summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2020-03-12 19:16:36 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2020-03-12 19:16:36 +0100
commitd26b4eb4c071f39d2ff262026608d26e7a56309d (patch)
treef8ed01ab17f186aa3e0175c143d5345def73dc2c
parent4ba36cfa0c677b7d094092d6aa5541c6c936a11f (diff)
parent51e9381dcc01ebd72d4f0adc057a64213f850d70 (diff)
downloadmariadb-git-d26b4eb4c071f39d2ff262026608d26e7a56309d.tar.gz
Pull new version from origin
-rw-r--r--.clang-format2
-rw-r--r--.gitignore2
-rw-r--r--VERSION2
-rw-r--r--client/mysql.cc6
-rw-r--r--client/mysqldump.c4
-rw-r--r--cmake/cpack_rpm.cmake13
-rw-r--r--cmake/dtrace.cmake5
-rw-r--r--cmake/install_layout.cmake32
-rw-r--r--cmake/install_macros.cmake87
-rw-r--r--cmake/os/WindowsCache.cmake1
-rw-r--r--cmake/plugin.cmake1
-rw-r--r--cmake/ssl.cmake1
-rw-r--r--config.h.cmake1
-rw-r--r--configure.cmake1
-rw-r--r--dbug/dbug.c149
-rw-r--r--debian/additions/innotop/innotop2
-rwxr-xr-xdebian/autobake-deb.sh1
-rw-r--r--debian/control9
-rw-r--r--debian/libmariadb-dev-compat.links3
-rw-r--r--debian/libmariadb-dev.install2
-rw-r--r--debian/libmariadb3.install1
-rw-r--r--debian/libmariadbd-dev.install4
-rw-r--r--debian/mariadb-plugin-rocksdb.install2
-rw-r--r--debian/mariadb-server-10.3.install4
-rw-r--r--debian/mariadb-test-data.install2
-rwxr-xr-xdebian/rules3
-rw-r--r--extra/innochecksum.cc4
-rw-r--r--extra/mariabackup/CMakeLists.txt2
-rw-r--r--extra/mariabackup/backup_copy.cc31
-rw-r--r--extra/mariabackup/innobackupex.cc11
-rw-r--r--extra/mariabackup/xtrabackup.cc57
-rw-r--r--extra/yassl/src/yassl_error.cpp4
-rw-r--r--extra/yassl/taocrypt/include/error.hpp4
-rw-r--r--extra/yassl/taocrypt/src/asn.cpp4
-rw-r--r--include/intrusive_list.h190
-rw-r--r--include/lf.h1
-rw-r--r--include/mysql/psi/mysql_file.h13
-rw-r--r--include/mysql/psi/mysql_idle.h13
-rw-r--r--include/mysql/psi/mysql_socket.h18
-rw-r--r--include/mysql/psi/mysql_stage.h13
-rw-r--r--include/mysql/psi/mysql_statement.h13
-rw-r--r--include/mysql/psi/mysql_table.h13
-rw-r--r--include/mysql/psi/mysql_thread.h13
-rw-r--r--include/mysql/psi/psi.h13
-rw-r--r--include/mysql/psi/psi_abi_v0.h13
-rw-r--r--include/mysql/psi/psi_abi_v1.h13
-rw-r--r--include/mysql/psi/psi_abi_v2.h13
-rw-r--r--include/sslopt-case.h2
-rw-r--r--man/CMakeLists.txt11
-rw-r--r--man/mysql-test-run.pl.16
-rw-r--r--mysql-test/include/binlog_inject_error.inc4
-rw-r--r--mysql-test/include/binlog_parallel_replication_marks.test2
-rw-r--r--mysql-test/include/partition_mrr.inc92
-rw-r--r--mysql-test/main/alter_user.result2
-rw-r--r--mysql-test/main/alter_user.test2
-rw-r--r--mysql-test/main/cache_temporal_4265.result3
-rw-r--r--mysql-test/main/cache_temporal_4265.test6
-rw-r--r--mysql-test/main/connect.result4
-rw-r--r--mysql-test/main/connect_debug.result10
-rw-r--r--mysql-test/main/connect_debug.test15
-rw-r--r--mysql-test/main/create.result2
-rw-r--r--mysql-test/main/create.test2
-rw-r--r--mysql-test/main/create_or_replace2.result4
-rw-r--r--mysql-test/main/create_or_replace2.test4
-rw-r--r--mysql-test/main/cte_nonrecursive.result18
-rw-r--r--mysql-test/main/cte_nonrecursive.test20
-rw-r--r--mysql-test/main/default_session.result28
-rw-r--r--mysql-test/main/default_session.test24
-rw-r--r--mysql-test/main/delete_use_source.result11
-rw-r--r--mysql-test/main/delete_use_source.test3
-rw-r--r--mysql-test/main/derived_cond_pushdown.result119
-rw-r--r--mysql-test/main/derived_cond_pushdown.test71
-rw-r--r--mysql-test/main/disabled.def2
-rw-r--r--mysql-test/main/drop_bad_db_type.result6
-rw-r--r--mysql-test/main/drop_bad_db_type.test6
-rw-r--r--mysql-test/main/engine_error_in_alter-8453.result5
-rw-r--r--mysql-test/main/engine_error_in_alter-8453.test5
-rw-r--r--mysql-test/main/error_simulation.result11
-rw-r--r--mysql-test/main/error_simulation.test11
-rw-r--r--mysql-test/main/events_bugs.result12
-rw-r--r--mysql-test/main/events_bugs.test4
-rw-r--r--mysql-test/main/events_grant.result6
-rw-r--r--mysql-test/main/events_restart.result27
-rw-r--r--mysql-test/main/events_restart.test31
-rw-r--r--mysql-test/main/fix_priv_tables.result16
-rw-r--r--mysql-test/main/foreign_key.result26
-rw-r--r--mysql-test/main/foreign_key.test24
-rw-r--r--mysql-test/main/func_misc.result13
-rw-r--r--mysql-test/main/func_misc.test15
-rw-r--r--mysql-test/main/func_regexp_pcre.result18
-rw-r--r--mysql-test/main/func_regexp_pcre.test8
-rw-r--r--mysql-test/main/func_regexp_pcre_debug.result3
-rw-r--r--mysql-test/main/func_regexp_pcre_debug.test3
-rw-r--r--mysql-test/main/func_time.result17
-rw-r--r--mysql-test/main/func_time.test8
-rw-r--r--mysql-test/main/grant.result564
-rw-r--r--mysql-test/main/grant2.result52
-rw-r--r--mysql-test/main/grant3.result16
-rw-r--r--mysql-test/main/grant5.result101
-rw-r--r--mysql-test/main/grant5.test50
-rw-r--r--mysql-test/main/grant_cache_no_prot.result14
-rw-r--r--mysql-test/main/grant_cache_ps_prot.result14
-rw-r--r--mysql-test/main/group_by.result16
-rw-r--r--mysql-test/main/group_by.test14
-rw-r--r--mysql-test/main/information_schema.result14
-rw-r--r--mysql-test/main/insert_debug-master.opt1
-rw-r--r--mysql-test/main/insert_debug.result29
-rw-r--r--mysql-test/main/insert_debug.test54
-rw-r--r--mysql-test/main/invisible_field_grant_completely.result2
-rw-r--r--mysql-test/main/invisible_field_grant_system.result2
-rw-r--r--mysql-test/main/ipv4_and_ipv6.result8
-rw-r--r--mysql-test/main/ipv4_as_ipv6.result24
-rw-r--r--mysql-test/main/ipv6.result12
-rw-r--r--mysql-test/main/join.result56
-rw-r--r--mysql-test/main/join.test65
-rw-r--r--mysql-test/main/join_cache.result72
-rw-r--r--mysql-test/main/join_cache.test40
-rw-r--r--mysql-test/main/locale.opt1
-rw-r--r--mysql-test/main/locale.result2
-rw-r--r--mysql-test/main/log_slow_debug.result4
-rw-r--r--mysql-test/main/log_slow_debug.test4
-rw-r--r--mysql-test/main/lowercase_table_grant.result8
-rw-r--r--mysql-test/main/mdev375.test2
-rw-r--r--mysql-test/main/mdev6830.result2
-rw-r--r--mysql-test/main/mdev6830.test4
-rw-r--r--mysql-test/main/merge-big.result2
-rw-r--r--mysql-test/main/merge-big.test2
-rw-r--r--mysql-test/main/merge_debug.result2
-rw-r--r--mysql-test/main/merge_debug.test2
-rw-r--r--mysql-test/main/myisam_debug.result4
-rw-r--r--mysql-test/main/myisam_debug.test4
-rw-r--r--mysql-test/main/mysql_client_test.test2
-rw-r--r--mysql-test/main/mysql_tzinfo_to_sql_symlink.result20
-rw-r--r--mysql-test/main/mysql_upgrade.result8
-rw-r--r--mysql-test/main/mysqlbinlog.result4
-rw-r--r--mysql-test/main/mysqld--defaults-file.result10
-rw-r--r--mysql-test/main/mysqld--defaults-file.test16
-rw-r--r--mysql-test/main/mysqld--help,win.rdiff34
-rw-r--r--mysql-test/main/mysqld--help.result6
-rw-r--r--mysql-test/main/no_password_column-mdev-11170.result30
-rw-r--r--mysql-test/main/opt_tvc.result53
-rw-r--r--mysql-test/main/opt_tvc.test31
-rw-r--r--mysql-test/main/order_by.result30
-rw-r--r--mysql-test/main/order_by.test16
-rw-r--r--mysql-test/main/partition_grant.result4
-rw-r--r--mysql-test/main/partition_innodb.result12
-rw-r--r--mysql-test/main/partition_innodb.test24
-rw-r--r--mysql-test/main/partition_mrr_aria.result157
-rw-r--r--mysql-test/main/partition_mrr_innodb.result157
-rw-r--r--mysql-test/main/partition_mrr_myisam.result213
-rw-r--r--mysql-test/main/partition_mrr_myisam.test59
-rw-r--r--mysql-test/main/partition_range.result44
-rw-r--r--mysql-test/main/partition_range.test46
-rw-r--r--mysql-test/main/plugin_auth.result6
-rw-r--r--mysql-test/main/ps_grant.result36
-rw-r--r--mysql-test/main/range_innodb.result3
-rw-r--r--mysql-test/main/range_innodb.test3
-rw-r--r--mysql-test/main/range_interrupted-13751.result4
-rw-r--r--mysql-test/main/range_interrupted-13751.test4
-rw-r--r--mysql-test/main/select_debug.result2
-rw-r--r--mysql-test/main/select_debug.test2
-rw-r--r--mysql-test/main/set_password.result2
-rw-r--r--mysql-test/main/show_create_user.result14
-rw-r--r--mysql-test/main/show_explain.result178
-rw-r--r--mysql-test/main/show_explain.test182
-rw-r--r--mysql-test/main/show_explain_non_select.result8
-rw-r--r--mysql-test/main/show_explain_non_select.test8
-rw-r--r--mysql-test/main/show_explain_ps.result5
-rw-r--r--mysql-test/main/show_explain_ps.test5
-rw-r--r--mysql-test/main/show_grants_with_plugin-7985.result60
-rw-r--r--mysql-test/main/skip_name_resolve.result4
-rw-r--r--mysql-test/main/slowlog_enospace-10508.result5
-rw-r--r--mysql-test/main/slowlog_enospace-10508.test5
-rw-r--r--mysql-test/main/sp-bugs.result2
-rw-r--r--mysql-test/main/sp-bugs.test2
-rw-r--r--mysql-test/main/sp-security.result36
-rw-r--r--mysql-test/main/sp-security.test2
-rw-r--r--mysql-test/main/sp_notembedded.result22
-rw-r--r--mysql-test/main/ssl_7937.test13
-rw-r--r--mysql-test/main/ssl_8k_key.test3
-rw-r--r--mysql-test/main/ssl_crl.test4
-rw-r--r--mysql-test/main/ssl_crl_clients.test14
-rw-r--r--mysql-test/main/ssl_system_ca,bad.result1
-rw-r--r--mysql-test/main/ssl_system_ca.combinations11
-rw-r--r--mysql-test/main/ssl_system_ca.result2
-rw-r--r--mysql-test/main/ssl_system_ca.test22
-rw-r--r--mysql-test/main/stat_tables-enospc.result5
-rw-r--r--mysql-test/main/stat_tables-enospc.test5
-rw-r--r--mysql-test/main/timezone_grant.result10
-rw-r--r--mysql-test/main/trigger_notembedded.result4
-rw-r--r--mysql-test/main/type_bit.test2
-rw-r--r--mysql-test/main/type_datetime.result81
-rw-r--r--mysql-test/main/type_datetime.test43
-rw-r--r--mysql-test/main/type_int.result13
-rw-r--r--mysql-test/main/type_int.test12
-rw-r--r--mysql-test/main/type_time.result66
-rw-r--r--mysql-test/main/type_time.test34
-rw-r--r--mysql-test/main/union_crash-714.result4
-rw-r--r--mysql-test/main/union_crash-714.test4
-rw-r--r--mysql-test/main/uniques_crash-7912.result11
-rw-r--r--mysql-test/main/uniques_crash-7912.test26
-rw-r--r--mysql-test/main/user_limits.result4
-rw-r--r--mysql-test/main/view_grant.result6
-rw-r--r--mysql-test/main/warnings_debug.result2
-rw-r--r--mysql-test/main/warnings_debug.test2
-rw-r--r--mysql-test/main/win.result90
-rw-r--r--mysql-test/main/win.test85
-rwxr-xr-xmysql-test/mysql-test-run.pl206
-rw-r--r--mysql-test/suite/binlog/include/binlog_index.inc4
-rw-r--r--mysql-test/suite/binlog/include/binlog_ioerr.inc3
-rw-r--r--mysql-test/suite/binlog/r/binlog_grant.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_index.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_invalid_read_in_rotate.result18
-rw-r--r--mysql-test/suite/binlog/r/binlog_ioerr.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_show_binlog_event_random_pos.result12
-rw-r--r--mysql-test/suite/binlog/r/binlog_write_error.result51
-rw-r--r--mysql-test/suite/binlog/t/binlog_invalid_read_in_rotate.combinations5
-rw-r--r--mysql-test/suite/binlog/t/binlog_invalid_read_in_rotate.test48
-rw-r--r--mysql-test/suite/binlog/t/binlog_show_binlog_event_random_pos.combinations5
-rw-r--r--mysql-test/suite/binlog/t/binlog_show_binlog_event_random_pos.test37
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_index.result3
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_ioerr.result3
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_write_error.result51
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum.result11
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_corruption.result9
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_incident.result2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_init_slave_errors.result3
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel.result18
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.result2
-rw-r--r--mysql-test/suite/compat/oracle/r/func_misc.result12
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-goto-debug.result236
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-goto.result79
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-security.result36
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-goto-debug.test178
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-goto.test98
-rw-r--r--mysql-test/suite/federated/federatedx.result16
-rw-r--r--mysql-test/suite/federated/federatedx.test21
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03.result116
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03e.result176
-rw-r--r--mysql-test/suite/funcs_1/r/is_basics_mixed.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_check_constraint.result121
-rw-r--r--mysql-test/suite/funcs_1/r/is_check_constraints.result235
-rw-r--r--mysql-test/suite/funcs_1/r/is_column_privileges.result64
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_schema_privileges.result32
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics.result32
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_privileges.result40
-rw-r--r--mysql-test/suite/funcs_1/r/is_triggers.result10
-rw-r--r--mysql-test/suite/funcs_1/r/is_user_privileges.result38
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03.result116
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03e.result172
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03.result116
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03e.result172
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result30
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_ps.result30
-rw-r--r--mysql-test/suite/funcs_1/t/is_check_constraint.test92
-rw-r--r--mysql-test/suite/funcs_1/t/is_check_constraints.test103
-rw-r--r--mysql-test/suite/funcs_1/views/views_master.inc2
-rw-r--r--mysql-test/suite/galera/disabled.def25
-rw-r--r--mysql-test/suite/galera/galera_2nodes.cnf11
-rw-r--r--mysql-test/suite/galera/galera_4nodes.cnf4
-rw-r--r--mysql-test/suite/galera/r/MW-284.result11
-rw-r--r--mysql-test/suite/galera/r/MW-328C.result23
-rw-r--r--mysql-test/suite/galera/r/MW-336.result52
-rw-r--r--mysql-test/suite/galera/r/MW-388.result4
-rw-r--r--mysql-test/suite/galera/r/MW-44.result13
-rw-r--r--mysql-test/suite/galera/r/galera_account_management.result65
-rw-r--r--mysql-test/suite/galera/r/galera_as_master_gtid.result59
-rw-r--r--mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result15
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave_ctas.result28
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result32
-rw-r--r--mysql-test/suite/galera/r/galera_as_slave_preordered.result19
-rw-r--r--mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result12
-rw-r--r--mysql-test/suite/galera/r/galera_events2.result1
-rw-r--r--mysql-test/suite/galera/r/galera_flush.result88
-rw-r--r--mysql-test/suite/galera/r/galera_forced_binlog_format.result10
-rw-r--r--mysql-test/suite/galera/r/galera_gtid.result10
-rw-r--r--mysql-test/suite/galera/r/galera_ist_restart_joiner.result1
-rw-r--r--mysql-test/suite/galera/r/galera_log_bin.result2
-rw-r--r--mysql-test/suite/galera/r/galera_migrate.result79
-rw-r--r--mysql-test/suite/galera/r/galera_partition.result424
-rw-r--r--mysql-test/suite/galera/r/galera_roles.result12
-rw-r--r--mysql-test/suite/galera/r/galera_rsu_add_pk.result24
-rw-r--r--mysql-test/suite/galera/r/galera_rsu_drop_pk.result50
-rw-r--r--mysql-test/suite/galera/r/galera_slave_replay.result95
-rw-r--r--mysql-test/suite/galera/r/galera_var_dirty_reads.result7
-rw-r--r--mysql-test/suite/galera/r/galera_var_notify_cmd.result19
-rw-r--r--mysql-test/suite/galera/r/galera_var_reject_queries.result5
-rw-r--r--mysql-test/suite/galera/r/lp1376747-4.result9
-rw-r--r--mysql-test/suite/galera/t/MW-284.test16
-rw-r--r--mysql-test/suite/galera/t/MW-313-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-313.cnf12
-rw-r--r--mysql-test/suite/galera/t/MW-328C.test36
-rw-r--r--mysql-test/suite/galera/t/MW-329-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-329.cnf9
-rw-r--r--mysql-test/suite/galera/t/MW-336.test68
-rw-r--r--mysql-test/suite/galera/t/MW-388.test8
-rw-r--r--mysql-test/suite/galera/t/MW-44-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-44.test30
-rw-r--r--mysql-test/suite/galera/t/MW-86-wait1-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-86-wait8-master.opt1
-rw-r--r--mysql-test/suite/galera/t/MW-86-wait8.cnf10
-rw-r--r--mysql-test/suite/galera/t/enforce_storage_engine2.cnf13
-rw-r--r--mysql-test/suite/galera/t/enforce_storage_engine2.opt2
-rw-r--r--mysql-test/suite/galera/t/galera_account_management.test99
-rw-r--r--mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf14
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_gtid.cnf8
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_gtid.test70
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf8
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test54
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_ctas.cnf5
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_ctas.test75
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.cnf6
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test66
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_preordered.test84
-rw-r--r--mysql-test/suite/galera/t/galera_bf_background_statistics.cnf9
-rw-r--r--mysql-test/suite/galera/t/galera_bf_background_statistics.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_checksum-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_checksum.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf9
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf9
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test28
-rw-r--r--mysql-test/suite/galera/t/galera_events2.test4
-rw-r--r--mysql-test/suite/galera/t/galera_flush-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_flush.test273
-rw-r--r--mysql-test/suite/galera/t/galera_flush_local.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_flush_local.opt3
-rw-r--r--mysql-test/suite/galera/t/galera_forced_binlog_format.test6
-rw-r--r--mysql-test/suite/galera/t/galera_gtid-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_gtid.cnf10
-rw-r--r--mysql-test/suite/galera/t/galera_gtid.test8
-rw-r--r--mysql-test/suite/galera/t/galera_load_data.cnf11
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin.cnf10
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin.test5
-rw-r--r--mysql-test/suite/galera/t/galera_mdev_13787.cnf9
-rw-r--r--mysql-test/suite/galera/t/galera_mdev_13787.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_migrate.cnf59
-rw-r--r--mysql-test/suite/galera/t/galera_migrate.test204
-rw-r--r--mysql-test/suite/galera/t/galera_partition.cnf18
-rw-r--r--mysql-test/suite/galera/t/galera_partition.test450
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache.cnf10
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf10
-rw-r--r--mysql-test/suite/galera/t/galera_rsu_add_pk.test14
-rw-r--r--mysql-test/suite/galera/t/galera_rsu_drop_pk.test28
-rw-r--r--mysql-test/suite/galera/t/galera_sbr_binlog-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_sbr_binlog.cnf7
-rw-r--r--mysql-test/suite/galera/t/galera_slave_replay.cnf (renamed from mysql-test/suite/galera/t/galera_as_slave_preordered.cnf)2
-rw-r--r--mysql-test/suite/galera/t/galera_slave_replay.test199
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_udf-master.opt2
-rw-r--r--mysql-test/suite/galera/t/galera_udf.cnf15
-rw-r--r--mysql-test/suite/galera/t/galera_v1_row_events-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_v1_row_events.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_var_dirty_reads.test9
-rw-r--r--mysql-test/suite/galera/t/galera_var_notify_cmd.test14
-rw-r--r--mysql-test/suite/galera/t/galera_var_reject_queries.test6
-rw-r--r--mysql-test/suite/galera/t/galera_var_sst_auth.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_var_sst_auth.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_wsrep_new_cluster.test26
-rw-r--r--mysql-test/suite/galera/t/lp1376747-4.test27
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#201-master.opt1
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#201.cnf9
-rw-r--r--mysql-test/suite/galera/t/query_cache.cnf9
-rw-r--r--mysql-test/suite/galera/t/query_cache.opt1
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result3
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test5
-rw-r--r--mysql-test/suite/innodb/r/blob-update-debug.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-32k-crash.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-64k-crash.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-blob.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb-mdev-7513.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-replace-debug.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-stats-initialize-failure.result3
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522-1.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug11754376.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug30113362.result119
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56947.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_corrupt_bit.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result3
-rw-r--r--mysql-test/suite/innodb/r/innodb_wl6326.result371
-rw-r--r--mysql-test/suite/innodb/r/innodb_wl6326_big.result449
-rw-r--r--mysql-test/suite/innodb/r/instant_alter,4k.rdiff60
-rw-r--r--mysql-test/suite/innodb/r/instant_alter.result23
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_bugs.result1
-rw-r--r--mysql-test/suite/innodb/r/redo_log_during_checkpoint.result6
-rw-r--r--mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result45
-rw-r--r--mysql-test/suite/innodb/r/undo_log.result1
-rw-r--r--mysql-test/suite/innodb/t/blob-update-debug.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k-crash.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k-crash.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-blob.test7
-rw-r--r--mysql-test/suite/innodb/t/innodb-mdev-7513.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-replace-debug.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug11754376.test3
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug30113362.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug30113362.test242
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56947.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_corrupt_bit.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test3
-rw-r--r--mysql-test/suite/innodb/t/innodb_wl6326.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_wl6326.test506
-rw-r--r--mysql-test/suite/innodb/t/innodb_wl6326_big.test716
-rw-r--r--mysql-test/suite/innodb/t/instant_alter.test12
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_bugs.test2
-rw-r--r--mysql-test/suite/innodb/t/redo_log_during_checkpoint.test6
-rw-r--r--mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test32
-rw-r--r--mysql-test/suite/innodb/t/undo_log.test2
-rw-r--r--mysql-test/suite/innodb_fts/r/concurrent_insert.result3
-rw-r--r--mysql-test/suite/innodb_fts/r/misc_debug.result9
-rw-r--r--mysql-test/suite/innodb_fts/r/misc_debug2.result7
-rw-r--r--mysql-test/suite/innodb_fts/r/sync_block.result4
-rw-r--r--mysql-test/suite/innodb_fts/t/concurrent_insert.test3
-rw-r--r--mysql-test/suite/innodb_fts/t/misc_debug.test13
-rw-r--r--mysql-test/suite/innodb_fts/t/misc_debug2.test12
-rw-r--r--mysql-test/suite/innodb_fts/t/sync_block.test4
-rw-r--r--mysql-test/suite/innodb_gis/r/rtree_debug.result2
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_debug.test2
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_rollback1.test3
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_rollback2.test3
-rw-r--r--mysql-test/suite/innodb_zip/r/cmp_per_index.result33
-rw-r--r--mysql-test/suite/innodb_zip/r/wl5522_zip.result2
-rw-r--r--mysql-test/suite/innodb_zip/t/cmp_per_index.test30
-rw-r--r--mysql-test/suite/maria/aria_pack_mdev14183.result22
-rw-r--r--mysql-test/suite/maria/aria_pack_mdev14183.test23
-rw-r--r--mysql-test/suite/mariabackup/incremental_backup.result4
-rw-r--r--mysql-test/suite/mariabackup/incremental_backup.test63
-rw-r--r--mysql-test/suite/mariabackup/innodb_redo_log_overwrite.opt1
-rw-r--r--mysql-test/suite/mariabackup/innodb_redo_log_overwrite.result2
-rw-r--r--mysql-test/suite/mariabackup/innodb_redo_log_overwrite.test20
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug36981.result2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug40992.result2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug41996.result2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug43249.result2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug43360.result2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug43448.result2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug36981.test2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug40992.test2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug41996.test2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug43360.test2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug43617.test3
-rw-r--r--mysql-test/suite/parts/r/partition_debug.result4
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result12
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result12
-rw-r--r--mysql-test/suite/parts/r/partition_exch_qa_6.result16
-rw-r--r--mysql-test/suite/parts/t/partition_debug.test4
-rw-r--r--mysql-test/suite/parts/t/partition_debug_innodb.test4
-rw-r--r--mysql-test/suite/perfschema/r/column_privilege.result2
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_format.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result3
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_peer_addr.result3
-rw-r--r--mysql-test/suite/perfschema/r/privilege.result2
-rw-r--r--mysql-test/suite/perfschema/r/read_only.result12
-rw-r--r--mysql-test/suite/perfschema/t/ddl_esms_by_digest.test13
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_digest.test13
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_format.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test4
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test4
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test3
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_peer_addr.test3
-rw-r--r--mysql-test/suite/plugins/r/auth_ed25519.result2
-rw-r--r--mysql-test/suite/plugins/r/server_audit.result26
-rw-r--r--mysql-test/suite/plugins/t/server_audit.test20
-rw-r--r--mysql-test/suite/roles/admin.result92
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.result6
-rw-r--r--mysql-test/suite/roles/create_and_grant_role.result8
-rw-r--r--mysql-test/suite/roles/definer.result10
-rw-r--r--mysql-test/suite/roles/drop_routines.result64
-rw-r--r--mysql-test/suite/roles/flush_roles-17898.result14
-rw-r--r--mysql-test/suite/roles/grant-5771.result14
-rw-r--r--mysql-test/suite/roles/grant_empty.result4
-rw-r--r--mysql-test/suite/roles/grant_proxy-5526.result2
-rw-r--r--mysql-test/suite/roles/grant_revoke_current.result20
-rw-r--r--mysql-test/suite/roles/ip-6401.result4
-rw-r--r--mysql-test/suite/roles/prepare_stmt_with_role.result26
-rw-r--r--mysql-test/suite/roles/rebuild_role_grants.result18
-rw-r--r--mysql-test/suite/roles/recursive.result224
-rw-r--r--mysql-test/suite/roles/recursive_dbug.result224
-rw-r--r--mysql-test/suite/roles/revoke_all.result204
-rw-r--r--mysql-test/suite/roles/role_case_sensitive-10744.result10
-rw-r--r--mysql-test/suite/roles/rpl_definer.result28
-rw-r--r--mysql-test/suite/roles/set_and_drop.result8
-rw-r--r--mysql-test/suite/roles/set_default_role_clear.result10
-rw-r--r--mysql-test/suite/roles/set_default_role_for.result18
-rw-r--r--mysql-test/suite/roles/set_default_role_invalid.result10
-rw-r--r--mysql-test/suite/roles/set_default_role_new_connection.result20
-rw-r--r--mysql-test/suite/roles/set_role-13655.result22
-rw-r--r--mysql-test/suite/roles/set_role-9614.result20
-rw-r--r--mysql-test/suite/roles/set_role-database-recursive.result24
-rw-r--r--mysql-test/suite/roles/set_role-multiple-role.result52
-rw-r--r--mysql-test/suite/roles/set_role-recursive.result64
-rw-r--r--mysql-test/suite/roles/set_role-routine-simple.result38
-rw-r--r--mysql-test/suite/roles/set_role-simple.result12
-rw-r--r--mysql-test/suite/roles/set_role-table-column-priv.result28
-rw-r--r--mysql-test/suite/roles/set_role-table-simple.result28
-rw-r--r--mysql-test/suite/roles/show_grants.result92
-rw-r--r--mysql-test/suite/roles/show_grants_replicated.result18
-rw-r--r--mysql-test/suite/rpl/include/rpl_checksum.inc12
-rw-r--r--mysql-test/suite/rpl/include/rpl_corruption.inc9
-rw-r--r--mysql-test/suite/rpl/include/rpl_incident.inc6
-rw-r--r--mysql-test/suite/rpl/include/rpl_init_slave_errors.inc3
-rw-r--r--mysql-test/suite/rpl/include/rpl_parallel.inc20
-rw-r--r--mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_stop_middle_group.test4
-rw-r--r--mysql-test/suite/rpl/r/circular_serverid0.result2
-rw-r--r--mysql-test/suite/rpl/r/kill_race_condition.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_grant.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_rollback_cleanup.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug33931.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug41902.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_corruption.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result58
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_reconnect.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_debug.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_grant.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result66
-rw-r--r--mysql-test/suite/rpl/r/rpl_incident.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave_errors.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev-11092.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_big_table_id.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_find_row_debug.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_skip_repl.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_show_slave_running.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_stop_slave.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_view_debug.result2
-rw-r--r--mysql-test/suite/rpl/t/circular_serverid0.test3
-rw-r--r--mysql-test/suite/rpl/t/kill_race_condition.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_rollback_cleanup.test46
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug33931.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug41902.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_reconnect.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_debug.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev-11092.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_optimistic.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_big_table_id.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_find_row_debug.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_index_choice.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_show_slave_running.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stop_slave.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_view_debug.test3
-rw-r--r--mysql-test/suite/sql_sequence/rebuild.result161
-rw-r--r--mysql-test/suite/sql_sequence/rebuild.test20
-rw-r--r--mysql-test/suite/sql_sequence/view.result10
-rw-r--r--mysql-test/suite/sql_sequence/view.test11
-rw-r--r--mysql-test/suite/sys_vars/r/debug_dbug_func.result50
-rw-r--r--mysql-test/suite/sys_vars/r/host_cache_size_auto.result2
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result2
-rw-r--r--mysql-test/suite/sys_vars/t/debug_dbug_func.test36
-rw-r--r--mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/init_connect_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/init_slave_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_basic.test2
-rw-r--r--mysql-test/suite/versioning/r/alter.result4
-rw-r--r--mysql-test/suite/versioning/r/delete.result20
-rw-r--r--mysql-test/suite/versioning/r/delete_history.result (renamed from mysql-test/suite/versioning/r/truncate.result)0
-rw-r--r--mysql-test/suite/versioning/r/partition.result48
-rw-r--r--mysql-test/suite/versioning/r/select.result39
-rw-r--r--mysql-test/suite/versioning/r/sysvars.result16
-rw-r--r--mysql-test/suite/versioning/r/truncate_privilege.result14
-rw-r--r--mysql-test/suite/versioning/r/trx_id.result22
-rw-r--r--mysql-test/suite/versioning/r/update.result36
-rw-r--r--mysql-test/suite/versioning/r/view.result146
-rw-r--r--mysql-test/suite/versioning/t/delete.test25
-rw-r--r--mysql-test/suite/versioning/t/delete_history.test (renamed from mysql-test/suite/versioning/t/truncate.test)0
-rw-r--r--mysql-test/suite/versioning/t/partition.test50
-rw-r--r--mysql-test/suite/versioning/t/select.test44
-rw-r--r--mysql-test/suite/versioning/t/sysvars.test16
-rw-r--r--mysql-test/suite/versioning/t/trx_id.test27
-rw-r--r--mysql-test/suite/versioning/t/update.test45
-rw-r--r--mysql-test/suite/versioning/t/view.test103
-rw-r--r--mysql-test/suite/wsrep/disabled.def2
-rw-r--r--mysql-test/suite/wsrep/my.cnf4
-rw-r--r--mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result16
-rw-r--r--mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result8
-rw-r--r--mysql-test/suite/wsrep/r/variables.result9
-rw-r--r--mysql-test/suite/wsrep/t/alter_table_innodb.cnf12
-rw-r--r--mysql-test/suite/wsrep/t/alter_table_innodb.opt1
-rw-r--r--mysql-test/suite/wsrep/t/binlog_format.opt2
-rw-r--r--mysql-test/suite/wsrep/t/mdev_10186.cnf15
-rw-r--r--mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt (renamed from mysql-test/suite/wsrep/t/mdev_10186.opt)4
-rw-r--r--mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test1
-rw-r--r--mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt3
-rw-r--r--mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test1
-rw-r--r--mysql-test/suite/wsrep/t/pool_of_threads.opt2
-rw-r--r--mysql-test/suite/wsrep/t/variables.test4
-rw-r--r--mysql-test/unstable-tests990
-rw-r--r--mysys/CMakeLists.txt4
-rw-r--r--mysys/lf_alloc-pin.c14
-rw-r--r--mysys/my_addr_resolve.c12
-rw-r--r--mysys/my_default.c10
-rw-r--r--mysys/my_getncpus.c43
-rw-r--r--pcre/ChangeLog2
-rw-r--r--pcre/doc/html/pcredemo.html4
-rw-r--r--pcre/doc/html/pcrejit.html2
-rw-r--r--pcre/doc/pcre.txt2
-rw-r--r--pcre/doc/pcredemo.34
-rw-r--r--pcre/doc/pcrejit.32
-rw-r--r--pcre/pcre_compile.c2
-rw-r--r--pcre/pcre_internal.h2
-rw-r--r--pcre/pcredemo.c4
-rw-r--r--plugin/auth_pam/CMakeLists.txt24
-rw-r--r--plugin/auth_pam/mapper/pam_user_map.c30
-rw-r--r--plugin/auth_pam/mapper/user_map.conf13
-rw-r--r--plugin/win_auth_client/CMakeLists.txt3
-rw-r--r--plugin/wsrep_info/mysql-test/wsrep_info/my.cnf2
-rw-r--r--scripts/mysql_install_db.sh2
-rw-r--r--scripts/mysql_system_tables_data.sql2
-rw-r--r--scripts/mysqlhotcopy.sh2
-rw-r--r--[-rwxr-xr-x]scripts/wsrep_sst_common.sh0
-rw-r--r--scripts/wsrep_sst_mariabackup.sh4
-rw-r--r--sql-bench/bench-init.pl.sh2
-rw-r--r--sql-common/client.c7
-rw-r--r--sql/CMakeLists.txt19
-rw-r--r--sql/derror.cc79
-rw-r--r--sql/events.cc8
-rw-r--r--sql/filesort.cc1
-rw-r--r--sql/ha_partition.cc30
-rw-r--r--sql/ha_partition.h92
-rw-r--r--sql/ha_sequence.cc2
-rw-r--r--sql/handler.cc3
-rw-r--r--sql/handler.h4
-rw-r--r--sql/item.cc57
-rw-r--r--sql/item.h9
-rw-r--r--sql/item_cmpfunc.cc2
-rw-r--r--sql/item_cmpfunc.h3
-rw-r--r--sql/item_func.cc3
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_sum.cc22
-rw-r--r--sql/item_sum.h97
-rw-r--r--sql/item_timefunc.cc16
-rw-r--r--sql/item_timefunc.h47
-rw-r--r--sql/item_windowfunc.h164
-rw-r--r--sql/lex.h2
-rw-r--r--sql/log.cc37
-rw-r--r--sql/log.h15
-rw-r--r--sql/log_event.cc107
-rw-r--r--sql/log_event.h15
-rw-r--r--sql/log_event_old.cc4
-rw-r--r--sql/my_decimal.cc4
-rw-r--r--sql/my_decimal.h2
-rw-r--r--sql/mysql_upgrade_service.cc2
-rw-r--r--sql/mysqld.cc18
-rw-r--r--sql/mysqld.h3
-rw-r--r--sql/opt_index_cond_pushdown.cc15
-rw-r--r--sql/opt_range.cc2
-rw-r--r--sql/opt_split.cc11
-rw-r--r--sql/opt_subselect.cc9
-rw-r--r--sql/proxy_protocol.cc2
-rw-r--r--sql/rpl_mi.cc2
-rw-r--r--sql/session_tracker.cc4
-rw-r--r--sql/share/errmsg-utf8.txt4
-rw-r--r--sql/slave.cc66
-rw-r--r--sql/sp.cc2
-rw-r--r--sql/sp_cache.cc2
-rw-r--r--sql/sp_head.cc97
-rw-r--r--sql/sp_head.h25
-rw-r--r--sql/sql_acl.cc89
-rw-r--r--sql/sql_admin.cc2
-rw-r--r--sql/sql_audit.h22
-rw-r--r--sql/sql_db.cc4
-rw-r--r--sql/sql_delete.cc61
-rw-r--r--sql/sql_derived.cc34
-rw-r--r--sql/sql_insert.cc62
-rw-r--r--sql/sql_join_cache.cc2
-rw-r--r--sql/sql_lex.cc13
-rw-r--r--sql/sql_lex.h22
-rw-r--r--sql/sql_parse.cc10
-rw-r--r--sql/sql_partition.cc26
-rw-r--r--sql/sql_prepare.cc2
-rw-r--r--sql/sql_repl.cc27
-rw-r--r--sql/sql_select.cc225
-rw-r--r--sql/sql_select.h1
-rw-r--r--sql/sql_sequence.cc7
-rw-r--r--sql/sql_servers.cc4
-rw-r--r--sql/sql_show.cc55
-rw-r--r--sql/sql_table.cc54
-rw-r--r--sql/sql_trigger.cc2
-rw-r--r--sql/sql_tvc.cc56
-rw-r--r--sql/sql_type.h14
-rw-r--r--sql/sql_union.cc16
-rw-r--r--sql/sql_update.cc37
-rw-r--r--sql/sql_window.cc6
-rw-r--r--sql/sql_yacc.yy6
-rw-r--r--sql/sql_yacc_ora.yy4
-rw-r--r--sql/sys_vars.cc2
-rw-r--r--sql/sys_vars.ic4
-rw-r--r--sql/table.cc20
-rw-r--r--sql/table.h30
-rw-r--r--sql/temporary_tables.cc7
-rw-r--r--sql/threadpool_common.cc2
-rw-r--r--sql/threadpool_generic.cc2
-rw-r--r--sql/tztime.cc10
-rw-r--r--sql/uniques.h12
-rw-r--r--sql/unireg.cc3
-rw-r--r--sql/wsrep_hton.cc26
-rw-r--r--sql/wsrep_mysqld.cc43
-rw-r--r--sql/wsrep_thd.cc57
-rw-r--r--sql/wsrep_thd.h2
-rw-r--r--sql/wsrep_var.cc10
-rw-r--r--storage/connect/CMakeLists.txt11
-rw-r--r--storage/connect/connect.cc64
-rw-r--r--storage/connect/connect.h2
-rw-r--r--storage/connect/filamzip.cpp2
-rw-r--r--storage/connect/filter.h1
-rw-r--r--storage/connect/ha_connect.cc44
-rw-r--r--storage/connect/javaconn.cpp2
-rw-r--r--storage/connect/mycat.cc115
-rw-r--r--storage/connect/mycat.h4
-rw-r--r--storage/connect/myconn.cpp10
-rw-r--r--storage/connect/mysql-test/connect/disabled.def1
-rw-r--r--storage/connect/mysql-test/connect/t/ini_grant.result89
-rw-r--r--storage/connect/plgdbsem.h29
-rw-r--r--storage/connect/reldef.cpp278
-rw-r--r--storage/connect/reldef.h9
-rw-r--r--storage/connect/restget.cpp42
-rw-r--r--storage/connect/tabcmg.cpp23
-rw-r--r--storage/connect/tabdos.cpp23
-rw-r--r--storage/connect/tabdos.h1
-rw-r--r--storage/connect/tabfix.cpp2
-rw-r--r--storage/connect/tabfmt.cpp5
-rw-r--r--storage/connect/tabjson.cpp44
-rw-r--r--storage/connect/tabmysql.cpp9
-rw-r--r--storage/connect/tabrest.cpp142
-rw-r--r--storage/connect/tabrest.h21
-rw-r--r--storage/connect/tabutil.cpp16
-rw-r--r--storage/connect/tabutil.h3
-rw-r--r--storage/connect/tabvct.cpp3
-rw-r--r--storage/connect/xindex.cpp14
-rw-r--r--storage/connect/xtable.h5
-rw-r--r--storage/example/ha_example.cc4
-rw-r--r--storage/federatedx/AUTHORS2
-rw-r--r--storage/federatedx/ha_federatedx.cc7
-rw-r--r--storage/innobase/btr/btr0btr.cc54
-rw-r--r--storage/innobase/btr/btr0bulk.cc14
-rw-r--r--storage/innobase/btr/btr0cur.cc314
-rw-r--r--storage/innobase/btr/btr0defragment.cc4
-rw-r--r--storage/innobase/btr/btr0pcur.cc17
-rw-r--r--storage/innobase/btr/btr0scrub.cc2
-rw-r--r--storage/innobase/btr/btr0sea.cc24
-rw-r--r--storage/innobase/buf/buf0buf.cc33
-rw-r--r--storage/innobase/buf/buf0dblwr.cc4
-rw-r--r--storage/innobase/buf/buf0lru.cc8
-rw-r--r--storage/innobase/dict/dict0crea.cc43
-rw-r--r--storage/innobase/dict/dict0dict.cc7
-rw-r--r--storage/innobase/dict/dict0mem.cc6
-rw-r--r--storage/innobase/dict/dict0stats.cc76
-rw-r--r--storage/innobase/eval/eval0eval.cc295
-rw-r--r--storage/innobase/fil/fil0crypt.cc51
-rw-r--r--storage/innobase/fil/fil0fil.cc133
-rw-r--r--storage/innobase/fts/fts0fts.cc12
-rw-r--r--storage/innobase/fts/fts0opt.cc2
-rw-r--r--storage/innobase/gis/gis0geo.cc55
-rw-r--r--storage/innobase/gis/gis0rtree.cc69
-rw-r--r--storage/innobase/gis/gis0sea.cc32
-rw-r--r--storage/innobase/handler/ha_innodb.cc59
-rw-r--r--storage/innobase/handler/ha_innodb.h8
-rw-r--r--storage/innobase/handler/handler0alter.cc32
-rw-r--r--storage/innobase/handler/i_s.cc23
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc14
-rw-r--r--storage/innobase/include/btr0btr.h7
-rw-r--r--storage/innobase/include/btr0btr.ic2
-rw-r--r--storage/innobase/include/btr0bulk.h5
-rw-r--r--storage/innobase/include/btr0cur.h41
-rw-r--r--storage/innobase/include/buf0buf.h21
-rw-r--r--storage/innobase/include/buf0buf.ic12
-rw-r--r--storage/innobase/include/dict0crea.h10
-rw-r--r--storage/innobase/include/dict0mem.h12
-rw-r--r--storage/innobase/include/dyn0buf.h96
-rw-r--r--storage/innobase/include/fil0fil.h25
-rw-r--r--storage/innobase/include/fil0fil.ic2
-rw-r--r--storage/innobase/include/gis0geo.h13
-rw-r--r--storage/innobase/include/gis0rtree.h21
-rw-r--r--storage/innobase/include/gis0rtree.ic2
-rw-r--r--storage/innobase/include/handler0alter.h4
-rw-r--r--storage/innobase/include/hash0hash.h12
-rw-r--r--storage/innobase/include/lock0lock.h12
-rw-r--r--storage/innobase/include/lock0priv.h3
-rw-r--r--storage/innobase/include/lock0priv.ic2
-rw-r--r--storage/innobase/include/log0recv.h15
-rw-r--r--storage/innobase/include/mem0mem.h11
-rw-r--r--storage/innobase/include/mem0mem.ic28
-rw-r--r--storage/innobase/include/mtr0log.h8
-rw-r--r--storage/innobase/include/mtr0log.ic27
-rw-r--r--storage/innobase/include/page0cur.h15
-rw-r--r--storage/innobase/include/page0cur.ic4
-rw-r--r--storage/innobase/include/page0page.h27
-rw-r--r--storage/innobase/include/page0page.ic27
-rw-r--r--storage/innobase/include/page0types.h3
-rw-r--r--storage/innobase/include/page0zip.h9
-rw-r--r--storage/innobase/include/pars0grm.h158
-rw-r--r--storage/innobase/include/pars0pars.h35
-rw-r--r--storage/innobase/include/rem0cmp.h68
-rw-r--r--storage/innobase/include/rem0cmp.ic35
-rw-r--r--storage/innobase/include/rem0rec.h209
-rw-r--r--storage/innobase/include/rem0rec.ic79
-rw-r--r--storage/innobase/include/rem0types.h4
-rw-r--r--storage/innobase/include/row0ftsort.h3
-rw-r--r--storage/innobase/include/row0log.h8
-rw-r--r--storage/innobase/include/row0merge.h2
-rw-r--r--storage/innobase/include/row0row.h24
-rw-r--r--storage/innobase/include/row0row.ic8
-rw-r--r--storage/innobase/include/row0upd.h13
-rw-r--r--storage/innobase/include/row0upd.ic2
-rw-r--r--storage/innobase/include/row0vers.h6
-rw-r--r--storage/innobase/include/trx0rec.h4
-rw-r--r--storage/innobase/include/trx0trx.h9
-rw-r--r--storage/innobase/include/univ.i2
-rw-r--r--storage/innobase/include/ut0rnd.h69
-rw-r--r--storage/innobase/include/ut0rnd.ic70
-rw-r--r--storage/innobase/innodb.cmake8
-rw-r--r--storage/innobase/lock/lock0lock.cc38
-rw-r--r--storage/innobase/log/log0recv.cc138
-rw-r--r--storage/innobase/mem/mem0mem.cc9
-rw-r--r--storage/innobase/os/os0file.cc122
-rw-r--r--storage/innobase/os/os0proc.cc6
-rw-r--r--storage/innobase/os/os0thread.cc10
-rw-r--r--storage/innobase/page/page0cur.cc99
-rw-r--r--storage/innobase/page/page0page.cc42
-rw-r--r--storage/innobase/page/page0zip.cc61
-rw-r--r--storage/innobase/pars/lexyy.cc1166
-rw-r--r--storage/innobase/pars/pars0grm.cc2116
-rw-r--r--storage/innobase/pars/pars0grm.y118
-rw-r--r--storage/innobase/pars/pars0lex.l84
-rw-r--r--storage/innobase/pars/pars0pars.cc144
-rw-r--r--storage/innobase/rem/rem0cmp.cc113
-rw-r--r--storage/innobase/rem/rem0rec.cc155
-rw-r--r--storage/innobase/row/row0ftsort.cc23
-rw-r--r--storage/innobase/row/row0import.cc163
-rw-r--r--storage/innobase/row/row0ins.cc40
-rw-r--r--storage/innobase/row/row0log.cc55
-rw-r--r--storage/innobase/row/row0merge.cc63
-rw-r--r--storage/innobase/row/row0mysql.cc34
-rw-r--r--storage/innobase/row/row0purge.cc10
-rw-r--r--storage/innobase/row/row0row.cc45
-rw-r--r--storage/innobase/row/row0sel.cc70
-rw-r--r--storage/innobase/row/row0uins.cc2
-rw-r--r--storage/innobase/row/row0umod.cc16
-rw-r--r--storage/innobase/row/row0undo.cc4
-rw-r--r--storage/innobase/row/row0upd.cc58
-rw-r--r--storage/innobase/row/row0vers.cc35
-rw-r--r--storage/innobase/srv/srv0mon.cc2
-rw-r--r--storage/innobase/srv/srv0srv.cc6
-rw-r--r--storage/innobase/sync/sync0debug.cc2
-rw-r--r--storage/innobase/trx/trx0i_s.cc6
-rw-r--r--storage/innobase/trx/trx0rec.cc23
-rw-r--r--storage/innobase/trx/trx0undo.cc4
-rw-r--r--storage/innobase/ut/ut0rnd.cc7
-rw-r--r--storage/maria/ha_maria.cc2
-rw-r--r--storage/maria/ma_check.c2
-rw-r--r--storage/maria/ma_close.c2
-rw-r--r--storage/maria/ma_page.c2
-rw-r--r--storage/maria/maria_pack.c16
-rw-r--r--storage/maria/trnman.c2
-rw-r--r--storage/myisam/ha_myisam.cc2
-rw-r--r--storage/perfschema/CMakeLists.txt15
-rw-r--r--storage/perfschema/cursor_by_account.cc13
-rw-r--r--storage/perfschema/cursor_by_account.h13
-rw-r--r--storage/perfschema/cursor_by_host.cc13
-rw-r--r--storage/perfschema/cursor_by_host.h13
-rw-r--r--storage/perfschema/cursor_by_thread.cc13
-rw-r--r--storage/perfschema/cursor_by_thread.h13
-rw-r--r--storage/perfschema/cursor_by_thread_connect_attr.cc13
-rw-r--r--storage/perfschema/cursor_by_thread_connect_attr.h13
-rw-r--r--storage/perfschema/cursor_by_user.cc13
-rw-r--r--storage/perfschema/cursor_by_user.h13
-rw-r--r--storage/perfschema/gen_pfs_lex_token.cc13
-rw-r--r--storage/perfschema/ha_perfschema.cc13
-rw-r--r--storage/perfschema/ha_perfschema.h13
-rw-r--r--storage/perfschema/pfs.cc13
-rw-r--r--storage/perfschema/pfs.h13
-rw-r--r--storage/perfschema/pfs_account.cc13
-rw-r--r--storage/perfschema/pfs_account.h13
-rw-r--r--storage/perfschema/pfs_atomic.h13
-rw-r--r--storage/perfschema/pfs_autosize.cc13
-rw-r--r--storage/perfschema/pfs_column_types.h13
-rw-r--r--storage/perfschema/pfs_column_values.cc13
-rw-r--r--storage/perfschema/pfs_column_values.h13
-rw-r--r--storage/perfschema/pfs_con_slice.cc13
-rw-r--r--storage/perfschema/pfs_con_slice.h13
-rw-r--r--storage/perfschema/pfs_defaults.cc13
-rw-r--r--storage/perfschema/pfs_defaults.h13
-rw-r--r--storage/perfschema/pfs_digest.cc13
-rw-r--r--storage/perfschema/pfs_digest.h13
-rw-r--r--storage/perfschema/pfs_engine_table.cc13
-rw-r--r--storage/perfschema/pfs_engine_table.h13
-rw-r--r--storage/perfschema/pfs_events.h13
-rw-r--r--storage/perfschema/pfs_events_stages.cc13
-rw-r--r--storage/perfschema/pfs_events_stages.h13
-rw-r--r--storage/perfschema/pfs_events_statements.cc13
-rw-r--r--storage/perfschema/pfs_events_statements.h13
-rw-r--r--storage/perfschema/pfs_events_waits.cc13
-rw-r--r--storage/perfschema/pfs_events_waits.h13
-rw-r--r--storage/perfschema/pfs_global.cc13
-rw-r--r--storage/perfschema/pfs_global.h13
-rw-r--r--storage/perfschema/pfs_host.cc13
-rw-r--r--storage/perfschema/pfs_host.h13
-rw-r--r--storage/perfschema/pfs_instr.cc13
-rw-r--r--storage/perfschema/pfs_instr.h13
-rw-r--r--storage/perfschema/pfs_instr_class.cc13
-rw-r--r--storage/perfschema/pfs_instr_class.h13
-rw-r--r--storage/perfschema/pfs_lock.h13
-rw-r--r--storage/perfschema/pfs_server.cc13
-rw-r--r--storage/perfschema/pfs_server.h13
-rw-r--r--storage/perfschema/pfs_setup_actor.cc13
-rw-r--r--storage/perfschema/pfs_setup_actor.h13
-rw-r--r--storage/perfschema/pfs_setup_object.cc13
-rw-r--r--storage/perfschema/pfs_setup_object.h13
-rw-r--r--storage/perfschema/pfs_stat.h13
-rw-r--r--storage/perfschema/pfs_timer.cc13
-rw-r--r--storage/perfschema/pfs_timer.h15
-rw-r--r--storage/perfschema/pfs_user.cc13
-rw-r--r--storage/perfschema/pfs_user.h13
-rw-r--r--storage/perfschema/pfs_visitor.cc13
-rw-r--r--storage/perfschema/pfs_visitor.h13
-rw-r--r--storage/perfschema/table_accounts.cc13
-rw-r--r--storage/perfschema/table_accounts.h13
-rw-r--r--storage/perfschema/table_all_instr.cc13
-rw-r--r--storage/perfschema/table_all_instr.h13
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.h13
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.h13
-rw-r--r--storage/perfschema/table_esgs_by_thread_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esgs_by_thread_by_event_name.h13
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.h13
-rw-r--r--storage/perfschema/table_esgs_global_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esgs_global_by_event_name.h13
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.h13
-rw-r--r--storage/perfschema/table_esms_by_digest.cc13
-rw-r--r--storage/perfschema/table_esms_by_digest.h13
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.h13
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.h13
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.h13
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.cc13
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.h13
-rw-r--r--storage/perfschema/table_events_stages.cc13
-rw-r--r--storage/perfschema/table_events_stages.h13
-rw-r--r--storage/perfschema/table_events_statements.cc13
-rw-r--r--storage/perfschema/table_events_statements.h13
-rw-r--r--storage/perfschema/table_events_waits.cc13
-rw-r--r--storage/perfschema/table_events_waits.h13
-rw-r--r--storage/perfschema/table_events_waits_summary.cc13
-rw-r--r--storage/perfschema/table_events_waits_summary.h13
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.cc13
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.h13
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.cc13
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.h13
-rw-r--r--storage/perfschema/table_ews_by_thread_by_event_name.cc13
-rw-r--r--storage/perfschema/table_ews_by_thread_by_event_name.h13
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.cc13
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.h13
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.cc13
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.h13
-rw-r--r--storage/perfschema/table_file_instances.cc13
-rw-r--r--storage/perfschema/table_file_instances.h13
-rw-r--r--storage/perfschema/table_file_summary_by_event_name.cc13
-rw-r--r--storage/perfschema/table_file_summary_by_event_name.h13
-rw-r--r--storage/perfschema/table_file_summary_by_instance.cc13
-rw-r--r--storage/perfschema/table_file_summary_by_instance.h13
-rw-r--r--storage/perfschema/table_helper.cc13
-rw-r--r--storage/perfschema/table_helper.h13
-rw-r--r--storage/perfschema/table_host_cache.cc13
-rw-r--r--storage/perfschema/table_host_cache.h13
-rw-r--r--storage/perfschema/table_hosts.cc13
-rw-r--r--storage/perfschema/table_hosts.h13
-rw-r--r--storage/perfschema/table_os_global_by_type.cc13
-rw-r--r--storage/perfschema/table_os_global_by_type.h13
-rw-r--r--storage/perfschema/table_performance_timers.cc13
-rw-r--r--storage/perfschema/table_performance_timers.h13
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.cc13
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.h13
-rw-r--r--storage/perfschema/table_session_connect.cc13
-rw-r--r--storage/perfschema/table_session_connect.h13
-rw-r--r--storage/perfschema/table_session_connect_attrs.cc13
-rw-r--r--storage/perfschema/table_session_connect_attrs.h13
-rw-r--r--storage/perfschema/table_setup_actors.cc13
-rw-r--r--storage/perfschema/table_setup_actors.h13
-rw-r--r--storage/perfschema/table_setup_consumers.cc13
-rw-r--r--storage/perfschema/table_setup_consumers.h13
-rw-r--r--storage/perfschema/table_setup_instruments.cc13
-rw-r--r--storage/perfschema/table_setup_instruments.h13
-rw-r--r--storage/perfschema/table_setup_objects.cc13
-rw-r--r--storage/perfschema/table_setup_objects.h13
-rw-r--r--storage/perfschema/table_setup_timers.cc13
-rw-r--r--storage/perfschema/table_setup_timers.h13
-rw-r--r--storage/perfschema/table_socket_instances.cc13
-rw-r--r--storage/perfschema/table_socket_instances.h13
-rw-r--r--storage/perfschema/table_socket_summary_by_event_name.cc13
-rw-r--r--storage/perfschema/table_socket_summary_by_event_name.h13
-rw-r--r--storage/perfschema/table_socket_summary_by_instance.cc13
-rw-r--r--storage/perfschema/table_socket_summary_by_instance.h13
-rw-r--r--storage/perfschema/table_sync_instances.cc13
-rw-r--r--storage/perfschema/table_sync_instances.h13
-rw-r--r--storage/perfschema/table_threads.cc13
-rw-r--r--storage/perfschema/table_threads.h13
-rw-r--r--storage/perfschema/table_tiws_by_index_usage.cc13
-rw-r--r--storage/perfschema/table_tiws_by_index_usage.h13
-rw-r--r--storage/perfschema/table_tiws_by_table.cc13
-rw-r--r--storage/perfschema/table_tiws_by_table.h13
-rw-r--r--storage/perfschema/table_tlws_by_table.cc13
-rw-r--r--storage/perfschema/table_tlws_by_table.h13
-rw-r--r--storage/perfschema/table_users.cc13
-rw-r--r--storage/perfschema/table_users.h13
-rw-r--r--storage/perfschema/unittest/CMakeLists.txt15
-rw-r--r--storage/perfschema/unittest/conf.txt13
-rw-r--r--storage/perfschema/unittest/pfs-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_account-oom-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_connect_attr-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_host-oom-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_instr-oom-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_instr-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-oom-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_misc-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_server_stubs.cc13
-rw-r--r--storage/perfschema/unittest/pfs_timer-t.cc13
-rw-r--r--storage/perfschema/unittest/pfs_user-oom-t.cc13
-rw-r--r--storage/perfschema/unittest/stub_pfs_defaults.h13
-rw-r--r--storage/perfschema/unittest/stub_pfs_global.h13
-rw-r--r--storage/perfschema/unittest/stub_print_error.h13
-rw-r--r--storage/rocksdb/CMakeLists.txt2
-rw-r--r--storage/rocksdb/build_rocksdb.cmake2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/lock_rows_not_exist.test2
-rw-r--r--storage/sphinx/ha_sphinx.cc2
-rw-r--r--storage/spider/mysql-test/spider/r/pushdown_not_like.result63
-rw-r--r--storage/spider/mysql-test/spider/t/pushdown_not_like.test138
-rw-r--r--storage/spider/spd_db_include.h2
-rw-r--r--storage/spider/spd_db_mysql.cc16
-rw-r--r--storage/tokudb/CMakeLists.txt2
-rw-r--r--storage/tokudb/PerconaFT/DartConfig.cmake10
-rw-r--r--storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc6
-rw-r--r--storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc10
-rw-r--r--storage/tokudb/PerconaFT/ft/ft-flusher.cc44
-rw-r--r--storage/tokudb/PerconaFT/ft/ft-internal.h21
-rw-r--r--storage/tokudb/PerconaFT/ft/ft-ops.cc56
-rw-r--r--storage/tokudb/PerconaFT/ft/ft-ops.h4
-rw-r--r--storage/tokudb/PerconaFT/ft/ft-recount-rows.cc2
-rw-r--r--storage/tokudb/PerconaFT/ft/ft-test-helpers.cc2
-rw-r--r--storage/tokudb/PerconaFT/ft/ft-verify.cc2
-rw-r--r--storage/tokudb/PerconaFT/ft/ft.cc28
-rw-r--r--storage/tokudb/PerconaFT/ft/ft.h10
-rw-r--r--storage/tokudb/PerconaFT/ft/loader/loader.cc4
-rw-r--r--storage/tokudb/PerconaFT/ft/logger/logger.cc12
-rw-r--r--storage/tokudb/PerconaFT/ft/node.cc18
-rw-r--r--storage/tokudb/PerconaFT/ft/node.h21
-rw-r--r--storage/tokudb/PerconaFT/ft/serialize/block_table.cc4
-rw-r--r--storage/tokudb/PerconaFT/ft/serialize/ft-node-deserialize.cc2
-rw-r--r--storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc2
-rw-r--r--storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc12
-rw-r--r--storage/tokudb/PerconaFT/ft/txn/rollback.cc4
-rw-r--r--storage/tokudb/PerconaFT/ft/txn/txn.cc4
-rw-r--r--storage/tokudb/PerconaFT/portability/toku_instr_mysql.cc9
l---------storage/tokudb/PerconaFT/scripts/tokuvalgrind1
-rw-r--r--storage/tokudb/PerconaFT/src/ydb.cc58
-rw-r--r--storage/tokudb/PerconaFT/src/ydb_db.cc8
-rw-r--r--storage/tokudb/PerconaFT/src/ydb_db.h1
-rw-r--r--storage/tokudb/PerconaFT/tools/tokuftdump.cc2
-rw-r--r--storage/tokudb/ha_tokudb.cc4
-rw-r--r--storage/tokudb/man/CMakeLists.txt2
-rw-r--r--storage/tokudb/man/tokuft_logprint.1 (renamed from man/tokuft_logprint.1)0
-rw-r--r--storage/tokudb/man/tokuftdump.1 (renamed from man/tokuftdump.1)0
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/type_bit.test2
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result12
-rw-r--r--storage/tokudb/tokudb_status.h4
-rw-r--r--strings/ctype-simple.c3
-rw-r--r--strings/my_strtoll10.c17
-rw-r--r--support-files/CMakeLists.txt37
-rw-r--r--support-files/mariadb.pc.in2
-rw-r--r--support-files/mariadb.service.in9
-rw-r--r--support-files/mariadb@.service.in9
-rw-r--r--wsrep/wsrep_api.h2
-rw-r--r--zlib/zlib.h2
1183 files changed, 20736 insertions, 12022 deletions
diff --git a/.clang-format b/.clang-format
index 1ad93ead80a..5fc6ab23622 100644
--- a/.clang-format
+++ b/.clang-format
@@ -90,7 +90,7 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
-SortIncludes: true
+SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
diff --git a/.gitignore b/.gitignore
index 83d921fab98..76c2122428d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -246,6 +246,8 @@ support-files/mysqld_multi.server
support-files/wsrep.cnf
support-files/wsrep_notify
support-files/policy/selinux/mysqld-safe.pp
+support-files/sysusers.conf
+support-files/tmpfiles.conf
support-files/mariadb.pp
tags
tests/async_queries
diff --git a/VERSION b/VERSION
index 5ac3a902883..01540871584 100644
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=3
-MYSQL_VERSION_PATCH=21
+MYSQL_VERSION_PATCH=23
SERVER_MATURITY=stable
diff --git a/client/mysql.cc b/client/mysql.cc
index d5001d335b6..d5ab1a12c7a 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3211,7 +3211,7 @@ static int
com_go(String *buffer,char *line __attribute__((unused)))
{
char buff[200]; /* about 110 chars used so far */
- char time_buff[53+3+1]; /* time max + space&parens + NUL */
+ char time_buff[53+3+1]; /* time max + space & parens + NUL */
MYSQL_RES *result;
ulonglong timer;
ulong warnings= 0;
@@ -3231,7 +3231,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
if (buffer->is_empty())
{
- if (status.batch) // Ignore empty quries
+ if (status.batch) // Ignore empty queries.
return 0;
return put_info("No query specified\n",INFO_ERROR);
@@ -3296,7 +3296,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
else
time_buff[0]= '\0';
- /* Every branch must truncate buff . */
+ /* Every branch must truncate buff. */
if (result)
{
if (!mysql_num_rows(result) && ! quick && !column_types_flag)
diff --git a/client/mysqldump.c b/client/mysqldump.c
index fff90b1d9e1..d4932094dac 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -4548,7 +4548,7 @@ static int dump_databases(char **db_names)
/*
-View Specific database initalization.
+View Specific database initialization.
SYNOPSIS
init_dumping_views
@@ -4565,7 +4565,7 @@ int init_dumping_views(char *qdatabase __attribute__((unused)))
/*
-Table Specific database initalization.
+Table Specific database initialization.
SYNOPSIS
init_dumping_tables
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 2d1103ce31c..d63661b3f1a 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -100,8 +100,13 @@ SET(ignored
"%ignore /etc"
"%ignore /etc/init.d"
"%ignore /etc/logrotate.d"
+ "%ignore /etc/security"
"%ignore /etc/systemd"
"%ignore /etc/systemd/system"
+ "%ignore /lib"
+ "%ignore /lib/security"
+ "%ignore /lib64"
+ "%ignore /lib64/security"
"%ignore ${CMAKE_INSTALL_PREFIX}"
"%ignore ${CMAKE_INSTALL_PREFIX}/bin"
"%ignore ${CMAKE_INSTALL_PREFIX}/include"
@@ -195,7 +200,7 @@ MACRO(ALTERNATIVE_NAME real alt)
SET(p "CPACK_RPM_${real}_PACKAGE_PROVIDES")
SET(${p} "${${p}} ${alt} = ${ver} ${alt}%{?_isa} = ${ver} config(${alt}) = ${ver}")
SET(o "CPACK_RPM_${real}_PACKAGE_OBSOLETES")
- SET(${o} "${${o}} ${alt} ${alt}%{?_isa}")
+ SET(${o} "${${o}} ${alt}")
ENDMACRO(ALTERNATIVE_NAME)
ALTERNATIVE_NAME("devel" "mysql-devel")
@@ -215,8 +220,9 @@ ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7")
ALTERNATIVE_NAME("server" "mariadb-server")
ALTERNATIVE_NAME("server" "mysql-compat-server")
ALTERNATIVE_NAME("test" "mariadb-test")
-ELSEIF(RPM MATCHES "(rhel|centos)8")
- SET(PYTHON_SHEBANG "/usr/bin/python3")
+ENDIF()
+IF(RPM MATCHES "fedora31" OR RPM MATCHES "(rhel|centos)8")
+ SET(PYTHON_SHEBANG "/usr/bin/python3" CACHE STRING "python shebang")
ENDIF()
# If we want to build build MariaDB-shared-compat,
@@ -249,6 +255,7 @@ IF(compat53 AND compat101)
STRING(REPLACE "\n" " " compat_provides "${compat_provides}")
STRING(REPLACE "\n" " " compat_obsoletes "${compat_obsoletes}")
+ STRING(REGEX REPLACE "[^ ]+\\([^ ]+ *" "" compat_obsoletes "${compat_obsoletes}")
SETA(CPACK_RPM_compat_PACKAGE_PROVIDES "${compat_provides}")
SETA(CPACK_RPM_compat_PACKAGE_OBSOLETES "${compat_obsoletes}")
diff --git a/cmake/dtrace.cmake b/cmake/dtrace.cmake
index 4e0f7501045..1e29ba685e0 100644
--- a/cmake/dtrace.cmake
+++ b/cmake/dtrace.cmake
@@ -147,11 +147,10 @@ FUNCTION(DTRACE_INSTRUMENT target)
# Note: DTrace probes in static libraries are unusable currently
# (see explanation for DTRACE_INSTRUMENT_STATIC_LIBS below)
# but maybe one day this will be fixed.
- GET_TARGET_PROPERTY(target_location ${target} LOCATION)
ADD_CUSTOM_COMMAND(
TARGET ${target} POST_BUILD
- COMMAND ${CMAKE_AR} r ${target_location} ${outfile}
- COMMAND ${CMAKE_RANLIB} ${target_location}
+ COMMAND ${CMAKE_AR} r $<TARGET_FILE:${target}> ${outfile}
+ COMMAND ${CMAKE_RANLIB} $<TARGET_FILE:${target}>
)
# Used in DTRACE_INSTRUMENT_WITH_STATIC_LIBS
SET(TARGET_OBJECT_DIRECTORY_${target} ${objdir} CACHE INTERNAL "")
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index 87d8cacb4d3..2779e07e9dd 100644
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -139,11 +139,10 @@ SET(INSTALL_SYSCONF2DIR_RPM "/etc/my.cnf.d")
#
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(INSTALL_LIBDIR_RPM "lib64")
- SET(INSTALL_PLUGINDIR_RPM "lib64/mysql/plugin")
ELSE()
SET(INSTALL_LIBDIR_RPM "lib")
- SET(INSTALL_PLUGINDIR_RPM "lib/mysql/plugin")
ENDIF()
+SET(INSTALL_PLUGINDIR_RPM "${INSTALL_LIBDIR_RPM}/mysql/plugin")
#
SET(INSTALL_INCLUDEDIR_RPM "include/mysql")
#
@@ -164,6 +163,7 @@ SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock"
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_RPM "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_RPM "/usr/lib/tmpfiles.d")
+SET(INSTALL_PAMDIR_RPM "/${INSTALL_LIBDIR_RPM}/security")
#
# DEB layout
@@ -174,7 +174,7 @@ SET(INSTALL_SCRIPTDIR_DEB "bin")
SET(INSTALL_SYSCONFDIR_DEB "/etc")
SET(INSTALL_SYSCONF2DIR_DEB "/etc/mysql/conf.d")
#
-SET(INSTALL_LIBDIR_DEB "lib")
+SET(INSTALL_LIBDIR_DEB "lib/${CMAKE_CXX_LIBRARY_ARCHITECTURE}")
SET(INSTALL_PLUGINDIR_DEB "lib/mysql/plugin")
#
SET(INSTALL_INCLUDEDIR_DEB "include/mariadb")
@@ -186,7 +186,7 @@ SET(INSTALL_INFODIR_DEB "share/info")
#
SET(INSTALL_SHAREDIR_DEB "share")
SET(INSTALL_MYSQLSHAREDIR_DEB "share/mysql")
-SET(INSTALL_MYSQLTESTDIR_DEB "mysql-test")
+SET(INSTALL_MYSQLTESTDIR_DEB "share/mysql/mysql-test")
SET(INSTALL_SQLBENCHDIR_DEB ".")
SET(INSTALL_SUPPORTFILESDIR_DEB "share/mysql")
#
@@ -196,6 +196,7 @@ SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")
SET(INSTALL_SYSTEMD_UNITDIR_DEB "/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_DEB "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_DEB "/usr/lib/tmpfiles.d")
+SET(INSTALL_PAMDIR_DEB "/lib/${CMAKE_CXX_LIBRARY_ARCHITECTURE}/security")
#
# SVR4 layout
@@ -235,17 +236,18 @@ SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "")
# Set INSTALL_FOODIR variables for chosen layout (for example, INSTALL_BINDIR
# will be defined as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE
# layout is chosen)
-FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN SYSCONF SYSCONF2
- INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA UNIX_ADDR
- SYSTEMD_UNIT SYSTEMD_SYSUSERS SYSTEMD_TMPFILES)
- SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
- CACHE STRING "${var} installation directory" ${FORCE})
- MARK_AS_ADVANCED(INSTALL_${var}DIR)
-
- IF(IS_ABSOLUTE ${INSTALL_${var}DIR})
- SET(INSTALL_${var}DIRABS ${INSTALL_${var}DIR})
- ELSE()
- SET(INSTALL_${var}DIRABS "${CMAKE_INSTALL_PREFIX}/${INSTALL_${var}DIR}")
+GET_CMAKE_PROPERTY(ALL_VARS VARIABLES)
+FOREACH (V ${ALL_VARS})
+ IF (V MATCHES "^(INSTALL_([A-Z_0-9]+)DIR)_${INSTALL_LAYOUT}$")
+ SET(var ${CMAKE_MATCH_1})
+ SET(${var} "${${V}}" CACHE STRING "${CMAKE_MATCH_2} installation directory" ${FORCE})
+ MARK_AS_ADVANCED(${var})
+
+ IF(IS_ABSOLUTE "${${var}}")
+ SET(${var}ABS "${${var}}")
+ ELSE()
+ SET(${var}ABS "${CMAKE_INSTALL_PREFIX}/${${var}}")
+ ENDIF()
ENDIF()
ENDFOREACH()
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index f28720e97bc..c40c196c3d0 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -262,93 +262,6 @@ GET_FILENAME_COMPONENT(BINARY_PARENTDIR ${CMAKE_BINARY_DIR} PATH)
SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug build")
-FUNCTION(INSTALL_DEBUG_TARGET target)
- RETURN() # XXX unused?
- CMAKE_PARSE_ARGUMENTS(ARG
- ""
- "DESTINATION;RENAME;PDB_DESTINATION;COMPONENT"
- ""
- ${ARGN}
- )
- GET_TARGET_PROPERTY(target_type ${target} TYPE)
- IF(ARG_RENAME)
- SET(RENAME_PARAM RENAME ${ARG_RENAME}${CMAKE_${target_type}_SUFFIX})
- ELSE()
- SET(RENAME_PARAM)
- ENDIF()
- IF(NOT ARG_DESTINATION)
- MESSAGE(FATAL_ERROR "Need DESTINATION parameter for INSTALL_DEBUG_TARGET")
- ENDIF()
- GET_TARGET_PROPERTY(target_location ${target} LOCATION)
- IF(CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
- STRING(REPLACE "${CMAKE_BINARY_DIR}" "${DEBUGBUILDDIR}" debug_target_location "${target_location}")
- ELSE()
- STRING(REPLACE "${CMAKE_CFG_INTDIR}" "Debug" debug_target_location "${target_location}" )
- ENDIF()
- IF(NOT ARG_COMPONENT)
- SET(ARG_COMPONENT DebugBinaries)
- ENDIF()
-
- # Define permissions
- # For executable files
- SET(PERMISSIONS_EXECUTABLE
- PERMISSIONS
- OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE)
-
- # Permissions for shared library (honors CMAKE_INSTALL_NO_EXE which is
- # typically set on Debian)
- IF(CMAKE_INSTALL_SO_NO_EXE)
- SET(PERMISSIONS_SHARED_LIBRARY
- PERMISSIONS
- OWNER_READ OWNER_WRITE
- GROUP_READ
- WORLD_READ)
- ELSE()
- SET(PERMISSIONS_SHARED_LIBRARY ${PERMISSIONS_EXECUTABLE})
- ENDIF()
-
- # Shared modules get the same permissions as shared libraries
- SET(PERMISSIONS_MODULE_LIBRARY ${PERMISSIONS_SHARED_LIBRARY})
-
- # Define permissions for static library
- SET(PERMISSIONS_STATIC_LIBRARY
- PERMISSIONS
- OWNER_READ OWNER_WRITE
- GROUP_READ
- WORLD_READ)
-
- INSTALL(FILES ${debug_target_location}
- DESTINATION ${ARG_DESTINATION}
- ${RENAME_PARAM}
- ${PERMISSIONS_${target_type}}
- CONFIGURATIONS Release RelWithDebInfo
- COMPONENT ${ARG_COMPONENT}
- OPTIONAL)
-
- IF(MSVC)
- GET_FILENAME_COMPONENT(ext ${debug_target_location} EXT)
- STRING(REPLACE "${ext}" ".pdb" debug_pdb_target_location "${debug_target_location}" )
- IF (RENAME_PARAM)
- IF(NOT ARG_PDB_DESTINATION)
- STRING(REPLACE "${ext}" ".pdb" "${ARG_RENAME}" pdb_rename)
- SET(PDB_RENAME_PARAM RENAME "${pdb_rename}")
- ENDIF()
- ENDIF()
- IF(NOT ARG_PDB_DESTINATION)
- SET(ARG_PDB_DESTINATION "${ARG_DESTINATION}")
- ENDIF()
- INSTALL(FILES ${debug_pdb_target_location}
- DESTINATION ${ARG_PDB_DESTINATION}
- ${PDB_RENAME_PARAM}
- CONFIGURATIONS Release RelWithDebInfo
- COMPONENT ${ARG_COMPONENT}
- OPTIONAL)
- ENDIF()
-ENDFUNCTION()
-
-
FUNCTION(INSTALL_MYSQL_TEST from to)
IF(INSTALL_MYSQLTESTDIR)
INSTALL(
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake
index 939a52d0655..1e946c93cdf 100644
--- a/cmake/os/WindowsCache.cmake
+++ b/cmake/os/WindowsCache.cmake
@@ -124,6 +124,7 @@ SET(HAVE_PTHREAD_ATTR_GETSTACKSIZE CACHE INTERNAL "")
SET(HAVE_PTHREAD_ATTR_SETSCOPE CACHE INTERNAL "")
SET(HAVE_PTHREAD_ATTR_SETSTACKSIZE CACHE INTERNAL "")
SET(HAVE_PTHREAD_CONDATTR_CREATE CACHE INTERNAL "")
+SET(HAVE_PTHREAD_GETAFFINITY_NP CACHE INTERNAL "")
SET(HAVE_PTHREAD_INIT CACHE INTERNAL "")
SET(HAVE_PTHREAD_KEY_DELETE CACHE INTERNAL "")
SET(HAVE_PTHREAD_RWLOCK_RDLOCK CACHE INTERNAL "")
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 5a1e8f81f0a..486f5b00590 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -249,7 +249,6 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(ARG_COMPONENT Server)
ENDIF()
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT ${ARG_COMPONENT})
- #INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug COMPONENT ${ARG_COMPONENT})
ENDIF()
GET_FILENAME_COMPONENT(subpath ${CMAKE_CURRENT_SOURCE_DIR} NAME)
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index 2ec370404df..cc4f0d2daa0 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -149,6 +149,7 @@ MACRO (MYSQL_CHECK_SSL)
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES ${SSL_LIBRARIES})
+ SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
CHECK_SYMBOL_EXISTS(ERR_remove_thread_state "openssl/err.h"
HAVE_ERR_remove_thread_state)
CHECK_SYMBOL_EXISTS(EVP_aes_128_ctr "openssl/evp.h"
diff --git a/config.h.cmake b/config.h.cmake
index 765d75dfb23..e89fbc7b95c 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -195,6 +195,7 @@
#cmakedefine HAVE_PTHREAD_ATTR_SETSCOPE 1
#cmakedefine HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#cmakedefine HAVE_PTHREAD_CONDATTR_CREATE 1
+#cmakedefine HAVE_PTHREAD_GETAFFINITY_NP 1
#cmakedefine HAVE_PTHREAD_KEY_DELETE 1
#cmakedefine HAVE_PTHREAD_KILL 1
#cmakedefine HAVE_PTHREAD_RWLOCK_RDLOCK 1
diff --git a/configure.cmake b/configure.cmake
index e75810f8150..a9aa1778ba8 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -385,6 +385,7 @@ CHECK_FUNCTION_EXISTS (pthread_attr_setscope HAVE_PTHREAD_ATTR_SETSCOPE)
CHECK_FUNCTION_EXISTS (pthread_attr_getguardsize HAVE_PTHREAD_ATTR_GETGUARDSIZE)
CHECK_FUNCTION_EXISTS (pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
CHECK_FUNCTION_EXISTS (pthread_condattr_create HAVE_PTHREAD_CONDATTR_CREATE)
+CHECK_FUNCTION_EXISTS (pthread_getaffinity_np HAVE_PTHREAD_GETAFFINITY_NP)
CHECK_FUNCTION_EXISTS (pthread_key_delete HAVE_PTHREAD_KEY_DELETE)
CHECK_FUNCTION_EXISTS (pthread_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK)
CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK)
diff --git a/dbug/dbug.c b/dbug/dbug.c
index b99a8c79d0c..847a8cc2b5d 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -324,8 +324,36 @@ static void DbugVfprintf(FILE *stream, const char* format, va_list args);
*/
#include <my_pthread.h>
+/*
+** Protects writing to all file descriptors, init_settings.keywords
+** pointer and it's pointee - a linked list with keywords.
+*/
static pthread_mutex_t THR_LOCK_dbug;
+static void LockMutex(CODE_STATE *cs)
+{
+ if (!cs->locked)
+ pthread_mutex_lock(&THR_LOCK_dbug);
+ cs->locked++;
+}
+static void UnlockMutex(CODE_STATE *cs)
+{
+ --cs->locked;
+ assert(cs->locked >= 0);
+ if (cs->locked == 0)
+ pthread_mutex_unlock(&THR_LOCK_dbug);
+}
+static void LockIfInitSettings(CODE_STATE *cs)
+{
+ if (cs->stack == &init_settings)
+ LockMutex(cs);
+}
+static void UnlockIfInitSettings(CODE_STATE *cs)
+{
+ if (cs->stack == &init_settings)
+ UnlockMutex(cs);
+}
+
static CODE_STATE *code_state(void)
{
CODE_STATE *cs, **cs_ptr;
@@ -453,16 +481,9 @@ static int DbugParse(CODE_STATE *cs, const char *control)
const char *end;
int rel, f_used=0;
struct settings *stack;
- int org_cs_locked;
stack= cs->stack;
- if (!(org_cs_locked= cs->locked))
- {
- pthread_mutex_lock(&THR_LOCK_dbug);
- cs->locked= 1;
- }
-
if (control[0] == '-' && control[1] == '#')
control+=2;
@@ -476,7 +497,9 @@ static int DbugParse(CODE_STATE *cs, const char *control)
stack->sub_level= 0;
stack->out_file= sstderr;
stack->functions= NULL;
+ LockIfInitSettings(cs);
stack->keywords= NULL;
+ UnlockIfInitSettings(cs);
stack->processes= NULL;
}
else if (!stack->out_file)
@@ -492,7 +515,9 @@ static int DbugParse(CODE_STATE *cs, const char *control)
{
/* never share with the global parent - it can change under your feet */
stack->functions= ListCopy(init_settings.functions);
+ LockMutex(cs);
stack->keywords= ListCopy(init_settings.keywords);
+ UnlockMutex(cs);
stack->processes= ListCopy(init_settings.processes);
}
else
@@ -516,21 +541,31 @@ static int DbugParse(CODE_STATE *cs, const char *control)
case 'd':
if (sign < 0 && control == end)
{
+ LockIfInitSettings(cs);
if (!is_shared(stack, keywords))
FreeList(stack->keywords);
stack->keywords=NULL;
+ UnlockIfInitSettings(cs);
stack->flags &= ~DEBUG_ON;
break;
}
+ LockIfInitSettings(cs);
if (rel && is_shared(stack, keywords))
stack->keywords= ListCopy(stack->keywords);
+ UnlockIfInitSettings(cs);
if (sign < 0)
{
if (DEBUGGING)
+ {
+ LockIfInitSettings(cs);
stack->keywords= ListDel(stack->keywords, control, end);
+ UnlockIfInitSettings(cs);
+ }
break;
}
+ LockIfInitSettings(cs);
stack->keywords= ListAdd(stack->keywords, control, end);
+ UnlockIfInitSettings(cs);
stack->flags |= DEBUG_ON;
break;
case 'D':
@@ -665,11 +700,6 @@ static int DbugParse(CODE_STATE *cs, const char *control)
control=end+1;
end= DbugStrTok(control);
}
- if (!org_cs_locked)
- {
- cs->locked= 0;
- pthread_mutex_unlock(&THR_LOCK_dbug);
- }
return !rel || f_used;
}
@@ -1002,7 +1032,9 @@ int _db_explain_ (CODE_STATE *cs, char *buf, size_t len)
get_code_state_if_not_set_or_return *buf=0;
+ LockIfInitSettings(cs);
op_list_to_buf('d', cs->stack->keywords, DEBUGGING);
+ UnlockIfInitSettings(cs);
op_int_to_buf ('D', cs->stack->delay, 0);
op_list_to_buf('f', cs->stack->functions, cs->stack->functions);
op_bool_to_buf('F', cs->stack->flags & FILE_ON);
@@ -1097,7 +1129,6 @@ int _db_explain_init_(char *buf, size_t len)
void _db_enter_(const char *_func_, const char *_file_,
uint _line_, struct _db_stack_frame_ *_stack_frame_)
{
- int save_errno, org_cs_locked;
CODE_STATE *cs;
if (!((cs=code_state())))
{
@@ -1105,7 +1136,6 @@ void _db_enter_(const char *_func_, const char *_file_,
_stack_frame_->prev= 0;
return;
}
- save_errno= errno;
_stack_frame_->line= -1;
_stack_frame_->func= cs->func;
@@ -1126,20 +1156,14 @@ void _db_enter_(const char *_func_, const char *_file_,
cs->stack->flags &= ~SANITY_CHECK_ON;
if (TRACING)
{
- if (!(org_cs_locked= cs->locked))
- {
- pthread_mutex_lock(&THR_LOCK_dbug);
- cs->locked= 1;
- }
+ int save_errno= errno;
+ LockMutex(cs);
DoPrefix(cs, _line_);
Indent(cs, cs->level);
(void) fprintf(cs->stack->out_file->file, ">%s\n", cs->func);
- DbugFlush(cs); /* This does a unlock */
- if (!org_cs_locked)
- {
- cs->locked= 0;
- pthread_mutex_unlock(&THR_LOCK_dbug);
- }
+ UnlockMutex(cs);
+ DbugFlush(cs);
+ errno=save_errno;
}
break;
case DISABLE_TRACE:
@@ -1148,7 +1172,6 @@ void _db_enter_(const char *_func_, const char *_file_,
case DONT_TRACE:
break;
}
- errno=save_errno;
}
/*
@@ -1173,7 +1196,6 @@ void _db_enter_(const char *_func_, const char *_file_,
void _db_return_(struct _db_stack_frame_ *_stack_frame_)
{
- int save_errno=errno;
uint _slevel_= _stack_frame_->level & ~TRACE_ON;
CODE_STATE *cs;
get_code_state_or_return;
@@ -1190,25 +1212,18 @@ void _db_return_(struct _db_stack_frame_ *_stack_frame_)
if (DoTrace(cs) & DO_TRACE)
{
- int org_cs_locked;
if ((cs->stack->flags & SANITY_CHECK_ON) && (*dbug_sanity)())
cs->stack->flags &= ~SANITY_CHECK_ON;
if (TRACING)
{
- if (!(org_cs_locked= cs->locked))
- {
- pthread_mutex_lock(&THR_LOCK_dbug);
- cs->locked= 1;
- }
+ int save_errno=errno;
+ LockMutex(cs);
DoPrefix(cs, _stack_frame_->line);
Indent(cs, cs->level);
(void) fprintf(cs->stack->out_file->file, "<%s\n", cs->func);
+ UnlockMutex(cs);
DbugFlush(cs);
- if (!org_cs_locked)
- {
- cs->locked= 0;
- pthread_mutex_unlock(&THR_LOCK_dbug);
- }
+ errno=save_errno;
}
}
/*
@@ -1220,7 +1235,6 @@ void _db_return_(struct _db_stack_frame_ *_stack_frame_)
cs->file= _stack_frame_->file;
if (cs->framep != NULL)
cs->framep= cs->framep->prev;
- errno=save_errno;
}
@@ -1285,18 +1299,14 @@ void _db_doprnt_(const char *format,...)
{
va_list args;
CODE_STATE *cs;
- int save_errno, org_cs_locked;
+ int save_errno;
get_code_state_or_return;
va_start(args,format);
- if (!(org_cs_locked= cs->locked))
- {
- pthread_mutex_lock(&THR_LOCK_dbug);
- cs->locked= 1;
- }
save_errno=errno;
+ LockMutex(cs);
DoPrefix(cs, cs->u_line);
if (TRACING)
Indent(cs, cs->level + 1);
@@ -1304,12 +1314,8 @@ void _db_doprnt_(const char *format,...)
(void) fprintf(cs->stack->out_file->file, "%s: ", cs->func);
(void) fprintf(cs->stack->out_file->file, "%s: ", cs->u_keyword);
DbugVfprintf(cs->stack->out_file->file, format, args);
+ UnlockMutex(cs);
DbugFlush(cs);
- if (!org_cs_locked)
- {
- cs->locked= 0;
- pthread_mutex_unlock(&THR_LOCK_dbug);
- }
errno=save_errno;
va_end(args);
@@ -1349,17 +1355,13 @@ static void DbugVfprintf(FILE *stream, const char* format, va_list args)
void _db_dump_(uint _line_, const char *keyword,
const unsigned char *memory, size_t length)
{
- int pos, org_cs_locked;
+ int pos;
CODE_STATE *cs;
get_code_state_or_return;
- if (!(org_cs_locked= cs->locked))
- {
- pthread_mutex_lock(&THR_LOCK_dbug);
- cs->locked= 1;
- }
if (_db_keyword_(cs, keyword, 0))
{
+ LockMutex(cs);
DoPrefix(cs, _line_);
if (TRACING)
{
@@ -1387,13 +1389,9 @@ void _db_dump_(uint _line_, const char *keyword,
fputc(' ',cs->stack->out_file->file);
}
(void) fputc('\n',cs->stack->out_file->file);
+ UnlockMutex(cs);
DbugFlush(cs);
}
- if (!org_cs_locked)
- {
- cs->locked= 0;
- pthread_mutex_unlock(&THR_LOCK_dbug);
- }
}
@@ -1621,8 +1619,13 @@ static void PushState(CODE_STATE *cs)
static void FreeState(CODE_STATE *cs, int free_state)
{
struct settings *state= cs->stack;
+ LockIfInitSettings(cs);
if (!is_shared(state, keywords))
+ {
FreeList(state->keywords);
+ state->keywords= NULL;
+ }
+ UnlockIfInitSettings(cs);
if (!is_shared(state, functions))
FreeList(state->functions);
if (!is_shared(state, processes))
@@ -1701,8 +1704,6 @@ void _db_end_()
static int DoTrace(CODE_STATE *cs)
{
int res= DONT_TRACE;
- if (!cs->locked)
- pthread_mutex_lock(&THR_LOCK_dbug);
if ((cs->stack->maxdepth == 0 || cs->level <= cs->stack->maxdepth) &&
InList(cs->stack->processes, cs->process, 0) & (MATCHED|INCLUDE))
{
@@ -1727,8 +1728,6 @@ static int DoTrace(CODE_STATE *cs)
break;
}
}
- if (!cs->locked)
- pthread_mutex_unlock(&THR_LOCK_dbug);
return res;
}
@@ -1768,11 +1767,9 @@ BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword, int strict)
if (!(DEBUGGING && (DoTrace(cs) & DO_TRACE)))
return 0;
- if (!cs->locked)
- pthread_mutex_lock(&THR_LOCK_dbug);
+ LockIfInitSettings(cs);
res= (InList(cs->stack->keywords, keyword, strict) & match);
- if (!cs->locked)
- pthread_mutex_unlock(&THR_LOCK_dbug);
+ UnlockIfInitSettings(cs);
return res != 0;
}
@@ -1999,16 +1996,16 @@ static void DBUGCloseFile(CODE_STATE *cs, sFILE *new_value)
sFILE *fp;
if (!cs || !cs->stack || !cs->stack->out_file)
return;
- if (!cs->locked)
- pthread_mutex_lock(&THR_LOCK_dbug);
fp= cs->stack->out_file;
if (--fp->used == 0)
{
if (fclose(fp->file) == EOF)
{
+ LockMutex(cs);
(void) fprintf(stderr, ERR_CLOSE, cs->process);
perror("");
+ UnlockMutex(cs);
}
else
{
@@ -2016,8 +2013,6 @@ static void DBUGCloseFile(CODE_STATE *cs, sFILE *new_value)
}
}
cs->stack->out_file= new_value;
- if (!cs->locked)
- pthread_mutex_unlock(&THR_LOCK_dbug);
}
@@ -2200,9 +2195,7 @@ void _db_flush_()
get_code_state_or_return;
if (DEBUGGING)
{
- pthread_mutex_lock(&THR_LOCK_dbug);
(void) fflush(cs->stack->out_file->file);
- pthread_mutex_unlock(&THR_LOCK_dbug);
}
}
@@ -2230,16 +2223,14 @@ void _db_lock_file_()
{
CODE_STATE *cs;
get_code_state_or_return;
- pthread_mutex_lock(&THR_LOCK_dbug);
- cs->locked=1;
+ LockMutex(cs);
}
void _db_unlock_file_()
{
CODE_STATE *cs;
get_code_state_or_return;
- cs->locked=0;
- pthread_mutex_unlock(&THR_LOCK_dbug);
+ UnlockMutex(cs);
}
const char* _db_get_func_(void)
diff --git a/debian/additions/innotop/innotop b/debian/additions/innotop/innotop
index eb4b3590cf6..399a393e67b 100644
--- a/debian/additions/innotop/innotop
+++ b/debian/additions/innotop/innotop
@@ -1607,7 +1607,7 @@ my %exprs = (
my %columns = (
active_secs => { hdr => 'SecsActive', num => 1, label => 'Seconds transaction has been active', },
- add_pool_alloc => { hdr => 'Add\'l Pool', num => 1, label => 'Additonal pool allocated' },
+ add_pool_alloc => { hdr => 'Add\'l Pool', num => 1, label => 'Additional pool allocated' },
attempted_op => { hdr => 'Action', num => 0, label => 'The action that caused the error' },
awe_mem_alloc => { hdr => 'AWE Memory', num => 1, label => '[Windows] AWE memory allocated' },
binlog_cache_overflow => { hdr => 'Binlog Cache', num => 1, label => 'Transactions too big for binlog cache that went to disk' },
diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh
index 4dba4de26b7..919dbd61c4f 100755
--- a/debian/autobake-deb.sh
+++ b/debian/autobake-deb.sh
@@ -77,7 +77,6 @@ fi
if ! apt-cache madison libzstd-dev | grep 'libzstd-dev' >/dev/null 2>&1
then
sed '/libzstd-dev/d' -i debian/control
- sed '/libzstd1/d' -i debian/control
fi
# The binaries should be fully hardened by default. However TokuDB compilation seems to fail on
diff --git a/debian/control b/debian/control
index 8896f4d1dcd..64034c831c9 100644
--- a/debian/control
+++ b/debian/control
@@ -7,6 +7,7 @@ Build-Depends: bison,
cmake (>= 2.7),
debhelper (>= 9),
dh-apparmor,
+ dh-exec,
dh-systemd,
gdb,
libaio-dev [linux-any],
@@ -234,7 +235,8 @@ Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)
Package: mariadb-client-core-10.3
Architecture: any
-Depends: mariadb-common (>= ${source:Version}), libmariadb3,
+Depends: libmariadb3,
+ mariadb-common (>= ${source:Version}),
${misc:Depends},
${shlibs:Depends}
Conflicts: mariadb-client-10.0,
@@ -538,7 +540,6 @@ Description: Connect storage engine for MariaDB
Package: mariadb-plugin-rocksdb
Architecture: amd64 arm64 mips64el ppc64el
Depends: mariadb-server-10.3 (= ${binary:Version}),
- libzstd1,
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-rocksdb-engine-10.2,
@@ -570,8 +571,8 @@ Description: OQGraph storage engine for MariaDB
Package: mariadb-plugin-tokudb
Architecture: amd64
-Depends: mariadb-server-10.3 (= ${binary:Version}),
- libjemalloc1 (>= 3.0.0~) | libjemalloc2,
+Depends: libjemalloc1 (>= 3.0.0~) | libjemalloc2,
+ mariadb-server-10.3 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-server-10.0,
diff --git a/debian/libmariadb-dev-compat.links b/debian/libmariadb-dev-compat.links
index 11e0dbce225..e02260c0129 100644
--- a/debian/libmariadb-dev-compat.links
+++ b/debian/libmariadb-dev-compat.links
@@ -1,3 +1,4 @@
+#!/usr/bin/dh-exec
usr/bin/mariadb_config usr/bin/mysql_config
usr/include/mariadb usr/include/mysql
-usr/share/pkgconfig/mariadb.pc usr/share/pkgconfig/mysqlclient.pc
+usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/mariadb.pc usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/mysqlclient.pc
diff --git a/debian/libmariadb-dev.install b/debian/libmariadb-dev.install
index 72798dec379..0625dec7a9e 100644
--- a/debian/libmariadb-dev.install
+++ b/debian/libmariadb-dev.install
@@ -4,6 +4,6 @@ usr/lib/*/libmariadb.so
usr/lib/*/libmariadbclient.a
usr/lib/*/libmariadbclient.so
usr/lib/*/libmysqlservices.a
+usr/lib/*/pkgconfig/mariadb.pc
usr/share/aclocal/mysql.m4
usr/share/man/man1/mysql_config.1
-usr/share/pkgconfig/mariadb.pc
diff --git a/debian/libmariadb3.install b/debian/libmariadb3.install
index 9783e7b0b01..8636166a493 100644
--- a/debian/libmariadb3.install
+++ b/debian/libmariadb3.install
@@ -3,4 +3,3 @@ usr/lib/mysql/plugin/client_ed25519.so
usr/lib/mysql/plugin/dialog.so
usr/lib/mysql/plugin/mysql_clear_password.so
usr/lib/mysql/plugin/sha256_password.so
-usr/lib/mysql/plugin/client_ed25519.so
diff --git a/debian/libmariadbd-dev.install b/debian/libmariadbd-dev.install
index 2c14af5ab31..13d961409cc 100644
--- a/debian/libmariadbd-dev.install
+++ b/debian/libmariadbd-dev.install
@@ -1,4 +1,4 @@
-usr/lib/*/libmysqld.a
usr/lib/*/libmariadbd.a
-usr/lib/*/libmysqld.so
usr/lib/*/libmariadbd.so
+usr/lib/*/libmysqld.a
+usr/lib/*/libmysqld.so
diff --git a/debian/mariadb-plugin-rocksdb.install b/debian/mariadb-plugin-rocksdb.install
index b9a6f7dc432..403c7f291b6 100644
--- a/debian/mariadb-plugin-rocksdb.install
+++ b/debian/mariadb-plugin-rocksdb.install
@@ -1,5 +1,5 @@
etc/mysql/conf.d/rocksdb.cnf etc/mysql/mariadb.conf.d
-usr/bin/mysql_ldb
usr/bin/myrocks_hotbackup
+usr/bin/mysql_ldb
usr/bin/sst_dump
usr/lib/mysql/plugin/ha_rocksdb.so
diff --git a/debian/mariadb-server-10.3.install b/debian/mariadb-server-10.3.install
index 9447446a6b5..7cd81e785bf 100644
--- a/debian/mariadb-server-10.3.install
+++ b/debian/mariadb-server-10.3.install
@@ -3,6 +3,8 @@ debian/additions/debian-start.inc.sh usr/share/mysql
debian/additions/echo_stderr usr/share/mysql
debian/additions/mysqld_safe_syslog.cnf etc/mysql/conf.d
etc/apparmor.d/usr.sbin.mysqld
+etc/security/user_map.conf
+lib/*/security/pam_user_map.so
lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf
usr/bin/aria_chk
usr/bin/aria_dump_log
@@ -86,9 +88,9 @@ usr/share/man/man1/replace.1
usr/share/man/man1/resolve_stack_dump.1
usr/share/man/man1/resolveip.1
usr/share/man/man1/wsrep_sst_common.1
+usr/share/man/man1/wsrep_sst_mariabackup.1
usr/share/man/man1/wsrep_sst_mysqldump.1
usr/share/man/man1/wsrep_sst_rsync.1
-usr/share/man/man1/wsrep_sst_mariabackup.1
usr/share/mysql/errmsg-utf8.txt
usr/share/mysql/fill_help_tables.sql
usr/share/mysql/maria_add_gis_sp_bootstrap.sql
diff --git a/debian/mariadb-test-data.install b/debian/mariadb-test-data.install
index 9e5356d061f..26b69c2941b 100644
--- a/debian/mariadb-test-data.install
+++ b/debian/mariadb-test-data.install
@@ -1,7 +1,7 @@
usr/share/mysql/mysql-test/collections
usr/share/mysql/mysql-test/include
-usr/share/mysql/mysql-test/plugin
usr/share/mysql/mysql-test/main
+usr/share/mysql/mysql-test/plugin
usr/share/mysql/mysql-test/std_data
usr/share/mysql/mysql-test/suite
usr/share/mysql/mysql-test/unstable-tests
diff --git a/debian/rules b/debian/rules
index 93bfe01e55e..e8ca0d92527 100755
--- a/debian/rules
+++ b/debian/rules
@@ -86,9 +86,6 @@ endif
-DSYSTEM_TYPE="debian-$(DEB_HOST_GNU_SYSTEM)" \
-DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_ARCH) \
-DBUILD_CONFIG=mysql_release \
- -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
- -DINSTALL_PLUGINDIR=lib/mysql/plugin \
- -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
-DDEB=$(DEB_VENDOR) ..'
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index 591527aacd0..73f62c26dd2 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -349,7 +349,7 @@ error_message(
/***********************************************//*
@param>>_______[in] name>_____name of file.
- @retval file pointer; file pointer is NULL when error occured.
+ @retval file pointer; file pointer is NULL when error occurred.
*/
FILE*
@@ -1136,7 +1136,7 @@ parse_page(
/**
@param [in/out] file_name name of the filename
-@retval FILE pointer if successfully created else NULL when error occured.
+@retval FILE pointer if successfully created else NULL when error occurred.
*/
FILE*
create_file(
diff --git a/extra/mariabackup/CMakeLists.txt b/extra/mariabackup/CMakeLists.txt
index be2d78b504e..adaf82b325e 100644
--- a/extra/mariabackup/CMakeLists.txt
+++ b/extra/mariabackup/CMakeLists.txt
@@ -97,7 +97,7 @@ ENDIF()
########################################################################
-# xbstream binary
+# mbstream binary
########################################################################
MYSQL_ADD_EXECUTABLE(mbstream
ds_buffer.cc
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc
index 161486fbe39..929319927e5 100644
--- a/extra/mariabackup/backup_copy.cc
+++ b/extra/mariabackup/backup_copy.cc
@@ -1666,6 +1666,9 @@ ibx_copy_incremental_over_full()
}
}
+ if (!(ret = backup_files_from_datadir(xtrabackup_incremental_dir)))
+ goto cleanup;
+
/* copy buffer pool dump */
if (innobase_buffer_pool_filename) {
const char *src_name;
@@ -2177,20 +2180,26 @@ static bool backup_files_from_datadir(const char *dir_path)
if (info.type != OS_FILE_TYPE_FILE)
continue;
- const char *pname = strrchr(info.name, IF_WIN('\\', '/'));
+ const char *pname = strrchr(info.name, OS_PATH_SEPARATOR);
if (!pname)
pname = info.name;
- /* Copy aria log files, and aws keys for encryption plugins.*/
- const char *prefixes[] = { "aria_log", "aws-kms-key" };
- for (size_t i = 0; i < array_elements(prefixes); i++) {
- if (starts_with(pname, prefixes[i])) {
- ret = copy_file(ds_data, info.name, info.name, 1);
- if (!ret) {
- break;
- }
- }
- }
+ if (!starts_with(pname, "aws-kms-key") &&
+ !starts_with(pname, "aria_log"))
+ /* For ES exchange the above line with the following code:
+ (!xtrabackup_prepare || !xtrabackup_incremental_dir ||
+ !starts_with(pname, "aria_log")))
+ */
+ continue;
+
+ if (xtrabackup_prepare && xtrabackup_incremental_dir &&
+ file_exists(info.name))
+ unlink(info.name);
+
+ std::string full_path(dir_path);
+ full_path.append(1, OS_PATH_SEPARATOR).append(info.name);
+ if (!(ret = copy_file(ds_data, full_path.c_str() , info.name, 1)))
+ break;
}
os_file_closedir(dir);
return ret;
diff --git a/extra/mariabackup/innobackupex.cc b/extra/mariabackup/innobackupex.cc
index 952d1f4ec63..f0e9c06b355 100644
--- a/extra/mariabackup/innobackupex.cc
+++ b/extra/mariabackup/innobackupex.cc
@@ -586,8 +586,8 @@ static struct my_option ibx_long_options[] =
{"stream", OPT_STREAM, "This option specifies the format in which to "
"do the streamed backup. The option accepts a string argument. The "
"backup will be done to STDOUT in the specified format. Currently, "
- "the only supported formats are tar and xbstream. This option is "
- "passed directly to xtrabackup's --stream option.",
+ "the only supported formats are tar and mbstream/xbstream. This "
+ "option is passed directly to xtrabackup's --stream option.",
(uchar*) &ibx_xtrabackup_stream_str,
(uchar*) &ibx_xtrabackup_stream_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -655,7 +655,7 @@ innobackupex [--compress] [--compress-threads=NUMBER-OF-THREADS] [--compress-chu
[--include=REGEXP] [--user=NAME]\n\
[--password=WORD] [--port=PORT] [--socket=SOCKET]\n\
[--no-timestamp] [--ibbackup=IBBACKUP-BINARY]\n\
- [--slave-info] [--galera-info] [--stream=tar|xbstream]\n\
+ [--slave-info] [--galera-info] [--stream=tar|mbstream|xbstream]\n\
[--defaults-file=MY.CNF] [--defaults-group=GROUP-NAME]\n\
[--databases=LIST] [--no-lock] \n\
[--tmpdir=DIRECTORY] [--tables-file=FILE]\n\
@@ -716,7 +716,7 @@ The --decompress command will decompress a backup made\n\
with the --compress option. The\n\
--parallel option will allow multiple files to be decompressed\n\
simultaneously. In order to decompress, the qpress utility MUST be installed\n\
-and accessable within the path. This process will remove the original\n\
+and accessible within the path. This process will remove the original\n\
compressed files and leave the results in the same location.\n\
\n\
On success the exit code innobackupex is 0. A non-zero exit code \n\
@@ -751,7 +751,8 @@ ibx_get_one_option(int optid,
}
break;
case OPT_STREAM:
- if (!strcasecmp(argument, "xbstream"))
+ if (!strcasecmp(argument, "mbstream") ||
+ !strcasecmp(argument, "xbstream"))
xtrabackup_stream_fmt = XB_STREAM_FMT_XBSTREAM;
else {
ibx_msg("Invalid --stream argument: %s\n", argument);
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index bd8ec97deb7..2cfeb87ba79 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -102,6 +102,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include <srv0srv.h>
#include <crc_glue.h>
#include <log.h>
+#include <derror.h>
int sys_var_init();
@@ -904,7 +905,7 @@ struct my_option xb_client_options[] =
{"stream", OPT_XTRA_STREAM, "Stream all backup files to the standard output "
"in the specified format."
- "Supported format is 'xbstream'."
+ "Supported format is 'mbstream' or 'xbstream'."
,
(G_PTR*) &xtrabackup_stream_str, (G_PTR*) &xtrabackup_stream_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -1711,7 +1712,8 @@ xb_get_one_option(int optid,
xtrabackup_target_dir= xtrabackup_real_target_dir;
break;
case OPT_XTRA_STREAM:
- if (!strcasecmp(argument, "xbstream"))
+ if (!strcasecmp(argument, "mbstream") ||
+ !strcasecmp(argument, "xbstream"))
xtrabackup_stream_fmt = XB_STREAM_FMT_XBSTREAM;
else
{
@@ -1969,7 +1971,7 @@ static bool innodb_init_param()
return false;
error:
- msg("mariabackup: innodb_init_param(): Error occured.\n");
+ msg("mariabackup: innodb_init_param(): Error occurred.\n");
return true;
}
@@ -2682,7 +2684,9 @@ static lsn_t xtrabackup_copy_log(lsn_t start_lsn, lsn_t end_lsn, bool last)
}
}
- if (more_data && recv_parse_log_recs(0, STORE_NO, false)) {
+ store_t store = STORE_NO;
+
+ if (more_data && recv_parse_log_recs(0, &store, 0, false)) {
msg("Error: copying the log failed");
@@ -2754,7 +2758,7 @@ static bool xtrabackup_copy_logfile(bool last = false)
log_mutex_exit();
if (!start_lsn) {
- msg(recv_sys->found_corrupt_log
+ die(recv_sys->found_corrupt_log
? "xtrabackup_copy_logfile() failed: corrupt log."
: "xtrabackup_copy_logfile() failed.");
return true;
@@ -3123,13 +3127,13 @@ xb_load_single_table_tablespace(
}
}
- ut_free(name);
-
delete file;
if (err != DB_SUCCESS && xtrabackup_backup && !is_empty_file) {
die("Failed to not validate first page of the file %s, error %d",name, (int)err);
}
+
+ ut_free(name);
}
/** Scan the database directories under the MySQL datadir, looking for
@@ -4226,6 +4230,8 @@ fail_before_log_copying_thread_start:
if (xtrabackup_copy_logfile())
goto fail_before_log_copying_thread_start;
+ DBUG_MARIABACKUP_EVENT("before_innodb_log_copy_thread_started",0);
+
log_copying_stop = os_event_create(0);
os_thread_create(log_copying_thread, NULL, &log_copying_thread_id);
@@ -5851,41 +5857,12 @@ extern void init_signals(void);
#include <sql_locale.h>
-/* Messages . Avoid loading errmsg.sys file */
+
void setup_error_messages()
{
- static const char *my_msgs[ERRORS_PER_RANGE];
- static const char **all_msgs[] = { my_msgs, my_msgs, my_msgs, my_msgs };
my_default_lc_messages = &my_locale_en_US;
- my_default_lc_messages->errmsgs->errmsgs = all_msgs;
-
- /* Populate the necessary error messages */
- struct {
- int id;
- const char *fmt;
- }
- xb_msgs[] =
- {
- { ER_DATABASE_NAME,"Database" },
- { ER_TABLE_NAME,"Table"},
- { ER_PARTITION_NAME, "Partition" },
- { ER_SUBPARTITION_NAME, "Subpartition" },
- { ER_TEMPORARY_NAME, "Temporary"},
- { ER_RENAMED_NAME, "Renamed"},
- { ER_CANT_FIND_DL_ENTRY, "Can't find symbol '%-.128s' in library"},
- { ER_CANT_OPEN_LIBRARY, "Can't open shared library '%-.192s' (errno: %d, %-.128s)" },
- { ER_OUTOFMEMORY, "Out of memory; restart server and try again (needed %d bytes)" },
- { ER_CANT_OPEN_LIBRARY, "Can't open shared library '%-.192s' (errno: %d, %-.128s)" },
- { ER_UDF_NO_PATHS, "No paths allowed for shared library" },
- { ER_CANT_INITIALIZE_UDF,"Can't initialize function '%-.192s'; %-.80s"},
- { ER_PLUGIN_IS_NOT_LOADED,"Plugin '%-.192s' is not loaded" }
- };
-
- for (int i = 0; i < (int)array_elements(all_msgs); i++)
- all_msgs[0][i] = "Unknown error";
-
- for (int i = 0; i < (int)array_elements(xb_msgs); i++)
- all_msgs[0][xb_msgs[i].id - ER_ERROR_FIRST] = xb_msgs[i].fmt;
+ if (init_errmessage())
+ die("could not initialize error messages");
}
void
@@ -6157,6 +6134,8 @@ int main(int argc, char **argv)
(void) pthread_key_delete(THR_THD);
logger.cleanup_base();
+ cleanup_errmsgs();
+ free_error_messages();
mysql_mutex_destroy(&LOCK_error_log);
if (status == EXIT_SUCCESS) {
diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp
index bb3825ca972..61dbbfcee65 100644
--- a/extra/yassl/src/yassl_error.cpp
+++ b/extra/yassl/src/yassl_error.cpp
@@ -242,11 +242,11 @@ void SetErrorString(YasslError error, char* buffer)
strncpy(buffer, "ASN: bad Signature Length", max);
break;
- case UNKOWN_SIG_E :
+ case UNKNOWN_SIG_E :
strncpy(buffer, "ASN: unknown signature OID", max);
break;
- case UNKOWN_HASH_E :
+ case UNKNOWN_HASH_E :
strncpy(buffer, "ASN: unknown hash OID", max);
break;
diff --git a/extra/yassl/taocrypt/include/error.hpp b/extra/yassl/taocrypt/include/error.hpp
index a749c00d80d..080542a5195 100644
--- a/extra/yassl/taocrypt/include/error.hpp
+++ b/extra/yassl/taocrypt/include/error.hpp
@@ -58,8 +58,8 @@ TIME_E = 1030, // "bad TIME"
DATE_SZ_E = 1031, // "bad Date Size"
SIG_LEN_E = 1032, // "bad Signature Length"
-UNKOWN_SIG_E = 1033, // "unknown signature OID"
-UNKOWN_HASH_E = 1034, // "unknown hash OID"
+UNKNOWN_SIG_E = 1033, // "unknown signature OID"
+UNKNOWN_HASH_E = 1034, // "unknown hash OID"
DSA_SZ_E = 1035, // "bad DSA r or s size"
BEFORE_DATE_E = 1036, // "before date in the future"
AFTER_DATE_E = 1037, // "after date in the past"
diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp
index 0a677c4b0f8..ed073567193 100644
--- a/extra/yassl/taocrypt/src/asn.cpp
+++ b/extra/yassl/taocrypt/src/asn.cpp
@@ -1007,7 +1007,7 @@ bool CertDecoder::ConfirmSignature(Source& pub)
}
#endif
else {
- source_.SetError(UNKOWN_SIG_E);
+ source_.SetError(UNKNOWN_SIG_E);
return false;
}
@@ -1132,7 +1132,7 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output)
break;
default:
- error_.SetError(UNKOWN_HASH_E);
+ error_.SetError(UNKNOWN_HASH_E);
return 0;
}
diff --git a/include/intrusive_list.h b/include/intrusive_list.h
new file mode 100644
index 00000000000..d745c6c6c62
--- /dev/null
+++ b/include/intrusive_list.h
@@ -0,0 +1,190 @@
+/*
+ Copyright (c) 2019, 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 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 St, Fifth Floor, Boston, MA 02110-1335 USA
+*/
+
+#pragma once
+
+#include <cstddef>
+#include <iterator>
+
+namespace intrusive
+{
+
+// Derive your class from this struct to insert to a linked list.
+template <class Tag= void> struct list_node
+{
+ list_node(list_node *next= NULL, list_node *prev= NULL)
+ : next(next), prev(prev)
+ {
+ }
+
+ list_node *next;
+ list_node *prev;
+};
+
+// Modelled after std::list<T>
+template <class T, class Tag= void> class list
+{
+public:
+ typedef list_node<Tag> ListNode;
+ class Iterator;
+
+ // All containers in C++ should define these types to implement generic
+ // container interface.
+ typedef T value_type;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef value_type &reference;
+ typedef const value_type &const_reference;
+ typedef T *pointer;
+ typedef const T *const_pointer;
+ typedef Iterator iterator;
+ typedef Iterator const_iterator; /* FIXME */
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const iterator> const_reverse_iterator;
+
+ class Iterator
+ {
+ public:
+ // All iterators in C++ should define these types to implement generic
+ // iterator interface.
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef T value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef T *pointer;
+ typedef T &reference;
+
+ Iterator(ListNode *node) : node_(node) {}
+
+ Iterator &operator++()
+ {
+ node_= node_->next;
+ return *this;
+ }
+ Iterator operator++(int)
+ {
+ Iterator tmp(*this);
+ operator++();
+ return tmp;
+ }
+
+ Iterator &operator--()
+ {
+ node_= node_->prev;
+ return *this;
+ }
+ Iterator operator--(int)
+ {
+ Iterator tmp(*this);
+ operator--();
+ return tmp;
+ }
+
+ reference operator*() { return *static_cast<pointer>(node_); }
+ pointer operator->() { return static_cast<pointer>(node_); }
+
+ bool operator==(const Iterator &rhs) { return node_ == rhs.node_; }
+ bool operator!=(const Iterator &rhs) { return !(*this == rhs); }
+
+ private:
+ ListNode *node_;
+
+ friend class list;
+ };
+
+ list() : sentinel_(&sentinel_, &sentinel_), size_(0) {}
+
+ reference front() { return *begin(); }
+ reference back() { return *--end(); }
+ const_reference front() const { return *begin(); }
+ const_reference back() const { return *--end(); }
+
+ iterator begin() { return iterator(sentinel_.next); }
+ const_iterator begin() const
+ {
+ return iterator(const_cast<ListNode *>(sentinel_.next));
+ }
+ iterator end() { return iterator(&sentinel_); }
+ const_iterator end() const
+ {
+ 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()); }
+
+ bool empty() const { return size_ == 0; }
+ size_type size() const { return size_; }
+
+ void clear()
+ {
+ sentinel_.next= &sentinel_;
+ sentinel_.prev= &sentinel_;
+ size_= 0;
+ }
+
+ iterator insert(iterator pos, reference value)
+ {
+ ListNode *curr= pos.node_;
+ ListNode *prev= pos.node_->prev;
+
+ prev->next= &value;
+ curr->prev= &value;
+
+ static_cast<ListNode &>(value).prev= prev;
+ static_cast<ListNode &>(value).next= curr;
+
+ ++size_;
+ return iterator(&value);
+ }
+
+ iterator erase(iterator pos)
+ {
+ ListNode *prev= pos.node_->prev;
+ ListNode *next= pos.node_->next;
+
+ prev->next= next;
+ next->prev= prev;
+
+ // This is not required for list functioning. But maybe it'll prevent bugs
+ // and ease debugging.
+ ListNode *curr= pos.node_;
+ curr->prev= NULL;
+ curr->next= NULL;
+
+ --size_;
+ return next;
+ }
+
+ void push_back(reference value) { insert(end(), value); }
+ void pop_back() { erase(end()); }
+
+ void push_front(reference value) { insert(begin(), value); }
+ void pop_front() { erase(begin()); }
+
+ // STL version is O(n) but this is O(1) because an element can't be inserted
+ // several times in the same intrusive list.
+ void remove(reference value) { erase(iterator(&value)); }
+
+private:
+ ListNode sentinel_;
+ size_type size_;
+};
+
+} // namespace intrusive
diff --git a/include/lf.h b/include/lf.h
index e4cad7eabb3..10a60c5c949 100644
--- a/include/lf.h
+++ b/include/lf.h
@@ -65,7 +65,6 @@ typedef struct {
typedef struct {
void * volatile pin[LF_PINBOX_PINS];
LF_PINBOX *pinbox;
- void **stack_ends_here;
void *purgatory;
uint32 purgatory_count;
uint32 volatile link;
diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index a206003ad7f..1d2ec34fc98 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h
index e60da6953df..1eb19f8f684 100644
--- a/include/mysql/psi/mysql_idle.h
+++ b/include/mysql/psi/mysql_idle.h
@@ -2,13 +2,20 @@
Copyright (c) 2017, 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 Foundation; version 2 of the License.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h
index 086df145e59..1277b97a52a 100644
--- a/include/mysql/psi/mysql_socket.h
+++ b/include/mysql/psi/mysql_socket.h
@@ -1,15 +1,21 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 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 Foundation; version 2 of the
-License.
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License, version 2.0,
+as published by the Free Software Foundation.
+
+This program is also distributed with certain software (including
+but not limited to OpenSSL) that is licensed under separate terms,
+as designated in a particular file or component or in included license
+documentation. The authors of MySQL hereby grant you an additional
+permission to link the program and your derivative works with the
+separately licensed software that they have included with MySQL.
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.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License, version 2.0, 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
diff --git a/include/mysql/psi/mysql_stage.h b/include/mysql/psi/mysql_stage.h
index b6ab09fef55..1dbaed6c682 100644
--- a/include/mysql/psi/mysql_stage.h
+++ b/include/mysql/psi/mysql_stage.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/include/mysql/psi/mysql_statement.h b/include/mysql/psi/mysql_statement.h
index 509c9371fe1..6d38131ea99 100644
--- a/include/mysql/psi/mysql_statement.h
+++ b/include/mysql/psi/mysql_statement.h
@@ -2,13 +2,20 @@
Copyright (c) 2017, 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 Foundation; version 2 of the License.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/include/mysql/psi/mysql_table.h b/include/mysql/psi/mysql_table.h
index 104f8567b5b..c1244e38866 100644
--- a/include/mysql/psi/mysql_table.h
+++ b/include/mysql/psi/mysql_table.h
@@ -2,13 +2,20 @@
Copyright (c) 2017, 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 Foundation; version 2 of the License.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h
index 9a987cf992b..eab87402140 100644
--- a/include/mysql/psi/mysql_thread.h
+++ b/include/mysql/psi/mysql_thread.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2013, Oracle and/or its affiliates.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h
index 8f412982ae2..238471c7af1 100644
--- a/include/mysql/psi/psi.h
+++ b/include/mysql/psi/psi.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/include/mysql/psi/psi_abi_v0.h b/include/mysql/psi/psi_abi_v0.h
index 0601b61a5c7..ca4373f847b 100644
--- a/include/mysql/psi/psi_abi_v0.h
+++ b/include/mysql/psi/psi_abi_v0.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/include/mysql/psi/psi_abi_v1.h b/include/mysql/psi/psi_abi_v1.h
index 2d5e81f5972..488e832c3ed 100644
--- a/include/mysql/psi/psi_abi_v1.h
+++ b/include/mysql/psi/psi_abi_v1.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/include/mysql/psi/psi_abi_v2.h b/include/mysql/psi/psi_abi_v2.h
index 420cc63fc13..67c054848a1 100644
--- a/include/mysql/psi/psi_abi_v2.h
+++ b/include/mysql/psi/psi_abi_v2.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/include/sslopt-case.h b/include/sslopt-case.h
index fe53088e89b..fe83051c275 100644
--- a/include/sslopt-case.h
+++ b/include/sslopt-case.h
@@ -30,7 +30,7 @@
*/
opt_use_ssl= 1;
/* crl has no effect in yaSSL */
-#ifdef HAVE_YASSL
+#if defined (HAVE_YASSL) && (!defined (_WIN32) || defined (MYSQL_SERVER))
opt_ssl_crl= NULL;
opt_ssl_crlpath= NULL;
#endif
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 7a1e284b3e7..f36da7c8915 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2012, Monty Program Ab
+# 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
@@ -21,11 +21,11 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1
mysql_secure_installation.1 mysql_setpermission.1
mysql_tzinfo_to_sql.1 mysql_upgrade.1
mysqld_multi.1 mysqld_safe.1 mysqldumpslow.1 mysqlhotcopy.1
- mysqltest.1 perror.1 replace.1 resolve_stack_dump.1
+ perror.1 replace.1 resolve_stack_dump.1
resolveip.1 mariadb-service-convert.1
- mysqld_safe_helper.1 tokuftdump.1 wsrep_sst_common.1
+ mysqld_safe_helper.1 wsrep_sst_common.1
wsrep_sst_mysqldump.1 wsrep_sst_rsync.1
- galera_recovery.1 galera_new_cluster.1 tokuft_logprint.1
+ galera_recovery.1 galera_new_cluster.1
mysql_ldb.1
wsrep_sst_mariabackup.1 mbstream.1 mariabackup.1
wsrep_sst_rsync_wan.1)
@@ -36,7 +36,8 @@ SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
mysql_plugin.1 mysql_embedded.1)
SET(MAN1_DEVEL mysql_config.1)
SET(MAN1_TEST mysql-stress-test.pl.1 mysql-test-run.pl.1 mysql_client_test.1
- mysqltest_embedded.1 mysql_client_test_embedded.1 my_safe_process.1)
+ mysqltest.1 mysqltest_embedded.1 mysql_client_test_embedded.1
+ my_safe_process.1)
INSTALL(FILES ${MAN1_SERVER} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesServer)
INSTALL(FILES ${MAN8_SERVER} DESTINATION ${INSTALL_MANDIR}/man8 COMPONENT ManPagesServer)
diff --git a/man/mysql-test-run.pl.1 b/man/mysql-test-run.pl.1
index 64995754718..6ef197a9d66 100644
--- a/man/mysql-test-run.pl.1
+++ b/man/mysql-test-run.pl.1
@@ -1937,8 +1937,10 @@ Run stress test, providing options to mysql\-stress\-test\&.pl\&. Options are se
.\" suite option: mysql-test-run.pl
\fB\-\-suite[s]=\fR\fB\fIsuite_name...\fR\fR
.sp
-Comma separated list of suite names to run. The default is: "main-,archive-,binlog-,csv-,federated-,funcs_1-,funcs_2-,handler-,heap-,innodb-,innodb_fts-,
-innodb_zip-,maria-,multi_source-,optimizer_unfixed_bugs-,parts-,perfschema-,
+Comma separated list of suite names to run. The default is:
+"main-,archive-,binlog-,csv-,federated-,funcs_1-,funcs_2-,
+handler-,heap-,innodb-,innodb_fts-,innodb_zip-,maria-,
+multi_source-,optimizer_unfixed_bugs-,parts-,perfschema-,
plugins-,roles-,rpl-,sys_vars-,unit-,vcol-"\&.
.RE
.sp
diff --git a/mysql-test/include/binlog_inject_error.inc b/mysql-test/include/binlog_inject_error.inc
index 383f66ba843..ce940352723 100644
--- a/mysql-test/include/binlog_inject_error.inc
+++ b/mysql-test/include/binlog_inject_error.inc
@@ -13,10 +13,10 @@
# let query= 'CREATE TABLE t1 (a INT)';
# source include/binlog_inject_error.inc;
#
-
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
--echo $query;
--replace_regex /(errno: .*)/(errno: #)/
--error ER_ERROR_ON_WRITE
--eval $query
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
diff --git a/mysql-test/include/binlog_parallel_replication_marks.test b/mysql-test/include/binlog_parallel_replication_marks.test
index 82fa997822d..3976088ca43 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 /GTID|BEGIN|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY/;
+ print if /\b(GTID|BEGIN|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY)\b/;
}
close F;
EOF
diff --git a/mysql-test/include/partition_mrr.inc b/mysql-test/include/partition_mrr.inc
index 4c285791ec7..f372cccfdd2 100644
--- a/mysql-test/include/partition_mrr.inc
+++ b/mysql-test/include/partition_mrr.inc
@@ -36,11 +36,103 @@ insert into t3 select
123456
from t1 A, t1 B;
+set @save_optimizer_switch=@@optimizer_switch;
+
set optimizer_switch='mrr=on';
--replace_column 9 #
explain
select * from t3 force index (key_col) where key_col < 3;
select * from t3 force index (key_col) where key_col < 3;
+set optimizer_switch=@save_optimizer_switch;
+
drop table t1,t3;
+--echo #
+--echo # MDEV-21544: partitioned table is joined with BKA+MRR
+--echo #
+
+set @save_join_cache_level=@@join_cache_level;
+set @save_optimizer_switch=@@optimizer_switch;
+
+create table t0 (
+ tp int, a int, b int not null, c varchar(12), index idx (a,b)
+);
+insert into t0 values
+(1,3,30,'yyzy'), (1,3,30,'yxxyy'), (1,3,30,'yyxy'), (1,3,30,'xxyy'),
+(1,3,30,'yyxz'), (1,3,30,'yyzz'), (1,3,30,'xxyzy'), (1,3,30,'yyyy'),
+(1,3,30,'yzzy'), (1,93,30,'zzzy'),
+(2,3,40,'yxx'), (2,4,40,'xx'), (2,3,10,'zxz'),
+(2,3,40,'yyx'), (2,4,40,'xxx'), (2,3,10,'zyyz'),
+(2,3,40,'xzzzz'), (2,4,40,'yyyxx'), (2,3,10,'zyz'),
+(2,3,40,'xxx'), (2,4,40,'xx'), (2,3,10,'zzz'),
+(2,3,40,'yyxzx'), (2,4,40,'xyx'), (2,3,10,'xzz'),
+(2,3,40,'xxxzz'), (2,4,40,'xxz'), (2,3,10,'zzzy'),
+(2,3,40,'zzxxx'), (2,4,40,'zxx'), (2,3,10,'yzzz'),
+(2,3,40,'xyyxx'), (2,4,40,'xzzzx'), (2,3,10,'zzxxz'),
+(2,3,40,'yzxxx'), (2,4,40,'xxzy'), (2,3,10,'zzzyx'),
+(2,93,40,'xzx'), (2,94,40,'xz'), (2,93,10,'zyyyz'),
+(3,4,30,'yx'), (3,4,30,'yyxxx'), (3,4,30,'zzyy'), (3,4,30,'zxyy'),
+(3,4,30,'xxyy'), (3,4,30,'yyzx'), (3,4,30,'zyyy'), (3,4,30,'yzy'),
+(3,4,30,'zzzyy'), (3,94,30,'yyz');
+
+create table t1 (
+ tp int, a int, b int not null, c varchar(12), index idx (a,b)
+)
+partition by list (tp)
+( partition p1 values in (1),
+ partition p2 values in (2),
+ partition p3 values in (3));
+insert into t1 select * from t0;
+
+# tables t0 and t1 contain the same set of records.
+
+create table t2 (a int, index idx(a));
+insert into t2 values
+(1), (2), (3), (4), (5);
+insert into t2 select a+10 from t2;
+insert into t2 select a+20 from t2;
+
+analyze table t0,t1,t2;
+
+set join_cache_level=6;
+set optimizer_switch='mrr=on';
+
+let $q1=
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
+eval explain extended $q1;
+eval $q1;
+
+let $q2=
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = t2.a-1;
+eval explain extended $q2;
+eval $q2;
+
+let $q1=
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
+eval explain extended $q1;
+eval $q1;
+
+let $q2=
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
+eval explain extended $q2;
+eval $q2;
+
+insert into t2 values
+(3), (4), (5);
+analyze table t2;
+
+let $q1=
+select * from t2 left join t0 on t2.a=t0.a where t2.a in (3,4) and t0.b is null;
+eval explain extended $q1;
+eval $q1;
+
+let $q2=
+select * from t2 left join t1 on t2.a=t1.a where t2.a in (3,4) and t1.b is null;
+eval explain extended $q2;
+eval $q2;
+
+set join_cache_level=@save_join_cache_level;
+set optimizer_switch=@save_optimizer_switch;
+
+drop table t0,t1,t2;
diff --git a/mysql-test/main/alter_user.result b/mysql-test/main/alter_user.result
index 76f811f18c7..7ba9549e73c 100644
--- a/mysql-test/main/alter_user.result
+++ b/mysql-test/main/alter_user.result
@@ -43,7 +43,7 @@ SET GLOBAL read_only = @start_read_only;
alter user boo;
ERROR HY000: Operation ALTER USER failed for 'boo'
#--warning ER_CANNOT_USER
-alter if exists user boo;
+alter user if exists boo;
Warnings:
Error 1133 Can't find any matching row in the user table
Note 1396 Operation ALTER USER failed for 'boo'
diff --git a/mysql-test/main/alter_user.test b/mysql-test/main/alter_user.test
index ca444f70a70..3a1052a98f6 100644
--- a/mysql-test/main/alter_user.test
+++ b/mysql-test/main/alter_user.test
@@ -41,7 +41,7 @@ SET GLOBAL read_only = @start_read_only;
--error ER_CANNOT_USER
alter user boo;
--echo #--warning ER_CANNOT_USER
-alter if exists user boo;
+alter user if exists boo;
--echo # Test password related altering.
alter user foo identified by 'something';
diff --git a/mysql-test/main/cache_temporal_4265.result b/mysql-test/main/cache_temporal_4265.result
index 7f215de43fb..1cda7004a6f 100644
--- a/mysql-test/main/cache_temporal_4265.result
+++ b/mysql-test/main/cache_temporal_4265.result
@@ -1,13 +1,12 @@
create table t1 (a date);
insert t1 values ('2000-01-02'), ('2001-02-03'), ('2002-03-04');
-set debug_dbug='d,str_to_datetime_warn';
+SET STATEMENT debug_dbug='d,str_to_datetime_warn' for
select * from t1 where a > date_add('2000-01-01', interval 5 day);
a
2001-02-03
2002-03-04
Warnings:
Note 1003 2000-01-01
-set debug_dbug='';
drop table t1;
create table t1 (id int not null, ut timestamp(6) not null);
insert into t1 values(1, '2001-01-01 00:00:00.2');
diff --git a/mysql-test/main/cache_temporal_4265.test b/mysql-test/main/cache_temporal_4265.test
index c62f3c3c506..1af683c617b 100644
--- a/mysql-test/main/cache_temporal_4265.test
+++ b/mysql-test/main/cache_temporal_4265.test
@@ -5,9 +5,9 @@
create table t1 (a date);
insert t1 values ('2000-01-02'), ('2001-02-03'), ('2002-03-04');
-set debug_dbug='d,str_to_datetime_warn';
-select * from t1 where a > date_add('2000-01-01', interval 5 day);
-set debug_dbug='';
+
+SET STATEMENT debug_dbug='d,str_to_datetime_warn' for
+ select * from t1 where a > date_add('2000-01-01', interval 5 day);
drop table t1;
#
diff --git a/mysql-test/main/connect.result b/mysql-test/main/connect.result
index 057105d192f..82007994eed 100644
--- a/mysql-test/main/connect.result
+++ b/mysql-test/main/connect.result
@@ -108,12 +108,12 @@ update mysql.user set password=old_password("gambling2") where user=_binary"test
flush privileges;
show grants for test@localhost;
Grants for test@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
+GRANT ALL PRIVILEGES ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
update mysql.user set plugin='mysql_old_password' where user='test';
flush privileges;
show grants for test@localhost;
Grants for test@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
+GRANT ALL PRIVILEGES ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
connect con10,localhost,test,gambling2,;
connect con5,localhost,test,gambling2,mysql;
connection con5;
diff --git a/mysql-test/main/connect_debug.result b/mysql-test/main/connect_debug.result
index 6c066c16731..cc3da50ec6b 100644
--- a/mysql-test/main/connect_debug.result
+++ b/mysql-test/main/connect_debug.result
@@ -8,3 +8,13 @@ create user 'bad' identified by 'worse';
ERROR 1045 (28000): Plugin foo/bar could not be loaded: invalid plugin name
set global debug_dbug=@old_dbug;
drop user bad;
+set global debug_dbug='+d,increase_srv_handshake_scramble_len';
+connect(localhost,root,,test,MASTER_MYPORT,MYSQL_TMP_DIR/mysqld.1.sock);
+connect con1,localhost,root;
+ERROR HY000: received malformed packet
+set global debug_dbug=@old_dbug;
+set global debug_dbug='+d,poison_srv_handshake_scramble_len';
+connect(localhost,root,,test,MASTER_MYPORT,MYSQL_TMP_DIR/mysqld.1.sock);
+connect con2,localhost,root;
+ERROR HY000: received malformed packet
+set global debug_dbug=@old_dbug;
diff --git a/mysql-test/main/connect_debug.test b/mysql-test/main/connect_debug.test
index 300a2de0fbd..169ba6e9fff 100644
--- a/mysql-test/main/connect_debug.test
+++ b/mysql-test/main/connect_debug.test
@@ -22,3 +22,18 @@ create user 'bad' identified by 'worse';
--exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse 2>&1
set global debug_dbug=@old_dbug;
drop user bad;
+
+#
+# Bug#29630767 - USE OF UNINITIALIZED VALUE IN LIBMYSQL (CLIENT.CC FUNCTION RUN_PLUGIN_AUTH)
+#
+set global debug_dbug='+d,increase_srv_handshake_scramble_len';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $MASTER_MYPORT MASTER_MYPORT
+--error 2027
+connect con1,localhost,root;
+set global debug_dbug=@old_dbug;
+
+set global debug_dbug='+d,poison_srv_handshake_scramble_len';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $MASTER_MYPORT MASTER_MYPORT
+--error 2027
+connect con2,localhost,root;
+set global debug_dbug=@old_dbug;
diff --git a/mysql-test/main/create.result b/mysql-test/main/create.result
index d490457dd62..f0ea2f4d237 100644
--- a/mysql-test/main/create.result
+++ b/mysql-test/main/create.result
@@ -945,7 +945,7 @@ drop table t1;
Bug #26104 Bug on foreign key class constructor
-Check that ref_columns is initalized correctly in the constructor
+Check that ref_columns is initialized correctly in the constructor
and semantic checks in mysql_prepare_table work.
We do not need a storage engine that supports foreign keys
diff --git a/mysql-test/main/create.test b/mysql-test/main/create.test
index 6b91a84197f..7611505b9ef 100644
--- a/mysql-test/main/create.test
+++ b/mysql-test/main/create.test
@@ -846,7 +846,7 @@ drop table t1;
--echo
--echo Bug #26104 Bug on foreign key class constructor
--echo
---echo Check that ref_columns is initalized correctly in the constructor
+--echo Check that ref_columns is initialized correctly in the constructor
--echo and semantic checks in mysql_prepare_table work.
--echo
--echo We do not need a storage engine that supports foreign keys
diff --git a/mysql-test/main/create_or_replace2.result b/mysql-test/main/create_or_replace2.result
index 47431212492..6be0d46bdc1 100644
--- a/mysql-test/main/create_or_replace2.result
+++ b/mysql-test/main/create_or_replace2.result
@@ -4,9 +4,9 @@ drop table if exists t1;
SET @old_debug= @@session.debug;
CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB;
CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam;
-set debug_dbug='+d,send_kill_after_delete';
+SET debug_dbug='+d,send_kill_after_delete';
CREATE OR REPLACE TABLE t1 LIKE tmp;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
SHOW TABLES;
Tables_in_test
t1
diff --git a/mysql-test/main/create_or_replace2.test b/mysql-test/main/create_or_replace2.test
index 199e5523811..80c8b635d8d 100644
--- a/mysql-test/main/create_or_replace2.test
+++ b/mysql-test/main/create_or_replace2.test
@@ -19,9 +19,9 @@ SET @old_debug= @@session.debug;
CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB;
CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam;
-set debug_dbug='+d,send_kill_after_delete';
+SET debug_dbug='+d,send_kill_after_delete';
CREATE OR REPLACE TABLE t1 LIKE tmp;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
SHOW TABLES;
show create table t1;
--sync_slave_with_master
diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result
index d6904b8a70a..ff5a6f15597 100644
--- a/mysql-test/main/cte_nonrecursive.result
+++ b/mysql-test/main/cte_nonrecursive.result
@@ -1673,3 +1673,21 @@ with columns as (select 1 as t) select * from columns;
t
1
use test;
+#
+# MDEV-18460: Server crashed in strmake / tdc_create_key /
+# THD::create_tmp_table_def_key
+#
+connect con1,localhost,root,,;
+CREATE TEMPORARY TABLE test.t (a INT);
+WITH cte AS (SELECT 1) SELECT * FROM cte;
+1
+1
+WITH t AS (SELECT 1) SELECT * FROM t;
+1
+1
+WITH cte AS (SELECT 1) SELECT * FROM t;
+ERROR 3D000: No database selected
+DROP TABLE test.t;
+connection default;
+disconnect con1;
+# End of 10.2 tests
diff --git a/mysql-test/main/cte_nonrecursive.test b/mysql-test/main/cte_nonrecursive.test
index bd8af55071a..41a5b815bc7 100644
--- a/mysql-test/main/cte_nonrecursive.test
+++ b/mysql-test/main/cte_nonrecursive.test
@@ -1182,3 +1182,23 @@ with t as (select 1 as t) select * from t;
with columns as (select 1 as t) select * from columns;
use test;
+
+--echo #
+--echo # MDEV-18460: Server crashed in strmake / tdc_create_key /
+--echo # THD::create_tmp_table_def_key
+--echo #
+
+--connect con1,localhost,root,,
+--change_user root,,
+
+CREATE TEMPORARY TABLE test.t (a INT);
+WITH cte AS (SELECT 1) SELECT * FROM cte;
+WITH t AS (SELECT 1) SELECT * FROM t;
+--error ER_NO_DB_ERROR
+WITH cte AS (SELECT 1) SELECT * FROM t;
+DROP TABLE test.t;
+
+--connection default
+--disconnect con1
+
+--echo # End of 10.2 tests
diff --git a/mysql-test/main/default_session.result b/mysql-test/main/default_session.result
index 6c0bcad0cb3..1b0c5f3f67a 100644
--- a/mysql-test/main/default_session.result
+++ b/mysql-test/main/default_session.result
@@ -92,3 +92,31 @@ a
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
drop table t1;
+set time_zone='+00:00';
+create table t1 (a int, b datetime default from_unixtime(a), c datetime);
+insert t1 (a, c) values (1569495327, from_unixtime(1569495327));
+set time_zone='+01:00';
+insert t1 (a, c) values (1569495327, from_unixtime(1569495327));
+flush tables;
+insert t1 (a, c) values (1569495327, from_unixtime(1569495327));
+select * from t1;
+a b c
+1569495327 2019-09-26 10:55:27 2019-09-26 10:55:27
+1569495327 2019-09-26 11:55:27 2019-09-26 11:55:27
+1569495327 2019-09-26 11:55:27 2019-09-26 11:55:27
+drop table t1;
+set time_zone = "+00:00";
+create table t1 (a int, b timestamp as (from_unixtime(a)) virtual);
+insert into t1 (a) value (1569495327);
+select a, b, from_unixtime(a) from t1;
+a b from_unixtime(a)
+1569495327 2019-09-26 10:55:27 2019-09-26 10:55:27
+set time_zone = "+01:00";
+select a, b, from_unixtime(a) from t1;
+a b from_unixtime(a)
+1569495327 2019-09-26 11:55:27 2019-09-26 11:55:27
+flush tables;
+select a, b, from_unixtime(a) from t1;
+a b from_unixtime(a)
+1569495327 2019-09-26 11:55:27 2019-09-26 11:55:27
+drop table t1;
diff --git a/mysql-test/main/default_session.test b/mysql-test/main/default_session.test
index 7796354ffd4..5e582bd5ca1 100644
--- a/mysql-test/main/default_session.test
+++ b/mysql-test/main/default_session.test
@@ -80,3 +80,27 @@ insert t1 () values ();
set sql_mode=default;
select * from t1;
drop table t1;
+
+#
+# MDEV-21249 MariaDB 10.3.10 When referring to bigint to generate timestamp data in the virtual generated column, the value of the generated column does not change when the time zone changes
+#
+set time_zone='+00:00';
+create table t1 (a int, b datetime default from_unixtime(a), c datetime);
+insert t1 (a, c) values (1569495327, from_unixtime(1569495327));
+set time_zone='+01:00';
+insert t1 (a, c) values (1569495327, from_unixtime(1569495327));
+flush tables;
+insert t1 (a, c) values (1569495327, from_unixtime(1569495327));
+select * from t1;
+drop table t1;
+
+# same with vcols
+set time_zone = "+00:00";
+create table t1 (a int, b timestamp as (from_unixtime(a)) virtual);
+insert into t1 (a) value (1569495327);
+select a, b, from_unixtime(a) from t1;
+set time_zone = "+01:00";
+select a, b, from_unixtime(a) from t1;
+flush tables;
+select a, b, from_unixtime(a) from t1;
+drop table t1;
diff --git a/mysql-test/main/delete_use_source.result b/mysql-test/main/delete_use_source.result
index 08da8901528..ae2f7b93208 100644
--- a/mysql-test/main/delete_use_source.result
+++ b/mysql-test/main/delete_use_source.result
@@ -1,4 +1,5 @@
-create table t1(c1 integer not null,c2 integer not null, key (c1)) engine=InnoDb;
+create table t1(c1 integer not null,c2 integer not null, key (c1))
+ENGINE=InnoDB STATS_PERSISTENT=1;
create view v1 as select * from t1 where c1 in (0,1);
insert t1 select 0,seq from seq_1_to_500;
insert t1 select 1,seq from seq_1_to_100;
@@ -47,8 +48,8 @@ rollback;
start transaction;
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL c1 NULL NULL NULL 502 Using where
-2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 58 Using index
+1 PRIMARY t1 range c1 c1 4 NULL 600 Using where
+2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 83 Using index
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
affected rows: 1
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
@@ -63,8 +64,8 @@ rollback;
start transaction;
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL c1 NULL NULL NULL 502 Using where
-2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 58 Using index
+1 PRIMARY t1 ALL c1 NULL NULL NULL 670 Using where
+2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 83 Using index
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 ;
affected rows: 500
select count(*) from v1 where c1=0;
diff --git a/mysql-test/main/delete_use_source.test b/mysql-test/main/delete_use_source.test
index 9b7b1f8650c..ed4c62b090c 100644
--- a/mysql-test/main/delete_use_source.test
+++ b/mysql-test/main/delete_use_source.test
@@ -2,7 +2,8 @@
--source include/have_innodb.inc
# This test is slow on buildbot.
--source include/big_test.inc
-create table t1(c1 integer not null,c2 integer not null, key (c1)) engine=InnoDb;
+create table t1(c1 integer not null,c2 integer not null, key (c1))
+ENGINE=InnoDB STATS_PERSISTENT=1;
create view v1 as select * from t1 where c1 in (0,1);
insert t1 select 0,seq from seq_1_to_500;
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result
index ea8400f8302..1ae78aea875 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -10568,6 +10568,36 @@ EXPLAIN
}
DROP TABLE t1;
DROP VIEW v1;
+#
+# MDEV-21388 Wrong result of DAYNAME()=xxx in combination with condition_pushdown_for_derived=on
+#
+CREATE TABLE t1 (a INT, b DATE, c INT);
+INSERT INTO t1 VALUES
+(1,'2001-01-21',345),
+(6,'2001-01-20',315),
+(6,'2001-01-20',214);
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t2 VALUES (2,19), (7,20);
+CREATE VIEW v1 AS SELECT a, b, max(c) AS max_c FROM t1
+GROUP BY a,b HAVING max_c < 707;
+SELECT *, dayname(v1.b) FROM v1,t2 WHERE (v1.max_c>214) AND (t2.a>v1.a);
+a b max_c a b dayname(v1.b)
+1 2001-01-21 345 2 19 Sunday
+1 2001-01-21 345 7 20 Sunday
+6 2001-01-20 315 7 20 Saturday
+SET optimizer_switch='condition_pushdown_for_derived=off';
+SELECT *, dayname(v1.b) FROM v1,t2 WHERE (v1.max_c>214) AND (t2.a>v1.a) AND dayname(v1.b)='Sunday';
+a b max_c a b dayname(v1.b)
+1 2001-01-21 345 2 19 Sunday
+1 2001-01-21 345 7 20 Sunday
+SET optimizer_switch='condition_pushdown_for_derived=on';
+SELECT *, dayname(v1.b) FROM v1,t2 WHERE (v1.max_c>214) AND (t2.a>v1.a) AND dayname(v1.b)='Sunday';
+a b max_c a b dayname(v1.b)
+1 2001-01-21 345 2 19 Sunday
+1 2001-01-21 345 7 20 Sunday
+DROP VIEW v1;
+DROP TABLE t1, t2;
+SET optimizer_switch=DEFAULT;
# End of 10.2 tests
#
# MDEV-14579: pushdown conditions into materialized views/derived tables
@@ -16799,4 +16829,93 @@ id username id userid logindate
2 user2 3 2 2017-06-19 12:17:02
set join_cache_level=default;
DROP TABLE t1,t2;
+#
+# MDEV-21614: potentially splittable materialized derived/view
+# within materialized semi-join
+#
+create table t1 (
+id int not null auto_increment primary key,
+a int not null
+) engine=myisam;
+create table t2 (
+id int not null auto_increment primary key,
+ro_id int not null,
+flag int not null, key (ro_id)
+) engine=myisam;
+insert into t1(a) select seq+100 from seq_1_to_20;
+insert into t2(ro_id,flag) select seq, 1 from seq_1_to_20;
+insert into t2(ro_id,flag) select seq, 0 from seq_1_to_20;
+create view v1 as
+select t1.* from t1 left join t2 on (t1.id = t2.ro_id AND t2.flag = 1)
+group by t1.id;
+select id, a from t1 where id in (select id from v1);
+id a
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+10 110
+11 111
+12 112
+13 113
+14 114
+15 115
+16 116
+17 117
+18 118
+19 119
+20 120
+explain extended select id, a from t1 where id in (select id from v1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00
+1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1)
+3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00
+3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`v1`) where `v1`.`id` = `test`.`t1`.`id`
+select id, a from t1
+where id in (select id
+from (select t1.* from t1 left join t2
+on (t1.id = t2.ro_id AND t2.flag = 1)
+group by t1.id) dt);
+id a
+1 101
+2 102
+3 103
+4 104
+5 105
+6 106
+7 107
+8 108
+9 109
+10 110
+11 111
+12 112
+13 113
+14 114
+15 115
+16 116
+17 117
+18 118
+19 119
+20 120
+explain extended select id, a from t1
+where id in (select id
+from (select t1.* from t1 left join t2
+on (t1.id = t2.ro_id AND t2.flag = 1)
+group by t1.id) dt);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00
+1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1)
+3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00
+3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`ro_id` = `test`.`t1`.`id` and `test`.`t2`.`flag` = 1) where `test`.`t1`.`id` = `test`.`t1`.`id` group by `test`.`t1`.`id`) `dt`) where `dt`.`id` = `test`.`t1`.`id`
+drop view v1;
+drop table t1,t2;
# End of 10.3 tests
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index 6ee85df7ea5..525122e6cd7 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -1,3 +1,4 @@
+--source include/have_sequence.inc
--source include/default_optimizer_switch.inc
let $no_pushdown= set statement optimizer_switch='condition_pushdown_for_derived=off' for;
set @@join_buffer_size=256*1024;
@@ -2140,6 +2141,34 @@ SELECT * FROM (SELECT 1 FROM v1 UNION (SELECT 1 FROM v1 WHERE @a := uuid())) dt;
DROP TABLE t1;
DROP VIEW v1;
+--echo #
+--echo # MDEV-21388 Wrong result of DAYNAME()=xxx in combination with condition_pushdown_for_derived=on
+--echo #
+
+CREATE TABLE t1 (a INT, b DATE, c INT);
+INSERT INTO t1 VALUES
+ (1,'2001-01-21',345),
+ (6,'2001-01-20',315),
+ (6,'2001-01-20',214);
+
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t2 VALUES (2,19), (7,20);
+CREATE VIEW v1 AS SELECT a, b, max(c) AS max_c FROM t1
+ GROUP BY a,b HAVING max_c < 707;
+
+SELECT *, dayname(v1.b) FROM v1,t2 WHERE (v1.max_c>214) AND (t2.a>v1.a);
+
+SET optimizer_switch='condition_pushdown_for_derived=off';
+SELECT *, dayname(v1.b) FROM v1,t2 WHERE (v1.max_c>214) AND (t2.a>v1.a) AND dayname(v1.b)='Sunday';
+
+SET optimizer_switch='condition_pushdown_for_derived=on';
+SELECT *, dayname(v1.b) FROM v1,t2 WHERE (v1.max_c>214) AND (t2.a>v1.a) AND dayname(v1.b)='Sunday';
+
+DROP VIEW v1;
+DROP TABLE t1, t2;
+
+SET optimizer_switch=DEFAULT;
+
--echo # End of 10.2 tests
--echo #
@@ -3300,4 +3329,46 @@ set join_cache_level=default;
DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-21614: potentially splittable materialized derived/view
+--echo # within materialized semi-join
+--echo #
+
+create table t1 (
+ id int not null auto_increment primary key,
+ a int not null
+) engine=myisam;
+
+create table t2 (
+ id int not null auto_increment primary key,
+ ro_id int not null,
+ flag int not null, key (ro_id)
+) engine=myisam;
+
+insert into t1(a) select seq+100 from seq_1_to_20;
+insert into t2(ro_id,flag) select seq, 1 from seq_1_to_20;
+insert into t2(ro_id,flag) select seq, 0 from seq_1_to_20;
+
+create view v1 as
+select t1.* from t1 left join t2 on (t1.id = t2.ro_id AND t2.flag = 1)
+ group by t1.id;
+
+let $q1=
+select id, a from t1 where id in (select id from v1);
+eval $q1;
+eval explain extended $q1;
+
+let $q2=
+select id, a from t1
+ where id in (select id
+ from (select t1.* from t1 left join t2
+ on (t1.id = t2.ro_id AND t2.flag = 1)
+ group by t1.id) dt);
+eval $q2;
+eval explain extended $q2;
+
+drop view v1;
+drop table t1,t2;
+
--echo # End of 10.3 tests
diff --git a/mysql-test/main/disabled.def b/mysql-test/main/disabled.def
index 93fff886791..8ba5b271c2b 100644
--- a/mysql-test/main/disabled.def
+++ b/mysql-test/main/disabled.def
@@ -14,8 +14,6 @@ events_time_zone : Test is not predictable as it depends on precise timi
read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836
#show_explain : Psergey: random timeout in range-checked-for-each record query.
-innodb-wl5522-debug-zip : broken upstream
-innodb_bug12902967 : broken upstream
file_contents : MDEV-6526 these files are not installed anymore
max_statement_time : cannot possibly work, depends on timing
partition_open_files_limit : open_files_limit check broken by MDEV-18360
diff --git a/mysql-test/main/drop_bad_db_type.result b/mysql-test/main/drop_bad_db_type.result
index 1b691957877..ae6fe708e60 100644
--- a/mysql-test/main/drop_bad_db_type.result
+++ b/mysql-test/main/drop_bad_db_type.result
@@ -1,5 +1,5 @@
-SET @save_dbug = @@debug_dbug;
-set debug_dbug='+d,unstable_db_type';
+SET @saved_dbug = @@debug_dbug;
+SET debug_dbug='+d,unstable_db_type';
install soname 'ha_archive';
create table t1 (a int) engine=archive;
insert t1 values (1),(2),(3);
@@ -33,4 +33,4 @@ t1.frm
drop table t1;
db.opt
uninstall soname 'ha_archive';
-set debug_dbug=@save_dbug;
+SET debug_dbug=@saved_dbug;
diff --git a/mysql-test/main/drop_bad_db_type.test b/mysql-test/main/drop_bad_db_type.test
index 6a3ac6ae00f..ebc732104d3 100644
--- a/mysql-test/main/drop_bad_db_type.test
+++ b/mysql-test/main/drop_bad_db_type.test
@@ -7,8 +7,8 @@ if (!$HA_ARCHIVE_SO) {
let $mysqld_datadir= `select @@datadir`;
-SET @save_dbug = @@debug_dbug;
-set debug_dbug='+d,unstable_db_type';
+SET @saved_dbug = @@debug_dbug;
+SET debug_dbug='+d,unstable_db_type';
install soname 'ha_archive';
create table t1 (a int) engine=archive;
@@ -28,4 +28,4 @@ drop table t1;
--list_files $mysqld_datadir/test
uninstall soname 'ha_archive';
-set debug_dbug=@save_dbug;
+SET debug_dbug=@saved_dbug;
diff --git a/mysql-test/main/engine_error_in_alter-8453.result b/mysql-test/main/engine_error_in_alter-8453.result
index c5a3375f33c..2c823f83038 100644
--- a/mysql-test/main/engine_error_in_alter-8453.result
+++ b/mysql-test/main/engine_error_in_alter-8453.result
@@ -1,6 +1,7 @@
create table t1 (a int, b int);
-set debug_dbug='+d,external_lock_failure';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,external_lock_failure';
alter table t1 add column c int;
ERROR HY000: Got error 168 'KABOOM!' from MyISAM
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
drop table t1;
diff --git a/mysql-test/main/engine_error_in_alter-8453.test b/mysql-test/main/engine_error_in_alter-8453.test
index c4600ec07fe..78e6de2d645 100644
--- a/mysql-test/main/engine_error_in_alter-8453.test
+++ b/mysql-test/main/engine_error_in_alter-8453.test
@@ -4,8 +4,9 @@
--source include/have_debug.inc
create table t1 (a int, b int);
-set debug_dbug='+d,external_lock_failure';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,external_lock_failure';
--error ER_GET_ERRMSG
alter table t1 add column c int;
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
drop table t1;
diff --git a/mysql-test/main/error_simulation.result b/mysql-test/main/error_simulation.result
index 7e728d24fc8..457e5c8ec9c 100644
--- a/mysql-test/main/error_simulation.result
+++ b/mysql-test/main/error_simulation.result
@@ -10,6 +10,7 @@ INSERT INTO t1 VALUES
('AAAAAAAAAH','AAAAAAAAAH'), ('AAAAAAAAAI','AAAAAAAAAI'),
('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
set tmp_table_size=1024;
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,raise_error";
SELECT MAX(a) FROM t1 GROUP BY a,b;
ERROR 23000: Can't write; duplicate key in table '(temporary)'
@@ -22,7 +23,7 @@ CREATE TABLE t1 (a INT(100) NOT NULL);
INSERT INTO t1 VALUES (1), (0), (2);
SET SESSION debug_dbug='+d,alter_table_only_index_change';
ALTER TABLE t1 ADD INDEX a(a);
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -42,7 +43,7 @@ CREATE TABLE t1(a BLOB);
SET SESSION debug_dbug="+d,bug42064_simulate_oom";
INSERT INTO t1 VALUES("");
Got one of the listed errors
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
DROP TABLE t1;
#
# Bug#41660: Sort-index_merge for non-first join table may require
@@ -79,7 +80,7 @@ a a b filler
7 1 1 data
8 1 1 data
9 1 1 data
-SET SESSION debug_dbug= DEFAULT;
+SET debug_dbug= @saved_dbug;
SET optimizer_switch=@save_optimizer_switch;
DROP TABLE t1, t2;
#
@@ -92,7 +93,7 @@ INSERT INTO t2 VALUES (1),(2);
SET SESSION debug_dbug="+d,bug11747970_raise_error";
INSERT IGNORE INTO t2 SELECT f1 FROM t1 a WHERE NOT EXISTS (SELECT 1 FROM t2 b WHERE a.f1 = b.f1);
ERROR 70100: Query execution was interrupted
-SET SESSION debug_dbug = DEFAULT;
+SET debug_dbug= @saved_dbug;
DROP TABLE t1,t2;
#
# End of 5.1 tests
@@ -126,4 +127,4 @@ SET SESSION debug_dbug="+d,simulate_create_virtual_tmp_table_out_of_memory";
SELECT f1(1);
Got one of the listed errors
DROP FUNCTION f1;
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/error_simulation.test b/mysql-test/main/error_simulation.test
index 1debed871c7..f713e2da6ba 100644
--- a/mysql-test/main/error_simulation.test
+++ b/mysql-test/main/error_simulation.test
@@ -21,6 +21,7 @@ set tmp_table_size=1024;
# Set debug flag so an error is returned when
# tmp table in query is converted from heap to myisam
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,raise_error";
--error ER_DUP_KEY
@@ -36,7 +37,7 @@ CREATE TABLE t1 (a INT(100) NOT NULL);
INSERT INTO t1 VALUES (1), (0), (2);
SET SESSION debug_dbug='+d,alter_table_only_index_change';
ALTER TABLE t1 ADD INDEX a(a);
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
@@ -51,7 +52,7 @@ SET SESSION debug_dbug="+d,bug42064_simulate_oom";
# May fail with either ER_OUT_OF_RESOURCES or EE_OUTOFMEMORY
--error ER_OUT_OF_RESOURCES, 5
INSERT INTO t1 VALUES("");
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
DROP TABLE t1;
@@ -84,7 +85,7 @@ EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
-SET SESSION debug_dbug= DEFAULT;
+SET debug_dbug= @saved_dbug;
SET optimizer_switch=@save_optimizer_switch;
@@ -101,7 +102,7 @@ INSERT INTO t2 VALUES (1),(2);
SET SESSION debug_dbug="+d,bug11747970_raise_error";
--error ER_QUERY_INTERRUPTED
INSERT IGNORE INTO t2 SELECT f1 FROM t1 a WHERE NOT EXISTS (SELECT 1 FROM t2 b WHERE a.f1 = b.f1);
-SET SESSION debug_dbug = DEFAULT;
+SET debug_dbug= @saved_dbug;
DROP TABLE t1,t2;
@@ -156,4 +157,4 @@ SET SESSION debug_dbug="+d,simulate_create_virtual_tmp_table_out_of_memory";
--error ER_OUT_OF_RESOURCES, 5
SELECT f1(1);
DROP FUNCTION f1;
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/events_bugs.result b/mysql-test/main/events_bugs.result
index cb8850112a5..666361188b9 100644
--- a/mysql-test/main/events_bugs.result
+++ b/mysql-test/main/events_bugs.result
@@ -618,7 +618,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SET GLOBAL event_scheduler = ON;
CREATE TABLE events_test.event_log
@@ -632,9 +632,9 @@ GRANT create, insert, select, event ON events_test.* TO evtest1@localhost;
GRANT select,insert ON test.* TO evtest1@localhost;
SHOW GRANTS FOR evtest1@localhost;
Grants for evtest1@localhost
-GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E31580C25DE4A08F4C07CC9A2D40C32'
-GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost'
-GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost'
+GRANT USAGE ON *.* TO `evtest1`@`localhost` IDENTIFIED BY PASSWORD '*3170F3644E31580C25DE4A08F4C07CC9A2D40C32'
+GRANT SELECT, INSERT ON `test`.* TO `evtest1`@`localhost`
+GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO `evtest1`@`localhost`
connect e1,localhost,evtest1,ev1,events_test,$MASTER_MYPORT,$MASTER_MYSOCK;
CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
DO BEGIN
@@ -692,7 +692,7 @@ SET GLOBAL READ_ONLY = 1;
connect u1_con,localhost,mysqltest_u1,,events_test;
-CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
+CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
ALTER EVENT e1 COMMENT 'comment';
@@ -703,7 +703,7 @@ ERROR HY000: The MariaDB server is running with the --read-only option so it can
connect root_con,localhost,root,,events_test;
-CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
+CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
diff --git a/mysql-test/main/events_bugs.test b/mysql-test/main/events_bugs.test
index a0f3c5991ef..ab45446667e 100644
--- a/mysql-test/main/events_bugs.test
+++ b/mysql-test/main/events_bugs.test
@@ -1029,7 +1029,7 @@ SET GLOBAL READ_ONLY = 1;
--echo
--error ER_OPTION_PREVENTS_STATEMENT
-CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
+CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
--echo
@@ -1049,7 +1049,7 @@ DROP EVENT e1;
--echo
-CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
+CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
--echo
diff --git a/mysql-test/main/events_grant.result b/mysql-test/main/events_grant.result
index c4f459dbe5b..5bdbbf0f8f1 100644
--- a/mysql-test/main/events_grant.result
+++ b/mysql-test/main/events_grant.result
@@ -23,9 +23,9 @@ USER() DATABASE()
ev_test@localhost events_test2
SHOW GRANTS;
Grants for ev_test@localhost
-GRANT USAGE ON *.* TO 'ev_test'@'localhost'
-GRANT ALL PRIVILEGES ON `events_test`.* TO 'ev_test'@'localhost'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, DELETE HISTORY ON `events_test2`.* TO 'ev_test'@'localhost'
+GRANT USAGE ON *.* TO `ev_test`@`localhost`
+GRANT ALL PRIVILEGES ON `events_test`.* TO `ev_test`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, DELETE HISTORY ON `events_test2`.* TO `ev_test`@`localhost`
"Here comes an error:";
SHOW EVENTS;
ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_test2'
diff --git a/mysql-test/main/events_restart.result b/mysql-test/main/events_restart.result
index e22cfa011f2..ab90f7ff2f7 100644
--- a/mysql-test/main/events_restart.result
+++ b/mysql-test/main/events_restart.result
@@ -110,3 +110,30 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
test e1 root@localhost SYSTEM RECURRING # 1 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT e1;
# end test for bug#11748899
+#
+# Test for MDEV-21758 Events switched randomly to SLAVESIDE_DISABLED
+#
+create event ev on schedule every 1 minute do set @a= 1;
+select name, originator, status from mysql.event;
+name originator status
+ev 1 ENABLED
+#
+# Restarting server with server_id=100
+#
+select @@global.server_id;
+@@global.server_id
+100
+select name, originator, status from mysql.event;
+name originator status
+ev 1 ENABLED
+set global server_id= 1;
+#
+# Restarting server with the original server_id=1
+#
+select @@global.server_id;
+@@global.server_id
+1
+select name, originator, status from mysql.event;
+name originator status
+ev 1 ENABLED
+drop event ev;
diff --git a/mysql-test/main/events_restart.test b/mysql-test/main/events_restart.test
index ca674170e96..f56bd32b71d 100644
--- a/mysql-test/main/events_restart.test
+++ b/mysql-test/main/events_restart.test
@@ -141,3 +141,34 @@ SHOW EVENTS;
DROP EVENT e1;
--echo # end test for bug#11748899
+
+--echo #
+--echo # Test for MDEV-21758 Events switched randomly to SLAVESIDE_DISABLED
+--echo #
+
+create event ev on schedule every 1 minute do set @a= 1;
+select name, originator, status from mysql.event;
+
+--let $server_id= `SELECT @@global.server_id`
+
+--echo #
+--echo # Restarting server with server_id=100
+--echo #
+--let $restart_parameters= --server-id=100
+--source include/restart_mysqld.inc
+
+select @@global.server_id;
+select name, originator, status from mysql.event;
+--eval set global server_id= $server_id
+
+--echo #
+--echo # Restarting server with the original server_id=$server_id
+--echo #
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+
+select @@global.server_id;
+select name, originator, status from mysql.event;
+
+# Cleanup
+drop event ev;
diff --git a/mysql-test/main/fix_priv_tables.result b/mysql-test/main/fix_priv_tables.result
index dea1ccdbd18..3f1830aadbc 100644
--- a/mysql-test/main/fix_priv_tables.result
+++ b/mysql-test/main/fix_priv_tables.result
@@ -10,25 +10,25 @@ SELECT * FROM testdb.t1;
GRANT CREATE VIEW, SHOW VIEW ON testdb.v1 TO 'show_view_tbl'@'localhost';
SHOW GRANTS FOR 'show_view_tbl'@'localhost';
Grants for show_view_tbl@localhost
-GRANT USAGE ON *.* TO 'show_view_tbl'@'localhost'
-GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO 'show_view_tbl'@'localhost'
+GRANT USAGE ON *.* TO `show_view_tbl`@`localhost`
+GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO `show_view_tbl`@`localhost`
GRANT SELECT(c1) on testdb.v1 to 'select_only_c1'@localhost;
SHOW GRANTS FOR 'select_only_c1'@'localhost';
Grants for select_only_c1@localhost
-GRANT USAGE ON *.* TO 'select_only_c1'@'localhost'
-GRANT SELECT (c1) ON `testdb`.`v1` TO 'select_only_c1'@'localhost'
+GRANT USAGE ON *.* TO `select_only_c1`@`localhost`
+GRANT SELECT (c1) ON `testdb`.`v1` TO `select_only_c1`@`localhost`
"after fix privs"
SHOW GRANTS FOR 'show_view_tbl'@'localhost';
Grants for show_view_tbl@localhost
-GRANT USAGE ON *.* TO 'show_view_tbl'@'localhost'
-GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO 'show_view_tbl'@'localhost'
+GRANT USAGE ON *.* TO `show_view_tbl`@`localhost`
+GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO `show_view_tbl`@`localhost`
SHOW GRANTS FOR 'select_only_c1'@'localhost';
Grants for select_only_c1@localhost
-GRANT USAGE ON *.* TO 'select_only_c1'@'localhost'
-GRANT SELECT (c1) ON `testdb`.`v1` TO 'select_only_c1'@'localhost'
+GRANT USAGE ON *.* TO `select_only_c1`@`localhost`
+GRANT SELECT (c1) ON `testdb`.`v1` TO `select_only_c1`@`localhost`
DROP USER 'show_view_tbl'@'localhost';
DROP USER 'select_only_c1'@'localhost';
diff --git a/mysql-test/main/foreign_key.result b/mysql-test/main/foreign_key.result
index a82151ddec0..c412be6bbdb 100644
--- a/mysql-test/main/foreign_key.result
+++ b/mysql-test/main/foreign_key.result
@@ -82,3 +82,29 @@ add foreign key (a) references t3 (a)
on update set default on update set default);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'update set default)' at line 3
drop table t_34455;
+#
+# MDEV-18460 Don't allow multiple table CONSTRAINTs with the same name.
+#
+CREATE TABLE tpk (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,name VARCHAR(100) NOT NULL) ENGINE=Innodb;
+CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1), CONSTRAINT sid CHECK (c2>15));
+ERROR HY000: Duplicate CHECK constraint name 'sid'
+CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1));
+ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15);
+ERROR HY000: Duplicate CHECK constraint name 'sid'
+DROP TABLE tfk;
+CREATE TABLE tfk (c1 INT, c2 INT,
+CONSTRAINT sid FOREIGN KEY (c1) REFERENCES tpk (id)) ENGINE=Innodb;
+show create table tfk;
+Table Create Table
+tfk CREATE TABLE `tfk` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ KEY `sid` (`c1`),
+ CONSTRAINT `sid` FOREIGN KEY (`c1`) REFERENCES `tpk` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15);
+ERROR HY000: Duplicate CHECK constraint name 'sid'
+ALTER TABLE tfk ADD CONSTRAINT sid UNIQUE(c2);
+ERROR 42000: Duplicate key name 'sid'
+DROP TABLE tfk;
+DROP TABLE tpk;
diff --git a/mysql-test/main/foreign_key.test b/mysql-test/main/foreign_key.test
index 17c93332cb3..3a09a544532 100644
--- a/mysql-test/main/foreign_key.test
+++ b/mysql-test/main/foreign_key.test
@@ -117,4 +117,28 @@ alter table t_34455
drop table t_34455;
+--echo #
+--echo # MDEV-18460 Don't allow multiple table CONSTRAINTs with the same name.
+--echo #
+
+CREATE TABLE tpk (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,name VARCHAR(100) NOT NULL) ENGINE=Innodb;
+--error ER_DUP_CONSTRAINT_NAME
+CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1), CONSTRAINT sid CHECK (c2>15));
+
+CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1));
+--error ER_DUP_CONSTRAINT_NAME
+ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15);
+DROP TABLE tfk;
+
+CREATE TABLE tfk (c1 INT, c2 INT,
+ CONSTRAINT sid FOREIGN KEY (c1) REFERENCES tpk (id)) ENGINE=Innodb;
+show create table tfk;
+--error ER_DUP_CONSTRAINT_NAME
+ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15);
+--error ER_DUP_KEYNAME
+ALTER TABLE tfk ADD CONSTRAINT sid UNIQUE(c2);
+DROP TABLE tfk;
+
+DROP TABLE tpk;
+
diff --git a/mysql-test/main/func_misc.result b/mysql-test/main/func_misc.result
index be6c1a5309f..9ff0ebdb9ea 100644
--- a/mysql-test/main/func_misc.result
+++ b/mysql-test/main/func_misc.result
@@ -1491,6 +1491,19 @@ x
x
DEALLOCATE PREPARE stmt;
#
+# MDEV-19680: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) ||
+# (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))'
+# or alike failed upon SELECT with mix of functions from simple view
+#
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT ISNULL( BENCHMARK(1, MIN(a))) FROM v1;
+ISNULL( BENCHMARK(1, MIN(a)))
+0
+DROP VIEW v1;
+DROP TABLE t1;
+#
# Start of 10.2 tests
#
#
diff --git a/mysql-test/main/func_misc.test b/mysql-test/main/func_misc.test
index 9fd2be8c38e..c984b73c648 100644
--- a/mysql-test/main/func_misc.test
+++ b/mysql-test/main/func_misc.test
@@ -1139,6 +1139,21 @@ PREPARE stmt FROM "SELECT 'x' ORDER BY NAME_CONST( 'f', 'foo' )";
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
+--echo #
+--echo # MDEV-19680: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) ||
+--echo # (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))'
+--echo # or alike failed upon SELECT with mix of functions from simple view
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+SELECT ISNULL( BENCHMARK(1, MIN(a))) FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
--echo #
--echo # Start of 10.2 tests
diff --git a/mysql-test/main/func_regexp_pcre.result b/mysql-test/main/func_regexp_pcre.result
index e030df99756..494fe917dc6 100644
--- a/mysql-test/main/func_regexp_pcre.result
+++ b/mysql-test/main/func_regexp_pcre.result
@@ -888,33 +888,33 @@ Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT CONCAT(REPEAT('100,',60),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
CONCAT(REPEAT('100,',60),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'
1
-SELECT CONCAT(REPEAT('100,',200),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
-CONCAT(REPEAT('100,',200),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'
+SELECT CONCAT(REPEAT('100,',400),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
+CONCAT(REPEAT('100,',400),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'
0
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
REGEXP_INSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')
1
-SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
-REGEXP_INSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')
+SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',400),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
+REGEXP_INSTR(CONCAT(REPEAT('100,',400),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')
0
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'))
243
-SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
-LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'))
+SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',400),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
+LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',400),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'))
0
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''))
0
-SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
-LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''))
-803
+SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',400),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
+LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',400),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''))
+1603
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT REGEXP_INSTR('a_kollision', 'oll');
diff --git a/mysql-test/main/func_regexp_pcre.test b/mysql-test/main/func_regexp_pcre.test
index 21600390bb2..de0fe94b7c1 100644
--- a/mysql-test/main/func_regexp_pcre.test
+++ b/mysql-test/main/func_regexp_pcre.test
@@ -438,19 +438,19 @@ SELECT 1 FROM dual WHERE ('Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,StrataCentral,
#
SELECT CONCAT(REPEAT('100,',60),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
--replace_regex /[0-9]+ exceeded/NUM exceeded/
-SELECT CONCAT(REPEAT('100,',200),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
+SELECT CONCAT(REPEAT('100,',400),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
--replace_regex /[0-9]+ exceeded/NUM exceeded/
-SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
+SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',400),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
--replace_regex /[0-9]+ exceeded/NUM exceeded/
-SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
+SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',400),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',60),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
--replace_regex /[0-9]+ exceeded/NUM exceeded/
-SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
+SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',400),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
#
# MDEV-12942 REGEXP_INSTR returns 1 when using brackets
diff --git a/mysql-test/main/func_regexp_pcre_debug.result b/mysql-test/main/func_regexp_pcre_debug.result
index e44492fca72..40a379a077d 100644
--- a/mysql-test/main/func_regexp_pcre_debug.result
+++ b/mysql-test/main/func_regexp_pcre_debug.result
@@ -1,10 +1,9 @@
-SET debug_dbug='+d,pcre_exec_error_123';
+SET STATEMENT debug_dbug='+d,pcre_exec_error_123' for
SELECT 'a' RLIKE 'a';
'a' RLIKE 'a'
0
Warnings:
Warning 1139 Got error 'pcre_exec: Internal error (-123)' from regexp
-SET debug_dbug='';
SELECT 'a' RLIKE 'a';
'a' RLIKE 'a'
1
diff --git a/mysql-test/main/func_regexp_pcre_debug.test b/mysql-test/main/func_regexp_pcre_debug.test
index c2581fa4110..cbf5c4a17ee 100644
--- a/mysql-test/main/func_regexp_pcre_debug.test
+++ b/mysql-test/main/func_regexp_pcre_debug.test
@@ -1,6 +1,5 @@
--source include/have_debug.inc
-SET debug_dbug='+d,pcre_exec_error_123';
+SET STATEMENT debug_dbug='+d,pcre_exec_error_123' for
SELECT 'a' RLIKE 'a';
-SET debug_dbug='';
SELECT 'a' RLIKE 'a';
diff --git a/mysql-test/main/func_time.result b/mysql-test/main/func_time.result
index 408183af47b..b8b14e61b46 100644
--- a/mysql-test/main/func_time.result
+++ b/mysql-test/main/func_time.result
@@ -159,7 +159,9 @@ date_format('1999-12-31','%x-%v') date_format('2000-01-01','%x-%v')
1999-52 1999-52
select dayname("1962-03-03"),dayname("1962-03-03")+0;
dayname("1962-03-03") dayname("1962-03-03")+0
-Saturday 5
+Saturday 0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'Saturday'
select monthname("1972-03-04"),monthname("1972-03-04")+0;
monthname("1972-03-04") monthname("1972-03-04")+0
March 0
@@ -3508,6 +3510,19 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
DROP VIEW v1,v2,v3;
DROP TABLE t1,t2;
#
+# MDEV-21388 Wrong result of DAYNAME()=xxx in combination with condition_pushdown_for_derived=on
+#
+SELECT DAYNAME('2019-01-05')+0;
+DAYNAME('2019-01-05')+0
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'Saturday'
+SELECT CAST(DAYNAME('2019-01-05') AS SIGNED);
+CAST(DAYNAME('2019-01-05') AS SIGNED)
+0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'Saturday'
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/func_time.test b/mysql-test/main/func_time.test
index 232cb16939e..719b0ae13b6 100644
--- a/mysql-test/main/func_time.test
+++ b/mysql-test/main/func_time.test
@@ -1970,6 +1970,14 @@ DROP VIEW v1,v2,v3;
DROP TABLE t1,t2;
--echo #
+--echo # MDEV-21388 Wrong result of DAYNAME()=xxx in combination with condition_pushdown_for_derived=on
+--echo #
+
+SELECT DAYNAME('2019-01-05')+0;
+SELECT CAST(DAYNAME('2019-01-05') AS SIGNED);
+
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result
index ccbabab8019..56d2eb8e6b1 100644
--- a/mysql-test/main/grant.result
+++ b/mysql-test/main/grant.result
@@ -13,8 +13,8 @@ flush privileges;
grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
grant delete on mysqltest.* to mysqltest_1@localhost;
select * from mysql.user where user="mysqltest_1";
Host localhost
@@ -66,27 +66,27 @@ default_role
max_statement_time 0.000000
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
-GRANT SELECT, DELETE ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
+GRANT SELECT, DELETE ON `mysqltest`.* TO `mysqltest_1`@`localhost`
revoke delete on mysqltest.* from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
grant select on mysqltest.* to mysqltest_1@localhost require NONE;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "Monty Program Ab";
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'Monty Program Ab' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` REQUIRE ISSUER 'Monty Program Ab' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA'
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'Monty Program Ab' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` REQUIRE ISSUER 'Monty Program Ab' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA'
delete from mysql.user where user='mysqltest_1';
flush privileges;
delete from mysql.user where user='mysqltest_1';
@@ -142,7 +142,7 @@ default_role
max_statement_time 60.000000
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_STATEMENT_TIME 60.000000
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` WITH MAX_QUERIES_PER_HOUR 10 MAX_STATEMENT_TIME 60.000000
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30 max_statement_time 0;
select * from mysql.user where user="mysqltest_1";
Host localhost
@@ -194,48 +194,48 @@ default_role
max_statement_time 0.000000
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
flush privileges;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
delete from mysql.user where user='mysqltest_1';
flush privileges;
grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
flush privileges;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT LOCK TABLES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION;
flush privileges;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `mysqltest`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user='mysqltest_1';
flush privileges;
grant usage on test.* to mysqltest_1@localhost with grant option;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT USAGE ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON `test`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT USAGE ON `mysqltest`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
+GRANT USAGE ON `test`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
delete from mysql.user where user='mysqltest_1';
delete from mysql.db where user='mysqltest_1';
delete from mysql.tables_priv where user='mysqltest_1';
@@ -248,21 +248,21 @@ GRANT select,update,insert on t1 to mysqltest_1@localhost;
GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, SELECT (a), INSERT, INSERT (a), UPDATE, UPDATE (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT, SELECT (a), INSERT, INSERT (a), UPDATE, UPDATE (a), REFERENCES (a) ON `test`.`t1` TO `mysqltest_1`@`localhost`
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
table_priv column_priv
Select,Insert,Update Select,Insert,Update,References
REVOKE select (a), update on t1 from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO `mysqltest_1`@`localhost`
REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT REFERENCES (a) ON `test`.`t1` TO `mysqltest_1`@`localhost`
GRANT select,references on t1 to mysqltest_1@localhost;
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
table_priv column_priv
@@ -271,22 +271,22 @@ grant all on test.* to mysqltest_3@localhost with grant option;
revoke all on test.* from mysqltest_3@localhost;
show grants for mysqltest_3@localhost;
Grants for mysqltest_3@localhost
-GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
-GRANT USAGE ON `test`.* TO 'mysqltest_3'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `mysqltest_3`@`localhost`
+GRANT USAGE ON `test`.* TO `mysqltest_3`@`localhost` WITH GRANT OPTION
revoke grant option on test.* from mysqltest_3@localhost;
show grants for mysqltest_3@localhost;
Grants for mysqltest_3@localhost
-GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_3`@`localhost`
grant all on test.t1 to mysqltest_2@localhost with grant option;
revoke all on test.t1 from mysqltest_2@localhost;
show grants for mysqltest_2@localhost;
Grants for mysqltest_2@localhost
-GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost'
-GRANT USAGE ON `test`.`t1` TO 'mysqltest_2'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `mysqltest_2`@`localhost`
+GRANT USAGE ON `test`.`t1` TO `mysqltest_2`@`localhost` WITH GRANT OPTION
revoke grant option on test.t1 from mysqltest_2@localhost;
show grants for mysqltest_2@localhost;
Grants for mysqltest_2@localhost
-GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_2`@`localhost`
delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
@@ -310,16 +310,16 @@ alter table mysql.db order by db asc;
flush privileges;
show grants for test11@localhost;
Grants for test11@localhost
-GRANT USAGE ON *.* TO 'test11'@'localhost'
-GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
-GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
+GRANT USAGE ON *.* TO `test11`@`localhost`
+GRANT SELECT ON `ab%`.* TO `test11`@`localhost`
+GRANT SELECT ON `a%`.* TO `test11`@`localhost`
alter table mysql.db order by db desc;
flush privileges;
show grants for test11@localhost;
Grants for test11@localhost
-GRANT USAGE ON *.* TO 'test11'@'localhost'
-GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
-GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
+GRANT USAGE ON *.* TO `test11`@`localhost`
+GRANT SELECT ON `ab%`.* TO `test11`@`localhost`
+GRANT SELECT ON `a%`.* TO `test11`@`localhost`
delete from mysql.user where user='test11';
delete from mysql.db where user='test11';
create database mysqltest1;
@@ -332,7 +332,7 @@ create table t1 (a int);
grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION;
show grants for drop_user2@localhost;
Grants for drop_user2@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user2'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `drop_user2`@`localhost` WITH GRANT OPTION
revoke all privileges, grant option from drop_user2@localhost;
drop user drop_user2@localhost;
grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION;
@@ -340,44 +340,44 @@ grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION;
grant select(a) on test.t1 to drop_user@localhost;
show grants for drop_user@localhost;
Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO `drop_user`@`localhost` WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON `test`.* TO `drop_user`@`localhost` WITH GRANT OPTION
+GRANT SELECT (a) ON `test`.`t1` TO `drop_user`@`localhost`
set sql_mode=ansi_quotes;
show grants for drop_user@localhost;
Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO "drop_user"@"localhost" WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON "test".* TO "drop_user"@"localhost" WITH GRANT OPTION
+GRANT SELECT (a) ON "test"."t1" TO "drop_user"@"localhost"
set sql_mode=default;
set sql_quote_show_create=0;
show grants for drop_user@localhost;
Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO drop_user@localhost WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON test.* TO drop_user@localhost WITH GRANT OPTION
+GRANT SELECT (a) ON test.t1 TO drop_user@localhost
set sql_mode="ansi_quotes";
show grants for drop_user@localhost;
Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO drop_user@localhost WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON test.* TO drop_user@localhost WITH GRANT OPTION
+GRANT SELECT (a) ON test.t1 TO drop_user@localhost
set sql_quote_show_create=1;
show grants for drop_user@localhost;
Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO "drop_user"@"localhost" WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON "test".* TO "drop_user"@"localhost" WITH GRANT OPTION
+GRANT SELECT (a) ON "test"."t1" TO "drop_user"@"localhost"
set sql_mode="";
show grants for drop_user@localhost;
Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO `drop_user`@`localhost` WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON `test`.* TO `drop_user`@`localhost` WITH GRANT OPTION
+GRANT SELECT (a) ON `test`.`t1` TO `drop_user`@`localhost`
revoke all privileges, grant option from drop_user@localhost;
show grants for drop_user@localhost;
Grants for drop_user@localhost
-GRANT USAGE ON *.* TO 'drop_user'@'localhost'
+GRANT USAGE ON *.* TO `drop_user`@`localhost`
drop user drop_user@localhost;
revoke all privileges, grant option from drop_user@localhost;
ERROR HY000: Can't revoke all privileges for one or more of the requested users
@@ -398,8 +398,8 @@ grant usage on *.* to mysqltest_1@localhost identified by "password";
grant select, update, insert on test.* to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19'
-GRANT SELECT, INSERT, UPDATE ON `test`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19'
+GRANT SELECT, INSERT, UPDATE ON `test`.* TO `mysqltest_1`@`localhost`
drop user mysqltest_1@localhost;
SET NAMES koi8r;
CREATE DATABASE ÂÄ;
@@ -408,20 +408,20 @@ CREATE TABLE ÔÁÂ (ËÏÌ INT);
GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost;
SHOW GRANTS FOR ÀÚÅÒ@localhost;
Grants for ÀÚÅÒ@localhost
-GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost'
-GRANT SELECT ON `ÂÄ`.* TO 'ÀÚÅÒ'@'localhost'
+GRANT USAGE ON *.* TO `ÀÚÅÒ`@`localhost`
+GRANT SELECT ON `ÂÄ`.* TO `ÀÚÅÒ`@`localhost`
REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost;
GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
SHOW GRANTS FOR ÀÚÅÒ@localhost;
Grants for ÀÚÅÒ@localhost
-GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost'
-GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost'
+GRANT USAGE ON *.* TO `ÀÚÅÒ`@`localhost`
+GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO `ÀÚÅÒ`@`localhost`
REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
SHOW GRANTS FOR ÀÚÅÒ@localhost;
Grants for ÀÚÅÒ@localhost
-GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost'
-GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost'
+GRANT USAGE ON *.* TO `ÀÚÅÒ`@`localhost`
+GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO `ÀÚÅÒ`@`localhost`
REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
DROP USER ÀÚÅÒ@localhost;
DROP DATABASE ÂÄ;
@@ -480,7 +480,7 @@ GRANT SELECT (a) ON test.t10 TO testuser@localhost;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost;
SHOW GRANTS FOR testuser@localhost;
Grants for testuser@localhost
-GRANT USAGE ON *.* TO 'testuser'@'localhost'
+GRANT USAGE ON *.* TO `testuser`@`localhost`
DROP USER testuser@localhost;
DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
DROP DATABASE testdb1;
@@ -497,8 +497,8 @@ create table t1(a int, b int, c int, d int);
grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost;
show grants for grant_user@localhost;
Grants for grant_user@localhost
-GRANT USAGE ON *.* TO 'grant_user'@'localhost'
-GRANT INSERT (a, d, c, b) ON `test`.`t1` TO 'grant_user'@'localhost'
+GRANT USAGE ON *.* TO `grant_user`@`localhost`
+GRANT INSERT (a, d, c, b) ON `test`.`t1` TO `grant_user`@`localhost`
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv order by Column_name;
Host Db User Table_name Column_name Column_priv
localhost test grant_user t1 a Insert
@@ -508,7 +508,7 @@ localhost test grant_user t1 d Insert
revoke ALL PRIVILEGES on t1 from grant_user@localhost;
show grants for grant_user@localhost;
Grants for grant_user@localhost
-GRANT USAGE ON *.* TO 'grant_user'@'localhost'
+GRANT USAGE ON *.* TO `grant_user`@`localhost`
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
Host Db User Table_name Column_name Column_priv
drop user grant_user@localhost;
@@ -612,7 +612,7 @@ Create temporary tables Databases To use CREATE TEMPORARY TABLE
Create view Tables To create new views
Create user Server Admin To create new users
Delete Tables To delete existing rows
-Delete versioning rows Tables To delete versioning table historical rows
+Delete history Tables To delete versioning table historical rows
Drop Databases,Tables To drop databases, tables, and views
Event Server Admin To create, alter, drop and execute events
Execute Functions,Procedures To execute stored routines
@@ -660,9 +660,9 @@ GRANT ALL PRIVILEGES ON mysqltest.dummytable TO dummy@localhost;
GRANT ALL PRIVILEGES ON mysqltest.dummyview TO dummy@localhost;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
-GRANT USAGE ON *.* TO 'dummy'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
+GRANT USAGE ON *.* TO `dummy`@`localhost`
+GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
+GRANT ALL PRIVILEGES ON `mysqltest`.`dummytable` TO `dummy`@`localhost`
use INFORMATION_SCHEMA;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
@@ -673,9 +673,9 @@ mysqltest dummyview ALTER, CREATE, CREATE VIEW, DELETE, DELETE HISTORY, DROP, IN
FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
-GRANT USAGE ON *.* TO 'dummy'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
+GRANT USAGE ON *.* TO `dummy`@`localhost`
+GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
+GRANT ALL PRIVILEGES ON `mysqltest`.`dummytable` TO `dummy`@`localhost`
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
@@ -704,9 +704,9 @@ GRANT CREATE VIEW ON mysqltest.dummytable TO dummy@localhost;
GRANT CREATE VIEW ON mysqltest.dummyview TO dummy@localhost;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
-GRANT USAGE ON *.* TO 'dummy'@'localhost'
-GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
-GRANT CREATE VIEW ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
+GRANT USAGE ON *.* TO `dummy`@`localhost`
+GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
+GRANT CREATE VIEW ON `mysqltest`.`dummytable` TO `dummy`@`localhost`
use INFORMATION_SCHEMA;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
@@ -717,9 +717,9 @@ mysqltest dummyview CREATE VIEW
FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
-GRANT USAGE ON *.* TO 'dummy'@'localhost'
-GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
-GRANT CREATE VIEW ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
+GRANT USAGE ON *.* TO `dummy`@`localhost`
+GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
+GRANT CREATE VIEW ON `mysqltest`.`dummytable` TO `dummy`@`localhost`
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
@@ -738,9 +738,9 @@ GRANT SHOW VIEW ON mysqltest.dummytable TO dummy@localhost;
GRANT SHOW VIEW ON mysqltest.dummyview TO dummy@localhost;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
-GRANT USAGE ON *.* TO 'dummy'@'localhost'
-GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
-GRANT SHOW VIEW ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
+GRANT USAGE ON *.* TO `dummy`@`localhost`
+GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
+GRANT SHOW VIEW ON `mysqltest`.`dummytable` TO `dummy`@`localhost`
use INFORMATION_SCHEMA;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
@@ -751,9 +751,9 @@ mysqltest dummyview SHOW VIEW
FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
-GRANT USAGE ON *.* TO 'dummy'@'localhost'
-GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
-GRANT SHOW VIEW ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
+GRANT USAGE ON *.* TO `dummy`@`localhost`
+GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
+GRANT SHOW VIEW ON `mysqltest`.`dummytable` TO `dummy`@`localhost`
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
@@ -782,27 +782,27 @@ hex(Db)
D0B1D0B4
show grants for root@localhost;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `ÂÄ`.* TO `root`@`localhost`
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
flush privileges;
show grants for root@localhost;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `ÂÄ`.* TO `root`@`localhost`
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop database ÂÄ;
revoke all privileges on ÂÄ.* from root@localhost;
show grants for root@localhost;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
set names latin1;
create user mysqltest_7@;
set password for mysqltest_7@ = password('systpass');
show grants for mysqltest_7@;
Grants for mysqltest_7@%
-GRANT USAGE ON *.* TO 'mysqltest_7'@'%' IDENTIFIED BY PASSWORD '*2FB071A056F9BB745219D9C876814231DAF46517'
+GRANT USAGE ON *.* TO `mysqltest_7`@`%` IDENTIFIED BY PASSWORD '*2FB071A056F9BB745219D9C876814231DAF46517'
drop user mysqltest_7@;
show grants for mysqltest_7@;
ERROR 42000: There is no such grant defined for user 'mysqltest_7' on host '%'
@@ -813,12 +813,12 @@ GRANT DELETE ON mysqltest.t1 TO mysqltest1@'%';
GRANT SELECT ON mysqltest.t1 TO mysqltest1@'192.%';
show grants for mysqltest1@'192.%';
Grants for mysqltest1@192.%
-GRANT USAGE ON *.* TO 'mysqltest1'@'192.%'
-GRANT SELECT ON `mysqltest`.`t1` TO 'mysqltest1'@'192.%'
+GRANT USAGE ON *.* TO `mysqltest1`@`192.%`
+GRANT SELECT ON `mysqltest`.`t1` TO `mysqltest1`@`192.%`
show grants for mysqltest1@'%';
Grants for mysqltest1@%
-GRANT USAGE ON *.* TO 'mysqltest1'@'%'
-GRANT DELETE ON `mysqltest`.`t1` TO 'mysqltest1'@'%'
+GRANT USAGE ON *.* TO `mysqltest1`@`%`
+GRANT DELETE ON `mysqltest`.`t1` TO `mysqltest1`@`%`
delete from mysql.user where user='mysqltest1';
delete from mysql.db where user='mysqltest1';
delete from mysql.tables_priv where user='mysqltest1';
@@ -861,18 +861,18 @@ Schema privileges
grant select on mysqltest.* to mysqltest_8@'';
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_8`@`%`
grant select on mysqltest.* to mysqltest_8@;
show grants for mysqltest_8@;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_8`@`%`
grant select on mysqltest.* to mysqltest_8;
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_8`@`%`
select * from information_schema.schema_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
@@ -885,26 +885,26 @@ connection master;
revoke select on mysqltest.* from mysqltest_8@'';
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
select * from information_schema.schema_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
show grants for mysqltest_8@;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
grant select on mysqltest.* to mysqltest_8@'';
flush privileges;
show grants for mysqltest_8@;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_8`@`%`
revoke select on mysqltest.* from mysqltest_8@'';
flush privileges;
Column privileges
@@ -912,21 +912,21 @@ grant update (a) on t1 to mysqltest_8@'';
grant update (a) on t1 to mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
select * from information_schema.column_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' def test t1 a UPDATE NO
@@ -938,39 +938,39 @@ connection master;
revoke update (a) on t1 from mysqltest_8@'';
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
select * from information_schema.column_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
Table privileges
grant update on t1 to mysqltest_8@'';
grant update on t1 to mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT UPDATE ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT UPDATE ON `test`.`t1` TO `mysqltest_8`@`%`
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT UPDATE ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT UPDATE ON `test`.`t1` TO `mysqltest_8`@`%`
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' def test t1 UPDATE NO
@@ -982,19 +982,19 @@ connection master;
revoke update on t1 from mysqltest_8@'';
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
"DROP USER" should clear privileges
grant all privileges on mysqltest.* to mysqltest_8@'';
grant select on mysqltest.* to mysqltest_8@'';
@@ -1003,14 +1003,14 @@ grant update (a) on t1 to mysqltest_8@'';
grant all privileges on mysqltest.* to mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
-GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_8`@`%`
+GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
-GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_8`@`%`
+GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
@@ -1024,14 +1024,14 @@ connection master;
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
-GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_8`@`%`
+GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
-GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
-GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
-GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
+GRANT USAGE ON *.* TO `mysqltest_8`@`%`
+GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_8`@`%`
+GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
drop user mysqltest_8@'';
show grants for mysqltest_8@'';
ERROR 42000: There is no such grant defined for user 'mysqltest_8' on host '%'
@@ -1149,8 +1149,8 @@ USER()
mysqltest_1@localhost
SHOW GRANTS;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT ON `mysqltest1`.`t1` TO `mysqltest_1`@`localhost`
RENAME TABLE t1 TO t2;
ERROR 42000: DROP, ALTER command denied to user 'mysqltest_1'@'localhost' for table 't1'
ALTER TABLE t1 RENAME TO t2;
@@ -1169,8 +1169,8 @@ GRANT ALTER ON mysqltest1.t1 TO mysqltest_1@localhost;
connect conn42,localhost,mysqltest_1,,mysqltest1;
SHOW GRANTS;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, DROP, ALTER ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT, DROP, ALTER ON `mysqltest1`.`t1` TO `mysqltest_1`@`localhost`
RENAME TABLE t1 TO t2;
ERROR 42000: INSERT, CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2'
ALTER TABLE t1 RENAME TO t2;
@@ -1181,8 +1181,8 @@ GRANT INSERT, CREATE ON mysqltest1.t1 TO mysqltest_1@localhost;
connect conn42,localhost,mysqltest_1,,mysqltest1;
SHOW GRANTS;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t1` TO `mysqltest_1`@`localhost`
disconnect conn42;
connection default;
GRANT INSERT, SELECT, CREATE, ALTER, DROP ON mysqltest1.t2 TO mysqltest_1@localhost;
@@ -1190,9 +1190,9 @@ DROP TABLE mysqltest1.t2;
connect conn42,localhost,mysqltest_1,,mysqltest1;
SHOW GRANTS;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
-GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t1` TO `mysqltest_1`@`localhost`
+GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t2` TO `mysqltest_1`@`localhost`
RENAME TABLE t1 TO t2;
RENAME TABLE t2 TO t1;
ALTER TABLE t1 RENAME TO t2;
@@ -1204,9 +1204,9 @@ REVOKE DROP, INSERT ON mysqltest1.t2 FROM mysqltest_1@localhost;
connect conn42,localhost,mysqltest_1,,mysqltest1;
SHOW GRANTS;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
-GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t2` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t1` TO `mysqltest_1`@`localhost`
+GRANT SELECT, CREATE, ALTER ON `mysqltest1`.`t2` TO `mysqltest_1`@`localhost`
RENAME TABLE t1 TO t2;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
ALTER TABLE t1 RENAME TO t2;
@@ -1541,9 +1541,9 @@ grant execute on procedure mysqltest1.p1 to mysqluser1@localhost;
# in privilege tables and in in-memory structures.
show grants for mysqluser1@localhost;
Grants for mysqluser1@localhost
-GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
-GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost'
-GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost'
+GRANT USAGE ON *.* TO `mysqluser1`@`localhost`
+GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO `mysqluser1`@`localhost`
+GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO `mysqluser1`@`localhost`
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
db routine_name routine_type proc_priv
mysqltest1 f1 FUNCTION Execute
@@ -1574,7 +1574,7 @@ connection default;
create user mysqluser1@localhost;
show grants for mysqluser1@localhost;
Grants for mysqluser1@localhost
-GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
+GRANT USAGE ON *.* TO `mysqluser1`@`localhost`
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
db routine_name routine_type proc_priv
connect bug36544_con2,localhost,mysqluser1,,;
@@ -1608,11 +1608,11 @@ grant select on mysqltest1.t11 to mysqluser1@localhost;
# in privilege tables and in in-memory structures.
show grants for mysqluser1@localhost;
Grants for mysqluser1@localhost
-GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
-GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser1'@'localhost'
-GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser1'@'localhost'
-GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost'
-GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost'
+GRANT USAGE ON *.* TO `mysqluser1`@`localhost`
+GRANT SELECT ON `mysqltest1`.`t11` TO `mysqluser1`@`localhost`
+GRANT SELECT ON `mysqltest1`.`t22` TO `mysqluser1`@`localhost`
+GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO `mysqluser1`@`localhost`
+GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO `mysqluser1`@`localhost`
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
db routine_name routine_type proc_priv
mysqltest1 f1 FUNCTION Execute
@@ -1654,7 +1654,7 @@ connection default;
create user mysqluser1@localhost;
show grants for mysqluser1@localhost;
Grants for mysqluser1@localhost
-GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
+GRANT USAGE ON *.* TO `mysqluser1`@`localhost`
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
db routine_name routine_type proc_priv
select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
@@ -1678,11 +1678,11 @@ connection default;
#
show grants for mysqluser10@localhost;
Grants for mysqluser10@localhost
-GRANT USAGE ON *.* TO 'mysqluser10'@'localhost'
-GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser10'@'localhost'
-GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser10'@'localhost'
-GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser10'@'localhost'
-GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser10'@'localhost'
+GRANT USAGE ON *.* TO `mysqluser10`@`localhost`
+GRANT SELECT ON `mysqltest1`.`t11` TO `mysqluser10`@`localhost`
+GRANT SELECT ON `mysqltest1`.`t22` TO `mysqluser10`@`localhost`
+GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO `mysqluser10`@`localhost`
+GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO `mysqluser10`@`localhost`
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost';
db routine_name routine_type proc_priv
mysqltest1 f1 FUNCTION Execute
@@ -1822,8 +1822,8 @@ GRANT CREATE ROUTINE ON db1.* TO 'user2'@'%';
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'user1'@'localhost';
Grants for user1@localhost
-GRANT USAGE ON *.* TO 'user1'@'localhost'
-GRANT CREATE, CREATE ROUTINE ON `db1`.* TO 'user1'@'localhost'
+GRANT USAGE ON *.* TO `user1`@`localhost`
+GRANT CREATE, CREATE ROUTINE ON `db1`.* TO `user1`@`localhost`
connect con1,localhost,user1,,;
** Connect as user1 and create a procedure.
** The creation will imply implicitly assigned
@@ -1854,14 +1854,14 @@ END ;||
connection default;
SHOW GRANTS FOR 'user1'@'localhost';
Grants for user1@localhost
-GRANT USAGE ON *.* TO 'user1'@'localhost'
-GRANT CREATE, CREATE ROUTINE ON `db1`.* TO 'user1'@'localhost'
-GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `db1`.`proc1` TO 'user1'@'localhost'
+GRANT USAGE ON *.* TO `user1`@`localhost`
+GRANT CREATE, CREATE ROUTINE ON `db1`.* TO `user1`@`localhost`
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `db1`.`proc1` TO `user1`@`localhost`
SHOW GRANTS FOR 'user2';
Grants for user2@%
-GRANT USAGE ON *.* TO 'user2'@'%'
-GRANT CREATE, CREATE ROUTINE ON `db1`.* TO 'user2'@'%'
-GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `db1`.`proc2` TO 'user2'@'%'
+GRANT USAGE ON *.* TO `user2`@`%`
+GRANT CREATE, CREATE ROUTINE ON `db1`.* TO `user2`@`%`
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `db1`.`proc2` TO `user2`@`%`
disconnect con1;
disconnect con2;
DROP PROCEDURE db1.proc1;
@@ -1882,19 +1882,19 @@ ERROR 3D000: No database selected
GRANT ALL ON *.* TO mysqltest_1;
SHOW GRANTS FOR mysqltest_1;
Grants for mysqltest_1@%
-GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%'
+GRANT ALL PRIVILEGES ON *.* TO `mysqltest_1`@`%`
DROP USER mysqltest_1;
USE test;
GRANT ALL ON * TO mysqltest_1;
SHOW GRANTS FOR mysqltest_1;
Grants for mysqltest_1@%
-GRANT USAGE ON *.* TO 'mysqltest_1'@'%'
-GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'%'
+GRANT USAGE ON *.* TO `mysqltest_1`@`%`
+GRANT ALL PRIVILEGES ON `test`.* TO `mysqltest_1`@`%`
DROP USER mysqltest_1;
GRANT ALL ON *.* TO mysqltest_1;
SHOW GRANTS FOR mysqltest_1;
Grants for mysqltest_1@%
-GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%'
+GRANT ALL PRIVILEGES ON *.* TO `mysqltest_1`@`%`
DROP USER mysqltest_1;
connection default;
disconnect conn1;
@@ -1967,8 +1967,8 @@ GRANT USAGE ON *.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT RELOAD, SHUTDOWN, PROCESS, FILE, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT, CREATE USER ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT RELOAD, SHUTDOWN, PROCESS, FILE, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT, CREATE USER ON *.* TO `mysqltest_u1`@`localhost`
+GRANT CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -1980,7 +1980,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global SELECT allows SHOW CREATE TABLE.
@@ -1990,8 +1990,8 @@ GRANT SELECT ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT SELECT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT SELECT ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2006,7 +2006,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global INSERT allows SHOW CREATE TABLE.
@@ -2016,8 +2016,8 @@ GRANT INSERT ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT INSERT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT INSERT ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2032,7 +2032,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global UPDATE allows SHOW CREATE TABLE.
@@ -2042,8 +2042,8 @@ GRANT UPDATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT UPDATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT UPDATE ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2058,7 +2058,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global DELETE allows SHOW CREATE TABLE.
@@ -2068,8 +2068,8 @@ GRANT DELETE ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT DELETE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT DELETE ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2084,7 +2084,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global CREATE allows SHOW CREATE TABLE.
@@ -2094,8 +2094,8 @@ GRANT CREATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT CREATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT CREATE ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2110,7 +2110,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global DROP allows SHOW CREATE TABLE.
@@ -2120,8 +2120,8 @@ GRANT DROP ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT DROP ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT DROP ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2136,7 +2136,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global ALTER allows SHOW CREATE TABLE.
@@ -2146,8 +2146,8 @@ GRANT ALTER ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT ALTER ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT ALTER ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2162,7 +2162,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global INDEX allows SHOW CREATE TABLE.
@@ -2172,8 +2172,8 @@ GRANT INDEX ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT INDEX ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT INDEX ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2188,7 +2188,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global REFERENCES allows SHOW CREATE TABLE.
@@ -2198,8 +2198,8 @@ GRANT REFERENCES ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT REFERENCES ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT REFERENCES ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2214,7 +2214,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global GRANT OPTION allows SHOW CREATE TABLE.
@@ -2224,8 +2224,8 @@ GRANT GRANT OPTION ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT USAGE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT USAGE ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost` WITH GRANT OPTION
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2240,7 +2240,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global CREATE VIEW allows SHOW CREATE TABLE.
@@ -2250,8 +2250,8 @@ GRANT CREATE VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT CREATE VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT CREATE VIEW ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2266,7 +2266,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that global SHOW VIEW allows SHOW CREATE TABLE.
@@ -2276,8 +2276,8 @@ GRANT SHOW VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT SHOW VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT SHOW VIEW ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2292,7 +2292,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level SELECT allows SHOW CREATE TABLE.
@@ -2302,8 +2302,8 @@ GRANT SELECT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT SELECT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT SELECT ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2318,7 +2318,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level INSERT allows SHOW CREATE TABLE.
@@ -2328,8 +2328,8 @@ GRANT INSERT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT INSERT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT INSERT ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2344,7 +2344,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level UPDATE allows SHOW CREATE TABLE.
@@ -2354,8 +2354,8 @@ GRANT UPDATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT UPDATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT UPDATE ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2370,7 +2370,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level DELETE allows SHOW CREATE TABLE.
@@ -2380,8 +2380,8 @@ GRANT DELETE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT DELETE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT DELETE ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2396,7 +2396,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level CREATE allows SHOW CREATE TABLE.
@@ -2406,8 +2406,8 @@ GRANT CREATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT CREATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT CREATE ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2422,7 +2422,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level DROP allows SHOW CREATE TABLE.
@@ -2432,8 +2432,8 @@ GRANT DROP ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT DROP ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT DROP ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2448,7 +2448,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level ALTER allows SHOW CREATE TABLE.
@@ -2458,8 +2458,8 @@ GRANT ALTER ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT ALTER ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT ALTER ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2474,7 +2474,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level INDEX allows SHOW CREATE TABLE.
@@ -2484,8 +2484,8 @@ GRANT INDEX ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT INDEX ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT INDEX ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2500,7 +2500,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level REFERENCES allows SHOW CREATE TABLE.
@@ -2510,8 +2510,8 @@ GRANT REFERENCES ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT REFERENCES ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT REFERENCES ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2526,7 +2526,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level GRANT OPTION allows SHOW CREATE TABLE.
@@ -2536,8 +2536,8 @@ GRANT GRANT OPTION ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT USAGE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT USAGE ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost` WITH GRANT OPTION
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2552,7 +2552,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level CREATE VIEW allows SHOW CREATE TABLE.
@@ -2562,8 +2562,8 @@ GRANT CREATE VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT CREATE VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT CREATE VIEW ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2578,7 +2578,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Check that table-level SHOW VIEW allows SHOW CREATE TABLE.
@@ -2588,8 +2588,8 @@ GRANT SHOW VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT SHOW VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT SHOW VIEW ON `mysqltest_db1`.`t1` TO `mysqltest_u1`@`localhost`
connect con1,localhost,mysqltest_u1,,mysqltest_db1;
connection con1;
@@ -2604,7 +2604,7 @@ disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
# --
# -- Cleanup.
@@ -2634,7 +2634,7 @@ grant select on mysqltest_db1.t1 to mysqltest_u1;
ERROR 42S02: Table 'mysqltest_db1.t1' doesn't exist
show grants for mysqltest_u1;
Grants for mysqltest_u1@%
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'%'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`%`
drop database mysqltest_db1;
drop user mysqltest_u1;
#
@@ -2677,28 +2677,28 @@ connect con1,localhost,foo;
create procedure fooproc() select 'i am fooproc';
show grants;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
-GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT CREATE ROUTINE ON `foodb`.* TO `foo`@`localhost`
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO `foo`@`localhost`
disconnect con1;
connection default;
rename table mysql.procs_priv to mysql.procs_priv1;
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT CREATE ROUTINE ON `foodb`.* TO `foo`@`localhost`
rename table mysql.procs_priv1 to mysql.procs_priv;
show grants for foo@localhost;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT CREATE ROUTINE ON `foodb`.* TO `foo`@`localhost`
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
-GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT CREATE ROUTINE ON `foodb`.* TO `foo`@`localhost`
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO `foo`@`localhost`
drop user foo@localhost;
drop procedure fooproc;
drop database foodb;
@@ -2713,7 +2713,7 @@ GRANT USAGE ON *.* TO untrusted@localhost;
connect con1, localhost, untrusted;
SHOW GRANTS;
Grants for untrusted@localhost
-GRANT USAGE ON *.* TO 'untrusted'@'localhost'
+GRANT USAGE ON *.* TO `untrusted`@`localhost`
SHOW DATABASES;
Database
information_schema
@@ -2779,11 +2779,11 @@ CREATE USER ten2;
GRANT ALL ON *.* TO ten2;
SHOW GRANTS FOR ten2;
Grants for ten2@%
-GRANT ALL PRIVILEGES ON *.* TO 'ten2'@'%'
+GRANT ALL PRIVILEGES ON *.* TO `ten2`@`%`
FLUSH PRIVILEGES;
SHOW GRANTS FOR ten2;
Grants for ten2@%
-GRANT ALL PRIVILEGES ON *.* TO 'ten2'@'%'
+GRANT ALL PRIVILEGES ON *.* TO `ten2`@`%`
DROP USER ten2;
ALTER TABLE mysql.user ADD Delete_history_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL DEFAULT 'N' after Create_tablespace_priv;
UPDATE mysql.user SET Delete_history_priv = Super_priv WHERE @had_user_delete_history_priv = 1;
diff --git a/mysql-test/main/grant2.result b/mysql-test/main/grant2.result
index ffb41c1b5f8..022b94d641b 100644
--- a/mysql-test/main/grant2.result
+++ b/mysql-test/main/grant2.result
@@ -59,12 +59,12 @@ disconnect user1;
connection default;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT CREATE USER ON *.* TO 'mysqltest_1'@'localhost'
-GRANT ALL PRIVILEGES ON `my\_%`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
+GRANT CREATE USER ON *.* TO `mysqltest_1`@`localhost`
+GRANT ALL PRIVILEGES ON `my\_%`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
show grants for mysqltest_2@localhost;
Grants for mysqltest_2@localhost
-GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost'
-GRANT ALL PRIVILEGES ON `my\_1`.* TO 'mysqltest_2'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `mysqltest_2`@`localhost`
+GRANT ALL PRIVILEGES ON `my\_1`.* TO `mysqltest_2`@`localhost` WITH GRANT OPTION
show grants for mysqltest_3@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest_3' on host 'localhost'
delete from mysql.user where user like 'mysqltest\_%';
@@ -88,8 +88,8 @@ disconnect user2;
connection default;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest\_1`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT ALL PRIVILEGES ON `mysqltest\_1`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
drop database mysqltest_1;
@@ -103,8 +103,8 @@ connect mrbad, localhost, mysqltest_1,,mysqltest;
connection mrbad;
show grants for current_user();
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, INSERT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT, INSERT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
insert into t1 values (1, 'I can''t change it!');
update t1 set data='I can change it!' where id = 1;
ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for table 't1'
@@ -198,13 +198,13 @@ host db user table_name column_name
% test mysqltest_2 t2 c2
show grants for 'mysqltest_1';
Grants for mysqltest_1@%
-GRANT USAGE ON *.* TO 'mysqltest_1'@'%'
+GRANT USAGE ON *.* TO "mysqltest_1"@"%"
show grants for 'mysqltest_2';
Grants for mysqltest_2@%
-GRANT SELECT ON *.* TO 'mysqltest_2'@'%' IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
-GRANT INSERT ON "test".* TO 'mysqltest_2'@'%'
-GRANT UPDATE (c2) ON "test"."t2" TO 'mysqltest_2'@'%'
-GRANT UPDATE ON "test"."t1" TO 'mysqltest_2'@'%'
+GRANT SELECT ON *.* TO "mysqltest_2"@"%" IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
+GRANT INSERT ON "test".* TO "mysqltest_2"@"%"
+GRANT UPDATE (c2) ON "test"."t2" TO "mysqltest_2"@"%"
+GRANT UPDATE ON "test"."t1" TO "mysqltest_2"@"%"
drop user 'mysqltest_1';
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
host user password
@@ -239,10 +239,10 @@ host db user table_name column_name
% test mysqltest_1 t2 c2
show grants for 'mysqltest_1';
Grants for mysqltest_1@%
-GRANT SELECT ON *.* TO 'mysqltest_1'@'%' IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
-GRANT INSERT ON "test".* TO 'mysqltest_1'@'%'
-GRANT UPDATE (c2) ON "test"."t2" TO 'mysqltest_1'@'%'
-GRANT UPDATE ON "test"."t1" TO 'mysqltest_1'@'%'
+GRANT SELECT ON *.* TO "mysqltest_1"@"%" IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
+GRANT INSERT ON "test".* TO "mysqltest_1"@"%"
+GRANT UPDATE (c2) ON "test"."t2" TO "mysqltest_1"@"%"
+GRANT UPDATE ON "test"."t1" TO "mysqltest_1"@"%"
drop user 'mysqltest_1', 'mysqltest_3';
drop user 'mysqltest_1';
ERROR HY000: Operation DROP USER failed for 'mysqltest_1'@'%'
@@ -292,19 +292,19 @@ drop user 'mysqltest_2';
create user '%@b'@'b';
show grants for '%@b'@'b';
Grants for %@b@b
-GRANT USAGE ON *.* TO '%@b'@'b'
+GRANT USAGE ON *.* TO "%@b"@"b"
grant select on mysql.* to '%@b'@'b';
show grants for '%@b'@'b';
Grants for %@b@b
-GRANT USAGE ON *.* TO '%@b'@'b'
-GRANT SELECT ON "mysql".* TO '%@b'@'b'
+GRANT USAGE ON *.* TO "%@b"@"b"
+GRANT SELECT ON "mysql".* TO "%@b"@"b"
rename user '%@b'@'b' to '%@a'@'a';
show grants for '%@b'@'b';
ERROR 42000: There is no such grant defined for user '%@b' on host 'b'
show grants for '%@a'@'a';
Grants for %@a@a
-GRANT USAGE ON *.* TO '%@a'@'a'
-GRANT SELECT ON "mysql".* TO '%@a'@'a'
+GRANT USAGE ON *.* TO "%@a"@"a"
+GRANT SELECT ON "mysql".* TO "%@a"@"a"
drop user '%@a'@'a';
create user mysqltest_2@localhost;
grant create user on *.* to mysqltest_2@localhost;
@@ -324,8 +324,8 @@ connect user4,localhost,mysqltest_3,,;
connection user4;
show grants;
Grants for mysqltest_3@localhost
-GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
-GRANT INSERT, UPDATE, DELETE ON `mysql`.* TO 'mysqltest_3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_3`@`localhost`
+GRANT INSERT, UPDATE, DELETE ON `mysql`.* TO `mysqltest_3`@`localhost`
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 'user'
insert into mysql.user set host='%', user='mysqltest_B';
@@ -350,8 +350,8 @@ connect n1,127.0.0.1,mysqltest_1,,mysqltest_1,$MASTER_MYPORT,$MASTER_MYSOCK;
connection n1;
show grants for current_user();
Grants for mysqltest_1@127.0.0.0/255.0.0.0
-GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'
-GRANT ALL PRIVILEGES ON `mysqltest_1`.`t1` TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'
+GRANT USAGE ON *.* TO `mysqltest_1`@`127.0.0.0/255.0.0.0`
+GRANT ALL PRIVILEGES ON `mysqltest_1`.`t1` TO `mysqltest_1`@`127.0.0.0/255.0.0.0`
select * from t1;
i
1
diff --git a/mysql-test/main/grant3.result b/mysql-test/main/grant3.result
index 4c99fb02f19..e26f19ee492 100644
--- a/mysql-test/main/grant3.result
+++ b/mysql-test/main/grant3.result
@@ -143,9 +143,9 @@ connect conn1,localhost,mysqltest1,,;
connection conn1;
SHOW GRANTS;
Grants for mysqltest1@%
-GRANT USAGE ON *.* TO 'mysqltest1'@'%'
-GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO 'mysqltest1'@'%'
-GRANT UPDATE ON `mysqltest_1`.* TO 'mysqltest1'@'%'
+GRANT USAGE ON *.* TO `mysqltest1`@`%`
+GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO `mysqltest1`@`%`
+GRANT UPDATE ON `mysqltest_1`.* TO `mysqltest1`@`%`
SELECT * FROM mysqltest_1.t1;
a
disconnect conn1;
@@ -166,20 +166,20 @@ RENAME USER 'user1'@'%' TO 'user2'@'%';
# Show privileges after rename and BEFORE grant
SHOW GRANTS FOR 'user2'@'%';
Grants for user2@%
-GRANT USAGE ON *.* TO 'user2'@'%'
+GRANT USAGE ON *.* TO `user2`@`%`
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%';
# Show privileges after rename and grant
SHOW GRANTS FOR 'user2'@'%';
Grants for user2@%
-GRANT USAGE ON *.* TO 'user2'@'%'
-GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%'
+GRANT USAGE ON *.* TO `user2`@`%`
+GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO `user2`@`%`
# Connect as the renamed user
connect conn1, localhost, user2,,;
connection conn1;
SHOW GRANTS;
Grants for user2@%
-GRANT USAGE ON *.* TO 'user2'@'%'
-GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%'
+GRANT USAGE ON *.* TO `user2`@`%`
+GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO `user2`@`%`
SELECT a FROM temp.t1;
a
1
diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result
index c0fecf0c369..6f474e3d52a 100644
--- a/mysql-test/main/grant5.result
+++ b/mysql-test/main/grant5.result
@@ -8,11 +8,11 @@ connect conn_1, localhost, test,,;
set role foo;
show grants for test;
Grants for test@%
-GRANT foo TO 'test'@'%'
-GRANT USAGE ON *.* TO 'test'@'%'
+GRANT `foo` TO `test`@`%`
+GRANT USAGE ON *.* TO `test`@`%`
show grants for foo;
Grants for foo
-GRANT USAGE ON *.* TO 'foo'
+GRANT USAGE ON *.* TO `foo`
show grants for foo@'%';
ERROR 42000: Access denied for user 'test'@'%' to database 'mysql'
connection default;
@@ -25,3 +25,98 @@ ERROR HY000: Table 'user' was not locked with LOCK TABLES
REVOKE PROCESS ON *.* FROM u;
ERROR HY000: Table 'user' was not locked with LOCK TABLES
DROP TABLE t1;
+#
+# MDEV-20076: SHOW GRANTS does not quote role names properly
+#
+create role 'role1';
+create role 'fetch';
+create role 'role-1';
+create role 'rock\'n\'roll';
+create user 'user1'@'localhost';
+create user 'fetch'@'localhost';
+create user 'user-1'@'localhost';
+create user 'O\'Brien'@'localhost';
+grant select on mysql.user to role1;
+grant select on mysql.user to 'fetch';
+grant select on mysql.user to 'role-1';
+grant select on mysql.user to 'rock\'n\'roll';
+GRANT 'role1' TO 'user1'@'localhost';
+GRANT 'fetch' TO 'fetch'@'localhost';
+GRANT 'role-1' TO 'user-1'@'localhost';
+GRANT 'rock\'n\'roll' TO 'O\'Brien'@'localhost';
+show grants for 'role1';
+Grants for role1
+GRANT USAGE ON *.* TO `role1`
+GRANT SELECT ON `mysql`.`user` TO `role1`
+show grants for 'fetch';
+Grants for fetch
+GRANT USAGE ON *.* TO `fetch`
+GRANT SELECT ON `mysql`.`user` TO `fetch`
+show grants for 'role-1';
+Grants for role-1
+GRANT USAGE ON *.* TO `role-1`
+GRANT SELECT ON `mysql`.`user` TO `role-1`
+show grants for 'rock\'n\'roll';
+Grants for rock'n'roll
+GRANT USAGE ON *.* TO `rock'n'roll`
+GRANT SELECT ON `mysql`.`user` TO `rock'n'roll`
+show grants for 'user1'@'localhost';
+Grants for user1@localhost
+GRANT `role1` TO `user1`@`localhost`
+GRANT USAGE ON *.* TO `user1`@`localhost`
+show grants for 'fetch'@'localhost';
+Grants for fetch@localhost
+GRANT `fetch` TO `fetch`@`localhost`
+GRANT USAGE ON *.* TO `fetch`@`localhost`
+show grants for 'user-1'@'localhost';
+Grants for user-1@localhost
+GRANT `role-1` TO `user-1`@`localhost`
+GRANT USAGE ON *.* TO `user-1`@`localhost`
+show grants for 'O\'Brien'@'localhost';
+Grants for O'Brien@localhost
+GRANT `rock'n'roll` TO `O'Brien`@`localhost`
+GRANT USAGE ON *.* TO `O'Brien`@`localhost`
+set @save_sql_quote_show_create= @@sql_quote_show_create;
+set @@sql_quote_show_create= OFF;
+show grants for 'role1';
+Grants for role1
+GRANT USAGE ON *.* TO role1
+GRANT SELECT ON `mysql`.`user` TO role1
+show grants for 'fetch';
+Grants for fetch
+GRANT USAGE ON *.* TO `fetch`
+GRANT SELECT ON `mysql`.`user` TO `fetch`
+show grants for 'role-1';
+Grants for role-1
+GRANT USAGE ON *.* TO `role-1`
+GRANT SELECT ON `mysql`.`user` TO `role-1`
+show grants for 'rock\'n\'roll';
+Grants for rock'n'roll
+GRANT USAGE ON *.* TO `rock'n'roll`
+GRANT SELECT ON `mysql`.`user` TO `rock'n'roll`
+show grants for 'user1'@'localhost';
+Grants for user1@localhost
+GRANT role1 TO user1@localhost
+GRANT USAGE ON *.* TO user1@localhost
+show grants for 'fetch'@'localhost';
+Grants for fetch@localhost
+GRANT `fetch` TO `fetch`@localhost
+GRANT USAGE ON *.* TO `fetch`@localhost
+show grants for 'user-1'@'localhost';
+Grants for user-1@localhost
+GRANT `role-1` TO `user-1`@localhost
+GRANT USAGE ON *.* TO `user-1`@localhost
+show grants for 'O\'Brien'@'localhost';
+Grants for O'Brien@localhost
+GRANT `rock'n'roll` TO `O'Brien`@localhost
+GRANT USAGE ON *.* TO `O'Brien`@localhost
+set @@sql_quote_show_create= @save_sql_quote_show_create;
+drop role 'role1';
+drop role 'fetch';
+drop role 'role-1';
+drop role 'rock\'n\'roll';
+drop user 'user1'@'localhost';
+drop user 'fetch'@'localhost';
+drop user 'user-1'@'localhost';
+drop user 'O\'Brien'@'localhost';
+# End of 10.3 tests
diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test
index 649bba7d1ca..63ea5590235 100644
--- a/mysql-test/main/grant5.test
+++ b/mysql-test/main/grant5.test
@@ -33,3 +33,53 @@ REVOKE EXECUTE ON PROCEDURE sp FROM u;
--error ER_TABLE_NOT_LOCKED
REVOKE PROCESS ON *.* FROM u;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-20076: SHOW GRANTS does not quote role names properly
+--echo #
+
+create role 'role1';
+create role 'fetch';
+create role 'role-1';
+create role 'rock\'n\'roll';
+create user 'user1'@'localhost';
+create user 'fetch'@'localhost';
+create user 'user-1'@'localhost';
+create user 'O\'Brien'@'localhost';
+grant select on mysql.user to role1;
+grant select on mysql.user to 'fetch';
+grant select on mysql.user to 'role-1';
+grant select on mysql.user to 'rock\'n\'roll';
+GRANT 'role1' TO 'user1'@'localhost';
+GRANT 'fetch' TO 'fetch'@'localhost';
+GRANT 'role-1' TO 'user-1'@'localhost';
+GRANT 'rock\'n\'roll' TO 'O\'Brien'@'localhost';
+show grants for 'role1';
+show grants for 'fetch';
+show grants for 'role-1';
+show grants for 'rock\'n\'roll';
+show grants for 'user1'@'localhost';
+show grants for 'fetch'@'localhost';
+show grants for 'user-1'@'localhost';
+show grants for 'O\'Brien'@'localhost';
+set @save_sql_quote_show_create= @@sql_quote_show_create;
+set @@sql_quote_show_create= OFF;
+show grants for 'role1';
+show grants for 'fetch';
+show grants for 'role-1';
+show grants for 'rock\'n\'roll';
+show grants for 'user1'@'localhost';
+show grants for 'fetch'@'localhost';
+show grants for 'user-1'@'localhost';
+show grants for 'O\'Brien'@'localhost';
+set @@sql_quote_show_create= @save_sql_quote_show_create;
+drop role 'role1';
+drop role 'fetch';
+drop role 'role-1';
+drop role 'rock\'n\'roll';
+drop user 'user1'@'localhost';
+drop user 'fetch'@'localhost';
+drop user 'user-1'@'localhost';
+drop user 'O\'Brien'@'localhost';
+
+--echo # End of 10.3 tests
diff --git a/mysql-test/main/grant_cache_no_prot.result b/mysql-test/main/grant_cache_no_prot.result
index 04eb2469732..780fb254b76 100644
--- a/mysql-test/main/grant_cache_no_prot.result
+++ b/mysql-test/main/grant_cache_no_prot.result
@@ -14,11 +14,11 @@ connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection root;
show grants for current_user;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
create database if not exists mysqltest;
create table mysqltest.t1 (a int,b int,c int);
@@ -65,8 +65,8 @@ connect user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
connection user1;
show grants for current_user();
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 6
@@ -131,7 +131,7 @@ connect unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK;
connection unkuser;
show grants for current_user();
Grants for @localhost
-GRANT USAGE ON *.* TO ''@'localhost'
+GRANT USAGE ON *.* TO ``@`localhost`
connect user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
connection user2;
select "user2";
@@ -197,8 +197,8 @@ user4
user4
show grants;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select a from t1;
ERROR 3D000: No database selected
select * from mysqltest.t1,test.t1;
diff --git a/mysql-test/main/grant_cache_ps_prot.result b/mysql-test/main/grant_cache_ps_prot.result
index 3bc51430fd0..9dcf8c4aa8f 100644
--- a/mysql-test/main/grant_cache_ps_prot.result
+++ b/mysql-test/main/grant_cache_ps_prot.result
@@ -14,11 +14,11 @@ connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection root;
show grants for current_user;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
create database if not exists mysqltest;
create table mysqltest.t1 (a int,b int,c int);
@@ -65,8 +65,8 @@ connect user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
connection user1;
show grants for current_user();
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 6
@@ -131,7 +131,7 @@ connect unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK;
connection unkuser;
show grants for current_user();
Grants for @localhost
-GRANT USAGE ON *.* TO ''@'localhost'
+GRANT USAGE ON *.* TO ``@`localhost`
connect user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
connection user2;
select "user2";
@@ -197,8 +197,8 @@ user4
user4
show grants;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select a from t1;
ERROR 3D000: No database selected
select * from mysqltest.t1,test.t1;
diff --git a/mysql-test/main/group_by.result b/mysql-test/main/group_by.result
index 38ae5bc0b00..99e843b732b 100644
--- a/mysql-test/main/group_by.result
+++ b/mysql-test/main/group_by.result
@@ -2828,6 +2828,22 @@ SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
0
drop table t1;
#
+# MDEV-20922: Adding an order by changes the query results
+#
+CREATE TABLE t1(a int, b int);
+INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200), (5, 200);
+create view v1 as select a, b+1 as x from t1;
+SELECT x, COUNT(DISTINCT a) AS y FROM v1 GROUP BY x ORDER BY y;
+x y
+101 2
+201 3
+SELECT b+1 AS x, COUNT(DISTINCT a) AS y FROM t1 GROUP BY x ORDER BY y;
+x y
+101 2
+201 3
+drop view v1;
+drop table t1;
+#
# MDEV-10694 - SIGFPE and/or huge memory allocation in maria_create with distinct/group by/ rollup
#
create table t1 (a int,b int) ;
diff --git a/mysql-test/main/group_by.test b/mysql-test/main/group_by.test
index 72f2c3b29d4..7b79e6caac1 100644
--- a/mysql-test/main/group_by.test
+++ b/mysql-test/main/group_by.test
@@ -1946,6 +1946,20 @@ SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
drop table t1;
--echo #
+--echo # MDEV-20922: Adding an order by changes the query results
+--echo #
+
+CREATE TABLE t1(a int, b int);
+INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200), (5, 200);
+
+create view v1 as select a, b+1 as x from t1;
+
+SELECT x, COUNT(DISTINCT a) AS y FROM v1 GROUP BY x ORDER BY y;
+SELECT b+1 AS x, COUNT(DISTINCT a) AS y FROM t1 GROUP BY x ORDER BY y;
+
+drop view v1;
+drop table t1;
+--echo #
--echo # MDEV-10694 - SIGFPE and/or huge memory allocation in maria_create with distinct/group by/ rollup
--echo #
create table t1 (a int,b int) ;
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index bca22b4885e..b11d8d432e0 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -1039,8 +1039,8 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'user1'@'localhost' def USAGE NO
show grants;
Grants for user1@localhost
-GRANT USAGE ON *.* TO 'user1'@'localhost'
-GRANT SELECT (f1) ON `mysqltest`.`t1` TO 'user1'@'localhost'
+GRANT USAGE ON *.* TO `user1`@`localhost`
+GRANT SELECT (f1) ON `mysqltest`.`t1` TO `user1`@`localhost`
connection con2;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
@@ -1054,8 +1054,8 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'user2'@'localhost' def USAGE NO
show grants;
Grants for user2@localhost
-GRANT USAGE ON *.* TO 'user2'@'localhost'
-GRANT SELECT ON `mysqltest`.`t2` TO 'user2'@'localhost'
+GRANT USAGE ON *.* TO `user2`@`localhost`
+GRANT SELECT ON `mysqltest`.`t2` TO `user2`@`localhost`
connection con3;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
@@ -1069,8 +1069,8 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'user3'@'localhost' def USAGE NO
show grants;
Grants for user3@localhost
-GRANT USAGE ON *.* TO 'user3'@'localhost'
-GRANT SELECT ON `mysqltest`.* TO 'user3'@'localhost'
+GRANT USAGE ON *.* TO `user3`@`localhost`
+GRANT SELECT ON `mysqltest`.* TO `user3`@`localhost`
connection con4;
select * from information_schema.column_privileges where grantee like '\'user%'
order by grantee;
@@ -1093,7 +1093,7 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'user4'@'localhost' def SELECT NO
show grants;
Grants for user4@localhost
-GRANT SELECT ON *.* TO 'user4'@'localhost'
+GRANT SELECT ON *.* TO `user4`@`localhost`
connection default;
disconnect con1;
disconnect con2;
diff --git a/mysql-test/main/insert_debug-master.opt b/mysql-test/main/insert_debug-master.opt
new file mode 100644
index 00000000000..824f656cbd5
--- /dev/null
+++ b/mysql-test/main/insert_debug-master.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=2
diff --git a/mysql-test/main/insert_debug.result b/mysql-test/main/insert_debug.result
new file mode 100644
index 00000000000..eed8688a04c
--- /dev/null
+++ b/mysql-test/main/insert_debug.result
@@ -0,0 +1,29 @@
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+connect con1, localhost, root,,;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+connection default;
+CREATE TABLE t1(c1 VARCHAR(10) NOT NULL, c2 VARCHAR(10) NOT NULL, c3 VARCHAR(10) NOT NULL);
+INSERT INTO t1(c1, c2, c3) VALUES('A1','B1','IT1'), ('A2','B2','IT1'), ('A3','B3','IT1'), ('A4','B4','IT1'), ('A5','B5','IT1'), ('A6','B6','IT1'), ('A7','B7','IT1');
+CREATE TABLE t2(c1 VARCHAR(10) NOT NULL, c2 VARCHAR(10) NOT NULL, c3 VARCHAR(10) NOT NULL);
+INSERT INTO t2(c1, c2, c3) VALUES ('A3','B3','IT2'), ('A2','B2','IT2'), ('A4','B4','IT2'), ('A5','B5','II2');
+CREATE TABLE result(id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, c1 VARCHAR(10) NOT NULL, c2 VARCHAR(10),
+c3 VARCHAR(10), update_count INT DEFAULT 0, UNIQUE KEY uniq_idx (c1,c2), PRIMARY KEY (id)) ENGINE = innodb;
+SET DEBUG_SYNC = "ha_write_row_end WAIT_FOR flushed EXECUTE 1";
+INSERT INTO result(c1, c2, c3) SELECT * FROM t1 ON DUPLICATE KEY UPDATE c2=t1.c2, c3='UT1', update_count=update_count+1;
+connection con1;
+INSERT INTO result(c1, c2, c3) SELECT * FROM t2 ON DUPLICATE KEY UPDATE c2=t2.c2, c3='UT2', update_count=update_count+1;
+SET DEBUG_SYNC = "now SIGNAL flushed";
+connection default;
+SELECT * FROM result;
+id c1 c2 c3 update_count
+1 A1 B1 IT1 0
+2 A3 B3 UT1 1
+3 A2 B2 UT1 1
+4 A4 B4 UT1 1
+5 A5 B5 UT1 1
+9 A6 B6 IT1 0
+10 A7 B7 IT1 0
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE result;
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/main/insert_debug.test b/mysql-test/main/insert_debug.test
new file mode 100644
index 00000000000..b35d6b838da
--- /dev/null
+++ b/mysql-test/main/insert_debug.test
@@ -0,0 +1,54 @@
+source include/have_innodb.inc;
+source include/have_debug.inc;
+source include/have_debug_sync.inc;
+
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+
+connect (con1, localhost, root,,);
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+
+connection default;
+
+let $conn0_id= `SELECT CONNECTION_ID()`;
+
+CREATE TABLE t1(c1 VARCHAR(10) NOT NULL, c2 VARCHAR(10) NOT NULL, c3 VARCHAR(10) NOT NULL);
+INSERT INTO t1(c1, c2, c3) VALUES('A1','B1','IT1'), ('A2','B2','IT1'), ('A3','B3','IT1'), ('A4','B4','IT1'), ('A5','B5','IT1'), ('A6','B6','IT1'), ('A7','B7','IT1');
+
+CREATE TABLE t2(c1 VARCHAR(10) NOT NULL, c2 VARCHAR(10) NOT NULL, c3 VARCHAR(10) NOT NULL);
+INSERT INTO t2(c1, c2, c3) VALUES ('A3','B3','IT2'), ('A2','B2','IT2'), ('A4','B4','IT2'), ('A5','B5','II2');
+
+CREATE TABLE result(id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, c1 VARCHAR(10) NOT NULL, c2 VARCHAR(10),
+c3 VARCHAR(10), update_count INT DEFAULT 0, UNIQUE KEY uniq_idx (c1,c2), PRIMARY KEY (id)) ENGINE = innodb;
+
+# Insert one row from 't1' into the 'result' table and wait on a debug sync
+# point. The next insert statement from an session 2 inserts values that would
+# lead to unique key clash, when this insert resumes.
+# The subsequent inserts of this statement(after resume) will fail because of a
+# clash with the unique index, and are expected to update the row which clashes
+# with the unique key.
+# Without the fix for bug#30194841 a stale auto increment value, would cause a
+# collision with existing auto increment column value and ends up updating that
+# colliding row, instead of the row colliding with the unique index.
+SET DEBUG_SYNC = "ha_write_row_end WAIT_FOR flushed EXECUTE 1";
+send INSERT INTO result(c1, c2, c3) SELECT * FROM t1 ON DUPLICATE KEY UPDATE c2=t1.c2, c3='UT1', update_count=update_count+1;
+
+# While session 1 is waiting (after one insert), insert rows that will cause a clash
+# with the inserts of session 1 on the unique key.
+connection con1;
+
+# Wait for the session 1 to hit the debug sync point.
+let $wait_condition=SELECT 1 FROM information_schema.processlist WHERE id = $conn0_id AND state LIKE '%ha_write_row_end%';
+--source include/wait_condition.inc
+
+INSERT INTO result(c1, c2, c3) SELECT * FROM t2 ON DUPLICATE KEY UPDATE c2=t2.c2, c3='UT2', update_count=update_count+1;
+
+# Signal to resume the insert statement in session 1
+SET DEBUG_SYNC = "now SIGNAL flushed";
+connection default;
+reap;
+SELECT * FROM result;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE result;
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/main/invisible_field_grant_completely.result b/mysql-test/main/invisible_field_grant_completely.result
index 208a9f24ddf..aa0a768c51c 100644
--- a/mysql-test/main/invisible_field_grant_completely.result
+++ b/mysql-test/main/invisible_field_grant_completely.result
@@ -2,7 +2,7 @@ set @old_debug= @@debug_dbug;
create user user_1;
show grants for user_1;
Grants for user_1@%
-GRANT USAGE ON *.* TO 'user_1'@'%'
+GRANT USAGE ON *.* TO `user_1`@`%`
# create user
create database d;
use d;
diff --git a/mysql-test/main/invisible_field_grant_system.result b/mysql-test/main/invisible_field_grant_system.result
index 77acfdae744..b69478c58b3 100644
--- a/mysql-test/main/invisible_field_grant_system.result
+++ b/mysql-test/main/invisible_field_grant_system.result
@@ -1,7 +1,7 @@
create user user_1;
show grants for user_1;
Grants for user_1@%
-GRANT USAGE ON *.* TO 'user_1'@'%'
+GRANT USAGE ON *.* TO `user_1`@`%`
# create user
create database d;
use d;
diff --git a/mysql-test/main/ipv4_and_ipv6.result b/mysql-test/main/ipv4_and_ipv6.result
index 447c20536e2..9ae55c56f65 100644
--- a/mysql-test/main/ipv4_and_ipv6.result
+++ b/mysql-test/main/ipv4_and_ipv6.result
@@ -4,8 +4,8 @@ CREATE USER testuser@'::1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::1';
SHOW GRANTS FOR testuser@'::1';
Grants for testuser@::1
-GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1'
+GRANT USAGE ON *.* TO `testuser`@`::1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`::1`
SET @nip= inet_aton('::1');
SELECT @nip;
@nip
@@ -36,8 +36,8 @@ CREATE USER testuser@'127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'127.0.0.1';
SHOW GRANTS FOR testuser@'127.0.0.1';
Grants for testuser@127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
+GRANT USAGE ON *.* TO `testuser`@`127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`127.0.0.1`
SET @nip= inet_aton('127.0.0.1');
SELECT @nip;
@nip
diff --git a/mysql-test/main/ipv4_as_ipv6.result b/mysql-test/main/ipv4_as_ipv6.result
index b92b545da86..3b523454b3b 100644
--- a/mysql-test/main/ipv4_as_ipv6.result
+++ b/mysql-test/main/ipv4_as_ipv6.result
@@ -4,8 +4,8 @@ CREATE USER testuser@'127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'127.0.0.1';
SHOW GRANTS FOR testuser@'127.0.0.1';
Grants for testuser@127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
+GRANT USAGE ON *.* TO `testuser`@`127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`127.0.0.1`
SET @nip= inet_aton('127.0.0.1');
SELECT @nip;
@nip
@@ -36,8 +36,8 @@ CREATE USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0:0:0:0:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF:127.0.0.1';
Grants for testuser@0:0:0:0:0:ffff:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:ffff:127.0.0.1'
+GRANT USAGE ON *.* TO `testuser`@`0:0:0:0:0:ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0:0:0:0:0:ffff:127.0.0.1`
SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1');
SELECT @nip;
@nip
@@ -68,8 +68,8 @@ CREATE USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' identified by '12
GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
Grants for testuser@0000:0000:0000:0000:0000:ffff:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:ffff:127.0.0.1'
+GRANT USAGE ON *.* TO `testuser`@`0000:0000:0000:0000:0000:ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0000:0000:0000:0000:0000:ffff:127.0.0.1`
SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
@@ -100,8 +100,8 @@ CREATE USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
Grants for testuser@0:0000:0000:0:0000:ffff:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:ffff:127.0.0.1'
+GRANT USAGE ON *.* TO `testuser`@`0:0000:0000:0:0000:ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0:0000:0000:0:0000:ffff:127.0.0.1`
SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
@@ -132,8 +132,8 @@ CREATE USER testuser@'0::0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0::0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0::0000:FFFF:127.0.0.1';
Grants for testuser@0::0000:ffff:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'0::0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:ffff:127.0.0.1'
+GRANT USAGE ON *.* TO `testuser`@`0::0000:ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0::0000:ffff:127.0.0.1`
SET @nip= inet_aton('0::0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
@@ -165,8 +165,8 @@ CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'::FFFF:127.0.0.1';
Grants for testuser@::ffff:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'::ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::ffff:127.0.0.1'
+GRANT USAGE ON *.* TO `testuser`@`::ffff:127.0.0.1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`::ffff:127.0.0.1`
SET @nip= inet_aton('::FFFF:127.0.0.1');
SELECT @nip;
@nip
diff --git a/mysql-test/main/ipv6.result b/mysql-test/main/ipv6.result
index 1540b4825e5..31a4857659c 100644
--- a/mysql-test/main/ipv6.result
+++ b/mysql-test/main/ipv6.result
@@ -4,8 +4,8 @@ CREATE USER testuser@'::1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::1';
SHOW GRANTS FOR testuser@'::1';
Grants for testuser@::1
-GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1'
+GRANT USAGE ON *.* TO `testuser`@`::1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`::1`
SET @nip= inet_aton('::1');
SELECT @nip;
@nip
@@ -37,8 +37,8 @@ CREATE USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' identified by '12
GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
Grants for testuser@0000:0000:0000:0000:0000:0000:0000:0001
-GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001'
+GRANT USAGE ON *.* TO `testuser`@`0000:0000:0000:0000:0000:0000:0000:0001` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0000:0000:0000:0000:0000:0000:0000:0001`
SET @nip= inet_aton('0000:0000:0000:0000:0000:0000:0000:0001');
SELECT @nip;
@nip
@@ -69,8 +69,8 @@ CREATE USER testuser@'0:0:0:0:0:0:0:1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0:0:0:0:0:0:1';
SHOW GRANTS FOR testuser@'0:0:0:0:0:0:0:1';
Grants for testuser@0:0:0:0:0:0:0:1
-GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:0:0:1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:0:0:1'
+GRANT USAGE ON *.* TO `testuser`@`0:0:0:0:0:0:0:1` IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser`@`0:0:0:0:0:0:0:1`
SET @nip= inet_aton('0:0:0:0:0:0:0:1');
SELECT @nip;
@nip
diff --git a/mysql-test/main/join.result b/mysql-test/main/join.result
index fb4f35ed555..fe6d18f7807 100644
--- a/mysql-test/main/join.result
+++ b/mysql-test/main/join.result
@@ -3339,3 +3339,59 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
1 SIMPLE t1 ref a a 5 test.t0.a 1
drop table t0,t1;
+#
+# MDEV-21383: Possible range plan is not used under certain conditions
+#
+drop table if exists t10, t1000, t03;
+create table t10(a int);
+insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1000(a int);
+insert into t1000 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C;
+create table t03(a int);
+insert into t03 values (0),(1),(2);
+create table t1 (
+stationid int
+);
+insert into t1 select a from t10;
+CREATE TABLE t2 (
+stationId int,
+startTime int,
+filler char(100),
+key1 int,
+key2 int,
+key(key1),
+key(key2),
+PRIMARY KEY (`stationId`,`startTime`)
+);
+insert into t2 select
+A.a,
+B.a,
+repeat('filler=data-', 4),
+B.a,
+1
+from
+t03 A,
+t1000 B;
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+create table t3(a int, filler char(100), key(a));
+insert into t3 select A.a+1000*B.a, 'filler-data' from t1000 A, t10 B;
+# This should produce a join order of t1,t2,t3
+# t2 should have type=range, key=PRIMARY key_len=8 (not type=ALL or key_len<8)
+explain
+SELECT *
+FROM
+t1,t2,t3
+WHERE
+t2.startTime <= 100 and
+t2.stationId = t1.stationId and
+(t1.stationid = 1 or t1.stationid = 2 or t1.stationid = 3) and
+key1 >0 and
+t2.key2=t3.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where
+1 SIMPLE t2 range PRIMARY,key1,key2 PRIMARY 8 NULL 219 Using index condition; Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t3 ref a a 5 test.t2.key2 1
+drop table t1,t2,t3;
+drop table t1000,t10,t03;
diff --git a/mysql-test/main/join.test b/mysql-test/main/join.test
index c5d62e213d8..c72ff0e1a8c 100644
--- a/mysql-test/main/join.test
+++ b/mysql-test/main/join.test
@@ -1748,3 +1748,68 @@ show keys from t1;
explain select * from t0,t1 where t0.a=t1.a;
drop table t0,t1;
+
+--echo #
+--echo # MDEV-21383: Possible range plan is not used under certain conditions
+--echo #
+
+--disable_warnings
+drop table if exists t10, t1000, t03;
+--enable_warnings
+
+create table t10(a int);
+insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1000(a int);
+insert into t1000 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C;
+
+create table t03(a int);
+insert into t03 values (0),(1),(2);
+
+
+create table t1 (
+ stationid int
+);
+insert into t1 select a from t10;
+
+CREATE TABLE t2 (
+ stationId int,
+ startTime int,
+ filler char(100),
+ key1 int,
+ key2 int,
+ key(key1),
+ key(key2),
+ PRIMARY KEY (`stationId`,`startTime`)
+);
+
+insert into t2 select
+ A.a,
+ B.a,
+ repeat('filler=data-', 4),
+ B.a,
+ 1
+from
+ t03 A,
+ t1000 B;
+analyze table t2;
+
+create table t3(a int, filler char(100), key(a));
+insert into t3 select A.a+1000*B.a, 'filler-data' from t1000 A, t10 B;
+
+--echo # This should produce a join order of t1,t2,t3
+--echo # t2 should have type=range, key=PRIMARY key_len=8 (not type=ALL or key_len<8)
+explain
+SELECT *
+FROM
+ t1,t2,t3
+WHERE
+ t2.startTime <= 100 and
+ t2.stationId = t1.stationId and
+ (t1.stationid = 1 or t1.stationid = 2 or t1.stationid = 3) and
+ key1 >0 and
+ t2.key2=t3.a;
+
+drop table t1,t2,t3;
+drop table t1000,t10,t03;
+
diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result
index bab32395413..3d1d91df997 100644
--- a/mysql-test/main/join_cache.result
+++ b/mysql-test/main/join_cache.result
@@ -6056,4 +6056,76 @@ select f2 from t2,t1 where f2 = 0;
f2
drop table t1, t2;
set join_buffer_size=@save_join_buffer_size;
+#
+# MDEV-21243: Join buffer: condition is checked in wrong place for range access
+#
+create table t1(a int primary key);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int);
+insert into t2 select A.a + 10*B.a from t1 A, t1 B;
+create table t3 (
+kp1 int,
+kp2 int,
+col1 int,
+col2 int,
+key (kp1, kp2)
+);
+insert into t3
+select
+A.a,
+B.a,
+A.a + 100*B.a,
+A.a + 100*B.a
+from
+t2 A, t2 B;
+analyze table t3;
+Table Op Msg_type Msg_text
+test.t3 analyze status Table is already up to date
+# The following must have "B.col1 + 1 < 33333" attached to table B
+# and not to the block-nl-join node:
+explain format=json
+select *
+from t1 a, t3 b
+where
+b.kp1=a.a and
+b.kp1 <= 10 and
+b.kp2 <= 10 and
+b.col1 +1 < 33333;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "a",
+ "access_type": "index",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["a"],
+ "rows": 10,
+ "filtered": 100,
+ "attached_condition": "a.a <= 10",
+ "using_index": true
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "b",
+ "access_type": "range",
+ "possible_keys": ["kp1"],
+ "key": "kp1",
+ "key_length": "10",
+ "used_key_parts": ["kp1", "kp2"],
+ "rows": 836,
+ "filtered": 11.962,
+ "index_condition": "b.kp2 <= 10",
+ "attached_condition": "b.kp2 <= 10 and b.col1 + 1 < 33333"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "b.kp1 = a.a"
+ }
+ }
+}
+drop table t1,t2,t3;
set @@optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test
index 9576d598125..91339c2cb21 100644
--- a/mysql-test/main/join_cache.test
+++ b/mysql-test/main/join_cache.test
@@ -4014,5 +4014,45 @@ select f2 from t2,t1 where f2 = 0;
drop table t1, t2;
set join_buffer_size=@save_join_buffer_size;
+
+--echo #
+--echo # MDEV-21243: Join buffer: condition is checked in wrong place for range access
+--echo #
+create table t1(a int primary key);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int);
+insert into t2 select A.a + 10*B.a from t1 A, t1 B;
+
+create table t3 (
+ kp1 int,
+ kp2 int,
+ col1 int,
+ col2 int,
+ key (kp1, kp2)
+);
+
+insert into t3
+select
+ A.a,
+ B.a,
+ A.a + 100*B.a,
+ A.a + 100*B.a
+from
+ t2 A, t2 B;
+analyze table t3;
+
+--echo # The following must have "B.col1 + 1 < 33333" attached to table B
+--echo # and not to the block-nl-join node:
+explain format=json
+select *
+from t1 a, t3 b
+where
+ b.kp1=a.a and
+ b.kp1 <= 10 and
+ b.kp2 <= 10 and
+ b.col1 +1 < 33333;
+
+drop table t1,t2,t3;
+
# The following command must be the last one in the file
set @@optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/main/locale.opt b/mysql-test/main/locale.opt
new file mode 100644
index 00000000000..0ea17c2e0a8
--- /dev/null
+++ b/mysql-test/main/locale.opt
@@ -0,0 +1 @@
+--lc-messages=de_DE
diff --git a/mysql-test/main/locale.result b/mysql-test/main/locale.result
index b750d038205..f136e9e99ab 100644
--- a/mysql-test/main/locale.result
+++ b/mysql-test/main/locale.result
@@ -51,7 +51,7 @@ DROP TABLE t1;
#
SET lc_messages=sr_YU;
Warnings:
-Warning 1287 'sr_YU' is deprecated and will be removed in a future release. Please use sr_RS instead
+Warning 1287 'sr_YU' ist veraltet. Bitte benutzen Sie 'sr_RS'
SHOW VARIABLES LIKE 'lc_messages';
Variable_name Value
lc_messages sr_RS
diff --git a/mysql-test/main/log_slow_debug.result b/mysql-test/main/log_slow_debug.result
index 71a76342aba..16d67d7fdc7 100644
--- a/mysql-test/main/log_slow_debug.result
+++ b/mysql-test/main/log_slow_debug.result
@@ -6,7 +6,7 @@ SET @@GLOBAL.log_output='TABLE';
FLUSH SLOW LOGS;
SET @@GLOBAL.slow_query_log=ON;
SET @@GLOBAL.log_slow_admin_statements=ON;
-SET @save_dbug = @@debug_dbug;
+SET @saved_dbug = @@debug_dbug;
SET SESSION debug_dbug="+d,simulate_slow_query";
CREATE PROCEDURE show_slow_log()
BEGIN
@@ -218,7 +218,7 @@ sql_text
#
# Clean up
#
-SET SESSION debug_dbug=@save_dbug;
+SET SESSION debug_dbug=@saved_dbug;
TRUNCATE mysql.slow_log;
SET @@global.slow_query_log= @org_slow_query_log;
SET @@global.log_output= @org_log_output;
diff --git a/mysql-test/main/log_slow_debug.test b/mysql-test/main/log_slow_debug.test
index 6b7cdd62f8a..aba4cbc8dcb 100644
--- a/mysql-test/main/log_slow_debug.test
+++ b/mysql-test/main/log_slow_debug.test
@@ -9,7 +9,7 @@ SET @@GLOBAL.log_output='TABLE';
FLUSH SLOW LOGS;
SET @@GLOBAL.slow_query_log=ON;
SET @@GLOBAL.log_slow_admin_statements=ON;
-SET @save_dbug = @@debug_dbug;
+SET @saved_dbug = @@debug_dbug;
SET SESSION debug_dbug="+d,simulate_slow_query";
DELIMITER $$;
@@ -87,7 +87,7 @@ CALL show_slow_log();
--echo # Clean up
--echo #
-SET SESSION debug_dbug=@save_dbug;
+SET SESSION debug_dbug=@saved_dbug;
TRUNCATE mysql.slow_log;
SET @@global.slow_query_log= @org_slow_query_log;
SET @@global.log_output= @org_log_output;
diff --git a/mysql-test/main/lowercase_table_grant.result b/mysql-test/main/lowercase_table_grant.result
index 9ba542ec22d..45b6ab0410f 100644
--- a/mysql-test/main/lowercase_table_grant.result
+++ b/mysql-test/main/lowercase_table_grant.result
@@ -4,8 +4,8 @@ create database MYSQLtest;
grant all on MySQLtest.* to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select * from db where user = 'mysqltest_1';
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv
localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y
@@ -13,8 +13,8 @@ update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' a
flush privileges;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select * from db where user = 'mysqltest_1';
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv
localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y
diff --git a/mysql-test/main/mdev375.test b/mysql-test/main/mdev375.test
index 9e35190b927..6fdb35016ca 100644
--- a/mysql-test/main/mdev375.test
+++ b/mysql-test/main/mdev375.test
@@ -27,6 +27,8 @@ SELECT 2;
--connection default
SELECT 0;
+let $count_sessions=11;
+--source include/wait_until_count_sessions.inc
show status like "Threads_connected";
SET GLOBAL log_warnings=@save_log_warnings;
diff --git a/mysql-test/main/mdev6830.result b/mysql-test/main/mdev6830.result
index d1cf8c98ac1..0048aa174bc 100644
--- a/mysql-test/main/mdev6830.result
+++ b/mysql-test/main/mdev6830.result
@@ -1,3 +1,4 @@
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug= 'd,opt';
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
CREATE TABLE t2 (
@@ -46,3 +47,4 @@ SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5;
pk f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f1 f2
drop table t1,t2,t3,t4;
drop view v2,v3;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/mdev6830.test b/mysql-test/main/mdev6830.test
index 3898d5bbef6..ab5f19f7093 100644
--- a/mysql-test/main/mdev6830.test
+++ b/mysql-test/main/mdev6830.test
@@ -2,7 +2,7 @@
# MDEV-6830 Server crashes in best_access_path after a sequence of SELECTs invollving a temptable view
#
--source include/have_debug.inc
-
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug= 'd,opt';
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
@@ -60,4 +60,4 @@ SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5;
drop table t1,t2,t3,t4;
drop view v2,v3;
-
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/merge-big.result b/mysql-test/main/merge-big.result
index 3b6e116986e..bd188d7a856 100644
--- a/mysql-test/main/merge-big.result
+++ b/mysql-test/main/merge-big.result
@@ -7,7 +7,7 @@ drop table if exists t1,t2,t3,t4,t5,t6;
CREATE TABLE t1 (c1 INT) ENGINE= MyISAM;
LOCK TABLE t1 WRITE;
connect con1,localhost,root,,;
-SET @orig_debug=@@debug;
+SET @orig_debug=@@global.debug_dbug;
SET GLOBAL debug_dbug="+d,sleep_open_and_lock_after_open";
INSERT INTO t1 VALUES (1);
connection default;
diff --git a/mysql-test/main/merge-big.test b/mysql-test/main/merge-big.test
index 9bd2cab2c8a..5873d2eb233 100644
--- a/mysql-test/main/merge-big.test
+++ b/mysql-test/main/merge-big.test
@@ -42,7 +42,7 @@ LOCK TABLE t1 WRITE;
#SELECT NOW();
connect (con1,localhost,root,,);
let $con1_id= `SELECT CONNECTION_ID()`;
- SET @orig_debug=@@debug;
+ SET @orig_debug=@@global.debug_dbug;
SET GLOBAL debug_dbug="+d,sleep_open_and_lock_after_open";
send INSERT INTO t1 VALUES (1);
connection default;
diff --git a/mysql-test/main/merge_debug.result b/mysql-test/main/merge_debug.result
index 51905e52d24..29858810ff1 100644
--- a/mysql-test/main/merge_debug.result
+++ b/mysql-test/main/merge_debug.result
@@ -3,7 +3,7 @@ set global storage_engine=myisam;
set session storage_engine=myisam;
call mtr.add_suppression("Index for table .*crashed' is corrupt; try to repair it");
drop table if exists crashed,t2,t3,t4;
-SET @orig_debug=@@debug;
+SET @orig_debug=@@global.debug_dbug;
CREATE TABLE crashed (c1 INT);
CREATE TABLE t2 (c1 INT);
CREATE TABLE t3 (c1 INT);
diff --git a/mysql-test/main/merge_debug.test b/mysql-test/main/merge_debug.test
index 3c617cfc545..50017bc1331 100644
--- a/mysql-test/main/merge_debug.test
+++ b/mysql-test/main/merge_debug.test
@@ -14,7 +14,7 @@ call mtr.add_suppression("Index for table .*crashed' is corrupt; try to repair i
drop table if exists crashed,t2,t3,t4;
--enable_warnings
-SET @orig_debug=@@debug;
+SET @orig_debug=@@global.debug_dbug;
#
# Check that MariaDB handles reopen that fails without crashing
diff --git a/mysql-test/main/myisam_debug.result b/mysql-test/main/myisam_debug.result
index 6232e3eac0e..1428473c850 100644
--- a/mysql-test/main/myisam_debug.result
+++ b/mysql-test/main/myisam_debug.result
@@ -34,10 +34,10 @@ create table t1 (a int, index(a));
lock tables t1 write;
insert t1 values (1),(2),(1);
set @old_dbug=@@debug_dbug;
-set debug_dbug='+d,mi_lock_database_failure';
+SET debug_dbug='+d,mi_lock_database_failure';
unlock tables;
Warnings:
Error 126 Index for table './test/t1.MYI' is corrupt; try to repair it
Error 1030 Got error 22 "Invalid argument" from storage engine MyISAM
-set debug_dbug=@old_dbug;
+SET debug_dbug=@old_dbug;
drop table t1;
diff --git a/mysql-test/main/myisam_debug.test b/mysql-test/main/myisam_debug.test
index 465ecd70895..2861c344b10 100644
--- a/mysql-test/main/myisam_debug.test
+++ b/mysql-test/main/myisam_debug.test
@@ -66,7 +66,7 @@ create table t1 (a int, index(a));
lock tables t1 write;
insert t1 values (1),(2),(1);
set @old_dbug=@@debug_dbug;
-set debug_dbug='+d,mi_lock_database_failure';
+SET debug_dbug='+d,mi_lock_database_failure';
unlock tables;
-set debug_dbug=@old_dbug;
+SET debug_dbug=@old_dbug;
drop table t1;
diff --git a/mysql-test/main/mysql_client_test.test b/mysql-test/main/mysql_client_test.test
index de4c33694ab..fc2e3a00ed5 100644
--- a/mysql-test/main/mysql_client_test.test
+++ b/mysql-test/main/mysql_client_test.test
@@ -2,8 +2,6 @@
-- source include/not_embedded.inc
# need to have the dynamic loading turned on for the client plugin tests
--source include/have_plugin_auth.inc
-# This test is slow on buildbot.
---source include/big_test.inc
# Run test with default character set
--source include/default_charset.inc
diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
index e33a519e897..fc9ddce08b1 100644
--- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
+++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
@@ -4,7 +4,7 @@
# Verbose run
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=InnoDB;
ALTER TABLE time_zone_name ENGINE=InnoDB;
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -36,7 +36,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -46,7 +46,7 @@ END IF|
# Silent run
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=InnoDB;
ALTER TABLE time_zone_name ENGINE=InnoDB;
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -75,7 +75,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -93,7 +93,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -105,21 +105,21 @@ END IF|
#
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
END IF|
\d ;
TRUNCATE TABLE time_zone_leap_second;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=MyISAM;
END IF|
\d ;
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -131,7 +131,7 @@ END IF|
#
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=InnoDB;
ALTER TABLE time_zone_name ENGINE=InnoDB;
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -146,7 +146,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result
index 08efe0e8bc8..aa58440747a 100644
--- a/mysql-test/main/mysql_upgrade.result
+++ b/mysql-test/main/mysql_upgrade.result
@@ -313,8 +313,8 @@ Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
SHOW GRANTS FOR 'user3'@'%';
Grants for user3@%
-GRANT USAGE ON *.* TO 'user3'@'%'
-GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
+GRANT USAGE ON *.* TO `user3`@`%`
+GRANT ALL PRIVILEGES ON `roelt`.`test2` TO `user3`@`%`
DROP USER 'user3'@'%';
End of 5.1 tests
The --upgrade-system-tables option was used, user tables won't be touched.
@@ -586,7 +586,7 @@ Run mysql_upgrade with all privileges on a user
flush privileges;
SHOW GRANTS FOR 'user3'@'%';
Grants for user3@%
-GRANT USAGE ON *.* TO 'user3'@'%'
-GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
+GRANT USAGE ON *.* TO `user3`@`%`
+GRANT ALL PRIVILEGES ON `roelt`.`test2` TO `user3`@`%`
DROP USER 'user3'@'%';
update mysql.db set Delete_history_priv='Y' where db like 'test%';
diff --git a/mysql-test/main/mysqlbinlog.result b/mysql-test/main/mysqlbinlog.result
index c4d95dc6ff7..decd095bbdf 100644
--- a/mysql-test/main/mysqlbinlog.result
+++ b/mysql-test/main/mysqlbinlog.result
@@ -654,8 +654,8 @@ CREATE USER untrusted@localhost;
GRANT SELECT ON mysqltest1.* TO untrusted@localhost;
SHOW GRANTS FOR untrusted@localhost;
Grants for untrusted@localhost
-GRANT USAGE ON *.* TO 'untrusted'@'localhost'
-GRANT SELECT ON `mysqltest1`.* TO 'untrusted'@'localhost'
+GRANT USAGE ON *.* TO `untrusted`@`localhost`
+GRANT SELECT ON `mysqltest1`.* TO `untrusted`@`localhost`
USE mysqltest1;
CREATE TABLE t1 (a INT, b CHAR(64));
flush logs;
diff --git a/mysql-test/main/mysqld--defaults-file.result b/mysql-test/main/mysqld--defaults-file.result
index 5fd5ca8d95a..ccad1d119fc 100644
--- a/mysql-test/main/mysqld--defaults-file.result
+++ b/mysql-test/main/mysqld--defaults-file.result
@@ -10,3 +10,13 @@ Could not open required defaults file: MYSQL_TEST_DIR/with.ext
Fatal error in defaults handling. Program aborted
Could not open required defaults file: MYSQL_TEST_DIR/no_extension
Fatal error in defaults handling. Program aborted
+#
+# MDEV-21374: When "--help --verbose" prints out configuration file paths,
+# the --defaults-file option is not considered
+#
+# Test on `defaults-file`
+Default options are read from the following files in the given order:
+MYSQLTEST_VARDIR/my.cnf
+# Test on `defaults-extra-file`
+Default options are read from the following files in the given order:
+<first-defaults> MYSQLTEST_VARDIR/my_test.cnf ~/.my.cnf
diff --git a/mysql-test/main/mysqld--defaults-file.test b/mysql-test/main/mysqld--defaults-file.test
index 3bfe0aa891f..91d30eb1617 100644
--- a/mysql-test/main/mysqld--defaults-file.test
+++ b/mysql-test/main/mysqld--defaults-file.test
@@ -29,3 +29,19 @@ exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
--error 1
exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;
+--echo #
+--echo # MDEV-21374: When "--help --verbose" prints out configuration file paths,
+--echo # the --defaults-file option is not considered
+--echo #
+
+--echo # Test on `defaults-file`
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+exec $MYSQLD --defaults-file=$MYSQLTEST_VARDIR/my.cnf --help --verbose | grep -A 1 'Default options are read';
+
+--echo # Test on `defaults-extra-file`
+# <first-defaults> = `/etc/my.cnf /etc/mysql/my.cnf`
+# Using sysconfdir configuration, we don't always have `/etc/mysql/my.cnf`, so replace them with a regex as well.
+copy_file $MYSQLTEST_VARDIR/my.cnf $MYSQLTEST_VARDIR/my_test.cnf;
+--replace_regex /.*my_test.cnf/<first-defaults> MYSQLTEST_VARDIR\/my_test.cnf/
+exec $MYSQLD --defaults-extra-file=$MYSQLTEST_VARDIR/my_test.cnf --help --verbose | grep -A 1 'Default options are read';
+remove_file $MYSQLTEST_VARDIR/my_test.cnf;
diff --git a/mysql-test/main/mysqld--help,win.rdiff b/mysql-test/main/mysqld--help,win.rdiff
index 89d2cd36112..880627631bd 100644
--- a/mysql-test/main/mysqld--help,win.rdiff
+++ b/mysql-test/main/mysqld--help,win.rdiff
@@ -1,6 +1,6 @@
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
-@@ -381,7 +381,6 @@ The following options may be given as the first argument:
+@@ -395,7 +395,6 @@
The number of segments in a key cache
-L, --language=name Client error messages in given language. May be given as
a full path. Deprecated. Use --lc-messages-dir instead.
@@ -8,7 +8,7 @@
--lc-messages=name Set the language used for the error messages.
-L, --lc-messages-dir=name
Directory where error messages are
-@@ -603,6 +602,7 @@ The following options may be given as the first argument:
+@@ -617,6 +616,7 @@
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
DATETIME, TIMESTAMP columns.
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
@@ -16,7 +16,7 @@
--net-buffer-length=#
Buffer length for TCP/IP and socket communication
--net-read-timeout=#
-@@ -1048,6 +1048,9 @@ The following options may be given as the first argument:
+@@ -1073,6 +1073,9 @@
characteristics (isolation level, read only/read
write,snapshot - but not any work done / data modified
within the transaction).
@@ -26,7 +26,7 @@
--show-slave-auth-info
Show user and password in SHOW SLAVE HOSTS on this
master.
-@@ -1171,6 +1174,10 @@ The following options may be given as the first argument:
+@@ -1196,6 +1199,10 @@
Log slow queries to given log file. Defaults logging to
'hostname'-slow.log. Must be enabled to activate other
slow log options
@@ -37,15 +37,15 @@
--socket=name Socket file to use for connection
--sort-buffer-size=#
Each thread that needs to do a sort allocates a buffer of
-@@ -1190,6 +1197,7 @@ The following options may be given as the first argument:
- EMPTY_STRING_IS_NULL, SIMULTANEOUS_ASSIGNMENT
+@@ -1219,6 +1226,7 @@
+ deleting or updating every row in a table.
--stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.)
+ --standalone Dummy option to start as a standalone program (NT).
--standard-compliant-cte
Allow only CTEs compliant to SQL standard
(Defaults to on; use --skip-standard-compliant-cte to disable.)
-@@ -1257,6 +1265,11 @@ The following options may be given as the first argument:
+@@ -1286,6 +1294,11 @@
--thread-pool-max-threads=#
Maximum allowed number of worker threads in the thread
pool
@@ -57,7 +57,7 @@
--thread-pool-oversubscribe=#
How many additional active worker threads in a group are
allowed.
-@@ -1295,8 +1308,8 @@ The following options may be given as the first argument:
+@@ -1324,8 +1337,8 @@
automatically convert it to an on-disk MyISAM or Aria
table.
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
@@ -68,7 +68,7 @@
--transaction-alloc-block-size=#
Allocation block size for transactions to be stored in
binary log
-@@ -1430,7 +1443,6 @@ key-cache-block-size 1024
+@@ -1462,7 +1475,6 @@
key-cache-division-limit 100
key-cache-file-hash-size 512
key-cache-segments 0
@@ -76,7 +76,7 @@
lc-messages en_US
lc-messages-dir MYSQL_SHAREDIR/
lc-time-names en_US
-@@ -1502,6 +1514,7 @@ myisam-sort-buffer-size 134216704
+@@ -1534,6 +1546,7 @@
myisam-stats-method NULLS_UNEQUAL
myisam-use-mmap FALSE
mysql56-temporal-format TRUE
@@ -84,7 +84,7 @@
net-buffer-length 16384
net-read-timeout 30
net-retry-count 10
-@@ -1612,6 +1625,8 @@ session-track-schema TRUE
+@@ -1645,6 +1658,8 @@
session-track-state-change FALSE
session-track-system-variables autocommit,character_set_client,character_set_connection,character_set_results,time_zone
session-track-transaction-info OFF
@@ -93,15 +93,15 @@
show-slave-auth-info FALSE
silent-startup FALSE
skip-grant-tables TRUE
-@@ -1638,6 +1653,7 @@ slave-transaction-retry-interval 0
+@@ -1671,6 +1686,7 @@
slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
+slow-start-timeout 15000
sort-buffer-size 2097152
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
- stack-trace TRUE
-@@ -1652,9 +1668,9 @@ sync-relay-log 10000
+ sql-safe-updates FALSE
+@@ -1686,10 +1702,10 @@
sync-relay-log-info 10000
sysdate-is-now FALSE
system-versioning-alter-history ERROR
@@ -109,11 +109,13 @@
+table-cache 2000
table-definition-cache 400
-table-open-cache 421
+-table-open-cache-instances 1
+table-open-cache 2000
- table-open-cache-instances 8
++table-open-cache-instances 8
tc-heuristic-recover OFF
tcp-keepalive-interval 0
-@@ -1663,6 +1679,8 @@ tcp-keepalive-time 0
+ tcp-keepalive-probes 0
+@@ -1697,6 +1713,8 @@
thread-cache-size 151
thread-pool-idle-timeout 60
thread-pool-max-threads 65536
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index 2a1455b05b0..40e9a8f4b56 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -1069,7 +1069,7 @@ The following specify which files/extra groups are read (specified before remain
disable; STATE to track just transaction state (Is there
an active transaction? Does it have any data? etc.);
CHARACTERISTICS to track transaction state and report all
- statements needed to start a transaction withthe same
+ statements needed to start a transaction with the same
characteristics (isolation level, read only/read
write,snapshot - but not any work done / data modified
within the transaction).
@@ -1689,7 +1689,7 @@ system-versioning-alter-history ERROR
table-cache 421
table-definition-cache 400
table-open-cache 421
-table-open-cache-instances 8
+table-open-cache-instances 1
tc-heuristic-recover OFF
tcp-keepalive-interval 0
tcp-keepalive-probes 0
@@ -1717,5 +1717,5 @@ userstat FALSE
verbose TRUE
wait-timeout 28800
-To see what values a running MySQL server is using, type
+To see what variables a running MySQL server is using, type
'mysqladmin variables' instead of 'mysqld --verbose --help'.
diff --git a/mysql-test/main/no_password_column-mdev-11170.result b/mysql-test/main/no_password_column-mdev-11170.result
index 6195100436d..6de44dffe42 100644
--- a/mysql-test/main/no_password_column-mdev-11170.result
+++ b/mysql-test/main/no_password_column-mdev-11170.result
@@ -76,13 +76,13 @@ create user ioo identified with "mysql_old_password" as "7a8f886d28473e85";
#
show grants for foo;
Grants for foo@%
-GRANT USAGE ON *.* TO 'foo'@'%'
+GRANT USAGE ON *.* TO `foo`@`%`
show grants for goo;
Grants for goo@%
-GRANT USAGE ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
+GRANT USAGE ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
-GRANT USAGE ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
+GRANT USAGE ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
select user, host, select_priv, plugin, authentication_string from mysql.user
where user like "%oo"
order by user;
@@ -96,13 +96,13 @@ ioo % N mysql_old_password 7a8f886d28473e85
SET PASSWORD FOR foo=PASSWORD("bar");
show grants for foo;
Grants for foo@%
-GRANT USAGE ON *.* TO 'foo'@'%' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
+GRANT USAGE ON *.* TO `foo`@`%` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
show grants for goo;
Grants for goo@%
-GRANT USAGE ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
+GRANT USAGE ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
-GRANT USAGE ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
+GRANT USAGE ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
select user, host, select_priv, plugin, authentication_string from mysql.user
where user like "%oo"
order by user;
@@ -116,13 +116,13 @@ ioo % N mysql_old_password 7a8f886d28473e85
flush privileges;
show grants for foo;
Grants for foo@%
-GRANT USAGE ON *.* TO 'foo'@'%' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
+GRANT USAGE ON *.* TO `foo`@`%` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
show grants for goo;
Grants for goo@%
-GRANT USAGE ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
+GRANT USAGE ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
-GRANT USAGE ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
+GRANT USAGE ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
#
# Test granting of privileges.
#
@@ -131,26 +131,26 @@ grant select on *.* to goo;
grant select on *.* to ioo;
show grants for foo;
Grants for foo@%
-GRANT SELECT ON *.* TO 'foo'@'%' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
+GRANT SELECT ON *.* TO `foo`@`%` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
show grants for goo;
Grants for goo@%
-GRANT SELECT ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
+GRANT SELECT ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
-GRANT SELECT ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
+GRANT SELECT ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
#
# Check to see if grants are stable on flush.
#
flush privileges;
show grants for foo;
Grants for foo@%
-GRANT SELECT ON *.* TO 'foo'@'%' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
+GRANT SELECT ON *.* TO `foo`@`%` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
show grants for goo;
Grants for goo@%
-GRANT SELECT ON *.* TO 'goo'@'%' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
+GRANT SELECT ON *.* TO `goo`@`%` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
show grants for ioo;
Grants for ioo@%
-GRANT SELECT ON *.* TO 'ioo'@'%' IDENTIFIED BY PASSWORD '7a8f886d28473e85'
+GRANT SELECT ON *.* TO `ioo`@`%` IDENTIFIED BY PASSWORD '7a8f886d28473e85'
#
# Check internal table representation.
#
diff --git a/mysql-test/main/opt_tvc.result b/mysql-test/main/opt_tvc.result
index 5329a9f64be..a68e70e8a25 100644
--- a/mysql-test/main/opt_tvc.result
+++ b/mysql-test/main/opt_tvc.result
@@ -629,11 +629,9 @@ SELECT * FROM t1 WHERE i IN (NULL, NULL, NULL, NULL, NULL);
i
EXPLAIN EXTENDED SELECT * FROM t1 WHERE i IN (NULL, NULL, NULL, NULL, NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY <derived3> ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
-3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i` from `test`.`t1` semi join ((values (NULL),(NULL),(NULL),(NULL),(NULL)) `tvc_0`) where `test`.`t1`.`i` = `tvc_0`.`_col_1`
+Note 1003 select `test`.`t1`.`i` AS `i` from `test`.`t1` where `test`.`t1`.`i` in (NULL,NULL,NULL,NULL,NULL)
SET in_predicate_conversion_threshold= default;
DROP TABLE t1;
#
@@ -687,3 +685,50 @@ f1 f2
1 1
DROP TABLE t1,t2,t3;
SET @@in_predicate_conversion_threshold= default;
+#
+# MDEV-20900: IN predicate to IN subquery conversion causes performance regression
+#
+create table t1(a int, b int);
+insert into t1 select seq-1, seq-1 from seq_1_to_10;
+set in_predicate_conversion_threshold=2;
+explain select * from t1 where t1.a IN ("1","2","3","4");
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where
+select * from t1 where t1.a IN ("1","2","3","4");
+a b
+1 1
+2 2
+3 3
+4 4
+set in_predicate_conversion_threshold=0;
+explain select * from t1 where t1.a IN ("1","2","3","4");
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where
+select * from t1 where t1.a IN ("1","2","3","4");
+a b
+1 1
+2 2
+3 3
+4 4
+set in_predicate_conversion_threshold=2;
+explain select * from t1 where (t1.a,t1.b) in (("1","1"),(2,2),(3,3),(4,4));
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where
+select * from t1 where (t1.a,t1.b) in (("1","1"),(2,2),(3,3),(4,4));
+a b
+1 1
+2 2
+3 3
+4 4
+set in_predicate_conversion_threshold=0;
+explain select * from t1 where (t1.a,t1.b) in (("1","1"),(2,2),(3,3),(4,4));
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where
+select * from t1 where (t1.a,t1.b) in (("1","1"),(2,2),(3,3),(4,4));
+a b
+1 1
+2 2
+3 3
+4 4
+drop table t1;
+SET @@in_predicate_conversion_threshold= default;
diff --git a/mysql-test/main/opt_tvc.test b/mysql-test/main/opt_tvc.test
index 7319dbdc9e8..e4e8c6d7919 100644
--- a/mysql-test/main/opt_tvc.test
+++ b/mysql-test/main/opt_tvc.test
@@ -3,6 +3,7 @@
#
source include/have_debug.inc;
source include/default_optimizer_switch.inc;
+source include/have_sequence.inc;
create table t1 (a int, b int);
@@ -397,3 +398,33 @@ SELECT * FROM t3 WHERE (f1,f2) IN ((2, 2), (1, 2), (3, 5), (1, 1));
DROP TABLE t1,t2,t3;
SET @@in_predicate_conversion_threshold= default;
+
+--echo #
+--echo # MDEV-20900: IN predicate to IN subquery conversion causes performance regression
+--echo #
+
+create table t1(a int, b int);
+insert into t1 select seq-1, seq-1 from seq_1_to_10;
+
+set in_predicate_conversion_threshold=2;
+
+let $query= select * from t1 where t1.a IN ("1","2","3","4");
+eval explain $query;
+eval $query;
+
+set in_predicate_conversion_threshold=0;
+eval explain $query;
+eval $query;
+
+set in_predicate_conversion_threshold=2;
+let $query= select * from t1 where (t1.a,t1.b) in (("1","1"),(2,2),(3,3),(4,4));
+eval explain $query;
+eval $query;
+
+set in_predicate_conversion_threshold=0;
+eval explain $query;
+eval $query;
+
+drop table t1;
+SET @@in_predicate_conversion_threshold= default;
+
diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result
index 8692e727c60..ec03e8c5f45 100644
--- a/mysql-test/main/order_by.result
+++ b/mysql-test/main/order_by.result
@@ -3206,6 +3206,36 @@ pk
3
DROP TABLE t1;
#
+# MDEV-21044: Wrong result when using a smaller size for sort buffer
+#
+create table t1(a varchar(765),b int);
+insert into t1 values ("a",1),("b",2),("c",3),("e",4);
+insert into t1 values ("d",5),("f",6),("g",7),("h",8);
+insert into t1 values ("k",11),("l",12),("i",9),("j",10);
+insert into t1 values ("m",13),("n",14),("o",15),("p",16);
+set @save_sort_buffer_size= @@sort_buffer_size;
+set sort_buffer_size=1024;
+select * from t1 order by b;
+a b
+a 1
+b 2
+c 3
+e 4
+d 5
+f 6
+g 7
+h 8
+i 9
+j 10
+k 11
+l 12
+m 13
+n 14
+o 15
+p 16
+set @@sort_buffer_size= @save_sort_buffer_size;
+drop table t1;
+#
# MDEV-13994: Bad join results with orderby_uses_equalities=on
#
CREATE TABLE books (
diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test
index 58b91fbda91..bcb9039ec88 100644
--- a/mysql-test/main/order_by.test
+++ b/mysql-test/main/order_by.test
@@ -2146,6 +2146,22 @@ SELECT DISTINCT pk FROM t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-21044: Wrong result when using a smaller size for sort buffer
+--echo #
+
+create table t1(a varchar(765),b int);
+insert into t1 values ("a",1),("b",2),("c",3),("e",4);
+insert into t1 values ("d",5),("f",6),("g",7),("h",8);
+insert into t1 values ("k",11),("l",12),("i",9),("j",10);
+insert into t1 values ("m",13),("n",14),("o",15),("p",16);
+set @save_sort_buffer_size= @@sort_buffer_size;
+set sort_buffer_size=1024;
+select * from t1 order by b;
+set @@sort_buffer_size= @save_sort_buffer_size;
+drop table t1;
+
+
+--echo #
--echo # MDEV-13994: Bad join results with orderby_uses_equalities=on
--echo #
diff --git a/mysql-test/main/partition_grant.result b/mysql-test/main/partition_grant.result
index cd8f8a970d0..41934896aeb 100644
--- a/mysql-test/main/partition_grant.result
+++ b/mysql-test/main/partition_grant.result
@@ -10,8 +10,8 @@ grant select,alter on mysqltest_1.* to mysqltest_1@localhost;
connect conn1,localhost,mysqltest_1,,mysqltest_1;
show grants for current_user;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, ALTER ON `mysqltest_1`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT SELECT, ALTER ON `mysqltest_1`.* TO `mysqltest_1`@`localhost`
alter table t1 add b int;
alter table t1 drop partition p2;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
diff --git a/mysql-test/main/partition_innodb.result b/mysql-test/main/partition_innodb.result
index 5c63fcfbbc9..70bfa4840ee 100644
--- a/mysql-test/main/partition_innodb.result
+++ b/mysql-test/main/partition_innodb.result
@@ -386,33 +386,33 @@ DROP TABLE t1;
create table t1 (a int) engine=innodb partition by hash(a) ;
show table status like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_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 10 Dynamic 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned 0 N
+t1 InnoDB 10 Dynamic 2 8192 16384 0 0 0 NULL # NULL NULL latin1_swedish_ci NULL partitioned 0 N
drop table t1;
create table t1 (a int)
engine = innodb
partition by key (a);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
-t1 InnoDB 10 Dynamic 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned 0 N
+t1 InnoDB 10 Dynamic 2 8192 16384 0 0 0 NULL Create_time NULL NULL latin1_swedish_ci NULL partitioned 0 N
insert into t1 values (0), (1), (2), (3);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
-t1 InnoDB 10 Dynamic 4 4096 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned 0 N
+t1 InnoDB 10 Dynamic 4 4096 16384 0 0 0 NULL Create_time Update_time NULL latin1_swedish_ci NULL partitioned 0 N
drop table t1;
create table t1 (a int auto_increment primary key)
engine = innodb
partition by key (a);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
-t1 InnoDB 10 Dynamic 2 8192 16384 0 0 # 1 # NULL NULL latin1_swedish_ci NULL partitioned 0 N
+t1 InnoDB 10 Dynamic 2 8192 16384 0 0 0 1 Create_time NULL NULL latin1_swedish_ci NULL partitioned 0 N
insert into t1 values (NULL), (NULL), (NULL), (NULL);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
-t1 InnoDB 10 Dynamic 4 4096 16384 0 0 # 5 # NULL NULL latin1_swedish_ci NULL partitioned 0 N
+t1 InnoDB 10 Dynamic 4 4096 16384 0 0 0 5 Create_time Update_time NULL latin1_swedish_ci NULL partitioned 0 N
insert into t1 values (NULL), (NULL), (NULL), (NULL);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
-t1 InnoDB 10 Dynamic 8 2048 16384 0 0 # 9 # NULL NULL latin1_swedish_ci NULL partitioned 0 N
+t1 InnoDB 10 Dynamic 8 2048 16384 0 0 0 9 Create_time Update_time NULL latin1_swedish_ci NULL partitioned 0 N
drop table t1;
create table t1 (a int)
partition by key (a)
diff --git a/mysql-test/main/partition_innodb.test b/mysql-test/main/partition_innodb.test
index f7ce9b03a54..6a89a0a6467 100644
--- a/mysql-test/main/partition_innodb.test
+++ b/mysql-test/main/partition_innodb.test
@@ -401,9 +401,7 @@ DROP TABLE t1;
# Bug #14673: Wrong InnoDB default row format
#
create table t1 (a int) engine=innodb partition by hash(a) ;
-# Data_free for InnoDB tablespace varies depending on which
-# tests have been run before this one
---replace_column 10 # 12 #
+--replace_column 12 #
show table status like 't1';
drop table t1;
@@ -413,33 +411,23 @@ drop table t1;
create table t1 (a int)
engine = innodb
partition by key (a);
-# Data_free for InnoDB tablespace varies depending on which
-# tests have been run before this one
---replace_column 10 # 12 #
+--replace_column 12 Create_time
show table status;
insert into t1 values (0), (1), (2), (3);
-# Data_free for InnoDB tablespace varies depending on which
-# tests have been run before this one
---replace_column 10 # 12 #
+--replace_column 12 Create_time 13 Update_time
show table status;
drop table t1;
create table t1 (a int auto_increment primary key)
engine = innodb
partition by key (a);
-# Data_free for InnoDB tablespace varies depending on which
-# tests have been run before this one
---replace_column 10 # 12 #
+--replace_column 12 Create_time
show table status;
insert into t1 values (NULL), (NULL), (NULL), (NULL);
-# Data_free for InnoDB tablespace varies depending on which
-# tests have been run before this one
---replace_column 10 # 12 #
+--replace_column 12 Create_time 13 Update_time
show table status;
insert into t1 values (NULL), (NULL), (NULL), (NULL);
-# Data_free for InnoDB tablespace varies depending on which
-# tests have been run before this one
---replace_column 10 # 12 #
+--replace_column 12 Create_time 13 Update_time
show table status;
drop table t1;
diff --git a/mysql-test/main/partition_mrr_aria.result b/mysql-test/main/partition_mrr_aria.result
index 7a0c35a309e..c2be6ee4703 100644
--- a/mysql-test/main/partition_mrr_aria.result
+++ b/mysql-test/main/partition_mrr_aria.result
@@ -39,6 +39,7 @@ A.a,
B.a,
123456
from t1 A, t1 B;
+set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='mrr=on';
explain
select * from t3 force index (key_col) where key_col < 3;
@@ -76,4 +77,160 @@ ID part_id key_col col2
27 7 2 123456
28 8 2 123456
29 9 2 123456
+set optimizer_switch=@save_optimizer_switch;
drop table t1,t3;
+#
+# MDEV-21544: partitioned table is joined with BKA+MRR
+#
+set @save_join_cache_level=@@join_cache_level;
+set @save_optimizer_switch=@@optimizer_switch;
+create table t0 (
+tp int, a int, b int not null, c varchar(12), index idx (a,b)
+);
+insert into t0 values
+(1,3,30,'yyzy'), (1,3,30,'yxxyy'), (1,3,30,'yyxy'), (1,3,30,'xxyy'),
+(1,3,30,'yyxz'), (1,3,30,'yyzz'), (1,3,30,'xxyzy'), (1,3,30,'yyyy'),
+(1,3,30,'yzzy'), (1,93,30,'zzzy'),
+(2,3,40,'yxx'), (2,4,40,'xx'), (2,3,10,'zxz'),
+(2,3,40,'yyx'), (2,4,40,'xxx'), (2,3,10,'zyyz'),
+(2,3,40,'xzzzz'), (2,4,40,'yyyxx'), (2,3,10,'zyz'),
+(2,3,40,'xxx'), (2,4,40,'xx'), (2,3,10,'zzz'),
+(2,3,40,'yyxzx'), (2,4,40,'xyx'), (2,3,10,'xzz'),
+(2,3,40,'xxxzz'), (2,4,40,'xxz'), (2,3,10,'zzzy'),
+(2,3,40,'zzxxx'), (2,4,40,'zxx'), (2,3,10,'yzzz'),
+(2,3,40,'xyyxx'), (2,4,40,'xzzzx'), (2,3,10,'zzxxz'),
+(2,3,40,'yzxxx'), (2,4,40,'xxzy'), (2,3,10,'zzzyx'),
+(2,93,40,'xzx'), (2,94,40,'xz'), (2,93,10,'zyyyz'),
+(3,4,30,'yx'), (3,4,30,'yyxxx'), (3,4,30,'zzyy'), (3,4,30,'zxyy'),
+(3,4,30,'xxyy'), (3,4,30,'yyzx'), (3,4,30,'zyyy'), (3,4,30,'yzy'),
+(3,4,30,'zzzyy'), (3,94,30,'yyz');
+create table t1 (
+tp int, a int, b int not null, c varchar(12), index idx (a,b)
+)
+partition by list (tp)
+( partition p1 values in (1),
+partition p2 values in (2),
+partition p3 values in (3));
+insert into t1 select * from t0;
+create table t2 (a int, index idx(a));
+insert into t2 values
+(1), (2), (3), (4), (5);
+insert into t2 select a+10 from t2;
+insert into t2 select a+20 from t2;
+analyze table t0,t1,t2;
+Table Op Msg_type Msg_text
+test.t0 analyze status OK
+test.t1 analyze status OK
+test.t2 analyze status OK
+set join_cache_level=6;
+set optimizer_switch='mrr=on';
+explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = `test`.`t2`.`a` - 1
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
+tp a b c a
+3 4 30 yx 4
+3 4 30 yyxxx 4
+3 4 30 zzyy 4
+3 4 30 zxyy 4
+3 4 30 xxyy 4
+3 4 30 yyzx 4
+3 4 30 zyyy 4
+3 4 30 yzy 4
+3 4 30 zzzyy 4
+explain extended select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = t2.a-1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 8 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t1`.`tp` AS `tp`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t1`.`b` / 10 = `test`.`t2`.`a` - 1
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = t2.a-1;
+tp a b c a
+3 4 30 yx 4
+3 4 30 yyxxx 4
+3 4 30 zzyy 4
+3 4 30 zxyy 4
+3 4 30 xxyy 4
+3 4 30 yyzx 4
+3 4 30 zyyy 4
+3 4 30 yzy 4
+3 4 30 zzzyy 4
+explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 100.00 Using index condition; Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = 4
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
+tp a b c a
+2 3 40 yxx 3
+2 4 40 xx 4
+2 3 40 yyx 3
+2 4 40 xxx 4
+2 3 40 xzzzz 3
+2 4 40 yyyxx 4
+2 3 40 xxx 3
+2 4 40 xx 4
+2 3 40 yyxzx 3
+2 4 40 xyx 4
+2 3 40 xxxzz 3
+2 4 40 xxz 4
+2 3 40 zzxxx 3
+2 4 40 zxx 4
+2 3 40 xyyxx 3
+2 4 40 xzzzx 4
+2 3 40 yzxxx 3
+2 4 40 xxzy 4
+explain extended select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 5 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t1`.`tp` AS `tp`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t1`.`b` / 10 = 4
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
+tp a b c a
+2 3 40 yxx 3
+2 4 40 xx 4
+2 3 40 yyx 3
+2 4 40 xxx 4
+2 3 40 xzzzz 3
+2 4 40 yyyxx 4
+2 3 40 xxx 3
+2 4 40 xx 4
+2 3 40 yyxzx 3
+2 4 40 xyx 4
+2 3 40 xxxzz 3
+2 4 40 xxz 4
+2 3 40 zzxxx 3
+2 4 40 zxx 4
+2 3 40 xyyxx 3
+2 4 40 xzzzx 4
+2 3 40 yzxxx 3
+2 4 40 xxzy 4
+insert into t2 values
+(3), (4), (5);
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+explain extended select * from t2 left join t0 on t2.a=t0.a where t2.a in (3,4) and t0.b is null;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 4 100.00 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 100.00 Using where; Not exists; Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c` from `test`.`t2` left join `test`.`t0` on(`test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` is not null) where `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` is null
+select * from t2 left join t0 on t2.a=t0.a where t2.a in (3,4) and t0.b is null;
+a tp a b c
+explain extended select * from t2 left join t1 on t2.a=t1.a where t2.a in (3,4) and t1.b is null;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 4 100.00 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 5 100.00 Using where; Not exists; Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t1`.`tp` AS `tp`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t2` left join `test`.`t1` on(`test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` is not null) where `test`.`t2`.`a` in (3,4) and `test`.`t1`.`b` is null
+select * from t2 left join t1 on t2.a=t1.a where t2.a in (3,4) and t1.b is null;
+a tp a b c
+set join_cache_level=@save_join_cache_level;
+set optimizer_switch=@save_optimizer_switch;
+drop table t0,t1,t2;
diff --git a/mysql-test/main/partition_mrr_innodb.result b/mysql-test/main/partition_mrr_innodb.result
index c188f7e9929..ecef67817a3 100644
--- a/mysql-test/main/partition_mrr_innodb.result
+++ b/mysql-test/main/partition_mrr_innodb.result
@@ -39,6 +39,7 @@ A.a,
B.a,
123456
from t1 A, t1 B;
+set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='mrr=on';
explain
select * from t3 force index (key_col) where key_col < 3;
@@ -76,4 +77,160 @@ ID part_id key_col col2
27 7 2 123456
28 8 2 123456
29 9 2 123456
+set optimizer_switch=@save_optimizer_switch;
drop table t1,t3;
+#
+# MDEV-21544: partitioned table is joined with BKA+MRR
+#
+set @save_join_cache_level=@@join_cache_level;
+set @save_optimizer_switch=@@optimizer_switch;
+create table t0 (
+tp int, a int, b int not null, c varchar(12), index idx (a,b)
+);
+insert into t0 values
+(1,3,30,'yyzy'), (1,3,30,'yxxyy'), (1,3,30,'yyxy'), (1,3,30,'xxyy'),
+(1,3,30,'yyxz'), (1,3,30,'yyzz'), (1,3,30,'xxyzy'), (1,3,30,'yyyy'),
+(1,3,30,'yzzy'), (1,93,30,'zzzy'),
+(2,3,40,'yxx'), (2,4,40,'xx'), (2,3,10,'zxz'),
+(2,3,40,'yyx'), (2,4,40,'xxx'), (2,3,10,'zyyz'),
+(2,3,40,'xzzzz'), (2,4,40,'yyyxx'), (2,3,10,'zyz'),
+(2,3,40,'xxx'), (2,4,40,'xx'), (2,3,10,'zzz'),
+(2,3,40,'yyxzx'), (2,4,40,'xyx'), (2,3,10,'xzz'),
+(2,3,40,'xxxzz'), (2,4,40,'xxz'), (2,3,10,'zzzy'),
+(2,3,40,'zzxxx'), (2,4,40,'zxx'), (2,3,10,'yzzz'),
+(2,3,40,'xyyxx'), (2,4,40,'xzzzx'), (2,3,10,'zzxxz'),
+(2,3,40,'yzxxx'), (2,4,40,'xxzy'), (2,3,10,'zzzyx'),
+(2,93,40,'xzx'), (2,94,40,'xz'), (2,93,10,'zyyyz'),
+(3,4,30,'yx'), (3,4,30,'yyxxx'), (3,4,30,'zzyy'), (3,4,30,'zxyy'),
+(3,4,30,'xxyy'), (3,4,30,'yyzx'), (3,4,30,'zyyy'), (3,4,30,'yzy'),
+(3,4,30,'zzzyy'), (3,94,30,'yyz');
+create table t1 (
+tp int, a int, b int not null, c varchar(12), index idx (a,b)
+)
+partition by list (tp)
+( partition p1 values in (1),
+partition p2 values in (2),
+partition p3 values in (3));
+insert into t1 select * from t0;
+create table t2 (a int, index idx(a));
+insert into t2 values
+(1), (2), (3), (4), (5);
+insert into t2 select a+10 from t2;
+insert into t2 select a+20 from t2;
+analyze table t0,t1,t2;
+Table Op Msg_type Msg_text
+test.t0 analyze status OK
+test.t1 analyze status OK
+test.t2 analyze status OK
+set join_cache_level=6;
+set optimizer_switch='mrr=on';
+explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = `test`.`t2`.`a` - 1
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
+tp a b c a
+3 4 30 yx 4
+3 4 30 yyxxx 4
+3 4 30 zzyy 4
+3 4 30 zxyy 4
+3 4 30 xxyy 4
+3 4 30 yyzx 4
+3 4 30 zyyy 4
+3 4 30 yzy 4
+3 4 30 zzzyy 4
+explain extended select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = t2.a-1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 8 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t1`.`tp` AS `tp`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t1`.`b` / 10 = `test`.`t2`.`a` - 1
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = t2.a-1;
+tp a b c a
+3 4 30 yx 4
+3 4 30 yyxxx 4
+3 4 30 zzyy 4
+3 4 30 zxyy 4
+3 4 30 xxyy 4
+3 4 30 yyzx 4
+3 4 30 zyyy 4
+3 4 30 yzy 4
+3 4 30 zzzyy 4
+explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 100.00 Using index condition; Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = 4
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
+tp a b c a
+2 3 40 yxx 3
+2 4 40 xx 4
+2 3 40 yyx 3
+2 4 40 xxx 4
+2 3 40 xzzzz 3
+2 4 40 yyyxx 4
+2 3 40 xxx 3
+2 4 40 xx 4
+2 3 40 yyxzx 3
+2 4 40 xyx 4
+2 3 40 xxxzz 3
+2 4 40 xxz 4
+2 3 40 zzxxx 3
+2 4 40 zxx 4
+2 3 40 xyyxx 3
+2 4 40 xzzzx 4
+2 3 40 yzxxx 3
+2 4 40 xxzy 4
+explain extended select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 5 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t1`.`tp` AS `tp`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t1`.`b` / 10 = 4
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
+tp a b c a
+2 3 40 yxx 3
+2 4 40 xx 4
+2 3 40 yyx 3
+2 4 40 xxx 4
+2 3 40 xzzzz 3
+2 4 40 yyyxx 4
+2 3 40 xxx 3
+2 4 40 xx 4
+2 3 40 yyxzx 3
+2 4 40 xyx 4
+2 3 40 xxxzz 3
+2 4 40 xxz 4
+2 3 40 zzxxx 3
+2 4 40 zxx 4
+2 3 40 xyyxx 3
+2 4 40 xzzzx 4
+2 3 40 yzxxx 3
+2 4 40 xxzy 4
+insert into t2 values
+(3), (4), (5);
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+explain extended select * from t2 left join t0 on t2.a=t0.a where t2.a in (3,4) and t0.b is null;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 4 100.00 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 100.00 Using where; Not exists; Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c` from `test`.`t2` left join `test`.`t0` on(`test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` is not null) where `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` is null
+select * from t2 left join t0 on t2.a=t0.a where t2.a in (3,4) and t0.b is null;
+a tp a b c
+explain extended select * from t2 left join t1 on t2.a=t1.a where t2.a in (3,4) and t1.b is null;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 4 100.00 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 5 100.00 Using where; Not exists; Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t1`.`tp` AS `tp`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t2` left join `test`.`t1` on(`test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` is not null) where `test`.`t2`.`a` in (3,4) and `test`.`t1`.`b` is null
+select * from t2 left join t1 on t2.a=t1.a where t2.a in (3,4) and t1.b is null;
+a tp a b c
+set join_cache_level=@save_join_cache_level;
+set optimizer_switch=@save_optimizer_switch;
+drop table t0,t1,t2;
diff --git a/mysql-test/main/partition_mrr_myisam.result b/mysql-test/main/partition_mrr_myisam.result
index 1f1cea8e9d6..ff23982ff1a 100644
--- a/mysql-test/main/partition_mrr_myisam.result
+++ b/mysql-test/main/partition_mrr_myisam.result
@@ -39,6 +39,7 @@ A.a,
B.a,
123456
from t1 A, t1 B;
+set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='mrr=on';
explain
select * from t3 force index (key_col) where key_col < 3;
@@ -76,4 +77,216 @@ ID part_id key_col col2
27 7 2 123456
28 8 2 123456
29 9 2 123456
+set optimizer_switch=@save_optimizer_switch;
drop table t1,t3;
+#
+# MDEV-21544: partitioned table is joined with BKA+MRR
+#
+set @save_join_cache_level=@@join_cache_level;
+set @save_optimizer_switch=@@optimizer_switch;
+create table t0 (
+tp int, a int, b int not null, c varchar(12), index idx (a,b)
+);
+insert into t0 values
+(1,3,30,'yyzy'), (1,3,30,'yxxyy'), (1,3,30,'yyxy'), (1,3,30,'xxyy'),
+(1,3,30,'yyxz'), (1,3,30,'yyzz'), (1,3,30,'xxyzy'), (1,3,30,'yyyy'),
+(1,3,30,'yzzy'), (1,93,30,'zzzy'),
+(2,3,40,'yxx'), (2,4,40,'xx'), (2,3,10,'zxz'),
+(2,3,40,'yyx'), (2,4,40,'xxx'), (2,3,10,'zyyz'),
+(2,3,40,'xzzzz'), (2,4,40,'yyyxx'), (2,3,10,'zyz'),
+(2,3,40,'xxx'), (2,4,40,'xx'), (2,3,10,'zzz'),
+(2,3,40,'yyxzx'), (2,4,40,'xyx'), (2,3,10,'xzz'),
+(2,3,40,'xxxzz'), (2,4,40,'xxz'), (2,3,10,'zzzy'),
+(2,3,40,'zzxxx'), (2,4,40,'zxx'), (2,3,10,'yzzz'),
+(2,3,40,'xyyxx'), (2,4,40,'xzzzx'), (2,3,10,'zzxxz'),
+(2,3,40,'yzxxx'), (2,4,40,'xxzy'), (2,3,10,'zzzyx'),
+(2,93,40,'xzx'), (2,94,40,'xz'), (2,93,10,'zyyyz'),
+(3,4,30,'yx'), (3,4,30,'yyxxx'), (3,4,30,'zzyy'), (3,4,30,'zxyy'),
+(3,4,30,'xxyy'), (3,4,30,'yyzx'), (3,4,30,'zyyy'), (3,4,30,'yzy'),
+(3,4,30,'zzzyy'), (3,94,30,'yyz');
+create table t1 (
+tp int, a int, b int not null, c varchar(12), index idx (a,b)
+)
+partition by list (tp)
+( partition p1 values in (1),
+partition p2 values in (2),
+partition p3 values in (3));
+insert into t1 select * from t0;
+create table t2 (a int, index idx(a));
+insert into t2 values
+(1), (2), (3), (4), (5);
+insert into t2 select a+10 from t2;
+insert into t2 select a+20 from t2;
+analyze table t0,t1,t2;
+Table Op Msg_type Msg_text
+test.t0 analyze status OK
+test.t1 analyze status OK
+test.t2 analyze status OK
+set join_cache_level=6;
+set optimizer_switch='mrr=on';
+explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = `test`.`t2`.`a` - 1
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
+tp a b c a
+3 4 30 yx 4
+3 4 30 yyxxx 4
+3 4 30 zzyy 4
+3 4 30 zxyy 4
+3 4 30 xxyy 4
+3 4 30 yyzx 4
+3 4 30 zyyy 4
+3 4 30 yzy 4
+3 4 30 zzzyy 4
+explain extended select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = t2.a-1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 8 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t1`.`tp` AS `tp`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t1`.`b` / 10 = `test`.`t2`.`a` - 1
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = t2.a-1;
+tp a b c a
+3 4 30 yx 4
+3 4 30 yyxxx 4
+3 4 30 zzyy 4
+3 4 30 zxyy 4
+3 4 30 xxyy 4
+3 4 30 yyzx 4
+3 4 30 zyyy 4
+3 4 30 yzy 4
+3 4 30 zzzyy 4
+explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 100.00 Using index condition; Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = 4
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
+tp a b c a
+2 3 40 yxx 3
+2 4 40 xx 4
+2 3 40 yyx 3
+2 4 40 xxx 4
+2 3 40 xzzzz 3
+2 4 40 yyyxx 4
+2 3 40 xxx 3
+2 4 40 xx 4
+2 3 40 yyxzx 3
+2 4 40 xyx 4
+2 3 40 xxxzz 3
+2 4 40 xxz 4
+2 3 40 zzxxx 3
+2 4 40 zxx 4
+2 3 40 xyyxx 3
+2 4 40 xzzzx 4
+2 3 40 yzxxx 3
+2 4 40 xxzy 4
+explain extended select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 5 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t1`.`tp` AS `tp`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t1`.`b` / 10 = 4
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
+tp a b c a
+2 3 40 yxx 3
+2 4 40 xx 4
+2 3 40 yyx 3
+2 4 40 xxx 4
+2 3 40 xzzzz 3
+2 4 40 yyyxx 4
+2 3 40 xxx 3
+2 4 40 xx 4
+2 3 40 yyxzx 3
+2 4 40 xyx 4
+2 3 40 xxxzz 3
+2 4 40 xxz 4
+2 3 40 zzxxx 3
+2 4 40 zxx 4
+2 3 40 xyyxx 3
+2 4 40 xzzzx 4
+2 3 40 yzxxx 3
+2 4 40 xxzy 4
+insert into t2 values
+(3), (4), (5);
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+explain extended select * from t2 left join t0 on t2.a=t0.a where t2.a in (3,4) and t0.b is null;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 4 100.00 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 100.00 Using where; Not exists; Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c` from `test`.`t2` left join `test`.`t0` on(`test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` is not null) where `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` is null
+select * from t2 left join t0 on t2.a=t0.a where t2.a in (3,4) and t0.b is null;
+a tp a b c
+explain extended select * from t2 left join t1 on t2.a=t1.a where t2.a in (3,4) and t1.b is null;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 range idx idx 5 NULL 4 100.00 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 5 100.00 Using where; Not exists; Using join buffer (flat, BKA join); Rowid-ordered scan
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t1`.`tp` AS `tp`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t2` left join `test`.`t1` on(`test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` is not null) where `test`.`t2`.`a` in (3,4) and `test`.`t1`.`b` is null
+select * from t2 left join t1 on t2.a=t1.a where t2.a in (3,4) and t1.b is null;
+a tp a b c
+set join_cache_level=@save_join_cache_level;
+set optimizer_switch=@save_optimizer_switch;
+drop table t0,t1,t2;
+#
+# MDEV-21628: Index condition pushdown for a simple condition over
+# index fields is not used for ref access of partitioned tables when employing BKA
+#
+create table t0 (
+tp int, a int, b int, c varchar(12), index idx (a,b)
+);
+insert into t0 values
+(1,3,30,'yyzy'), (1,3,30,'yxxyy'), (1,3,30,'yyxy'), (1,3,30,'xxyy'),
+(1,3,30,'yyxz'), (1,3,30,'yyzz'), (1,3,30,'xxyzy'), (1,3,30,'yyyy'),
+(1,3,30,'yzzy'), (1,93,30,'zzzy'),
+(2,3,40,'yxx'), (2,4,40,'xx'), (2,3,10,'zxz'),
+(2,3,40,'yyx'), (2,4,40,'xxx'), (2,3,10,'zyyz'),
+(2,3,40,'xzzzz'), (2,4,40,'yyyxx'), (2,3,10,'zyz'),
+(2,3,40,'xxx'), (2,4,40,'xx'), (2,3,10,'zzz'),
+(2,3,40,'yyxzx'), (2,4,40,'xyx'), (2,3,10,'xzz'),
+(2,3,40,'xxxzz'), (2,4,40,'xxz'), (2,3,10,'zzzy'),
+(2,3,40,'zzxxx'), (2,4,40,'zxx'), (2,3,10,'yzzz'),
+(2,3,40,'xyyxx'), (2,4,40,'xzzzx'), (2,3,10,'zzxxz'),
+(2,3,40,'yzxxx'), (2,4,40,'xxzy'), (2,3,10,'zzzyx'),
+(2,93,40,'xzx'), (2,94,40,'xz'), (2,93,10,'zyyyz'),
+(3,4,30,'yx'), (3,4,30,'yyxxx'), (3,4,30,'zzyy'), (3,4,30,'zxyy'),
+(3,4,30,'xxyy'), (3,4,30,'yyzx'), (3,4,30,'zyyy'), (3,4,30,'yzy'),
+(3,4,30,'zzzyy'), (3,94,30,'yyz');
+create table t1 (
+tp int, a int, b int, c varchar(12), index idx (a,b)
+) engine=myisam
+partition by list (tp)
+( partition p1 values in (1),
+partition p2 values in (2),
+partition p3 values in (3));
+insert into t1 select * from t0;
+create table t2 (a int, index idx(a)) engine=myisam;
+insert into t2 values (1), (2), (3), (4), (5);
+insert into t2 select a+10 from t2;
+insert into t2 select a+20 from t2;
+analyze table t0,t1,t2;
+Table Op Msg_type Msg_text
+test.t0 analyze status OK
+test.t1 analyze status OK
+test.t2 analyze status OK
+set @tmp1=@@join_cache_level, @tmp2=@@optimizer_switch;
+set join_cache_level=6, optimizer_switch='mrr=on';
+explain
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 Using where; Using index
+1 SIMPLE t0 ref idx idx 5 test.t2.a 13 Using index condition; Using join buffer (flat, BKA join); Rowid-ordered scan
+# This will use "Using index condition(BKA)"
+explain
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range idx idx 5 NULL 2 Using where; Using index
+1 SIMPLE t1 ref idx idx 5 test.t2.a 8 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+set join_cache_level=@tmp1, optimizer_switch=@tmp2;
+drop table t0,t1,t2;
diff --git a/mysql-test/main/partition_mrr_myisam.test b/mysql-test/main/partition_mrr_myisam.test
index d67a37ab3d2..eb30319d81f 100644
--- a/mysql-test/main/partition_mrr_myisam.test
+++ b/mysql-test/main/partition_mrr_myisam.test
@@ -1,3 +1,62 @@
let $engine_type= myisam;
--source include/partition_mrr.inc
+
+--echo #
+--echo # MDEV-21628: Index condition pushdown for a simple condition over
+--echo # index fields is not used for ref access of partitioned tables when employing BKA
+--echo #
+
+create table t0 (
+tp int, a int, b int, c varchar(12), index idx (a,b)
+);
+
+insert into t0 values
+(1,3,30,'yyzy'), (1,3,30,'yxxyy'), (1,3,30,'yyxy'), (1,3,30,'xxyy'),
+(1,3,30,'yyxz'), (1,3,30,'yyzz'), (1,3,30,'xxyzy'), (1,3,30,'yyyy'),
+(1,3,30,'yzzy'), (1,93,30,'zzzy'),
+(2,3,40,'yxx'), (2,4,40,'xx'), (2,3,10,'zxz'),
+(2,3,40,'yyx'), (2,4,40,'xxx'), (2,3,10,'zyyz'),
+(2,3,40,'xzzzz'), (2,4,40,'yyyxx'), (2,3,10,'zyz'),
+(2,3,40,'xxx'), (2,4,40,'xx'), (2,3,10,'zzz'),
+(2,3,40,'yyxzx'), (2,4,40,'xyx'), (2,3,10,'xzz'),
+(2,3,40,'xxxzz'), (2,4,40,'xxz'), (2,3,10,'zzzy'),
+(2,3,40,'zzxxx'), (2,4,40,'zxx'), (2,3,10,'yzzz'),
+(2,3,40,'xyyxx'), (2,4,40,'xzzzx'), (2,3,10,'zzxxz'),
+(2,3,40,'yzxxx'), (2,4,40,'xxzy'), (2,3,10,'zzzyx'),
+(2,93,40,'xzx'), (2,94,40,'xz'), (2,93,10,'zyyyz'),
+(3,4,30,'yx'), (3,4,30,'yyxxx'), (3,4,30,'zzyy'), (3,4,30,'zxyy'),
+(3,4,30,'xxyy'), (3,4,30,'yyzx'), (3,4,30,'zyyy'), (3,4,30,'yzy'),
+(3,4,30,'zzzyy'), (3,94,30,'yyz');
+
+create table t1 (
+tp int, a int, b int, c varchar(12), index idx (a,b)
+) engine=myisam
+partition by list (tp)
+( partition p1 values in (1),
+ partition p2 values in (2),
+ partition p3 values in (3));
+insert into t1 select * from t0;
+
+create table t2 (a int, index idx(a)) engine=myisam;
+insert into t2 values (1), (2), (3), (4), (5);
+insert into t2 select a+10 from t2;
+insert into t2 select a+20 from t2;
+
+analyze table t0,t1,t2;
+
+set @tmp1=@@join_cache_level, @tmp2=@@optimizer_switch;
+set join_cache_level=6, optimizer_switch='mrr=on';
+
+explain
+select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
+
+--echo # This will use "Using index condition(BKA)"
+explain
+select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
+
+set join_cache_level=@tmp1, optimizer_switch=@tmp2;
+
+drop table t0,t1,t2;
+
+
diff --git a/mysql-test/main/partition_range.result b/mysql-test/main/partition_range.result
index 00171e3e0bd..2c72d9f1865 100644
--- a/mysql-test/main/partition_range.result
+++ b/mysql-test/main/partition_range.result
@@ -1009,3 +1009,47 @@ select * from t1 partition (p1);
d
2000-01-01 00:00:01.000000
DROP TABLE t1, t2;
+#
+# MDEV-21195 INSERT chooses wrong partition for RANGE partitioning by DECIMAL column
+#
+create or replace table t (
+d decimal(2,1)) partition by range (d)
+(partition p1 values less than (10));
+insert into t values (9.9);
+create or replace table t (
+d decimal(2,1)) partition by range (d)
+(partition p1 values less than (10),
+partition p2 values less than (20));
+insert into t values (9.9);
+select * from t partition (p1);
+d
+9.9
+select * from t partition (p2);
+d
+create or replace table t (
+d decimal(2,1)) partition by range (d)
+(partition p1 values less than (-3));
+insert into t values (-3.3);
+create or replace table t (
+d decimal(2,1)) partition by range (d+1)
+(partition p1 values less than (10),
+partition p2 values less than (20));
+insert into t values (8.9);
+select * from t partition (p1);
+d
+8.9
+select * from t partition (p2);
+d
+set time_zone='+00:00';
+create or replace table t (
+d timestamp(1)) partition by range (unix_timestamp(d))
+(partition p1 values less than (1577836800),
+partition p2 values less than (2000000000));
+insert into t values (from_unixtime(1577836799.9));
+select * from t partition (p1);
+d
+2019-12-31 23:59:59.9
+select * from t partition (p2);
+d
+set time_zone=default;
+drop table t;
diff --git a/mysql-test/main/partition_range.test b/mysql-test/main/partition_range.test
index 628602ffa25..abba4c5f374 100644
--- a/mysql-test/main/partition_range.test
+++ b/mysql-test/main/partition_range.test
@@ -999,3 +999,49 @@ select * from t1 partition (p0);
select * from t1 partition (p1);
DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-21195 INSERT chooses wrong partition for RANGE partitioning by DECIMAL column
+--echo #
+create or replace table t (
+ d decimal(2,1)) partition by range (d)
+ (partition p1 values less than (10));
+
+insert into t values (9.9);
+
+create or replace table t (
+ d decimal(2,1)) partition by range (d)
+ (partition p1 values less than (10),
+ partition p2 values less than (20));
+
+insert into t values (9.9);
+select * from t partition (p1);
+select * from t partition (p2);
+
+create or replace table t (
+ d decimal(2,1)) partition by range (d)
+ (partition p1 values less than (-3));
+
+insert into t values (-3.3);
+
+create or replace table t (
+ d decimal(2,1)) partition by range (d+1)
+ (partition p1 values less than (10),
+ partition p2 values less than (20));
+
+insert into t values (8.9);
+select * from t partition (p1);
+select * from t partition (p2);
+
+set time_zone='+00:00';
+create or replace table t (
+ d timestamp(1)) partition by range (unix_timestamp(d))
+ (partition p1 values less than (1577836800),
+ partition p2 values less than (2000000000));
+
+insert into t values (from_unixtime(1577836799.9));
+select * from t partition (p1);
+select * from t partition (p2);
+
+set time_zone=default;
+drop table t;
diff --git a/mysql-test/main/plugin_auth.result b/mysql-test/main/plugin_auth.result
index eeb65187fea..66495da65e7 100644
--- a/mysql-test/main/plugin_auth.result
+++ b/mysql-test/main/plugin_auth.result
@@ -185,18 +185,18 @@ in default connection
disconnect proxy_admin_con;
SHOW GRANTS FOR grant_plug;
Grants for grant_plug@%
-GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
+GRANT ALL PRIVILEGES ON *.* TO `grant_plug`@`%` IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
GRANT PROXY ON 'future_user'@'%' TO 'grant_plug'@'%'
REVOKE PROXY ON future_user FROM grant_plug;
SHOW GRANTS FOR grant_plug;
Grants for grant_plug@%
-GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
+GRANT ALL PRIVILEGES ON *.* TO `grant_plug`@`%` IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
## testing drop user
CREATE USER test_drop@localhost;
GRANT PROXY ON future_user TO test_drop@localhost;
SHOW GRANTS FOR test_drop@localhost;
Grants for test_drop@localhost
-GRANT USAGE ON *.* TO 'test_drop'@'localhost'
+GRANT USAGE ON *.* TO `test_drop`@`localhost`
GRANT PROXY ON 'future_user'@'%' TO 'test_drop'@'localhost'
DROP USER test_drop@localhost;
SELECT * FROM mysql.proxies_priv WHERE Host = 'test_drop' AND User = 'localhost';
diff --git a/mysql-test/main/ps_grant.result b/mysql-test/main/ps_grant.result
index 0e296cdc699..ab21c198b98 100644
--- a/mysql-test/main/ps_grant.result
+++ b/mysql-test/main/ps_grant.result
@@ -11,8 +11,8 @@ grant select on mysqltest.t9 to second_user@localhost
identified by 'looser' ;
show grants for second_user@localhost ;
Grants for second_user@localhost
-GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
+GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
+GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
connect con3,localhost,second_user,looser,mysqltest;
connection con3;
select current_user();
@@ -20,8 +20,8 @@ current_user()
second_user@localhost
show grants for current_user();
Grants for second_user@localhost
-GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
+GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
+GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
prepare s_t9 from 'select c1 as my_col
from t9 where c1= 1' ;
execute s_t9 ;
@@ -34,21 +34,21 @@ grant select on mysqltest.t1 to second_user@localhost
identified by 'looser' ;
show grants for second_user@localhost ;
Grants for second_user@localhost
-GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
-GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
+GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
+GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
+GRANT SELECT ON `mysqltest`.`t1` TO `second_user`@`localhost`
drop table mysqltest.t9 ;
show grants for second_user@localhost ;
Grants for second_user@localhost
-GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
-GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
+GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
+GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
+GRANT SELECT ON `mysqltest`.`t1` TO `second_user`@`localhost`
connection con3;
show grants for second_user@localhost ;
Grants for second_user@localhost
-GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
-GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
+GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
+GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
+GRANT SELECT ON `mysqltest`.`t1` TO `second_user`@`localhost`
prepare s_t1 from 'select a as my_col from t1' ;
execute s_t1 ;
my_col
@@ -63,13 +63,13 @@ connection default;
revoke all privileges on mysqltest.t1 from second_user@localhost;
show grants for second_user@localhost ;
Grants for second_user@localhost
-GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
+GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
+GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
connection con3;
show grants for second_user@localhost ;
Grants for second_user@localhost
-GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
+GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
+GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost`
execute s_t1 ;
ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1'
connection default;
@@ -77,7 +77,7 @@ disconnect con3;
revoke all privileges, grant option from second_user@localhost ;
show grants for second_user@localhost ;
Grants for second_user@localhost
-GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
+GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
drop user second_user@localhost ;
commit ;
show grants for second_user@localhost ;
diff --git a/mysql-test/main/range_innodb.result b/mysql-test/main/range_innodb.result
index 6572b248911..38a8964bb61 100644
--- a/mysql-test/main/range_innodb.result
+++ b/mysql-test/main/range_innodb.result
@@ -70,6 +70,7 @@ key(a),key(b),key(c)
insert into t1
select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
from t0 A, t0 B, t0 C, t0 D where D.a<5;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set @@global.debug_dbug="+d,ha_index_init_fail";
explain select * from t1 where a=10 and b=10;
id select_type table type possible_keys key key_len ref rows Extra
@@ -77,5 +78,5 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from t1 where a=10 and b=10;
ERROR HY000: Table definition has changed, please retry transaction
DROP TABLE t0,t1;
-set @@global.debug_dbug="-d";
+SET @@GLOBAL.debug_dbug = @saved_dbug;
set @@optimizer_switch= @optimizer_switch_save;
diff --git a/mysql-test/main/range_innodb.test b/mysql-test/main/range_innodb.test
index a17ef3f1146..928ed74f784 100644
--- a/mysql-test/main/range_innodb.test
+++ b/mysql-test/main/range_innodb.test
@@ -80,10 +80,11 @@ create table t1 (
insert into t1
select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
from t0 A, t0 B, t0 C, t0 D where D.a<5;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set @@global.debug_dbug="+d,ha_index_init_fail";
explain select * from t1 where a=10 and b=10;
--error ER_TABLE_DEF_CHANGED
select * from t1 where a=10 and b=10;
DROP TABLE t0,t1;
-set @@global.debug_dbug="-d";
+SET @@GLOBAL.debug_dbug = @saved_dbug;
set @@optimizer_switch= @optimizer_switch_save;
diff --git a/mysql-test/main/range_interrupted-13751.result b/mysql-test/main/range_interrupted-13751.result
index f4f995721ad..68610cdda8e 100644
--- a/mysql-test/main/range_interrupted-13751.result
+++ b/mysql-test/main/range_interrupted-13751.result
@@ -7,10 +7,10 @@ INSERT INTO t1 (c) SELECT c FROM t1;
INSERT INTO t1 (c) SELECT c FROM t1;
INSERT INTO t1 (c) SELECT c FROM t1;
set @old_dbug=@@session.debug_dbug;
-set debug_dbug="+d,kill_join_init_read_record";
+SET debug_dbug="+d,kill_join_init_read_record";
SELECT 1 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.c = alias2.c OR alias1.i <= 1
;
ERROR 70100: Query execution was interrupted
-set debug_dbug=@old_dbug;
+SET debug_dbug=@old_dbug;
DROP TABLE t1;
diff --git a/mysql-test/main/range_interrupted-13751.test b/mysql-test/main/range_interrupted-13751.test
index 8b2c1834ee5..b0793edeb9d 100644
--- a/mysql-test/main/range_interrupted-13751.test
+++ b/mysql-test/main/range_interrupted-13751.test
@@ -14,14 +14,14 @@ INSERT INTO t1 (c) SELECT c FROM t1;
INSERT INTO t1 (c) SELECT c FROM t1;
set @old_dbug=@@session.debug_dbug;
-set debug_dbug="+d,kill_join_init_read_record";
+SET debug_dbug="+d,kill_join_init_read_record";
--error ER_QUERY_INTERRUPTED
SELECT 1 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.c = alias2.c OR alias1.i <= 1
;
-set debug_dbug=@old_dbug;
+SET debug_dbug=@old_dbug;
DROP TABLE t1;
diff --git a/mysql-test/main/select_debug.result b/mysql-test/main/select_debug.result
index 55882ad337a..dfe49aed215 100644
--- a/mysql-test/main/select_debug.result
+++ b/mysql-test/main/select_debug.result
@@ -6,6 +6,7 @@ insert into t1 values (2,2), (1,1);
create table t2 (a int);
insert into t2 values (2), (3);
set session join_cache_level=3;
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug= 'd,opt';
explain select t1.b from t1,t2 where t1.b=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
@@ -16,3 +17,4 @@ b
2
set session join_cache_level=default;
drop table t1,t2;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/select_debug.test b/mysql-test/main/select_debug.test
index 49415400db3..922cec7ed7a 100644
--- a/mysql-test/main/select_debug.test
+++ b/mysql-test/main/select_debug.test
@@ -10,6 +10,7 @@ create table t2 (a int);
insert into t2 values (2), (3);
set session join_cache_level=3;
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug= 'd,opt';
explain select t1.b from t1,t2 where t1.b=t2.a;
@@ -17,3 +18,4 @@ select t1.b from t1,t2 where t1.b=t2.a;
set session join_cache_level=default;
drop table t1,t2;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/set_password.result b/mysql-test/main/set_password.result
index 733d9c96187..11432a40d28 100644
--- a/mysql-test/main/set_password.result
+++ b/mysql-test/main/set_password.result
@@ -168,7 +168,7 @@ user() current_user()
foo@localhost foo@localhost
show grants;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
+GRANT USAGE ON *.* TO `foo`@`localhost` IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
disconnect foo;
connection default;
select user,host,password,plugin,authentication_string from mysql.user where user='foo';
diff --git a/mysql-test/main/show_create_user.result b/mysql-test/main/show_create_user.result
index 63013eca074..63acc38295a 100644
--- a/mysql-test/main/show_create_user.result
+++ b/mysql-test/main/show_create_user.result
@@ -1,27 +1,27 @@
create user foo;
show create user foo;
CREATE USER for foo@%
-CREATE USER 'foo'@'%'
+CREATE USER `foo`@`%`
create user foo@test;
show create user foo@test;
CREATE USER for foo@test
-CREATE USER 'foo'@'test'
+CREATE USER `foo`@`test`
create user foo2@test identified by 'password';
show create user foo2@test;
CREATE USER for foo2@test
-CREATE USER 'foo2'@'test' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19'
+CREATE USER `foo2`@`test` IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19'
alter user foo2@test identified with 'someplugin' as 'somepassword';
show create user foo2@test;
CREATE USER for foo2@test
-CREATE USER 'foo2'@'test' IDENTIFIED VIA someplugin USING 'somepassword'
+CREATE USER `foo2`@`test` IDENTIFIED VIA someplugin USING 'somepassword'
create user foo3@test require SSL;
show create user foo3@test;
CREATE USER for foo3@test
-CREATE USER 'foo3'@'test' REQUIRE SSL
+CREATE USER `foo3`@`test` REQUIRE SSL
create user foo4@test require cipher 'text' issuer 'foo_issuer' subject 'foo_subject';
show create user foo4@test;
CREATE USER for foo4@test
-CREATE USER 'foo4'@'test' REQUIRE ISSUER 'foo_issuer' SUBJECT 'foo_subject' CIPHER 'text'
+CREATE USER `foo4`@`test` REQUIRE ISSUER 'foo_issuer' SUBJECT 'foo_subject' CIPHER 'text'
create user foo5@test require SSL
with MAX_QUERIES_PER_HOUR 10
MAX_UPDATES_PER_HOUR 20
@@ -30,7 +30,7 @@ MAX_USER_CONNECTIONS 40
MAX_STATEMENT_TIME 0.5;
show create user foo5@test;
CREATE USER for foo5@test
-CREATE USER 'foo5'@'test' REQUIRE SSL WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 MAX_USER_CONNECTIONS 40 MAX_STATEMENT_TIME 0.500000
+CREATE USER `foo5`@`test` REQUIRE SSL WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 MAX_USER_CONNECTIONS 40 MAX_STATEMENT_TIME 0.500000
drop user foo5@test;
drop user foo4@test;
drop user foo3@test;
diff --git a/mysql-test/main/show_explain.result b/mysql-test/main/show_explain.result
index 0819ae5ba37..e280ae7040e 100644
--- a/mysql-test/main/show_explain.result
+++ b/mysql-test/main/show_explain.result
@@ -23,7 +23,7 @@ show explain for $thr1;
ERROR HY000: Target is not running an EXPLAINable command
connection con1;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select count(*) from t1 where a < 100000;
connection default;
show explain for $thr2;
@@ -58,10 +58,10 @@ connection con1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan
set optimizer_switch= @show_expl_tmp;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# UNION, first branch
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a from t0 A union select a+1 from t0 B;
connection default;
show explain for $thr2;
@@ -76,10 +76,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
2 UNION B ALL NULL NULL NULL NULL 10
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# UNION, second branch
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a from t0 A union select a+1 from t0 B;
connection default;
show explain for $thr2;
@@ -94,10 +94,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
2 UNION B ALL NULL NULL NULL NULL 10
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# Uncorrelated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
show explain for $thr2;
@@ -109,10 +109,10 @@ Note 1003 select a, (select max(a) from t0 B) from t0 A where a<1
connection con1;
a (select max(a) from t0 B)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# Uncorrelated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
show explain for $thr2;
@@ -125,10 +125,10 @@ connection con1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10 Using where
2 SUBQUERY B ALL NULL NULL NULL NULL 10
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -140,10 +140,10 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -155,10 +155,10 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, select, while inside the subquery
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -170,10 +170,10 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -185,10 +185,10 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -200,12 +200,12 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# Try to do SHOW EXPLAIN for a query that runs a SET command:
# I've found experimentally that select_id==2 here...
#
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @foo= (select max(a) from t0 where sin(a) >0);
connection default;
show explain for $thr2;
@@ -213,13 +213,13 @@ ERROR HY000: Target is not running an EXPLAINable command
kill query $thr2;
connection con1;
ERROR 70100: Query execution was interrupted
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Attempt SHOW EXPLAIN for an UPDATE
#
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
show explain for $thr2;
@@ -236,13 +236,13 @@ Warnings:
Note 1003 update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3
connection con1;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Attempt SHOW EXPLAIN for a DELETE (UPD: now works)
#
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
show explain for $thr2;
@@ -259,13 +259,13 @@ Warnings:
Note 1003 delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3
connection con1;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Multiple SHOW EXPLAIN calls for one select
#
create table t2 as select a as a, a as dummy from t0 limit 3;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2;
connection default;
show explain for $thr2;
@@ -292,14 +292,14 @@ a SUBQ
1 0
2 0
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... ORDER BY with "Using filesort"
#
explain select * from t0 order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using filesort
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select * from t0 order by a;
connection default;
@@ -320,7 +320,7 @@ a
7
8
9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... with "Using temporary"
#
@@ -329,7 +329,7 @@ explain select distinct a from t0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
connection con1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select distinct a from t0;
connection default;
@@ -350,7 +350,7 @@ a
7
8
9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... with "Using temporary; Using filesort"
#
@@ -359,7 +359,7 @@ explain select distinct a from t0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
connection con1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select distinct a from t0;
connection default;
@@ -380,7 +380,7 @@ a
7
8
9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# MDEV-238: SHOW EXPLAIN: Server crashes in JOIN::print_explain with FROM subquery and GROUP BY
#
@@ -390,7 +390,7 @@ explain SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-set debug_dbug='+d,show_explain_in_find_all_keys';
+SET debug_dbug='+d,show_explain_in_find_all_keys';
SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
connection default;
# FIXED by "conservative assumptions about when QEP is available" fix:
@@ -406,7 +406,7 @@ a
1
2
4
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
#
# MDEV-239: Assertion `field_types == 0 ... ' failed in Protocol_text::store(double, uint32, String*) with
@@ -421,7 +421,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a`
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
connection default;
show explain for $thr2;
@@ -436,7 +436,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a`
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
#
# MDEV-240: SHOW EXPLAIN: Assertion `this->optimized == 2' failed in
@@ -453,7 +453,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 6
2 DERIVED t3 system NULL NULL NULL NULL 1
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
SELECT * FROM v1, t2;
connection default;
show explain for $thr2;
@@ -461,14 +461,14 @@ ERROR HY000: Target is not running an EXPLAINable command
kill query $thr2;
connection con1;
ERROR 70100: Query execution was interrupted
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t2, t3;
#
# MDEV-267: SHOW EXPLAIN: Server crashes in JOIN::print_explain on most of queries
#
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
select sleep(1);
connection default;
show explain for $thr2;
@@ -479,12 +479,12 @@ Note 1003 select sleep(1)
connection con1;
sleep(1)
0
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Same as above, but try another reason for JOIN to be degenerate
#
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
select * from t0 where 1>10;
connection default;
show explain for $thr2;
@@ -494,14 +494,14 @@ Warnings:
Note 1003 select * from t0 where 1>10
connection con1;
a
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Same as above, but try another reason for JOIN to be degenerate (2)
#
create table t3(a int primary key);
insert into t3 select a from t0;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
select * from t0,t3 where t3.a=112233;
connection default;
show explain for $thr2;
@@ -511,7 +511,7 @@ Warnings:
Note 1003 select * from t0,t3 where t3.a=112233
connection con1;
a a
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t3;
#
# MDEV-270: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with
@@ -530,7 +530,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
SELECT * FROM t2 WHERE a =
(SELECT MAX(a) FROM t2
WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3)
@@ -552,7 +552,7 @@ pk a
6 7
7 7
9 7
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t2;
#
# MDEV-273: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with impossible WHERE
@@ -584,7 +584,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 87 Using join buffer (flat, BNL join)
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
SELECT count(*) FROM t2, t3
WHERE a1 < ALL (
SELECT a1 FROM t2
@@ -605,7 +605,7 @@ WHERE a1 IN ( SELECT a1 FROM t2, t4 )
connection con1;
count(*)
1740
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t2, t3, t4;
#
# MDEV-275: SHOW EXPLAIN: server crashes in JOIN::print_explain with IN subquery and aggregate function
@@ -615,7 +615,7 @@ INSERT INTO t2 VALUES
(1,5),(2,4),(3,6),(4,9),(5,2),(6,8),(7,4),(8,8),(9,0),(10,43),
(11,23),(12,3),(13,45),(14,16),(15,2),(16,33),(17,2),(18,5),(19,9),(20,2);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`);
connection default;
show explain for $thr2;
@@ -627,7 +627,7 @@ Warnings:
Note 1003 SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`)
connection con1;
pk a1
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
DROP TABLE t1;
#
@@ -636,7 +636,7 @@ DROP TABLE t1;
CREATE TABLE t1(a INT, KEY(a));
INSERT INTO t1 VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT 'test' FROM t1 WHERE a=1;
connection default;
show explain for $thr2;
@@ -648,7 +648,7 @@ connection con1;
test
test
test
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
#
# MDEV-299: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN changes back and forth during query execution
@@ -666,7 +666,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE A ALL NULL NULL NULL NULL 100 Using where
1 SIMPLE B ALL key1 NULL NULL NULL 100 Range checked for each record (index map: 0x1)
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_test_if_quick_select';
+SET debug_dbug='+d,show_explain_probe_test_if_quick_select';
select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
connection default;
show explain for $thr2;
@@ -696,7 +696,7 @@ Note 1003 select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND
connection con1;
count(*)
212
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
#
# MDEV-297: SHOW EXPLAIN: Server gets stuck until timeout occurs while
@@ -705,7 +705,7 @@ drop table t1;
CREATE TABLE t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c));
INSERT INTO t1 (a) VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SHOW INDEX FROM t1;
connection default;
show explain for $thr2;
@@ -718,7 +718,7 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t1 1 a 1 a A NULL NULL NULL YES BTREE
t1 1 b 1 b A NULL NULL NULL YES BTREE
t1 1 c 1 c A NULL NULL NULL YES BTREE
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
#
# MDEV-324: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN for a query with TEMPTABLE view
@@ -731,7 +731,7 @@ EXPLAIN SELECT a + 1 FROM v1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED t1 ALL NULL NULL NULL NULL 2
-set debug_dbug='+d,show_explain_probe_join_tab_preread';
+SET debug_dbug='+d,show_explain_probe_join_tab_preread';
set @show_explain_probe_select_id=1;
SELECT a + 1 FROM v1;
connection default;
@@ -745,7 +745,7 @@ connection con1;
a + 1
2
3
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t1;
#
@@ -761,7 +761,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
-set debug_dbug='+d,show_explain_probe_union_read';
+SET debug_dbug='+d,show_explain_probe_union_read';
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
connection default;
show explain for $thr2;
@@ -782,7 +782,7 @@ Warnings:
Note 1003 SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 )
connection con1;
a
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
#
# MDEV-327: SHOW EXPLAIN: Different select_type in plans produced by SHOW EXPLAIN
@@ -805,7 +805,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 SUBQUERY t1 ALL NULL NULL NULL NULL 20
3 SUBQUERY t2 ALL NULL NULL NULL NULL 20 Using where
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
connection default;
@@ -820,7 +820,7 @@ Note 1003 SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b )
connection con1;
a b
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1, t2;
#
# Test that SHOW EXPLAIN will print 'Distinct'.
@@ -842,7 +842,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary
1 SIMPLE t3 ref a a 5 test.t1.a 7 Using index; Distinct
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select distinct t1.a from t1,t3 where t1.a=t3.a;
connection default;
show explain for $thr2;
@@ -855,7 +855,7 @@ connection con1;
a
1
2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1,t3,t4;
#
# ---------- SHOW EXPLAIN and permissions -----------------
@@ -869,7 +869,7 @@ connection con1;
# First, make sure that user 'test2' cannot do SHOW EXPLAIN on us
#
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
connection default;
connection con2;
@@ -886,14 +886,14 @@ a
0
1
2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Check that user test2 can do SHOW EXPLAIN on its own queries
#
connect con3, localhost, test2,,;
connection con2;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
connection con1;
connection con3;
@@ -916,9 +916,9 @@ disconnect con2;
grant process on *.* to test2@localhost;
connect con2, localhost, test2,,;
connection con1;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
connection default;
connection con2;
@@ -932,7 +932,7 @@ a
0
1
2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
revoke all privileges on test.* from test2@localhost;
drop user test2@localhost;
disconnect con2;
@@ -1009,7 +1009,7 @@ ORDER BY b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
@@ -1030,9 +1030,9 @@ a+SLEEP(0.01)
0
0
0
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
@@ -1053,7 +1053,7 @@ a+SLEEP(0.01)
0
0
0
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
#
# MDEV-298: SHOW EXPLAIN: Plan returned by SHOW EXPLAIN only contains
@@ -1067,7 +1067,7 @@ EXPLAIN SELECT a FROM t1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4112 Using temporary; Using filesort
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT a FROM t1 GROUP BY a;
connection default;
show explain for $thr2;
@@ -1093,7 +1093,7 @@ a
14
15
16
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
#
# MDEV-408: SHOW EXPLAIN: Some values are chopped off in SHOW EXPLAIN output
@@ -1107,7 +1107,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 index_subquery PRIMARY,c c 5 func 1 Using index; Using where
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
connection default;
show explain for $thr2;
@@ -1119,7 +1119,7 @@ Note 1003 SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE
connection con1;
SUM(a + SLEEP(0.1))
7862
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1, t2;
#
# MDEV-412: SHOW EXPLAIN: Server crashes in JOIN::print_explain on a query with inner join and ORDER BY the same column twice
@@ -1157,7 +1157,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range b b 6 NULL 107 Using where; Using index
1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
connection default;
show explain for $thr2;
@@ -1169,7 +1169,7 @@ Warnings:
Note 1003 SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2
connection con1;
field1 field2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
#
# MDEV-423: SHOW EXPLAIN: 'Using where' for a subquery is shown in EXPLAIN, but not in SHOW EXPLAIN output
@@ -1190,7 +1190,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 20
3 SUBQUERY t3 ALL NULL NULL NULL NULL 20 Using where
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10;
connection default;
@@ -1205,7 +1205,7 @@ WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10
connection con1;
max(a+b+c)
279
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
#
# MDEV-416: Server crashes in SQL_SELECT::cleanup on EXPLAIN with SUM ( DISTINCT ) in a non-correlated subquery (5.5-show-explain tree)
@@ -1231,7 +1231,7 @@ select hex('ãû');
hex('ãû')
E3FB
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where length('ãû') = a;
connection default;
set names utf8;
@@ -1244,7 +1244,7 @@ set names default;
connection con1;
a
2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set names default;
#
# MDEV-462: SHOW EXPLAIN: Assertion `table_list->table' fails in find_field_in_table_ref if FOR contains a non-numeric value
@@ -1270,7 +1270,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 DEPENDENT SUBQUERY t1 ALL a NULL NULL NULL 2 Range checked for each record (index map: 0x1)
4 SUBQUERY t2 ALL NULL NULL NULL NULL 2
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT SUM(b) FROM ( SELECT * FROM t1 ) AS alias1, t2
WHERE b <= ANY (
SELECT a FROM t1
@@ -1290,7 +1290,7 @@ WHERE a = b + SLEEP(0.2) OR a >= ( SELECT SUM(b) FROM t2 ))
connection con1;
SUM(b)
0
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2;
drop table t0;
#
@@ -1302,7 +1302,7 @@ create table t1 (a int, b int);
insert into t1 select a,a from t0;
create table t2 as select * from t1;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_best_ext_lim_search';
+SET debug_dbug='+d,show_explain_probe_best_ext_lim_search';
explain
select * from t0
where not exists ( select 1 from t1, t2 where t1.b=t2.b and t2.a=t0.a) and a is null;
diff --git a/mysql-test/main/show_explain.test b/mysql-test/main/show_explain.test
index 6615ff66737..2a87d24cf6d 100644
--- a/mysql-test/main/show_explain.test
+++ b/mysql-test/main/show_explain.test
@@ -15,7 +15,7 @@ SET @old_debug= @@session.debug;
# is that we use the following commands for synchronization:
#
# set @show_explain_probe_select_id=1;
-# set debug_dbug='d,show_explain_probe_join_exec_start';
+# SET debug_dbug='d,show_explain_probe_join_exec_start';
# send select count(*) from t1 where a < 100000;
#
# When ran with mysqltest_embedded, this translates into:
@@ -75,7 +75,7 @@ let $wait_condition= select State='show_explain_trap' from information_schema.pr
#
connection con1;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select count(*) from t1 where a < 100000;
connection default;
@@ -103,109 +103,109 @@ evalp show explain for $thr2;
connection con1;
reap;
set optimizer_switch= @show_expl_tmp;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # UNION, first branch
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a from t0 A union select a+1 from t0 B;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # UNION, second branch
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a from t0 A union select a+1 from t0 B;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # Uncorrelated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # Uncorrelated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, select, while inside the subquery
set @show_explain_probe_select_id=2; # <---
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# TODO: explain in the parent subuqery when the un-correlated child has been
# run (and have done irreversible cleanups)
@@ -218,7 +218,7 @@ set debug_dbug=@old_debug;
--echo # I've found experimentally that select_id==2 here...
--echo #
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send set @foo= (select max(a) from t0 where sin(a) >0);
connection default;
--source include/wait_condition.inc
@@ -228,14 +228,14 @@ evalp kill query $thr2;
connection con1;
--error ER_QUERY_INTERRUPTED
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Attempt SHOW EXPLAIN for an UPDATE
--echo #
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
@@ -247,14 +247,14 @@ evalp show explain for $thr2;
connection con1;
reap;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Attempt SHOW EXPLAIN for a DELETE (UPD: now works)
--echo #
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
@@ -266,14 +266,14 @@ evalp show explain for $thr2;
connection con1;
reap;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Multiple SHOW EXPLAIN calls for one select
--echo #
create table t2 as select a as a, a as dummy from t0 limit 3;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2;
connection default;
--source include/wait_condition.inc
@@ -285,14 +285,14 @@ evalp show explain for $thr2;
connection con1;
reap;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # SHOW EXPLAIN for SELECT ... ORDER BY with "Using filesort"
--echo #
explain select * from t0 order by a;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
send select * from t0 order by a;
connection default;
@@ -300,7 +300,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # SHOW EXPLAIN for SELECT ... with "Using temporary"
@@ -309,7 +309,7 @@ connection default;
explain select distinct a from t0;
connection con1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
send select distinct a from t0;
connection default;
@@ -317,7 +317,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # SHOW EXPLAIN for SELECT ... with "Using temporary; Using filesort"
@@ -326,7 +326,7 @@ connection default;
explain select distinct a from t0;
connection con1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
send select distinct a from t0;
connection default;
@@ -334,7 +334,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # MDEV-238: SHOW EXPLAIN: Server crashes in JOIN::print_explain with FROM subquery and GROUP BY
@@ -343,7 +343,7 @@ CREATE TABLE t2 ( a INT );
INSERT INTO t2 VALUES (1),(2),(1),(4),(2);
explain SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
-set debug_dbug='+d,show_explain_in_find_all_keys';
+SET debug_dbug='+d,show_explain_in_find_all_keys';
send SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
connection default;
@@ -354,7 +354,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
@@ -370,7 +370,7 @@ INSERT INTO t2 VALUES (1),(2),(1),(4),(2);
EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
connection default;
@@ -378,7 +378,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
@@ -394,7 +394,7 @@ INSERT INTO t2 VALUES (4),(5),(6),(7),(8),(9);
explain SELECT * FROM v1, t2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send SELECT * FROM v1, t2;
connection default;
@@ -405,7 +405,7 @@ evalp kill query $thr2;
connection con1;
--error ER_QUERY_INTERRUPTED
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t2, t3;
@@ -413,21 +413,21 @@ DROP TABLE t2, t3;
--echo # MDEV-267: SHOW EXPLAIN: Server crashes in JOIN::print_explain on most of queries
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send select sleep(1);
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Same as above, but try another reason for JOIN to be degenerate
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send select * from t0 where 1>10;
connection default;
--source include/wait_condition.inc
@@ -435,7 +435,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Same as above, but try another reason for JOIN to be degenerate (2)
@@ -443,7 +443,7 @@ set debug_dbug=@old_debug;
create table t3(a int primary key);
insert into t3 select a from t0;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send select * from t0,t3 where t3.a=112233;
connection default;
--source include/wait_condition.inc
@@ -451,7 +451,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t3;
--echo #
@@ -470,7 +470,7 @@ explain SELECT * FROM t2 WHERE a =
);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
send SELECT * FROM t2 WHERE a =
(SELECT MAX(a) FROM t2
WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3)
@@ -480,7 +480,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t2;
@@ -513,7 +513,7 @@ WHERE a1 < ALL (
);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
send
SELECT count(*) FROM t2, t3
WHERE a1 < ALL (
@@ -526,7 +526,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t2, t3, t4;
--echo #
@@ -538,7 +538,7 @@ INSERT INTO t2 VALUES
(11,23),(12,3),(13,45),(14,16),(15,2),(16,33),(17,2),(18,5),(19,9),(20,2);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send
SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`);
connection default;
@@ -547,7 +547,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
DROP TABLE t1;
@@ -559,7 +559,7 @@ CREATE TABLE t1(a INT, KEY(a));
INSERT INTO t1 VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send SELECT 'test' FROM t1 WHERE a=1;
connection default;
@@ -567,7 +567,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
@@ -591,7 +591,7 @@ set join_cache_level=0;
explain select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_test_if_quick_select';
+SET debug_dbug='+d,show_explain_probe_test_if_quick_select';
send
select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
@@ -608,7 +608,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
--echo #
@@ -619,7 +619,7 @@ CREATE TABLE t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c));
INSERT INTO t1 (a) VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send SHOW INDEX FROM t1;
connection default;
@@ -627,7 +627,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
@@ -641,7 +641,7 @@ CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
EXPLAIN SELECT a + 1 FROM v1;
-set debug_dbug='+d,show_explain_probe_join_tab_preread';
+SET debug_dbug='+d,show_explain_probe_join_tab_preread';
set @show_explain_probe_select_id=1;
send
@@ -651,7 +651,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t1;
@@ -667,7 +667,7 @@ INSERT INTO t1 VALUES (4),(6);
EXPLAIN
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
-set debug_dbug='+d,show_explain_probe_union_read';
+SET debug_dbug='+d,show_explain_probe_union_read';
send
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
@@ -681,7 +681,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
--echo #
@@ -703,7 +703,7 @@ SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
@@ -714,7 +714,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1, t2;
--echo #
@@ -737,7 +737,7 @@ insert into t3 select * from t4;
explain select distinct t1.a from t1,t3 where t1.a=t3.a;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
select distinct t1.a from t1,t3 where t1.a=t3.a;
connection default;
@@ -746,7 +746,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1,t3,t4;
@@ -756,7 +756,7 @@ drop table t1,t3,t4;
create user test2@localhost;
grant ALL on test.* to test2@localhost;
-# Give the user SUPER privilege so it can set debug_dbug variable.
+# Give the user SUPER privilege so it can SET debug_dbug variable.
grant super on *.* to test2@localhost;
connect (con2, localhost, test2,,);
connection con1;
@@ -765,7 +765,7 @@ connection con1;
--echo # First, make sure that user 'test2' cannot do SHOW EXPLAIN on us
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where a < 3;
@@ -781,7 +781,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Check that user test2 can do SHOW EXPLAIN on its own queries
@@ -791,7 +791,7 @@ connect (con3, localhost, test2,,);
connection con2;
let $thr_con2=`select connection_id()`;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where a < 3;
@@ -817,10 +817,10 @@ disconnect con2;
grant process on *.* to test2@localhost;
connect (con2, localhost, test2,,);
connection con1;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where a < 3;
@@ -832,7 +832,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
revoke all privileges on test.* from test2@localhost;
drop user test2@localhost;
@@ -912,7 +912,7 @@ WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
@@ -924,10 +924,10 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
--send
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
@@ -940,7 +940,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
@@ -956,7 +956,7 @@ INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12, t1 t13;
EXPLAIN SELECT a FROM t1 GROUP BY a;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT a FROM t1 GROUP BY a;
@@ -967,7 +967,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
@@ -983,7 +983,7 @@ INSERT INTO t2 VALUES (86,'English'),(87,'Russian');
explain SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
@@ -994,7 +994,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1, t2;
--echo #
@@ -1033,7 +1033,7 @@ explain
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
send
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
@@ -1045,7 +1045,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
@@ -1069,7 +1069,7 @@ SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
@@ -1082,7 +1082,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
--echo #
@@ -1109,7 +1109,7 @@ select charset('ãû');
select hex('ãû');
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where length('ãû') = a;
@@ -1124,7 +1124,7 @@ connection con1;
# The constant should be two letters, the last looking like 'bl'
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set names default;
--echo #
@@ -1151,7 +1151,7 @@ WHERE b <= ANY (
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
SELECT SUM(b) FROM ( SELECT * FROM t1 ) AS alias1, t2
@@ -1166,7 +1166,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2;
drop table t0;
@@ -1182,7 +1182,7 @@ insert into t1 select a,a from t0;
create table t2 as select * from t1;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_best_ext_lim_search';
+SET debug_dbug='+d,show_explain_probe_best_ext_lim_search';
send
explain
select * from t0
diff --git a/mysql-test/main/show_explain_non_select.result b/mysql-test/main/show_explain_non_select.result
index 6076a848e22..8d96056ca91 100644
--- a/mysql-test/main/show_explain_non_select.result
+++ b/mysql-test/main/show_explain_non_select.result
@@ -14,7 +14,7 @@ from t0 A, t0 B, t0 C;
# Test SHOW EXPLAIN for single-table DELETE
#
connection con2;
-set debug_dbug='+d,show_explain_probe_delete_exec_start';
+SET debug_dbug='+d,show_explain_probe_delete_exec_start';
delete from t1 where a<10 and b+1>1000;
connection default;
show explain for $thr2;
@@ -27,7 +27,7 @@ connection con2;
# Test SHOW EXPLAIN for multi-table DELETE
#
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
delete t1 from t1, t0 where t0.a=t1.a and t1.b +1 > 1000;
connection default;
show explain for $thr2;
@@ -41,7 +41,7 @@ connection con2;
# Test SHOW EXPLAIN for single-table UPDATE
#
connection con2;
-set debug_dbug='+d,show_explain_probe_update_exec_start';
+SET debug_dbug='+d,show_explain_probe_update_exec_start';
update t1 set filler='filler-data-2' where a<10 and b+1>1000;
connection default;
show explain for $thr2;
@@ -51,5 +51,5 @@ Warnings:
Note 1003 update t1 set filler='filler-data-2' where a<10 and b+1>1000
connection con2;
drop table t0,t1;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set debug_sync='RESET';
diff --git a/mysql-test/main/show_explain_non_select.test b/mysql-test/main/show_explain_non_select.test
index 21b16739141..505e9296222 100644
--- a/mysql-test/main/show_explain_non_select.test
+++ b/mysql-test/main/show_explain_non_select.test
@@ -38,7 +38,7 @@ let $wait_condition= select State='show_explain_trap' from information_schema.pr
--echo # Test SHOW EXPLAIN for single-table DELETE
--echo #
connection con2;
-set debug_dbug='+d,show_explain_probe_delete_exec_start';
+SET debug_dbug='+d,show_explain_probe_delete_exec_start';
send delete from t1 where a<10 and b+1>1000;
connection default;
@@ -51,7 +51,7 @@ reap;
--echo # Test SHOW EXPLAIN for multi-table DELETE
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
send delete t1 from t1, t0 where t0.a=t1.a and t1.b +1 > 1000;
connection default;
--source include/wait_condition.inc
@@ -63,7 +63,7 @@ reap;
--echo # Test SHOW EXPLAIN for single-table UPDATE
--echo #
connection con2;
-set debug_dbug='+d,show_explain_probe_update_exec_start';
+SET debug_dbug='+d,show_explain_probe_update_exec_start';
send update t1 set filler='filler-data-2' where a<10 and b+1>1000;
connection default;
@@ -74,5 +74,5 @@ reap;
drop table t0,t1;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set debug_sync='RESET';
diff --git a/mysql-test/main/show_explain_ps.result b/mysql-test/main/show_explain_ps.result
index 69ee2cab31d..1c3be0d5953 100644
--- a/mysql-test/main/show_explain_ps.result
+++ b/mysql-test/main/show_explain_ps.result
@@ -17,7 +17,8 @@ connection con1;
connection default;
connection con1;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='d,show_explain_probe_join_exec_start';
select count(*) from t0 where a < 100000;
connection default;
show explain for $thr2;
@@ -28,7 +29,7 @@ Note 1003 select count(*) from t0 where a < 100000
connection con1;
count(*)
10
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
select event_name
from
performance_schema.events_stages_history_long join
diff --git a/mysql-test/main/show_explain_ps.test b/mysql-test/main/show_explain_ps.test
index 13cd1538143..cbff0f50f96 100644
--- a/mysql-test/main/show_explain_ps.test
+++ b/mysql-test/main/show_explain_ps.test
@@ -38,7 +38,8 @@ let $wait_condition= select State='show_explain_trap' from information_schema.pr
#
connection con1;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='d,show_explain_probe_join_exec_start';
send select count(*) from t0 where a < 100000;
connection default;
@@ -47,7 +48,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
evalp select event_name
from
diff --git a/mysql-test/main/show_grants_with_plugin-7985.result b/mysql-test/main/show_grants_with_plugin-7985.result
index bb475b7cba9..b07603aaf91 100644
--- a/mysql-test/main/show_grants_with_plugin-7985.result
+++ b/mysql-test/main/show_grants_with_plugin-7985.result
@@ -13,16 +13,16 @@ u1 %
#
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Test to see if connecting with no password is succesful.
#
connect con1, localhost, u1,,;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
@@ -32,8 +32,8 @@ flush privileges;
connect con1, localhost, u1,,;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
@@ -50,8 +50,8 @@ u1 % *7AFEFD08B6B720E781FB000CAA418F54FA662626
connect con1, localhost, u1,'SOMETHING',;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
@@ -61,8 +61,8 @@ flush privileges;
connect con1, localhost, u1,'SOMETHING',;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
@@ -78,16 +78,16 @@ u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 mysql_native_password *054B7BBD2B
#
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Logging in with the user's password should work.
#
connect con1, localhost, u1,'SOMETHINGELSE',;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
@@ -96,16 +96,16 @@ connection default;
flush privileges;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Here we connect via the user's password again.
#
connect con1, localhost, u1,'SOMETHINGELSE',;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
@@ -119,8 +119,8 @@ u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6
flush privileges;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Here we connect via the user's password.
#
@@ -143,16 +143,16 @@ GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password
USING '*7AFEFD08B6B720E781FB000CAA418F54FA662626';
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
#
# Test if the user can now use that password instead.
#
connect con1, localhost, u1,'SOMETHING',;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
#
# Test if the user can now use that password instead, after flushing privileges;
@@ -162,8 +162,8 @@ flush privileges;
connect con1, localhost, u1,'SOMETHING',;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%` IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626'
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
@@ -179,8 +179,8 @@ u1 % mysql_native_password
connect con1, localhost, u1,,;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
#
@@ -190,8 +190,8 @@ flush privileges;
connect con1, localhost, u1,,;
show grants;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT SELECT ON `mysql`.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT SELECT ON `mysql`.* TO `u1`@`%`
disconnect con1;
connection default;
drop user u1;
diff --git a/mysql-test/main/skip_name_resolve.result b/mysql-test/main/skip_name_resolve.result
index 1362e482717..9a903ebf472 100644
--- a/mysql-test/main/skip_name_resolve.result
+++ b/mysql-test/main/skip_name_resolve.result
@@ -2,8 +2,8 @@ CREATE USER mysqltest_1@'127.0.0.1/255.255.255.255';
GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
Grants for mysqltest_1@127.0.0.1/255.255.255.255
-GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
-GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
+GRANT USAGE ON *.* TO `mysqltest_1`@`127.0.0.1/255.255.255.255`
+GRANT ALL PRIVILEGES ON `test`.* TO `mysqltest_1`@`127.0.0.1/255.255.255.255`
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
connect con1, localhost, root, , test, $MASTER_MYPORT, ;
diff --git a/mysql-test/main/slowlog_enospace-10508.result b/mysql-test/main/slowlog_enospace-10508.result
index f39bfa2f00e..66fb19eed6a 100644
--- a/mysql-test/main/slowlog_enospace-10508.result
+++ b/mysql-test/main/slowlog_enospace-10508.result
@@ -3,7 +3,8 @@ create table t1 (a int, b int) engine=memory;
insert t1 select seq, seq+1 from seq_1_to_1000;
set global general_log=0;
set global log_queries_not_using_indexes=1;
-set debug_dbug='+d,simulate_file_write_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,simulate_file_write_error';
select * from t1 where a>10;
select * from t1 where a>10;
select * from t1 where a>10;
@@ -54,7 +55,7 @@ select * from t1 where a>10;
select * from t1 where a>10;
select * from t1 where a>10;
select * from t1 where a>10;
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
set global general_log=1;
set global log_queries_not_using_indexes=default;
drop table t1;
diff --git a/mysql-test/main/slowlog_enospace-10508.test b/mysql-test/main/slowlog_enospace-10508.test
index b2c26a5984d..74dca21f8ec 100644
--- a/mysql-test/main/slowlog_enospace-10508.test
+++ b/mysql-test/main/slowlog_enospace-10508.test
@@ -9,7 +9,8 @@ create table t1 (a int, b int) engine=memory;
insert t1 select seq, seq+1 from seq_1_to_1000;
set global general_log=0;
set global log_queries_not_using_indexes=1;
-set debug_dbug='+d,simulate_file_write_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,simulate_file_write_error';
--disable_result_log
--let $run= 50
while ($run)
@@ -18,7 +19,7 @@ while ($run)
dec $run;
}
--enable_result_log
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
set global general_log=1;
set global log_queries_not_using_indexes=default;
drop table t1;
diff --git a/mysql-test/main/sp-bugs.result b/mysql-test/main/sp-bugs.result
index a699cd11c5a..60cb6a89cde 100644
--- a/mysql-test/main/sp-bugs.result
+++ b/mysql-test/main/sp-bugs.result
@@ -1,5 +1,5 @@
#
-# Bug #47412: Valgrind warnings / user can read uninitalized memory
+# Bug #47412: Valgrind warnings / user can read uninitialized memory
# using SP variables
#
CREATE SCHEMA testdb;
diff --git a/mysql-test/main/sp-bugs.test b/mysql-test/main/sp-bugs.test
index 2dd70d28249..d7b88bbeeec 100644
--- a/mysql-test/main/sp-bugs.test
+++ b/mysql-test/main/sp-bugs.test
@@ -1,7 +1,7 @@
# Test file for stored procedure bugfixes
--echo #
---echo # Bug #47412: Valgrind warnings / user can read uninitalized memory
+--echo # Bug #47412: Valgrind warnings / user can read uninitialized memory
--echo # using SP variables
--echo #
diff --git a/mysql-test/main/sp-security.result b/mysql-test/main/sp-security.result
index de33c11a28f..1dea23a5271 100644
--- a/mysql-test/main/sp-security.result
+++ b/mysql-test/main/sp-security.result
@@ -195,14 +195,14 @@ grant insert on t1 to usera@localhost;
grant execute on procedure sptest.p1 to usera@localhost;
show grants for usera@localhost;
Grants for usera@localhost
-GRANT USAGE ON *.* TO 'usera'@'localhost'
-GRANT INSERT ON `test`.`t1` TO 'usera'@'localhost'
-GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO 'usera'@'localhost'
+GRANT USAGE ON *.* TO `usera`@`localhost`
+GRANT INSERT ON `test`.`t1` TO `usera`@`localhost`
+GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO `usera`@`localhost`
grant execute on procedure sptest.p1 to userc@localhost with grant option;
show grants for userc@localhost;
Grants for userc@localhost
-GRANT USAGE ON *.* TO 'userc'@'localhost'
-GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO 'userc'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `userc`@`localhost`
+GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO `userc`@`localhost` WITH GRANT OPTION
connect con2usera,localhost,usera,,;
connect con3userb,localhost,userb,,;
connect con4userc,localhost,userc,,;
@@ -239,18 +239,18 @@ userb@localhost 4
grant all privileges on procedure sptest.p1 to userc@localhost;
show grants for userc@localhost;
Grants for userc@localhost
-GRANT USAGE ON *.* TO 'userc'@'localhost'
-GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `sptest`.`p1` TO 'userc'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `userc`@`localhost`
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `sptest`.`p1` TO `userc`@`localhost` WITH GRANT OPTION
show grants for userb@localhost;
Grants for userb@localhost
-GRANT USAGE ON *.* TO 'userb'@'localhost'
-GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO 'userb'@'localhost'
+GRANT USAGE ON *.* TO `userb`@`localhost`
+GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO `userb`@`localhost`
connection con4userc;
revoke all privileges on procedure sptest.p1 from userb@localhost;
connection con1root;
show grants for userb@localhost;
Grants for userb@localhost
-GRANT USAGE ON *.* TO 'userb'@'localhost'
+GRANT USAGE ON *.* TO `userb`@`localhost`
disconnect con4userc;
disconnect con3userb;
disconnect con2usera;
@@ -723,14 +723,14 @@ user() current_user()
foo@localhost foo@local_ost
show grants;
Grants for foo@local_ost
-GRANT USAGE ON *.* TO 'foo'@'local_ost'
-GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
+GRANT USAGE ON *.* TO `foo`@`local_ost`
+GRANT CREATE ROUTINE ON `foodb`.* TO `foo`@`local_ost`
create procedure fooproc() select 'i am fooproc';
show grants;
Grants for foo@local_ost
-GRANT USAGE ON *.* TO 'foo'@'local_ost'
-GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
-GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'local_ost'
+GRANT USAGE ON *.* TO `foo`@`local_ost`
+GRANT CREATE ROUTINE ON `foodb`.* TO `foo`@`local_ost`
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO `foo`@`local_ost`
disconnect con1;
connection default;
drop user foo@local_ost;
@@ -772,13 +772,13 @@ set password=password('foobar');
create procedure sp1() select 1;
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
grant execute on procedure sp1 to current_user() identified by 'barfoo';
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
-GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO 'root'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
+GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO `root`@`localhost`
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop procedure sp1;
set password='';
diff --git a/mysql-test/main/sp-security.test b/mysql-test/main/sp-security.test
index 30d7e4cf895..622c75c48f7 100644
--- a/mysql-test/main/sp-security.test
+++ b/mysql-test/main/sp-security.test
@@ -342,7 +342,7 @@ flush privileges;
drop table t1;
#
-# Bug#9503 reseting correct parameters of thread after error in SP function
+# Bug#9503 resetting correct parameters of thread after error in SP function
#
connect (root,localhost,root,,test);
connection root;
diff --git a/mysql-test/main/sp_notembedded.result b/mysql-test/main/sp_notembedded.result
index fe95508cb9d..0d04f23326d 100644
--- a/mysql-test/main/sp_notembedded.result
+++ b/mysql-test/main/sp_notembedded.result
@@ -8,11 +8,11 @@ show grants for 'root'@'localhost';
end|
call bug4902()|
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
call bug4902()|
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop procedure bug4902|
drop procedure if exists bug4902_2|
@@ -159,11 +159,11 @@ create procedure 15298_2 () sql security definer show grants;
connect con1,localhost,mysqltest_1,,test;
call 15298_1();
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
call 15298_2();
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
connection default;
disconnect con1;
@@ -330,21 +330,21 @@ update mysql.user set password = replace(password, '*', '-') where user='foo1';
connect foo,localhost,foo1,foo;
show grants;
Grants for foo1@localhost
-GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
-GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost'
+GRANT USAGE ON *.* TO `foo1`@`localhost` IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
+GRANT CREATE ROUTINE ON `test`.* TO `foo1`@`localhost`
connection default;
flush privileges;
connection foo;
show grants;
Grants for foo1@localhost
-GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
-GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost'
+GRANT USAGE ON *.* TO `foo1`@`localhost` IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
+GRANT CREATE ROUTINE ON `test`.* TO `foo1`@`localhost`
create procedure spfoo() select 1;
show grants;
Grants for foo1@localhost
-GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
-GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost'
-GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`spfoo` TO 'foo1'@'localhost'
+GRANT USAGE ON *.* TO `foo1`@`localhost` IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
+GRANT CREATE ROUTINE ON `test`.* TO `foo1`@`localhost`
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`spfoo` TO `foo1`@`localhost`
connection default;
disconnect foo;
drop procedure spfoo;
diff --git a/mysql-test/main/ssl_7937.test b/mysql-test/main/ssl_7937.test
index aa8cd225d7b..59c13107e01 100644
--- a/mysql-test/main/ssl_7937.test
+++ b/mysql-test/main/ssl_7937.test
@@ -21,15 +21,6 @@ create procedure have_ssl()
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
--echo mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()"
-# this is the test where certificate verification fails.
-# but yassl doesn't support certificate verification, so
-# we fake the test result for yassl
-let yassl=`select variable_value='Unknown' from information_schema.session_status where variable_name='Ssl_session_cache_mode'`;
-if (!$yassl) {
- --replace_result "self signed certificate in certificate chain" "Failed to verify the server certificate" "Error in the certificate." "Failed to verify the server certificate"
- --exec $MYSQL --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
-}
-if ($yassl) {
- --echo ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate
-}
+--replace_regex /SSL connection error.*certificate[^\n]*/SSL connection error: Failed to verify the server certificate/
+--exec $MYSQL --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
drop procedure have_ssl;
diff --git a/mysql-test/main/ssl_8k_key.test b/mysql-test/main/ssl_8k_key.test
index edfead46658..88f6b963cc4 100644
--- a/mysql-test/main/ssl_8k_key.test
+++ b/mysql-test/main/ssl_8k_key.test
@@ -1,6 +1,3 @@
-# schannel does not support keys longer than 4k
--- source include/not_windows.inc
-
-- source include/have_ssl_communication.inc
#
# Bug#29784 YaSSL assertion failure when reading 8k key.
diff --git a/mysql-test/main/ssl_crl.test b/mysql-test/main/ssl_crl.test
index dc30a9b5934..e79f8ff32c2 100644
--- a/mysql-test/main/ssl_crl.test
+++ b/mysql-test/main/ssl_crl.test
@@ -7,7 +7,7 @@
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/server-new-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/server-new-cert.pem test -e "SHOW STATUS LIKE 'Ssl_version'"
--echo # try logging in with a certificate in the server's --ssl-crl : should fail
-# OpenSSL 1.1.1a correctly rejects the certificate, but the error message is wrong
---replace_result "ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 0" "ERROR 2026 (HY000): SSL connection error: sslv3 alert certificate revoked"
+# OpenSSL 1.1.1a correctly rejects the certificate, but the error message is different
+--replace_regex /ERROR 2013 \(HY000\): Lost connection to MySQL server at '.*', system error: [0-9]+/ERROR 2026 (HY000): SSL connection error: sslv3 alert certificate revoked/
--error 1
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_version'" 2>&1
diff --git a/mysql-test/main/ssl_crl_clients.test b/mysql-test/main/ssl_crl_clients.test
index fc954a2fc38..f1dc4909cc6 100644
--- a/mysql-test/main/ssl_crl_clients.test
+++ b/mysql-test/main/ssl_crl_clients.test
@@ -1,6 +1,12 @@
# This test should work in embedded server after we fix mysqltest
-- source include/not_embedded.inc
--- source include/have_openssl.inc
+
+if (`SELECT COUNT(*) = 0 FROM information_schema.GLOBAL_VARIABLES
+ WHERE (VARIABLE_NAME ='version_compile_os' AND VARIABLE_VALUE LIKE 'Win%' OR
+ VARIABLE_NAME='have_openssl' AND VARIABLE_VALUE='YES')`)
+{
+ skip Need openssl or Windows;
+}
--echo # Test clients with and without CRL lists
@@ -14,10 +20,12 @@ copy_file $MYSQL_TEST_DIR/std_data/server-cert.crl $MYSQL_TMP_DIR/ed1f42db.r0;
--echo ############ Test mysql ##############
--echo # Test mysql connecting to a server with a certificate revoked by -crl
+--replace_result "Server certificate validation failed. The certificate is revoked. Error 0x80092010(CRYPT_E_REVOKED)" "certificate revoked"
--error 1
--exec $MYSQL $ssl_crl test -e "SHOW STATUS LIKE 'Ssl_version'" 2>&1
--echo # Test mysql connecting to a server with a certificate revoked by -crlpath
+--replace_result "Server certificate validation failed. The certificate is revoked. Error 0x80092010(CRYPT_E_REVOKED)" "certificate revoked"
--error 1
--exec $MYSQL $ssl_crlpath test -e "SHOW STATUS LIKE 'Ssl_version'" 2>&1
@@ -26,11 +34,11 @@ copy_file $MYSQL_TEST_DIR/std_data/server-cert.crl $MYSQL_TMP_DIR/ed1f42db.r0;
let $admin_suffix = --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping;
--echo # Test mysqladmin connecting to a server with a certificate revoked by -crl
---replace_regex /.*mysqladmin.*:/mysqladmin:/
+--replace_regex /.*mysqladmin.*:/mysqladmin:/ /SSL connection error: .*CRYPT_E_REVOKED./SSL connection error: certificate revoked/
--error 1
--exec $MYSQLADMIN $ssl_crl $admin_suffix 2>&1
--echo # Test mysqladmin connecting to a server with a certificate revoked by -crlpath
---replace_regex /.*mysqladmin.*:/mysqladmin:/
+--replace_regex /.*mysqladmin.*:/mysqladmin:/ /SSL connection error: .*CRYPT_E_REVOKED./SSL connection error: certificate revoked/
--error 1
--exec $MYSQLADMIN $ssl_crlpath $admin_suffix 2>&1
diff --git a/mysql-test/main/ssl_system_ca,bad.result b/mysql-test/main/ssl_system_ca,bad.result
new file mode 100644
index 00000000000..b9c6d3e29d8
--- /dev/null
+++ b/mysql-test/main/ssl_system_ca,bad.result
@@ -0,0 +1 @@
+ERROR 2026 (HY000): SSL connection error: Validation of SSL server certificate failed
diff --git a/mysql-test/main/ssl_system_ca.combinations b/mysql-test/main/ssl_system_ca.combinations
new file mode 100644
index 00000000000..6e3576ada15
--- /dev/null
+++ b/mysql-test/main/ssl_system_ca.combinations
@@ -0,0 +1,11 @@
+[good]
+#
+# hostname on the certificate is localhost
+#
+
+[bad]
+#
+# hostname on the certificate is server8k
+#
+loose-ssl-key=$MYSQL_TEST_DIR/std_data/server8k-key.pem
+loose-ssl-cert=$MYSQL_TEST_DIR/std_data/server8k-cert.pem
diff --git a/mysql-test/main/ssl_system_ca.result b/mysql-test/main/ssl_system_ca.result
new file mode 100644
index 00000000000..78f8bf805dd
--- /dev/null
+++ b/mysql-test/main/ssl_system_ca.result
@@ -0,0 +1,2 @@
+*************************** 1. row ***************************
+have_ssl: 1
diff --git a/mysql-test/main/ssl_system_ca.test b/mysql-test/main/ssl_system_ca.test
new file mode 100644
index 00000000000..920e391090f
--- /dev/null
+++ b/mysql-test/main/ssl_system_ca.test
@@ -0,0 +1,22 @@
+#
+# Tests here don't use --ssl-ca but expect the certificate to be
+# signed by a CA in a system CA store
+#
+# They only work for openssl, because the following line works only there:
+let SSL_CERT_DIR=$MYSQL_TMP_DIR;
+
+source include/not_embedded.inc;
+
+if (`select @@version_ssl_library not like 'OpenSSL%'`) {
+ skip Needs OpenSSL;
+}
+
+# See `openssl x509 -in cacert.pem -noout -issuer_hash`
+copy_file $MYSQL_TEST_DIR/std_data/cacert.pem $MYSQL_TMP_DIR/ed1f42db.0;
+
+#
+# test --ssl-verify-server-cert
+#
+
+disable_abort_on_error;
+exec $MYSQL --ssl-verify-server-cert -Ee "select (variable_value <> '') as have_ssl from information_schema.session_status where variable_name='ssl_cipher'" 2>&1;
diff --git a/mysql-test/main/stat_tables-enospc.result b/mysql-test/main/stat_tables-enospc.result
index 943cbca6bc5..9ac24a2af99 100644
--- a/mysql-test/main/stat_tables-enospc.result
+++ b/mysql-test/main/stat_tables-enospc.result
@@ -1,11 +1,12 @@
call mtr.add_suppression("No space left on device");
create table t1 (a varchar(255), b varchar(255), c varchar(255));
set use_stat_tables=PREFERABLY, optimizer_use_condition_selectivity=3;
-set debug_dbug='+d,simulate_file_write_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,simulate_file_write_error';
set @@max_heap_table_size=128*1024;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze Error Error writing file 'tmp-file' (Errcode: 28 "No space left on device")
test.t1 analyze status Operation failed
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
drop table t1;
diff --git a/mysql-test/main/stat_tables-enospc.test b/mysql-test/main/stat_tables-enospc.test
index 932b2bde302..fe8fe3590ae 100644
--- a/mysql-test/main/stat_tables-enospc.test
+++ b/mysql-test/main/stat_tables-enospc.test
@@ -16,9 +16,10 @@ while ($i) {
}
--enable_query_log
set use_stat_tables=PREFERABLY, optimizer_use_condition_selectivity=3;
-set debug_dbug='+d,simulate_file_write_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,simulate_file_write_error';
set @@max_heap_table_size=128*1024;
--replace_regex /'.*'/'tmp-file'/
analyze table t1;
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
drop table t1;
diff --git a/mysql-test/main/timezone_grant.result b/mysql-test/main/timezone_grant.result
index 42ce458d00f..bacc8348e89 100644
--- a/mysql-test/main/timezone_grant.result
+++ b/mysql-test/main/timezone_grant.result
@@ -13,8 +13,8 @@ connect tzuser, localhost, mysqltest_1,,;
connection tzuser;
show grants for current_user();
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `mysqltest_1`@`localhost`
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC');
@@ -39,9 +39,9 @@ connect tzuser2, localhost, mysqltest_1,,;
connection tzuser2;
show grants for current_user();
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t2` TO 'mysqltest_1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t1` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t2` TO `mysqltest_1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t1` TO `mysqltest_1`@`localhost`
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC');
diff --git a/mysql-test/main/trigger_notembedded.result b/mysql-test/main/trigger_notembedded.result
index 3ee84c3c308..94e651b1340 100644
--- a/mysql-test/main/trigger_notembedded.result
+++ b/mysql-test/main/trigger_notembedded.result
@@ -194,8 +194,8 @@ use mysqltest_db1;
GRANT DELETE ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
-GRANT DELETE, TRIGGER ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_u1`@`localhost`
+GRANT DELETE, TRIGGER ON `mysqltest_db1`.* TO `mysqltest_u1`@`localhost`
connection bug15166_u1_con;
use mysqltest_db1;
CREATE TRIGGER t1_trg_after_delete AFTER DELETE ON t1
diff --git a/mysql-test/main/type_bit.test b/mysql-test/main/type_bit.test
index 012fa2236d7..216995fc479 100644
--- a/mysql-test/main/type_bit.test
+++ b/mysql-test/main/type_bit.test
@@ -262,7 +262,7 @@ select hex(a), b from t1;
drop table t1;
#
-# type was not properly initalized, which caused key_copy to fail
+# type was not properly initialized, which caused key_copy to fail
#
create table t1(bit_field bit(2), int_field int, key a(bit_field));
diff --git a/mysql-test/main/type_datetime.result b/mysql-test/main/type_datetime.result
index a7a9eece0da..19a2c87b730 100644
--- a/mysql-test/main/type_datetime.result
+++ b/mysql-test/main/type_datetime.result
@@ -1198,6 +1198,87 @@ Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
DROP VIEW v1;
DROP TABLE t1;
#
+# MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41
+#
+CREATE TABLE t1
+(
+id INT NOT NULL PRIMARY KEY,
+id2 INT,
+k TINYINT,
+j INT,
+t DATETIME,
+KEY k1 (id2,k,j,t)
+);
+INSERT INTO t1 VALUES
+(53,54,1,0,'2019-12-13 10:09:59'),
+(54,54,1,0,'2019-12-13 16:28:41'),
+(55,54,1,0,'2019-12-13 16:29:10'),
+(56,54,1,0,'2019-12-13 16:29:43'),
+(57,54,1,0,'2019-12-13 16:30:16'),
+(58,54,1,0,'2019-12-13 16:30:49'),
+(59,54,1,0,'2019-12-13 16:31:23'),
+(60,54,1,0,'2019-12-13 16:31:55'),
+(61,54,1,0,'2019-12-13 16:32:28'),
+(62,54,1,0,'2019-12-13 16:33:01'),
+(63,54,1,0,'2019-12-13 16:33:34'),
+(64,54,1,0,'2019-12-13 16:34:07'),
+(65,54,1,0,'2019-12-13 16:34:40'),
+(66,54,1,0,'2019-12-13 16:35:13'),
+(67,54,1,0,'2019-12-13 16:35:46'),
+(68,54,1,0,'2019-12-13 16:36:19');
+SELECT t FROM t1 GROUP BY t HAVING t=max(t);
+t
+2019-12-13 10:09:59
+2019-12-13 16:28:41
+2019-12-13 16:29:10
+2019-12-13 16:29:43
+2019-12-13 16:30:16
+2019-12-13 16:30:49
+2019-12-13 16:31:23
+2019-12-13 16:31:55
+2019-12-13 16:32:28
+2019-12-13 16:33:01
+2019-12-13 16:33:34
+2019-12-13 16:34:07
+2019-12-13 16:34:40
+2019-12-13 16:35:13
+2019-12-13 16:35:46
+2019-12-13 16:36:19
+SELECT t FROM t1 WHERE id2=54 and j=0 and k=1 GROUP BY t HAVING t=max(t);
+t
+2019-12-13 10:09:59
+2019-12-13 16:28:41
+2019-12-13 16:29:10
+2019-12-13 16:29:43
+2019-12-13 16:30:16
+2019-12-13 16:30:49
+2019-12-13 16:31:23
+2019-12-13 16:31:55
+2019-12-13 16:32:28
+2019-12-13 16:33:01
+2019-12-13 16:33:34
+2019-12-13 16:34:07
+2019-12-13 16:34:40
+2019-12-13 16:35:13
+2019-12-13 16:35:46
+2019-12-13 16:36:19
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES (1);
+SELECT pk<DATE'2001-01-01' FROM t1 GROUP BY pk;
+pk<DATE'2001-01-01'
+1
+Warnings:
+Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
+SELECT pk<DATE'2001-01-01' FROM v1 GROUP BY pk;
+pk<DATE'2001-01-01'
+1
+Warnings:
+Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
+DROP VIEW v1;
+DROP TABLE t1;
+#
# End of 10.1 tests
#
#
diff --git a/mysql-test/main/type_datetime.test b/mysql-test/main/type_datetime.test
index 2445925cb80..60b30121559 100644
--- a/mysql-test/main/type_datetime.test
+++ b/mysql-test/main/type_datetime.test
@@ -748,6 +748,49 @@ DROP TABLE t1;
--echo #
+--echo # MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41
+--echo #
+
+CREATE TABLE t1
+(
+ id INT NOT NULL PRIMARY KEY,
+ id2 INT,
+ k TINYINT,
+ j INT,
+ t DATETIME,
+ KEY k1 (id2,k,j,t)
+);
+INSERT INTO t1 VALUES
+(53,54,1,0,'2019-12-13 10:09:59'),
+(54,54,1,0,'2019-12-13 16:28:41'),
+(55,54,1,0,'2019-12-13 16:29:10'),
+(56,54,1,0,'2019-12-13 16:29:43'),
+(57,54,1,0,'2019-12-13 16:30:16'),
+(58,54,1,0,'2019-12-13 16:30:49'),
+(59,54,1,0,'2019-12-13 16:31:23'),
+(60,54,1,0,'2019-12-13 16:31:55'),
+(61,54,1,0,'2019-12-13 16:32:28'),
+(62,54,1,0,'2019-12-13 16:33:01'),
+(63,54,1,0,'2019-12-13 16:33:34'),
+(64,54,1,0,'2019-12-13 16:34:07'),
+(65,54,1,0,'2019-12-13 16:34:40'),
+(66,54,1,0,'2019-12-13 16:35:13'),
+(67,54,1,0,'2019-12-13 16:35:46'),
+(68,54,1,0,'2019-12-13 16:36:19');
+SELECT t FROM t1 GROUP BY t HAVING t=max(t);
+SELECT t FROM t1 WHERE id2=54 and j=0 and k=1 GROUP BY t HAVING t=max(t);
+DROP TABLE t1;
+
+CREATE TABLE t1 (pk INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES (1);
+SELECT pk<DATE'2001-01-01' FROM t1 GROUP BY pk;
+SELECT pk<DATE'2001-01-01' FROM v1 GROUP BY pk;
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/main/type_int.result b/mysql-test/main/type_int.result
index 3a1cdf2f24b..45060611f8e 100644
--- a/mysql-test/main/type_int.result
+++ b/mysql-test/main/type_int.result
@@ -20,6 +20,19 @@ COALESCE(@a)
1
DROP TABLE t1;
#
+# MDEV-21065 UNIQUE constraint causes a query with string comparison to omit a row in the result set
+#
+CREATE TABLE t1 (c0 INT UNIQUE);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL), (NULL), (1), (0);
+SELECT * FROM t1 WHERE c0 < '\n2';
+c0
+0
+1
+DROP TABLE t1;
+SELECT CAST('\n2' AS INT);
+CAST('\n2' AS INT)
+2
+#
# End of 5.5 tests
#
#
diff --git a/mysql-test/main/type_int.test b/mysql-test/main/type_int.test
index 008fd014afa..38bd1a0037a 100644
--- a/mysql-test/main/type_int.test
+++ b/mysql-test/main/type_int.test
@@ -15,6 +15,18 @@ SELECT COALESCE(@a) FROM t1 ORDER BY STRCMP(STDDEV_SAMP(a), 'bar');
DROP TABLE t1;
--echo #
+--echo # MDEV-21065 UNIQUE constraint causes a query with string comparison to omit a row in the result set
+--echo #
+
+CREATE TABLE t1 (c0 INT UNIQUE);
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL), (NULL), (1), (0);
+SELECT * FROM t1 WHERE c0 < '\n2';
+DROP TABLE t1;
+
+SELECT CAST('\n2' AS INT);
+
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/main/type_time.result b/mysql-test/main/type_time.result
index 44f0d50d94e..de0dd9a03a2 100644
--- a/mysql-test/main/type_time.result
+++ b/mysql-test/main/type_time.result
@@ -1246,6 +1246,72 @@ drop table t1;
SET @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set @@old_mode= @save_old_mode;
#
+# MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41
+#
+CREATE OR REPLACE TABLE t1
+(
+id INT NOT NULL PRIMARY KEY,
+id2 INT,
+k TINYINT,
+j INT,
+t TIME,
+KEY k1 (id2,k,j,t)
+);
+INSERT INTO t1 VALUES
+(53,54,1,0,'10:09:59'),
+(54,54,1,0,'16:28:41'),
+(55,54,1,0,'16:29:10'),
+(56,54,1,0,'16:29:43'),
+(57,54,1,0,'16:30:16'),
+(58,54,1,0,'16:30:49'),
+(59,54,1,0,'16:31:23'),
+(60,54,1,0,'16:31:55'),
+(61,54,1,0,'16:32:28'),
+(62,54,1,0,'16:33:01'),
+(63,54,1,0,'16:33:34'),
+(64,54,1,0,'16:34:07'),
+(65,54,1,0,'16:34:40'),
+(66,54,1,0,'16:35:13'),
+(67,54,1,0,'16:35:46'),
+(68,54,1,0,'16:36:19');
+SELECT t FROM t1 GROUP BY t HAVING t=MAX(t);
+t
+10:09:59
+16:28:41
+16:29:10
+16:29:43
+16:30:16
+16:30:49
+16:31:23
+16:31:55
+16:32:28
+16:33:01
+16:33:34
+16:34:07
+16:34:40
+16:35:13
+16:35:46
+16:36:19
+SELECT t FROM t1 WHERE id2=54 AND j=0 AND k=1 GROUP BY t HAVING t=MAX(t);
+t
+10:09:59
+16:28:41
+16:29:10
+16:29:43
+16:30:16
+16:30:49
+16:31:23
+16:31:55
+16:32:28
+16:33:01
+16:33:34
+16:34:07
+16:34:40
+16:35:13
+16:35:46
+16:36:19
+DROP TABLE t1;
+#
# End of 10.1 tests
#
#
diff --git a/mysql-test/main/type_time.test b/mysql-test/main/type_time.test
index d8bb66fcd5c..5c998ec0ab0 100644
--- a/mysql-test/main/type_time.test
+++ b/mysql-test/main/type_time.test
@@ -747,6 +747,40 @@ SET @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selecti
set @@old_mode= @save_old_mode;
--echo #
+--echo # MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41
+--echo #
+
+CREATE OR REPLACE TABLE t1
+(
+ id INT NOT NULL PRIMARY KEY,
+ id2 INT,
+ k TINYINT,
+ j INT,
+ t TIME,
+ KEY k1 (id2,k,j,t)
+);
+INSERT INTO t1 VALUES
+(53,54,1,0,'10:09:59'),
+(54,54,1,0,'16:28:41'),
+(55,54,1,0,'16:29:10'),
+(56,54,1,0,'16:29:43'),
+(57,54,1,0,'16:30:16'),
+(58,54,1,0,'16:30:49'),
+(59,54,1,0,'16:31:23'),
+(60,54,1,0,'16:31:55'),
+(61,54,1,0,'16:32:28'),
+(62,54,1,0,'16:33:01'),
+(63,54,1,0,'16:33:34'),
+(64,54,1,0,'16:34:07'),
+(65,54,1,0,'16:34:40'),
+(66,54,1,0,'16:35:13'),
+(67,54,1,0,'16:35:46'),
+(68,54,1,0,'16:36:19');
+SELECT t FROM t1 GROUP BY t HAVING t=MAX(t);
+SELECT t FROM t1 WHERE id2=54 AND j=0 AND k=1 GROUP BY t HAVING t=MAX(t);
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/main/union_crash-714.result b/mysql-test/main/union_crash-714.result
index 4a51f88b76f..371be1e03d0 100644
--- a/mysql-test/main/union_crash-714.result
+++ b/mysql-test/main/union_crash-714.result
@@ -1,5 +1,7 @@
create table t1 (i tinyint);
-set debug_dbug='+d,bug11747970_raise_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,bug11747970_raise_error';
insert into t1 (i) select i from t1 union select i from t1;
ERROR 70100: Query execution was interrupted
drop table t1;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/union_crash-714.test b/mysql-test/main/union_crash-714.test
index 6c31a2202cb..90b849037f2 100644
--- a/mysql-test/main/union_crash-714.test
+++ b/mysql-test/main/union_crash-714.test
@@ -3,7 +3,9 @@
#
--source include/have_debug.inc
create table t1 (i tinyint);
-set debug_dbug='+d,bug11747970_raise_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,bug11747970_raise_error';
--error ER_QUERY_INTERRUPTED
insert into t1 (i) select i from t1 union select i from t1;
drop table t1;
+SET debug_dbug= @saved_dbug; \ No newline at end of file
diff --git a/mysql-test/main/uniques_crash-7912.result b/mysql-test/main/uniques_crash-7912.result
deleted file mode 100644
index bf3aab684ae..00000000000
--- a/mysql-test/main/uniques_crash-7912.result
+++ /dev/null
@@ -1,11 +0,0 @@
-call mtr.add_suppression("Out of memory");
-set sql_mode="";
-drop table if exists t1,t2;
-create table `t1` (`a` datetime not null) engine=InnoDB;
-create table `t2` (`a` int not null) engine=innodb;
-replace into t1 values (),();
-insert into t2 values(0);
-set session sort_buffer_size = 1024*1024*1024*1024;
-delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a;
-drop table t2;
-drop table t1;
diff --git a/mysql-test/main/uniques_crash-7912.test b/mysql-test/main/uniques_crash-7912.test
deleted file mode 100644
index 8dc82f8f540..00000000000
--- a/mysql-test/main/uniques_crash-7912.test
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# MDEV-7912
-#
-# multitable delete with wrongly set sort_buffer_size crashes in merge_buffers
-
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/windows.inc
-
-call mtr.add_suppression("Out of memory");
-
-set sql_mode="";
---disable_warnings
-drop table if exists t1,t2;
-create table `t1` (`a` datetime not null) engine=InnoDB;
-create table `t2` (`a` int not null) engine=innodb;
-replace into t1 values (),();
-insert into t2 values(0);
-set session sort_buffer_size = 1024*1024*1024*1024;
-#Either fail with EE_OUTOFMEMORY, or succeed
---error 0 , 5
-delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a;
---enable_warnings
-
-drop table t2;
-drop table t1;
diff --git a/mysql-test/main/user_limits.result b/mysql-test/main/user_limits.result
index bbf73d7c617..ffb8bb204a6 100644
--- a/mysql-test/main/user_limits.result
+++ b/mysql-test/main/user_limits.result
@@ -108,11 +108,11 @@ connection default;
grant usage on *.* to mysqltest_1@localhost with max_user_connections -1;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_USER_CONNECTIONS -1
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` WITH MAX_USER_CONNECTIONS -1
flush user_resources;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_USER_CONNECTIONS -1
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost` WITH MAX_USER_CONNECTIONS -1
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
connect muc5, localhost, mysqltest_1,,;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource (current value: -1)
diff --git a/mysql-test/main/view_grant.result b/mysql-test/main/view_grant.result
index 6d22f93fd49..00a93488919 100644
--- a/mysql-test/main/view_grant.result
+++ b/mysql-test/main/view_grant.result
@@ -4,12 +4,12 @@ create user test@localhost;
grant create view on test.* to test@localhost;
show grants for test@localhost;
Grants for test@localhost
-GRANT USAGE ON *.* TO 'test'@'localhost'
-GRANT CREATE VIEW ON `test`.* TO 'test'@'localhost'
+GRANT USAGE ON *.* TO `test`@`localhost`
+GRANT CREATE VIEW ON `test`.* TO `test`@`localhost`
revoke create view on test.* from test@localhost;
show grants for test@localhost;
Grants for test@localhost
-GRANT USAGE ON *.* TO 'test'@'localhost'
+GRANT USAGE ON *.* TO `test`@`localhost`
drop user test@localhost;
connect root,localhost,root,,test;
connection root;
diff --git a/mysql-test/main/warnings_debug.result b/mysql-test/main/warnings_debug.result
index 4cdce7a5feb..3a9d8225795 100644
--- a/mysql-test/main/warnings_debug.result
+++ b/mysql-test/main/warnings_debug.result
@@ -1,5 +1,6 @@
drop table if exists t1;
create table t1 (a int primary key) engine=innodb;
+SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,warn_during_ha_commit_trans";
INSERT INTO t1 VALUES (1);
Warnings:
@@ -8,3 +9,4 @@ SHOW WARNINGS;
Level Code Message
Warning 1196 Some non-transactional changed tables couldn't be rolled back
drop table t1;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/warnings_debug.test b/mysql-test/main/warnings_debug.test
index 3055e3894e5..6605daf875d 100644
--- a/mysql-test/main/warnings_debug.test
+++ b/mysql-test/main/warnings_debug.test
@@ -9,6 +9,7 @@ create table t1 (a int primary key) engine=innodb;
# Test that warnings produced during autocommit (after calling
# set_ok_status()) are still reported to the client.
+SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,warn_during_ha_commit_trans";
INSERT INTO t1 VALUES (1);
# The warning will be shown automatically by mysqltest; there was a bug where
@@ -17,3 +18,4 @@ INSERT INTO t1 VALUES (1);
SHOW WARNINGS;
drop table t1;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result
index 80c4109fe27..0ec459d4bd2 100644
--- a/mysql-test/main/win.result
+++ b/mysql-test/main/win.result
@@ -3634,6 +3634,96 @@ rank() over (partition by 'abc' order by 'xyz')
1
drop table t1;
#
+# MDEV-19380: ASAN heap-use-after-free in Protocol::net_store_data
+#
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT (SELECT MIN('foo') OVER() FROM t1 LIMIT 1) as x;
+x
+foo
+drop table t1;
+#
+# MDEV-16579: Wrong result of query using DISTINCT COUNT(*) OVER (*)
+#
+CREATE TABLE t1 (i int) ;
+INSERT INTO t1 VALUES (1),(0),(1),(2),(0),(1),(2),(1),(2);
+SELECT DISTINCT COUNT(*) OVER (), MOD(MIN(i),2) FROM t1 GROUP BY i ;
+COUNT(*) OVER () MOD(MIN(i),2)
+3 0
+3 1
+drop table t1;
+#
+# MDEV-21318: Wrong results with window functions and implicit grouping
+#
+CREATE TABLE t1 (a INT);
+#
+# With empty const table
+# The expected result here is 1, NULL
+#
+explain
+SELECT row_number() over(), sum(1) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found; Using temporary
+SELECT row_number() over(), sum(1) FROM t1;
+row_number() over() sum(1)
+1 NULL
+insert into t1 values (2);
+#
+# Const table has 1 row, but still impossible where
+# The expected result here is 1, NULL
+#
+EXPLAIN SELECT row_number() over(), sum(1) FROM t1 where a=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT row_number() over(), sum(1) FROM t1 where a=1;
+row_number() over() sum(1)
+1 NULL
+#
+# Impossible HAVING
+# Empty result is expected
+#
+EXPLAIN SELECT row_number() over(), sum(1) FROM t1 where a=1 having 1=0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
+SELECT row_number() over(), sum(1) FROM t1 where a=1 having 1=0;
+row_number() over() sum(1)
+#
+# const table has 1 row, no impossible where
+# The expected result here is 1, 2
+#
+EXPLAIN SELECT row_number() over(), sum(a) FROM t1 where a=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary
+SELECT row_number() over(), sum(a) FROM t1 where a=2;
+row_number() over() sum(a)
+1 2
+drop table t1;
+#
+# Impossible Where
+#
+create table t1(a int);
+insert into t1 values (1);
+#
+# Expected result is NULL, 0, NULL
+#
+EXPLAIN SELECT MAX(a) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+SELECT MAX(a) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE;
+MAX(a) OVER () COUNT(a) abs(a)
+NULL 0 NULL
+#
+# Expected result is 1, 0, NULL
+#
+EXPLAIN
+SELECT MAX(1) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+SELECT MAX(1) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE;
+MAX(1) OVER () COUNT(a) abs(a)
+1 0 NULL
+drop table t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index e71a4376392..38da2bde064 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2342,6 +2342,91 @@ select rank() over (partition by 'abc' order by 'xyz') from t1;
drop table t1;
--echo #
+--echo # MDEV-19380: ASAN heap-use-after-free in Protocol::net_store_data
+--echo #
+
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+
+SELECT (SELECT MIN('foo') OVER() FROM t1 LIMIT 1) as x;
+drop table t1;
+
+--echo #
+--echo # MDEV-16579: Wrong result of query using DISTINCT COUNT(*) OVER (*)
+--echo #
+
+CREATE TABLE t1 (i int) ;
+INSERT INTO t1 VALUES (1),(0),(1),(2),(0),(1),(2),(1),(2);
+
+SELECT DISTINCT COUNT(*) OVER (), MOD(MIN(i),2) FROM t1 GROUP BY i ;
+drop table t1;
+
+--echo #
+--echo # MDEV-21318: Wrong results with window functions and implicit grouping
+--echo #
+
+CREATE TABLE t1 (a INT);
+
+--echo #
+--echo # With empty const table
+--echo # The expected result here is 1, NULL
+--echo #
+
+explain
+SELECT row_number() over(), sum(1) FROM t1;
+SELECT row_number() over(), sum(1) FROM t1;
+
+insert into t1 values (2);
+
+--echo #
+--echo # Const table has 1 row, but still impossible where
+--echo # The expected result here is 1, NULL
+--echo #
+
+EXPLAIN SELECT row_number() over(), sum(1) FROM t1 where a=1;
+SELECT row_number() over(), sum(1) FROM t1 where a=1;
+
+--echo #
+--echo # Impossible HAVING
+--echo # Empty result is expected
+--echo #
+
+EXPLAIN SELECT row_number() over(), sum(1) FROM t1 where a=1 having 1=0;
+SELECT row_number() over(), sum(1) FROM t1 where a=1 having 1=0;
+
+--echo #
+--echo # const table has 1 row, no impossible where
+--echo # The expected result here is 1, 2
+--echo #
+
+EXPLAIN SELECT row_number() over(), sum(a) FROM t1 where a=2;
+SELECT row_number() over(), sum(a) FROM t1 where a=2;
+drop table t1;
+
+--echo #
+--echo # Impossible Where
+--echo #
+
+create table t1(a int);
+insert into t1 values (1);
+
+--echo #
+--echo # Expected result is NULL, 0, NULL
+--echo #
+EXPLAIN SELECT MAX(a) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE;
+SELECT MAX(a) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE;
+
+--echo #
+--echo # Expected result is 1, 0, NULL
+--echo #
+
+EXPLAIN
+SELECT MAX(1) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE;
+SELECT MAX(1) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE;
+
+drop table t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 12fb5de4678..3777997ba0a 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -324,7 +324,8 @@ my $opt_valgrind_mysqld= 0;
my $opt_valgrind_mysqltest= 0;
my @valgrind_args;
my $opt_strace= 0;
-my $opt_strace_client;
+my $opt_stracer;
+my $opt_client_strace = 0;
my @strace_args;
my $opt_valgrind_path;
my $valgrind_reports= 0;
@@ -1329,9 +1330,10 @@ sub command_line_setup {
'debugger=s' => \$opt_debugger,
'boot-dbx' => \$opt_boot_dbx,
'client-debugger=s' => \$opt_client_debugger,
- 'strace' => \$opt_strace,
- 'strace-client' => \$opt_strace_client,
- 'strace-option=s' => \@strace_args,
+ 'strace' => \$opt_strace,
+ 'strace-option=s' => \@strace_args,
+ 'client-strace' => \$opt_client_strace,
+ 'stracer=s' => \$opt_stracer,
'max-save-core=i' => \$opt_max_save_core,
'max-save-datadir=i' => \$opt_max_save_datadir,
'max-test-fail=i' => \$opt_max_test_fail,
@@ -1927,7 +1929,7 @@ sub command_line_setup {
join(" ", @valgrind_args), "\"");
}
- if (@strace_args)
+ if (@strace_args || $opt_stracer)
{
$opt_strace=1;
}
@@ -3051,15 +3053,43 @@ sub mysql_server_start($) {
# Save this test case information, so next can examine it
$mysqld->{'started_tinfo'}= $tinfo;
}
+
+ # If wsrep is on, we need to wait until the first
+ # server starts and bootstraps the cluster before
+ # starting other servers. The bootsrap server in the
+ # configuration should always be the first which has
+ # wsrep_on=ON
+ if (wsrep_on($mysqld) && wsrep_is_bootstrap_server($mysqld))
+ {
+ mtr_verbose("Waiting for wsrep bootstrap server to start");
+ if ($mysqld->{WAIT}->($mysqld))
+ {
+ return 1;
+ }
+ }
}
sub mysql_server_wait {
- my ($mysqld) = @_;
+ my ($mysqld, $tinfo) = @_;
- return not sleep_until_file_created($mysqld->value('pid-file'),
+ if (!sleep_until_file_created($mysqld->value('pid-file'),
$opt_start_timeout,
$mysqld->{'proc'},
- $warn_seconds);
+ $warn_seconds))
+ {
+ $tinfo->{comment}= "Failed to start ".$mysqld->name() . "\n";
+ return 1;
+ }
+
+ if (wsrep_on($mysqld))
+ {
+ mtr_verbose("Waiting for wsrep server " . $mysqld->name() . " to be ready");
+ if (!wait_wsrep_ready($tinfo, $mysqld))
+ {
+ return 1;
+ }
+ }
+ return 0;
}
sub create_config_file_for_extern {
@@ -4606,6 +4636,8 @@ sub extract_warning_lines ($$) {
qr/missing DBUG_RETURN/,
qr/Attempting backtrace/,
qr/Assertion .* failed/,
+ qr/Sanitizer/,
+ qr/runtime error:/,
);
# These are taken from the include/mtr_warnings.sql global suppression
# list. They occur delayed, so they can be parsed during shutdown rather
@@ -4700,8 +4732,8 @@ sub extract_warning_lines ($$) {
qr/InnoDB: See also */,
qr/InnoDB: Cannot open .*ib_buffer_pool.* for reading: No such file or directory*/,
qr/InnoDB: Table .*mysql.*innodb_table_stats.* not found./,
- qr/InnoDB: User stopword table .* does not exist./
-
+ qr/InnoDB: User stopword table .* does not exist./,
+ qr/Detected table cache mutex contention at instance .* waits. Additional table cache instance cannot be activated: consider raising table_open_cache_instances. Number of active instances/
);
my $matched_lines= [];
@@ -5498,12 +5530,12 @@ sub server_need_restart {
{
delete $server->{'restart_opts'};
my $use_dynamic_option_switch= 0;
- delete $server->{'restart_opts'};
+ my $restart_opts = delete $server->{'restart_opts'} || [];
if (!$use_dynamic_option_switch)
{
mtr_verbose_restart($server, "running with different options '" .
join(" ", @{$extra_opts}) . "' != '" .
- join(" ", @{$started_opts}) . "'" );
+ join(" ", @{$started_opts}, @{$restart_opts}) . "'" );
return 1;
}
@@ -5593,6 +5625,118 @@ sub stop_servers($$) {
}
}
+#
+# run_query_output
+#
+# Run a query against a server using mysql client. The output of
+# the query will be written into outfile.
+#
+sub run_query_output {
+ my ($mysqld, $query, $outfile)= @_;
+ my $args;
+
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
+ mtr_add_arg($args, "--silent");
+ mtr_add_arg($args, "--execute=%s", $query);
+
+ my $res= My::SafeProcess->run
+ (
+ name => "run_query_output -> ".$mysqld->name(),
+ path => $exe_mysql,
+ args => \$args,
+ output => $outfile,
+ error => $outfile
+ );
+
+ return $res
+}
+
+
+#
+# wsrep_wait_ready
+#
+# Wait until the server has been joined to the cluster and is
+# ready for operation.
+#
+# RETURN
+# 1 Server is ready
+# 0 Server didn't transition to ready state within start timeout
+#
+sub wait_wsrep_ready($$) {
+ my ($tinfo, $mysqld)= @_;
+
+ my $sleeptime= 100; # Milliseconds
+ my $loops= ($opt_start_timeout * 1000) / $sleeptime;
+
+ my $name= $mysqld->name();
+ my $outfile= "$opt_vardir/tmp/$name.wsrep_ready";
+ my $query= "SET SESSION wsrep_sync_wait = 0;
+ SELECT VARIABLE_NAME, VARIABLE_VALUE
+ FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+ WHERE VARIABLE_NAME = 'wsrep_ready'";
+
+ for (my $loop= 1; $loop <= $loops; $loop++)
+ {
+ # Careful... if MTR runs with option 'verbose' then the
+ # file contains also SafeProcess verbose output
+ if (run_query_output($mysqld, $query, $outfile) == 0 &&
+ mtr_grab_file($outfile) =~ /WSREP_READY\s+ON/)
+ {
+ unlink($outfile);
+ return 1;
+ }
+ mtr_milli_sleep($sleeptime);
+ }
+
+ $tinfo->{logfile}= "WSREP did not transition to state READY";
+ return 0;
+}
+
+#
+# wsrep_is_bootstrap_server
+#
+# Check if the server is the first one to be started in the
+# cluster.
+#
+# RETURN
+# 1 The server is a bootstrap server
+# 0 The server is not a bootstrap server
+#
+sub wsrep_is_bootstrap_server($) {
+ my $mysqld= shift;
+
+ my $cluster_address= $mysqld->if_exist('wsrep-cluster-address') ||
+ $mysqld->if_exist('wsrep_cluster_address');
+ if (defined $cluster_address)
+ {
+ return $cluster_address eq "gcomm://" || $cluster_address eq "'gcomm://'";
+ }
+ return 0;
+}
+
+#
+# wsrep_on
+#
+# Check if wsrep has been enabled for a server.
+#
+# RETURN
+# 1 Wsrep has been enabled
+# 0 Wsrep is not enabled
+#
+sub wsrep_on($) {
+ my $mysqld= shift;
+ #check if wsrep_on= is set in configuration
+ if ($mysqld->if_exist('wsrep-on')) {
+ my $on= "".$mysqld->value('wsrep-on');
+ if ($on eq "1" || $on eq "ON") {
+ return 1;
+ }
+ }
+ return 0;
+}
+
#
# start_servers
@@ -5612,7 +5756,7 @@ sub start_servers($) {
for (all_servers()) {
next unless $_->{WAIT} and started($_);
- if ($_->{WAIT}->($_)) {
+ if ($_->{WAIT}->($_, $tinfo)) {
$tinfo->{comment}= "Failed to start ".$_->name() . "\n";
return 1;
}
@@ -5721,14 +5865,6 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "--non-blocking-api");
}
- if ( $opt_strace_client )
- {
- $exe= $opt_strace_client || "strace";
- mtr_add_arg($args, "-o");
- mtr_add_arg($args, "%s/log/mysqltest.strace", $opt_vardir);
- mtr_add_arg($args, "$exe_mysqltest");
- }
-
mtr_add_arg($args, "--timer-file=%s/log/timer", $opt_vardir);
if ( $opt_compress )
@@ -5794,6 +5930,17 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "%s", $_) for @args_saved;
}
+ # ----------------------------------------------------------------------
+ # Prefix the strace options to the argument list.
+ # ----------------------------------------------------------------------
+ if ( $opt_client_strace )
+ {
+ my @args_saved = @$args;
+ mtr_init_args(\$args);
+ strace_arguments($args, \$exe, "mysqltest");
+ mtr_add_arg($args, "%s", $_) for @args_saved;
+ }
+
if ($opt_force > 1)
{
mtr_add_arg($args, "--continue-on-error");
@@ -6118,16 +6265,17 @@ sub strace_arguments {
my $args= shift;
my $exe= shift;
my $mysqld_name= shift;
+ my $output= sprintf("%s/log/%s.strace", $path_vardir_trace, $mysqld_name);
mtr_add_arg($args, "-f");
- mtr_add_arg($args, "-o%s/var/log/%s.strace", $glob_mysql_test_dir, $mysqld_name);
+ mtr_add_arg($args, "-o%s", $output);
- # Add strace options, can be overridden by user
+ # Add strace options
mtr_add_arg($args, '%s', $_) for (@strace_args);
mtr_add_arg($args, $$exe);
- $$exe= "strace";
+ $$exe= $opt_stracer || "strace";
if ($exe_libtool)
{
@@ -6403,11 +6551,11 @@ Options for valgrind
Options for strace
strace Run the "mysqld" executables using strace. Default
- options are -f -o var/log/'mysqld-name'.strace
- strace-option=ARGS Option to give strace, replaces default option(s),
- strace-client=[path] Create strace output for mysqltest client, optionally
- specifying name and path to the trace program to use.
- Example: $0 --strace-client=ktrace
+ options are -f -o 'vardir'/log/'mysqld-name'.strace.
+ client-strace Trace the "mysqltest".
+ strace-option=ARGS Option to give strace, appends to existing options.
+ stracer=<EXE> Specify name and path to the trace program to use.
+ Default is "strace". Example: $0 --stracer=ktrace.
Misc options
user=USER User for connecting to mysqld(default: $opt_user)
diff --git a/mysql-test/suite/binlog/include/binlog_index.inc b/mysql-test/suite/binlog/include/binlog_index.inc
index b930386a0ba..d73091d59ab 100644
--- a/mysql-test/suite/binlog/include/binlog_index.inc
+++ b/mysql-test/suite/binlog/include/binlog_index.inc
@@ -22,7 +22,7 @@ call mtr.add_suppression('Could not use .*');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
-let $old=`select @@debug`;
+SET @saved_dbug = @@SESSION.debug_dbug;
RESET MASTER;
@@ -273,6 +273,6 @@ SELECT @index;
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
-eval SET SESSION debug_dbug="$old";
+SET @@SESSION.debug_dbug = @saved_dbug;
--echo End of tests
diff --git a/mysql-test/suite/binlog/include/binlog_ioerr.inc b/mysql-test/suite/binlog/include/binlog_ioerr.inc
index 8d1069bacb0..da6fb5ac727 100644
--- a/mysql-test/suite/binlog/include/binlog_ioerr.inc
+++ b/mysql-test/suite/binlog/include/binlog_ioerr.inc
@@ -15,12 +15,13 @@ RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES(0);
+SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug='+d,fail_binlog_write_1';
--error ER_ERROR_ON_WRITE
INSERT INTO t1 VALUES(1);
--error ER_ERROR_ON_WRITE
INSERT INTO t1 VALUES(2);
-SET SESSION debug_dbug='';
+SET SESSION debug_dbug=@saved_dbug;
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result
index 201e7b9e722..e077182fe8b 100644
--- a/mysql-test/suite/binlog/r/binlog_grant.result
+++ b/mysql-test/suite/binlog/r/binlog_grant.result
@@ -4,7 +4,7 @@ set @saved_binlog_format = @@global.binlog_format;
create user mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
connect plain,localhost,mysqltest_1,,test;
connect root,localhost,root,,test;
**** Variable SQL_LOG_BIN ****
diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result
index 02af5e40aab..4b6b4c7fbee 100644
--- a/mysql-test/suite/binlog/r/binlog_index.result
+++ b/mysql-test/suite/binlog/r/binlog_index.result
@@ -5,6 +5,7 @@ call mtr.add_suppression('Turning logging off for the whole duration of the MySQ
call mtr.add_suppression('Could not use .*');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
+SET @saved_dbug = @@SESSION.debug_dbug;
RESET MASTER;
flush logs;
flush logs;
@@ -183,5 +184,5 @@ master-bin.000011
master-bin.000012
master-bin.000013
-SET SESSION debug_dbug="";
+SET @@SESSION.debug_dbug = @saved_dbug;
End of tests
diff --git a/mysql-test/suite/binlog/r/binlog_invalid_read_in_rotate.result b/mysql-test/suite/binlog/r/binlog_invalid_read_in_rotate.result
new file mode 100644
index 00000000000..442fc951289
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_invalid_read_in_rotate.result
@@ -0,0 +1,18 @@
+RESET MASTER;
+call mtr.add_suppression("Error in Log_event::read_log_event*");
+call mtr.add_suppression("Replication event checksum verification failed while reading from a log file*");
+DROP TABLE /*! IF EXISTS*/ t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+CREATE TABLE `t1` (
+`col_int` int,
+pk integer auto_increment,
+`col_char_12_key` char(12),
+`col_int_key` int,
+`col_char_12` char(12),
+primary key (pk),
+key (`col_char_12_key` ),
+key (`col_int_key` )) ENGINE=InnoDB;
+INSERT /*! IGNORE */ INTO t1 VALUES (183173120, NULL, 'abcd', 1, 'efghijk'), (1, NULL, 'lmno', 2, 'p');
+ALTER TABLE `t1` ENABLE KEYS;
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_ioerr.result b/mysql-test/suite/binlog/r/binlog_ioerr.result
index 1d3c3d7d12d..e4f00a017ba 100644
--- a/mysql-test/suite/binlog/r/binlog_ioerr.result
+++ b/mysql-test/suite/binlog/r/binlog_ioerr.result
@@ -2,12 +2,13 @@ CALL mtr.add_suppression("Error writing file 'master-bin'");
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES(0);
+SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug='+d,fail_binlog_write_1';
INSERT INTO t1 VALUES(1);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
INSERT INTO t1 VALUES(2);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
-SET SESSION debug_dbug='';
+SET SESSION debug_dbug=@saved_dbug;
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
a
diff --git a/mysql-test/suite/binlog/r/binlog_show_binlog_event_random_pos.result b/mysql-test/suite/binlog/r/binlog_show_binlog_event_random_pos.result
new file mode 100644
index 00000000000..358422c5842
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_show_binlog_event_random_pos.result
@@ -0,0 +1,12 @@
+RESET MASTER;
+call mtr.add_suppression("Error in Log_event::read_log_event*");
+call mtr.add_suppression("Replication event checksum verification failed while reading from a log file*");
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 'test.t1'
+CREATE TABLE t1 (c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255), c5 CHAR(255));
+INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
+INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
+UPDATE t1 SET c1=repeat('b',255);
+INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_write_error.result b/mysql-test/suite/binlog/r/binlog_write_error.result
index 2606a9f40b3..6e8a212035a 100644
--- a/mysql-test/suite/binlog/r/binlog_write_error.result
+++ b/mysql-test/suite/binlog/r/binlog_write_error.result
@@ -12,92 +12,109 @@ DROP VIEW IF EXISTS v1, v2;
#
# Test injecting binlog write error when executing queries
#
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE TABLE t1 (a INT);
CREATE TABLE t1 (a INT);
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
INSERT INTO t1 VALUES (1),(2),(3);
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
INSERT INTO t1 VALUES (4),(5),(6);
INSERT INTO t1 VALUES (4),(5),(6);
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
UPDATE t1 set a=a+1;
UPDATE t1 set a=a+1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DELETE FROM t1;
DELETE FROM t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP TRIGGER tr1;
DROP TRIGGER tr1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
ALTER TABLE t1 ADD (b INT);
ALTER TABLE t1 ADD (b INT);
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE VIEW v1 AS SELECT a FROM t1;
CREATE VIEW v1 AS SELECT a FROM t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP VIEW v1;
DROP VIEW v1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP PROCEDURE p1;
DROP PROCEDURE p1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP TABLE t1;
DROP TABLE t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE FUNCTION f1() RETURNS INT return 1;
CREATE FUNCTION f1() RETURNS INT return 1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP FUNCTION f1;
DROP FUNCTION f1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE USER user1;
CREATE USER user1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP USER user1;
DROP USER user1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
#
# Cleanup
#
diff --git a/mysql-test/suite/binlog/t/binlog_invalid_read_in_rotate.combinations b/mysql-test/suite/binlog/t/binlog_invalid_read_in_rotate.combinations
new file mode 100644
index 00000000000..72076e12d48
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_invalid_read_in_rotate.combinations
@@ -0,0 +1,5 @@
+[enable_checksum]
+binlog_checksum=1
+
+[disable_checksum]
+binlog_checksum=0
diff --git a/mysql-test/suite/binlog/t/binlog_invalid_read_in_rotate.test b/mysql-test/suite/binlog/t/binlog_invalid_read_in_rotate.test
new file mode 100644
index 00000000000..36bb56c8342
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_invalid_read_in_rotate.test
@@ -0,0 +1,48 @@
+# ==== Purpose ====
+#
+# Test verifies that reading binary log by using "SHOW BINLOG EVENTS" command
+# from various random positions doesn't lead to crash. It should exit
+# gracefully with appropriate error.
+#
+# ==== References ====
+#
+# MDEV-18046:Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
+
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+
+RESET MASTER;
+
+call mtr.add_suppression("Error in Log_event::read_log_event*");
+call mtr.add_suppression("Replication event checksum verification failed while reading from a log file*");
+
+DROP TABLE /*! IF EXISTS*/ t1;
+CREATE TABLE `t1` (
+`col_int` int,
+pk integer auto_increment,
+`col_char_12_key` char(12),
+`col_int_key` int,
+`col_char_12` char(12),
+primary key (pk),
+key (`col_char_12_key` ),
+key (`col_int_key` )) ENGINE=InnoDB;
+
+INSERT /*! IGNORE */ INTO t1 VALUES (183173120, NULL, 'abcd', 1, 'efghijk'), (1, NULL, 'lmno', 2, 'p');
+
+--disable_warnings
+ALTER TABLE `t1` ENABLE KEYS;
+--enable_warnings
+
+--let $max_pos= query_get_value(SHOW MASTER STATUS,Position,1)
+--let $pos= 1
+while ($pos <= $max_pos)
+{
+ --disable_query_log
+ --disable_result_log
+ --error 0,1220
+ eval SHOW BINLOG EVENTS FROM $pos;
+ --inc $pos
+ --enable_result_log
+ --enable_query_log
+}
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_show_binlog_event_random_pos.combinations b/mysql-test/suite/binlog/t/binlog_show_binlog_event_random_pos.combinations
new file mode 100644
index 00000000000..72076e12d48
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_show_binlog_event_random_pos.combinations
@@ -0,0 +1,5 @@
+[enable_checksum]
+binlog_checksum=1
+
+[disable_checksum]
+binlog_checksum=0
diff --git a/mysql-test/suite/binlog/t/binlog_show_binlog_event_random_pos.test b/mysql-test/suite/binlog/t/binlog_show_binlog_event_random_pos.test
new file mode 100644
index 00000000000..e6a9e1cb2c1
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_show_binlog_event_random_pos.test
@@ -0,0 +1,37 @@
+# ==== Purpose ====
+#
+# Test verifies that reading binary log by using "SHOW BINLOG EVENTS" command
+# from various random positions doesn't lead to crash. It should exit
+# gracefully with appropriate error.
+#
+# ==== References ====
+#
+# MDEV-18046:Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
+
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+
+RESET MASTER;
+call mtr.add_suppression("Error in Log_event::read_log_event*");
+call mtr.add_suppression("Replication event checksum verification failed while reading from a log file*");
+
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255), c5 CHAR(255));
+INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
+INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
+UPDATE t1 SET c1=repeat('b',255);
+INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
+--let $max_pos= query_get_value(SHOW MASTER STATUS,Position,1)
+--let $pos= 1
+while ($pos <= $max_pos)
+{
+ --disable_query_log
+ --disable_result_log
+ --error 0,1220
+ eval SHOW BINLOG EVENTS FROM $pos LIMIT 100;
+ --inc $pos
+ --enable_result_log
+ --enable_query_log
+}
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog_encryption/binlog_index.result b/mysql-test/suite/binlog_encryption/binlog_index.result
index 02af5e40aab..4b6b4c7fbee 100644
--- a/mysql-test/suite/binlog_encryption/binlog_index.result
+++ b/mysql-test/suite/binlog_encryption/binlog_index.result
@@ -5,6 +5,7 @@ call mtr.add_suppression('Turning logging off for the whole duration of the MySQ
call mtr.add_suppression('Could not use .*');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
+SET @saved_dbug = @@SESSION.debug_dbug;
RESET MASTER;
flush logs;
flush logs;
@@ -183,5 +184,5 @@ master-bin.000011
master-bin.000012
master-bin.000013
-SET SESSION debug_dbug="";
+SET @@SESSION.debug_dbug = @saved_dbug;
End of tests
diff --git a/mysql-test/suite/binlog_encryption/binlog_ioerr.result b/mysql-test/suite/binlog_encryption/binlog_ioerr.result
index 6b3120b6d89..2823b7050c3 100644
--- a/mysql-test/suite/binlog_encryption/binlog_ioerr.result
+++ b/mysql-test/suite/binlog_encryption/binlog_ioerr.result
@@ -2,12 +2,13 @@ CALL mtr.add_suppression("Error writing file 'master-bin'");
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES(0);
+SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug='+d,fail_binlog_write_1';
INSERT INTO t1 VALUES(1);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
INSERT INTO t1 VALUES(2);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
-SET SESSION debug_dbug='';
+SET SESSION debug_dbug=@saved_dbug;
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
a
diff --git a/mysql-test/suite/binlog_encryption/binlog_write_error.result b/mysql-test/suite/binlog_encryption/binlog_write_error.result
index 2606a9f40b3..6e8a212035a 100644
--- a/mysql-test/suite/binlog_encryption/binlog_write_error.result
+++ b/mysql-test/suite/binlog_encryption/binlog_write_error.result
@@ -12,92 +12,109 @@ DROP VIEW IF EXISTS v1, v2;
#
# Test injecting binlog write error when executing queries
#
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE TABLE t1 (a INT);
CREATE TABLE t1 (a INT);
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
INSERT INTO t1 VALUES (1),(2),(3);
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
INSERT INTO t1 VALUES (4),(5),(6);
INSERT INTO t1 VALUES (4),(5),(6);
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
UPDATE t1 set a=a+1;
UPDATE t1 set a=a+1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DELETE FROM t1;
DELETE FROM t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP TRIGGER tr1;
DROP TRIGGER tr1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
ALTER TABLE t1 ADD (b INT);
ALTER TABLE t1 ADD (b INT);
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE VIEW v1 AS SELECT a FROM t1;
CREATE VIEW v1 AS SELECT a FROM t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP VIEW v1;
DROP VIEW v1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP PROCEDURE p1;
DROP PROCEDURE p1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP TABLE t1;
DROP TABLE t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE FUNCTION f1() RETURNS INT return 1;
CREATE FUNCTION f1() RETURNS INT return 1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP FUNCTION f1;
DROP FUNCTION f1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE USER user1;
CREATE USER user1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug='d,injecting_fault_writing';
DROP USER user1;
DROP USER user1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
-SET GLOBAL debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
#
# Cleanup
#
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.result b/mysql-test/suite/binlog_encryption/rpl_checksum.result
index 41c4cd94aff..22220b8e9fb 100644
--- a/mysql-test/suite/binlog_encryption/rpl_checksum.result
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum.result
@@ -76,6 +76,7 @@ connection master;
set @@global.binlog_checksum = CRC32;
insert into t1 values (1) /* will not be applied on slave due to simulation */;
connection slave;
+set @saved_dbug = @@global.debug_dbug;
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
@@ -83,15 +84,16 @@ Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary
select count(*) as zero from t1;
zero
0
-set @@global.debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
connection slave;
include/start_slave.inc
connection master;
set @@global.master_verify_checksum = 1;
+set @save_dbug = @@session.debug_dbug;
set @@session.debug_dbug='d,simulate_checksum_test_failure';
show binlog events;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
-set @@session.debug_dbug='';
+SET debug_dbug= @save_dbug;
set @@global.master_verify_checksum = default;
connection slave;
connection slave;
@@ -99,10 +101,11 @@ include/stop_slave.inc
connection master;
create table t2 (a int);
connection slave;
+set @saved_dbug = @@global.debug_dbug;
set @@global.debug_dbug='d,simulate_checksum_test_failure';
start slave io_thread;
include/wait_for_slave_io_error.inc [errno=1595,1913]
-set @@global.debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
start slave io_thread;
include/wait_for_slave_param.inc [Read_Master_Log_Pos]
set @@global.slave_sql_verify_checksum = 1;
@@ -110,7 +113,7 @@ set @@global.debug_dbug='d,simulate_checksum_test_failure';
start slave sql_thread;
include/wait_for_slave_sql_error.inc [errno=1593]
Last_SQL_Error = 'Error initializing relay log position: I/O error reading event at position 4'
-set @@global.debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
include/start_slave.inc
connection master;
connection slave;
diff --git a/mysql-test/suite/binlog_encryption/rpl_corruption.result b/mysql-test/suite/binlog_encryption/rpl_corruption.result
index 25a82fd60cd..f32b7c58ad1 100644
--- a/mysql-test/suite/binlog_encryption/rpl_corruption.result
+++ b/mysql-test/suite/binlog_encryption/rpl_corruption.result
@@ -13,6 +13,7 @@ connection master;
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
include/stop_slave.inc
# 2. Corruption in master binlog and SHOW BINLOG EVENTS
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
SHOW BINLOG EVENTS;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
@@ -33,10 +34,11 @@ START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1595,1743]
connection master;
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
-SET GLOBAL debug_dbug= "";
+SET GLOBAL debug_dbug=@saved_dbug;
SET GLOBAL master_verify_checksum=1;
# 5. Slave. Corruption in network
connection slave;
+SET @saved_dbug_slave = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,corrupt_queue_event";
START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1595,1743]
@@ -46,7 +48,7 @@ SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
START SLAVE SQL_THREAD;
include/wait_for_slave_sql_error.inc [errno=1593]
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
-SET GLOBAL debug_dbug= "";
+SET GLOBAL debug_dbug=@saved_dbug_slave;
# 7. Seek diff for tables on master and slave
connection slave;
include/start_slave.inc
@@ -55,9 +57,8 @@ connection slave;
include/diff_tables.inc [master:test.t1, slave:test.t1]
# 8. Clean up
connection master;
-SET GLOBAL debug_dbug= "";
+set @@global.debug_dbug = @saved_dbug;
SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
DROP TABLE t1;
connection slave;
-SET GLOBAL debug_dbug= "";
include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_incident.result b/mysql-test/suite/binlog_encryption/rpl_incident.result
index 8fb4aa907cc..6dbe4417c5a 100644
--- a/mysql-test/suite/binlog_encryption/rpl_incident.result
+++ b/mysql-test/suite/binlog_encryption/rpl_incident.result
@@ -14,6 +14,7 @@ a
1
2
3
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
REPLACE INTO t1 VALUES (4);
SELECT * FROM t1;
@@ -22,6 +23,7 @@ a
2
3
4
+set @@global.debug_dbug = @saved_dbug;
connection slave;
call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
include/wait_for_slave_sql_error.inc [errno=1590]
diff --git a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.result b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.result
index 91742814b4c..fc23734c645 100644
--- a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.result
+++ b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.result
@@ -4,12 +4,13 @@ connection slave;
stop slave;
reset slave;
connection slave;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
include/wait_for_slave_sql_error.inc [errno=1593]
Last_SQL_Error = 'Failed during slave thread initialization'
call mtr.add_suppression("Failed during slave.* thread initialization");
-SET GLOBAL debug_dbug= "";
+set @@global.debug_dbug = @saved_dbug;
connection slave;
reset slave;
SET GLOBAL init_slave= "garbage";
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel.result b/mysql-test/suite/binlog_encryption/rpl_parallel.result
index 20f3facea27..12e5455c6c1 100644
--- a/mysql-test/suite/binlog_encryption/rpl_parallel.result
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel.result
@@ -1513,7 +1513,7 @@ SET GLOBAL slave_parallel_threads=10;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
connection server_1;
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10000;
ANALYZE TABLE t2;
@@ -1522,7 +1522,7 @@ test.t2 analyze status OK
INSERT INTO t3 VALUES (120, 0);
SET @commit_id= 10001;
INSERT INTO t3 VALUES (121, 0);
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
a b
120 0
@@ -1544,7 +1544,7 @@ include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
connection server_1;
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @old_server_id= @@SESSION.server_id;
SET SESSION server_id= 100;
@@ -1554,7 +1554,7 @@ SET SESSION server_id= @old_server_id;
INSERT INTO t3 VALUES (130, 0);
SET @commit_id= 10011;
INSERT INTO t3 VALUES (131, 0);
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
a b
130 0
@@ -1580,7 +1580,7 @@ include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_mdev8031';
connection server_1;
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10200;
INSERT INTO t3 VALUES (203, 1);
@@ -1601,7 +1601,7 @@ UPDATE t3 SET b=b+1 WHERE a=204;
UPDATE t3 SET b=b+1 WHERE a=203;
UPDATE t3 SET b=b+1 WHERE a=205;
UPDATE t3 SET b=b+1 WHERE a=205;
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a>=200 ORDER BY a;
a b
201 3
@@ -1631,11 +1631,11 @@ SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill';
SET @old_max= @@GLOBAL.max_relay_log_size;
SET GLOBAL max_relay_log_size= 4096;
connection server_1;
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10210;
Omit long queries that cause relaylog rotations and transaction retries...
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a>=200 ORDER BY a;
a b
201 6
@@ -1655,7 +1655,7 @@ a b
204 7
205 5
include/stop_slave.inc
-SET GLOBAL debug_dbug= @old_debg;
+SET GLOBAL debug_dbug= @old_dbug;
SET GLOBAL max_relay_log_size= @old_max;
include/start_slave.inc
*** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.result b/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.result
index 570d2534ed7..3dd5a3ea83c 100644
--- a/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.result
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.result
@@ -4,7 +4,7 @@ connection server_2;
include/stop_slave.inc
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
-SET @old_dbug= @@GLOBAL.debug_dbug;
+SET @old_debug= @@GLOBAL.debug_dbug;
SET GLOBAL slave_parallel_mode='optimistic';
SET GLOBAL slave_parallel_threads= 3;
CHANGE MASTER TO master_use_gtid=slave_pos;
diff --git a/mysql-test/suite/compat/oracle/r/func_misc.result b/mysql-test/suite/compat/oracle/r/func_misc.result
index f285423b446..ffb9e10110d 100644
--- a/mysql-test/suite/compat/oracle/r/func_misc.result
+++ b/mysql-test/suite/compat/oracle/r/func_misc.result
@@ -32,7 +32,7 @@ CALL p1('SELECT 1');
1
1
'Error1: ' || SQLCODE || ' ' || SQLERRM
-Error1: 0 normal, successful completition
+Error1: 0 normal, successful completion
CALL p1('xxx');
'Error2: ' || SQLCODE || ' ' || SQLERRM
Error2: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
@@ -40,7 +40,7 @@ CALL p1('SELECT 1');
1
1
'Error1: ' || SQLCODE || ' ' || SQLERRM
-Error1: 0 normal, successful completition
+Error1: 0 normal, successful completion
DROP PROCEDURE p1;
#
# SQLCODE and SQLERRM hidden by local variables
@@ -219,7 +219,7 @@ f1()
Exception|1329 No data - zero rows fetched, selected, or processed
SELECT f2() FROM DUAL;
f2()
-Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completition
+Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion
DROP TABLE t1;
DROP FUNCTION f2;
DROP FUNCTION f1;
@@ -246,7 +246,7 @@ f1()
Exception|1329 No data - zero rows fetched, selected, or processed
SELECT f2() FROM DUAL;
f2()
-Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completition
+Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion
DROP TABLE t1;
DROP FUNCTION f2;
DROP FUNCTION f1;
@@ -274,7 +274,7 @@ END;
$$
SELECT f2() FROM DUAL;
f2()
-Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completition
+Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion
DROP FUNCTION f2;
DROP PROCEDURE p1;
DROP TABLE t1;
@@ -299,7 +299,7 @@ END;
$$
SELECT f2() FROM DUAL;
f2()
-Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completition
+Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion
DROP FUNCTION f2;
DROP PROCEDURE p1;
DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-goto-debug.result b/mysql-test/suite/compat/oracle/r/sp-goto-debug.result
new file mode 100644
index 00000000000..3660bfa2d84
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/sp-goto-debug.result
@@ -0,0 +1,236 @@
+SET sql_mode=ORACLE;
+#
+# MDEV-20667 Server crash on pop_cursor
+#
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<< iac_err >>
+RETURN;
+END//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 5(5) 1 = 2
+1 cpush cur1@0
+2 jump 3
+3 cpop 1
+4 jump 7
+5 jump_if_not 7(7) 1 = 1
+6 jump 7
+7 preturn
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<< iac_err >>
+RETURN ;
+END//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 5(5) 1 = 2
+1 cpush cur1@0
+2 jump 3
+3 cpop 1
+4 jump 7
+5 jump_if_not 7(7) 1 = 1
+6 jump 7
+7 preturn
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+GOTO iac_err;
+<< iac_err >>
+RETURN ;
+END//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 5(5) 1 = 2
+1 cpush cur1@0
+2 jump 3
+3 cpop 1
+4 jump 5
+5 preturn
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=1 THEN
+DECLARE
+CURSOR cur2 IS SELECT 'cur2' FROM DUAL;
+BEGIN
+SELECT 'cur2';
+IF 1=1 THEN
+DECLARE
+CURSOR cur3 IS SELECT 'cur3' FROM DUAL;
+BEGIN
+SELECT 'cur3';
+IF 1=1 THEN
+DECLARE
+CURSOR cur4 IS SELECT 'cur4' FROM DUAL;
+BEGIN
+SELECT 'cur4';
+GOTO ret;
+END;
+END IF;
+GOTO ret;
+END;
+END IF;
+GOTO ret;
+END;
+END IF;
+<<ret>>
+RETURN;
+END;
+//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 15(15) 1 = 1
+1 cpush cur2@0
+2 stmt 0 "SELECT 'cur2'"
+3 jump_if_not 13(13) 1 = 1
+4 cpush cur3@1
+5 stmt 0 "SELECT 'cur3'"
+6 jump_if_not 11(11) 1 = 1
+7 cpush cur4@2
+8 stmt 0 "SELECT 'cur4'"
+9 cpop 3
+10 jump 15
+11 cpop 2
+12 jump 15
+13 cpop 1
+14 jump 15
+15 preturn
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(lab VARCHAR(32)) IS
+BEGIN
+IF 1=1 THEN
+DECLARE
+CURSOR cur2 IS SELECT 'cur2' FROM DUAL;
+BEGIN
+IF 1=1 THEN
+DECLARE
+CURSOR cur3 IS SELECT 'cur3' FROM DUAL;
+BEGIN
+IF 1=1 THEN
+DECLARE
+CURSOR cur4 IS SELECT 'cur4' FROM DUAL;
+BEGIN
+IF lab = 'cur4' THEN
+SELECT 'goto from cur4' AS comment;
+GOTO ret;
+END IF;
+END;
+END IF;
+IF lab = 'cur3' THEN
+SELECT 'goto from cur3' AS comment;
+GOTO ret;
+END IF;
+END;
+END IF;
+IF lab = 'cur2' THEN
+SELECT 'goto from cur2' AS comment;
+GOTO ret;
+END IF;
+END;
+END IF;
+<<ret>>
+RETURN;
+END;
+//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 21(21) 1 = 1
+1 cpush cur2@0
+2 jump_if_not 16(16) 1 = 1
+3 cpush cur3@1
+4 jump_if_not 11(11) 1 = 1
+5 cpush cur4@2
+6 jump_if_not 10(10) lab@0 = 'cur4'
+7 stmt 0 "SELECT 'goto from cur4' AS comment"
+8 cpop 3
+9 jump 21
+10 cpop 1
+11 jump_if_not 15(15) lab@0 = 'cur3'
+12 stmt 0 "SELECT 'goto from cur3' AS comment"
+13 cpop 2
+14 jump 21
+15 cpop 1
+16 jump_if_not 20(20) lab@0 = 'cur2'
+17 stmt 0 "SELECT 'goto from cur2' AS comment"
+18 cpop 1
+19 jump 21
+20 cpop 1
+21 preturn
+CALL p1('');
+CALL p1('cur2');
+comment
+goto from cur2
+CALL p1('cur3');
+comment
+goto from cur3
+CALL p1('cur4');
+comment
+goto from cur4
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2 = 1;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<<iac_err >>
+RETURN;
+END//
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 jump_if_not 9(9) 1 = 2
+1 hpush_jump 4 0 CONTINUE
+2 stmt 31 "SET @x2 = 1"
+3 hreturn 0
+4 hpop 1
+5 jump 11
+6 jump 11
+7 hpop 1
+8 jump 9
+9 jump_if_not 11(11) 1 = 1
+10 jump 11
+11 preturn
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-goto.result b/mysql-test/suite/compat/oracle/r/sp-goto.result
index 259be7a34e6..badda507ee4 100644
--- a/mysql-test/suite/compat/oracle/r/sp-goto.result
+++ b/mysql-test/suite/compat/oracle/r/sp-goto.result
@@ -832,3 +832,82 @@ a
15
DROP TRIGGER trg1;
DROP TABLE t1;
+#
+# MDEV-20667 Server crash on pop_cursor
+#
+CREATE TABLE t1 (a VARCHAR(6));
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<< iac_err >>
+RETURN;
+END//
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<< iac_err >>
+RETURN ;
+END//
+CALL p1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CURSOR cur1 IS SELECT a FROM t1 ;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+GOTO iac_err;
+<< iac_err >>
+RETURN ;
+END//
+CALL p1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1() IS
+BEGIN
+IF 1=2 THEN
+BEGIN
+DECLARE
+CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2 = 1;
+BEGIN
+GOTO iac_err;
+END;
+END;
+END IF;
+IF 1=1 THEN
+GOTO iac_err;
+END IF;
+<<iac_err >>
+RETURN;
+END//
+CALL p1;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-security.result b/mysql-test/suite/compat/oracle/r/sp-package-security.result
index 6cb580e0c46..c08b78cb8cf 100644
--- a/mysql-test/suite/compat/oracle/r/sp-package-security.result
+++ b/mysql-test/suite/compat/oracle/r/sp-package-security.result
@@ -132,15 +132,15 @@ END;
$$
SHOW GRANTS;
Grants for u1@localhost
-GRANT USAGE ON *.* TO 'u1'@'localhost'
-GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
-GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE "db1"."p1" TO 'u1'@'localhost'
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE "db1"."p1" TO "u1"@"localhost"
CALL p1;
DROP PROCEDURE p1;
SHOW GRANTS;
Grants for u1@localhost
-GRANT USAGE ON *.* TO 'u1'@'localhost'
-GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
#
# Now u1 can also CREATE, DROP its own package specifications
#
@@ -157,14 +157,14 @@ FUNCTION f1 RETURN TEXT;
END latin1 latin1_swedish_ci latin1_swedish_ci
SHOW GRANTS;
Grants for u1@localhost
-GRANT USAGE ON *.* TO 'u1'@'localhost'
-GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
-GRANT EXECUTE, ALTER ROUTINE ON PACKAGE "db1"."pkg2" TO 'u1'@'localhost'
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+GRANT EXECUTE, ALTER ROUTINE ON PACKAGE "db1"."pkg2" TO "u1"@"localhost"
DROP PACKAGE pkg2;
SHOW GRANTS;
Grants for u1@localhost
-GRANT USAGE ON *.* TO 'u1'@'localhost'
-GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
#
# Now u1 can also CREATE, DROP package bodies and EXECUTE package body routines
#
@@ -184,9 +184,9 @@ FUNCTION f1 RETURN TEXT AS BEGIN RETURN 'This is pkg1.f1'; END;
END latin1 latin1_swedish_ci latin1_swedish_ci
SHOW GRANTS;
Grants for u1@localhost
-GRANT USAGE ON *.* TO 'u1'@'localhost'
-GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
-GRANT EXECUTE, ALTER ROUTINE ON PACKAGE BODY "db1"."pkg1" TO 'u1'@'localhost'
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+GRANT EXECUTE, ALTER ROUTINE ON PACKAGE BODY "db1"."pkg1" TO "u1"@"localhost"
CALL pkg1.p1;
comment
This is pkg1.p1
@@ -196,8 +196,8 @@ This is pkg1.f1
DROP PACKAGE BODY pkg1;
SHOW GRANTS;
Grants for u1@localhost
-GRANT USAGE ON *.* TO 'u1'@'localhost'
-GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
#
# Now create a PACKAGE BODY by root.
# u1 does not have EXECUTE access by default.
@@ -232,9 +232,9 @@ u1@localhost
SET sql_mode=ORACLE;
SHOW GRANTS;
Grants for u1@localhost
-GRANT USAGE ON *.* TO 'u1'@'localhost'
-GRANT SELECT, CREATE ROUTINE ON "db1".* TO 'u1'@'localhost'
-GRANT EXECUTE ON PACKAGE BODY "db1"."pkg1" TO 'u1'@'localhost'
+GRANT USAGE ON *.* TO "u1"@"localhost"
+GRANT SELECT, CREATE ROUTINE ON "db1".* TO "u1"@"localhost"
+GRANT EXECUTE ON PACKAGE BODY "db1"."pkg1" TO "u1"@"localhost"
CALL pkg1.p1;
comment
This is pkg1.p1
diff --git a/mysql-test/suite/compat/oracle/t/sp-goto-debug.test b/mysql-test/suite/compat/oracle/t/sp-goto-debug.test
new file mode 100644
index 00000000000..0ded370b17a
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/sp-goto-debug.test
@@ -0,0 +1,178 @@
+-- source include/have_debug.inc
+
+SET sql_mode=ORACLE;
+
+--echo #
+--echo # MDEV-20667 Server crash on pop_cursor
+--echo #
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<< iac_err >>
+ RETURN;
+END//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<< iac_err >>
+ RETURN ;
+END//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ GOTO iac_err;
+<< iac_err >>
+ RETURN ;
+END//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur2 IS SELECT 'cur2' FROM DUAL;
+ BEGIN
+ SELECT 'cur2';
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur3 IS SELECT 'cur3' FROM DUAL;
+ BEGIN
+ SELECT 'cur3';
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur4 IS SELECT 'cur4' FROM DUAL;
+ BEGIN
+ SELECT 'cur4';
+ GOTO ret;
+ END;
+ END IF;
+ GOTO ret;
+ END;
+ END IF;
+ GOTO ret;
+ END;
+ END IF;
+<<ret>>
+ RETURN;
+END;
+//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1(lab VARCHAR(32)) IS
+BEGIN
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur2 IS SELECT 'cur2' FROM DUAL;
+ BEGIN
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur3 IS SELECT 'cur3' FROM DUAL;
+ BEGIN
+ IF 1=1 THEN
+ DECLARE
+ CURSOR cur4 IS SELECT 'cur4' FROM DUAL;
+ BEGIN
+ IF lab = 'cur4' THEN
+ SELECT 'goto from cur4' AS comment;
+ GOTO ret;
+ END IF;
+ END;
+ END IF;
+ IF lab = 'cur3' THEN
+ SELECT 'goto from cur3' AS comment;
+ GOTO ret;
+ END IF;
+ END;
+ END IF;
+ IF lab = 'cur2' THEN
+ SELECT 'goto from cur2' AS comment;
+ GOTO ret;
+ END IF;
+ END;
+ END IF;
+<<ret>>
+ RETURN;
+END;
+//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+CALL p1('');
+CALL p1('cur2');
+CALL p1('cur3');
+CALL p1('cur4');
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2 = 1;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<<iac_err >>
+ RETURN;
+END//
+DELIMITER ;//
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-goto.test b/mysql-test/suite/compat/oracle/t/sp-goto.test
index df7f1132666..9c15d10b3de 100644
--- a/mysql-test/suite/compat/oracle/t/sp-goto.test
+++ b/mysql-test/suite/compat/oracle/t/sp-goto.test
@@ -869,4 +869,100 @@ insert into t1 values (1);
insert into t1 values (null);
SELECT * FROM t1;
DROP TRIGGER trg1;
-DROP TABLE t1; \ No newline at end of file
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-20667 Server crash on pop_cursor
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(6));
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<< iac_err >>
+ RETURN;
+END//
+DELIMITER ;//
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<< iac_err >>
+ RETURN ;
+END//
+DELIMITER ;//
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CURSOR cur1 IS SELECT a FROM t1 ;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ GOTO iac_err;
+<< iac_err >>
+ RETURN ;
+END//
+DELIMITER ;//
+CALL p1;
+DROP PROCEDURE p1;
+
+
+DELIMITER //;
+CREATE PROCEDURE p1() IS
+BEGIN
+ IF 1=2 THEN
+ BEGIN
+ DECLARE
+ CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2 = 1;
+ BEGIN
+ GOTO iac_err;
+ END;
+ END;
+ END IF;
+ IF 1=1 THEN
+ GOTO iac_err;
+ END IF;
+<<iac_err >>
+ RETURN;
+END//
+DELIMITER ;//
+CALL p1;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result
index 84dcb0d0a8c..8345f56dba9 100644
--- a/mysql-test/suite/federated/federatedx.result
+++ b/mysql-test/suite/federated/federatedx.result
@@ -2283,6 +2283,22 @@ connection default;
connection master;
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:SLAVE_PORT/federated/t1';
ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: '' hostname: '127.0.0.1'
+#
+# MDEV-21049 Segfault in create federatedx table with empty hostname
+#
+connection master;
+CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
+CONNECTION='mysql://root@:SLAVE_PORT/federated/t1';
+ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: 'root' hostname: 'localhost'
+connection slave;
+CREATE TABLE federated.t1(x int);
+connection master;
+CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
+CONNECTION='mysql://root@:SLAVE_PORT/federated/t1';
+DROP TABLE federated.t1;
+connection slave;
+DROP TABLE federated.t1;
+connection default;
connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federatedx.test b/mysql-test/suite/federated/federatedx.test
index 29d1eaddc26..fcc0178c024 100644
--- a/mysql-test/suite/federated/federatedx.test
+++ b/mysql-test/suite/federated/federatedx.test
@@ -2010,4 +2010,25 @@ connection master;
--error ER_CANT_CREATE_FEDERATED_TABLE
eval CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+--echo #
+--echo # MDEV-21049 Segfault in create federatedx table with empty hostname
+--echo #
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--error ER_CANT_CREATE_FEDERATED_TABLE
+eval CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
+ CONNECTION='mysql://root@:$SLAVE_MYPORT/federated/t1';
+
+connection slave;
+CREATE TABLE federated.t1(x int);
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE federated.t1 (x int) ENGINE=FEDERATED
+ CONNECTION='mysql://root@:$SLAVE_MYPORT/federated/t1';
+
+DROP TABLE federated.t1;
+connection slave;
+DROP TABLE federated.t1;
+connection default;
+
source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03.result b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
index be235c2d4ae..9f9bf1ca4de 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
@@ -78,14 +78,14 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -168,12 +168,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_424a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection no_privs_424a;
@@ -183,7 +183,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -209,7 +209,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
connection default;
@@ -233,22 +233,22 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_424b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
@@ -276,8 +276,8 @@ drop trigger trg4b_1;
connection yes_privs_424b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
@@ -314,22 +314,22 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_424c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
@@ -349,8 +349,8 @@ drop trigger trg4c_1;
connection yes_privs_424c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
@@ -377,21 +377,21 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
connect no_privs_424d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
@@ -412,8 +412,8 @@ drop trigger trg4d_1;
connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
@@ -441,12 +441,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_425a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -457,7 +457,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
@@ -478,7 +478,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
@@ -502,23 +502,23 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_425b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -537,8 +537,8 @@ drop trigger trg5b_1;
connection yes_privs_425b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -564,23 +564,23 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_425c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -595,8 +595,8 @@ drop trigger trg5c_1;
connection yes_privs_425c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -617,23 +617,23 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -648,8 +648,8 @@ drop trigger trg5d_1;
connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -674,9 +674,9 @@ grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect yes_353x,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_353x;
select current_user;
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
index aea34df6356..c869b5cc5bc 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
@@ -14,16 +14,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant select on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant select,insert on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on db level for create:
@@ -45,8 +45,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -96,8 +96,8 @@ root@localhost
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
no trigger privilege on db level for drop:
------------------------------------------
@@ -152,8 +152,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
@@ -182,9 +182,9 @@ create table t1 (f1 char(20)) engine= innodb;
grant SELECT,UPDATE on no_priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `no_priv_db`.* TO `test_yesprivs`@`localhost`
use db with trigger privilege on db level and without...:
---------------------------------------------------------
@@ -285,13 +285,13 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant select, update, insert on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -329,8 +329,8 @@ insert2-yes
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -366,8 +366,8 @@ trig 1_2-yes
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
no trigger privilege on table level for drop:
---------------------------------------------
@@ -421,8 +421,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
connection no_privs;
select current_user;
@@ -458,15 +458,15 @@ create table t2 (f1 char(20)) engine= innodb;
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_noprivs`@`localhost`
use table with trigger privilege and without...:
------------------------------------------------
@@ -543,14 +543,14 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant ALL on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_privs;
@@ -603,7 +603,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
disconnect yes_privs;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
@@ -622,7 +622,7 @@ current_user
root@localhost
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop trigger trg1_1;
use priv_db;
@@ -656,8 +656,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -720,7 +720,7 @@ trig 1_2-yes
grant TRIGGER on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connection yes_privs;
select current_user;
current_user
@@ -811,9 +811,9 @@ grant ALL on priv1_db.* to test_yesprivs@localhost;
grant SELECT,UPDATE on priv2_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
@@ -821,9 +821,9 @@ grant SELECT,INSERT,UPDATE on priv1_db.* to test_noprivs@localhost;
grant SELECT,INSERT on priv2_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT ON `priv2_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -888,9 +888,9 @@ revoke TRIGGER on priv1_db.t1 from test_yesprivs@localhost;
ERROR 42000: There is no such grant defined for user 'test_yesprivs' on host 'localhost' on table 't1'
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -928,10 +928,10 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -976,10 +976,10 @@ root@localhost
grant TRIGGER on priv1_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1069,8 +1069,8 @@ grant select
on priv_db.t1 to test_useprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1103,8 +1103,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1134,8 +1134,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1166,8 +1166,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1199,8 +1199,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1233,8 +1233,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1272,8 +1272,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1336,8 +1336,8 @@ grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1379,9 +1379,9 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost` WITH GRANT OPTION
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
@@ -1416,8 +1416,8 @@ grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1474,16 +1474,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,UPDATE on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -1539,10 +1539,10 @@ revoke UPDATE(f1) on priv_db.t2
from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1691,9 +1691,9 @@ grant TRIGGER,UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1734,9 +1734,9 @@ grant UPDATE(f1),UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection no_privs;
select current_user;
current_user
diff --git a/mysql-test/suite/funcs_1/r/is_basics_mixed.result b/mysql-test/suite/funcs_1/r/is_basics_mixed.result
index 235022e3f43..95fc5ae59c3 100644
--- a/mysql-test/suite/funcs_1/r/is_basics_mixed.result
+++ b/mysql-test/suite/funcs_1/r/is_basics_mixed.result
@@ -128,7 +128,7 @@ CREATE USER 'testuser1'@'localhost';
GRANT ALL ON *.* TO testuser1@localhost;
SHOW GRANTS FOR testuser1@localhost;
Grants for testuser1@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'testuser1'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO `testuser1`@`localhost`
connect testuser1, localhost, testuser1, , test;
USE information_schema;
CREATE TABLE schemata ( c1 INT );
diff --git a/mysql-test/suite/funcs_1/r/is_check_constraint.result b/mysql-test/suite/funcs_1/r/is_check_constraint.result
deleted file mode 100644
index be44a8867e8..00000000000
--- a/mysql-test/suite/funcs_1/r/is_check_constraint.result
+++ /dev/null
@@ -1,121 +0,0 @@
-#
-# MDEV-17323: Backport INFORMATION_SCHEMA.CHECK_CONSTRAINTS to 10.2
-#
-CREATE user boo1;
-GRANT select,create,alter,drop on foo.* to boo1;
-SHOW GRANTS for boo1;
-Grants for boo1@%
-GRANT USAGE ON *.* TO 'boo1'@'%'
-GRANT SELECT, CREATE, DROP, ALTER ON `foo`.* TO 'boo1'@'%'
-CREATE user boo2;
-create database foo;
-CONNECT con1,localhost, boo1,, foo;
-SET check_constraint_checks=1;
-CREATE TABLE t0
-(
-t int, check (t>32) # table constraint
-) ENGINE=myisam;
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def foo CONSTRAINT_1 t0 `t` > 32
-ALTER TABLE t0
-ADD CONSTRAINT CHK_t0_t CHECK(t<100);
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def foo CHK_t0_t t0 `t` < 100
-def foo CONSTRAINT_1 t0 `t` > 32
-ALTER TABLE t0
-DROP CONSTRAINT CHK_t0_t;
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def foo CONSTRAINT_1 t0 `t` > 32
-ALTER TABLE t0
-ADD CONSTRAINT CHECK(t<50);
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def foo CONSTRAINT_1 t0 `t` > 32
-def foo CONSTRAINT_2 t0 `t` < 50
-CREATE TABLE t1
-( t int CHECK(t>2), # field constraint
-tt int,
-CONSTRAINT CHECK (tt > 32), CONSTRAINT CHECK (tt <50),# autogenerated names table constraints
-CONSTRAINT CHK_tt CHECK(tt<100) # named table constraint
-) ENGINE=InnoDB;
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def foo CHK_tt t1 `tt` < 100
-def foo CONSTRAINT_1 t0 `t` > 32
-def foo CONSTRAINT_1 t1 `tt` > 32
-def foo CONSTRAINT_2 t0 `t` < 50
-def foo CONSTRAINT_2 t1 `tt` < 50
-def foo t t1 `t` > 2
-ALTER TABLE t1
-DROP CONSTRAINT CHK_tt;
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def foo CONSTRAINT_1 t0 `t` > 32
-def foo CONSTRAINT_1 t1 `tt` > 32
-def foo CONSTRAINT_2 t0 `t` < 50
-def foo CONSTRAINT_2 t1 `tt` < 50
-def foo t t1 `t` > 2
-CREATE TABLE t2
-(
-name VARCHAR(30) CHECK(CHAR_LENGTH(name)>2), #field constraint
-start_date DATE,
-end_date DATE,
-CONSTRAINT CHK_dates CHECK(start_date IS NULL) #table constraint
-)ENGINE=Innodb;
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def foo CHK_dates t2 `start_date` is null
-def foo CONSTRAINT_1 t0 `t` > 32
-def foo CONSTRAINT_1 t1 `tt` > 32
-def foo CONSTRAINT_2 t0 `t` < 50
-def foo CONSTRAINT_2 t1 `tt` < 50
-def foo name t2 char_length(`name`) > 2
-def foo t t1 `t` > 2
-ALTER TABLE t1
-ADD CONSTRAINT CHK_new_ CHECK(t>tt);
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def foo CHK_dates t2 `start_date` is null
-def foo CHK_new_ t1 `t` > `tt`
-def foo CONSTRAINT_1 t0 `t` > 32
-def foo CONSTRAINT_1 t1 `tt` > 32
-def foo CONSTRAINT_2 t0 `t` < 50
-def foo CONSTRAINT_2 t1 `tt` < 50
-def foo name t2 char_length(`name`) > 2
-def foo t t1 `t` > 2
-CREATE TABLE t3
-(
-a int,
-b int check (b>0), # field constraint named 'b'
-CONSTRAINT b check (b>10) # table constraint
-) ENGINE=InnoDB;
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def foo CHK_dates t2 `start_date` is null
-def foo CHK_new_ t1 `t` > `tt`
-def foo CONSTRAINT_1 t0 `t` > 32
-def foo CONSTRAINT_1 t1 `tt` > 32
-def foo CONSTRAINT_2 t0 `t` < 50
-def foo CONSTRAINT_2 t1 `tt` < 50
-def foo b t3 `b` > 0
-def foo b t3 `b` > 10
-def foo name t2 char_length(`name`) > 2
-def foo t t1 `t` > 2
-disconnect con1;
-CONNECT con2, localhost, boo2,, test;
-SELECT * from information_schema.check_constraints;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-disconnect con2;
-CONNECT con1, localhost, boo1,,foo;
-DROP TABLE t0;
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-DROP DATABASE foo;
-disconnect con1;
-connection default;
-DROP USER boo1;
-DROP USER boo2;
diff --git a/mysql-test/suite/funcs_1/r/is_check_constraints.result b/mysql-test/suite/funcs_1/r/is_check_constraints.result
index 678cfb8db2f..1b54135e355 100644
--- a/mysql-test/suite/funcs_1/r/is_check_constraints.result
+++ b/mysql-test/suite/funcs_1/r/is_check_constraints.result
@@ -1,144 +1,147 @@
#
# MDEV-14474: Create INFORMATION_SCHEMA.CHECK_CONSTRAINTS
#
-set check_constraint_checks=1;
-use test;
-create table t0
+CREATE user boo1;
+GRANT select,create,alter,drop on foo.* to boo1;
+SHOW GRANTS for boo1;
+Grants for boo1@%
+GRANT USAGE ON *.* TO `boo1`@`%`
+GRANT SELECT, CREATE, DROP, ALTER ON `foo`.* TO `boo1`@`%`
+CREATE user boo2;
+create database foo;
+CONNECT con1,localhost, boo1,, foo;
+SET check_constraint_checks=1;
+CREATE TABLE t0
(
t int, check (t>32) # table constraint
) ENGINE=myisam;
-SELECT * from information_schema.check_constraints order by check_clause;
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CONSTRAINT_1
-TABLE_NAME t0
-CHECK_CLAUSE `t` > 32
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def foo t0 CONSTRAINT_1 `t` > 32
ALTER TABLE t0
ADD CONSTRAINT CHK_t0_t CHECK(t<100);
-SELECT * from information_schema.check_constraints order by check_clause;
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CHK_t0_t
-TABLE_NAME t0
-CHECK_CLAUSE `t` < 100
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CONSTRAINT_1
-TABLE_NAME t0
-CHECK_CLAUSE `t` > 32
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def foo t0 CHK_t0_t `t` < 100
+def foo t0 CONSTRAINT_1 `t` > 32
ALTER TABLE t0
DROP CONSTRAINT CHK_t0_t;
-SELECT * from information_schema.check_constraints order by check_clause;
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CONSTRAINT_1
-TABLE_NAME t0
-CHECK_CLAUSE `t` > 32
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def foo t0 CONSTRAINT_1 `t` > 32
+ALTER TABLE t0
+ADD CONSTRAINT CHECK(t<50);
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def foo t0 CONSTRAINT_1 `t` > 32
+def foo t0 CONSTRAINT_2 `t` < 50
CREATE TABLE t1
( t int CHECK(t>2), # field constraint
-tt int, CONSTRAINT CHK_tt CHECK(tt<100) # table constraint
+tt int,
+CONSTRAINT CHECK (tt > 32), CONSTRAINT CHECK (tt <50),# autogenerated names table constraints
+CONSTRAINT CHK_tt CHECK(tt<100) # named table constraint
) ENGINE=InnoDB;
-SELECT * from information_schema.check_constraints order by check_clause;
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CHK_tt
-TABLE_NAME t1
-CHECK_CLAUSE `tt` < 100
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME t
-TABLE_NAME t1
-CHECK_CLAUSE `t` > 2
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CONSTRAINT_1
-TABLE_NAME t0
-CHECK_CLAUSE `t` > 32
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def foo t0 CONSTRAINT_1 `t` > 32
+def foo t0 CONSTRAINT_2 `t` < 50
+def foo t1 CHK_tt `tt` < 100
+def foo t1 CONSTRAINT_1 `tt` > 32
+def foo t1 CONSTRAINT_2 `tt` < 50
+def foo t1 t `t` > 2
ALTER TABLE t1
DROP CONSTRAINT CHK_tt;
-SELECT * from information_schema.check_constraints order by check_clause;
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME t
-TABLE_NAME t1
-CHECK_CLAUSE `t` > 2
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CONSTRAINT_1
-TABLE_NAME t0
-CHECK_CLAUSE `t` > 32
-create table t2
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def foo t0 CONSTRAINT_1 `t` > 32
+def foo t0 CONSTRAINT_2 `t` < 50
+def foo t1 CONSTRAINT_1 `tt` > 32
+def foo t1 CONSTRAINT_2 `tt` < 50
+def foo t1 t `t` > 2
+CREATE TABLE t2
(
name VARCHAR(30) CHECK(CHAR_LENGTH(name)>2), #field constraint
start_date DATE,
end_date DATE,
CONSTRAINT CHK_dates CHECK(start_date IS NULL) #table constraint
)ENGINE=Innodb;
-SELECT * from information_schema.check_constraints order by check_clause;
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME name
-TABLE_NAME t2
-CHECK_CLAUSE char_length(`name`) > 2
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CHK_dates
-TABLE_NAME t2
-CHECK_CLAUSE `start_date` is null
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME t
-TABLE_NAME t1
-CHECK_CLAUSE `t` > 2
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CONSTRAINT_1
-TABLE_NAME t0
-CHECK_CLAUSE `t` > 32
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def foo t0 CONSTRAINT_1 `t` > 32
+def foo t0 CONSTRAINT_2 `t` < 50
+def foo t1 CONSTRAINT_1 `tt` > 32
+def foo t1 CONSTRAINT_2 `tt` < 50
+def foo t1 t `t` > 2
+def foo t2 CHK_dates `start_date` is null
+def foo t2 name char_length(`name`) > 2
ALTER TABLE t1
ADD CONSTRAINT CHK_new_ CHECK(t>tt);
-SELECT * from information_schema.check_constraints order by check_clause;
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME name
-TABLE_NAME t2
-CHECK_CLAUSE char_length(`name`) > 2
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CHK_dates
-TABLE_NAME t2
-CHECK_CLAUSE `start_date` is null
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME t
-TABLE_NAME t1
-CHECK_CLAUSE `t` > 2
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CONSTRAINT_1
-TABLE_NAME t0
-CHECK_CLAUSE `t` > 32
-CONSTRAINT_CATALOG def
-CONSTRAINT_SCHEMA test
-CONSTRAINT_NAME CHK_new_
-TABLE_NAME t1
-CHECK_CLAUSE `t` > `tt`
-create table t3
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def foo t0 CONSTRAINT_1 `t` > 32
+def foo t0 CONSTRAINT_2 `t` < 50
+def foo t1 CHK_new_ `t` > `tt`
+def foo t1 CONSTRAINT_1 `tt` > 32
+def foo t1 CONSTRAINT_2 `tt` < 50
+def foo t1 t `t` > 2
+def foo t2 CHK_dates `start_date` is null
+def foo t2 name char_length(`name`) > 2
+CREATE TABLE t3
(
a int,
b int check (b>0), # field constraint named 'b'
CONSTRAINT b check (b>10) # table constraint
) ENGINE=InnoDB;
-select * from information_schema.check_constraints order by check_clause;
-CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_NAME CHECK_CLAUSE
-def test name t2 char_length(`name`) > 2
-def test b t3 `b` > 0
-def test b t3 `b` > 10
-def test CHK_dates t2 `start_date` is null
-def test t t1 `t` > 2
-def test CONSTRAINT_1 t0 `t` > 32
-def test CHK_new_ t1 `t` > `tt`
-drop table t0;
-drop table t1;
-drop table t2;
-drop table t3;
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def foo t0 CONSTRAINT_1 `t` > 32
+def foo t0 CONSTRAINT_2 `t` < 50
+def foo t1 CHK_new_ `t` > `tt`
+def foo t1 CONSTRAINT_1 `tt` > 32
+def foo t1 CONSTRAINT_2 `tt` < 50
+def foo t1 t `t` > 2
+def foo t2 CHK_dates `start_date` is null
+def foo t2 name char_length(`name`) > 2
+def foo t3 b `b` > 0
+def foo t3 b `b` > 10
+disconnect con1;
+CONNECT con2, localhost, boo2,, test;
+SELECT * from information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+disconnect con2;
+CONNECT con1, localhost, boo1,,foo;
+DROP TABLE t0;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP DATABASE foo;
+disconnect con1;
+connection default;
+DROP USER boo1;
+DROP USER boo2;
+#
+# MDEV-18440: Information_schema.check_constraints possible data leak
+#
+CREATE USER foo;
+CREATE DATABASE db;
+USE db;
+CREATE TABLE t1 (a int, b int, CONSTRAINT CHECK (b > 0));
+INSERT INTO t1 VALUES (1, 2), (2, 3);
+GRANT SELECT (a) ON t1 TO foo;
+SHOW GRANTS FOR foo;
+Grants for foo@%
+GRANT USAGE ON *.* TO `foo`@`%`
+GRANT SELECT (a) ON `db`.`t1` TO `foo`@`%`
+SELECT * FROM information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+def db t1 CONSTRAINT_1 `b` > 0
+CONNECT con1,localhost, foo,, db;
+SELECT a FROM t1;
+a
+1
+2
+SELECT * FROM information_schema.check_constraints;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
+connection default;
+DROP USER foo;
+DROP DATABASE db;
diff --git a/mysql-test/suite/funcs_1/r/is_column_privileges.result b/mysql-test/suite/funcs_1/r/is_column_privileges.result
index c835864e738..b6be9118048 100644
--- a/mysql-test/suite/funcs_1/r/is_column_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_column_privileges.result
@@ -196,8 +196,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -205,8 +205,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connection default;
GRANT SELECT (f1,f3) ON db_datadict.my_table TO 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
@@ -217,9 +217,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -229,9 +229,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
ALTER TABLE db_datadict.my_table DROP COLUMN f3;
GRANT UPDATE (f1) ON db_datadict.my_table TO 'testuser1'@'localhost';
@@ -244,9 +244,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -257,9 +257,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
SELECT f1, f3 FROM db_datadict.my_table;
ERROR 42S22: Unknown column 'f3' in 'field list'
connection default;
@@ -273,9 +273,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -286,9 +286,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
DROP TABLE db_datadict.my_table;
SELECT * FROM information_schema.column_privileges
@@ -300,9 +300,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -313,9 +313,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict my_table f3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
+GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
REVOKE ALL ON db_datadict.my_table FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
@@ -324,8 +324,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -333,8 +333,8 @@ ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
connection default;
disconnect testuser1;
DROP USER 'testuser1'@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index dfaa5d75137..808836ab119 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -26,9 +26,9 @@ def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NU
def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select NEVER NULL
-def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
+def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
-def information_schema CHECK_CONSTRAINTS TABLE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
+def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
def information_schema CLIENT_STATISTICS BUSY_TIME 5 0 NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL
@@ -564,8 +564,8 @@ COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH C
NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(3)
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema CHECK_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema CLIENT_STATISTICS CLIENT varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index 96fb1e286c0..ca3cac7f0fc 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -26,9 +26,9 @@ def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NU
def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) NEVER NULL
-def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
+def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
-def information_schema CHECK_CONSTRAINTS TABLE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
+def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
def information_schema CLIENT_STATISTICS BUSY_TIME 5 0 NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL
@@ -564,8 +564,8 @@ COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH C
NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(3)
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
-3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema CHECK_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
+3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema CLIENT_STATISTICS CLIENT varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
diff --git a/mysql-test/suite/funcs_1/r/is_schema_privileges.result b/mysql-test/suite/funcs_1/r/is_schema_privileges.result
index 3daac8b2c5f..8669b2873ed 100644
--- a/mysql-test/suite/funcs_1/r/is_schema_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_schema_privileges.result
@@ -124,10 +124,10 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict_4 SELECT YES
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT INSERT ON `db_datadict_1`.* TO 'testuser1'@'localhost'
-GRANT SELECT ON `db_datadict_4`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT INSERT ON `db_datadict_2`.`t1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT INSERT ON `db_datadict_1`.* TO `testuser1`@`localhost`
+GRANT SELECT ON `db_datadict_4`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT INSERT ON `db_datadict_2`.`t1` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connect testuser2, localhost, testuser2, , test;
@@ -147,10 +147,10 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_3`.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_1`.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_4`.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_3`.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_1`.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_4`.* TO `testuser2`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
@@ -165,16 +165,16 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser2'@'localhost' def db_datadict_4 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT INSERT ON `db_datadict_1`.* TO 'testuser1'@'localhost'
-GRANT SELECT ON `db_datadict_4`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT INSERT ON `db_datadict_2`.`t1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT INSERT ON `db_datadict_1`.* TO `testuser1`@`localhost`
+GRANT SELECT ON `db_datadict_4`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT INSERT ON `db_datadict_2`.`t1` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_3`.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_1`.* TO 'testuser2'@'localhost'
-GRANT SELECT ON `db_datadict_4`.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_3`.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_1`.* TO `testuser2`@`localhost`
+GRANT SELECT ON `db_datadict_4`.* TO `testuser2`@`localhost`
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP DATABASE db_datadict_1;
diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result
index 419eb0b4b4c..76f3b03d018 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result
@@ -196,10 +196,10 @@ def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
@@ -207,7 +207,7 @@ ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connect testuser2, localhost, testuser2, , test;
@@ -219,7 +219,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
connection default;
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost' WITH GRANT OPTION;
GRANT SELECT(f1,f5) ON db_datadict_2.t3 TO 'testuser1'@'localhost';
@@ -239,12 +239,12 @@ def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
connection testuser1;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
@@ -258,9 +258,9 @@ def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connection testuser2;
@@ -272,13 +272,13 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
connection default;
REVOKE SELECT,GRANT OPTION ON db_datadict.t1 FROM 'testuser1'@'localhost';
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
@@ -290,8 +290,8 @@ def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints.result b/mysql-test/suite/funcs_1/r/is_table_constraints.result
index d968d3b65de..a5f7b39d166 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result
@@ -109,8 +109,8 @@ CREATE USER 'testuser1'@'localhost';
GRANT SELECT(f5) ON db_datadict.t1 TO 'testuser1'@'localhost';
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT (f5) ON `db_datadict`.`t1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT (f5) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
@@ -133,8 +133,8 @@ t2 0 PRIMARY 2 f2 ### ### ### ### ### ### ###
connect testuser1, localhost, testuser1, , db_datadict;
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT (f5) ON `db_datadict`.`t1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT (f5) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
diff --git a/mysql-test/suite/funcs_1/r/is_table_privileges.result b/mysql-test/suite/funcs_1/r/is_table_privileges.result
index 1d54ef75297..2c0942f44f1 100644
--- a/mysql-test/suite/funcs_1/r/is_table_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_table_privileges.result
@@ -84,9 +84,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict tb1 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT, CREATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `db_datadict`.`tb1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT, CREATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `db_datadict`.`tb1` TO `testuser1`@`localhost`
connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
@@ -107,8 +107,8 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser2'@'localhost' def db_datadict tb1 UPDATE YES
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO 'testuser2'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO `testuser2`@`localhost` WITH GRANT OPTION
connect testuser3, localhost, testuser3, , db_datadict;
SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
@@ -117,8 +117,8 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser3'@'localhost' def db_datadict tb3 SELECT NO
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
-GRANT USAGE ON *.* TO 'testuser3'@'localhost'
-GRANT SELECT ON `db_datadict`.`tb3` TO 'testuser3'@'localhost'
+GRANT USAGE ON *.* TO `testuser3`@`localhost`
+GRANT SELECT ON `db_datadict`.`tb3` TO `testuser3`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
@@ -144,17 +144,17 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser3'@'localhost' def db_datadict tb3 SELECT NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT, CREATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `db_datadict`.`tb1` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT, CREATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `db_datadict`.`tb1` TO `testuser1`@`localhost`
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO 'testuser2'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO `testuser2`@`localhost` WITH GRANT OPTION
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
-GRANT USAGE ON *.* TO 'testuser3'@'localhost'
-GRANT SELECT ON `db_datadict`.`tb3` TO 'testuser3'@'localhost'
+GRANT USAGE ON *.* TO `testuser3`@`localhost`
+GRANT SELECT ON `db_datadict`.`tb3` TO `testuser3`@`localhost`
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
@@ -226,9 +226,9 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: There is no such grant defined for user 'testuser1' on host 'localhost'
SHOW GRANTS FOR 'the_user'@'localhost';
Grants for the_user@localhost
-GRANT USAGE ON *.* TO 'the_user'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t1_view` TO 'the_user'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t1_table` TO 'the_user'@'localhost'
+GRANT USAGE ON *.* TO `the_user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t1_table` TO `the_user`@`localhost`
SELECT DISTINCT table_schema,table_name FROM information_schema.table_privileges
WHERE table_name LIKE 't1_%'
ORDER BY table_schema,table_name;
@@ -246,9 +246,9 @@ test t1_table
test t1_view
SHOW GRANTS FOR 'the_user'@'localhost';
Grants for the_user@localhost
-GRANT USAGE ON *.* TO 'the_user'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t1_view` TO 'the_user'@'localhost'
-GRANT ALL PRIVILEGES ON `test`.`t1_table` TO 'the_user'@'localhost'
+GRANT USAGE ON *.* TO `the_user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.`t1_table` TO `the_user`@`localhost`
REVOKE ALL PRIVILEGES ON test.t1_table FROM 'the_user'@'localhost';
REVOKE ALL PRIVILEGES ON test.t1_view FROM 'the_user'@'localhost';
DROP VIEW test.t1_view;
diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result
index 1127dc3ff44..d9ba88cba5a 100644
--- a/mysql-test/suite/funcs_1/r/is_triggers.result
+++ b/mysql-test/suite/funcs_1/r/is_triggers.result
@@ -145,8 +145,8 @@ trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@l
connect testuser2, localhost, testuser2, , db_datadict;
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
-GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, DELETE HISTORY ON `db_datadict`.`t1` TO 'testuser2'@'localhost'
+GRANT USAGE ON *.* TO `testuser2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, DELETE HISTORY ON `db_datadict`.`t1` TO `testuser2`@`localhost`
# No TRIGGER Privilege --> no result for query
SELECT * FROM information_schema.triggers
WHERE trigger_name = 'trg1';
@@ -156,8 +156,8 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
connect testuser3, localhost, testuser3, , test;
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
-GRANT TRIGGER ON *.* TO 'testuser3'@'localhost'
-GRANT SELECT ON `db_datadict`.`t1` TO 'testuser3'@'localhost'
+GRANT TRIGGER ON *.* TO `testuser3`@`localhost`
+GRANT SELECT ON `db_datadict`.`t1` TO `testuser3`@`localhost`
# TRIGGER Privilege + SELECT Privilege on t1 --> result for query
SELECT * FROM information_schema.triggers
WHERE trigger_name = 'trg1';
@@ -169,7 +169,7 @@ trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@l
connect testuser4, localhost, testuser4, , test;
SHOW GRANTS FOR 'testuser4'@'localhost';
Grants for testuser4@localhost
-GRANT TRIGGER ON *.* TO 'testuser4'@'localhost'
+GRANT TRIGGER ON *.* TO `testuser4`@`localhost`
# TRIGGER Privilege + no SELECT Privilege on t1 --> result for query
SELECT * FROM db_datadict.t1;
ERROR 42000: SELECT command denied to user 'testuser4'@'localhost' for table 't1'
diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result
index cb619831baa..4ef7c18d627 100644
--- a/mysql-test/suite/funcs_1/r/is_user_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result
@@ -546,9 +546,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT SELECT, UPDATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
# Now add SELECT on *.* to testuser1;
connection default;
@@ -1035,9 +1035,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
+GRANT SELECT ON *.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT, UPDATE ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -1055,7 +1055,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser2@localhost
-GRANT INSERT, UPDATE ON *.* TO 'testuser2'@'localhost'
+GRANT INSERT, UPDATE ON *.* TO `testuser2`@`localhost`
connect testuser3, localhost, testuser3, , test;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -1069,7 +1069,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser3'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser3@localhost
-GRANT USAGE ON *.* TO 'testuser3'@'localhost'
+GRANT USAGE ON *.* TO `testuser3`@`localhost`
# Revoke privileges from testuser1;
connection default;
@@ -1249,7 +1249,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_55 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_55'
SELECT * FROM information_schema.user_privileges
@@ -1264,7 +1264,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_66 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_66'
@@ -1587,9 +1587,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_56 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_56'
USE db_datadict;
@@ -1745,9 +1745,9 @@ default_role
max_statement_time 0.000000
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
-GRANT ALL PRIVILEGES ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
-GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
+GRANT ALL PRIVILEGES ON `db_datadict`.* TO `testuser1`@`localhost` WITH GRANT OPTION
+GRANT SELECT ON `mysql`.`user` TO `testuser1`@`localhost`
CREATE TABLE tb_57 ( c1 TEXT )
ENGINE = <other_engine_type>;
@@ -1929,7 +1929,7 @@ WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
SHOW GRANTS;
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
CREATE TABLE db_datadict.tb_58 ( c1 TEXT )
ENGINE = <other_engine_type>;
USE db_datadict;
@@ -1961,7 +1961,7 @@ PRIVILEGE_TYPE USAGE
IS_GRANTABLE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT USAGE ON *.* TO 'testuser1'@'localhost'
+GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
@@ -1975,7 +1975,7 @@ PRIVILEGE_TYPE FILE
IS_GRANTABLE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
-GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost'
+GRANT SELECT, FILE ON *.* TO `testuser1`@`localhost`
DROP USER 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03.result b/mysql-test/suite/funcs_1/r/memory_trig_03.result
index acab98b0cdc..75286115d86 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03.result
@@ -78,14 +78,14 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -168,12 +168,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_424a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection no_privs_424a;
@@ -183,7 +183,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -209,7 +209,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
connection default;
@@ -233,22 +233,22 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_424b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
@@ -276,8 +276,8 @@ drop trigger trg4b_1;
connection yes_privs_424b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
@@ -314,22 +314,22 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_424c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
@@ -349,8 +349,8 @@ drop trigger trg4c_1;
connection yes_privs_424c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
@@ -377,21 +377,21 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
connect no_privs_424d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
@@ -412,8 +412,8 @@ drop trigger trg4d_1;
connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
@@ -441,12 +441,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_425a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -457,7 +457,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
@@ -478,7 +478,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
@@ -502,23 +502,23 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_425b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -537,8 +537,8 @@ drop trigger trg5b_1;
connection yes_privs_425b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -564,23 +564,23 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_425c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -595,8 +595,8 @@ drop trigger trg5c_1;
connection yes_privs_425c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -617,23 +617,23 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -648,8 +648,8 @@ drop trigger trg5d_1;
connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -674,9 +674,9 @@ grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect yes_353x,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_353x;
select current_user;
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03e.result b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
index b1c017d368b..72c269cb89a 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
@@ -15,16 +15,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant select on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant select,insert on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on db level for create:
@@ -46,8 +46,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -97,8 +97,8 @@ root@localhost
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
no trigger privilege on db level for drop:
------------------------------------------
@@ -153,8 +153,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
@@ -183,9 +183,9 @@ create table t1 (f1 char(20)) engine= memory;
grant SELECT,UPDATE on no_priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `no_priv_db`.* TO `test_yesprivs`@`localhost`
use db with trigger privilege on db level and without...:
---------------------------------------------------------
@@ -286,13 +286,13 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant select, update, insert on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -330,8 +330,8 @@ insert2-yes
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -367,8 +367,8 @@ trig 1_2-yes
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
no trigger privilege on table level for drop:
---------------------------------------------
@@ -422,8 +422,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
connection no_privs;
select current_user;
@@ -459,15 +459,15 @@ create table t2 (f1 char(20)) engine= memory;
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_noprivs`@`localhost`
use table with trigger privilege and without...:
------------------------------------------------
@@ -544,14 +544,14 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant ALL on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_privs;
@@ -604,7 +604,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
disconnect yes_privs;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
@@ -623,7 +623,7 @@ current_user
root@localhost
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop trigger trg1_1;
use priv_db;
@@ -657,8 +657,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -721,7 +721,7 @@ trig 1_2-yes
grant TRIGGER on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connection yes_privs;
select current_user;
current_user
@@ -812,9 +812,9 @@ grant ALL on priv1_db.* to test_yesprivs@localhost;
grant SELECT,UPDATE on priv2_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
@@ -822,9 +822,9 @@ grant SELECT,INSERT,UPDATE on priv1_db.* to test_noprivs@localhost;
grant SELECT,INSERT on priv2_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT ON `priv2_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -889,9 +889,9 @@ revoke TRIGGER on priv1_db.t1 from test_yesprivs@localhost;
ERROR 42000: There is no such grant defined for user 'test_yesprivs' on host 'localhost' on table 't1'
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -929,10 +929,10 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -977,10 +977,10 @@ root@localhost
grant TRIGGER on priv1_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1070,8 +1070,8 @@ grant select
on priv_db.t1 to test_useprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1104,8 +1104,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1135,8 +1135,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1167,8 +1167,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1200,8 +1200,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1234,8 +1234,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1273,8 +1273,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1337,8 +1337,8 @@ grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1380,9 +1380,9 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost` WITH GRANT OPTION
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
@@ -1413,16 +1413,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,UPDATE on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -1478,10 +1478,10 @@ revoke UPDATE(f1) on priv_db.t2
from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1630,9 +1630,9 @@ grant TRIGGER,UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1673,9 +1673,9 @@ grant UPDATE(f1),UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection no_privs;
select current_user;
current_user
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03.result b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
index acab98b0cdc..75286115d86 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
@@ -78,14 +78,14 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -168,12 +168,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_424a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection no_privs_424a;
@@ -183,7 +183,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -209,7 +209,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
connection default;
@@ -233,22 +233,22 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke UPDATE on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_424b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
@@ -276,8 +276,8 @@ drop trigger trg4b_1;
connection yes_privs_424b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
@@ -314,22 +314,22 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_424c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
@@ -349,8 +349,8 @@ drop trigger trg4c_1;
connection yes_privs_424c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
@@ -377,21 +377,21 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`%`
connect no_privs_424d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_424d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
@@ -412,8 +412,8 @@ drop trigger trg4d_1;
connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
@@ -441,12 +441,12 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect no_privs_425a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
@@ -457,7 +457,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
@@ -478,7 +478,7 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
@@ -502,23 +502,23 @@ grant ALL on priv_db.* to test_noprivs@localhost;
revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
connect no_privs_425b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -537,8 +537,8 @@ drop trigger trg5b_1;
connection yes_privs_425b;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
@@ -564,23 +564,23 @@ grant ALL on priv_db.t1 to test_noprivs@localhost;
revoke SELECT on priv_db.t1 from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect no_privs_425c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425c;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER, DELETE HISTORY ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -595,8 +595,8 @@ drop trigger trg5c_1;
connection yes_privs_425c;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -617,23 +617,23 @@ grant TRIGGER on *.* to test_noprivs@localhost;
grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -648,8 +648,8 @@ drop trigger trg5d_1;
connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
@@ -674,9 +674,9 @@ grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connect yes_353x,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_353x;
select current_user;
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
index 8a42a54b1be..8b8df4bd694 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
@@ -15,16 +15,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant select on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant select,insert on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on db level for create:
@@ -46,8 +46,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -97,8 +97,8 @@ root@localhost
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_yesprivs`@`localhost`
no trigger privilege on db level for drop:
------------------------------------------
@@ -153,8 +153,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
@@ -183,9 +183,9 @@ create table t1 (f1 char(20)) engine= myisam;
grant SELECT,UPDATE on no_priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `no_priv_db`.* TO `test_yesprivs`@`localhost`
use db with trigger privilege on db level and without...:
---------------------------------------------------------
@@ -286,13 +286,13 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant select, update, insert on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -330,8 +330,8 @@ insert2-yes
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -367,8 +367,8 @@ trig 1_2-yes
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
no trigger privilege on table level for drop:
---------------------------------------------
@@ -422,8 +422,8 @@ current_user
test_yesprivs@localhost
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
drop trigger trg1_2;
connection no_privs;
select current_user;
@@ -459,15 +459,15 @@ create table t2 (f1 char(20)) engine= myisam;
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
grant SELECT, INSERT, UPDATE on priv_db.t2 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO `test_noprivs`@`localhost`
use table with trigger privilege and without...:
------------------------------------------------
@@ -544,14 +544,14 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant ALL on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection yes_privs;
@@ -604,7 +604,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
disconnect yes_privs;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
@@ -623,7 +623,7 @@ current_user
root@localhost
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop trigger trg1_1;
use priv_db;
@@ -657,8 +657,8 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
-----------------------------------------
@@ -721,7 +721,7 @@ trig 1_2-yes
grant TRIGGER on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
connection yes_privs;
select current_user;
current_user
@@ -812,9 +812,9 @@ grant ALL on priv1_db.* to test_yesprivs@localhost;
grant SELECT,UPDATE on priv2_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
@@ -822,9 +822,9 @@ grant SELECT,INSERT,UPDATE on priv1_db.* to test_noprivs@localhost;
grant SELECT,INSERT on priv2_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT ON `priv2_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -889,9 +889,9 @@ revoke TRIGGER on priv1_db.t1 from test_yesprivs@localhost;
ERROR 42000: There is no such grant defined for user 'test_yesprivs' on host 'localhost' on table 't1'
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -929,10 +929,10 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
trigger privilege on table level for create:
--------------------------------------------
@@ -977,10 +977,10 @@ root@localhost
grant TRIGGER on priv1_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT ALL PRIVILEGES ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
+GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1070,8 +1070,8 @@ grant select
on priv_db.t1 to test_useprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1104,8 +1104,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1135,8 +1135,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1167,8 +1167,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1200,8 +1200,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1234,8 +1234,8 @@ root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1273,8 +1273,8 @@ root@localhost
grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost` WITH GRANT OPTION
connection yes_privs;
select current_user;
current_user
@@ -1337,8 +1337,8 @@ grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1380,9 +1380,9 @@ current_user
test_yesprivs@localhost
show grants;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost` WITH GRANT OPTION
+GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
@@ -1413,16 +1413,16 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
grant SELECT,UPDATE on priv_db.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, UPDATE ON `priv_db`.* TO `test_noprivs`@`localhost`
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -1478,10 +1478,10 @@ revoke UPDATE(f1) on priv_db.t2
from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1630,9 +1630,9 @@ grant TRIGGER,UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
@@ -1673,9 +1673,9 @@ grant UPDATE(f1),UPDATE(f2),UPDATE(f3) on priv_db.t1
to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
+GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection no_privs;
select current_user;
current_user
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
index 5dd432714ab..f3f561fd479 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
@@ -74,7 +74,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
SHOW GRANTS;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
CREATE INDEX i_processlist ON processlist (user);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -151,7 +151,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
CREATE INDEX i_processlist ON processlist (user);
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP TABLE processlist;
@@ -187,7 +187,7 @@ SHOW/SELECT shows only the processes (1) of the user.
connection con100;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME Init SHOW processlist TIME_MS
@@ -201,7 +201,7 @@ SHOW/SELECT shows all processes/threads.
connect con101,localhost,ddicttestuser1,ddictpass,information_schema;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -227,7 +227,7 @@ SHOW/SELECT shows all processes/threads.
connect anonymous1,localhost,"''",,information_schema;
SHOW GRANTS;
Grants for @localhost
-GRANT PROCESS ON *.* TO ''@'localhost'
+GRANT PROCESS ON *.* TO ``@`localhost`
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -254,7 +254,7 @@ ddicttestuser1 are visible.
####################################################################################
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -279,7 +279,7 @@ Again only the processes of the anonymous user are visible.
####################################################################################
SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
-GRANT USAGE ON *.* TO ''@'localhost'
+GRANT USAGE ON *.* TO ``@`localhost`
SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
@@ -297,7 +297,7 @@ Only the processes of ddicttestuser1 user are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -324,7 +324,7 @@ Only the processes of ddicttestuser1 are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -352,7 +352,7 @@ Try to grant PROCESS privilege to user ddicttestuser2 without having it.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
####################################################################################
@@ -368,7 +368,7 @@ Grant PROCESS privilege to user ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT PROCESS, SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT PROCESS, SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
####################################################################################
10.4 New connection con200 (ddicttestuser2 with PROCESS privilege)
@@ -377,7 +377,7 @@ ddicttestuser2 has now the PROCESS privilege and sees all connections
####################################################################################
SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
Grants for ddicttestuser2@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -417,7 +417,7 @@ ddicttestuser2 has no more the PROCESS privilege and can only see own connects
####################################################################################
SHOW GRANTS;
Grants for ddicttestuser2@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -440,7 +440,7 @@ He is also unable to GRANT the PROCESS privilege to ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
SHOW processlist;
@@ -479,7 +479,7 @@ Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
index 6ade94dbe58..a68e62e4642 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
@@ -74,7 +74,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
SHOW GRANTS;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
CREATE INDEX i_processlist ON processlist (user);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -151,7 +151,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
CREATE INDEX i_processlist ON processlist (user);
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP TABLE processlist;
@@ -187,7 +187,7 @@ SHOW/SELECT shows only the processes (1) of the user.
connection con100;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME Init SHOW processlist TIME_MS
@@ -201,7 +201,7 @@ SHOW/SELECT shows all processes/threads.
connect con101,localhost,ddicttestuser1,ddictpass,information_schema;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -227,7 +227,7 @@ SHOW/SELECT shows all processes/threads.
connect anonymous1,localhost,"''",,information_schema;
SHOW GRANTS;
Grants for @localhost
-GRANT PROCESS ON *.* TO ''@'localhost'
+GRANT PROCESS ON *.* TO ``@`localhost`
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -254,7 +254,7 @@ ddicttestuser1 are visible.
####################################################################################
SHOW GRANTS;
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -279,7 +279,7 @@ Again only the processes of the anonymous user are visible.
####################################################################################
SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
-GRANT USAGE ON *.* TO ''@'localhost'
+GRANT USAGE ON *.* TO ``@`localhost`
SELECT * FROM information_schema.processlist;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
@@ -297,7 +297,7 @@ Only the processes of ddicttestuser1 user are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -324,7 +324,7 @@ Only the processes of ddicttestuser1 are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -352,7 +352,7 @@ Try to grant PROCESS privilege to user ddicttestuser2 without having it.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
####################################################################################
@@ -368,7 +368,7 @@ Grant PROCESS privilege to user ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT PROCESS, SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT PROCESS, SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
####################################################################################
10.4 New connection con200 (ddicttestuser2 with PROCESS privilege)
@@ -377,7 +377,7 @@ ddicttestuser2 has now the PROCESS privilege and sees all connections
####################################################################################
SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
Grants for ddicttestuser2@localhost
-GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -417,7 +417,7 @@ ddicttestuser2 has no more the PROCESS privilege and can only see own connects
####################################################################################
SHOW GRANTS;
Grants for ddicttestuser2@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
@@ -440,7 +440,7 @@ He is also unable to GRANT the PROCESS privilege to ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
SHOW processlist;
@@ -479,7 +479,7 @@ Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
Grants for ddicttestuser1@localhost
-GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
diff --git a/mysql-test/suite/funcs_1/t/is_check_constraint.test b/mysql-test/suite/funcs_1/t/is_check_constraint.test
deleted file mode 100644
index 30a72d02b34..00000000000
--- a/mysql-test/suite/funcs_1/t/is_check_constraint.test
+++ /dev/null
@@ -1,92 +0,0 @@
---source include/have_innodb.inc
---source include/not_embedded.inc
---echo #
---echo # MDEV-17323: Backport INFORMATION_SCHEMA.CHECK_CONSTRAINTS to 10.2
---echo #
-CREATE user boo1;
-GRANT select,create,alter,drop on foo.* to boo1;
-SHOW GRANTS for boo1;
-CREATE user boo2;
-create database foo;
-# Connect with user boo1
-CONNECT(con1,localhost, boo1,, foo);
-
-SET check_constraint_checks=1;
-CREATE TABLE t0
-(
- t int, check (t>32) # table constraint
-) ENGINE=myisam;
---sorted_result
-SELECT * from information_schema.check_constraints;
-
-ALTER TABLE t0
-ADD CONSTRAINT CHK_t0_t CHECK(t<100);
---sorted_result
-SELECT * from information_schema.check_constraints;
-
-ALTER TABLE t0
-DROP CONSTRAINT CHK_t0_t;
---sorted_result
-SELECT * from information_schema.check_constraints;
-
-ALTER TABLE t0
-ADD CONSTRAINT CHECK(t<50);
---sorted_result
-SELECT * from information_schema.check_constraints;
-
-CREATE TABLE t1
-( t int CHECK(t>2), # field constraint
- tt int,
- CONSTRAINT CHECK (tt > 32), CONSTRAINT CHECK (tt <50),# autogenerated names table constraints
- CONSTRAINT CHK_tt CHECK(tt<100) # named table constraint
-) ENGINE=InnoDB;
- --sorted_result
-SELECT * from information_schema.check_constraints;
-
-ALTER TABLE t1
-DROP CONSTRAINT CHK_tt;
---sorted_result
-SELECT * from information_schema.check_constraints;
-
-CREATE TABLE t2
-(
-name VARCHAR(30) CHECK(CHAR_LENGTH(name)>2), #field constraint
-start_date DATE,
-end_date DATE,
-CONSTRAINT CHK_dates CHECK(start_date IS NULL) #table constraint
-)ENGINE=Innodb;
- --sorted_result
-SELECT * from information_schema.check_constraints;
-
-ALTER TABLE t1
-ADD CONSTRAINT CHK_new_ CHECK(t>tt);
---sorted_result
-SELECT * from information_schema.check_constraints;
-
-# Create table with same field and table check constraint name
-CREATE TABLE t3
-(
-a int,
-b int check (b>0), # field constraint named 'b'
-CONSTRAINT b check (b>10) # table constraint
-) ENGINE=InnoDB;
- --sorted_result
-SELECT * from information_schema.check_constraints;
-
-DISCONNECT con1;
-CONNECT(con2, localhost, boo2,, test);
- --sorted_result
-SELECT * from information_schema.check_constraints;
-
-DISCONNECT con2;
-CONNECT(con1, localhost, boo1,,foo);
-DROP TABLE t0;
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-DROP DATABASE foo;
-
-DISCONNECT con1;
---CONNECTION default
-DROP USER boo1;
-DROP USER boo2;
diff --git a/mysql-test/suite/funcs_1/t/is_check_constraints.test b/mysql-test/suite/funcs_1/t/is_check_constraints.test
index b39abdc1b24..b539de67f73 100644
--- a/mysql-test/suite/funcs_1/t/is_check_constraints.test
+++ b/mysql-test/suite/funcs_1/t/is_check_constraints.test
@@ -1,69 +1,118 @@
--source include/have_innodb.inc
+--source include/not_embedded.inc
--echo #
--echo # MDEV-14474: Create INFORMATION_SCHEMA.CHECK_CONSTRAINTS
--echo #
-set check_constraint_checks=1;
+CREATE user boo1;
+GRANT select,create,alter,drop on foo.* to boo1;
+SHOW GRANTS for boo1;
+CREATE user boo2;
+create database foo;
+# Connect with user boo1
+CONNECT(con1,localhost, boo1,, foo);
-use test;
-create table t0
+SET check_constraint_checks=1;
+CREATE TABLE t0
(
t int, check (t>32) # table constraint
) ENGINE=myisam;
-
---vertical_results
-SELECT * from information_schema.check_constraints order by check_clause;
+--sorted_result
+SELECT * from information_schema.check_constraints;
ALTER TABLE t0
ADD CONSTRAINT CHK_t0_t CHECK(t<100);
-
-SELECT * from information_schema.check_constraints order by check_clause;
+--sorted_result
+SELECT * from information_schema.check_constraints;
ALTER TABLE t0
DROP CONSTRAINT CHK_t0_t;
+--sorted_result
+SELECT * from information_schema.check_constraints;
-SELECT * from information_schema.check_constraints order by check_clause;
+ALTER TABLE t0
+ADD CONSTRAINT CHECK(t<50);
+--sorted_result
+SELECT * from information_schema.check_constraints;
CREATE TABLE t1
( t int CHECK(t>2), # field constraint
- tt int, CONSTRAINT CHK_tt CHECK(tt<100) # table constraint
+ tt int,
+ CONSTRAINT CHECK (tt > 32), CONSTRAINT CHECK (tt <50),# autogenerated names table constraints
+ CONSTRAINT CHK_tt CHECK(tt<100) # named table constraint
) ENGINE=InnoDB;
-
-SELECT * from information_schema.check_constraints order by check_clause;
+--sorted_result
+SELECT * from information_schema.check_constraints;
ALTER TABLE t1
DROP CONSTRAINT CHK_tt;
+--sorted_result
+SELECT * from information_schema.check_constraints;
-SELECT * from information_schema.check_constraints order by check_clause;
-
-create table t2
+CREATE TABLE t2
(
name VARCHAR(30) CHECK(CHAR_LENGTH(name)>2), #field constraint
start_date DATE,
end_date DATE,
CONSTRAINT CHK_dates CHECK(start_date IS NULL) #table constraint
)ENGINE=Innodb;
-
-SELECT * from information_schema.check_constraints order by check_clause;
+--sorted_result
+SELECT * from information_schema.check_constraints;
ALTER TABLE t1
ADD CONSTRAINT CHK_new_ CHECK(t>tt);
-
-SELECT * from information_schema.check_constraints order by check_clause;
-
+--sorted_result
+SELECT * from information_schema.check_constraints;
# Create table with same field and table check constraint name
-create table t3
+CREATE TABLE t3
(
a int,
b int check (b>0), # field constraint named 'b'
CONSTRAINT b check (b>10) # table constraint
) ENGINE=InnoDB;
+--sorted_result
+SELECT * from information_schema.check_constraints;
+
+DISCONNECT con1;
+CONNECT(con2, localhost, boo2,, test);
+--sorted_result
+SELECT * from information_schema.check_constraints;
+
+DISCONNECT con2;
+CONNECT(con1, localhost, boo1,,foo);
+DROP TABLE t0;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP DATABASE foo;
+
+DISCONNECT con1;
+--CONNECTION default
+DROP USER boo1;
+DROP USER boo2;
+
+--echo #
+--echo # MDEV-18440: Information_schema.check_constraints possible data leak
+--echo #
+
+CREATE USER foo;
+CREATE DATABASE db;
+USE db;
+CREATE TABLE t1 (a int, b int, CONSTRAINT CHECK (b > 0));
+INSERT INTO t1 VALUES (1, 2), (2, 3);
+GRANT SELECT (a) ON t1 TO foo;
+
+SHOW GRANTS FOR foo;
+--sorted_result
+SELECT * FROM information_schema.check_constraints;
+
+CONNECT(con1,localhost, foo,, db);
+SELECT a FROM t1;
+--sorted_result
+SELECT * FROM information_schema.check_constraints;
---horizontal_results
-select * from information_schema.check_constraints order by check_clause;
+--CONNECTION default
-drop table t0;
-drop table t1;
-drop table t2;
-drop table t3;
+DROP USER foo;
+DROP DATABASE db;
diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc
index 17f5c1e5529..573d72022fb 100644
--- a/mysql-test/suite/funcs_1/views/views_master.inc
+++ b/mysql-test/suite/funcs_1/views/views_master.inc
@@ -764,7 +764,7 @@ CREATE VIEW test.v2 AS SELECT * FROM test.t0;
CREATE VIEW test2.v2 AS SELECT * FROM test2.t0;
# Some additional tests on the just created objects to show that they are
-# accessable and do have the expected content.
+# accessible and do have the expected content.
# INSERTs with full qualified table
INSERT INTO test.t1 VALUES('test.t1 - 1');
INSERT INTO test2.t1 VALUES('test2.t1 - 1');
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index 61820f6e7c1..dadfa8ad781 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -10,22 +10,27 @@
#
##############################################################################
+MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently with Galera/replication victim kill
+MW-328A : MDEV-21483 galera.MW-328A galera.MW-328B
+MW-328B : MDEV-21483 galera.MW-328A galera.MW-328B
MW-329 : MDEV-19962 Galera test failure on MW-329
-MW-388: MDEV-19803 Long semaphore wait error on galera.MW-388
-galera_account_management : MariaDB 10.0 does not support ALTER USER
-galera_as_master_gtid : Requires MySQL GTID
-galera_as_master_gtid_change_master : Requires MySQL GTID
-galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB
+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_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events
-galera_binlog_stmt_autoinc: MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc
-galera_flush : MariaDB does not have global.thread_statistics
+galera_autoinc_sst_mariabackup : Known issue, may require porting MDEV-17458 from later versions
+galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
-galera_ist_mariabackup : MDEV-18829 test leaves port open
galera_ist_progress : MDEV-15236 fails when trying to read transfer status
-galera_migrate : MariaDB does not support START SLAVE USER
+galera_load_data : MDEV-19968 galera.galera_load_data
+galera_parallel_autoinc_largetrx : MDEV-20916 galera.galera_parallel_autoinc_largetrx
+galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
+galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade
+galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key
+galera_sst_mariabackup_table_options: MDEV-19741 Galera test failure on galera.galera_sst_mariabackup_table_options
+galera_var_innodb_disallow_writes : MDEV-20928 galera.galera_var_innodb_disallow_writes
galera_var_node_address : MDEV-20485 Galera test failure
galera_wan : MDEV-17259 Test failure on galera.galera_wan
+lp1376747-4 : MDEV-21911 Galera test failure on lp1376747-4
partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache
+sql_log_bin : MDEV-21491 galera.sql_log_bin
diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf
index b24f3603894..67e9893179f 100644
--- a/mysql-test/suite/galera/galera_2nodes.cnf
+++ b/mysql-test/suite/galera/galera_2nodes.cnf
@@ -2,7 +2,7 @@
!include include/default_mysqld.cnf
[mysqld]
-wsrep-on=1
+loose-innodb
binlog-format=row
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
@@ -12,18 +12,26 @@ wsrep_node_address=127.0.0.1
wsrep-sync-wait=15
[mysqld.1]
+loose-innodb
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
+wsrep-on=1
wsrep-cluster-address=gcomm://
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 15
+
[mysqld.2]
+loose-innodb
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
+wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
@@ -36,7 +44,6 @@ wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
-
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
diff --git a/mysql-test/suite/galera/galera_4nodes.cnf b/mysql-test/suite/galera/galera_4nodes.cnf
index 1c195afd54b..426a6ae6d92 100644
--- a/mysql-test/suite/galera/galera_4nodes.cnf
+++ b/mysql-test/suite/galera/galera_4nodes.cnf
@@ -16,6 +16,7 @@ wsrep-sync-wait=15
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
+wsrep-on=1
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
@@ -25,6 +26,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
+wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
@@ -35,6 +37,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
+wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M'
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
@@ -45,6 +48,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
+wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M'
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
diff --git a/mysql-test/suite/galera/r/MW-284.result b/mysql-test/suite/galera/r/MW-284.result
index 0f6c0be25fe..6f7bdf3917a 100644
--- a/mysql-test/suite/galera/r/MW-284.result
+++ b/mysql-test/suite/galera/r/MW-284.result
@@ -1,4 +1,6 @@
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+call mtr.add_suppression("\\[ERROR\\] Error reading packet from server: WSREP has not yet prepared node for application use .*");
+call mtr.add_suppression("WSREP has not yet prepared node for application use");
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
@@ -6,6 +8,9 @@ SET SESSION wsrep_on = OFF;
SET SESSION wsrep_on = ON;
SET global wsrep_sync_wait=0;
connection node_3;
+SELECT @@wsrep_on;
+@@wsrep_on
+0
START SLAVE;
include/wait_for_slave_param.inc [Slave_IO_Running]
connection node_1;
@@ -22,9 +27,3 @@ connection node_3;
STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('failed registering on master');
-CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
-connection node_1;
-RESET MASTER;
-CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
-connection node_2;
-CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
diff --git a/mysql-test/suite/galera/r/MW-328C.result b/mysql-test/suite/galera/r/MW-328C.result
deleted file mode 100644
index f8d747c5df1..00000000000
--- a/mysql-test/suite/galera/r/MW-328C.result
+++ /dev/null
@@ -1,23 +0,0 @@
-CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
-INSERT INTO t1 (f1) VALUES (1);
-CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
-CREATE PROCEDURE proc_update ()
-BEGIN
-DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
-SET SESSION wsrep_sync_wait = 0;
-WHILE 1 DO
-UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
-END WHILE;
-END|
-connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
-connection node_1X;
-CALL proc_update();;
-connection node_2;
-SET SESSION wsrep_retry_autocommit = 10000;
-connection node_1;
-connection node_1X;
-Got one of the listed errors
-connection node_1;
-DROP PROCEDURE proc_update;
-DROP TABLE t1, t2;
-CALL mtr.add_suppression("conflict state ABORTED after post commit");
diff --git a/mysql-test/suite/galera/r/MW-336.result b/mysql-test/suite/galera/r/MW-336.result
index b91e73aaada..dc1f0763a3f 100644
--- a/mysql-test/suite/galera/r/MW-336.result
+++ b/mysql-test/suite/galera/r/MW-336.result
@@ -2,14 +2,27 @@ connection node_1;
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
SET GLOBAL wsrep_slave_threads = 10;
# Set slave threads to 10 step 1
+SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+EXPECT_10
+10
SET GLOBAL wsrep_slave_threads = 1;
connection node_2;
INSERT INTO t1 VALUES (1);
connection node_1;
+# Wait until one of the appliers has exited
+SELECT VARIABLE_VALUE AS EXPECT_9 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+EXPECT_9
+9
SET GLOBAL wsrep_slave_threads = 10;
# Set slave threads to 10 step 2
+SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+EXPECT_10
+10
SET GLOBAL wsrep_slave_threads = 20;
# Set slave threads to 20
+SELECT VARIABLE_VALUE AS EXPECT_20 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+EXPECT_20
+20
SET GLOBAL wsrep_slave_threads = 1;
connection node_2;
INSERT INTO t1 VALUES (1);
@@ -22,28 +35,47 @@ INSERT INTO t1 VALUES (7);
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (9);
INSERT INTO t1 VALUES (10);
-connection node_1;
-SET GLOBAL wsrep_slave_threads = 10;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-11
-# Set slave threads to 10 step 3
-connection node_2;
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
INSERT INTO t1 VALUES (14);
-INSERT INTO t1 VALUES (15);
INSERT INTO t1 VALUES (16);
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
INSERT INTO t1 VALUES (20);
+connection node_1;
+# Wait until 19 of the appliers has exited
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+EXPECT_1
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+20
+SET GLOBAL wsrep_slave_threads = 10;
+# Set slave threads to 10 step 3
+SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+EXPECT_10
+10
+connection node_1;
+SET GLOBAL wsrep_slave_threads = 1;
+connection node_2;
INSERT INTO t1 VALUES (21);
INSERT INTO t1 VALUES (22);
+INSERT INTO t1 VALUES (23);
+INSERT INTO t1 VALUES (24);
+INSERT INTO t1 VALUES (25);
+INSERT INTO t1 VALUES (26);
+INSERT INTO t1 VALUES (27);
+INSERT INTO t1 VALUES (28);
+INSERT INTO t1 VALUES (29);
+INSERT INTO t1 VALUES (30);
connection node_1;
+# Wait until slave threads back to 1
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+EXPECT_1
+1
SELECT COUNT(*) FROM t1;
COUNT(*)
-23
-SET GLOBAL wsrep_slave_threads = 1;
+30
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MW-388.result b/mysql-test/suite/galera/r/MW-388.result
index a2cf02712bb..59d499e117d 100644
--- a/mysql-test/suite/galera/r/MW-388.result
+++ b/mysql-test/suite/galera/r/MW-388.result
@@ -18,12 +18,10 @@ connection node_1a;
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
connection node_1;
SET SESSION wsrep_sync_wait = 0;
-SET SESSION DEBUG_SYNC = 'wsrep_after_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
CALL insert_proc ();;
connection node_1a;
-SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached";
+SET SESSION wsrep_sync_wait = 0;
SET GLOBAL DEBUG_DBUG = "";
-SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
connection node_2;
connection node_1;
diff --git a/mysql-test/suite/galera/r/MW-44.result b/mysql-test/suite/galera/r/MW-44.result
index 83668339310..7335acc445a 100644
--- a/mysql-test/suite/galera/r/MW-44.result
+++ b/mysql-test/suite/galera/r/MW-44.result
@@ -1,24 +1,11 @@
connection node_1;
TRUNCATE TABLE mysql.general_log;
connection node_2;
-TRUNCATE TABLE mysql.general_log;
connection node_1;
-SELECT Argument FROM mysql.general_log;
-Argument
-SET GLOBAL general_log='ON';
SET SESSION wsrep_osu_method=TOI;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_osu_method=RSU;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
SET SESSION wsrep_osu_method=TOI;
-SELECT argument FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
-argument
-CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
-ALTER TABLE t1 ADD COLUMN f2 INTEGER
connection node_2;
-SELECT Argument FROM mysql.general_log;
-Argument
DROP TABLE t1;
-SET GLOBAL general_log='OFF';
-connection node_1;
-SET GLOBAL general_log='OFF';
diff --git a/mysql-test/suite/galera/r/galera_account_management.result b/mysql-test/suite/galera/r/galera_account_management.result
deleted file mode 100644
index 6c81d401136..00000000000
--- a/mysql-test/suite/galera/r/galera_account_management.result
+++ /dev/null
@@ -1,65 +0,0 @@
-connection node_1;
-CREATE USER user1, user2 IDENTIFIED BY 'password';
-connection node_2;
-SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
-COUNT(*) = 2
-1
-connection node_1;
-ALTER USER user1 PASSWORD EXPIRE;
-SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
-password_expired = 'Y'
-1
-connection node_2;
-SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
-password_expired = 'Y'
-1
-connection node_1;
-RENAME USER user2 TO user3;
-connection node_2;
-SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
-COUNT(*) = 0
-1
-SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3';
-COUNT(*) = 1
-1
-connection node_1;
-SET PASSWORD FOR user3 = PASSWORD('foo');
-connection node_1;
-SELECT password != '' FROM mysql.user WHERE user = 'user3';
-password != ''
-1
-connection node_1;
-DROP USER user1, user3;
-connection node_2;
-SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2');
-COUNT(*) = 0
-1
-connection node_1;
-GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password';
-connection node_2;
-SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4';
-COUNT(*) = 1
-1
-SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4';
-Select_priv = 'Y'
-1
-connection node_1;
-CREATE USER user5;
-GRANT PROXY ON user4 TO user5;
-connection node_2;
-SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5';
-COUNT(*) = 1
-1
-connection node_1;
-REVOKE ALL PRIVILEGES ON *.* FROM user4;
-connection node_2;
-SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4';
-Select_priv = 'N'
-1
-connection node_1;
-REVOKE PROXY ON user4 FROM user5;
-connection node_2;
-SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5';
-COUNT(*) = 0
-1
-DROP USER user4, user5;
diff --git a/mysql-test/suite/galera/r/galera_as_master_gtid.result b/mysql-test/suite/galera/r/galera_as_master_gtid.result
deleted file mode 100644
index 8dfe462d495..00000000000
--- a/mysql-test/suite/galera/r/galera_as_master_gtid.result
+++ /dev/null
@@ -1,59 +0,0 @@
-START SLAVE USER='root';
-Warnings:
-Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t1 VALUES(1);
-uuids_do_not_match
-1
-SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 120;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000002 120 Previous_gtids 1 151
-mysqld-bin.000002 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
-mysqld-bin.000002 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
-mysqld-bin.000002 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
-mysqld-bin.000002 375 Query 1 452 BEGIN
-mysqld-bin.000002 452 Table_map 1 497 table_id: # (test.t1)
-mysqld-bin.000002 497 Write_rows 1 537 table_id: # flags: STMT_END_F
-mysqld-bin.000002 537 Xid 1 568 COMMIT /* xid=# */
-INSERT INTO t1 VALUES(2);
-uuids_do_not_match
-1
-uuids_match
-1
-SHOW BINLOG EVENTS IN 'mysqld-bin.000003' FROM 120;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000003 120 Previous_gtids 2 151
-mysqld-bin.000003 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
-mysqld-bin.000003 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
-mysqld-bin.000003 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
-mysqld-bin.000003 375 Query 1 443 BEGIN
-mysqld-bin.000003 443 Table_map 1 488 table_id: # (test.t1)
-mysqld-bin.000003 488 Write_rows 1 528 table_id: # flags: STMT_END_F
-mysqld-bin.000003 528 Xid 1 559 COMMIT /* xid=# */
-mysqld-bin.000003 559 Gtid 2 607 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
-mysqld-bin.000003 607 Query 2 684 BEGIN
-mysqld-bin.000003 684 Table_map 2 729 table_id: # (test.t1)
-mysqld-bin.000003 729 Write_rows 2 769 table_id: # flags: STMT_END_F
-mysqld-bin.000003 769 Xid 2 800 COMMIT /* xid=# */
-uuids_do_not_match
-1
-uuids_match
-1
-SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 120 Previous_gtids 3 151
-mysqld-bin.000001 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
-mysqld-bin.000001 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
-mysqld-bin.000001 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
-mysqld-bin.000001 375 Query 1 443 BEGIN
-mysqld-bin.000001 443 Table_map 1 488 table_id: # (test.t1)
-mysqld-bin.000001 488 Write_rows 1 528 table_id: # flags: STMT_END_F
-mysqld-bin.000001 528 Xid 1 559 COMMIT /* xid=# */
-mysqld-bin.000001 559 Gtid 2 607 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
-mysqld-bin.000001 607 Query 2 675 BEGIN
-mysqld-bin.000001 675 Table_map 2 720 table_id: # (test.t1)
-mysqld-bin.000001 720 Write_rows 2 760 table_id: # flags: STMT_END_F
-mysqld-bin.000001 760 Xid 2 791 COMMIT /* xid=# */
-DROP TABLE t1;
-STOP SLAVE;
-RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result b/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result
deleted file mode 100644
index 80fbccf58e2..00000000000
--- a/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result
+++ /dev/null
@@ -1,15 +0,0 @@
-START SLAVE USER='root';
-Warnings:
-Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t1 VALUES(1);
-INSERT INTO t1 VALUES(2);
-STOP SLAVE;
-START SLAVE USER='root';
-Warnings:
-Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
-INSERT INTO t1 VALUES(3);
-INSERT INTO t1 VALUES(4);
-DROP TABLE t1;
-STOP SLAVE;
-RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/r/galera_as_slave_ctas.result b/mysql-test/suite/galera/r/galera_as_slave_ctas.result
new file mode 100644
index 00000000000..13cbbc905e3
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_slave_ctas.result
@@ -0,0 +1,28 @@
+connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+connection node_2;
+START SLAVE;
+connection node_1;
+SHOW VARIABLES LIKE 'binlog_format';
+Variable_name Value
+binlog_format ROW
+connection node_1;
+CREATE TABLE source (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE target AS SELECT * FROM source;
+connection node_2;
+connection node_3;
+connection node_1;
+DROP TABLE target;
+INSERT INTO source VALUES(1);
+CREATE TABLE target AS SELECT * FROM source;
+connection node_2;
+connection node_3;
+connection node_1;
+DROP TABLE source;
+DROP TABLE target;
+connection node_3;
+connection node_2;
+STOP SLAVE;
+RESET SLAVE ALL;
+connection node_1;
+RESET MASTER;
diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result b/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result
new file mode 100644
index 00000000000..d8a9f0d6f57
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result
@@ -0,0 +1,32 @@
+connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+SELECT @@WSREP_ON;
+@@WSREP_ON
+0
+connection node_2;
+ALTER TABLE mysql.gtid_slave_pos engine = InnoDB;
+START SLAVE;
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1);
+SELECT LENGTH(@@global.gtid_binlog_state) > 1;
+LENGTH(@@global.gtid_binlog_state) > 1
+1
+connection node_2;
+gtid_binlog_state_equal
+0
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+gtid_binlog_state_equal
+0
+#cleanup
+connection node_1;
+DROP TABLE t1;
+reset master;
+connection node_2;
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+connection node_3;
+reset master;
diff --git a/mysql-test/suite/galera/r/galera_as_slave_preordered.result b/mysql-test/suite/galera/r/galera_as_slave_preordered.result
deleted file mode 100644
index 27a08e73491..00000000000
--- a/mysql-test/suite/galera/r/galera_as_slave_preordered.result
+++ /dev/null
@@ -1,19 +0,0 @@
-START SLAVE USER='root';
-Warnings:
-Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
-CREATE TABLE ten (f1 INTEGER);
-INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
-SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
-COUNT(DISTINCT f1) = 2 * 100 * 10 * 10
-1
-SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
-COUNT(*) = 2 * 100 * 10 * 10
-1
-SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
-COUNT(DISTINCT f1) = 2 * 100 * 10 * 10
-1
-DROP TABLE t1;
-DROP TABLE ten;
-STOP SLAVE;
-RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result b/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result
deleted file mode 100644
index 80ae3d0de2c..00000000000
--- a/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result
+++ /dev/null
@@ -1,12 +0,0 @@
-SET GLOBAL binlog_rows_query_log_events=TRUE;
-CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-SELECT COUNT(*) = 1 FROM t1;
-COUNT(*) = 1
-1
-UPDATE t1 SET f1 = 2 WHERE f1 = 1;
-SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
-COUNT(*) = 1
-1
-SET GLOBAL binlog_rows_query_log_events = 0;
-DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_events2.result b/mysql-test/suite/galera/r/galera_events2.result
index fa33e75ff57..36441e15f7d 100644
--- a/mysql-test/suite/galera/r/galera_events2.result
+++ b/mysql-test/suite/galera/r/galera_events2.result
@@ -14,6 +14,7 @@ SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFIN
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def test event_2 root@localhost SQL INSERT INTO event_table VALUES (1) RECURRING NULL 1 SECOND ENABLED NOT PRESERVE
connection node_2;
+set global wsrep_sync_wait=15;
# node_2 event should be there
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
diff --git a/mysql-test/suite/galera/r/galera_flush.result b/mysql-test/suite/galera/r/galera_flush.result
deleted file mode 100644
index 71226432eda..00000000000
--- a/mysql-test/suite/galera/r/galera_flush.result
+++ /dev/null
@@ -1,88 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-FLUSH DES_KEY_FILE;
-wsrep_last_committed_diff
-1
-FLUSH HOSTS;
-wsrep_last_committed_diff
-1
-SET GLOBAL wsrep_replicate_myisam = TRUE;
-INSERT INTO mysql.user VALUES('localhost','user1',PASSWORD('pass1'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N','N','',0);
-FLUSH PRIVILEGES;
-DELETE FROM mysql.user WHERE user = 'user1';
-SET GLOBAL wsrep_replicate_myisam = FALSE;
-FLUSH PRIVILEGES;
-FLUSH QUERY CACHE;
-wsrep_last_committed_diff
-1
-FLUSH STATUS;
-wsrep_last_committed_diff
-1
-FLUSH USER_RESOURCES;
-wsrep_last_committed_diff
-1
-FLUSH TABLES;
-wsrep_last_committed_diff
-1
-CREATE TABLE t2 (f1 INTEGER);
-FLUSH TABLES t2;
-wsrep_last_committed_diff
-1
-FLUSH ERROR LOGS;
-wsrep_last_committed_diff
-1
-FLUSH SLOW LOGS;
-wsrep_last_committed_diff
-1
-FLUSH GENERAL LOGS;
-wsrep_last_committed_diff
-1
-FLUSH ENGINE LOGS;
-wsrep_last_committed_diff
-1
-FLUSH RELAY LOGS;
-wsrep_last_committed_diff
-1
-SET @userstat_old= @@userstat;
-SET GLOBAL userstat=ON;
-FLUSH CLIENT_STATISTICS;
-FLUSH INDEX_STATISTICS;
-FLUSH TABLE_STATISTICS;
-FLUSH USER_STATISTICS;
-wsrep_last_committed_diff
-1
-SET @old_thread_statistics= @@global.thread_statistics;
-SET GLOBAL thread_statistics= ON;
-FLUSH THREAD_STATISTICS;
-wsrep_last_committed_diff
-1
-FLUSH CHANGED_PAGE_BITMAPS;
-wsrep_last_committed_diff
-1
-CREATE TABLE t1 (f1 INTEGER);
-FLUSH LOGS;
-FLUSH TABLES WITH READ LOCK;
-UNLOCK TABLES;
-FLUSH TABLES t1 WITH READ LOCK;
-UNLOCK TABLES;
-FLUSH TABLES t1 FOR EXPORT;
-UNLOCK TABLES;
-wsrep_last_committed_diff
-1
-LOCK TABLES t1 WRITE;
-FLUSH TABLES t1;
-UNLOCK TABLES;
-wsrep_last_committed_diff
-1
-LOCK TABLES t1 READ;
-FLUSH TABLES t1;
-ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
-UNLOCK TABLES;
-wsrep_last_committed_diff
-1
-FLUSH TABLES t1;
-wsrep_last_committed_diff
-1
-DROP TABLE t1;
-DROP TABLE t2;
-SET GLOBAL userstat= @userstat_old;
-SET GLOBAL thread_statistics= @old_thread_statistics;
diff --git a/mysql-test/suite/galera/r/galera_forced_binlog_format.result b/mysql-test/suite/galera/r/galera_forced_binlog_format.result
index b94e6530886..3653a311d83 100644
--- a/mysql-test/suite/galera/r/galera_forced_binlog_format.result
+++ b/mysql-test/suite/galera/r/galera_forced_binlog_format.result
@@ -1,13 +1,11 @@
connection node_1;
+SET SESSION wsrep_on=OFF;
RESET MASTER;
+SET SESSION wsrep_on=ON;
SET SESSION binlog_format = 'STATEMENT';
-Warnings:
-Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET SESSION binlog_format = 'MIXED';
-Warnings:
-Warning 1105 MariaDB Galera and flashback do not support binlog format: MIXED
INSERT INTO t1 VALUES (2);
SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 256;
Log_name Pos Event_type Server_id End_log_pos Info
@@ -38,8 +36,8 @@ GRANT ALL PRIVILEGES ON testdb_9401.t1 TO dummy@localhost;
FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
-GRANT USAGE ON *.* TO 'dummy'@'localhost'
-GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO 'dummy'@'localhost'
+GRANT USAGE ON *.* TO `dummy`@`localhost`
+GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO `dummy`@`localhost`
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE testdb_9401;
diff --git a/mysql-test/suite/galera/r/galera_gtid.result b/mysql-test/suite/galera/r/galera_gtid.result
index acc5eae9876..0346abc5a6c 100644
--- a/mysql-test/suite/galera/r/galera_gtid.result
+++ b/mysql-test/suite/galera/r/galera_gtid.result
@@ -1,14 +1,12 @@
CREATE TABLE t1 (f1 INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
connection node_2;
-SELECT COUNT(*) = 1 FROM t1;
-COUNT(*) = 1
-1
UPDATE t1 SET f1 = 2;
connection node_1;
-SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
-COUNT(*) = 1
-1
+SET SESSION wsrep_sync_wait = 15;
+SELECT * from t1;
+f1
+2
gtid_binlog_state_equal
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result
index c81cecfae1c..d38d664b6fa 100644
--- a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result
+++ b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result
@@ -13,7 +13,6 @@ Loading wsrep_provider ...
SET SESSION wsrep_on=OFF;
SET SESSION wsrep_on=ON;
connection node_1;
-connection node_1;
UPDATE t1 SET f2 = 'd' WHERE f1 > 3;
connection node_2;
connection node_1;
diff --git a/mysql-test/suite/galera/r/galera_log_bin.result b/mysql-test/suite/galera/r/galera_log_bin.result
index 2fb59fc200f..eb009a620e0 100644
--- a/mysql-test/suite/galera/r/galera_log_bin.result
+++ b/mysql-test/suite/galera/r/galera_log_bin.result
@@ -71,5 +71,3 @@ DROP TABLE t2;
#cleanup
connection node_1;
RESET MASTER;
-connection node_2;
-reset master;
diff --git a/mysql-test/suite/galera/r/galera_migrate.result b/mysql-test/suite/galera/r/galera_migrate.result
deleted file mode 100644
index aab3ffbd6b6..00000000000
--- a/mysql-test/suite/galera/r/galera_migrate.result
+++ /dev/null
@@ -1,79 +0,0 @@
-CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-START SLAVE USER='root';
-Warnings:
-Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
-INSERT INTO t1 VALUES (2);
-START SLAVE USER='root';
-Warnings:
-Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
-INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-SET GLOBAL wsrep_cluster_address='gcomm://';
-INSERT INTO t1 VALUES (5);
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-VARIABLE_VALUE = 'Primary'
-1
-SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 1
-1
-INSERT INTO t1 VALUES (6);
-GRANT ALL PRIVILEGES ON *.* TO 'sst';
-SET GLOBAL wsrep_sst_auth = 'sst:';
-GRANT ALL PRIVILEGES ON *.* TO 'sst';
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-VARIABLE_VALUE = 'Primary'
-1
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 2
-1
-STOP SLAVE;
-RESET SLAVE ALL;
-STOP SLAVE;
-RESET SLAVE ALL;
-INSERT INTO t1 VALUES (7);
-INSERT INTO t1 VALUES (8);
-SELECT COUNT(*) = 8 FROM t1;
-COUNT(*) = 8
-1
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-VARIABLE_VALUE = 'Primary'
-1
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 2
-1
-SELECT COUNT(*) = 8 FROM t1;
-COUNT(*) = 8
-1
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-VARIABLE_VALUE = 'Primary'
-1
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 2
-1
-DROP TABLE t1;
-DROP TABLE t1;
-SET GLOBAL wsrep_provider = 'none';
-SET GLOBAL wsrep_sst_auth = '';
-SET GLOBAL wsrep_provider_options = '';
-DROP TABLE t1;
-DROP USER sst;
-SET GLOBAL wsrep_provider = 'none';
-SET GLOBAL wsrep_sst_method = 'rsync';
-SET GLOBAL wsrep_provider_options = '';
-SET GLOBAL wsrep_sst_receive_address = 'AUTO';
-DROP TABLE t1;
-DROP USER sst;
-CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
diff --git a/mysql-test/suite/galera/r/galera_partition.result b/mysql-test/suite/galera/r/galera_partition.result
new file mode 100644
index 00000000000..c21d1005293
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_partition.result
@@ -0,0 +1,424 @@
+connection node_1;
+call mtr.add_suppression("WSREP: RSU failed due to pending transactions, schema: test, query ALTER.*");
+call mtr.add_suppression("WSREP: ALTER TABLE isolation failure");
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
+connection node_1;
+CREATE TABLE t1(
+id bigint unsigned NOT NULL AUTO_INCREMENT,
+dt datetime NOT NULL,
+PRIMARY KEY (id,dt),
+KEY dt_idx (dt)
+) ENGINE=InnoDB
+PARTITION BY RANGE( TO_DAYS(dt) ) (
+PARTITION rx2009xx VALUES LESS THAN( TO_DAYS('2010-01-01 00:00:00') ),
+PARTITION rx201001 VALUES LESS THAN( TO_DAYS('2010-02-01 00:00:00') ),
+PARTITION rx201002 VALUES LESS THAN( TO_DAYS('2010-03-01 00:00:00') ),
+PARTITION rx201003 VALUES LESS THAN( TO_DAYS('2010-04-01 00:00:00') ),
+PARTITION rx201004 VALUES LESS THAN( TO_DAYS('2010-05-01 00:00:00') ),
+PARTITION rx201005 VALUES LESS THAN( TO_DAYS('2010-06-01 00:00:00') ),
+PARTITION rx201006 VALUES LESS THAN( TO_DAYS('2010-07-01 00:00:00') ),
+PARTITION rx201007 VALUES LESS THAN( TO_DAYS('2010-08-01 00:00:00') ),
+PARTITION rx201008 VALUES LESS THAN( TO_DAYS('2010-09-01 00:00:00') ),
+PARTITION rx201009 VALUES LESS THAN( TO_DAYS('2010-10-01 00:00:00') ),
+PARTITION rx201010 VALUES LESS THAN( TO_DAYS('2010-11-01 00:00:00') ),
+PARTITION rx201011 VALUES LESS THAN( TO_DAYS('2010-12-01 00:00:00') ),
+PARTITION rx201012 VALUES LESS THAN( TO_DAYS('2011-01-01 00:00:00') ),
+PARTITION rx2011 VALUES LESS THAN MAXVALUE);
+CREATE PROCEDURE p1 (repeat_count int)
+BEGIN
+DECLARE current_num int;
+SET current_num = 0;
+WHILE current_num < repeat_count do
+INSERT INTO t1 VALUES (NULL, '2010-10-21 00:00:00');
+INSERT INTO t1 VALUES (NULL, '2010-02-21 00:00:00');
+INSERT INTO t1 VALUES (NULL, '2010-03-21 00:00:00');
+INSERT INTO t1 VALUES (NULL, '2010-04-21 00:00:00');
+INSERT INTO t1 VALUES (NULL, '2010-06-21 00:00:00');
+INSERT INTO t1 VALUES (NULL, '2010-10-21 00:00:00');
+INSERT INTO t1 VALUES (NULL, '2012-02-21 00:00:00');
+COMMIT;
+SET current_num = current_num + 1;
+END WHILE;
+END|
+insert into t1 (id, dt) values (1, '2010-01-02 00:00:00');
+insert into t1 (id, dt) values (2, '2010-01-03 00:00:00');
+insert into t1 (id, dt) values (3, '2010-01-04 00:00:00');
+insert into t1 (id, dt) values (4, '2010-01-05 00:00:00');
+insert into t1 (id, dt) values (5, '2010-01-06 00:00:00');
+insert into t1 (id, dt) values (6, '2010-01-07 00:00:00');
+insert into t1 (id, dt) values (7, '2010-01-08 00:00:00');
+insert into t1 (id, dt) values (8, '2010-01-09 00:00:00');
+insert into t1 (id, dt) values (9, '2010-01-10 00:00:00');
+insert into t1 (id, dt) values (10, '2010-01-11 00:00:00');
+insert into t1 (id, dt) values (11, '2010-01-12 00:00:00');
+insert into t1 (id, dt) values (12, '2010-01-13 00:00:00');
+insert into t1 (id, dt) values (13, '2010-01-14 00:00:00');
+insert into t1 (id, dt) values (14, '2010-01-15 00:00:00');
+insert into t1 (id, dt) values (15, '2010-01-16 00:00:00');
+insert into t1 (id, dt) values (16, '2010-01-17 00:00:00');
+insert into t1 (id, dt) values (17, '2010-01-18 00:00:00');
+insert into t1 (id, dt) values (18, '2010-01-19 00:00:00');
+insert into t1 (id, dt) values (19, '2010-01-20 00:00:00');
+insert into t1 (id, dt) values (20, '2010-01-21 00:00:00');
+insert into t1 (id, dt) values (21, '2010-01-22 00:00:00');
+insert into t1 (id, dt) values (22, '2010-01-23 00:00:00');
+insert into t1 (id, dt) values (23, '2010-01-24 00:00:00');
+insert into t1 (id, dt) values (24, '2010-01-25 00:00:00');
+insert into t1 (id, dt) values (25, '2010-01-26 00:00:00');
+insert into t1 (id, dt) values (26, '2010-01-27 00:00:00');
+insert into t1 (id, dt) values (27, '2010-01-28 00:00:00');
+insert into t1 (id, dt) values (28, '2010-01-29 00:00:00');
+insert into t1 (id, dt) values (29, '2010-01-30 00:00:00');
+insert into t1 (id, dt) values (30, '2010-01-31 00:00:00');
+insert into t1 (id, dt) values (31, '2010-02-01 00:00:00');
+insert into t1 (id, dt) values (32, '2010-02-02 00:00:00');
+insert into t1 (id, dt) values (33, '2010-02-03 00:00:00');
+insert into t1 (id, dt) values (34, '2010-02-04 00:00:00');
+insert into t1 (id, dt) values (35, '2010-02-05 00:00:00');
+insert into t1 (id, dt) values (36, '2010-02-06 00:00:00');
+insert into t1 (id, dt) values (37, '2010-02-07 00:00:00');
+insert into t1 (id, dt) values (38, '2010-02-08 00:00:00');
+insert into t1 (id, dt) values (39, '2010-02-09 00:00:00');
+insert into t1 (id, dt) values (40, '2010-02-10 00:00:00');
+insert into t1 (id, dt) values (41, '2010-02-11 00:00:00');
+insert into t1 (id, dt) values (42, '2010-02-12 00:00:00');
+insert into t1 (id, dt) values (43, '2010-02-13 00:00:00');
+insert into t1 (id, dt) values (44, '2010-02-14 00:00:00');
+insert into t1 (id, dt) values (45, '2010-02-15 00:00:00');
+insert into t1 (id, dt) values (46, '2010-02-16 00:00:00');
+insert into t1 (id, dt) values (47, '2010-02-17 00:00:00');
+insert into t1 (id, dt) values (48, '2010-02-18 00:00:00');
+insert into t1 (id, dt) values (49, '2010-02-19 00:00:00');
+insert into t1 (id, dt) values (50, '2010-02-20 00:00:00');
+insert into t1 (id, dt) values (51, '2010-02-21 00:00:00');
+insert into t1 (id, dt) values (52, '2010-02-22 00:00:00');
+insert into t1 (id, dt) values (53, '2010-02-23 00:00:00');
+insert into t1 (id, dt) values (54, '2010-02-24 00:00:00');
+insert into t1 (id, dt) values (55, '2010-02-25 00:00:00');
+insert into t1 (id, dt) values (56, '2010-02-26 00:00:00');
+insert into t1 (id, dt) values (57, '2010-02-27 00:00:00');
+insert into t1 (id, dt) values (58, '2010-02-28 00:00:00');
+insert into t1 (id, dt) values (59, '2010-03-01 00:00:00');
+insert into t1 (id, dt) values (60, '2010-03-02 00:00:00');
+insert into t1 (id, dt) values (61, '2010-03-03 00:00:00');
+insert into t1 (id, dt) values (62, '2010-03-04 00:00:00');
+insert into t1 (id, dt) values (63, '2010-03-05 00:00:00');
+insert into t1 (id, dt) values (64, '2010-03-06 00:00:00');
+insert into t1 (id, dt) values (65, '2010-03-07 00:00:00');
+insert into t1 (id, dt) values (66, '2010-03-08 00:00:00');
+insert into t1 (id, dt) values (67, '2010-03-09 00:00:00');
+insert into t1 (id, dt) values (68, '2010-03-10 00:00:00');
+insert into t1 (id, dt) values (69, '2010-03-11 00:00:00');
+insert into t1 (id, dt) values (70, '2010-03-12 00:00:00');
+insert into t1 (id, dt) values (71, '2010-03-13 00:00:00');
+insert into t1 (id, dt) values (72, '2010-03-14 00:00:00');
+insert into t1 (id, dt) values (73, '2010-03-15 00:00:00');
+insert into t1 (id, dt) values (74, '2010-03-16 00:00:00');
+insert into t1 (id, dt) values (75, '2010-03-17 00:00:00');
+insert into t1 (id, dt) values (76, '2010-03-18 00:00:00');
+insert into t1 (id, dt) values (77, '2010-03-19 00:00:00');
+insert into t1 (id, dt) values (78, '2010-03-20 00:00:00');
+insert into t1 (id, dt) values (79, '2010-03-21 00:00:00');
+insert into t1 (id, dt) values (80, '2010-03-22 00:00:00');
+insert into t1 (id, dt) values (81, '2010-03-23 00:00:00');
+insert into t1 (id, dt) values (82, '2010-03-24 00:00:00');
+insert into t1 (id, dt) values (83, '2010-03-25 00:00:00');
+insert into t1 (id, dt) values (84, '2010-03-26 00:00:00');
+insert into t1 (id, dt) values (85, '2010-03-27 00:00:00');
+insert into t1 (id, dt) values (86, '2010-03-28 00:00:00');
+insert into t1 (id, dt) values (87, '2010-03-29 00:00:00');
+insert into t1 (id, dt) values (88, '2010-03-30 00:00:00');
+insert into t1 (id, dt) values (89, '2010-03-31 00:00:00');
+insert into t1 (id, dt) values (90, '2010-04-01 00:00:00');
+insert into t1 (id, dt) values (91, '2010-04-02 00:00:00');
+insert into t1 (id, dt) values (92, '2010-04-03 00:00:00');
+insert into t1 (id, dt) values (93, '2010-04-04 00:00:00');
+insert into t1 (id, dt) values (94, '2010-04-05 00:00:00');
+insert into t1 (id, dt) values (95, '2010-04-06 00:00:00');
+insert into t1 (id, dt) values (96, '2010-04-07 00:00:00');
+insert into t1 (id, dt) values (97, '2010-04-08 00:00:00');
+insert into t1 (id, dt) values (98, '2010-04-09 00:00:00');
+insert into t1 (id, dt) values (99, '2010-04-10 00:00:00');
+insert into t1 (id, dt) values (100, '2010-04-11 00:00:00');
+insert into t1 (id, dt) values (101, '2010-04-12 00:00:00');
+insert into t1 (id, dt) values (102, '2010-04-13 00:00:00');
+insert into t1 (id, dt) values (103, '2010-04-14 00:00:00');
+insert into t1 (id, dt) values (104, '2010-04-15 00:00:00');
+insert into t1 (id, dt) values (105, '2010-04-16 00:00:00');
+insert into t1 (id, dt) values (106, '2010-04-17 00:00:00');
+insert into t1 (id, dt) values (107, '2010-04-18 00:00:00');
+insert into t1 (id, dt) values (108, '2010-04-19 00:00:00');
+insert into t1 (id, dt) values (109, '2010-04-20 00:00:00');
+insert into t1 (id, dt) values (110, '2010-04-21 00:00:00');
+insert into t1 (id, dt) values (111, '2010-04-22 00:00:00');
+insert into t1 (id, dt) values (112, '2010-04-23 00:00:00');
+insert into t1 (id, dt) values (113, '2010-04-24 00:00:00');
+insert into t1 (id, dt) values (114, '2010-04-25 00:00:00');
+insert into t1 (id, dt) values (115, '2010-04-26 00:00:00');
+insert into t1 (id, dt) values (116, '2010-04-27 00:00:00');
+insert into t1 (id, dt) values (117, '2010-04-28 00:00:00');
+insert into t1 (id, dt) values (118, '2010-04-29 00:00:00');
+insert into t1 (id, dt) values (119, '2010-04-30 00:00:00');
+insert into t1 (id, dt) values (120, '2010-05-01 00:00:00');
+insert into t1 (id, dt) values (121, '2010-05-02 00:00:00');
+insert into t1 (id, dt) values (122, '2010-05-03 00:00:00');
+insert into t1 (id, dt) values (123, '2010-05-04 00:00:00');
+insert into t1 (id, dt) values (124, '2010-05-05 00:00:00');
+insert into t1 (id, dt) values (125, '2010-05-06 00:00:00');
+insert into t1 (id, dt) values (126, '2010-05-07 00:00:00');
+insert into t1 (id, dt) values (127, '2010-05-08 00:00:00');
+insert into t1 (id, dt) values (128, '2010-05-09 00:00:00');
+insert into t1 (id, dt) values (129, '2010-05-10 00:00:00');
+insert into t1 (id, dt) values (130, '2010-05-11 00:00:00');
+insert into t1 (id, dt) values (131, '2010-05-12 00:00:00');
+insert into t1 (id, dt) values (132, '2010-05-13 00:00:00');
+insert into t1 (id, dt) values (133, '2010-05-14 00:00:00');
+insert into t1 (id, dt) values (134, '2010-05-15 00:00:00');
+insert into t1 (id, dt) values (135, '2010-05-16 00:00:00');
+insert into t1 (id, dt) values (136, '2010-05-17 00:00:00');
+insert into t1 (id, dt) values (137, '2010-05-18 00:00:00');
+insert into t1 (id, dt) values (138, '2010-05-19 00:00:00');
+insert into t1 (id, dt) values (139, '2010-05-20 00:00:00');
+insert into t1 (id, dt) values (140, '2010-05-21 00:00:00');
+insert into t1 (id, dt) values (141, '2010-05-22 00:00:00');
+insert into t1 (id, dt) values (142, '2010-05-23 00:00:00');
+insert into t1 (id, dt) values (143, '2010-05-24 00:00:00');
+insert into t1 (id, dt) values (144, '2010-05-25 00:00:00');
+insert into t1 (id, dt) values (145, '2010-05-26 00:00:00');
+insert into t1 (id, dt) values (146, '2010-05-27 00:00:00');
+insert into t1 (id, dt) values (147, '2010-05-28 00:00:00');
+insert into t1 (id, dt) values (148, '2010-05-29 00:00:00');
+insert into t1 (id, dt) values (149, '2010-05-30 00:00:00');
+insert into t1 (id, dt) values (150, '2010-05-31 00:00:00');
+insert into t1 (id, dt) values (151, '2010-06-01 00:00:00');
+insert into t1 (id, dt) values (152, '2010-06-02 00:00:00');
+insert into t1 (id, dt) values (153, '2010-06-03 00:00:00');
+insert into t1 (id, dt) values (154, '2010-06-04 00:00:00');
+insert into t1 (id, dt) values (155, '2010-06-05 00:00:00');
+insert into t1 (id, dt) values (156, '2010-06-06 00:00:00');
+insert into t1 (id, dt) values (157, '2010-06-07 00:00:00');
+insert into t1 (id, dt) values (158, '2010-06-08 00:00:00');
+insert into t1 (id, dt) values (159, '2010-06-09 00:00:00');
+insert into t1 (id, dt) values (160, '2010-06-10 00:00:00');
+insert into t1 (id, dt) values (161, '2010-06-11 00:00:00');
+insert into t1 (id, dt) values (162, '2010-06-12 00:00:00');
+insert into t1 (id, dt) values (163, '2010-06-13 00:00:00');
+insert into t1 (id, dt) values (164, '2010-06-14 00:00:00');
+insert into t1 (id, dt) values (165, '2010-06-15 00:00:00');
+insert into t1 (id, dt) values (166, '2010-06-16 00:00:00');
+insert into t1 (id, dt) values (167, '2010-06-17 00:00:00');
+insert into t1 (id, dt) values (168, '2010-06-18 00:00:00');
+insert into t1 (id, dt) values (169, '2010-06-19 00:00:00');
+insert into t1 (id, dt) values (170, '2010-06-20 00:00:00');
+insert into t1 (id, dt) values (171, '2010-06-21 00:00:00');
+insert into t1 (id, dt) values (172, '2010-06-22 00:00:00');
+insert into t1 (id, dt) values (173, '2010-06-23 00:00:00');
+insert into t1 (id, dt) values (174, '2010-06-24 00:00:00');
+insert into t1 (id, dt) values (175, '2010-06-25 00:00:00');
+insert into t1 (id, dt) values (176, '2010-06-26 00:00:00');
+insert into t1 (id, dt) values (177, '2010-06-27 00:00:00');
+insert into t1 (id, dt) values (178, '2010-06-28 00:00:00');
+insert into t1 (id, dt) values (179, '2010-06-29 00:00:00');
+insert into t1 (id, dt) values (180, '2010-06-30 00:00:00');
+insert into t1 (id, dt) values (181, '2010-07-01 00:00:00');
+insert into t1 (id, dt) values (182, '2010-07-02 00:00:00');
+insert into t1 (id, dt) values (183, '2010-07-03 00:00:00');
+insert into t1 (id, dt) values (184, '2010-07-04 00:00:00');
+insert into t1 (id, dt) values (185, '2010-07-05 00:00:00');
+insert into t1 (id, dt) values (186, '2010-07-06 00:00:00');
+insert into t1 (id, dt) values (187, '2010-07-07 00:00:00');
+insert into t1 (id, dt) values (188, '2010-07-08 00:00:00');
+insert into t1 (id, dt) values (189, '2010-07-09 00:00:00');
+insert into t1 (id, dt) values (190, '2010-07-10 00:00:00');
+insert into t1 (id, dt) values (191, '2010-07-11 00:00:00');
+insert into t1 (id, dt) values (192, '2010-07-12 00:00:00');
+insert into t1 (id, dt) values (193, '2010-07-13 00:00:00');
+insert into t1 (id, dt) values (194, '2010-07-14 00:00:00');
+insert into t1 (id, dt) values (195, '2010-07-15 00:00:00');
+insert into t1 (id, dt) values (196, '2010-07-16 00:00:00');
+insert into t1 (id, dt) values (197, '2010-07-17 00:00:00');
+insert into t1 (id, dt) values (198, '2010-07-18 00:00:00');
+insert into t1 (id, dt) values (199, '2010-07-19 00:00:00');
+insert into t1 (id, dt) values (200, '2010-07-20 00:00:00');
+insert into t1 (id, dt) values (201, '2010-07-21 00:00:00');
+insert into t1 (id, dt) values (202, '2010-07-22 00:00:00');
+insert into t1 (id, dt) values (203, '2010-07-23 00:00:00');
+insert into t1 (id, dt) values (204, '2010-07-24 00:00:00');
+insert into t1 (id, dt) values (205, '2010-07-25 00:00:00');
+insert into t1 (id, dt) values (206, '2010-07-26 00:00:00');
+insert into t1 (id, dt) values (207, '2010-07-27 00:00:00');
+insert into t1 (id, dt) values (208, '2010-07-28 00:00:00');
+insert into t1 (id, dt) values (209, '2010-07-29 00:00:00');
+insert into t1 (id, dt) values (210, '2010-07-30 00:00:00');
+insert into t1 (id, dt) values (211, '2010-07-31 00:00:00');
+insert into t1 (id, dt) values (212, '2010-08-01 00:00:00');
+insert into t1 (id, dt) values (213, '2010-08-02 00:00:00');
+insert into t1 (id, dt) values (214, '2010-08-03 00:00:00');
+insert into t1 (id, dt) values (215, '2010-08-04 00:00:00');
+insert into t1 (id, dt) values (216, '2010-08-05 00:00:00');
+insert into t1 (id, dt) values (217, '2010-08-06 00:00:00');
+insert into t1 (id, dt) values (218, '2010-08-07 00:00:00');
+insert into t1 (id, dt) values (219, '2010-08-08 00:00:00');
+insert into t1 (id, dt) values (220, '2010-08-09 00:00:00');
+insert into t1 (id, dt) values (221, '2010-08-10 00:00:00');
+insert into t1 (id, dt) values (222, '2010-08-11 00:00:00');
+insert into t1 (id, dt) values (223, '2010-08-12 00:00:00');
+insert into t1 (id, dt) values (224, '2010-08-13 00:00:00');
+insert into t1 (id, dt) values (225, '2010-08-14 00:00:00');
+insert into t1 (id, dt) values (226, '2010-08-15 00:00:00');
+insert into t1 (id, dt) values (227, '2010-08-16 00:00:00');
+insert into t1 (id, dt) values (228, '2010-08-17 00:00:00');
+insert into t1 (id, dt) values (229, '2010-08-18 00:00:00');
+insert into t1 (id, dt) values (230, '2010-08-19 00:00:00');
+insert into t1 (id, dt) values (231, '2010-08-20 00:00:00');
+insert into t1 (id, dt) values (232, '2010-08-21 00:00:00');
+insert into t1 (id, dt) values (233, '2010-08-22 00:00:00');
+insert into t1 (id, dt) values (234, '2010-08-23 00:00:00');
+insert into t1 (id, dt) values (235, '2010-08-24 00:00:00');
+insert into t1 (id, dt) values (236, '2010-08-25 00:00:00');
+insert into t1 (id, dt) values (237, '2010-08-26 00:00:00');
+insert into t1 (id, dt) values (238, '2010-08-27 00:00:00');
+insert into t1 (id, dt) values (239, '2010-08-28 00:00:00');
+insert into t1 (id, dt) values (240, '2010-08-29 00:00:00');
+insert into t1 (id, dt) values (241, '2010-08-30 00:00:00');
+insert into t1 (id, dt) values (242, '2010-08-31 00:00:00');
+insert into t1 (id, dt) values (243, '2010-09-01 00:00:00');
+insert into t1 (id, dt) values (244, '2010-09-02 00:00:00');
+insert into t1 (id, dt) values (245, '2010-09-03 00:00:00');
+insert into t1 (id, dt) values (246, '2010-09-04 00:00:00');
+insert into t1 (id, dt) values (247, '2010-09-05 00:00:00');
+insert into t1 (id, dt) values (248, '2010-09-06 00:00:00');
+insert into t1 (id, dt) values (249, '2010-09-07 00:00:00');
+insert into t1 (id, dt) values (250, '2010-09-08 00:00:00');
+insert into t1 (id, dt) values (251, '2010-09-09 00:00:00');
+insert into t1 (id, dt) values (252, '2010-09-10 00:00:00');
+insert into t1 (id, dt) values (253, '2010-09-11 00:00:00');
+insert into t1 (id, dt) values (254, '2010-09-12 00:00:00');
+insert into t1 (id, dt) values (255, '2010-09-13 00:00:00');
+insert into t1 (id, dt) values (256, '2010-09-14 00:00:00');
+insert into t1 (id, dt) values (257, '2010-09-15 00:00:00');
+insert into t1 (id, dt) values (258, '2010-09-16 00:00:00');
+insert into t1 (id, dt) values (259, '2010-09-17 00:00:00');
+insert into t1 (id, dt) values (260, '2010-09-18 00:00:00');
+insert into t1 (id, dt) values (261, '2010-09-19 00:00:00');
+insert into t1 (id, dt) values (262, '2010-09-20 00:00:00');
+insert into t1 (id, dt) values (263, '2010-09-21 00:00:00');
+insert into t1 (id, dt) values (264, '2010-09-22 00:00:00');
+insert into t1 (id, dt) values (265, '2010-09-23 00:00:00');
+insert into t1 (id, dt) values (266, '2010-09-24 00:00:00');
+insert into t1 (id, dt) values (267, '2010-09-25 00:00:00');
+insert into t1 (id, dt) values (268, '2010-09-26 00:00:00');
+insert into t1 (id, dt) values (269, '2010-09-27 00:00:00');
+insert into t1 (id, dt) values (270, '2010-09-28 00:00:00');
+insert into t1 (id, dt) values (271, '2010-09-29 00:00:00');
+insert into t1 (id, dt) values (272, '2010-09-30 00:00:00');
+insert into t1 (id, dt) values (273, '2010-10-01 00:00:00');
+insert into t1 (id, dt) values (274, '2010-10-02 00:00:00');
+insert into t1 (id, dt) values (275, '2010-10-03 00:00:00');
+insert into t1 (id, dt) values (276, '2010-10-04 00:00:00');
+insert into t1 (id, dt) values (277, '2010-10-05 00:00:00');
+insert into t1 (id, dt) values (278, '2010-10-06 00:00:00');
+insert into t1 (id, dt) values (279, '2010-10-07 00:00:00');
+insert into t1 (id, dt) values (280, '2010-10-08 00:00:00');
+insert into t1 (id, dt) values (281, '2010-10-09 00:00:00');
+insert into t1 (id, dt) values (282, '2010-10-10 00:00:00');
+insert into t1 (id, dt) values (283, '2010-10-11 00:00:00');
+insert into t1 (id, dt) values (284, '2010-10-12 00:00:00');
+insert into t1 (id, dt) values (285, '2010-10-13 00:00:00');
+insert into t1 (id, dt) values (286, '2010-10-14 00:00:00');
+insert into t1 (id, dt) values (287, '2010-10-15 00:00:00');
+insert into t1 (id, dt) values (288, '2010-10-16 00:00:00');
+insert into t1 (id, dt) values (289, '2010-10-17 00:00:00');
+insert into t1 (id, dt) values (290, '2010-10-18 00:00:00');
+insert into t1 (id, dt) values (291, '2010-10-19 00:00:00');
+insert into t1 (id, dt) values (292, '2010-10-20 00:00:00');
+insert into t1 (id, dt) values (293, '2010-10-21 00:00:00');
+insert into t1 (id, dt) values (294, '2010-10-22 00:00:00');
+insert into t1 (id, dt) values (295, '2010-10-23 00:00:00');
+insert into t1 (id, dt) values (296, '2010-10-24 00:00:00');
+insert into t1 (id, dt) values (297, '2010-10-25 00:00:00');
+insert into t1 (id, dt) values (298, '2010-10-26 00:00:00');
+insert into t1 (id, dt) values (299, '2010-10-27 00:00:00');
+insert into t1 (id, dt) values (300, '2010-10-28 00:00:00');
+insert into t1 (id, dt) values (301, '2010-10-29 00:00:00');
+insert into t1 (id, dt) values (302, '2010-10-30 00:00:00');
+insert into t1 (id, dt) values (303, '2010-10-31 00:00:00');
+insert into t1 (id, dt) values (304, '2010-11-01 00:00:00');
+insert into t1 (id, dt) values (305, '2010-11-02 00:00:00');
+insert into t1 (id, dt) values (306, '2010-11-03 00:00:00');
+insert into t1 (id, dt) values (307, '2010-11-04 00:00:00');
+insert into t1 (id, dt) values (308, '2010-11-05 00:00:00');
+insert into t1 (id, dt) values (309, '2010-11-06 00:00:00');
+insert into t1 (id, dt) values (310, '2010-11-07 00:00:00');
+insert into t1 (id, dt) values (311, '2010-11-08 00:00:00');
+insert into t1 (id, dt) values (312, '2010-11-09 00:00:00');
+insert into t1 (id, dt) values (313, '2010-11-10 00:00:00');
+insert into t1 (id, dt) values (314, '2010-11-11 00:00:00');
+insert into t1 (id, dt) values (315, '2010-11-12 00:00:00');
+insert into t1 (id, dt) values (316, '2010-11-13 00:00:00');
+insert into t1 (id, dt) values (317, '2010-11-14 00:00:00');
+insert into t1 (id, dt) values (318, '2010-11-15 00:00:00');
+insert into t1 (id, dt) values (319, '2010-11-16 00:00:00');
+insert into t1 (id, dt) values (320, '2010-11-17 00:00:00');
+insert into t1 (id, dt) values (321, '2010-11-18 00:00:00');
+insert into t1 (id, dt) values (322, '2010-11-19 00:00:00');
+insert into t1 (id, dt) values (323, '2010-11-20 00:00:00');
+insert into t1 (id, dt) values (324, '2010-11-21 00:00:00');
+insert into t1 (id, dt) values (325, '2010-11-22 00:00:00');
+insert into t1 (id, dt) values (326, '2010-11-23 00:00:00');
+insert into t1 (id, dt) values (327, '2010-11-24 00:00:00');
+insert into t1 (id, dt) values (328, '2010-11-25 00:00:00');
+insert into t1 (id, dt) values (329, '2010-11-26 00:00:00');
+insert into t1 (id, dt) values (330, '2010-11-27 00:00:00');
+insert into t1 (id, dt) values (331, '2010-11-28 00:00:00');
+insert into t1 (id, dt) values (332, '2010-11-29 00:00:00');
+insert into t1 (id, dt) values (333, '2010-11-30 00:00:00');
+insert into t1 (id, dt) values (334, '2010-12-01 00:00:00');
+insert into t1 (id, dt) values (335, '2010-12-02 00:00:00');
+insert into t1 (id, dt) values (336, '2010-12-03 00:00:00');
+insert into t1 (id, dt) values (337, '2010-12-04 00:00:00');
+insert into t1 (id, dt) values (338, '2010-12-05 00:00:00');
+insert into t1 (id, dt) values (339, '2010-12-06 00:00:00');
+insert into t1 (id, dt) values (340, '2010-12-07 00:00:00');
+insert into t1 (id, dt) values (341, '2010-12-08 00:00:00');
+insert into t1 (id, dt) values (342, '2010-12-09 00:00:00');
+insert into t1 (id, dt) values (343, '2010-12-10 00:00:00');
+insert into t1 (id, dt) values (344, '2010-12-11 00:00:00');
+insert into t1 (id, dt) values (345, '2010-12-12 00:00:00');
+insert into t1 (id, dt) values (346, '2010-12-13 00:00:00');
+insert into t1 (id, dt) values (347, '2010-12-14 00:00:00');
+insert into t1 (id, dt) values (348, '2010-12-15 00:00:00');
+insert into t1 (id, dt) values (349, '2010-12-16 00:00:00');
+insert into t1 (id, dt) values (350, '2010-12-17 00:00:00');
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+350
+connection node_2;
+call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
+call p1(100);;
+connection node_3;
+call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
+call p1(100);;
+connection node_4;
+call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
+call p1(100);;
+connection node_1;
+SET SESSION wsrep_OSU_method='RSU';
+SELECT @@wsrep_OSU_method;
+@@wsrep_OSU_method
+RSU
+SET SESSION sql_log_bin = 0;
+ALTER TABLE t1 DROP PARTITION rx2009xx;
+ALTER TABLE t1 DROP PARTITION rx201004;
+ALTER TABLE t1 DROP PARTITION rx201008;
+SET SESSION wsrep_OSU_METHOD='TOI';
+SELECT @@wsrep_OSU_method;
+@@wsrep_OSU_method
+TOI
+connection node_2;
+connection node_3;
+connection node_4;
+connection node_1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/galera/r/galera_roles.result b/mysql-test/suite/galera/r/galera_roles.result
index bef89acfc92..7d6c57e8131 100644
--- a/mysql-test/suite/galera/r/galera_roles.result
+++ b/mysql-test/suite/galera/r/galera_roles.result
@@ -26,8 +26,8 @@ connect foo_node_2,127.0.0.1,foo,,test,$port_2,;
connection foo_node_1;
SHOW GRANTS;
Grants for foo@localhost
-GRANT role1 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
+GRANT `role1` TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `foo`@`localhost`
FLUSH TABLES;
ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
SELECT * FROM mysql.roles_mapping;
@@ -62,8 +62,8 @@ pr1
connection foo_node_2;
SHOW GRANTS;
Grants for foo@localhost
-GRANT role1 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
+GRANT `role1` TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `foo`@`localhost`
FLUSH TABLES;
ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
SELECT * FROM mysql.roles_mapping;
@@ -129,7 +129,7 @@ SELECT a FROM test1.t2;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't2'
SHOW GRANTS;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
ROLE_NAME
NULL
@@ -151,7 +151,7 @@ SELECT a FROM test1.t2;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't2'
SHOW GRANTS;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
ROLE_NAME
NULL
diff --git a/mysql-test/suite/galera/r/galera_rsu_add_pk.result b/mysql-test/suite/galera/r/galera_rsu_add_pk.result
index 4c79da154e2..2df08c3e4ff 100644
--- a/mysql-test/suite/galera/r/galera_rsu_add_pk.result
+++ b/mysql-test/suite/galera/r/galera_rsu_add_pk.result
@@ -9,19 +9,19 @@ SET SESSION wsrep_OSU_method = "RSU";
ALTER TABLE t1 ADD PRIMARY KEY (f1);
SET SESSION wsrep_OSU_method = "TOI";
INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
-SELECT COUNT(*) = 300000 FROM t1;
-COUNT(*) = 300000
-1
-SELECT MAX(f1) = 299999 FROM t1;
-MAX(f1) = 299999
-1
+SELECT COUNT(*) AS EXPECT_300000 FROM t1;
+EXPECT_300000
+300000
+SELECT MAX(f1) AS EXPECT_299999 FROM t1;
+EXPECT_299999
+299999
connection node_1;
-SELECT COUNT(*) = 300000 FROM t1;
-COUNT(*) = 300000
-1
-SELECT MAX(f1) = 299999 FROM t1;
-MAX(f1) = 299999
-1
+SELECT COUNT(*) AS EXPECT_300000 FROM t1;
+EXPECT_300000
+300000
+SELECT MAX(f1) AS EXPECT_299999 FROM t1;
+EXPECT_299999
+299999
SET SESSION wsrep_OSU_method = "RSU";
ALTER TABLE t1 ADD PRIMARY KEY (f1);
SET SESSION wsrep_OSU_method = "TOI";
diff --git a/mysql-test/suite/galera/r/galera_rsu_drop_pk.result b/mysql-test/suite/galera/r/galera_rsu_drop_pk.result
index f64649ef4e2..a8b623cc37f 100644
--- a/mysql-test/suite/galera/r/galera_rsu_drop_pk.result
+++ b/mysql-test/suite/galera/r/galera_rsu_drop_pk.result
@@ -1,5 +1,5 @@
connection node_1;
-CREATE TABLE ten (f1 INTEGER);
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
@@ -9,19 +9,19 @@ SET SESSION wsrep_OSU_method = "RSU";
ALTER TABLE t1 DROP PRIMARY KEY;
SET SESSION wsrep_OSU_method = "TOI";
INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
-SELECT COUNT(*) = 300000 FROM t1;
-COUNT(*) = 300000
-1
-SELECT MAX(f1) = 299999 FROM t1;
-MAX(f1) = 299999
-1
+SELECT COUNT(*) as expect_300000 FROM t1;
+expect_300000
+300000
+SELECT MAX(f1) as expect_299999 FROM t1;
+expect_299999
+299999
connection node_1;
-SELECT COUNT(*) = 300000 FROM t1;
-COUNT(*) = 300000
-1
-SELECT MAX(f1) = 299999 FROM t1;
-MAX(f1) = 299999
-1
+SELECT COUNT(*) as expect_300000 FROM t1;
+expect_300000
+300000
+SELECT MAX(f1) as expect_299999 FROM t1;
+expect_299999
+299999
SET SESSION wsrep_OSU_method = "RSU";
ALTER TABLE t1 DROP PRIMARY KEY;
SET SESSION wsrep_OSU_method = "TOI";
@@ -29,20 +29,20 @@ connection node_2;
INSERT INTO t1 (f1) VALUES (1);
INSERT INTO t1 (f1) VALUES (10);
connection node_1;
-SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1;
-COUNT(*) = 2
-1
-SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 10;
-COUNT(*) = 2
-1
+SELECT COUNT(*) as expect_2 FROM t1 WHERE f1 = 1;
+expect_2
+2
+SELECT COUNT(*) as expect_2 FROM t1 WHERE f1 = 10;
+expect_2
+2
INSERT INTO t1 (f1) VALUES (100);
INSERT INTO t1 (f1) VALUES (1000);
connection node_2;
-SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 100;
-COUNT(*) = 2
-1
-SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1000;
-COUNT(*) = 2
-1
+SELECT COUNT(*) as expect_2 FROM t1 WHERE f1 = 100;
+expect_2
+2
+SELECT COUNT(*) as expect_2 FROM t1 WHERE f1 = 1000;
+expect_2
+2
DROP TABLE t1;
DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_slave_replay.result b/mysql-test/suite/galera/r/galera_slave_replay.result
new file mode 100644
index 00000000000..760617be5f7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_slave_replay.result
@@ -0,0 +1,95 @@
+connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+connection node_2a;
+connection node_1;
+RESET MASTER;
+connection node_2a;
+START SLAVE;
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (3, 'a');
+set binlog_format=STATEMENT;
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+SELECT * FROM t1 FOR UPDATE;
+f1 f2
+1 a
+3 a
+UPDATE t1 SET f2 = 'c' WHERE f1 > 1;
+connection node_2a;
+SET SESSION wsrep_sync_wait = 0;
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+connection node_3;
+SET SESSION wsrep_sync_wait = 0;
+connection node_2a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
+connection node_3;
+INSERT INTO test.t1 VALUES (2, 'b');
+connection node_1;
+COMMIT;
+connection node_2a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL debug_dbug = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+connection node_2a;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+connection node_1;
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+COUNT(*) = 1
+1
+SELECT * FROM t1;
+f1 f2
+1 a
+3 c
+connection node_2a;
+set session wsrep_sync_wait=15;
+set session wsrep_sync_wait=0;
+wsrep_local_replays
+1
+SELECT * FROM t1;
+f1 f2
+1 a
+2 b
+3 c
+SET DEBUG_SYNC = "RESET";
+#
+# test phase with real abort
+#
+connection node_1;
+set binlog_format=ROW;
+insert into t1 values (4, 'd');
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'd' WHERE f1 = 3;
+connection node_2a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
+connection node_3;
+UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3;
+connection node_1;
+COMMIT;
+connection node_2a;
+SET GLOBAL debug_dbug = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+connection node_2a;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+SET DEBUG_SYNC = "RESET";
+connection node_2a;
+set session wsrep_sync_wait=15;
+SELECT COUNT(*) = 1 FROM test.t1 WHERE f2 = 'e';
+COUNT(*) = 1
+1
+set session wsrep_sync_wait=0;
+STOP SLAVE;
+RESET SLAVE;
+DROP TABLE t1;
+connection node_1;
+DROP TABLE t1;
+RESET MASTER;
diff --git a/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
index 020efb7b8f1..50938d61a4b 100644
--- a/mysql-test/suite/galera/r/galera_var_dirty_reads.result
+++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("WSREP has not yet prepared node for application use");
connection node_1;
connection node_2;
connection node_2;
@@ -16,9 +17,9 @@ SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SELECT * FROM t1;
-ERROR 08S01: WSREP has not yet prepared node for application use
+Got one of the listed errors
SELECT 1 FROM t1;
-ERROR 08S01: WSREP has not yet prepared node for application use
+Got one of the listed errors
SET @@session.wsrep_dirty_reads=ON;
SELECT * FROM t1;
i
@@ -31,7 +32,7 @@ i variable_name variable_value
1 WSREP_DIRTY_READS ON
SET @@session.wsrep_dirty_reads=OFF;
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
-ERROR 08S01: WSREP has not yet prepared node for application use
+Got one of the listed errors
SELECT 1;
1
1
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 3f0dd57aa3b..823407fbba7 100644
--- a/mysql-test/suite/galera/r/galera_var_notify_cmd.result
+++ b/mysql-test/suite/galera/r/galera_var_notify_cmd.result
@@ -1,10 +1,11 @@
connection node_1;
-SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership;
-COUNT(DISTINCT uuid) = 2
-1
-SELECT MAX(size) = 2 FROM mtr_wsrep_notify.status;
-MAX(size) = 2
-1
-SELECT COUNT(DISTINCT idx) = 2 FROM mtr_wsrep_notify.status;
-COUNT(DISTINCT idx) = 2
-1
+SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
+EXPECT_2
+2
+SELECT MAX(size) AS EXPECT_2 FROM mtr_wsrep_notify.status;
+EXPECT_2
+2
+SELECT COUNT(DISTINCT idx) AS EXPECT_2 FROM mtr_wsrep_notify.status;
+EXPECT_2
+2
+DROP SCHEMA mtr_wsrep_notify;
diff --git a/mysql-test/suite/galera/r/galera_var_reject_queries.result b/mysql-test/suite/galera/r/galera_var_reject_queries.result
index caf98566595..22e2e6d764a 100644
--- a/mysql-test/suite/galera/r/galera_var_reject_queries.result
+++ b/mysql-test/suite/galera/r/galera_var_reject_queries.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("WSREP has not yet prepared node for application use");
CREATE TABLE t1 (f1 INTEGER);
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1;
@@ -5,14 +6,14 @@ SET SESSION wsrep_reject_queries = ALL;
ERROR HY000: Variable 'wsrep_reject_queries' is a GLOBAL variable and should be set with SET GLOBAL
SET GLOBAL wsrep_reject_queries = ALL;
SELECT * FROM t1;
-ERROR 08S01: WSREP has not yet prepared node for application use
+Got one of the listed errors
SET GLOBAL wsrep_reject_queries = ALL_KILL;
connection node_1a;
SELECT * FROM t1;
Got one of the listed errors
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SELECT * FROM t1;
-ERROR 08S01: WSREP has not yet prepared node for application use
+Got one of the listed errors
connection node_2;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
diff --git a/mysql-test/suite/galera/r/lp1376747-4.result b/mysql-test/suite/galera/r/lp1376747-4.result
index f1d32aa8f69..a7c1e7d6e9d 100644
--- a/mysql-test/suite/galera/r/lp1376747-4.result
+++ b/mysql-test/suite/galera/r/lp1376747-4.result
@@ -3,18 +3,13 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SET session wsrep_sync_wait=0;
-SET session wsrep_causal_reads=OFF;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
FLUSH TABLE WITH READ LOCK;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
connection node_2a;
SET session wsrep_sync_wait=0;
-SET session wsrep_causal_reads=OFF;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
+# node_1 DDL should not yet be applied
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -24,6 +19,7 @@ t1 CREATE TABLE `t1` (
FLUSH TABLES t1 WITH READ LOCK;;
connection node_2;
UNLOCK TABLES;
+# node_1 DDL should not yet be applied 2
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -32,6 +28,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection node_2a;
UNLOCK TABLES;
+# node_1 DDL should be applied 2
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/galera/t/MW-284.test b/mysql-test/suite/galera/t/MW-284.test
index 5e17baa1bdb..568826db5b0 100644
--- a/mysql-test/suite/galera/t/MW-284.test
+++ b/mysql-test/suite/galera/t/MW-284.test
@@ -2,10 +2,13 @@
# MW-284 Slave I/O retry on ER_COM_UNKNOWN_ERROR
#
+--source include/have_log_bin.inc
--source include/galera_cluster.inc
---source include/have_innodb.inc
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+call mtr.add_suppression("\\[ERROR\\] Error reading packet from server: WSREP has not yet prepared node for application use .*");
+call mtr.add_suppression("WSREP has not yet prepared node for application use");
+
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_USER='root', MASTER_CONNECT_RETRY=1;
--enable_query_log
@@ -18,11 +21,14 @@ SET SESSION wsrep_on = OFF;
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'
--source include/wait_condition.inc
SET SESSION wsrep_on = ON;
+
#wsrep_sync_wait is set to zero because when slave tries to connect it it ask for queries like SELECT UNIX_TIMESTAMP() on node 1 which will fail, causing
#a warning in slave error log.
SET global wsrep_sync_wait=0;
--connection node_3
+SELECT @@wsrep_on;
+--sleep 1
START SLAVE;
--let $slave_param= Slave_IO_Running
--let $slave_param_value= Connecting
@@ -50,8 +56,8 @@ INSERT INTO t1 VALUES (1);
--connection node_1
DROP TABLE t1;
-
--eval SET global wsrep_sync_wait=$wsrep_sync_wait_state
+
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
--source include/wait_condition.inc
@@ -60,11 +66,5 @@ STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('failed registering on master');
-CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
---connection node_1
-RESET MASTER;
-CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
---connection node_2
-CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member'); \ No newline at end of file
diff --git a/mysql-test/suite/galera/t/MW-313-master.opt b/mysql-test/suite/galera/t/MW-313-master.opt
deleted file mode 100644
index 8a755e98b00..00000000000
--- a/mysql-test/suite/galera/t/MW-313-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/MW-313.cnf b/mysql-test/suite/galera/t/MW-313.cnf
new file mode 100644
index 00000000000..184900c58fd
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-313.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+log-bin
+log-slave-updates
+
+[mysqld.2]
+log-bin
+log-slave-updates
+
+
+
diff --git a/mysql-test/suite/galera/t/MW-328C.test b/mysql-test/suite/galera/t/MW-328C.test
deleted file mode 100644
index 1594547d0de..00000000000
--- a/mysql-test/suite/galera/t/MW-328C.test
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# MW-328 Fix unnecessary/silent BF aborts
-#
-
-#
-# Make sure that a high value of wsrep_retry_autocommit
-# masks all deadlock errors
-#
-
---source include/galera_cluster.inc
---source include/big_test.inc
---source suite/galera/t/MW-328-header.inc
-
---connection node_2
---let $count = 100
-
-SET SESSION wsrep_retry_autocommit = 10000;
-
---disable_query_log
-
-while ($count)
-{
- --error 0
- INSERT IGNORE INTO t2 SELECT f2 FROM t1;
-
- --disable_result_log
- --error 0
- SELECT 1 FROM DUAL;
- --enable_result_log
-
- --dec $count
-}
-
---enable_query_log
-
---source suite/galera/t/MW-328-footer.inc
diff --git a/mysql-test/suite/galera/t/MW-329-master.opt b/mysql-test/suite/galera/t/MW-329-master.opt
deleted file mode 100644
index 6565a6af3c4..00000000000
--- a/mysql-test/suite/galera/t/MW-329-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---wsrep-retry-autocommit=0
diff --git a/mysql-test/suite/galera/t/MW-329.cnf b/mysql-test/suite/galera/t/MW-329.cnf
new file mode 100644
index 00000000000..10870a81547
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-329.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep-retry-autocommit=0
+
+[mysqld.2]
+
+
+
diff --git a/mysql-test/suite/galera/t/MW-336.test b/mysql-test/suite/galera/t/MW-336.test
index 0e92094da6c..83943c7d8ea 100644
--- a/mysql-test/suite/galera/t/MW-336.test
+++ b/mysql-test/suite/galera/t/MW-336.test
@@ -17,20 +17,31 @@ SET GLOBAL wsrep_slave_threads = 10;
--let $wait_condition_on_error_output = SELECT COUNT(*), 10 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
--source include/wait_condition_with_debug.inc
+SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+
SET GLOBAL wsrep_slave_threads = 1;
--connection node_2
INSERT INTO t1 VALUES (1);
--connection node_1
+--echo # Wait until one of the appliers has exited
+--let $wait_condition = SELECT VARIABLE_VALUE = 9 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+--let $wait_condition_on_error_output = SELECT COUNT(*), 9 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
+--source include/wait_condition_with_debug.inc
+
+SELECT VARIABLE_VALUE AS EXPECT_9 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+
SET GLOBAL wsrep_slave_threads = 10;
# Note that above insert could be handled by one of the slave threads
--echo # Set slave threads to 10 step 2
---let $wait_condition = SELECT VARIABLE_VALUE >= 9 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
---let $wait_condition_on_error_output = SELECT COUNT(*), 9 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
+--let $wait_condition = SELECT VARIABLE_VALUE = 10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+--let $wait_condition_on_error_output = SELECT COUNT(*), 10 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
--source include/wait_condition_with_debug.inc
+SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+
SET GLOBAL wsrep_slave_threads = 20;
--echo # Set slave threads to 20
@@ -38,6 +49,8 @@ SET GLOBAL wsrep_slave_threads = 20;
--let $wait_condition_on_error_output = SELECT COUNT(*), 20 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
--source include/wait_condition_with_debug.inc
+SELECT VARIABLE_VALUE AS EXPECT_20 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+
SET GLOBAL wsrep_slave_threads = 1;
--connection node_2
@@ -51,30 +64,57 @@ INSERT INTO t1 VALUES (7);
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (9);
INSERT INTO t1 VALUES (10);
-
---connection node_1
-SET GLOBAL wsrep_slave_threads = 10;
-SELECT COUNT(*) FROM t1;
---echo # Set slave threads to 10 step 3
---let $wait_condition = SELECT VARIABLE_VALUE = 10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
---let $wait_condition_on_error_output = SELECT COUNT(*), 10 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
---source include/wait_condition_with_debug.inc
-
---connection node_2
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
INSERT INTO t1 VALUES (14);
-INSERT INTO t1 VALUES (15);
INSERT INTO t1 VALUES (16);
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
INSERT INTO t1 VALUES (20);
+
+--connection node_1
+--echo # Wait until 19 of the appliers has exited
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+--let $wait_condition_on_error_output = SELECT COUNT(*), 1 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
+--source include/wait_condition_with_debug.inc
+
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+
+SELECT COUNT(*) FROM t1;
+
+SET GLOBAL wsrep_slave_threads = 10;
+--echo # Set slave threads to 10 step 3
+--let $wait_condition = SELECT VARIABLE_VALUE = 10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+--let $wait_condition_on_error_output = SELECT COUNT(*), 10 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
+--source include/wait_condition_with_debug.inc
+
+SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+
+--connection node_1
+SET GLOBAL wsrep_slave_threads = 1;
+
+--connection node_2
INSERT INTO t1 VALUES (21);
INSERT INTO t1 VALUES (22);
+INSERT INTO t1 VALUES (23);
+INSERT INTO t1 VALUES (24);
+INSERT INTO t1 VALUES (25);
+INSERT INTO t1 VALUES (26);
+INSERT INTO t1 VALUES (27);
+INSERT INTO t1 VALUES (28);
+INSERT INTO t1 VALUES (29);
+INSERT INTO t1 VALUES (30);
--connection node_1
+--echo # Wait until slave threads back to 1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+--let $wait_condition_on_error_output = SELECT COUNT(*), 1 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
+--source include/wait_condition_with_debug.inc
+
+SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
+
SELECT COUNT(*) FROM t1;
-SET GLOBAL wsrep_slave_threads = 1;
+
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-388.test b/mysql-test/suite/galera/t/MW-388.test
index 042b7e2fee5..09fc8a8bfc9 100644
--- a/mysql-test/suite/galera/t/MW-388.test
+++ b/mysql-test/suite/galera/t/MW-388.test
@@ -31,6 +31,8 @@ DELIMITER ;|
SET GLOBAL wsrep_slave_threads = 2;
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb";
+--let $expected_cert_failures = `SELECT VARIABLE_VALUE + 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'`
+
--connection node_2
--send INSERT INTO t1 VALUES (1, 'node 2');
@@ -40,15 +42,15 @@ SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
--connection node_1
SET SESSION wsrep_sync_wait = 0;
-SET SESSION DEBUG_SYNC = 'wsrep_after_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
--send CALL insert_proc ();
--connection node_1a
-SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached";
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT VARIABLE_VALUE = $expected_cert_failures FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'
+--source include/wait_condition.inc
SET GLOBAL DEBUG_DBUG = "";
-SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
--connection node_2
diff --git a/mysql-test/suite/galera/t/MW-44-master.opt b/mysql-test/suite/galera/t/MW-44-master.opt
index 9b086195e8a..a15aa0a99d9 100644
--- a/mysql-test/suite/galera/t/MW-44-master.opt
+++ b/mysql-test/suite/galera/t/MW-44-master.opt
@@ -1,2 +1 @@
--log-output=TABLE
---general-log=OFF
diff --git a/mysql-test/suite/galera/t/MW-44.test b/mysql-test/suite/galera/t/MW-44.test
index 8730631edc6..a2acfc57f6c 100644
--- a/mysql-test/suite/galera/t/MW-44.test
+++ b/mysql-test/suite/galera/t/MW-44.test
@@ -3,40 +3,30 @@
#
--source include/galera_cluster.inc
---source include/have_innodb.inc
--connection node_1
TRUNCATE TABLE mysql.general_log;
---sleep 1
--connection node_2
---let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log;
---source include/wait_condition.inc
-TRUNCATE TABLE mysql.general_log;
+--let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE '%mysql.general_log%'
+--let $wait_condition_on_error_output = SELECT * FROM mysql.general_log
+--source include/wait_condition_with_debug.inc
---sleep 1
--connection node_1
---let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log;
---source include/wait_condition.inc
-SELECT Argument FROM mysql.general_log;
-
-SET GLOBAL general_log='ON';
SET SESSION wsrep_osu_method=TOI;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_osu_method=RSU;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
SET SESSION wsrep_osu_method=TOI;
---let $wait_condition = SELECT COUNT(argument) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
---source include/wait_condition.inc
-
-SELECT argument FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
+--let $wait_condition = SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE "CREATE%" OR argument LIKE "ALTER%"
+--let $wait_condition_on_error_output = SELECT * FROM mysql.general_log
+--source include/wait_condition_with_debug.inc
--connection node_2
-SELECT Argument FROM mysql.general_log;
-DROP TABLE t1;
-SET GLOBAL general_log='OFF';
---connection node_1
-SET GLOBAL general_log='OFF';
+--let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument LIKE "CREATE%" OR argument LIKE "ALTER%"
+--let $wait_condition_on_error_output = SELECT * FROM mysql.general_log
+--source include/wait_condition_with_debug.inc
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MW-86-wait1-master.opt b/mysql-test/suite/galera/t/MW-86-wait1-master.opt
deleted file mode 100644
index 8a755e98b00..00000000000
--- a/mysql-test/suite/galera/t/MW-86-wait1-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/MW-86-wait8-master.opt b/mysql-test/suite/galera/t/MW-86-wait8-master.opt
deleted file mode 100644
index 8a755e98b00..00000000000
--- a/mysql-test/suite/galera/t/MW-86-wait8-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/MW-86-wait8.cnf b/mysql-test/suite/galera/t/MW-86-wait8.cnf
new file mode 100644
index 00000000000..8f6a760def0
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-86-wait8.cnf
@@ -0,0 +1,10 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+log-bin
+log-slave-updates
+
+[mysqld.2]
+log-bin
+log-slave-updates
+
diff --git a/mysql-test/suite/galera/t/enforce_storage_engine2.cnf b/mysql-test/suite/galera/t/enforce_storage_engine2.cnf
new file mode 100644
index 00000000000..b14fce85b36
--- /dev/null
+++ b/mysql-test/suite/galera/t/enforce_storage_engine2.cnf
@@ -0,0 +1,13 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+enforce_storage_engine=innodb
+sql_mode=''
+
+[mysqld.2]
+enforce_storage_engine=innodb
+sql_mode=''
+
+
+
+
diff --git a/mysql-test/suite/galera/t/enforce_storage_engine2.opt b/mysql-test/suite/galera/t/enforce_storage_engine2.opt
deleted file mode 100644
index 03f7dc5e527..00000000000
--- a/mysql-test/suite/galera/t/enforce_storage_engine2.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---enforce_storage_engine=innodb --sql_mode=''
-
diff --git a/mysql-test/suite/galera/t/galera_account_management.test b/mysql-test/suite/galera/t/galera_account_management.test
deleted file mode 100644
index 6dea0fcfa9e..00000000000
--- a/mysql-test/suite/galera/t/galera_account_management.test
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# Test the account management statements - GRANT, REVOKE, etc.
-#
-
---source include/galera_cluster.inc
---source include/have_innodb.inc
-
-#
-# CREATE USER
-#
---connection node_1
-CREATE USER user1, user2 IDENTIFIED BY 'password';
-
---connection node_2
-SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
-
-#
-# ALTER USER
-#
-
---connection node_1
-ALTER USER user1 PASSWORD EXPIRE;
-SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
-
---connection node_2
-SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
-
-#
-# RENAME USER
-#
-
---connection node_1
-RENAME USER user2 TO user3;
-
---connection node_2
-SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
-SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3';
-
-#
-# SET PASSWORD
-#
-
---connection node_1
-SET PASSWORD FOR user3 = PASSWORD('foo');
-
---connection node_1
-SELECT password != '' FROM mysql.user WHERE user = 'user3';
-
-#
-# DROP USER
-#
---connection node_1
-DROP USER user1, user3;
-
---connection node_2
-SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2');
-
-#
-# GRANT
-#
-
---connection node_1
-GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password';
-
---connection node_2
-SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4';
-SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4';
-
-#
-# GRANT PROXY ON
-#
---connection node_1
-CREATE USER user5;
-GRANT PROXY ON user4 TO user5;
-
---connection node_2
-SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5';
-
-#
-# REVOKE
-#
-
---connection node_1
-REVOKE ALL PRIVILEGES ON *.* FROM user4;
-
---connection node_2
-SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4';
-
-#
-# REVOKE PROXY
-#
-
---connection node_1
-REVOKE PROXY ON user4 FROM user5;
-
---connection node_2
-SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5';
-
-DROP USER user4, user5;
diff --git a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt
deleted file mode 100644
index d8ecaacaa4c..00000000000
--- a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lock_wait_timeout=5 --innodb_lock_wait_timeout=5 --wait_timeout=5
diff --git a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf
new file mode 100644
index 00000000000..4d93a1b2509
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf
@@ -0,0 +1,14 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+lock_wait_timeout=5
+innodb_lock_wait_timeout=5
+wait_timeout=5
+
+[mysqld.2]
+lock_wait_timeout=5
+innodb_lock_wait_timeout=5
+wait_timeout=5
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid.cnf b/mysql-test/suite/galera/t/galera_as_master_gtid.cnf
deleted file mode 100644
index 19517556331..00000000000
--- a/mysql-test/suite/galera/t/galera_as_master_gtid.cnf
+++ /dev/null
@@ -1,8 +0,0 @@
-!include ../galera_2nodes_as_master.cnf
-
-[mysqld]
-gtid-mode=ON
-log-bin=mysqld-bin
-log-slave-updates
-enforce-gtid-consistency
-binlog-format=ROW
diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid.test b/mysql-test/suite/galera/t/galera_as_master_gtid.test
deleted file mode 100644
index 9db104b7cab..00000000000
--- a/mysql-test/suite/galera/t/galera_as_master_gtid.test
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# Test Galera as a master to a MySQL slave with GTID
-#
-# The galera/galera_2node_master.cnf describes the setup of the nodes
-#
-# We check that all transactions originating from within Galera use a UUID that is
-# different from the server_uuid of either node
-#
-#
-
---source include/have_innodb.inc
---source include/have_log_bin.inc
---source include/galera_cluster.inc
-
---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
---disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
---enable_query_log
-START SLAVE USER='root';
-
---connection node_1
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t1 VALUES(1);
-
---let $effective_uuid = `SELECT LEFT(@@global.gtid_executed, 36)`
---disable_query_log
---eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match;
---enable_query_log
-
---replace_result $effective_uuid <effective_uuid>
---replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
-SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 120;
-
---connection node_2
-INSERT INTO t1 VALUES(2);
-
---disable_query_log
---eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match;
---eval SELECT '$effective_uuid' = LEFT(@@global.gtid_executed, 36) AS uuids_match;
---enable_query_log
-
---replace_result $effective_uuid <effective_uuid>
---replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
-SHOW BINLOG EVENTS IN 'mysqld-bin.000003' FROM 120;
-
---connection node_3
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
-
---let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
---source include/wait_condition.inc
-
---disable_query_log
---eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match;
---eval SELECT '$effective_uuid' = LEFT(@@global.gtid_executed, 36) AS uuids_match;
---enable_query_log
-
---replace_result $effective_uuid <effective_uuid>
---replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
-SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
-
---connection node_1
-DROP TABLE t1;
-
---connection node_3
---let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
-
-STOP SLAVE;
-RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf
deleted file mode 100644
index 19517556331..00000000000
--- a/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf
+++ /dev/null
@@ -1,8 +0,0 @@
-!include ../galera_2nodes_as_master.cnf
-
-[mysqld]
-gtid-mode=ON
-log-bin=mysqld-bin
-log-slave-updates
-enforce-gtid-consistency
-binlog-format=ROW
diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test
deleted file mode 100644
index 23606d7ac4c..00000000000
--- a/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Test that a MySQL slave can use CHANGE MASTER MASTER_AUTO_POSITION to begin replicating
-# from another Galera node
-#
-# The galera/galera_2node_master.cnf describes the setup of the nodes
-#
-#
-
---source include/have_innodb.inc
---source include/have_log_bin.inc
---source include/galera_cluster.inc
-
---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
---disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
---enable_query_log
-START SLAVE USER='root';
-
---connection node_1
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t1 VALUES(1);
-
---connection node_2
-INSERT INTO t1 VALUES(2);
-
---connection node_3
-STOP SLAVE;
---disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_2, MASTER_AUTO_POSITION=1;
---enable_query_log
-START SLAVE USER='root';
-
---connection node_1
-INSERT INTO t1 VALUES(3);
-
---connection node_2
-INSERT INTO t1 VALUES(4);
-
---connection node_3
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
-
---let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
---source include/wait_condition.inc
-
---connection node_1
-DROP TABLE t1;
-
---connection node_3
---let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
-
-STOP SLAVE;
-RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_ctas.cnf b/mysql-test/suite/galera/t/galera_as_slave_ctas.cnf
new file mode 100644
index 00000000000..eab2a6de90d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_ctas.cnf
@@ -0,0 +1,5 @@
+!include ../galera_2nodes_as_slave.cnf
+
+# make sure master server uses ROW format for replication
+[mysqld]
+binlog-format=row
diff --git a/mysql-test/suite/galera/t/galera_as_slave_ctas.test b/mysql-test/suite/galera/t/galera_as_slave_ctas.test
new file mode 100644
index 00000000000..1a5e023b981
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_ctas.test
@@ -0,0 +1,75 @@
+#
+# Test Galera as a slave to a MySQL master
+#
+# The galera/galera_2node_slave.cnf describes the setup of the nodes
+# also, for this test, master server must have binlog_format=ROW
+#
+
+--source include/have_innodb.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+
+# make sure master server has binlog_format=ROW
+--connection node_1
+SHOW VARIABLES LIKE 'binlog_format';
+
+#
+# test phase one, issue CTAS with empty source table
+#
+--connection node_1
+CREATE TABLE source (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+
+CREATE TABLE target AS SELECT * FROM source;
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'target';
+--source include/wait_condition.inc
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'target';
+--source include/wait_condition.inc
+
+#
+# test phase two, issue CTAS with populated source table
+#
+--connection node_1
+DROP TABLE target;
+INSERT INTO source VALUES(1);
+
+CREATE TABLE target AS SELECT * FROM source;
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM target;
+--source include/wait_condition.inc
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM target;
+--source include/wait_condition.inc
+
+--connection node_1
+DROP TABLE source;
+DROP TABLE target;
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'target';
+--source include/wait_condition.inc
+
+
+--connection node_2
+STOP SLAVE;
+RESET SLAVE ALL;
+
+--connection node_1
+RESET MASTER;
+
diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.cnf b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.cnf
new file mode 100644
index 00000000000..01d2eb12630
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.cnf
@@ -0,0 +1,6 @@
+!include ../galera_2nodes_as_slave.cnf
+
+[mysqld]
+log-bin=mysqld-bin
+log-slave-updates
+binlog-format=ROW
diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test
new file mode 100644
index 00000000000..33668da11be
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test
@@ -0,0 +1,66 @@
+#
+# Test Galera as a slave to a MariaDB master using GTIDs
+#
+# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes
+# suite/galera/t/galera_as_slave_gtid.cnf has the GTID options
+#
+# This test will replicate writes to MyISAM table and check that slave node is able
+# to apply them.
+# mysql.gtid_slave_pos table should be defined as innodb engine, original problem
+# by writes to mysql.gtid_slave_pos, whereas the replicated transaction contained
+# no innodb writes
+#
+
+--source include/have_innodb.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+SELECT @@WSREP_ON;
+
+--connection node_2
+# make sure gtid_slave_pos is of innodb engine, mtr does not currently provide that
+ALTER TABLE mysql.gtid_slave_pos engine = InnoDB;
+
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1);
+
+SELECT LENGTH(@@global.gtid_binlog_state) > 1;
+--let $gtid_binlog_state_node1 = `SELECT @@global.gtid_binlog_state;`
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
+--source include/wait_condition.inc
+
+--disable_query_log
+--eval SELECT '$gtid_binlog_state_node1' = @@global.gtid_binlog_state AS gtid_binlog_state_equal;
+--enable_query_log
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+SELECT COUNT(*) = 0 FROM t1;
+
+--disable_query_log
+--eval SELECT '$gtid_binlog_state_node1' = @@global.gtid_binlog_state AS gtid_binlog_state_equal;
+--enable_query_log
+
+--echo #cleanup
+--connection node_1
+DROP TABLE t1;
+reset master;
+
+--connection node_2
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+
+--connection node_3
+reset master;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_preordered.test b/mysql-test/suite/galera/t/galera_as_slave_preordered.test
deleted file mode 100644
index 6f221f83b3a..00000000000
--- a/mysql-test/suite/galera/t/galera_as_slave_preordered.test
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Test Galera as a slave to a MySQL master with --wsrep-preordered=TRUE
-#
-# The galera/galera_2node_slave.cnf describes the setup of the nodes
-#
-
---source include/have_innodb.inc
---source include/have_log_bin.inc
-
-# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
---connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
---source include/galera_cluster.inc
-
---connection node_2
---disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
---enable_query_log
-START SLAVE USER='root';
-
-#
-# Issue many large-ish transaction on the async master
-#
-
---connection node_1
-CREATE TABLE ten (f1 INTEGER);
-INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB;
-
---disable_query_log
---let $count = 100
-while ($count)
-{
- --eval INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;
- --dec $count
-}
---enable_query_log
-
-#
-# While the async transactions are being applied, issue another set of transactions
-# on the Galera node.
-#
-
---connection node_2
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
-
---let $count = 100
---disable_query_log
-while ($count)
-{
- --eval INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;
- --dec $count
-}
---enable_query_log
-
-#
-# Confirm that all transactions successfully committed
-#
-
---let $wait_condition = SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
---source include/wait_condition.inc
-
-SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
-
---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
---connection node_3
-SELECT COUNT(*) = 2 * 100 * 10 * 10 FROM t1;
-SELECT COUNT(DISTINCT f1) = 2 * 100 * 10 * 10 FROM t1;
-
-#
-# Cleanup
-#
-
---connection node_1
-DROP TABLE t1;
-DROP TABLE ten;
-
---connection node_2
---let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
-
-STOP SLAVE;
-RESET SLAVE ALL;
diff --git a/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf b/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf
new file mode 100644
index 00000000000..4101b4073ec
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+innodb_stats_persistent=ON
+
+[mysqld.2]
+innodb_stats_persistent=ON
+
+
diff --git a/mysql-test/suite/galera/t/galera_bf_background_statistics.opt b/mysql-test/suite/galera/t/galera_bf_background_statistics.opt
deleted file mode 100644
index f9b1414a974..00000000000
--- a/mysql-test/suite/galera/t/galera_bf_background_statistics.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb_stats_persistent=ON
diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt b/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt
deleted file mode 100644
index c8e53f07fc2..00000000000
--- a/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog-checksum=CRC32 --master-verify-checksum=1 --slave-sql-verify-checksum=1
diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum.cnf b/mysql-test/suite/galera/t/galera_binlog_checksum.cnf
new file mode 100644
index 00000000000..bd61ee67406
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_checksum.cnf
@@ -0,0 +1,13 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+binlog-checksum=CRC32
+master-verify-checksum=1
+slave-sql-verify-checksum=1
+
+[mysqld.2]
+binlog-checksum=CRC32
+master-verify-checksum=1
+slave-sql-verify-checksum=1
+
+
diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
deleted file mode 100644
index 576829cfef8..00000000000
--- a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog-row-event-max-size=4294967040
diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf
new file mode 100644
index 00000000000..9315086a3cc
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+binlog-row-event-max-size=4294967040
+
+[mysqld.2]
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt
deleted file mode 100644
index 22174756652..00000000000
--- a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog-row-event-max-size=256
diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf
new file mode 100644
index 00000000000..798435d8e54
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+binlog-row-event-max-size=256
+
+[mysqld.2]
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test b/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test
deleted file mode 100644
index 95bc85c4cab..00000000000
--- a/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Test that Galera continues to run even with binlog-rows-query-log-events=TRUE
-#
-
---source include/galera_cluster.inc
---source include/have_innodb.inc
-
---let $binlog_rows_query_log_events_orig = `SELECT @@binlog_rows_query_log_events`
-
-SET GLOBAL binlog_rows_query_log_events=TRUE;
-
-CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
-
-INSERT INTO t1 VALUES (1);
-
---connection node_2
-SELECT COUNT(*) = 1 FROM t1;
-
---connection node_1
-UPDATE t1 SET f1 = 2 WHERE f1 = 1;
-
---connection node_2
-SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
-
---connection node_1
---eval SET GLOBAL binlog_rows_query_log_events = $binlog_rows_query_log_events_orig
-
-DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_events2.test b/mysql-test/suite/galera/t/galera_events2.test
index 54b90386851..3dfbe406fc4 100644
--- a/mysql-test/suite/galera/t/galera_events2.test
+++ b/mysql-test/suite/galera/t/galera_events2.test
@@ -23,6 +23,7 @@ DO
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
--connection node_2
+set global wsrep_sync_wait=15;
--echo # node_2 event should be there
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
@@ -66,6 +67,9 @@ ALTER EVENT one_event ON SCHEDULE EVERY 10 SECOND;
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
+--source include/wait_condition.inc
+
use events_test;
--echo "The definer should be ev_test@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
diff --git a/mysql-test/suite/galera/t/galera_flush-master.opt b/mysql-test/suite/galera/t/galera_flush-master.opt
deleted file mode 100644
index 5a1fb6748d9..00000000000
--- a/mysql-test/suite/galera/t/galera_flush-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---query_cache_type=1 --query_cache_size=1000000
diff --git a/mysql-test/suite/galera/t/galera_flush.test b/mysql-test/suite/galera/t/galera_flush.test
deleted file mode 100644
index 77e95f62fda..00000000000
--- a/mysql-test/suite/galera/t/galera_flush.test
+++ /dev/null
@@ -1,273 +0,0 @@
-#
-# Test that various FLUSH commands are replicated. Whenever possible, check the slave for the effects.
-#
-
---source include/galera_cluster.inc
---source include/have_innodb.inc
---source include/have_perfschema.inc
---source include/have_query_cache.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-#
-# The following FLUSH statements should be replicated
-#
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH DES_KEY_FILE;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH HOSTS;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
---connection node_1
-SET GLOBAL wsrep_replicate_myisam = TRUE;
-INSERT INTO mysql.user VALUES('localhost','user1',PASSWORD('pass1'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N','N','',0);
-FLUSH PRIVILEGES;
---connect node_2a, 127.0.0.1, user1, pass1, test, $NODE_MYPORT_2
---connection node_1
-DELETE FROM mysql.user WHERE user = 'user1';
-SET GLOBAL wsrep_replicate_myisam = FALSE;
-FLUSH PRIVILEGES;
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH QUERY CACHE;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH STATUS;
-
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH USER_RESOURCES;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH TABLES;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
---connection node_1
-CREATE TABLE t2 (f1 INTEGER);
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH TABLES t2;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH ERROR LOGS;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH SLOW LOGS;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH GENERAL LOGS;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH ENGINE LOGS;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH RELAY LOGS;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
---connection node_1
-SET @userstat_old= @@userstat;
-SET GLOBAL userstat=ON;
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH CLIENT_STATISTICS;
-FLUSH INDEX_STATISTICS;
-FLUSH TABLE_STATISTICS;
-FLUSH USER_STATISTICS;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 4 AS wsrep_last_committed_diff;
---enable_query_log
-
-
---connection node_1
-SET @old_thread_statistics= @@global.thread_statistics;
-SET GLOBAL thread_statistics= ON;
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH THREAD_STATISTICS;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-FLUSH CHANGED_PAGE_BITMAPS;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
-#
-# The following statements should not be replicated: FLUSH LOGS, FLUSH TABLES WITH LOCKS
-#
-
-
---connection node_1
-CREATE TABLE t1 (f1 INTEGER);
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
-
---connection node_1
-FLUSH LOGS;
-FLUSH TABLES WITH READ LOCK;
-UNLOCK TABLES;
-FLUSH TABLES t1 WITH READ LOCK;
-UNLOCK TABLES;
-FLUSH TABLES t1 FOR EXPORT;
-UNLOCK TABLES;
-
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
---enable_query_log
-
-
-## Test LOCK TABLES with FLUSH TABLES
-## LOCK TABLES t1 write followed by flush tables t1 should succeed due to MDL upgrade.
-## LOCK tables t2 read followed by flush tables t2 should fail with ER_TABLE_NOT_LOCKED_FOR_WRITE
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-LOCK TABLES t1 WRITE;
-FLUSH TABLES t1;
-UNLOCK TABLES;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
---connection node_2
---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---connection node_1
-LOCK TABLES t1 READ;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
-FLUSH TABLES t1;
-UNLOCK TABLES;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
---enable_query_log
---connection node_1
-FLUSH TABLES t1;
---connection node_2
---let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
---disable_query_log
---eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
---enable_query_log
-
-
-
---connection node_1
-DROP TABLE t1;
-DROP TABLE t2;
-SET GLOBAL userstat= @userstat_old;
-SET GLOBAL thread_statistics= @old_thread_statistics;
diff --git a/mysql-test/suite/galera/t/galera_flush_local.cnf b/mysql-test/suite/galera/t/galera_flush_local.cnf
new file mode 100644
index 00000000000..c92cb58f484
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_flush_local.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+query_cache_type=1
+query_cache_size=1000000
+wsrep_replicate_myisam=ON
+
+[mysqld.2]
+query_cache_type=1
+query_cache_size=1000000
+wsrep_replicate_myisam=ON
+
diff --git a/mysql-test/suite/galera/t/galera_flush_local.opt b/mysql-test/suite/galera/t/galera_flush_local.opt
deleted file mode 100644
index a084db15c5d..00000000000
--- a/mysql-test/suite/galera/t/galera_flush_local.opt
+++ /dev/null
@@ -1,3 +0,0 @@
---query_cache_type=1
---query_cache_size=1000000
---wsrep_replicate_myisam=ON
diff --git a/mysql-test/suite/galera/t/galera_forced_binlog_format.test b/mysql-test/suite/galera/t/galera_forced_binlog_format.test
index 364f41529a4..5da70abd255 100644
--- a/mysql-test/suite/galera/t/galera_forced_binlog_format.test
+++ b/mysql-test/suite/galera/t/galera_forced_binlog_format.test
@@ -7,14 +7,20 @@
--source include/galera_cluster.inc
--connection node_1
+SET SESSION wsrep_on=OFF;
RESET MASTER;
+SET SESSION wsrep_on=ON;
+--disable_warnings
SET SESSION binlog_format = 'STATEMENT';
+--enable_warnings
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
+--disable_warnings
SET SESSION binlog_format = 'MIXED';
+--enable_warnings
INSERT INTO t1 VALUES (2);
diff --git a/mysql-test/suite/galera/t/galera_gtid-master.opt b/mysql-test/suite/galera/t/galera_gtid-master.opt
deleted file mode 100644
index 8a755e98b00..00000000000
--- a/mysql-test/suite/galera/t/galera_gtid-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/galera_gtid.cnf b/mysql-test/suite/galera/t/galera_gtid.cnf
new file mode 100644
index 00000000000..8f6a760def0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid.cnf
@@ -0,0 +1,10 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+log-bin
+log-slave-updates
+
+[mysqld.2]
+log-bin
+log-slave-updates
+
diff --git a/mysql-test/suite/galera/t/galera_gtid.test b/mysql-test/suite/galera/t/galera_gtid.test
index e8369be62e6..560a320255f 100644
--- a/mysql-test/suite/galera/t/galera_gtid.test
+++ b/mysql-test/suite/galera/t/galera_gtid.test
@@ -11,14 +11,18 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
--connection node_2
-SELECT COUNT(*) = 1 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1
+--source include/wait_condition.inc
UPDATE t1 SET f1 = 2;
--let $gtid_binlog_state_node2 = `SELECT @@global.gtid_binlog_state;`
--connection node_1
-SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
+SET SESSION wsrep_sync_wait = 15;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2
+--source include/wait_condition.inc
+SELECT * from t1;
--disable_query_log
--eval SELECT '$gtid_binlog_state_node2' = @@global.gtid_binlog_state AS gtid_binlog_state_equal;
diff --git a/mysql-test/suite/galera/t/galera_load_data.cnf b/mysql-test/suite/galera/t/galera_load_data.cnf
index fd0327e0ecb..14d894fc7d0 100644
--- a/mysql-test/suite/galera/t/galera_load_data.cnf
+++ b/mysql-test/suite/galera/t/galera_load_data.cnf
@@ -1,6 +1,15 @@
!include ../galera_2nodes.cnf
-[mysqld]
+[mysqld.1]
+secure-file-priv = ""
+innodb_file_format ='Barracuda'
+innodb_file_per_table = ON
+innodb_stats_persistent=ON
+innodb_stats_auto_recalc=ON
+innodb_stats_persistent_sample_pages=20
+innodb_stats_sample_pages=8
+
+[mysqld.2]
secure-file-priv = ""
innodb_file_format ='Barracuda'
innodb_file_per_table = ON
diff --git a/mysql-test/suite/galera/t/galera_log_bin-master.opt b/mysql-test/suite/galera/t/galera_log_bin-master.opt
deleted file mode 100644
index 8a755e98b00..00000000000
--- a/mysql-test/suite/galera/t/galera_log_bin-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-bin --log-slave-updates
diff --git a/mysql-test/suite/galera/t/galera_log_bin.cnf b/mysql-test/suite/galera/t/galera_log_bin.cnf
new file mode 100644
index 00000000000..8f6a760def0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_bin.cnf
@@ -0,0 +1,10 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+log-bin
+log-slave-updates
+
+[mysqld.2]
+log-bin
+log-slave-updates
+
diff --git a/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-test/suite/galera/t/galera_log_bin.test
index c3d94d15194..f1d2a12b9de 100644
--- a/mysql-test/suite/galera/t/galera_log_bin.test
+++ b/mysql-test/suite/galera/t/galera_log_bin.test
@@ -1,5 +1,5 @@
--source include/galera_cluster.inc
---source include/have_innodb.inc
+--source include/force_restart.inc
--connection node_1
reset master;
@@ -39,5 +39,4 @@ DROP TABLE t2;
--echo #cleanup
--connection node_1
RESET MASTER;
---connection node_2
-reset master;
+
diff --git a/mysql-test/suite/galera/t/galera_mdev_13787.cnf b/mysql-test/suite/galera/t/galera_mdev_13787.cnf
new file mode 100644
index 00000000000..ada78e1db2a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_mdev_13787.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+innodb-stats-persistent=1
+
+[mysqld.2]
+innodb-stats-persistent=1
+
+
diff --git a/mysql-test/suite/galera/t/galera_mdev_13787.opt b/mysql-test/suite/galera/t/galera_mdev_13787.opt
deleted file mode 100644
index 27ec1e3f00e..00000000000
--- a/mysql-test/suite/galera/t/galera_mdev_13787.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-stats-persistent=1
diff --git a/mysql-test/suite/galera/t/galera_migrate.cnf b/mysql-test/suite/galera/t/galera_migrate.cnf
deleted file mode 100644
index ed48f208e52..00000000000
--- a/mysql-test/suite/galera/t/galera_migrate.cnf
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# This .cnf file starts 4 servers without enabling Galera.
-# The galera_migrate.test will set wsrep_provider and the other settings as needed.
-#
-
-!include include/default_mysqld.cnf
-
-[mysqld]
-binlog-format=row
-innodb_autoinc_lock_mode=2
-innodb_flush_log_at_trx_commit=2
-log-bin=mysqld-bin
-
-wsrep_node_address=127.0.0.1
-wsrep_causal_reads=ON
-wsrep_sync_wait = 15
-
-[mysqld.1]
-#galera_port=@OPT.port
-#ist_port=@OPT.port
-#sst_port=@OPT.port
-
-[mysqld.2]
-#galera_port=@OPT.port
-#ist_port=@OPT.port
-#sst_port=@OPT.port
-
-[mysqld.3]
-#galera_port=@OPT.port
-#ist_port=@OPT.port
-#sst_port=@OPT.port
-
-[mysqld.4]
-#galera_port=@OPT.port
-#ist_port=@OPT.port
-#sst_port=@OPT.port
-
-[ENV]
-NODE_MYPORT_1= @mysqld.1.port
-NODE_MYSOCK_1= @mysqld.1.socket
-
-NODE_MYPORT_2= @mysqld.2.port
-NODE_MYSOCK_2= @mysqld.2.socket
-
-NODE_MYPORT_3= @mysqld.3.port
-NODE_MYSOCK_3= @mysqld.3.socket
-
-NODE_MYPORT_4= @mysqld.4.port
-NODE_MYSOCK_4= @mysqld.4.socket
-
-NODE_GALERAPORT_1= @mysqld.1.#galera_port
-NODE_GALERAPORT_2= @mysqld.2.#galera_port
-NODE_GALERAPORT_3= @mysqld.3.#galera_port
-NODE_GALERAPORT_4= @mysqld.4.#galera_port
-
-NODE_SSTPORT_1= @mysqld.1.#sst_port
-NODE_SSTPORT_2= @mysqld.2.#sst_port
-NODE_SSTPORT_3= @mysqld.3.#sst_port
-NODE_SSTPORT_4= @mysqld.4.#sst_port
diff --git a/mysql-test/suite/galera/t/galera_migrate.test b/mysql-test/suite/galera/t/galera_migrate.test
deleted file mode 100644
index 84897b66c6d..00000000000
--- a/mysql-test/suite/galera/t/galera_migrate.test
+++ /dev/null
@@ -1,204 +0,0 @@
-#
-# Execute a migration from MariaDB replication to Galera replication.
-# The test starts with 4 stand-alone servers defined by galera_migrate.cnf and then
-# performs the following steps:
-#
-# 1. Begin with a single MySQL server
-# 2. Establish traditional MySQL master-slave replication
-# 3. Attach a new sever to serve as a MySQL replication slave
-# 4. Enable Galera on the new slave and create a single-node Galera cluster
-# 5. Attach a second Galera node
-# 6. Turn off the traditional replication parts of the system
-# 7. Continue replicating within Galera only
-#
-
---source include/big_test.inc
---source include/have_innodb.inc
---source include/have_log_bin.inc
-
-#
-# Step #1 Begin with a single server
-#
-
---connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1
-
-CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-
-#
-# Step #2. Establish traditional MySQL replication
-#
-
---connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2
---disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT = $NODE_MYPORT_1;
---enable_query_log
-START SLAVE;
-
---connection node_1
-INSERT INTO t1 VALUES (2);
-
---connection node_2
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
-
---let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
---source include/wait_condition.inc
-
-#
-# Step #3. Attach a second slave, later to be converted to Galera
-#
-
---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
---disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT = $NODE_MYPORT_1;
---enable_query_log
-START SLAVE USER='root';
-
---connection node_1
-INSERT INTO t1 VALUES (3);
-
---connection node_3
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
-
---let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
---source include/wait_condition.inc
-
-#
-# Step #4. Convert this MySQL slave into a Galera node
-#
-
---connection node_1
-INSERT INTO t1 VALUES (4);
-
---connection node_3
---disable_query_log
---eval SET GLOBAL wsrep_provider='$WSREP_PROVIDER'
---eval SET GLOBAL wsrep_provider_options='base_port=$NODE_GALERAPORT_3'
---enable_query_log
-SET GLOBAL wsrep_cluster_address='gcomm://';
-
---connection node_1
-INSERT INTO t1 VALUES (5);
-
---connection node_3
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
---let $wait_condition = SELECT COUNT(*) = 5 FROM t1;
---source include/wait_condition.inc
-
---let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
---source include/wait_condition.inc
-
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-
---connection node_1
-INSERT INTO t1 VALUES (6);
-
-#
-# Step #5. Attach a second Galera node using mysqldump SST
-#
-
---connection node_3
-# We need a user with a password for mysqldump SST
-GRANT ALL PRIVILEGES ON *.* TO 'sst';
-SET GLOBAL wsrep_sst_auth = 'sst:';
-
---connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
-GRANT ALL PRIVILEGES ON *.* TO 'sst';
-
---disable_query_log
---eval SET GLOBAL wsrep_sst_method = 'mysqldump';
---eval SET GLOBAL wsrep_provider='$WSREP_PROVIDER'
---eval SET GLOBAL wsrep_provider_options='base_port=$NODE_GALERAPORT_4'
---eval SET GLOBAL wsrep_sst_receive_address = '127.0.0.2:$NODE_MYPORT_4';
---eval SET GLOBAL wsrep_cluster_address='gcomm://127.0.0.1:$NODE_GALERAPORT_3'
---enable_query_log
-
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
---source include/wait_condition.inc
-
---let $wait_condition = SELECT COUNT(*) = 6 FROM t1;
---source include/wait_condition.inc
-
---let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
---source include/wait_condition.inc
-
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-
-
-#
-# Step #6. Turn off traditional replication
-#
-
---connection node_2
-STOP SLAVE;
-RESET SLAVE ALL;
-
---connection node_3
-STOP SLAVE;
-RESET SLAVE ALL;
-
-#
-# Step #7. Continue replicating within Galera only
-#
-
-# We need fresh connections due to galera#191
-
---connect node_3a, 127.0.0.1, root, , test, $NODE_MYPORT_3
-INSERT INTO t1 VALUES (7);
-
---connect node_4a, 127.0.0.1, root, , test, $NODE_MYPORT_4
-INSERT INTO t1 VALUES (8);
-
---connection node_4a
-SELECT COUNT(*) = 8 FROM t1;
-
---let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
---source include/wait_condition.inc
-
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-
---connection node_3a
-SELECT COUNT(*) = 8 FROM t1;
-
---let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
---source include/wait_condition.inc
-
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-
-#
-# Teardown
-#
-
---connection node_1
-DROP TABLE t1;
-
---connection node_2
-DROP TABLE t1;
-
---connection node_3
-SET GLOBAL wsrep_provider = 'none';
-SET GLOBAL wsrep_sst_auth = '';
-SET GLOBAL wsrep_provider_options = '';
-DROP TABLE t1;
-DROP USER sst;
-
---connection node_4
-SET GLOBAL wsrep_provider = 'none';
-SET GLOBAL wsrep_sst_method = 'rsync';
-SET GLOBAL wsrep_provider_options = '';
-SET GLOBAL wsrep_sst_receive_address = 'AUTO';
-DROP TABLE t1;
-DROP USER sst;
-
-CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
diff --git a/mysql-test/suite/galera/t/galera_partition.cnf b/mysql-test/suite/galera/t/galera_partition.cnf
new file mode 100644
index 00000000000..e6cb13ef523
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_partition.cnf
@@ -0,0 +1,18 @@
+!include ../galera_4nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;gmcast.segment=1'
+wsrep_slave_threads=10
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;gmcast.segment=1'
+wsrep_slave_threads=10
+
+[mysqld.3]
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M;gmcast.segment=2'
+wsrep_slave_threads=10
+
+[mysqld.4]
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M;gmcast.segment=3'
+wsrep_slave_threads=10
+
diff --git a/mysql-test/suite/galera/t/galera_partition.test b/mysql-test/suite/galera/t/galera_partition.test
new file mode 100644
index 00000000000..66b2a5c10f6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_partition.test
@@ -0,0 +1,450 @@
+--source include/galera_cluster.inc
+--source include/have_partition.inc
+
+--connection node_1
+
+call mtr.add_suppression("WSREP: RSU failed due to pending transactions, schema: test, query ALTER.*");
+call mtr.add_suppression("WSREP: ALTER TABLE isolation failure");
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+
+--connection node_1
+
+CREATE TABLE t1(
+ id bigint unsigned NOT NULL AUTO_INCREMENT,
+ dt datetime NOT NULL,
+ PRIMARY KEY (id,dt),
+ KEY dt_idx (dt)
+) ENGINE=InnoDB
+PARTITION BY RANGE( TO_DAYS(dt) ) (
+PARTITION rx2009xx VALUES LESS THAN( TO_DAYS('2010-01-01 00:00:00') ),
+PARTITION rx201001 VALUES LESS THAN( TO_DAYS('2010-02-01 00:00:00') ),
+PARTITION rx201002 VALUES LESS THAN( TO_DAYS('2010-03-01 00:00:00') ),
+PARTITION rx201003 VALUES LESS THAN( TO_DAYS('2010-04-01 00:00:00') ),
+PARTITION rx201004 VALUES LESS THAN( TO_DAYS('2010-05-01 00:00:00') ),
+PARTITION rx201005 VALUES LESS THAN( TO_DAYS('2010-06-01 00:00:00') ),
+PARTITION rx201006 VALUES LESS THAN( TO_DAYS('2010-07-01 00:00:00') ),
+PARTITION rx201007 VALUES LESS THAN( TO_DAYS('2010-08-01 00:00:00') ),
+PARTITION rx201008 VALUES LESS THAN( TO_DAYS('2010-09-01 00:00:00') ),
+PARTITION rx201009 VALUES LESS THAN( TO_DAYS('2010-10-01 00:00:00') ),
+PARTITION rx201010 VALUES LESS THAN( TO_DAYS('2010-11-01 00:00:00') ),
+PARTITION rx201011 VALUES LESS THAN( TO_DAYS('2010-12-01 00:00:00') ),
+PARTITION rx201012 VALUES LESS THAN( TO_DAYS('2011-01-01 00:00:00') ),
+PARTITION rx2011 VALUES LESS THAN MAXVALUE);
+
+DELIMITER |;
+CREATE PROCEDURE p1 (repeat_count int)
+BEGIN
+ DECLARE current_num int;
+ SET current_num = 0;
+ WHILE current_num < repeat_count do
+ INSERT INTO t1 VALUES (NULL, '2010-10-21 00:00:00');
+ INSERT INTO t1 VALUES (NULL, '2010-02-21 00:00:00');
+ INSERT INTO t1 VALUES (NULL, '2010-03-21 00:00:00');
+ INSERT INTO t1 VALUES (NULL, '2010-04-21 00:00:00');
+ INSERT INTO t1 VALUES (NULL, '2010-06-21 00:00:00');
+ INSERT INTO t1 VALUES (NULL, '2010-10-21 00:00:00');
+ INSERT INTO t1 VALUES (NULL, '2012-02-21 00:00:00');
+ COMMIT;
+ SET current_num = current_num + 1;
+ END WHILE;
+END|
+DELIMITER ;|
+
+insert into t1 (id, dt) values (1, '2010-01-02 00:00:00');
+insert into t1 (id, dt) values (2, '2010-01-03 00:00:00');
+insert into t1 (id, dt) values (3, '2010-01-04 00:00:00');
+insert into t1 (id, dt) values (4, '2010-01-05 00:00:00');
+insert into t1 (id, dt) values (5, '2010-01-06 00:00:00');
+insert into t1 (id, dt) values (6, '2010-01-07 00:00:00');
+insert into t1 (id, dt) values (7, '2010-01-08 00:00:00');
+insert into t1 (id, dt) values (8, '2010-01-09 00:00:00');
+insert into t1 (id, dt) values (9, '2010-01-10 00:00:00');
+insert into t1 (id, dt) values (10, '2010-01-11 00:00:00');
+insert into t1 (id, dt) values (11, '2010-01-12 00:00:00');
+insert into t1 (id, dt) values (12, '2010-01-13 00:00:00');
+insert into t1 (id, dt) values (13, '2010-01-14 00:00:00');
+insert into t1 (id, dt) values (14, '2010-01-15 00:00:00');
+insert into t1 (id, dt) values (15, '2010-01-16 00:00:00');
+insert into t1 (id, dt) values (16, '2010-01-17 00:00:00');
+insert into t1 (id, dt) values (17, '2010-01-18 00:00:00');
+insert into t1 (id, dt) values (18, '2010-01-19 00:00:00');
+insert into t1 (id, dt) values (19, '2010-01-20 00:00:00');
+insert into t1 (id, dt) values (20, '2010-01-21 00:00:00');
+insert into t1 (id, dt) values (21, '2010-01-22 00:00:00');
+insert into t1 (id, dt) values (22, '2010-01-23 00:00:00');
+insert into t1 (id, dt) values (23, '2010-01-24 00:00:00');
+insert into t1 (id, dt) values (24, '2010-01-25 00:00:00');
+insert into t1 (id, dt) values (25, '2010-01-26 00:00:00');
+insert into t1 (id, dt) values (26, '2010-01-27 00:00:00');
+insert into t1 (id, dt) values (27, '2010-01-28 00:00:00');
+insert into t1 (id, dt) values (28, '2010-01-29 00:00:00');
+insert into t1 (id, dt) values (29, '2010-01-30 00:00:00');
+insert into t1 (id, dt) values (30, '2010-01-31 00:00:00');
+insert into t1 (id, dt) values (31, '2010-02-01 00:00:00');
+insert into t1 (id, dt) values (32, '2010-02-02 00:00:00');
+insert into t1 (id, dt) values (33, '2010-02-03 00:00:00');
+insert into t1 (id, dt) values (34, '2010-02-04 00:00:00');
+insert into t1 (id, dt) values (35, '2010-02-05 00:00:00');
+insert into t1 (id, dt) values (36, '2010-02-06 00:00:00');
+insert into t1 (id, dt) values (37, '2010-02-07 00:00:00');
+insert into t1 (id, dt) values (38, '2010-02-08 00:00:00');
+insert into t1 (id, dt) values (39, '2010-02-09 00:00:00');
+insert into t1 (id, dt) values (40, '2010-02-10 00:00:00');
+insert into t1 (id, dt) values (41, '2010-02-11 00:00:00');
+insert into t1 (id, dt) values (42, '2010-02-12 00:00:00');
+insert into t1 (id, dt) values (43, '2010-02-13 00:00:00');
+insert into t1 (id, dt) values (44, '2010-02-14 00:00:00');
+insert into t1 (id, dt) values (45, '2010-02-15 00:00:00');
+insert into t1 (id, dt) values (46, '2010-02-16 00:00:00');
+insert into t1 (id, dt) values (47, '2010-02-17 00:00:00');
+insert into t1 (id, dt) values (48, '2010-02-18 00:00:00');
+insert into t1 (id, dt) values (49, '2010-02-19 00:00:00');
+insert into t1 (id, dt) values (50, '2010-02-20 00:00:00');
+insert into t1 (id, dt) values (51, '2010-02-21 00:00:00');
+insert into t1 (id, dt) values (52, '2010-02-22 00:00:00');
+insert into t1 (id, dt) values (53, '2010-02-23 00:00:00');
+insert into t1 (id, dt) values (54, '2010-02-24 00:00:00');
+insert into t1 (id, dt) values (55, '2010-02-25 00:00:00');
+insert into t1 (id, dt) values (56, '2010-02-26 00:00:00');
+insert into t1 (id, dt) values (57, '2010-02-27 00:00:00');
+insert into t1 (id, dt) values (58, '2010-02-28 00:00:00');
+insert into t1 (id, dt) values (59, '2010-03-01 00:00:00');
+insert into t1 (id, dt) values (60, '2010-03-02 00:00:00');
+insert into t1 (id, dt) values (61, '2010-03-03 00:00:00');
+insert into t1 (id, dt) values (62, '2010-03-04 00:00:00');
+insert into t1 (id, dt) values (63, '2010-03-05 00:00:00');
+insert into t1 (id, dt) values (64, '2010-03-06 00:00:00');
+insert into t1 (id, dt) values (65, '2010-03-07 00:00:00');
+insert into t1 (id, dt) values (66, '2010-03-08 00:00:00');
+insert into t1 (id, dt) values (67, '2010-03-09 00:00:00');
+insert into t1 (id, dt) values (68, '2010-03-10 00:00:00');
+insert into t1 (id, dt) values (69, '2010-03-11 00:00:00');
+insert into t1 (id, dt) values (70, '2010-03-12 00:00:00');
+insert into t1 (id, dt) values (71, '2010-03-13 00:00:00');
+insert into t1 (id, dt) values (72, '2010-03-14 00:00:00');
+insert into t1 (id, dt) values (73, '2010-03-15 00:00:00');
+insert into t1 (id, dt) values (74, '2010-03-16 00:00:00');
+insert into t1 (id, dt) values (75, '2010-03-17 00:00:00');
+insert into t1 (id, dt) values (76, '2010-03-18 00:00:00');
+insert into t1 (id, dt) values (77, '2010-03-19 00:00:00');
+insert into t1 (id, dt) values (78, '2010-03-20 00:00:00');
+insert into t1 (id, dt) values (79, '2010-03-21 00:00:00');
+insert into t1 (id, dt) values (80, '2010-03-22 00:00:00');
+insert into t1 (id, dt) values (81, '2010-03-23 00:00:00');
+insert into t1 (id, dt) values (82, '2010-03-24 00:00:00');
+insert into t1 (id, dt) values (83, '2010-03-25 00:00:00');
+insert into t1 (id, dt) values (84, '2010-03-26 00:00:00');
+insert into t1 (id, dt) values (85, '2010-03-27 00:00:00');
+insert into t1 (id, dt) values (86, '2010-03-28 00:00:00');
+insert into t1 (id, dt) values (87, '2010-03-29 00:00:00');
+insert into t1 (id, dt) values (88, '2010-03-30 00:00:00');
+insert into t1 (id, dt) values (89, '2010-03-31 00:00:00');
+insert into t1 (id, dt) values (90, '2010-04-01 00:00:00');
+insert into t1 (id, dt) values (91, '2010-04-02 00:00:00');
+insert into t1 (id, dt) values (92, '2010-04-03 00:00:00');
+insert into t1 (id, dt) values (93, '2010-04-04 00:00:00');
+insert into t1 (id, dt) values (94, '2010-04-05 00:00:00');
+insert into t1 (id, dt) values (95, '2010-04-06 00:00:00');
+insert into t1 (id, dt) values (96, '2010-04-07 00:00:00');
+insert into t1 (id, dt) values (97, '2010-04-08 00:00:00');
+insert into t1 (id, dt) values (98, '2010-04-09 00:00:00');
+insert into t1 (id, dt) values (99, '2010-04-10 00:00:00');
+insert into t1 (id, dt) values (100, '2010-04-11 00:00:00');
+insert into t1 (id, dt) values (101, '2010-04-12 00:00:00');
+insert into t1 (id, dt) values (102, '2010-04-13 00:00:00');
+insert into t1 (id, dt) values (103, '2010-04-14 00:00:00');
+insert into t1 (id, dt) values (104, '2010-04-15 00:00:00');
+insert into t1 (id, dt) values (105, '2010-04-16 00:00:00');
+insert into t1 (id, dt) values (106, '2010-04-17 00:00:00');
+insert into t1 (id, dt) values (107, '2010-04-18 00:00:00');
+insert into t1 (id, dt) values (108, '2010-04-19 00:00:00');
+insert into t1 (id, dt) values (109, '2010-04-20 00:00:00');
+insert into t1 (id, dt) values (110, '2010-04-21 00:00:00');
+insert into t1 (id, dt) values (111, '2010-04-22 00:00:00');
+insert into t1 (id, dt) values (112, '2010-04-23 00:00:00');
+insert into t1 (id, dt) values (113, '2010-04-24 00:00:00');
+insert into t1 (id, dt) values (114, '2010-04-25 00:00:00');
+insert into t1 (id, dt) values (115, '2010-04-26 00:00:00');
+insert into t1 (id, dt) values (116, '2010-04-27 00:00:00');
+insert into t1 (id, dt) values (117, '2010-04-28 00:00:00');
+insert into t1 (id, dt) values (118, '2010-04-29 00:00:00');
+insert into t1 (id, dt) values (119, '2010-04-30 00:00:00');
+insert into t1 (id, dt) values (120, '2010-05-01 00:00:00');
+insert into t1 (id, dt) values (121, '2010-05-02 00:00:00');
+insert into t1 (id, dt) values (122, '2010-05-03 00:00:00');
+insert into t1 (id, dt) values (123, '2010-05-04 00:00:00');
+insert into t1 (id, dt) values (124, '2010-05-05 00:00:00');
+insert into t1 (id, dt) values (125, '2010-05-06 00:00:00');
+insert into t1 (id, dt) values (126, '2010-05-07 00:00:00');
+insert into t1 (id, dt) values (127, '2010-05-08 00:00:00');
+insert into t1 (id, dt) values (128, '2010-05-09 00:00:00');
+insert into t1 (id, dt) values (129, '2010-05-10 00:00:00');
+insert into t1 (id, dt) values (130, '2010-05-11 00:00:00');
+insert into t1 (id, dt) values (131, '2010-05-12 00:00:00');
+insert into t1 (id, dt) values (132, '2010-05-13 00:00:00');
+insert into t1 (id, dt) values (133, '2010-05-14 00:00:00');
+insert into t1 (id, dt) values (134, '2010-05-15 00:00:00');
+insert into t1 (id, dt) values (135, '2010-05-16 00:00:00');
+insert into t1 (id, dt) values (136, '2010-05-17 00:00:00');
+insert into t1 (id, dt) values (137, '2010-05-18 00:00:00');
+insert into t1 (id, dt) values (138, '2010-05-19 00:00:00');
+insert into t1 (id, dt) values (139, '2010-05-20 00:00:00');
+insert into t1 (id, dt) values (140, '2010-05-21 00:00:00');
+insert into t1 (id, dt) values (141, '2010-05-22 00:00:00');
+insert into t1 (id, dt) values (142, '2010-05-23 00:00:00');
+insert into t1 (id, dt) values (143, '2010-05-24 00:00:00');
+insert into t1 (id, dt) values (144, '2010-05-25 00:00:00');
+insert into t1 (id, dt) values (145, '2010-05-26 00:00:00');
+insert into t1 (id, dt) values (146, '2010-05-27 00:00:00');
+insert into t1 (id, dt) values (147, '2010-05-28 00:00:00');
+insert into t1 (id, dt) values (148, '2010-05-29 00:00:00');
+insert into t1 (id, dt) values (149, '2010-05-30 00:00:00');
+insert into t1 (id, dt) values (150, '2010-05-31 00:00:00');
+insert into t1 (id, dt) values (151, '2010-06-01 00:00:00');
+insert into t1 (id, dt) values (152, '2010-06-02 00:00:00');
+insert into t1 (id, dt) values (153, '2010-06-03 00:00:00');
+insert into t1 (id, dt) values (154, '2010-06-04 00:00:00');
+insert into t1 (id, dt) values (155, '2010-06-05 00:00:00');
+insert into t1 (id, dt) values (156, '2010-06-06 00:00:00');
+insert into t1 (id, dt) values (157, '2010-06-07 00:00:00');
+insert into t1 (id, dt) values (158, '2010-06-08 00:00:00');
+insert into t1 (id, dt) values (159, '2010-06-09 00:00:00');
+insert into t1 (id, dt) values (160, '2010-06-10 00:00:00');
+insert into t1 (id, dt) values (161, '2010-06-11 00:00:00');
+insert into t1 (id, dt) values (162, '2010-06-12 00:00:00');
+insert into t1 (id, dt) values (163, '2010-06-13 00:00:00');
+insert into t1 (id, dt) values (164, '2010-06-14 00:00:00');
+insert into t1 (id, dt) values (165, '2010-06-15 00:00:00');
+insert into t1 (id, dt) values (166, '2010-06-16 00:00:00');
+insert into t1 (id, dt) values (167, '2010-06-17 00:00:00');
+insert into t1 (id, dt) values (168, '2010-06-18 00:00:00');
+insert into t1 (id, dt) values (169, '2010-06-19 00:00:00');
+insert into t1 (id, dt) values (170, '2010-06-20 00:00:00');
+insert into t1 (id, dt) values (171, '2010-06-21 00:00:00');
+insert into t1 (id, dt) values (172, '2010-06-22 00:00:00');
+insert into t1 (id, dt) values (173, '2010-06-23 00:00:00');
+insert into t1 (id, dt) values (174, '2010-06-24 00:00:00');
+insert into t1 (id, dt) values (175, '2010-06-25 00:00:00');
+insert into t1 (id, dt) values (176, '2010-06-26 00:00:00');
+insert into t1 (id, dt) values (177, '2010-06-27 00:00:00');
+insert into t1 (id, dt) values (178, '2010-06-28 00:00:00');
+insert into t1 (id, dt) values (179, '2010-06-29 00:00:00');
+insert into t1 (id, dt) values (180, '2010-06-30 00:00:00');
+insert into t1 (id, dt) values (181, '2010-07-01 00:00:00');
+insert into t1 (id, dt) values (182, '2010-07-02 00:00:00');
+insert into t1 (id, dt) values (183, '2010-07-03 00:00:00');
+insert into t1 (id, dt) values (184, '2010-07-04 00:00:00');
+insert into t1 (id, dt) values (185, '2010-07-05 00:00:00');
+insert into t1 (id, dt) values (186, '2010-07-06 00:00:00');
+insert into t1 (id, dt) values (187, '2010-07-07 00:00:00');
+insert into t1 (id, dt) values (188, '2010-07-08 00:00:00');
+insert into t1 (id, dt) values (189, '2010-07-09 00:00:00');
+insert into t1 (id, dt) values (190, '2010-07-10 00:00:00');
+insert into t1 (id, dt) values (191, '2010-07-11 00:00:00');
+insert into t1 (id, dt) values (192, '2010-07-12 00:00:00');
+insert into t1 (id, dt) values (193, '2010-07-13 00:00:00');
+insert into t1 (id, dt) values (194, '2010-07-14 00:00:00');
+insert into t1 (id, dt) values (195, '2010-07-15 00:00:00');
+insert into t1 (id, dt) values (196, '2010-07-16 00:00:00');
+insert into t1 (id, dt) values (197, '2010-07-17 00:00:00');
+insert into t1 (id, dt) values (198, '2010-07-18 00:00:00');
+insert into t1 (id, dt) values (199, '2010-07-19 00:00:00');
+insert into t1 (id, dt) values (200, '2010-07-20 00:00:00');
+insert into t1 (id, dt) values (201, '2010-07-21 00:00:00');
+insert into t1 (id, dt) values (202, '2010-07-22 00:00:00');
+insert into t1 (id, dt) values (203, '2010-07-23 00:00:00');
+insert into t1 (id, dt) values (204, '2010-07-24 00:00:00');
+insert into t1 (id, dt) values (205, '2010-07-25 00:00:00');
+insert into t1 (id, dt) values (206, '2010-07-26 00:00:00');
+insert into t1 (id, dt) values (207, '2010-07-27 00:00:00');
+insert into t1 (id, dt) values (208, '2010-07-28 00:00:00');
+insert into t1 (id, dt) values (209, '2010-07-29 00:00:00');
+insert into t1 (id, dt) values (210, '2010-07-30 00:00:00');
+insert into t1 (id, dt) values (211, '2010-07-31 00:00:00');
+insert into t1 (id, dt) values (212, '2010-08-01 00:00:00');
+insert into t1 (id, dt) values (213, '2010-08-02 00:00:00');
+insert into t1 (id, dt) values (214, '2010-08-03 00:00:00');
+insert into t1 (id, dt) values (215, '2010-08-04 00:00:00');
+insert into t1 (id, dt) values (216, '2010-08-05 00:00:00');
+insert into t1 (id, dt) values (217, '2010-08-06 00:00:00');
+insert into t1 (id, dt) values (218, '2010-08-07 00:00:00');
+insert into t1 (id, dt) values (219, '2010-08-08 00:00:00');
+insert into t1 (id, dt) values (220, '2010-08-09 00:00:00');
+insert into t1 (id, dt) values (221, '2010-08-10 00:00:00');
+insert into t1 (id, dt) values (222, '2010-08-11 00:00:00');
+insert into t1 (id, dt) values (223, '2010-08-12 00:00:00');
+insert into t1 (id, dt) values (224, '2010-08-13 00:00:00');
+insert into t1 (id, dt) values (225, '2010-08-14 00:00:00');
+insert into t1 (id, dt) values (226, '2010-08-15 00:00:00');
+insert into t1 (id, dt) values (227, '2010-08-16 00:00:00');
+insert into t1 (id, dt) values (228, '2010-08-17 00:00:00');
+insert into t1 (id, dt) values (229, '2010-08-18 00:00:00');
+insert into t1 (id, dt) values (230, '2010-08-19 00:00:00');
+insert into t1 (id, dt) values (231, '2010-08-20 00:00:00');
+insert into t1 (id, dt) values (232, '2010-08-21 00:00:00');
+insert into t1 (id, dt) values (233, '2010-08-22 00:00:00');
+insert into t1 (id, dt) values (234, '2010-08-23 00:00:00');
+insert into t1 (id, dt) values (235, '2010-08-24 00:00:00');
+insert into t1 (id, dt) values (236, '2010-08-25 00:00:00');
+insert into t1 (id, dt) values (237, '2010-08-26 00:00:00');
+insert into t1 (id, dt) values (238, '2010-08-27 00:00:00');
+insert into t1 (id, dt) values (239, '2010-08-28 00:00:00');
+insert into t1 (id, dt) values (240, '2010-08-29 00:00:00');
+insert into t1 (id, dt) values (241, '2010-08-30 00:00:00');
+insert into t1 (id, dt) values (242, '2010-08-31 00:00:00');
+insert into t1 (id, dt) values (243, '2010-09-01 00:00:00');
+insert into t1 (id, dt) values (244, '2010-09-02 00:00:00');
+insert into t1 (id, dt) values (245, '2010-09-03 00:00:00');
+insert into t1 (id, dt) values (246, '2010-09-04 00:00:00');
+insert into t1 (id, dt) values (247, '2010-09-05 00:00:00');
+insert into t1 (id, dt) values (248, '2010-09-06 00:00:00');
+insert into t1 (id, dt) values (249, '2010-09-07 00:00:00');
+insert into t1 (id, dt) values (250, '2010-09-08 00:00:00');
+insert into t1 (id, dt) values (251, '2010-09-09 00:00:00');
+insert into t1 (id, dt) values (252, '2010-09-10 00:00:00');
+insert into t1 (id, dt) values (253, '2010-09-11 00:00:00');
+insert into t1 (id, dt) values (254, '2010-09-12 00:00:00');
+insert into t1 (id, dt) values (255, '2010-09-13 00:00:00');
+insert into t1 (id, dt) values (256, '2010-09-14 00:00:00');
+insert into t1 (id, dt) values (257, '2010-09-15 00:00:00');
+insert into t1 (id, dt) values (258, '2010-09-16 00:00:00');
+insert into t1 (id, dt) values (259, '2010-09-17 00:00:00');
+insert into t1 (id, dt) values (260, '2010-09-18 00:00:00');
+insert into t1 (id, dt) values (261, '2010-09-19 00:00:00');
+insert into t1 (id, dt) values (262, '2010-09-20 00:00:00');
+insert into t1 (id, dt) values (263, '2010-09-21 00:00:00');
+insert into t1 (id, dt) values (264, '2010-09-22 00:00:00');
+insert into t1 (id, dt) values (265, '2010-09-23 00:00:00');
+insert into t1 (id, dt) values (266, '2010-09-24 00:00:00');
+insert into t1 (id, dt) values (267, '2010-09-25 00:00:00');
+insert into t1 (id, dt) values (268, '2010-09-26 00:00:00');
+insert into t1 (id, dt) values (269, '2010-09-27 00:00:00');
+insert into t1 (id, dt) values (270, '2010-09-28 00:00:00');
+insert into t1 (id, dt) values (271, '2010-09-29 00:00:00');
+insert into t1 (id, dt) values (272, '2010-09-30 00:00:00');
+insert into t1 (id, dt) values (273, '2010-10-01 00:00:00');
+insert into t1 (id, dt) values (274, '2010-10-02 00:00:00');
+insert into t1 (id, dt) values (275, '2010-10-03 00:00:00');
+insert into t1 (id, dt) values (276, '2010-10-04 00:00:00');
+insert into t1 (id, dt) values (277, '2010-10-05 00:00:00');
+insert into t1 (id, dt) values (278, '2010-10-06 00:00:00');
+insert into t1 (id, dt) values (279, '2010-10-07 00:00:00');
+insert into t1 (id, dt) values (280, '2010-10-08 00:00:00');
+insert into t1 (id, dt) values (281, '2010-10-09 00:00:00');
+insert into t1 (id, dt) values (282, '2010-10-10 00:00:00');
+insert into t1 (id, dt) values (283, '2010-10-11 00:00:00');
+insert into t1 (id, dt) values (284, '2010-10-12 00:00:00');
+insert into t1 (id, dt) values (285, '2010-10-13 00:00:00');
+insert into t1 (id, dt) values (286, '2010-10-14 00:00:00');
+insert into t1 (id, dt) values (287, '2010-10-15 00:00:00');
+insert into t1 (id, dt) values (288, '2010-10-16 00:00:00');
+insert into t1 (id, dt) values (289, '2010-10-17 00:00:00');
+insert into t1 (id, dt) values (290, '2010-10-18 00:00:00');
+insert into t1 (id, dt) values (291, '2010-10-19 00:00:00');
+insert into t1 (id, dt) values (292, '2010-10-20 00:00:00');
+insert into t1 (id, dt) values (293, '2010-10-21 00:00:00');
+insert into t1 (id, dt) values (294, '2010-10-22 00:00:00');
+insert into t1 (id, dt) values (295, '2010-10-23 00:00:00');
+insert into t1 (id, dt) values (296, '2010-10-24 00:00:00');
+insert into t1 (id, dt) values (297, '2010-10-25 00:00:00');
+insert into t1 (id, dt) values (298, '2010-10-26 00:00:00');
+insert into t1 (id, dt) values (299, '2010-10-27 00:00:00');
+insert into t1 (id, dt) values (300, '2010-10-28 00:00:00');
+insert into t1 (id, dt) values (301, '2010-10-29 00:00:00');
+insert into t1 (id, dt) values (302, '2010-10-30 00:00:00');
+insert into t1 (id, dt) values (303, '2010-10-31 00:00:00');
+insert into t1 (id, dt) values (304, '2010-11-01 00:00:00');
+insert into t1 (id, dt) values (305, '2010-11-02 00:00:00');
+insert into t1 (id, dt) values (306, '2010-11-03 00:00:00');
+insert into t1 (id, dt) values (307, '2010-11-04 00:00:00');
+insert into t1 (id, dt) values (308, '2010-11-05 00:00:00');
+insert into t1 (id, dt) values (309, '2010-11-06 00:00:00');
+insert into t1 (id, dt) values (310, '2010-11-07 00:00:00');
+insert into t1 (id, dt) values (311, '2010-11-08 00:00:00');
+insert into t1 (id, dt) values (312, '2010-11-09 00:00:00');
+insert into t1 (id, dt) values (313, '2010-11-10 00:00:00');
+insert into t1 (id, dt) values (314, '2010-11-11 00:00:00');
+insert into t1 (id, dt) values (315, '2010-11-12 00:00:00');
+insert into t1 (id, dt) values (316, '2010-11-13 00:00:00');
+insert into t1 (id, dt) values (317, '2010-11-14 00:00:00');
+insert into t1 (id, dt) values (318, '2010-11-15 00:00:00');
+insert into t1 (id, dt) values (319, '2010-11-16 00:00:00');
+insert into t1 (id, dt) values (320, '2010-11-17 00:00:00');
+insert into t1 (id, dt) values (321, '2010-11-18 00:00:00');
+insert into t1 (id, dt) values (322, '2010-11-19 00:00:00');
+insert into t1 (id, dt) values (323, '2010-11-20 00:00:00');
+insert into t1 (id, dt) values (324, '2010-11-21 00:00:00');
+insert into t1 (id, dt) values (325, '2010-11-22 00:00:00');
+insert into t1 (id, dt) values (326, '2010-11-23 00:00:00');
+insert into t1 (id, dt) values (327, '2010-11-24 00:00:00');
+insert into t1 (id, dt) values (328, '2010-11-25 00:00:00');
+insert into t1 (id, dt) values (329, '2010-11-26 00:00:00');
+insert into t1 (id, dt) values (330, '2010-11-27 00:00:00');
+insert into t1 (id, dt) values (331, '2010-11-28 00:00:00');
+insert into t1 (id, dt) values (332, '2010-11-29 00:00:00');
+insert into t1 (id, dt) values (333, '2010-11-30 00:00:00');
+insert into t1 (id, dt) values (334, '2010-12-01 00:00:00');
+insert into t1 (id, dt) values (335, '2010-12-02 00:00:00');
+insert into t1 (id, dt) values (336, '2010-12-03 00:00:00');
+insert into t1 (id, dt) values (337, '2010-12-04 00:00:00');
+insert into t1 (id, dt) values (338, '2010-12-05 00:00:00');
+insert into t1 (id, dt) values (339, '2010-12-06 00:00:00');
+insert into t1 (id, dt) values (340, '2010-12-07 00:00:00');
+insert into t1 (id, dt) values (341, '2010-12-08 00:00:00');
+insert into t1 (id, dt) values (342, '2010-12-09 00:00:00');
+insert into t1 (id, dt) values (343, '2010-12-10 00:00:00');
+insert into t1 (id, dt) values (344, '2010-12-11 00:00:00');
+insert into t1 (id, dt) values (345, '2010-12-12 00:00:00');
+insert into t1 (id, dt) values (346, '2010-12-13 00:00:00');
+insert into t1 (id, dt) values (347, '2010-12-14 00:00:00');
+insert into t1 (id, dt) values (348, '2010-12-15 00:00:00');
+insert into t1 (id, dt) values (349, '2010-12-16 00:00:00');
+insert into t1 (id, dt) values (350, '2010-12-17 00:00:00');
+
+SELECT COUNT(*) FROM t1;
+
+--connection node_2
+call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
+--send call p1(100);
+
+--connection node_3
+call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
+--send call p1(100);
+
+--connection node_4
+call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
+--send call p1(100);
+
+--connection node_1
+SET SESSION wsrep_OSU_method='RSU';
+SELECT @@wsrep_OSU_method;
+SET SESSION sql_log_bin = 0;
+
+--error 0,ER_LOCK_DEADLOCK
+ALTER TABLE t1 DROP PARTITION rx2009xx;
+--error 0,ER_LOCK_DEADLOCK
+ALTER TABLE t1 DROP PARTITION rx201004;
+--error 0,ER_LOCK_DEADLOCK
+ALTER TABLE t1 DROP PARTITION rx201008;
+
+SET SESSION wsrep_OSU_METHOD='TOI';
+SELECT @@wsrep_OSU_method;
+
+--connection node_2
+--error 0,ER_LOCK_DEADLOCK
+reap;
+
+--connection node_3
+--error 0,ER_LOCK_DEADLOCK
+reap;
+
+--connection node_4
+--error 0,ER_LOCK_DEADLOCK
+reap;
+
+--connection node_1
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
diff --git a/mysql-test/suite/galera/t/galera_query_cache-master.opt b/mysql-test/suite/galera/t/galera_query_cache-master.opt
deleted file mode 100644
index 915a36c0937..00000000000
--- a/mysql-test/suite/galera/t/galera_query_cache-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---query_cache_type=1 --query_cache_size=1355776
diff --git a/mysql-test/suite/galera/t/galera_query_cache.cnf b/mysql-test/suite/galera/t/galera_query_cache.cnf
new file mode 100644
index 00000000000..80f40b0997e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache.cnf
@@ -0,0 +1,10 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+query_cache_type=1
+query_cache_size=1355776
+
+[mysqld.2]
+query_cache_type=1
+query_cache_size=1355776
+
diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt b/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt
deleted file mode 100644
index 915a36c0937..00000000000
--- a/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---query_cache_type=1 --query_cache_size=1355776
diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf
new file mode 100644
index 00000000000..80f40b0997e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf
@@ -0,0 +1,10 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+query_cache_type=1
+query_cache_size=1355776
+
+[mysqld.2]
+query_cache_type=1
+query_cache_size=1355776
+
diff --git a/mysql-test/suite/galera/t/galera_rsu_add_pk.test b/mysql-test/suite/galera/t/galera_rsu_add_pk.test
index 7db990d7be1..094048f6caa 100644
--- a/mysql-test/suite/galera/t/galera_rsu_add_pk.test
+++ b/mysql-test/suite/galera/t/galera_rsu_add_pk.test
@@ -26,14 +26,20 @@ SET SESSION wsrep_OSU_method = "TOI";
# Insert values after the ALTER
INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+--let $wait_condition = SELECT COUNT(*) = 300000 FROM t1;
+--source include/wait_condition.inc
-SELECT COUNT(*) = 300000 FROM t1;
-SELECT MAX(f1) = 299999 FROM t1;
+SELECT COUNT(*) AS EXPECT_300000 FROM t1;
+SELECT MAX(f1) AS EXPECT_299999 FROM t1;
--connection node_1
--reap
-SELECT COUNT(*) = 300000 FROM t1;
-SELECT MAX(f1) = 299999 FROM t1;
+
+--let $wait_condition = SELECT COUNT(*) = 300000 FROM t1;
+--source include/wait_condition.inc
+
+SELECT COUNT(*) AS EXPECT_300000 FROM t1;
+SELECT MAX(f1) AS EXPECT_299999 FROM t1;
SET SESSION wsrep_OSU_method = "RSU";
ALTER TABLE t1 ADD PRIMARY KEY (f1);
diff --git a/mysql-test/suite/galera/t/galera_rsu_drop_pk.test b/mysql-test/suite/galera/t/galera_rsu_drop_pk.test
index e64259494d1..97bdbcfdb84 100644
--- a/mysql-test/suite/galera/t/galera_rsu_drop_pk.test
+++ b/mysql-test/suite/galera/t/galera_rsu_drop_pk.test
@@ -4,10 +4,9 @@
--source include/big_test.inc
--source include/galera_cluster.inc
---source include/have_innodb.inc
--connection node_1
-CREATE TABLE ten (f1 INTEGER);
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
@@ -26,13 +25,18 @@ SET SESSION wsrep_OSU_method = "TOI";
# Insert even more data after the ALTER has completed
INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
-SELECT COUNT(*) = 300000 FROM t1;
-SELECT MAX(f1) = 299999 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 300000 FROM t1;
+--source include/wait_condition.inc
+
+SELECT COUNT(*) as expect_300000 FROM t1;
+SELECT MAX(f1) as expect_299999 FROM t1;
--connection node_1
--reap
-SELECT COUNT(*) = 300000 FROM t1;
-SELECT MAX(f1) = 299999 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 300000 FROM t1;
+--source include/wait_condition.inc
+SELECT COUNT(*) as expect_300000 FROM t1;
+SELECT MAX(f1) as expect_299999 FROM t1;
SET SESSION wsrep_OSU_method = "RSU";
ALTER TABLE t1 DROP PRIMARY KEY;
@@ -44,15 +48,19 @@ INSERT INTO t1 (f1) VALUES (1);
INSERT INTO t1 (f1) VALUES (10);
--connection node_1
-SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1;
-SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 10;
+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1 where f1 = 10;
+--source include/wait_condition.inc
+SELECT COUNT(*) as expect_2 FROM t1 WHERE f1 = 1;
+SELECT COUNT(*) as expect_2 FROM t1 WHERE f1 = 10;
INSERT INTO t1 (f1) VALUES (100);
INSERT INTO t1 (f1) VALUES (1000);
--connection node_2
-SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 100;
-SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1000;
+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1 where f1 = 1000;
+--source include/wait_condition.inc
+SELECT COUNT(*) as expect_2 FROM t1 WHERE f1 = 100;
+SELECT COUNT(*) as expect_2 FROM t1 WHERE f1 = 1000;
DROP TABLE t1;
DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt b/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt
deleted file mode 100644
index beae84b3862..00000000000
--- a/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-bin
diff --git a/mysql-test/suite/galera/t/galera_sbr_binlog.cnf b/mysql-test/suite/galera/t/galera_sbr_binlog.cnf
new file mode 100644
index 00000000000..9dbd81f758d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sbr_binlog.cnf
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+log-bin
+
+[mysqld.2]
+log-bin
diff --git a/mysql-test/suite/galera/t/galera_as_slave_preordered.cnf b/mysql-test/suite/galera/t/galera_slave_replay.cnf
index d1a0fb15ff3..9449ec9cf40 100644
--- a/mysql-test/suite/galera/t/galera_as_slave_preordered.cnf
+++ b/mysql-test/suite/galera/t/galera_slave_replay.cnf
@@ -1,3 +1 @@
!include ../galera_2nodes_as_slave.cnf
-[mysqld]
-wsrep-preordered=TRUE
diff --git a/mysql-test/suite/galera/t/galera_slave_replay.test b/mysql-test/suite/galera/t/galera_slave_replay.test
new file mode 100644
index 00000000000..96f6a3e26fc
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_slave_replay.test
@@ -0,0 +1,199 @@
+#
+# This test tests the operation of transaction replay for async replication slave.
+# If a potentially conflicting galera transaction arrives at
+# just the right time during the commit and has lock conflict with async replication transaction
+# applied by slave SQL thread, then the async replication transaction should either abort
+# or rollback and replay (depending on the nature of lock conflict).
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+
+--connection node_2a
+--source include/galera_cluster.inc
+--source include/galera_have_debug_sync.inc
+
+#
+# node 1 is native MariaDB server operating as async replication master
+#
+--connection node_1
+RESET MASTER;
+
+--connection node_2a
+#
+# count the number of wsrep replay's done in the node
+#
+--let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+
+
+#
+# nodes 2 and 3 form a galera cluster, node 2 operates as slave for native MariaDB naster in node 1
+#
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (3, 'a');
+
+#
+# use statement format replication to cause a false positive conflict with async replication transaction
+# and galera replication. The conflict will be on GAP lock, and slave SQL thread should rollback
+# and replay
+#
+set binlog_format=STATEMENT;
+
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+SELECT * FROM t1 FOR UPDATE;
+UPDATE t1 SET f2 = 'c' WHERE f1 > 1;
+
+--connection node_2a
+# wait for create table and inserts to be replicated from master
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
+--source include/wait_condition.inc
+
+# wait for create table and inserts to be replicated in cluster
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
+--source include/wait_condition.inc
+
+--connection node_2a
+# Block the future commit of async replication
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+# block also the applier before applying begins
+SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
+
+#
+# now inject a conflicting insert from node 3, it will replicate with
+# earlier seqno (than async transaction) and pause before applying in node 2
+#
+--connection node_3
+INSERT INTO test.t1 VALUES (2, 'b');
+
+#
+# send the update from master, this will succeed here, beceuase of async replication.
+# async replication will apply this in node 2 and pause before commit phase,
+--connection node_1
+--error 0
+COMMIT;
+
+# Wait until async slave commit is blocked in node_2
+--connection node_2a
+--source include/galera_wait_sync_point.inc
+
+#
+# release the applier
+# note: have to clear wsrep_apply_cb sync point first, as async replication will go for replay
+# and as this sync point, after BF applier is released to progress
+#
+SET GLOBAL debug_dbug = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+# Unblock the async slave commit
+--connection node_2a
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+--connection node_1
+
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+SELECT * FROM t1;
+
+--connection node_2a
+
+# wsrep_local_replays has increased by 1
+set session wsrep_sync_wait=15;
+--let $wsrep_local_replays_new = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+set session wsrep_sync_wait=0;
+
+--disable_query_log
+--eval SELECT $wsrep_local_replays_new - $wsrep_local_replays_old = 1 AS wsrep_local_replays;
+--enable_query_log
+
+#
+# replaying of async transaction should be effective, and row 3 having 'c' in f2
+#
+SELECT * FROM t1;
+SET DEBUG_SYNC = "RESET";
+
+#********************************************************************************
+# test phase 2
+#********************************************************************************
+
+--echo #
+--echo # test phase with real abort
+--echo #
+
+--connection node_1
+
+set binlog_format=ROW;
+
+insert into t1 values (4, 'd');
+
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+UPDATE t1 SET f2 = 'd' WHERE f1 = 3;
+
+--connection node_2a
+# wait for the last insert to be replicated from master
+--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
+--source include/wait_condition.inc
+
+# Block the commit
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+# block applier
+SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
+
+# Inject a conflicting update from node 3
+--connection node_3
+UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3;
+
+# send the update from master
+--connection node_1
+--error 0
+COMMIT;
+
+--connection node_2a
+
+# release the applier
+SET GLOBAL debug_dbug = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+
+# Unblock the async slave commit
+--connection node_2a
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+SET DEBUG_SYNC = "RESET";
+
+--connection node_2a
+
+set session wsrep_sync_wait=15;
+SELECT COUNT(*) = 1 FROM test.t1 WHERE f2 = 'e';
+set session wsrep_sync_wait=0;
+
+STOP SLAVE;
+RESET SLAVE;
+
+DROP TABLE t1;
+
+--connection node_1
+DROP TABLE t1;
+RESET MASTER;
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
index 336296e9bfe..5e6913d4d2b 100644
--- a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
@@ -4,6 +4,8 @@
wsrep_sst_method=mariabackup
wsrep_sst_auth="root:"
wsrep_debug=ON
+innodb-file-format='Barracuda'
+innodb-file-per-table=ON
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
diff --git a/mysql-test/suite/galera/t/galera_udf-master.opt b/mysql-test/suite/galera/t/galera_udf-master.opt
deleted file mode 100644
index 14dfe3e20bc..00000000000
--- a/mysql-test/suite/galera/t/galera_udf-master.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-$UDF_EXAMPLE_LIB_OPT
---query_cache_type=1
diff --git a/mysql-test/suite/galera/t/galera_udf.cnf b/mysql-test/suite/galera/t/galera_udf.cnf
new file mode 100644
index 00000000000..69d5acd65f3
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_udf.cnf
@@ -0,0 +1,15 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+$UDF_EXAMPLE_LIB_OPT
+query_cache_type=1
+
+[mysqld.2]
+query_cache_type=1
+
+
+
+
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_v1_row_events-master.opt b/mysql-test/suite/galera/t/galera_v1_row_events-master.opt
deleted file mode 100644
index dc82542128e..00000000000
--- a/mysql-test/suite/galera/t/galera_v1_row_events-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---log-bin-use-v1-row-events=1
diff --git a/mysql-test/suite/galera/t/galera_v1_row_events.cnf b/mysql-test/suite/galera/t/galera_v1_row_events.cnf
new file mode 100644
index 00000000000..b95e321ad4f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_v1_row_events.cnf
@@ -0,0 +1,13 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+log-bin-use-v1-row-events=1
+
+[mysqld.2]
+
+
+
+
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf
new file mode 100644
index 00000000000..523bae68763
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf
@@ -0,0 +1,13 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep-auto-increment-control=ON
+
+[mysqld.2]
+wsrep-auto-increment-control=ON
+
+
+
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt
deleted file mode 100644
index 0a03610888c..00000000000
--- a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt
+++ /dev/null
@@ -1 +0,0 @@
---wsrep-auto-increment-control=ON
diff --git a/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
index 3e2108868af..f18069929f9 100644
--- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test
+++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
@@ -3,9 +3,10 @@
#
--source include/galera_cluster.inc
---source include/have_innodb.inc
--source include/have_perfschema.inc
+call mtr.add_suppression("WSREP has not yet prepared node for application use");
+
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
@@ -30,10 +31,10 @@ SHOW STATUS LIKE 'wsrep_ready';
# Must return 'Non-primary'
SHOW STATUS LIKE 'wsrep_cluster_status';
---error ER_UNKNOWN_COM_ERROR
+--error ER_UNKNOWN_COM_ERROR,1047
SELECT * FROM t1;
---error ER_UNKNOWN_COM_ERROR
+--error ER_UNKNOWN_COM_ERROR,1047
SELECT 1 FROM t1;
SET @@session.wsrep_dirty_reads=ON;
@@ -45,7 +46,7 @@ SELECT i, variable_name, variable_value FROM t1, information_schema.session_vari
SET @@session.wsrep_dirty_reads=OFF;
---error ER_UNKNOWN_COM_ERROR
+--error ER_UNKNOWN_COM_ERROR,1047
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
SELECT 1;
diff --git a/mysql-test/suite/galera/t/galera_var_notify_cmd.test b/mysql-test/suite/galera/t/galera_var_notify_cmd.test
index b261f878ced..fda61bf2914 100644
--- a/mysql-test/suite/galera/t/galera_var_notify_cmd.test
+++ b/mysql-test/suite/galera/t/galera_var_notify_cmd.test
@@ -3,10 +3,16 @@
# notifications into a table.
#
---source include/have_innodb.inc
--source include/galera_cluster.inc
+--source include/force_restart.inc
--connection node_1
-SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership;
-SELECT MAX(size) = 2 FROM mtr_wsrep_notify.status;
-SELECT COUNT(DISTINCT idx) = 2 FROM mtr_wsrep_notify.status;
+--let $wait_condition = SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership;
+--source include/wait_condition.inc
+
+SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
+SELECT MAX(size) AS EXPECT_2 FROM mtr_wsrep_notify.status;
+SELECT COUNT(DISTINCT idx) AS EXPECT_2 FROM mtr_wsrep_notify.status;
+
+# CLEANUP
+DROP SCHEMA mtr_wsrep_notify;
diff --git a/mysql-test/suite/galera/t/galera_var_reject_queries.test b/mysql-test/suite/galera/t/galera_var_reject_queries.test
index 8b80c04e3be..aa31b94d6e0 100644
--- a/mysql-test/suite/galera/t/galera_var_reject_queries.test
+++ b/mysql-test/suite/galera/t/galera_var_reject_queries.test
@@ -5,6 +5,8 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+call mtr.add_suppression("WSREP has not yet prepared node for application use");
+
CREATE TABLE t1 (f1 INTEGER);
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
@@ -15,7 +17,7 @@ SET SESSION wsrep_reject_queries = ALL;
SET GLOBAL wsrep_reject_queries = ALL;
---error ER_UNKNOWN_COM_ERROR
+--error ER_UNKNOWN_COM_ERROR,1047
SELECT * FROM t1;
#
@@ -30,7 +32,7 @@ SET GLOBAL wsrep_reject_queries = ALL_KILL;
SELECT * FROM t1;
--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
---error ER_UNKNOWN_COM_ERROR
+--error ER_UNKNOWN_COM_ERROR,1047
SELECT * FROM t1;
# Confirm that replication continues
diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.cnf b/mysql-test/suite/galera/t/galera_var_sst_auth.cnf
new file mode 100644
index 00000000000..ff29db2306b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_sst_auth.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_sst_auth=root:
+
+[mysqld.2]
+wsrep_sst_auth=root:
+
+
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.opt b/mysql-test/suite/galera/t/galera_var_sst_auth.opt
deleted file mode 100644
index 67babbb1ae7..00000000000
--- a/mysql-test/suite/galera/t/galera_var_sst_auth.opt
+++ /dev/null
@@ -1 +0,0 @@
---wsrep_sst_auth=root:
diff --git a/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt b/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt
deleted file mode 100644
index 930c483bd64..00000000000
--- a/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---wsrep_log_conflicts=ON
diff --git a/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf
new file mode 100644
index 00000000000..440c37bea81
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_log_conflicts=ON
+
+[mysqld.2]
+wsrep_log_conflicts=ON
+
+
+
+
+
diff --git a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test
index 6ba8ce786c8..59350222a4c 100644
--- a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test
+++ b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test
@@ -7,6 +7,19 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'on' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
@@ -16,6 +29,19 @@ SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VAR
--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'on' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
+
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
diff --git a/mysql-test/suite/galera/t/lp1376747-4.test b/mysql-test/suite/galera/t/lp1376747-4.test
index 0c707d6d681..7cf922b97e5 100644
--- a/mysql-test/suite/galera/t/lp1376747-4.test
+++ b/mysql-test/suite/galera/t/lp1376747-4.test
@@ -17,7 +17,6 @@ INSERT INTO t1 VALUES (1);
--connection node_2
SET session wsrep_sync_wait=0;
-SET session wsrep_causal_reads=OFF;
FLUSH TABLE WITH READ LOCK;
--connection node_1
@@ -26,26 +25,32 @@ INSERT INTO t1 VALUES (2,3);
--connection node_2a
SET session wsrep_sync_wait=0;
-SET session wsrep_causal_reads=OFF;
+
+--echo # node_1 DDL should not yet be applied
SHOW CREATE TABLE t1;
---sleep 1
+
--send FLUSH TABLES t1 WITH READ LOCK;
--connection node_2
-# let the flush table wait in pause state before we unlock
-# table otherwise there is window where-in flush table is
-# yet to wait in pause and unlock allows alter table to proceed.
-# this is because send in asynchronous.
---sleep 3
-# this will release existing lock but will not resume
-# the cluster as there is new FTRL that is still pausing it.
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%committed%';
+--source include/wait_condition.inc
+
UNLOCK TABLES;
+
+--echo # node_1 DDL should not yet be applied 2
SHOW CREATE TABLE t1;
--connection node_2a
--reap
UNLOCK TABLES;
---sleep 2
+
+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--echo # node_1 DDL should be applied 2
SHOW CREATE TABLE t1;
SELECT * from t1;
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt b/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt
deleted file mode 100644
index a00258bc48c..00000000000
--- a/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---query_cache_type=1
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#201.cnf b/mysql-test/suite/galera/t/mysql-wsrep#201.cnf
new file mode 100644
index 00000000000..4a82e9fa037
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#201.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+query_cache_type=1
+
+[mysqld.2]
+query_cache_type=1
+
+
diff --git a/mysql-test/suite/galera/t/query_cache.cnf b/mysql-test/suite/galera/t/query_cache.cnf
new file mode 100644
index 00000000000..4a82e9fa037
--- /dev/null
+++ b/mysql-test/suite/galera/t/query_cache.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+query_cache_type=1
+
+[mysqld.2]
+query_cache_type=1
+
+
diff --git a/mysql-test/suite/galera/t/query_cache.opt b/mysql-test/suite/galera/t/query_cache.opt
deleted file mode 100644
index a00258bc48c..00000000000
--- a/mysql-test/suite/galera/t/query_cache.opt
+++ /dev/null
@@ -1 +0,0 @@
---query_cache_type=1
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
index d99565b2f4c..ffc821b6ecc 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
@@ -208,6 +208,7 @@ DROP TABLE t1, t2;
# MDEV-16222 Assertion `0' failed in row_purge_remove_sec_if_poss_leaf
# on table with virtual columns and indexes
#
+InnoDB 0 transactions not purged
set @saved_dbug= @@global.debug_dbug;
set global debug_dbug= "+d,ib_purge_virtual_mdev_16222_1,ib_purge_virtual_mdev_16222_2";
create table t1 (
@@ -253,7 +254,7 @@ SET GLOBAL innodb_debug_sync = "ib_clust_v_col_before_row_allocated "
SET GLOBAL innodb_debug_sync = "ib_open_after_dict_open "
"SIGNAL purge_open "
"WAIT_FOR select_open";
-set @saved_dbug= @@global.debug_dbug;
+SET @saved_dbug= @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,ib_purge_virtual_index_callback";
connect purge_waiter,localhost,root;
SET debug_sync= "now WAIT_FOR before_row_allocated";
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
index 276407007da..a384e0667de 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
@@ -264,6 +264,7 @@ DROP TABLE t1, t2;
--echo # on table with virtual columns and indexes
--echo #
+--source suite/innodb/include/wait_all_purged.inc
--let $datadir= `select @@datadir`
set @saved_dbug= @@global.debug_dbug;
set global debug_dbug= "+d,ib_purge_virtual_mdev_16222_1,ib_purge_virtual_mdev_16222_2";
@@ -336,7 +337,7 @@ SET GLOBAL innodb_debug_sync = "ib_open_after_dict_open "
# In 10.2 trx_undo_roll_ptr_is_insert(t_roll_ptr) condition never pass in purge,
# so this condition is forced to pass in row_vers_old_has_index_entry
-set @saved_dbug= @@global.debug_dbug;
+SET @saved_dbug= @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,ib_purge_virtual_index_callback";
# The purge starts from REPLACE command. To avoid possible race, separate
@@ -373,4 +374,4 @@ SELECT * FROM t1;
# Cleanup
DROP TABLE t1;
SET debug_sync= reset;
-set global debug_dbug= @saved_dbug; \ No newline at end of file
+set global debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/innodb/r/blob-update-debug.result b/mysql-test/suite/innodb/r/blob-update-debug.result
index 1360745b7e6..813a469dd2b 100644
--- a/mysql-test/suite/innodb/r/blob-update-debug.result
+++ b/mysql-test/suite/innodb/r/blob-update-debug.result
@@ -7,9 +7,11 @@ insert into t1 values (1, repeat('*', 50000));
select f1, substring(f2, 1, 40) from t1;
f1 substring(f2, 1, 40)
1 ****************************************
-set debug_dbug = 'd,row_ins_index_entry_timeout';
+set @saved_debug = @@session.debug_dbug;
+SET debug_dbug = 'd,row_ins_index_entry_timeout';
update t1 set f1 = 3;
select f1, substring(f2, 1, 40) from t1;
f1 substring(f2, 1, 40)
3 ****************************************
drop table t1;
+SET debug_dbug= @saved_debug;
diff --git a/mysql-test/suite/innodb/r/innodb-32k-crash.result b/mysql-test/suite/innodb/r/innodb-32k-crash.result
index 6c6b7c7fd35..bb46704198d 100644
--- a/mysql-test/suite/innodb/r/innodb-32k-crash.result
+++ b/mysql-test/suite/innodb/r/innodb-32k-crash.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression("Cannot add field `u` in table `test`.`t2` because after adding it, the row size is");
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob,
diff --git a/mysql-test/suite/innodb/r/innodb-64k-crash.result b/mysql-test/suite/innodb/r/innodb-64k-crash.result
index 7ed271a14dd..e7998fddf29 100644
--- a/mysql-test/suite/innodb/r/innodb-64k-crash.result
+++ b/mysql-test/suite/innodb/r/innodb-64k-crash.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression("Cannot add field `pa` in table `test`.`t2` because after adding it, the row size is");
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob,
diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result
index c2b46661e31..8a6327216d0 100644
--- a/mysql-test/suite/innodb/r/innodb-blob.result
+++ b/mysql-test/suite/innodb/r/innodb-blob.result
@@ -153,3 +153,9 @@ a
SELECT * FROM t2;
a
DROP TABLE t1,t2,t3;
+CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT)ENGINE=InnoDB
+ROW_FORMAT=REDUNDANT;
+SET @fill_amount = (@@innodb_page_size / 2 ) + 1 ;
+INSERT INTO t1 VALUES(1, REPEAT(2, @fill_amount));
+UPDATE t1 SET f1 = 2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7513.result b/mysql-test/suite/innodb/r/innodb-mdev-7513.result
index 2ef54911cf1..68f06d89036 100644
--- a/mysql-test/suite/innodb/r/innodb-mdev-7513.result
+++ b/mysql-test/suite/innodb/r/innodb-mdev-7513.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression("InnoDB: Cannot add field .* in table");
CREATE TABLE t1 ( text1 TEXT,
text2 TEXT,
text3 TEXT,
diff --git a/mysql-test/suite/innodb/r/innodb-replace-debug.result b/mysql-test/suite/innodb/r/innodb-replace-debug.result
index 989fb055cbc..03e22b774e4 100644
--- a/mysql-test/suite/innodb/r/innodb-replace-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-replace-debug.result
@@ -5,10 +5,10 @@ create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34);
set @old_dbug= @@session.debug_dbug;
-set debug_dbug = '+d,row_ins_sec_index_entry_timeout';
+SET debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34);
select * from t1;
f1 f2 f3
14 25 34
drop table t1;
-set debug_dbug = @old_dbug;
+SET debug_dbug = @old_dbug;
diff --git a/mysql-test/suite/innodb/r/innodb-stats-initialize-failure.result b/mysql-test/suite/innodb/r/innodb-stats-initialize-failure.result
index ef2d3182b92..06bb708b82c 100644
--- a/mysql-test/suite/innodb/r/innodb-stats-initialize-failure.result
+++ b/mysql-test/suite/innodb/r/innodb-stats-initialize-failure.result
@@ -1,4 +1,5 @@
call mtr.add_suppression("InnoDB: Warning: Index.*");
+SET @saved_dbug = @@SESSION.debug_dbug;
set DEBUG_DBUG='+d,ib_ha_innodb_stat_not_initialized';
create table t1(a int not null primary key, b int, c int, key(b), key(c)) engine=innodb;
create procedure innodb_insert_proc (repeat_count int)
@@ -27,6 +28,6 @@ count(1)
select count(1) from t1 where c between 7 and 787;
count(1)
781
-set DEBUG_DBUG=NULL;
drop procedure innodb_insert_proc;
drop table t1;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-1.result b/mysql-test/suite/innodb/r/innodb-wl5522-1.result
index b2a5f49a9ad..55557a8fb99 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-1.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-1.result
@@ -389,7 +389,7 @@ CREATE TABLE testdb_wl5522.t1 ( i bigint) ENGINE = Innodb;
ALTER TABLE testdb_wl5522.t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE testdb_wl5522.t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Column i precise type mismatch.)
+ERROR HY000: Schema mismatch (Column i precise type mismatch, it's 0X408 in the table and 0X403 in the tablespace meta file)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE testdb_wl5522.t1;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result
index 62f03292baa..b364b36a36f 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522.result
@@ -426,7 +426,7 @@ SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Column c2 precise type mismatch.)
+ERROR HY000: Schema mismatch (Column c2 precise type mismatch, it's 0X408 in the table and 0X403 in the tablespace meta file)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug11754376.result b/mysql-test/suite/innodb/r/innodb_bug11754376.result
index b9f2a169a73..650dfbb35c2 100644
--- a/mysql-test/suite/innodb/r/innodb_bug11754376.result
+++ b/mysql-test/suite/innodb/r/innodb_bug11754376.result
@@ -1,3 +1,5 @@
CREATE TABLE bug11754376 (c INT) ENGINE=INNODB;
+SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION DEBUG_DBUG='+d,test_normalize_table_name_low';
DROP TABLE bug11754376;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/innodb/r/innodb_bug30113362.result b/mysql-test/suite/innodb/r/innodb_bug30113362.result
new file mode 100644
index 00000000000..9d43053b281
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug30113362.result
@@ -0,0 +1,119 @@
+SET GLOBAL innodb_adaptive_hash_index = false;
+SET GLOBAL innodb_stats_persistent = false;
+connect purge_control,localhost,root,,;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connect con2,localhost,root,,;
+CREATE TABLE t1 (
+a00 CHAR(255) NOT NULL DEFAULT 'a',
+a01 CHAR(255) NOT NULL DEFAULT 'a',
+a02 CHAR(255) NOT NULL DEFAULT 'a',
+b INT NOT NULL DEFAULT 0,
+PRIMARY KEY(a00, a01, a02)
+) charset latin1 ENGINE = InnoDB COMMENT='MERGE_THRESHOLD=45';
+SET GLOBAL innodb_limit_optimistic_insert_debug = 3;
+CREATE PROCEDURE data_load_t1()
+BEGIN
+DECLARE c1 INT DEFAULT 97;
+DECLARE c2 INT DEFAULT 97;
+DECLARE c3 INT DEFAULT 97;
+WHILE c1 < 102 DO
+WHILE c2 < 123 DO
+WHILE c3 < 123 DO
+INSERT INTO t1 (a00) VALUES (CHAR(c1,c2,c3));
+SET c3 = c3 + 1;
+END WHILE;
+SET c3 = 97;
+SET c2 = c2 + 1;
+END WHILE;
+SET c2 = 97;
+SET c1 = c1 + 1;
+END WHILE;
+END |
+call data_load_t1();
+DROP PROCEDURE data_load_t1;
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+1856
+connection con2;
+DELETE FROM t1 WHERE a00 = 'cnm';
+COMMIT;
+BEGIN;
+INSERT INTO t1 SET a00 = 'cnm';
+connection purge_control;
+COMMIT;
+connection con2;
+SET GLOBAL innodb_limit_optimistic_insert_debug = 0;
+ROLLBACK;
+# Test start
+connection purge_control;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection con2;
+DELETE FROM t1 WHERE a00 = 'bii';
+COMMIT;
+BEGIN;
+INSERT INTO t1 SET a00 = 'bii';
+SET DEBUG_SYNC = 'rollback_undo_pk SIGNAL roll1_wait WAIT_FOR roll2';
+SET DEBUG_SYNC = 'rollback_purge_clust SIGNAL rollback_waiting WAIT_FOR resume';
+ROLLBACK;
+connection purge_control;
+SET DEBUG_SYNC = 'now WAIT_FOR roll1_wait';
+COMMIT;
+SET DEBUG_SYNC = 'now SIGNAL roll2';
+connect con1,localhost,root,,;
+SET DEBUG_SYNC = 'now WAIT_FOR rollback_waiting TIMEOUT 1';
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait1';
+SELECT a00 FROM t1 WHERE a00 = 'bii';
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait1 TIMEOUT 1';
+SET DEBUG_SYNC = 'now SIGNAL resume';
+connection con1;
+a00
+connection con2;
+connection default;
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+1856
+DELETE FROM t1 WHERE a00 = 'dpn';
+COMMIT;
+INSERT INTO t1 SET a00 = 'dpn';
+ROLLBACK;
+ALTER TABLE t1 COMMENT='MERGE_THRESHOLD=35';
+connection purge_control;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection con2;
+DELETE FROM t1 WHERE a00 = 'cnd';
+COMMIT;
+BEGIN;
+INSERT INTO t1 SET a00 = 'cnd';
+SET DEBUG_SYNC = 'rollback_undo_pk SIGNAL roll1_wait WAIT_FOR roll2';
+SET DEBUG_SYNC = 'rollback_purge_clust SIGNAL rollback_waiting WAIT_FOR resume EXECUTE 2';
+ROLLBACK;
+connection purge_control;
+SET DEBUG_SYNC = 'now WAIT_FOR roll1_wait';
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+SET DEBUG_SYNC = 'now SIGNAL roll2';
+connection con1;
+SET DEBUG_SYNC = 'now WAIT_FOR rollback_waiting TIMEOUT 1';
+SET DEBUG_SYNC = 'now SIGNAL resume';
+SET DEBUG_SYNC = 'now WAIT_FOR rollback_waiting TIMEOUT 1';
+disconnect purge_control;
+connection default;
+SET DEBUG_SYNC = 'now SIGNAL resume';
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+1856
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug56947.result b/mysql-test/suite/innodb/r/innodb_bug56947.result
index 4248013b088..aa922776f7b 100644
--- a/mysql-test/suite/innodb/r/innodb_bug56947.result
+++ b/mysql-test/suite/innodb/r/innodb_bug56947.result
@@ -1,5 +1,6 @@
SET GLOBAL innodb_file_per_table=0;
create table bug56947(a int not null) engine = innodb;
+SET @saved_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG='+d,ib_rebuild_cannot_rename';
alter table bug56947 add unique index (a);
ERROR HY000: Got error 11 "xxx" from storage engine InnoDB
@@ -8,3 +9,4 @@ Table Op Msg_type Msg_text
test.bug56947 check status OK
drop table bug56947;
SET @@global.innodb_file_per_table=DEFAULT;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
index 2000db03efa..daf0345e8ca 100644
--- a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
+++ b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
@@ -24,7 +24,7 @@ test.corrupt_bit_test_Ä check Warning InnoDB: Index idx is marked as corrupted
test.corrupt_bit_test_Ä check Warning InnoDB: Index idxÄ is marked as corrupted
test.corrupt_bit_test_Ä check Warning InnoDB: Index idxÄ“ is marked as corrupted
test.corrupt_bit_test_Ä check error Corrupt
-SET debug_dbug = @save_dbug;
+SET @@SESSION.debug_dbug = @save_dbug;
CREATE INDEX idx3 ON corrupt_bit_test_Ä(b, c);
ERROR HY000: Index idx is corrupted
CREATE INDEX idx4 ON corrupt_bit_test_Ä(b, z);
diff --git a/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result b/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result
index 7eb9a172754..8e3d670e4fe 100644
--- a/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result
+++ b/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
SELECT @@innodb_page_size;
@@innodb_page_size
32768
diff --git a/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result b/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result
index c889e00107b..50d0971bc63 100644
--- a/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result
+++ b/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
SELECT @@innodb_page_size;
@@innodb_page_size
65536
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
index 75069db5997..015bfe9dcef 100644
--- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -97,7 +97,7 @@ buffer_LRU_batch_flush_avg_time_thread buffer 0 NULL NULL NULL 0 NULL NULL NULL
buffer_flush_adaptive_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for adaptive flushing recently.
buffer_LRU_batch_flush_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for LRU batch flushing recently.
buffer_flush_avg_time buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Avg time (ms) spent for flushing recently.
-buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Numner of adaptive flushes passed during the recent Avg period.
+buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of adaptive flushes passed during the recent Avg period.
buffer_LRU_batch_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of LRU batch flushes passed during the recent Avg period.
buffer_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of flushes passed during the recent Avg period.
buffer_LRU_get_free_loops buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Total loops in LRU get free.
diff --git a/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result b/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result
index 5f14ad9b0d7..65d0a0bde43 100644
--- a/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result
+++ b/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result
@@ -4,6 +4,7 @@ drop table if exists t1;
connection con1;
create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0);
+SET @saved_dbug = @@SESSION.debug_dbug;
set DEBUG_DBUG='+d,fatal-semaphore-timeout';
set autocommit=0;
# Sending query on con1,
@@ -21,6 +22,6 @@ connection default;
# Waitting for reconnect after mysqld restarts
# Reconnected after mysqld was successfully restarted
# Cleaning up before exit
-set DEBUG_DBUG=NULL;
+SET debug_dbug = @saved_dbug;
drop table if exists t1;
# Clean exit
diff --git a/mysql-test/suite/innodb/r/innodb_wl6326.result b/mysql-test/suite/innodb/r/innodb_wl6326.result
new file mode 100644
index 00000000000..e0574a6b7b1
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_wl6326.result
@@ -0,0 +1,371 @@
+SET GLOBAL innodb_adaptive_hash_index = false;
+SET GLOBAL innodb_stats_persistent = false;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+CREATE TABLE t1 (
+a00 CHAR(255) NOT NULL DEFAULT 'a',
+a01 CHAR(255) NOT NULL DEFAULT 'a',
+a02 CHAR(255) NOT NULL DEFAULT 'a',
+a03 CHAR(255) NOT NULL DEFAULT 'a',
+a04 CHAR(255) NOT NULL DEFAULT 'a',
+a05 CHAR(255) NOT NULL DEFAULT 'a',
+a06 CHAR(255) NOT NULL DEFAULT 'a',
+b INT NOT NULL DEFAULT 0
+) ENGINE = InnoDB;
+ALTER TABLE t1 ADD PRIMARY KEY(
+a00,
+a01,
+a02,
+a03,
+a04,
+a05,
+a06
+);
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+1
+SET GLOBAL innodb_limit_optimistic_insert_debug = 7;
+INSERT INTO t1 (a00) VALUES ('aa');
+INSERT INTO t1 (a00) VALUES ('ab');
+INSERT INTO t1 (a00) VALUES ('ac');
+INSERT INTO t1 (a00) VALUES ('ad');
+INSERT INTO t1 (a00) VALUES ('ae');
+INSERT INTO t1 (a00) VALUES ('af');
+INSERT INTO t1 (a00) VALUES ('ag');
+INSERT INTO t1 (a00) VALUES ('ah');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+3
+INSERT INTO t1 (a00) VALUES ('ai');
+INSERT INTO t1 (a00) VALUES ('aj');
+INSERT INTO t1 (a00) VALUES ('ak');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+4
+INSERT INTO t1 (a00) VALUES ('al');
+INSERT INTO t1 (a00) VALUES ('am');
+INSERT INTO t1 (a00) VALUES ('an');
+INSERT INTO t1 (a00) VALUES ('ao');
+INSERT INTO t1 (a00) VALUES ('ap');
+INSERT INTO t1 (a00) VALUES ('aq');
+INSERT INTO t1 (a00) VALUES ('ar');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+5
+INSERT INTO t1 (a00) VALUES ('as');
+INSERT INTO t1 (a00) VALUES ('at');
+INSERT INTO t1 (a00) VALUES ('au');
+INSERT INTO t1 (a00) VALUES ('av');
+INSERT INTO t1 (a00) VALUES ('aw');
+INSERT INTO t1 (a00) VALUES ('ax');
+INSERT INTO t1 (a00) VALUES ('ay');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+6
+INSERT INTO t1 (a00) VALUES ('az');
+INSERT INTO t1 (a00) VALUES ('ba');
+INSERT INTO t1 (a00) VALUES ('bb');
+INSERT INTO t1 (a00) VALUES ('bc');
+INSERT INTO t1 (a00) VALUES ('bd');
+INSERT INTO t1 (a00) VALUES ('be');
+INSERT INTO t1 (a00) VALUES ('bf');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+7
+INSERT INTO t1 (a00) VALUES ('bg');
+INSERT INTO t1 (a00) VALUES ('bh');
+INSERT INTO t1 (a00) VALUES ('bi');
+INSERT INTO t1 (a00) VALUES ('bj');
+INSERT INTO t1 (a00) VALUES ('bk');
+INSERT INTO t1 (a00) VALUES ('bl');
+INSERT INTO t1 (a00) VALUES ('bm');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+8
+INSERT INTO t1 (a00) VALUES ('bn');
+INSERT INTO t1 (a00) VALUES ('bo');
+INSERT INTO t1 (a00) VALUES ('bp');
+INSERT INTO t1 (a00) VALUES ('bq');
+INSERT INTO t1 (a00) VALUES ('br');
+INSERT INTO t1 (a00) VALUES ('bs');
+INSERT INTO t1 (a00) VALUES ('bt');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+11
+INSERT INTO t1 (a00) VALUES ('bu');
+INSERT INTO t1 (a00) VALUES ('bv');
+INSERT INTO t1 (a00) VALUES ('bw');
+INSERT INTO t1 (a00) VALUES ('bx');
+INSERT INTO t1 (a00) VALUES ('by');
+INSERT INTO t1 (a00) VALUES ('bz');
+INSERT INTO t1 (a00) VALUES ('ca');
+INSERT INTO t1 (a00) VALUES ('cb');
+INSERT INTO t1 (a00) VALUES ('cc');
+INSERT INTO t1 (a00) VALUES ('cd');
+INSERT INTO t1 (a00) VALUES ('ce');
+INSERT INTO t1 (a00) VALUES ('cf');
+INSERT INTO t1 (a00) VALUES ('cg');
+INSERT INTO t1 (a00) VALUES ('ch');
+INSERT INTO t1 (a00) VALUES ('ci');
+INSERT INTO t1 (a00) VALUES ('cj');
+INSERT INTO t1 (a00) VALUES ('ck');
+INSERT INTO t1 (a00) VALUES ('cl');
+INSERT INTO t1 (a00) VALUES ('cm');
+INSERT INTO t1 (a00) VALUES ('cn');
+INSERT INTO t1 (a00) VALUES ('co');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+15
+INSERT INTO t1 (a00) VALUES ('cp');
+INSERT INTO t1 (a00) VALUES ('cq');
+INSERT INTO t1 (a00) VALUES ('cr');
+INSERT INTO t1 (a00) VALUES ('cs');
+INSERT INTO t1 (a00) VALUES ('ct');
+INSERT INTO t1 (a00) VALUES ('cu');
+INSERT INTO t1 (a00) VALUES ('cv');
+INSERT INTO t1 (a00) VALUES ('cw');
+INSERT INTO t1 (a00) VALUES ('cx');
+INSERT INTO t1 (a00) VALUES ('cy');
+INSERT INTO t1 (a00) VALUES ('cz');
+INSERT INTO t1 (a00) VALUES ('da');
+INSERT INTO t1 (a00) VALUES ('db');
+INSERT INTO t1 (a00) VALUES ('dc');
+INSERT INTO t1 (a00) VALUES ('dd');
+INSERT INTO t1 (a00) VALUES ('de');
+INSERT INTO t1 (a00) VALUES ('df');
+INSERT INTO t1 (a00) VALUES ('dg');
+INSERT INTO t1 (a00) VALUES ('dh');
+INSERT INTO t1 (a00) VALUES ('di');
+INSERT INTO t1 (a00) VALUES ('dj');
+INSERT INTO t1 (a00) VALUES ('dk');
+INSERT INTO t1 (a00) VALUES ('dl');
+INSERT INTO t1 (a00) VALUES ('dm');
+INSERT INTO t1 (a00) VALUES ('dn');
+INSERT INTO t1 (a00) VALUES ('do');
+INSERT INTO t1 (a00) VALUES ('dp');
+INSERT INTO t1 (a00) VALUES ('dq');
+INSERT INTO t1 (a00) VALUES ('dr');
+INSERT INTO t1 (a00) VALUES ('ds');
+INSERT INTO t1 (a00) VALUES ('dt');
+INSERT INTO t1 (a00) VALUES ('du');
+INSERT INTO t1 (a00) VALUES ('dv');
+INSERT INTO t1 (a00) VALUES ('dw');
+INSERT INTO t1 (a00) VALUES ('dx');
+INSERT INTO t1 (a00) VALUES ('dy');
+INSERT INTO t1 (a00) VALUES ('dz');
+INSERT INTO t1 (a00) VALUES ('ea');
+INSERT INTO t1 (a00) VALUES ('eb');
+INSERT INTO t1 (a00) VALUES ('ec');
+INSERT INTO t1 (a00) VALUES ('ed');
+INSERT INTO t1 (a00) VALUES ('ee');
+INSERT INTO t1 (a00) VALUES ('ef');
+INSERT INTO t1 (a00) VALUES ('eg');
+INSERT INTO t1 (a00) VALUES ('eh');
+INSERT INTO t1 (a00) VALUES ('ei');
+INSERT INTO t1 (a00) VALUES ('ej');
+INSERT INTO t1 (a00) VALUES ('ek');
+INSERT INTO t1 (a00) VALUES ('el');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+23
+INSERT INTO t1 (a00) VALUES ('em');
+INSERT INTO t1 (a00) VALUES ('en');
+INSERT INTO t1 (a00) VALUES ('eo');
+INSERT INTO t1 (a00) VALUES ('ep');
+INSERT INTO t1 (a00) VALUES ('eq');
+INSERT INTO t1 (a00) VALUES ('er');
+INSERT INTO t1 (a00) VALUES ('es');
+INSERT INTO t1 (a00) VALUES ('et');
+INSERT INTO t1 (a00) VALUES ('eu');
+INSERT INTO t1 (a00) VALUES ('ev');
+INSERT INTO t1 (a00) VALUES ('ew');
+INSERT INTO t1 (a00) VALUES ('ex');
+INSERT INTO t1 (a00) VALUES ('ey');
+INSERT INTO t1 (a00) VALUES ('ez');
+INSERT INTO t1 (a00) VALUES ('fa');
+INSERT INTO t1 (a00) VALUES ('fb');
+INSERT INTO t1 (a00) VALUES ('fc');
+INSERT INTO t1 (a00) VALUES ('fd');
+INSERT INTO t1 (a00) VALUES ('fe');
+INSERT INTO t1 (a00) VALUES ('ff');
+INSERT INTO t1 (a00) VALUES ('fg');
+INSERT INTO t1 (a00) VALUES ('fh');
+INSERT INTO t1 (a00) VALUES ('fi');
+INSERT INTO t1 (a00) VALUES ('fj');
+INSERT INTO t1 (a00) VALUES ('fk');
+INSERT INTO t1 (a00) VALUES ('fl');
+INSERT INTO t1 (a00) VALUES ('fm');
+INSERT INTO t1 (a00) VALUES ('fn');
+INSERT INTO t1 (a00) VALUES ('fo');
+INSERT INTO t1 (a00) VALUES ('fp');
+INSERT INTO t1 (a00) VALUES ('fq');
+INSERT INTO t1 (a00) VALUES ('fr');
+INSERT INTO t1 (a00) VALUES ('fs');
+INSERT INTO t1 (a00) VALUES ('ft');
+INSERT INTO t1 (a00) VALUES ('fu');
+INSERT INTO t1 (a00) VALUES ('fv');
+INSERT INTO t1 (a00) VALUES ('fw');
+INSERT INTO t1 (a00) VALUES ('fx');
+INSERT INTO t1 (a00) VALUES ('fy');
+INSERT INTO t1 (a00) VALUES ('fz');
+INSERT INTO t1 (a00) VALUES ('ga');
+INSERT INTO t1 (a00) VALUES ('gb');
+INSERT INTO t1 (a00) VALUES ('gc');
+INSERT INTO t1 (a00) VALUES ('gd');
+INSERT INTO t1 (a00) VALUES ('ge');
+INSERT INTO t1 (a00) VALUES ('gf');
+INSERT INTO t1 (a00) VALUES ('gg');
+INSERT INTO t1 (a00) VALUES ('gh');
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+29
+SET GLOBAL innodb_limit_optimistic_insert_debug = 0;
+# Test start
+SET DEBUG_SYNC = 'RESET';
+INSERT INTO t1 (a00) VALUES ('bfa');
+connection con1;
+SET DEBUG_SYNC = 'before_insert_pessimitic_row_ins_clust SIGNAL reached WAIT_FOR continue';
+INSERT INTO t1 (a00) VALUES ('bfb');
+connection con2;
+SET DEBUG_SYNC = 'now WAIT_FOR reached';
+SELECT a00,a01 FROM t1 WHERE a00 = 'aa';
+a00 a01
+aa a
+SELECT a00,a01 FROM t1 WHERE a00 = 'aq';
+a00 a01
+aq a
+SELECT a00,a01 FROM t1 WHERE a00 = 'cp';
+a00 a01
+cp a
+SELECT a00,a01 FROM t1 WHERE a00 = 'el';
+a00 a01
+el a
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait1';
+SELECT a00,a01 FROM t1 WHERE a00 = 'ar';
+connection con3;
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait2';
+SELECT a00,a01 FROM t1 WHERE a00 = 'cn';
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait1 TIMEOUT 1';
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait2 TIMEOUT 1';
+SET DEBUG_SYNC = 'now SIGNAL continue';
+connection con1;
+connection con2;
+a00 a01
+ar a
+connection con3;
+a00 a01
+cn a
+connection default;
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+30
+SET DEBUG_SYNC = 'RESET';
+INSERT INTO t1 (a00) VALUES ('coa');
+connection con1;
+SET DEBUG_SYNC = 'before_insert_pessimitic_row_ins_clust SIGNAL reached WAIT_FOR continue';
+INSERT INTO t1 (a00) VALUES ('cob');
+connection con2;
+SET DEBUG_SYNC = 'now WAIT_FOR reached';
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait1';
+SELECT a00,a01 FROM t1 WHERE a00 = 'aa';
+connection con3;
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait2';
+SELECT a00,a01 FROM t1 WHERE a00 = 'el';
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait1 TIMEOUT 1';
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait2 TIMEOUT 1';
+SET DEBUG_SYNC = 'now SIGNAL continue';
+connection con1;
+connection con2;
+a00 a01
+aa a
+connection con3;
+a00 a01
+el a
+connection default;
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+31
+SET DEBUG_SYNC = 'RESET';
+INSERT INTO t1 (a00) VALUES ('gba');
+connection con1;
+SET DEBUG_SYNC = 'before_insert_pessimitic_row_ins_clust SIGNAL reached WAIT_FOR continue';
+INSERT INTO t1 (a00) VALUES ('gbb');
+connection con2;
+SET DEBUG_SYNC = 'now WAIT_FOR reached';
+SELECT a00,a01 FROM t1 WHERE a00 = 'aa';
+a00 a01
+aa a
+SELECT a00,a01 FROM t1 WHERE a00 = 'ek';
+a00 a01
+ek a
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait1';
+SELECT a00,a01 FROM t1 WHERE a00 = 'el';
+connection con3;
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait2';
+SELECT a00,a01 FROM t1 WHERE a00 = 'gb';
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait1 TIMEOUT 1';
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait2 TIMEOUT 1';
+SET DEBUG_SYNC = 'now SIGNAL continue';
+connection con1;
+connection con2;
+a00 a01
+el a
+connection con3;
+a00 a01
+gb a
+connection default;
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+CLUST_INDEX_SIZE
+32
+SET DEBUG_SYNC = 'RESET';
+connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_wl6326_big.result b/mysql-test/suite/innodb/r/innodb_wl6326_big.result
new file mode 100644
index 00000000000..3ff6d0d0b5c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_wl6326_big.result
@@ -0,0 +1,449 @@
+CREATE SCHEMA my_schema;
+USE my_schema;
+CREATE FUNCTION f_thread_id (i INT) RETURNS CHAR(4) DETERMINISTIC
+RETURN CONCAT(LPAD(CAST(i AS CHAR),3,'_'),'_') ;
+SELECT CONCAT('->', f_thread_id( 1), '<-');
+CONCAT('->', f_thread_id( 1), '<-')
+->__1_<-
+SELECT CONCAT('->', f_thread_id(12), '<-');
+CONCAT('->', f_thread_id(12), '<-')
+->_12_<-
+SET @extra_int = 1;
+SET @extra_string = f_thread_id(@extra_int);
+SELECT @extra_int , @extra_string;
+@extra_int @extra_string
+1 __1_
+CREATE FUNCTION f_col_int1 (i INT) RETURNS INT(20) DETERMINISTIC
+RETURN i * 1000 + @extra_int ;
+SELECT f_col_int1(my_col) AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+my_result
+1001
+12001
+123001
+1234001
+12345001
+CREATE FUNCTION f_col_int2 (i INT) RETURNS INT(20) DETERMINISTIC
+RETURN @extra_int * 10000000 + i ;
+SELECT f_col_int2(my_col) AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+my_result
+10000001
+10000012
+10000123
+10001234
+10012345
+CREATE FUNCTION f_col_int3 (i INT) RETURNS INT(20) DETERMINISTIC
+RETURN @extra_int ;
+SELECT f_col_int3(my_col) AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+my_result
+1
+1
+1
+1
+1
+CREATE FUNCTION f_col_blob (i INT) RETURNS BLOB DETERMINISTIC
+RETURN RPAD(@extra_string,(@@innodb_page_size / 2 ) + 1,'a');
+SELECT CONCAT('->', SUBSTR(f_col_blob(my_col) FROM 1 FOR 10),
+'<-.....->', SUBSTR(f_col_blob(my_col) FROM -10 FOR 10), '<-') AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+my_result
+->__1_aaaaaa<-.....->aaaaaaaaaa<-
+->__1_aaaaaa<-.....->aaaaaaaaaa<-
+->__1_aaaaaa<-.....->aaaaaaaaaa<-
+->__1_aaaaaa<-.....->aaaaaaaaaa<-
+->__1_aaaaaa<-.....->aaaaaaaaaa<-
+CREATE FUNCTION f_col_char0 (i INT) RETURNS CHAR(255) DETERMINISTIC
+RETURN LPAD(CAST(i AS CHAR),255,' ');
+SELECT CONCAT('->', f_col_char0(my_col), '<-') AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+my_result
+-> 1<-
+-> 12<-
+-> 123<-
+-> 1234<-
+-> 12345<-
+CREATE FUNCTION f_col_char1 (i INT) RETURNS CHAR(26) DETERMINISTIC
+RETURN
+CONCAT('B',
+LPAD(SUBSTR(CAST(i AS CHAR),1,(LENGTH(CAST(i AS CHAR)) DIV 2)),10,' '),
+@extra_string,
+RPAD(SUBSTR(CAST(i AS CHAR), -((LENGTH(CAST(i AS CHAR)) + 1) DIV 2)),10,' '),
+'E') ;
+SELECT CONCAT('->', f_col_char1(my_col), '<-') AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+my_result
+->B __1_1 E<-
+->B 1__1_2 E<-
+->B 1__1_23 E<-
+->B 12__1_34 E<-
+->B 12__1_345 E<-
+CREATE FUNCTION f_col_char2 (i INT) RETURNS CHAR(26) DETERMINISTIC
+RETURN
+CONCAT('B',
+RPAD(SUBSTR(CAST(i AS CHAR),1,(LENGTH(CAST(i AS CHAR)) DIV 2)),10,' '),
+@extra_string,
+LPAD(SUBSTR(CAST(i AS CHAR), -((LENGTH(CAST(i AS CHAR)) + 1) DIV 2)),10,' '),
+'E');
+SELECT CONCAT('->', f_col_char2(my_col), '<-') AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+my_result
+->B __1_ 1E<-
+->B1 __1_ 2E<-
+->B1 __1_ 23E<-
+->B12 __1_ 34E<-
+->B12 __1_ 345E<-
+CREATE FUNCTION f_col_char3 (i INT) RETURNS CHAR(26) DETERMINISTIC
+RETURN
+CONCAT('B',@extra_string,LPAD(CAST(i AS CHAR),20,' '),'E');
+SELECT CONCAT('->', f_col_char3(my_col), '<-') AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+my_result
+->B__1_ 1E<-
+->B__1_ 12E<-
+->B__1_ 123E<-
+->B__1_ 1234E<-
+->B__1_ 12345E<-
+CREATE FUNCTION f_col_char4 (i INT) RETURNS CHAR(26) DETERMINISTIC
+RETURN
+CONCAT('B',RPAD(CAST(i AS CHAR),20,' '),@extra_string,'E');
+SELECT CONCAT('->', f_col_char4(my_col), '<-') AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+my_result
+->B1 __1_E<-
+->B12 __1_E<-
+->B123 __1_E<-
+->B1234 __1_E<-
+->B12345 __1_E<-
+CREATE TABLE my_metrics LIKE information_schema.innodb_metrics;
+ALTER TABLE my_metrics ADD COLUMN phase ENUM('after', 'before'),
+DROP COLUMN SUBSYSTEM, DROP COLUMN TYPE, DROP COLUMN COMMENT,
+ADD PRIMARY KEY (NAME,phase);
+CREATE TABLE t1 (
+col_int0 BIGINT,
+col_int1 BIGINT,
+col_int2 BIGINT,
+col_int3 BIGINT,
+col_blob BLOB,
+col_char0 VARCHAR(255),
+col_char1 VARCHAR(30),
+col_char2 VARCHAR(30),
+col_char3 VARCHAR(30),
+col_char4 VARCHAR(30)
+) ENGINE = InnoDB;
+ALTER TABLE t1 ADD UNIQUE KEY uidx_col_int0 (col_int0),
+ADD UNIQUE KEY uidx1 (col_int1, col_char0),
+ADD UNIQUE KEY uidx2 (col_int2, col_char0, col_int1),
+ADD UNIQUE KEY uidx3 (col_int3, col_int2, col_char0),
+ADD UNIQUE KEY uidx4 (col_char1, col_char0),
+ADD UNIQUE KEY uidx5 (col_char2, col_char0, col_char1),
+ADD UNIQUE KEY uidx6 (col_char3, col_char2, col_char0),
+ADD UNIQUE KEY uidx7 (col_int1, col_int2, col_int3, col_char4,
+col_char1, col_char2, col_char3, col_char0),
+ADD KEY idx8 (col_blob(10), col_char4);
+CREATE PROCEDURE proc_fill_t1 (max_row_count INT, load_unit INT)
+BEGIN
+DECLARE my_count INTEGER DEFAULT 0;
+DECLARE max_load_count INTEGER DEFAULT 0;
+DROP TABLE IF EXISTS t0;
+CREATE TEMPORARY TABLE t0 (col_int0 BIGINT, PRIMARY KEY(col_int0));
+WHILE (my_count < load_unit ) DO
+SET my_count = my_count + 1;
+INSERT INTO t0 SET col_int0 = my_count;
+END WHILE;
+SET max_load_count = (SELECT (max_row_count DIV load_unit) + 1 );
+SELECT COUNT(col_int0) INTO @val FROM t1;
+SET my_count = 0;
+REPEAT
+INSERT INTO t1 (col_int0, col_int1, col_int2, col_int3, col_blob,
+col_char0, col_char1, col_char2,col_char3,col_char4)
+SELECT col_int0 + @val,
+f_col_int1(col_int0 + @val),
+f_col_int2(col_int0 + @val),
+f_col_int3(col_int0 + @val),
+f_col_blob(col_int0 + @val),
+f_col_char0(col_int0 + @val),
+f_col_char1(col_int0 + @val),
+f_col_char2(col_int0 + @val),
+f_col_char3(col_int0 + @val),
+f_col_char4(col_int0 + @val)
+FROM t0;
+COMMIT;
+SELECT MAX(col_int0) INTO @val FROM t1;
+SET my_count = my_count + 1;
+UNTIL( my_count > max_load_count OR @val >= max_row_count )
+END REPEAT;
+DROP TEMPORARY TABLE t0;
+END|
+CREATE PROCEDURE proc_dml (max_duration INT, t1_stripe_half INT)
+BEGIN
+DECLARE aux INTEGER DEFAULT 0;
+DECLARE start_time INT;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND BEGIN END;
+SET @extra_int = CONNECTION_ID();
+SET @extra_string = f_thread_id(@extra_int);
+SELECT ROUND(MAX(col_int0) / 2 ) INTO @t1_half FROM t1;
+# The user lock 'Blocker' should be already set by some other session S1.
+# S1 starts the race by releasing that lock.
+# Wait till the lock is released and the lock can be obtained.
+# In order to prevent endless waiting in case of non foreseen problems
+# limit the timespan to 30 seconds.
+SELECT GET_LOCK('Blocker', 30) INTO @aux;
+# Release the lock immediate so that the other "runner" sessions start too.
+SELECT RELEASE_LOCK('Blocker') INTO @aux;
+SET start_time = UNIX_TIMESTAMP();
+WHILE (UNIX_TIMESTAMP() - start_time < max_duration) DO
+SET @aux = @t1_half - t1_stripe_half + ROUND(RAND() * t1_stripe_half * 2);
+UPDATE t1 SET
+col_int1 = f_col_int1(col_int0),
+col_int2 = f_col_int2(col_int0),
+col_int3 = f_col_int3(col_int0),
+col_blob = f_col_blob(col_int0),
+col_char0 = f_col_char0(col_int0),
+col_char1 = f_col_char1(col_int0),
+col_char2 = f_col_char2(col_int0),
+col_char3 = f_col_char3(col_int0),
+col_char4 = f_col_char4(col_int0)
+WHERE col_int0 = @aux;
+COMMIT;
+END WHILE;
+END|
+SET GLOBAL innodb_monitor_disable = "innodb_rwlock_sx_%";
+SET @pre_reset_ts = NOW();
+SET GLOBAL innodb_monitor_reset = "innodb_rwlock_sx_%";
+SET @pre_enable_ts = NOW();
+SET GLOBAL innodb_monitor_enable = "innodb_rwlock_sx_%";
+SET @pre_collect_ts = NOW();
+DELETE FROM my_metrics;
+INSERT INTO my_metrics
+SELECT NAME, COUNT, MAX_COUNT, MIN_COUNT, AVG_COUNT,
+COUNT_RESET, MAX_COUNT_RESET, MIN_COUNT_RESET, AVG_COUNT_RESET,
+TIME_ENABLED, TIME_DISABLED, TIME_ELAPSED, TIME_RESET,
+STATUS, 'before'
+FROM information_schema.innodb_metrics
+WHERE NAME LIKE 'innodb_rwlock_sx_%';
+# TC-01 There are exact three entries "innodb_rwlock_sx_%" with the
+# with the name which follow in innodb_metrics.
+# pass
+SELECT COUNT(*) INTO @sx_count FROM my_metrics;
+# TC-02 Counting is now enabled. ALL = @sx_count entries show that.
+# pass
+# TC-03 @pre_reset_ts < TIME_RESET. ALL = @sx_count entries show that.
+# pass
+# TC-04 @pre_enable_ts < TIME_ENABLED. ALL = @sx_count entries show that.
+# pass
+# TC-05 TIME_RESET < TIME_ENABLED AND TIME_ENABLED < @pre_collect_ts
+# AND TIME_ELAPSED > 0. ALL = @sx_count entries show that.
+# pass
+# TC-06 COUNT_RESET = MAX_COUNT_RESET. ALL = @sx_count entries show that.
+# pass
+SET GLOBAL innodb_monitor_reset = "innodb_rwlock_sx_%";
+SHOW ENGINE INNODB STATUS;
+DELETE FROM my_metrics;
+INSERT INTO my_metrics
+SELECT NAME, COUNT, MAX_COUNT, MIN_COUNT, AVG_COUNT,
+COUNT_RESET, MAX_COUNT_RESET, MIN_COUNT_RESET, AVG_COUNT_RESET,
+TIME_ENABLED, TIME_DISABLED, TIME_ELAPSED, TIME_RESET,
+STATUS, 'before'
+FROM information_schema.innodb_metrics
+WHERE NAME LIKE 'innodb_rwlock_sx_%';
+SET @extra_string = '__0_';
+SET @extra_int = 0;
+# TC-07 One session inserts some significant amount of rows into t1.
+# The system MUST survive that.
+SET @max_row_count = <max_row_count>;
+SET @load_unit = <load_unit>;
+SET @start_time = UNIX_TIMESTAMP();
+SET AUTOCOMMIT = OFF;
+CALL proc_fill_t1 (@max_row_count, @load_unit);
+# pass
+SET AUTOCOMMIT = ON;
+SELECT col_int0 INTO @t1_half FROM t1
+WHERE col_int0 >= (@val DIV 2) ORDER BY col_int0 LIMIT 1;
+SHOW ENGINE INNODB STATUS;
+SELECT col_int0, col_int1, col_int2, col_int3,
+CONCAT('->', SUBSTR(col_blob FROM 1 FOR 10),
+'<-.....->', SUBSTR(col_blob FROM -10 FOR 10), '<-') AS col_blobx,
+CONCAT('->',col_char0,'<-') AS col_char0x,
+CONCAT('->',col_char1,'<-') AS col_char1x,
+CONCAT('->',col_char2,'<-') AS col_char2x,
+CONCAT('->',col_char3,'<-') AS col_char3x,
+CONCAT('->',col_char4,'<-') AS col_char4x
+FROM t1 WHERE col_int0 between 98 AND 102;
+col_int0 98
+col_int1 98000
+col_int2 98
+col_int3 0
+col_blobx ->__0_aaaaaa<-.....->aaaaaaaaaa<-
+col_char0x -> 98<-
+col_char1x ->B 9__0_8 E<-
+col_char2x ->B9 __0_ 8E<-
+col_char3x ->B__0_ 98E<-
+col_char4x ->B98 __0_E<-
+col_int0 99
+col_int1 99000
+col_int2 99
+col_int3 0
+col_blobx ->__0_aaaaaa<-.....->aaaaaaaaaa<-
+col_char0x -> 99<-
+col_char1x ->B 9__0_9 E<-
+col_char2x ->B9 __0_ 9E<-
+col_char3x ->B__0_ 99E<-
+col_char4x ->B99 __0_E<-
+col_int0 100
+col_int1 100000
+col_int2 100
+col_int3 0
+col_blobx ->__0_aaaaaa<-.....->aaaaaaaaaa<-
+col_char0x -> 100<-
+col_char1x ->B 1__0_00 E<-
+col_char2x ->B1 __0_ 00E<-
+col_char3x ->B__0_ 100E<-
+col_char4x ->B100 __0_E<-
+col_int0 101
+col_int1 101000
+col_int2 101
+col_int3 0
+col_blobx ->__0_aaaaaa<-.....->aaaaaaaaaa<-
+col_char0x -> 101<-
+col_char1x ->B 1__0_01 E<-
+col_char2x ->B1 __0_ 01E<-
+col_char3x ->B__0_ 101E<-
+col_char4x ->B101 __0_E<-
+col_int0 102
+col_int1 102000
+col_int2 102
+col_int3 0
+col_blobx ->__0_aaaaaa<-.....->aaaaaaaaaa<-
+col_char0x -> 102<-
+col_char1x ->B 1__0_02 E<-
+col_char2x ->B1 __0_ 02E<-
+col_char3x ->B__0_ 102E<-
+col_char4x ->B102 __0_E<-
+# TC-11 Several concurrent sessions perform updates in t1 like mad.
+# The system MUST survive this.
+# Printing of statements is partially suppressed.
+SET @start_time = UNIX_TIMESTAMP();
+SELECT 1 FROM t1 WHERE col_int0 = @t1_half FOR UPDATE;
+1
+1
+SELECT GET_LOCK('Blocker', 1000) ;
+GET_LOCK('Blocker', 1000)
+1
+RELEASE_LOCK('Blocker')
+1
+# pass
+SHOW ENGINE INNODB STATUS;
+# TC-13 One session performs ALTER TABLE t1 ADD KEY ... on the fat table t1.
+# The system MUST survive this.
+SET @start_time = UNIX_TIMESTAMP();
+ALTER TABLE t1 ADD KEY idx_col_char4_col_char0 (col_char4,col_char0);
+SHOW ENGINE INNODB STATUS;
+# pass
+# TC-15 One session performs a fat update on the fat table t1.
+# The system MUST survive this.
+SET @start_time = UNIX_TIMESTAMP();
+SET @extra_int = 13;
+SET @extra_string = f_thread_id(@extra_int);
+UPDATE t1 SET
+col_int1 = f_col_int1(col_int0), col_int2 = f_col_int2(col_int0),
+col_int3 = f_col_int3(col_int0), col_blob = f_col_blob(col_int0),
+col_char0 = f_col_char0(col_int0), col_char1 = f_col_char1(col_int0),
+col_char2 = f_col_char2(col_int0), col_char3 = f_col_char3(col_int0),
+col_char4 = f_col_char4(col_int0)
+WHERE col_int0 BETWEEN @t1_half - 2500 AND @t1_half + 2500;
+COMMIT;
+SHOW ENGINE INNODB STATUS;
+# pass
+INSERT INTO my_metrics
+SELECT NAME, COUNT, MAX_COUNT, MIN_COUNT, AVG_COUNT,
+COUNT_RESET, MAX_COUNT_RESET, MIN_COUNT_RESET, AVG_COUNT_RESET,
+TIME_ENABLED, TIME_DISABLED, TIME_ELAPSED, TIME_RESET,
+STATUS, 'after'
+FROM information_schema.innodb_metrics
+WHERE NAME LIKE 'innodb_rwlock_sx_%';
+# TC-16 The following activities happend after reset in innodb_metrics
+# - Insert some significant amount of rows into t1.
+# - Several concurrent users perform excessive updates in t1.
+# - ALTER TABLE ... ADD KEY <sufficient big enough structure>
+# - One UPDATE statement modifying a huge slice of t1.
+# Any of them causes heavy use of SX lock and therefore COUNT_RESET
+# must have grown for ALL = @sx_count entries.
+# pass
+# TC-09 Heavy activity after reset.
+# COUNT_RESET = MAX_COUNT_RESET for ALL = @sx_count entries
+# needs to stay valid though he counters will have grown.
+# pass
+DELETE FROM my_metrics;
+INSERT INTO my_metrics
+SELECT NAME, COUNT, MAX_COUNT, MIN_COUNT, AVG_COUNT,
+COUNT_RESET, MAX_COUNT_RESET, MIN_COUNT_RESET, AVG_COUNT_RESET,
+TIME_ENABLED, TIME_DISABLED, TIME_ELAPSED, TIME_RESET,
+STATUS, 'before'
+FROM information_schema.innodb_metrics
+WHERE NAME LIKE 'innodb_rwlock_sx_%';
+SET GLOBAL innodb_monitor_reset = "innodb_rwlock_sx_%";
+INSERT INTO my_metrics
+SELECT NAME, COUNT, MAX_COUNT, MIN_COUNT, AVG_COUNT,
+COUNT_RESET, MAX_COUNT_RESET, MIN_COUNT_RESET, AVG_COUNT_RESET,
+TIME_ENABLED, TIME_DISABLED, TIME_ELAPSED, TIME_RESET,
+STATUS, 'after'
+FROM information_schema.innodb_metrics
+WHERE NAME LIKE 'innodb_rwlock_sx_%';
+# TC-08 There was a reset. COUNT_RESET = MAX_COUNT_RESET for ALL
+# = @sx_count entries.
+# pass
+# TC-17 We had heavy activity causing big counters and after that a reset.
+# Reset causes COUNT > COUNT_RESET AND MAX_COUNT > MAX_COUNT_RESET
+# for ALL @sx_count entries.
+# pass
+# TC-18 We had some reset but this must not decrease COUNT or MAX_COUNT
+# after.COUNT >= before.COUNT AND
+# after.MAX_COUNT >= before.MAX_COUNT for ALL @sx_count entries.
+# pass
+# TC-19 We had some reset after heavy activity and this must cause
+# after.COUNT_RESET < before.COUNT_RESET
+# AND after.MAX_COUNT_RESET < before.MAX_COUNT_RESET AND
+# for ALL @sx_count entries.
+# pass
+connection con10;
+disconnect con10;
+connection con9;
+disconnect con9;
+connection con8;
+disconnect con8;
+connection con7;
+disconnect con7;
+connection con6;
+disconnect con6;
+connection con5;
+disconnect con5;
+connection con4;
+disconnect con4;
+connection con3;
+disconnect con3;
+connection con2;
+disconnect con2;
+connection con1;
+disconnect con1;
+connection default;
+USE test;
+DROP SCHEMA my_schema;
+SET GLOBAL innodb_monitor_disable = all;
+SET GLOBAL innodb_monitor_reset_all = all;
+SET GLOBAL innodb_monitor_enable = default;
+SET GLOBAL innodb_monitor_disable = default;
+SET GLOBAL innodb_monitor_reset = default;
+SET GLOBAL innodb_monitor_reset_all = default;
+SET GLOBAL innodb_monitor_disable = "innodb_rwlock_sx_%";
+SET GLOBAL innodb_monitor_reset = "innodb_rwlock_sx_%";
diff --git a/mysql-test/suite/innodb/r/instant_alter,4k.rdiff b/mysql-test/suite/innodb/r/instant_alter,4k.rdiff
index c362174e5ba..cb65d12b09f 100644
--- a/mysql-test/suite/innodb/r/instant_alter,4k.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter,4k.rdiff
@@ -119,7 +119,16 @@
connection default;
InnoDB 0 transactions not purged
DROP TABLE t1,t2,t3,t4,big;
-@@ -698,7 +712,7 @@
+@@ -515,6 +529,8 @@
+ CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+ ALTER TABLE t1 ADD d TEXT;
+ ALTER TABLE t1 ADD PRIMARY KEY (a,b);
++Warnings:
++Warning 139 Row size too large (> 1979). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+ DROP TABLE t1;
+ CREATE TABLE t1
+@@ -703,7 +719,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t2';
clust_index_size
@@ -128,7 +137,7 @@
connection default;
ROLLBACK;
connection analyze;
-@@ -708,7 +722,7 @@
+@@ -713,7 +729,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t2';
clust_index_size
@@ -137,7 +146,7 @@
connection default;
BEGIN;
UPDATE t2 SET d1 = repeat(id, 200);
-@@ -719,7 +733,7 @@
+@@ -724,7 +740,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t2';
clust_index_size
@@ -146,7 +155,7 @@
connection default;
ROLLBACK;
connection analyze;
-@@ -729,7 +743,7 @@
+@@ -734,7 +750,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t2';
clust_index_size
@@ -155,7 +164,7 @@
connection default;
ALTER TABLE t2 DROP p;
affected rows: 0
-@@ -778,7 +792,9 @@
+@@ -783,7 +799,9 @@
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL;
affected rows: 0
@@ -166,7 +175,7 @@
INSERT INTO t3 SET id=4;
ERROR HY000: Field 'c2' doesn't have a default value
INSERT INTO t3 SET id=4, c2=0, b=0xf09f98b1;
-@@ -791,7 +807,9 @@
+@@ -796,7 +814,9 @@
ALTER TABLE t3 CHANGE t phrase TEXT DEFAULT 0xc3a4c3a448,
CHANGE b b BLOB NOT NULL DEFAULT 'binary line of business';
affected rows: 4
@@ -177,7 +186,7 @@
INSERT INTO t3 SET id=5, c2=9;
Warnings:
Note 1265 Data truncated for column 'c7' at row 1
-@@ -805,7 +823,9 @@
+@@ -810,7 +830,9 @@
5 9 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 ääH binary line of business
ALTER TABLE t3 DROP c3, DROP c7;
affected rows: 0
@@ -188,7 +197,7 @@
SELECT * FROM t3;
id c2 c4 c5 c6 c8 phrase b
1 1 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog
-@@ -833,6 +853,8 @@
+@@ -838,6 +860,8 @@
(id INT PRIMARY KEY, c1 VARCHAR(4000), c2 VARCHAR(4000), c3 VARCHAR(1000),
p POINT NOT NULL DEFAULT ST_GeomFromText('POINT(0 0)'), SPATIAL INDEX(p))
ENGINE=InnoDB ROW_FORMAT=COMPACT;
@@ -197,7 +206,7 @@
BEGIN;
INSERT INTO big
SET id=1, c1=REPEAT('a', 200), c2=REPEAT('b', 200), c3=REPEAT('c', 159);
-@@ -850,13 +872,15 @@
+@@ -855,13 +879,15 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
@@ -215,7 +224,7 @@
CHECKSUM TABLE big;
Table Checksum
test.big 1705165209
-@@ -873,7 +897,7 @@
+@@ -878,7 +904,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
@@ -224,7 +233,7 @@
connection default;
ROLLBACK;
CHECKSUM TABLE big;
-@@ -886,7 +910,7 @@
+@@ -891,7 +917,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
@@ -233,7 +242,16 @@
connection default;
InnoDB 0 transactions not purged
DROP TABLE t1,t2,t3,t4,big;
-@@ -1155,7 +1179,7 @@
+@@ -977,6 +1003,8 @@
+ CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+ ALTER TABLE t1 ADD d TEXT;
+ ALTER TABLE t1 ADD PRIMARY KEY (a,b);
++Warnings:
++Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+ DROP TABLE t1;
+ CREATE TABLE t1
+@@ -1165,7 +1193,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t2';
clust_index_size
@@ -242,7 +260,7 @@
connection default;
ROLLBACK;
connection analyze;
-@@ -1165,7 +1189,7 @@
+@@ -1175,7 +1203,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t2';
clust_index_size
@@ -251,7 +269,7 @@
connection default;
BEGIN;
UPDATE t2 SET d1 = repeat(id, 200);
-@@ -1176,7 +1200,7 @@
+@@ -1186,7 +1214,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t2';
clust_index_size
@@ -260,7 +278,7 @@
connection default;
ROLLBACK;
connection analyze;
-@@ -1186,7 +1210,7 @@
+@@ -1196,7 +1224,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t2';
clust_index_size
@@ -269,7 +287,7 @@
connection default;
ALTER TABLE t2 DROP p;
affected rows: 0
-@@ -1307,7 +1331,7 @@
+@@ -1317,7 +1345,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
@@ -278,7 +296,7 @@
connection default;
ALTER TABLE big ADD COLUMN
(d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
-@@ -1330,7 +1354,7 @@
+@@ -1340,7 +1368,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
@@ -287,7 +305,7 @@
connection default;
ROLLBACK;
CHECKSUM TABLE big;
-@@ -1343,7 +1367,7 @@
+@@ -1353,7 +1381,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
@@ -296,10 +314,10 @@
connection default;
InnoDB 0 transactions not purged
DROP TABLE t1,t2,t3,t4,big;
-@@ -1431,5 +1455,5 @@
+@@ -1446,5 +1474,5 @@
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
--54
-+55
+-57
++58
SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency;
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result
index 72f6eee72b8..aadb7021887 100644
--- a/mysql-test/suite/innodb/r/instant_alter.result
+++ b/mysql-test/suite/innodb/r/instant_alter.result
@@ -512,6 +512,13 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+SET innodb_strict_mode = ON;
+CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+ALTER TABLE t1 ADD d TEXT;
+ALTER TABLE t1 ADD PRIMARY KEY (b,a);
+ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+DROP TABLE t1;
+SET innodb_strict_mode = OFF;
CREATE TABLE t1
(id INT PRIMARY KEY, c2 INT UNIQUE,
c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
@@ -969,6 +976,13 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+SET innodb_strict_mode = ON;
+CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+ALTER TABLE t1 ADD d TEXT;
+ALTER TABLE t1 ADD PRIMARY KEY (b,a);
+ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+DROP TABLE t1;
+SET innodb_strict_mode = OFF;
CREATE TABLE t1
(id INT PRIMARY KEY, c2 INT UNIQUE,
c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
@@ -1426,10 +1440,17 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+SET innodb_strict_mode = ON;
+CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ALTER TABLE t1 ADD d TEXT;
+ALTER TABLE t1 ADD PRIMARY KEY (b,a);
+ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+DROP TABLE t1;
+SET innodb_strict_mode = OFF;
disconnect analyze;
SELECT variable_value-@old_instant instants
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
-54
+57
SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency;
diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result
index 9e6c537cf7e..d07067fa19f 100644
--- a/mysql-test/suite/innodb/r/instant_alter_bugs.result
+++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result
@@ -169,3 +169,4 @@ DROP FOREIGN KEY fk1,
CHANGE b d INT UNSIGNED,
ADD c INT;
DROP TABLE t2, t1;
+# End of 10.3 tests
diff --git a/mysql-test/suite/innodb/r/redo_log_during_checkpoint.result b/mysql-test/suite/innodb/r/redo_log_during_checkpoint.result
index efe48682a6f..3915b07f12e 100644
--- a/mysql-test/suite/innodb/r/redo_log_during_checkpoint.result
+++ b/mysql-test/suite/innodb/r/redo_log_during_checkpoint.result
@@ -4,8 +4,8 @@ SET GLOBAL innodb_master_thread_disabled_debug = 1;
SET GLOBAL innodb_log_checkpoint_now = 1;
CREATE DATABASE very_long_database_name;
USE very_long_database_name;
-set debug_dbug = '+d,increase_mtr_checkpoint_size';
-set debug_dbug = '+d,crash_after_checkpoint';
+SET debug_dbug = '+d,increase_mtr_checkpoint_size';
+SET debug_dbug = '+d,crash_after_checkpoint';
set global innodb_log_checkpoint_now = 1;
ERROR HY000: Lost connection to MySQL server during query
# Skip MLOG_FILE_NAME redo records during recovery
@@ -18,7 +18,7 @@ SET GLOBAL innodb_log_checkpoint_now = 1;
# exceeds LOG_CHECKPOINT_FREE_PER_THREAD size during checkpoint.
CREATE DATABASE very_long_database_name;
USE very_long_database_name;
-set debug_dbug = '+d,crash_after_checkpoint';
+SET debug_dbug = '+d,crash_after_checkpoint';
set global innodb_log_checkpoint_now = 1;
ERROR HY000: Lost connection to MySQL server during query
# Skip MLOG_FILE_NAME redo records during recovery
diff --git a/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result b/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result
new file mode 100644
index 00000000000..fba209dd2b5
--- /dev/null
+++ b/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result
@@ -0,0 +1,45 @@
+call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
+SET innodb_strict_mode = 0;
+SET @@global.log_warnings = 3;
+CREATE TABLE t1 (
+col_1 TEXT
+,col_2 TEXT
+,col_3 TEXT
+,col_4 TEXT
+,col_5 TEXT
+,col_6 TEXT
+,col_7 TEXT
+,col_8 TEXT
+,col_9 TEXT
+,col_10 TEXT
+,col_11 TEXT
+) ENGINE=INNODB ROW_FORMAT=COMPACT;
+Warnings:
+Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+TRUNCATE TABLE t1;
+Warnings:
+Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+Warnings:
+Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ALTER TABLE t1 FORCE;
+Warnings:
+Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+SET innodb_strict_mode = ON;
+TRUNCATE TABLE t1;
+Warnings:
+Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+Warnings:
+Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ALTER TABLE t1 FORCE;
+Warnings:
+Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+DROP TABLE t1;
+SET @@global.log_warnings = 2;
diff --git a/mysql-test/suite/innodb/r/undo_log.result b/mysql-test/suite/innodb/r/undo_log.result
index 7892e26d896..cda3b190ede 100644
--- a/mysql-test/suite/innodb/r/undo_log.result
+++ b/mysql-test/suite/innodb/r/undo_log.result
@@ -1,4 +1,3 @@
-call mtr.add_suppression("Cannot add field `b_str_20` in table `test`.`test_tab` because after adding it, the row size is");
SET innodb_strict_mode=OFF;
CREATE TABLE test_tab (
a_str_18 mediumtext,
diff --git a/mysql-test/suite/innodb/t/blob-update-debug.test b/mysql-test/suite/innodb/t/blob-update-debug.test
index 948cd749148..8d35dbfc70e 100644
--- a/mysql-test/suite/innodb/t/blob-update-debug.test
+++ b/mysql-test/suite/innodb/t/blob-update-debug.test
@@ -11,7 +11,9 @@
create table t1 (f1 int primary key, f2 blob) engine = innodb;
insert into t1 values (1, repeat('*', 50000));
select f1, substring(f2, 1, 40) from t1;
-set debug_dbug = 'd,row_ins_index_entry_timeout';
+set @saved_debug = @@session.debug_dbug;
+SET debug_dbug = 'd,row_ins_index_entry_timeout';
update t1 set f1 = 3;
select f1, substring(f2, 1, 40) from t1;
drop table t1;
+SET debug_dbug= @saved_debug;
diff --git a/mysql-test/suite/innodb/t/innodb-32k-crash.test b/mysql-test/suite/innodb/t/innodb-32k-crash.test
index da6d91f351e..178b32d54c9 100644
--- a/mysql-test/suite/innodb/t/innodb-32k-crash.test
+++ b/mysql-test/suite/innodb/t/innodb-32k-crash.test
@@ -5,8 +5,6 @@
let $MYSQLD_DATADIR= `select @@datadir`;
-call mtr.add_suppression("Cannot add field `u` in table `test`.`t2` because after adding it, the row size is");
-
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob,
diff --git a/mysql-test/suite/innodb/t/innodb-64k-crash.test b/mysql-test/suite/innodb/t/innodb-64k-crash.test
index cbec1a452c7..93f6f79edf3 100644
--- a/mysql-test/suite/innodb/t/innodb-64k-crash.test
+++ b/mysql-test/suite/innodb/t/innodb-64k-crash.test
@@ -5,8 +5,6 @@
let $MYSQLD_DATADIR= `select @@datadir`;
-call mtr.add_suppression("Cannot add field `pa` in table `test`.`t2` because after adding it, the row size is");
-
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob,
diff --git a/mysql-test/suite/innodb/t/innodb-blob.test b/mysql-test/suite/innodb/t/innodb-blob.test
index fbf0641880b..301966fb41d 100644
--- a/mysql-test/suite/innodb/t/innodb-blob.test
+++ b/mysql-test/suite/innodb/t/innodb-blob.test
@@ -206,3 +206,10 @@ SELECT a FROM t3;
SELECT * FROM t2;
DROP TABLE t1,t2,t3;
+
+CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT)ENGINE=InnoDB
+ ROW_FORMAT=REDUNDANT;
+SET @fill_amount = (@@innodb_page_size / 2 ) + 1 ;
+INSERT INTO t1 VALUES(1, REPEAT(2, @fill_amount));
+UPDATE t1 SET f1 = 2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7513.test b/mysql-test/suite/innodb/t/innodb-mdev-7513.test
index c0e16b9e9d2..b824cbcfa60 100644
--- a/mysql-test/suite/innodb/t/innodb-mdev-7513.test
+++ b/mysql-test/suite/innodb/t/innodb-mdev-7513.test
@@ -3,7 +3,6 @@
# MDEV-7513: ib_warn_row_too_big dereferences null thd
-call mtr.add_suppression("InnoDB: Cannot add field .* in table");
--disable_warnings
CREATE TABLE t1 ( text1 TEXT,
diff --git a/mysql-test/suite/innodb/t/innodb-replace-debug.test b/mysql-test/suite/innodb/t/innodb-replace-debug.test
index 7e710ae154c..823712a01f1 100644
--- a/mysql-test/suite/innodb/t/innodb-replace-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-replace-debug.test
@@ -9,8 +9,8 @@ create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34);
set @old_dbug= @@session.debug_dbug;
-set debug_dbug = '+d,row_ins_sec_index_entry_timeout';
+SET debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34);
select * from t1;
drop table t1;
-set debug_dbug = @old_dbug;
+SET debug_dbug = @old_dbug;
diff --git a/mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test b/mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test
index e480f0caf07..d5d04190b8a 100644
--- a/mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test
+++ b/mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test
@@ -6,6 +6,7 @@
call mtr.add_suppression("InnoDB: Warning: Index.*");
# This caused crash earlier
+SET @saved_dbug = @@SESSION.debug_dbug;
set DEBUG_DBUG='+d,ib_ha_innodb_stat_not_initialized';
create table t1(a int not null primary key, b int, c int, key(b), key(c)) engine=innodb;
@@ -32,8 +33,8 @@ select count(1) from t1 where a between 5 and 100;
select count(1) from t1 where b between 5 and 256;
select count(1) from t1 where c between 7 and 787;
-set DEBUG_DBUG=NULL;
+
drop procedure innodb_insert_proc;
drop table t1;
-
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/innodb/t/innodb_bug11754376.test b/mysql-test/suite/innodb/t/innodb_bug11754376.test
index a7f35c1a960..64547d409b3 100644
--- a/mysql-test/suite/innodb/t/innodb_bug11754376.test
+++ b/mysql-test/suite/innodb/t/innodb_bug11754376.test
@@ -8,7 +8,8 @@
CREATE TABLE bug11754376 (c INT) ENGINE=INNODB;
# This will invoke test_normalize_table_name_low() in debug builds
-
+SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION DEBUG_DBUG='+d,test_normalize_table_name_low';
DROP TABLE bug11754376;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/innodb/t/innodb_bug30113362.opt b/mysql-test/suite/innodb/t/innodb_bug30113362.opt
new file mode 100644
index 00000000000..99bf0e5a28b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug30113362.opt
@@ -0,0 +1 @@
+--innodb-sys-tablestats
diff --git a/mysql-test/suite/innodb/t/innodb_bug30113362.test b/mysql-test/suite/innodb/t/innodb_bug30113362.test
new file mode 100644
index 00000000000..de5d07ffb29
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug30113362.test
@@ -0,0 +1,242 @@
+#
+# Test for Bug#30113362 : BTR_CUR_WILL_MODIFY_TREE() IS INSUFFICIENT FOR HIGHER TREE LEVEL
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_innodb_16k.inc
+
+--disable_query_log
+SET @old_innodb_limit_optimistic_insert_debug = @@innodb_limit_optimistic_insert_debug;
+SET @old_innodb_adaptive_hash_index = @@innodb_adaptive_hash_index;
+SET @old_innodb_stats_persistent = @@innodb_stats_persistent;
+--enable_query_log
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+SET GLOBAL innodb_adaptive_hash_index = false;
+SET GLOBAL innodb_stats_persistent = false;
+
+connect (purge_control,localhost,root,,);
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+
+--connect (con2,localhost,root,,)
+
+CREATE TABLE t1 (
+ a00 CHAR(255) NOT NULL DEFAULT 'a',
+ a01 CHAR(255) NOT NULL DEFAULT 'a',
+ a02 CHAR(255) NOT NULL DEFAULT 'a',
+ b INT NOT NULL DEFAULT 0,
+ PRIMARY KEY(a00, a01, a02)
+) charset latin1 ENGINE = InnoDB COMMENT='MERGE_THRESHOLD=45';
+
+#
+# Prepare primary key index tree to be used for this test.
+#
+
+SET GLOBAL innodb_limit_optimistic_insert_debug = 3;
+
+delimiter |;
+CREATE PROCEDURE data_load_t1()
+BEGIN
+ DECLARE c1 INT DEFAULT 97;
+ DECLARE c2 INT DEFAULT 97;
+ DECLARE c3 INT DEFAULT 97;
+
+ WHILE c1 < 102 DO
+ WHILE c2 < 123 DO
+ WHILE c3 < 123 DO
+ INSERT INTO t1 (a00) VALUES (CHAR(c1,c2,c3));
+ SET c3 = c3 + 1;
+ END WHILE;
+ SET c3 = 97;
+ SET c2 = c2 + 1;
+ END WHILE;
+ SET c2 = 97;
+ SET c1 = c1 + 1;
+ END WHILE;
+END |
+delimiter ;|
+call data_load_t1();
+DROP PROCEDURE data_load_t1;
+
+# all node pages are sparse (max 3 node_ptrs)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+connection con2;
+DELETE FROM t1 WHERE a00 = 'cnm';
+COMMIT;
+BEGIN;
+INSERT INTO t1 SET a00 = 'cnm';
+# causes "domino falling" merges to upper level
+connection purge_control;
+COMMIT;
+connection con2;
+SET GLOBAL innodb_limit_optimistic_insert_debug = 0;
+ROLLBACK;
+
+# at this moment, in the tree,
+# ...
+# level 4: ...(ast,avw,ayz)(bcc,bff,bii,bll,boo,brr,buu,bxx,cba,ced,cqp,cts)(cwv,czy,ddb)...
+# ...
+
+--echo # Test start
+
+# (1) Similar case to the first reported corefile at bug#30113362
+# - Deleting 'bii' causes "domino falling" merges and the node_ptr becomes left_most of level 4.
+# So, the operation needs upper level pages' X-latch, though doesn't cause merge more.
+
+connection purge_control;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection con2;
+DELETE FROM t1 WHERE a00 = 'bii';
+COMMIT;
+BEGIN;
+INSERT INTO t1 SET a00 = 'bii';
+SET DEBUG_SYNC = 'rollback_undo_pk SIGNAL roll1_wait WAIT_FOR roll2';
+SET DEBUG_SYNC = 'rollback_purge_clust SIGNAL rollback_waiting WAIT_FOR resume';
+send ROLLBACK;
+
+connection purge_control;
+SET DEBUG_SYNC = 'now WAIT_FOR roll1_wait';
+COMMIT;
+SET DEBUG_SYNC = 'now SIGNAL roll2';
+
+connect (con1,localhost,root,,);
+# FIXME: This occasionally times out!
+--disable_warnings
+SET DEBUG_SYNC = 'now WAIT_FOR rollback_waiting TIMEOUT 1';
+--enable_warnings
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait1';
+send SELECT a00 FROM t1 WHERE a00 = 'bii';
+
+connection default;
+# FIXME: This occasionally times out!
+--disable_warnings
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait1 TIMEOUT 1';
+--enable_warnings
+# bug#30113362 caused deadlock
+SET DEBUG_SYNC = 'now SIGNAL resume';
+
+connection con1;
+reap;
+connection con2;
+reap;
+connection default;
+
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+# (2) Confirm blocking domain caused by DELETE modify_tree for tall index tree
+
+# at this moment, in the tree,
+# ...
+# level 4: ...(ajk,amn,apq)(ast,avw,ayz,bll,boo,brr,buu,bxx,cba,ced,cqp,cts)(cwv,czy,ddb)(dge,djh,dmk)(dpn,dsq,dvt)(dyw,ebz,efc)...
+# ...
+
+# makes >17 records in level4 [(2^(4-1))*2 + 1]. (causes never left_most records)
+DELETE FROM t1 WHERE a00 = 'dpn';
+COMMIT;
+INSERT INTO t1 SET a00 = 'dpn';
+ROLLBACK;
+
+# at this moment, in the tree,
+# (* before "]" and after "[" records are treated as left_most possible records)
+# ...
+# level 4: ...(ajk,amn,apq)(ast,avw,ayz,bll,boo,brr,buu,bxx],cba,ced,[cqp,cts,cwv,czy,ddb,dge,dsq,dvt)(dyw,ebz,efc)...
+# level 3: ...(cba,ccb,cdc)(ced,cfe,cgf,chg],cih,cji,[ckj,clk,con,cpo)(cqp,crq,csr)...
+# level 2: ...(ckj,cks,clb)(clk,clt],cmc,cml,cmu,cnd,[cnv,coe)(con,cow,cpf)...
+# level 1: ...(cmu,cmx,cna)(cnd],cng,cnj,cnp,[cns)(cnv,cny,cob)...
+# level 0: ...(cnd,cne,cnf)(cng,cnh,cni)(cnj,cnk,cnl,cnn,cno)(cnp,cnq,cnr)...
+
+# deletes just 'ced' node_ptr only from level 4. doesn't cause merge and never left_most.
+# adjusts MERGE_THRESHOLD to do so.
+ALTER TABLE t1 COMMENT='MERGE_THRESHOLD=35';
+
+connection purge_control;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+
+connection con2;
+DELETE FROM t1 WHERE a00 = 'cnd';
+COMMIT;
+BEGIN;
+INSERT INTO t1 SET a00 = 'cnd';
+SET DEBUG_SYNC = 'rollback_undo_pk SIGNAL roll1_wait WAIT_FOR roll2';
+SET DEBUG_SYNC = 'rollback_purge_clust SIGNAL rollback_waiting WAIT_FOR resume EXECUTE 2';
+send ROLLBACK;
+
+connection purge_control;
+SET DEBUG_SYNC = 'now WAIT_FOR roll1_wait';
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+SET DEBUG_SYNC = 'now SIGNAL roll2';
+
+connection con1;
+# FIXME: For some reason, we will not always receive these signals!
+--disable_warnings
+# An optimistic row_undo_mod_remove_clust_low() will fail.
+SET DEBUG_SYNC = 'now WAIT_FOR rollback_waiting TIMEOUT 1';
+SET DEBUG_SYNC = 'now SIGNAL resume';
+# Wait for the pessimistic row_undo_mod_remove_clust_low() attempt.
+SET DEBUG_SYNC = 'now WAIT_FOR rollback_waiting TIMEOUT 1';
+--enable_warnings
+disconnect purge_control;
+
+# The expectation should be...
+# level 0: (#cnd#,cne,cnf): causes merge
+# level 1: (#cnd#],cng,cnj,cnp,[cns): left_most
+# level 2: (clk,clt],cmc,cml,cmu,#cnd#,[cnv,coe): causes merge
+# level 3: (ced,cfe,cgf,chg],cih,cji,[ckj,#clk#,con,cpo): left_most possible (not cause merge)
+# level 4: (ast,avw,ayz,bll,boo,brr,buu,bxx],cba,#ced#,[cqp,cts,cwv,czy,ddb,dge,dsq,dvt): no merge, not left_most possible
+# So, the top X-latch page is at level4. (ast~dvt)
+
+# blocking domain based on whether its ancestor is latched or not.
+# (*[]: ancestor is X-latched)
+# level 0: ...(asq,asr,ass) [(ast,asu,asv)...(dyt,dyu,dyv)] (dyw,dyx,dyy)...
+
+# Not blocked searches
+## In MariaDB, both these will block, because we use different DEBUG_SYNC
+## instrumentation (in rollback, not purge) and the root page (number 3)
+## is being latched in row_undo_mod_remove_clust_low().
+## SELECT a00 FROM t1 WHERE a00 = 'ass';
+## SELECT a00 FROM t1 WHERE a00 = 'dyx';
+
+## SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait1';
+## send SELECT a00 FROM t1 WHERE a00 = 'ast';
+
+## connection con2;
+## SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait2';
+## send SELECT a00 FROM t1 WHERE a00 = 'dyw';
+
+connection default;
+## SET DEBUG_SYNC = 'now WAIT_FOR lockwait1';
+## SET DEBUG_SYNC = 'now WAIT_FOR lockwait2';
+SET DEBUG_SYNC = 'now SIGNAL resume';
+
+## connection con1;
+## reap;
+disconnect con1;
+
+connection con2;
+reap;
+disconnect con2;
+
+connection default;
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+
+# Cleanup
+SET DEBUG_SYNC = 'RESET';
+
+DROP TABLE t1;
+
+--disable_query_log
+SET GLOBAL innodb_limit_optimistic_insert_debug = @old_innodb_limit_optimistic_insert_debug;
+SET GLOBAL innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index;
+SET GLOBAL innodb_stats_persistent = @old_innodb_stats_persistent;
+--enable_query_log
+
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/innodb_bug56947.test b/mysql-test/suite/innodb/t/innodb_bug56947.test
index 84c5e70e1b5..ce64f1a8322 100644
--- a/mysql-test/suite/innodb/t/innodb_bug56947.test
+++ b/mysql-test/suite/innodb/t/innodb_bug56947.test
@@ -7,6 +7,7 @@
SET GLOBAL innodb_file_per_table=0;
create table bug56947(a int not null) engine = innodb;
+SET @saved_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG='+d,ib_rebuild_cannot_rename';
--replace_regex /"[^"]*"/"xxx"/
--error ER_GET_ERRNO
@@ -15,3 +16,4 @@ check table bug56947;
drop table bug56947;
SET @@global.innodb_file_per_table=DEFAULT;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
index 1d723c0bbc3..f1fd7f3c56a 100644
--- a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
+++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
@@ -36,7 +36,7 @@ select count(*) from corrupt_bit_test_Ä;
SET @save_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,dict_set_index_corrupted';
check table corrupt_bit_test_Ä;
-SET debug_dbug = @save_dbug;
+SET @@SESSION.debug_dbug = @save_dbug;
# Cannot create new indexes while corrupted indexes exist
--error ER_INDEX_CORRUPT
diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test
index 5041612bec1..89bace5d9b1 100644
--- a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test
+++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test
@@ -1,8 +1,6 @@
--source include/have_innodb.inc
--source include/have_innodb_32k.inc
-call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
-
# Check page size 32k
SELECT @@innodb_page_size;
diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test
index 5b06b57d4b4..4b4faf16f58 100644
--- a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test
+++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test
@@ -1,8 +1,6 @@
--source include/have_innodb.inc
--source include/have_innodb_64k.inc
-call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
-
# Check page size 64k
SELECT @@innodb_page_size;
diff --git a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test
index e7acb98b0d0..ccd9e3d70f4 100644
--- a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test
+++ b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test
@@ -17,6 +17,7 @@ eval create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0);
# Enable the debug injection.
+SET @saved_dbug = @@SESSION.debug_dbug;
set DEBUG_DBUG='+d,fatal-semaphore-timeout';
set autocommit=0;
@@ -107,7 +108,7 @@ source include/wait_until_connected_again.inc;
--echo # Cleaning up before exit
--disable_warnings
-set DEBUG_DBUG=NULL;
+SET debug_dbug = @saved_dbug;
drop table if exists t1;
--enable_warnings
diff --git a/mysql-test/suite/innodb/t/innodb_wl6326.opt b/mysql-test/suite/innodb/t/innodb_wl6326.opt
new file mode 100644
index 00000000000..99bf0e5a28b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_wl6326.opt
@@ -0,0 +1 @@
+--innodb-sys-tablestats
diff --git a/mysql-test/suite/innodb/t/innodb_wl6326.test b/mysql-test/suite/innodb/t/innodb_wl6326.test
new file mode 100644
index 00000000000..71eba94be04
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_wl6326.test
@@ -0,0 +1,506 @@
+#
+# WL#6326: InnoDB: fix index->lock contention
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_innodb_16k.inc
+
+--disable_query_log
+SET @old_innodb_limit_optimistic_insert_debug = @@innodb_limit_optimistic_insert_debug;
+SET @old_innodb_adaptive_hash_index = @@innodb_adaptive_hash_index;
+SET @old_innodb_stats_persistent = @@innodb_stats_persistent;
+--enable_query_log
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+SET GLOBAL innodb_adaptive_hash_index = false;
+SET GLOBAL innodb_stats_persistent = false;
+
+--connect (con1,localhost,root,,)
+--connect (con2,localhost,root,,)
+--connect (con3,localhost,root,,)
+
+CREATE TABLE t1 (
+ a00 CHAR(255) NOT NULL DEFAULT 'a',
+ a01 CHAR(255) NOT NULL DEFAULT 'a',
+ a02 CHAR(255) NOT NULL DEFAULT 'a',
+ a03 CHAR(255) NOT NULL DEFAULT 'a',
+ a04 CHAR(255) NOT NULL DEFAULT 'a',
+ a05 CHAR(255) NOT NULL DEFAULT 'a',
+ a06 CHAR(255) NOT NULL DEFAULT 'a',
+ b INT NOT NULL DEFAULT 0
+) ENGINE = InnoDB;
+
+ALTER TABLE t1 ADD PRIMARY KEY(
+ a00,
+ a01,
+ a02,
+ a03,
+ a04,
+ a05,
+ a06
+);
+
+#
+# Prepare primary key index tree to be used for this test.
+#
+
+# Only root (1)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+# Make the first records sparse artificially,
+# not to cause modify_tree by single node_ptr insert operation.
+# * (7 - 2) records should be larger than a half of the page size
+# * (7 + 2) records should be fit to the page
+# (above t1 definition is already adjusted)
+SET GLOBAL innodb_limit_optimistic_insert_debug = 7;
+
+INSERT INTO t1 (a00) VALUES ('aa');
+INSERT INTO t1 (a00) VALUES ('ab');
+INSERT INTO t1 (a00) VALUES ('ac');
+INSERT INTO t1 (a00) VALUES ('ad');
+INSERT INTO t1 (a00) VALUES ('ae');
+INSERT INTO t1 (a00) VALUES ('af');
+INSERT INTO t1 (a00) VALUES ('ag');
+INSERT INTO t1 (a00) VALUES ('ah');
+# Raise root (1-2)
+# (aa,ad)
+# (aa,ab,ac)(ad,ae,af,ag,ah)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+INSERT INTO t1 (a00) VALUES ('ai');
+INSERT INTO t1 (a00) VALUES ('aj');
+INSERT INTO t1 (a00) VALUES ('ak');
+# Split leaf (1-3)
+# (aa,ad,ak)
+# (aa,ab,ac)(ad,ae,af,ag,ah,ai,aj)(ak)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+INSERT INTO t1 (a00) VALUES ('al');
+INSERT INTO t1 (a00) VALUES ('am');
+INSERT INTO t1 (a00) VALUES ('an');
+INSERT INTO t1 (a00) VALUES ('ao');
+INSERT INTO t1 (a00) VALUES ('ap');
+INSERT INTO t1 (a00) VALUES ('aq');
+INSERT INTO t1 (a00) VALUES ('ar');
+# Split leaf (1-4)
+# (aa,ad,ak,ar)
+# (aa,ab,ac)(ad,ae,af,ag,ah,ai,aj)(ak,al,am,an,ao,ap,aq)(ar)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+INSERT INTO t1 (a00) VALUES ('as');
+INSERT INTO t1 (a00) VALUES ('at');
+INSERT INTO t1 (a00) VALUES ('au');
+INSERT INTO t1 (a00) VALUES ('av');
+INSERT INTO t1 (a00) VALUES ('aw');
+INSERT INTO t1 (a00) VALUES ('ax');
+INSERT INTO t1 (a00) VALUES ('ay');
+# Split leaf (1-5)
+# (aa,ad,ak,ar,ay)
+# (aa,ab,ac)(ad,ae,af,ag,ah,ai,aj)(ak,al,am,an,ao,ap,aq)(ar,as,at,au,av,aw,ax)(ay)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+INSERT INTO t1 (a00) VALUES ('az');
+INSERT INTO t1 (a00) VALUES ('ba');
+INSERT INTO t1 (a00) VALUES ('bb');
+INSERT INTO t1 (a00) VALUES ('bc');
+INSERT INTO t1 (a00) VALUES ('bd');
+INSERT INTO t1 (a00) VALUES ('be');
+INSERT INTO t1 (a00) VALUES ('bf');
+# Split leaf (1-6)
+# (aa,ad,ak,ar,ay,bf)
+# (aa,ab,ac)(ad..)(ak..)(ar,as,at,au,av,aw,ax)(ay,az,ba,bb,bc,bd,be)(bf)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+
+INSERT INTO t1 (a00) VALUES ('bg');
+INSERT INTO t1 (a00) VALUES ('bh');
+INSERT INTO t1 (a00) VALUES ('bi');
+INSERT INTO t1 (a00) VALUES ('bj');
+INSERT INTO t1 (a00) VALUES ('bk');
+INSERT INTO t1 (a00) VALUES ('bl');
+INSERT INTO t1 (a00) VALUES ('bm');
+# Split leaf (1-7)
+# (aa,ad,ak,ar,ay,bf,bm)
+# (aa,ab,ac)(ad..)(ak..)(ar..)(ay,az,ba,bb,bc,bd,be)(bf,bg,bh,bi,bj,bk,bl)(bm)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+INSERT INTO t1 (a00) VALUES ('bn');
+INSERT INTO t1 (a00) VALUES ('bo');
+INSERT INTO t1 (a00) VALUES ('bp');
+INSERT INTO t1 (a00) VALUES ('bq');
+INSERT INTO t1 (a00) VALUES ('br');
+INSERT INTO t1 (a00) VALUES ('bs');
+INSERT INTO t1 (a00) VALUES ('bt');
+# Raise root (1-2-8)
+# (aa,ar)
+# (aa,ad,ak) (ar,ay,bf,bm,bt)
+# (aa,ab,ac)(ad..)(ak..)(ar..)(ay..)(bf..)(bm..)(bt)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+
+INSERT INTO t1 (a00) VALUES ('bu');
+INSERT INTO t1 (a00) VALUES ('bv');
+INSERT INTO t1 (a00) VALUES ('bw');
+INSERT INTO t1 (a00) VALUES ('bx');
+INSERT INTO t1 (a00) VALUES ('by');
+INSERT INTO t1 (a00) VALUES ('bz');
+INSERT INTO t1 (a00) VALUES ('ca');
+
+INSERT INTO t1 (a00) VALUES ('cb');
+INSERT INTO t1 (a00) VALUES ('cc');
+INSERT INTO t1 (a00) VALUES ('cd');
+INSERT INTO t1 (a00) VALUES ('ce');
+INSERT INTO t1 (a00) VALUES ('cf');
+INSERT INTO t1 (a00) VALUES ('cg');
+INSERT INTO t1 (a00) VALUES ('ch');
+
+INSERT INTO t1 (a00) VALUES ('ci');
+INSERT INTO t1 (a00) VALUES ('cj');
+INSERT INTO t1 (a00) VALUES ('ck');
+INSERT INTO t1 (a00) VALUES ('cl');
+INSERT INTO t1 (a00) VALUES ('cm');
+INSERT INTO t1 (a00) VALUES ('cn');
+INSERT INTO t1 (a00) VALUES ('co');
+# Split also at level 1 (1-3-11)
+# (aa,ar,co)
+# (aa,ad,ak) (ar,ay,bf,bm,bt,ca,ch) (co)
+# (aa,ab,ac)(ad..)(ak..)(ar..)(ay..)(bf..)(bm..)(bt..)(ca..)(ch..)(co)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+
+INSERT INTO t1 (a00) VALUES ('cp');
+INSERT INTO t1 (a00) VALUES ('cq');
+INSERT INTO t1 (a00) VALUES ('cr');
+INSERT INTO t1 (a00) VALUES ('cs');
+INSERT INTO t1 (a00) VALUES ('ct');
+INSERT INTO t1 (a00) VALUES ('cu');
+INSERT INTO t1 (a00) VALUES ('cv');
+
+INSERT INTO t1 (a00) VALUES ('cw');
+INSERT INTO t1 (a00) VALUES ('cx');
+INSERT INTO t1 (a00) VALUES ('cy');
+INSERT INTO t1 (a00) VALUES ('cz');
+INSERT INTO t1 (a00) VALUES ('da');
+INSERT INTO t1 (a00) VALUES ('db');
+INSERT INTO t1 (a00) VALUES ('dc');
+
+INSERT INTO t1 (a00) VALUES ('dd');
+INSERT INTO t1 (a00) VALUES ('de');
+INSERT INTO t1 (a00) VALUES ('df');
+INSERT INTO t1 (a00) VALUES ('dg');
+INSERT INTO t1 (a00) VALUES ('dh');
+INSERT INTO t1 (a00) VALUES ('di');
+INSERT INTO t1 (a00) VALUES ('dj');
+
+INSERT INTO t1 (a00) VALUES ('dk');
+INSERT INTO t1 (a00) VALUES ('dl');
+INSERT INTO t1 (a00) VALUES ('dm');
+INSERT INTO t1 (a00) VALUES ('dn');
+INSERT INTO t1 (a00) VALUES ('do');
+INSERT INTO t1 (a00) VALUES ('dp');
+INSERT INTO t1 (a00) VALUES ('dq');
+
+INSERT INTO t1 (a00) VALUES ('dr');
+INSERT INTO t1 (a00) VALUES ('ds');
+INSERT INTO t1 (a00) VALUES ('dt');
+INSERT INTO t1 (a00) VALUES ('du');
+INSERT INTO t1 (a00) VALUES ('dv');
+INSERT INTO t1 (a00) VALUES ('dw');
+INSERT INTO t1 (a00) VALUES ('dx');
+
+INSERT INTO t1 (a00) VALUES ('dy');
+INSERT INTO t1 (a00) VALUES ('dz');
+INSERT INTO t1 (a00) VALUES ('ea');
+INSERT INTO t1 (a00) VALUES ('eb');
+INSERT INTO t1 (a00) VALUES ('ec');
+INSERT INTO t1 (a00) VALUES ('ed');
+INSERT INTO t1 (a00) VALUES ('ee');
+
+INSERT INTO t1 (a00) VALUES ('ef');
+INSERT INTO t1 (a00) VALUES ('eg');
+INSERT INTO t1 (a00) VALUES ('eh');
+INSERT INTO t1 (a00) VALUES ('ei');
+INSERT INTO t1 (a00) VALUES ('ej');
+INSERT INTO t1 (a00) VALUES ('ek');
+INSERT INTO t1 (a00) VALUES ('el');
+# Split also at level 1 (1-4-18)
+# (aa,ar,co,el)
+# (aa,ad,ak) (ar,ay,bf,bm,bt,ca,ch) (co,cv,dc,dj,dq,dx,ee) (el)
+# (aa,ab,ac)(ad..)(ak..)(ar..)(ay..)(bf..)(bm..)(bt..)(ca..)(ch..)(co..)(cv..)(dc..)(dj..)(dq..)(dx..)(ee..)(el)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+INSERT INTO t1 (a00) VALUES ('em');
+INSERT INTO t1 (a00) VALUES ('en');
+INSERT INTO t1 (a00) VALUES ('eo');
+INSERT INTO t1 (a00) VALUES ('ep');
+INSERT INTO t1 (a00) VALUES ('eq');
+INSERT INTO t1 (a00) VALUES ('er');
+INSERT INTO t1 (a00) VALUES ('es');
+
+INSERT INTO t1 (a00) VALUES ('et');
+INSERT INTO t1 (a00) VALUES ('eu');
+INSERT INTO t1 (a00) VALUES ('ev');
+INSERT INTO t1 (a00) VALUES ('ew');
+INSERT INTO t1 (a00) VALUES ('ex');
+INSERT INTO t1 (a00) VALUES ('ey');
+INSERT INTO t1 (a00) VALUES ('ez');
+
+INSERT INTO t1 (a00) VALUES ('fa');
+INSERT INTO t1 (a00) VALUES ('fb');
+INSERT INTO t1 (a00) VALUES ('fc');
+INSERT INTO t1 (a00) VALUES ('fd');
+INSERT INTO t1 (a00) VALUES ('fe');
+INSERT INTO t1 (a00) VALUES ('ff');
+INSERT INTO t1 (a00) VALUES ('fg');
+
+INSERT INTO t1 (a00) VALUES ('fh');
+INSERT INTO t1 (a00) VALUES ('fi');
+INSERT INTO t1 (a00) VALUES ('fj');
+INSERT INTO t1 (a00) VALUES ('fk');
+INSERT INTO t1 (a00) VALUES ('fl');
+INSERT INTO t1 (a00) VALUES ('fm');
+INSERT INTO t1 (a00) VALUES ('fn');
+
+INSERT INTO t1 (a00) VALUES ('fo');
+INSERT INTO t1 (a00) VALUES ('fp');
+INSERT INTO t1 (a00) VALUES ('fq');
+INSERT INTO t1 (a00) VALUES ('fr');
+INSERT INTO t1 (a00) VALUES ('fs');
+INSERT INTO t1 (a00) VALUES ('ft');
+INSERT INTO t1 (a00) VALUES ('fu');
+
+INSERT INTO t1 (a00) VALUES ('fv');
+INSERT INTO t1 (a00) VALUES ('fw');
+INSERT INTO t1 (a00) VALUES ('fx');
+INSERT INTO t1 (a00) VALUES ('fy');
+INSERT INTO t1 (a00) VALUES ('fz');
+INSERT INTO t1 (a00) VALUES ('ga');
+INSERT INTO t1 (a00) VALUES ('gb');
+
+INSERT INTO t1 (a00) VALUES ('gc');
+INSERT INTO t1 (a00) VALUES ('gd');
+INSERT INTO t1 (a00) VALUES ('ge');
+INSERT INTO t1 (a00) VALUES ('gf');
+INSERT INTO t1 (a00) VALUES ('gg');
+INSERT INTO t1 (a00) VALUES ('gh');
+
+
+# Current tree form (1-4-24)
+# (aa,ar,co,el)
+# (aa,ad,ak) (ar,ay,bf,bm,bt,ca,ch) (co,cv,dc,dj,dq,dx,ee) (el..,gb)
+# (aa,ab,ac)(ad..)(ak..)(ar..)(ay..)(bf..)(bm..)(bt..)(ca..)(ch..)(co..)(cv..)(dc..)(dj..)(dq..)(dx..)(ee..)(el..)..(gb..)
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+
+
+# Insert the rest of records normally
+SET GLOBAL innodb_limit_optimistic_insert_debug = 0;
+
+
+--echo # Test start
+
+# (1) Insert records to leaf page (bf..) and cause modify_page.
+# - root page is not X latched
+# - latched from level 1 page (ar,ay,bf,bm,bt,ca,ch)
+
+SET DEBUG_SYNC = 'RESET';
+
+# Filling leaf page (bf..)
+INSERT INTO t1 (a00) VALUES ('bfa');
+
+--connection con1
+SET DEBUG_SYNC = 'before_insert_pessimitic_row_ins_clust SIGNAL reached WAIT_FOR continue';
+# Cause modify_tree
+--send
+INSERT INTO t1 (a00) VALUES ('bfb');
+
+--connection con2
+SET DEBUG_SYNC = 'now WAIT_FOR reached';
+# Not blocked searches
+SELECT a00,a01 FROM t1 WHERE a00 = 'aa';
+SELECT a00,a01 FROM t1 WHERE a00 = 'aq';
+# "where a00 = 'co'" is blocked because searching from smaller ('co','a','a',..).
+SELECT a00,a01 FROM t1 WHERE a00 = 'cp';
+SELECT a00,a01 FROM t1 WHERE a00 = 'el';
+
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait1';
+# Blocked
+--send
+SELECT a00,a01 FROM t1 WHERE a00 = 'ar';
+
+--connection con3
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait2';
+# Blocked
+--send
+SELECT a00,a01 FROM t1 WHERE a00 = 'cn';
+
+--connection default
+# FIXME: These occasionally time out!
+--disable_warnings
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait1 TIMEOUT 1';
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait2 TIMEOUT 1';
+--enable_warnings
+SET DEBUG_SYNC = 'now SIGNAL continue';
+
+--connection con1
+--reap
+
+--connection con2
+--reap
+
+--connection con3
+--reap
+
+--connection default
+
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+
+
+# (2) Insert records to leaf page (co..) and cause modify_page
+# - root page is X latched, because node_ptr for 'co'
+# is 1st record for (co,cv,dc,dj,dq,dx,ee)
+#
+# * ordinary pessimitic insert might be done by pessistic update
+# and we should consider possibility node_ptr to be deleted.
+
+SET DEBUG_SYNC = 'RESET';
+
+# Filling leaf page (co..)
+INSERT INTO t1 (a00) VALUES ('coa');
+
+--connection con1
+SET DEBUG_SYNC = 'before_insert_pessimitic_row_ins_clust SIGNAL reached WAIT_FOR continue';
+# Cause modify_tree
+--send
+INSERT INTO t1 (a00) VALUES ('cob');
+
+--connection con2
+SET DEBUG_SYNC = 'now WAIT_FOR reached';
+# All searches are blocked because root page is X latched
+
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait1';
+# Blocked
+--send
+SELECT a00,a01 FROM t1 WHERE a00 = 'aa';
+
+--connection con3
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait2';
+# Blocked
+--send
+SELECT a00,a01 FROM t1 WHERE a00 = 'el';
+
+--connection default
+# FIXME: These occasionally time out!
+--disable_warnings
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait1 TIMEOUT 1';
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait2 TIMEOUT 1';
+--enable_warnings
+SET DEBUG_SYNC = 'now SIGNAL continue';
+
+--connection con1
+--reap
+
+--connection con2
+--reap
+
+--connection con3
+--reap
+
+--connection default
+
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+
+
+# (3) Insert records to rightmost leaf page (gb..) and cause modify_page
+# - root page is not X latched, because node_ptr for 'gb' is the last record
+# of the level 1 though it is last record in the page.
+# - lathed from level 1 page (el..,gb)
+
+SET DEBUG_SYNC = 'RESET';
+
+# Filling leaf page (gb..)
+INSERT INTO t1 (a00) VALUES ('gba');
+
+--connection con1
+SET DEBUG_SYNC = 'before_insert_pessimitic_row_ins_clust SIGNAL reached WAIT_FOR continue';
+# Cause modify_tree
+--send
+INSERT INTO t1 (a00) VALUES ('gbb');
+
+--connection con2
+SET DEBUG_SYNC = 'now WAIT_FOR reached';
+# Not blocked searches
+SELECT a00,a01 FROM t1 WHERE a00 = 'aa';
+SELECT a00,a01 FROM t1 WHERE a00 = 'ek';
+
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait1';
+# Blocked
+--send
+SELECT a00,a01 FROM t1 WHERE a00 = 'el';
+
+--connection con3
+SET DEBUG_SYNC = 'rw_s_lock_waiting SIGNAL lockwait2';
+# Blocked
+--send
+SELECT a00,a01 FROM t1 WHERE a00 = 'gb';
+
+--connection default
+# FIXME: These occasionally time out!
+--disable_warnings
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait1 TIMEOUT 1';
+SET DEBUG_SYNC = 'now WAIT_FOR lockwait2 TIMEOUT 1';
+--enable_warnings
+SET DEBUG_SYNC = 'now SIGNAL continue';
+
+--connection con1
+--reap
+
+--connection con2
+--reap
+
+--connection con3
+--reap
+
+--connection default
+ANALYZE TABLE t1;
+SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
+
+
+
+# Cleanup
+SET DEBUG_SYNC = 'RESET';
+
+--connection default
+--disconnect con1
+--disconnect con2
+--disconnect con3
+
+DROP TABLE t1;
+
+--disable_query_log
+SET GLOBAL innodb_limit_optimistic_insert_debug = @old_innodb_limit_optimistic_insert_debug;
+SET GLOBAL innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index;
+SET GLOBAL innodb_stats_persistent = @old_innodb_stats_persistent;
+--enable_query_log
+
+# Wait till all disconnects are completed.
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/innodb_wl6326_big.test b/mysql-test/suite/innodb/t/innodb_wl6326_big.test
new file mode 100644
index 00000000000..6d4b07e7cb6
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_wl6326_big.test
@@ -0,0 +1,716 @@
+# This is a script for MTR with hybrid use.
+# a) As regression test
+# Mostly some brute force attempt to stress the internal sx locks of
+# InnoDB which were introduced by WL#6326+WL#6363.
+# The file with expected results fits to this variant.
+# The impact on code coverage is quite good.
+# b) As testbed for attempts to extend or improve the RQG test wl6326_sql.yy.
+# The MTR based test uses
+# - a table t1 with the same layout
+# - the same stored functions
+# - the same stored procedure proc_fill_t1 for inserting a configurable
+# amount of records into t1
+# like the RQG test wl6326_sql.yy.
+# Feel free to modify parameters like $max_row_count, $max_con,
+# $high_load_duration or switch debugging on (let $test_debug= 1).
+# But please be aware that MTR will most probably report that the test
+# failed because it got a difference to expected results.
+# Reasons:
+# - In general: The file with expected results fits to a) only.
+# - The actual results might dependend on $max_row_count.
+# - Additional result sets might be printed.
+#
+
+# WL#6326 is about the sx locks (InnoDB feature only).
+--source include/have_innodb.inc
+# Runtime properties:
+# Notebook i5 dual core with HT, MySQL binaries compiled with debug,
+# max_row_count=10000 rows
+# vardir on tmpfs : ~ 375
+# vardir on disk : ~ 546
+--source include/big_test.inc
+# We go with "--send" and "--reap" and that fails with the embedded server.
+--source include/not_embedded.inc
+# Its intentional to not take the risk that a run with valgrind times out.
+--source include/not_valgrind.inc
+
+# FIXME:
+# Increase the code coverage provided by the current test by
+# trying "InnoDB Tablespace Monitor" as soon as some bug is fixed
+# or wait till the deprecated "InnoDB Tablespace Monitor" is
+# removed.
+
+# Setup of some parameters
+# ------------------------
+# Number of records within every chunk to be added to t1.
+let $load_unit= 10000;
+#
+# Rough number of records in t1 to achieve.
+# We add chunks of $load_unit rows till the actual number
+# of rows in the table t1 exceeds $max_row_count.
+# let $max_row_count= 1000000;
+# let $max_row_count= 300000;
+# let $max_row_count= 100000;
+# let $max_row_count= 30000;
+ let $max_row_count= 10000; # ~ 322s on tmpfs (NB)
+#
+# Determine which variant to run.
+let $test_debug= 0;
+#
+# Number of concurrent sessions to be used in the high load test.
+let $max_con= 10;
+# Duration of the high load test in seconds.
+let $high_load_duration= 60;
+
+# Putting all objects into the SCHEMA my_schema makes the final cleanup easier.
+# We simply run than DROP SCHEMA my_schema.
+CREATE SCHEMA my_schema;
+USE my_schema;
+CREATE FUNCTION f_thread_id (i INT) RETURNS CHAR(4) DETERMINISTIC
+RETURN CONCAT(LPAD(CAST(i AS CHAR),3,'_'),'_') ;
+SELECT CONCAT('->', f_thread_id( 1), '<-');
+SELECT CONCAT('->', f_thread_id(12), '<-');
+
+# Definition of parameters used in functions.
+# We use here a "1" in order to make the impact on the results of the functions
+# good visible.
+SET @extra_int = 1;
+SET @extra_string = f_thread_id(@extra_int);
+SELECT @extra_int , @extra_string;
+
+# The different functions are used later when filling t1 and also during
+# RQG testing. They serve to generate the difference between column values
+# in different rows in different areas of the column.
+# Fictional example:
+# row 1 col_int0=1 colx='1abcdefgh' coly='abcd1efgh' colz='abcdefgh1'
+# row 2 col_int0=2 colx='2abcdefgh' coly='abcd2efgh' colz='abcdefgh2'
+# The function f_<pattern> is for the column with the name <pattern>.
+# There is a function
+# - for every column except col_int0
+# - even if the SQL for generating the value is simple.
+# The reason for this is the architecture of the RQG test.
+
+let $part= AS my_result
+FROM (SELECT 1 AS my_col UNION SELECT 12 UNION SELECT 123
+UNION SELECT 1234 UNION SELECT 12345) AS tx;
+
+let $function_name= f_col_int1;
+eval CREATE FUNCTION $function_name (i INT) RETURNS INT(20) DETERMINISTIC
+RETURN i * 1000 + @extra_int ;
+eval SELECT $function_name(my_col) $part;
+
+let $function_name= f_col_int2;
+eval CREATE FUNCTION $function_name (i INT) RETURNS INT(20) DETERMINISTIC
+RETURN @extra_int * 10000000 + i ;
+eval SELECT $function_name(my_col) $part;
+
+let $function_name= f_col_int3;
+eval CREATE FUNCTION $function_name (i INT) RETURNS INT(20) DETERMINISTIC
+RETURN @extra_int ;
+eval SELECT $function_name(my_col) $part;
+
+let $function_name= f_col_blob;
+eval CREATE FUNCTION $function_name (i INT) RETURNS BLOB DETERMINISTIC
+RETURN RPAD(@extra_string,(@@innodb_page_size / 2 ) + 1,'a');
+eval SELECT CONCAT('->', SUBSTR($function_name(my_col) FROM 1 FOR 10),
+ '<-.....->', SUBSTR($function_name(my_col) FROM -10 FOR 10), '<-') $part;
+
+let $function_name= f_col_char0;
+eval CREATE FUNCTION $function_name (i INT) RETURNS CHAR(255) DETERMINISTIC
+RETURN LPAD(CAST(i AS CHAR),255,' ');
+eval SELECT CONCAT('->', $function_name(my_col), '<-') $part;
+
+let $function_name= f_col_char1;
+eval CREATE FUNCTION $function_name (i INT) RETURNS CHAR(26) DETERMINISTIC
+RETURN
+CONCAT('B',
+ LPAD(SUBSTR(CAST(i AS CHAR),1,(LENGTH(CAST(i AS CHAR)) DIV 2)),10,' '),
+ @extra_string,
+ RPAD(SUBSTR(CAST(i AS CHAR), -((LENGTH(CAST(i AS CHAR)) + 1) DIV 2)),10,' '),
+ 'E') ;
+eval SELECT CONCAT('->', $function_name(my_col), '<-') $part;
+
+let $function_name= f_col_char2;
+eval CREATE FUNCTION $function_name (i INT) RETURNS CHAR(26) DETERMINISTIC
+RETURN
+CONCAT('B',
+ RPAD(SUBSTR(CAST(i AS CHAR),1,(LENGTH(CAST(i AS CHAR)) DIV 2)),10,' '),
+ @extra_string,
+ LPAD(SUBSTR(CAST(i AS CHAR), -((LENGTH(CAST(i AS CHAR)) + 1) DIV 2)),10,' '),
+ 'E');
+eval SELECT CONCAT('->', $function_name(my_col), '<-') $part;
+
+let $function_name= f_col_char3;
+eval CREATE FUNCTION $function_name (i INT) RETURNS CHAR(26) DETERMINISTIC
+RETURN
+CONCAT('B',@extra_string,LPAD(CAST(i AS CHAR),20,' '),'E');
+eval SELECT CONCAT('->', $function_name(my_col), '<-') $part;
+
+let $function_name= f_col_char4;
+eval CREATE FUNCTION $function_name (i INT) RETURNS CHAR(26) DETERMINISTIC
+RETURN
+CONCAT('B',RPAD(CAST(i AS CHAR),20,' '),@extra_string,'E');
+eval SELECT CONCAT('->', $function_name(my_col), '<-') $part;
+
+# Auxiliary table for figuring out the impact of scenarios on
+# information_schema.innodb_metrics content.
+CREATE TABLE my_metrics LIKE information_schema.innodb_metrics;
+ALTER TABLE my_metrics ADD COLUMN phase ENUM('after', 'before'),
+DROP COLUMN SUBSYSTEM, DROP COLUMN TYPE, DROP COLUMN COMMENT,
+ADD PRIMARY KEY (NAME,phase);
+let $empty_my_metrics= DELETE FROM my_metrics;
+let $before_my_metrics= INSERT INTO my_metrics
+SELECT NAME, COUNT, MAX_COUNT, MIN_COUNT, AVG_COUNT,
+COUNT_RESET, MAX_COUNT_RESET, MIN_COUNT_RESET, AVG_COUNT_RESET,
+TIME_ENABLED, TIME_DISABLED, TIME_ELAPSED, TIME_RESET,
+STATUS, 'before'
+FROM information_schema.innodb_metrics
+WHERE NAME LIKE 'innodb_rwlock_sx_%';
+let $after_my_metrics= INSERT INTO my_metrics
+SELECT NAME, COUNT, MAX_COUNT, MIN_COUNT, AVG_COUNT,
+COUNT_RESET, MAX_COUNT_RESET, MIN_COUNT_RESET, AVG_COUNT_RESET,
+TIME_ENABLED, TIME_DISABLED, TIME_ELAPSED, TIME_RESET,
+STATUS, 'after'
+FROM information_schema.innodb_metrics
+WHERE NAME LIKE 'innodb_rwlock_sx_%';
+let $print_metrics= SELECT NAME, COUNT, MAX_COUNT, MIN_COUNT, AVG_COUNT,
+COUNT_RESET, MAX_COUNT_RESET, MIN_COUNT_RESET, AVG_COUNT_RESET,
+TIME_ENABLED, TIME_DISABLED, TIME_ELAPSED, TIME_RESET, STATUS
+FROM information_schema.innodb_metrics
+WHERE NAME LIKE 'innodb_rwlock_sx_%'
+ORDER BY NAME;
+
+# The main table for testing.
+CREATE TABLE t1 (
+ col_int0 BIGINT,
+ col_int1 BIGINT,
+ col_int2 BIGINT,
+ col_int3 BIGINT,
+ col_blob BLOB,
+ col_char0 VARCHAR(255),
+ col_char1 VARCHAR(30),
+ col_char2 VARCHAR(30),
+ col_char3 VARCHAR(30),
+ col_char4 VARCHAR(30)
+) ENGINE = InnoDB;
+
+# Use many indexes with mostly significant size in order to cause
+# some heavy use of sx locks during data generation.
+ALTER TABLE t1 ADD UNIQUE KEY uidx_col_int0 (col_int0),
+ADD UNIQUE KEY uidx1 (col_int1, col_char0),
+ADD UNIQUE KEY uidx2 (col_int2, col_char0, col_int1),
+ADD UNIQUE KEY uidx3 (col_int3, col_int2, col_char0),
+ADD UNIQUE KEY uidx4 (col_char1, col_char0),
+ADD UNIQUE KEY uidx5 (col_char2, col_char0, col_char1),
+ADD UNIQUE KEY uidx6 (col_char3, col_char2, col_char0),
+ADD UNIQUE KEY uidx7 (col_int1, col_int2, col_int3, col_char4,
+ col_char1, col_char2, col_char3, col_char0),
+ADD KEY idx8 (col_blob(10), col_char4);
+
+delimiter |;
+CREATE PROCEDURE proc_fill_t1 (max_row_count INT, load_unit INT)
+BEGIN
+ DECLARE my_count INTEGER DEFAULT 0;
+ DECLARE max_load_count INTEGER DEFAULT 0;
+ DROP TABLE IF EXISTS t0;
+ CREATE TEMPORARY TABLE t0 (col_int0 BIGINT, PRIMARY KEY(col_int0));
+ WHILE (my_count < load_unit ) DO
+ SET my_count = my_count + 1;
+ INSERT INTO t0 SET col_int0 = my_count;
+ END WHILE;
+ SET max_load_count = (SELECT (max_row_count DIV load_unit) + 1 );
+ SELECT COUNT(col_int0) INTO @val FROM t1;
+ SET my_count = 0;
+ REPEAT
+ INSERT INTO t1 (col_int0, col_int1, col_int2, col_int3, col_blob,
+ col_char0, col_char1, col_char2,col_char3,col_char4)
+ SELECT col_int0 + @val,
+ f_col_int1(col_int0 + @val),
+ f_col_int2(col_int0 + @val),
+ f_col_int3(col_int0 + @val),
+ f_col_blob(col_int0 + @val),
+ f_col_char0(col_int0 + @val),
+ f_col_char1(col_int0 + @val),
+ f_col_char2(col_int0 + @val),
+ f_col_char3(col_int0 + @val),
+ f_col_char4(col_int0 + @val)
+ FROM t0;
+ COMMIT;
+ SELECT MAX(col_int0) INTO @val FROM t1;
+ SET my_count = my_count + 1;
+ UNTIL( my_count > max_load_count OR @val >= max_row_count )
+ END REPEAT;
+ DROP TEMPORARY TABLE t0;
+END|
+delimiter ;|
+
+delimiter |;
+CREATE PROCEDURE proc_dml (max_duration INT, t1_stripe_half INT)
+BEGIN
+ DECLARE aux INTEGER DEFAULT 0;
+ DECLARE start_time INT;
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND BEGIN END;
+
+ SET @extra_int = CONNECTION_ID();
+ SET @extra_string = f_thread_id(@extra_int);
+ SELECT ROUND(MAX(col_int0) / 2 ) INTO @t1_half FROM t1;
+ # The user lock 'Blocker' should be already set by some other session S1.
+ # S1 starts the race by releasing that lock.
+ # Wait till the lock is released and the lock can be obtained.
+ # In order to prevent endless waiting in case of non foreseen problems
+ # limit the timespan to 30 seconds.
+ SELECT GET_LOCK('Blocker', 30) INTO @aux;
+ # Release the lock immediate so that the other "runner" sessions start too.
+ SELECT RELEASE_LOCK('Blocker') INTO @aux;
+ SET start_time = UNIX_TIMESTAMP();
+
+ WHILE (UNIX_TIMESTAMP() - start_time < max_duration) DO
+ SET @aux = @t1_half - t1_stripe_half + ROUND(RAND() * t1_stripe_half * 2);
+ UPDATE t1 SET
+ col_int1 = f_col_int1(col_int0),
+ col_int2 = f_col_int2(col_int0),
+ col_int3 = f_col_int3(col_int0),
+ col_blob = f_col_blob(col_int0),
+ col_char0 = f_col_char0(col_int0),
+ col_char1 = f_col_char1(col_int0),
+ col_char2 = f_col_char2(col_int0),
+ col_char3 = f_col_char3(col_int0),
+ col_char4 = f_col_char4(col_int0)
+ WHERE col_int0 = @aux;
+ COMMIT;
+ END WHILE;
+END|
+delimiter ;|
+
+SET GLOBAL innodb_monitor_disable = "innodb_rwlock_sx_%";
+SET @pre_reset_ts = NOW();
+--sleep 1.1
+SET GLOBAL innodb_monitor_reset = "innodb_rwlock_sx_%";
+SET @pre_enable_ts = NOW();
+--sleep 1.1
+SET GLOBAL innodb_monitor_enable = "innodb_rwlock_sx_%";
+--sleep 1.1
+SET @pre_collect_ts = NOW();
+eval $empty_my_metrics;
+eval $before_my_metrics;
+--echo # TC-01 There are exact three entries "innodb_rwlock_sx_%" with the
+--echo # with the name which follow in innodb_metrics.
+let $check_statement=
+SELECT COUNT(*) <> 3 FROM my_metrics
+WHERE NAME IN ('innodb_rwlock_sx_spin_waits',
+ 'innodb_rwlock_sx_spin_rounds',
+ 'innodb_rwlock_sx_os_waits');
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT NAME FROM my_metrics
+ ORDER BY NAME;
+ exit;
+}
+--echo # pass
+
+SELECT COUNT(*) INTO @sx_count FROM my_metrics;
+
+--echo # TC-02 Counting is now enabled. ALL = @sx_count entries show that.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics
+WHERE STATUS = 'enabled';
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT NAME, STATUS FROM my_metrics
+ ORDER BY NAME;
+ exit;
+}
+--echo # pass
+
+--echo # TC-03 @pre_reset_ts < TIME_RESET. ALL = @sx_count entries show that.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics
+WHERE @pre_reset_ts < TIME_RESET;
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT NAME, @pre_reset_ts, TIME_RESET FROM my_metrics
+ ORDER BY NAME;
+ exit;
+}
+--echo # pass
+
+--echo # TC-04 @pre_enable_ts < TIME_ENABLED. ALL = @sx_count entries show that.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics
+WHERE @pre_enable_ts < TIME_ENABLED;
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT NAME, @pre_enable_ts, TIME_ENABLED FROM my_metrics
+ ORDER BY NAME;
+ exit;
+}
+--echo # pass
+
+--echo # TC-05 TIME_RESET < TIME_ENABLED AND TIME_ENABLED < @pre_collect_ts
+--echo # AND TIME_ELAPSED > 0. ALL = @sx_count entries show that.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics
+WHERE TIME_RESET < TIME_ENABLED AND TIME_ENABLED < @pre_collect_ts
+ AND TIME_ELAPSED > 0;
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT NAME, @pre_collect_ts, TIME_RESET, TIME_ENABLED, TIME_ELAPSED
+ FROM my_metrics
+ ORDER BY NAME;
+ exit;
+}
+--echo # pass
+
+--echo # TC-06 COUNT_RESET = MAX_COUNT_RESET. ALL = @sx_count entries show that.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics
+WHERE COUNT_RESET = MAX_COUNT_RESET;
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT NAME, COUNT_RESET, MAX_COUNT_RESET FROM my_metrics
+ ORDER BY NAME;
+ exit;
+}
+--echo # pass
+
+SET GLOBAL innodb_monitor_reset = "innodb_rwlock_sx_%";
+--disable_result_log
+if($test_debug)
+{
+ --enable_result_log
+ eval $print_metrics;
+}
+SHOW ENGINE INNODB STATUS;
+--enable_result_log
+
+eval $empty_my_metrics;
+eval $before_my_metrics;
+# These values (the "0") help to identify later if some record is in its
+# initial state or already modified.
+SET @extra_string = '__0_';
+SET @extra_int = 0;
+
+--echo # TC-07 One session inserts some significant amount of rows into t1.
+--echo # The system MUST survive that.
+--replace_result $max_row_count <max_row_count>
+eval SET @max_row_count = $max_row_count;
+--replace_result $load_unit <load_unit>
+eval SET @load_unit = $load_unit;
+SET @start_time = UNIX_TIMESTAMP();
+SET AUTOCOMMIT = OFF;
+CALL proc_fill_t1 (@max_row_count, @load_unit);
+--echo # pass
+SET AUTOCOMMIT = ON;
+SELECT col_int0 INTO @t1_half FROM t1
+WHERE col_int0 >= (@val DIV 2) ORDER BY col_int0 LIMIT 1;
+
+--disable_result_log
+if($test_debug)
+{
+ --enable_result_log
+ SELECT COUNT(*) AS table_row_count,
+ UNIX_TIMESTAMP() - @start_time AS fill_run_time
+ FROM t1;
+ eval $print_metrics;
+}
+SHOW ENGINE INNODB STATUS;
+--enable_result_log
+
+# Show that the value distribution is according to the plan.
+--vertical_results
+SELECT col_int0, col_int1, col_int2, col_int3,
+ CONCAT('->', SUBSTR(col_blob FROM 1 FOR 10),
+ '<-.....->', SUBSTR(col_blob FROM -10 FOR 10), '<-') AS col_blobx,
+ CONCAT('->',col_char0,'<-') AS col_char0x,
+ CONCAT('->',col_char1,'<-') AS col_char1x,
+ CONCAT('->',col_char2,'<-') AS col_char2x,
+ CONCAT('->',col_char3,'<-') AS col_char3x,
+ CONCAT('->',col_char4,'<-') AS col_char4x
+FROM t1 WHERE col_int0 between 98 AND 102;
+--horizontal_results
+
+# For experiments/interest only. Please do not remove that.
+if (0)
+{
+ ANALYZE TABLE t1;
+ SELECT n_rows, clustered_index_size, sum_of_other_index_sizes
+ FROM mysql.innodb_table_stats;
+
+ # SELECT * FROM mysql.innodb_index_stats;
+ # idx_col_int3_int0 n_diff_pfx01 1 col_int3
+ # idx_col_int3_int0 n_diff_pfx02 10000 col_int3,col_int0
+ # idx_col_int3_int0 n_diff_pfx03 10000 col_int3,col_int0,DB_ROW_ID
+ # idx_col_int3_int0 n_leaf_pages 19 Number of leaf pages in the index
+ # idx_col_int3_int0 size 20 Number of pages in the index
+
+ --vertical_results
+ SELECT t1.index_name, t1.stat_value AS idx_pages, t2.stat_value AS idx_leaf_pages,
+ (t1.stat_value - t2.stat_value - 1) / t1.stat_value AS sx_page_ratio
+ FROM mysql.innodb_index_stats t1, mysql.innodb_index_stats t2
+ WHERE t1.index_name = t2.index_name
+ AND t1.stat_name = 'size' AND t2.stat_name = 'n_leaf_pages'
+ ORDER BY t1.index_name;
+ --horizontal_results
+}
+
+--echo # TC-11 Several concurrent sessions perform updates in t1 like mad.
+--echo # The system MUST survive this.
+--echo # Printing of statements is partially suppressed.
+SET @start_time = UNIX_TIMESTAMP();
+SELECT 1 FROM t1 WHERE col_int0 = @t1_half FOR UPDATE;
+SELECT GET_LOCK('Blocker', 1000) ;
+--disable_query_log
+let $num= $max_con;
+while ($num)
+{
+ --connect (con$num,localhost,root,,)
+ USE my_schema;
+ # The second parameter of the procedure is size of the affected stripe / 2.
+ # A smaller stripe causes some smaller counter growth but most probably
+ # also more stress around locking in general.
+ # Example # (nnnn) = half stripe size
+ # NAME | COUNT_RESET (5000) | COUNT_RESET (100)
+ # -----------------------------+--------------------+----------------
+ # innodb_rwlock_sx_os_waits | 1412 | 486
+ # innodb_rwlock_sx_spin_rounds | 44061 | 17031
+ # innodb_rwlock_sx_spin_waits | 996 | 515
+ --send
+ eval CALL proc_dml($high_load_duration,@t1_half);
+ dec $num;
+}
+--connection default
+SELECT RELEASE_LOCK('Blocker') ;
+--sleep 3
+COMMIT;
+let $num= $max_con;
+while ($num)
+{
+ --connection con$num
+ --reap
+ dec $num;
+}
+--echo # pass
+--connection default
+--enable_query_log
+
+# let $wait_timeout= 181;
+# --source include/wait_condition.inc
+# eval $after_my_metrics;
+--disable_result_log
+if($test_debug)
+{
+ --enable_result_log
+ SELECT UNIX_TIMESTAMP() - @start_time AS update_battle_run_time;
+ eval $print_metrics;
+}
+SHOW ENGINE INNODB STATUS;
+--enable_result_log
+
+--echo # TC-13 One session performs ALTER TABLE t1 ADD KEY ... on the fat table t1.
+--echo # The system MUST survive this.
+SET @start_time = UNIX_TIMESTAMP();
+ALTER TABLE t1 ADD KEY idx_col_char4_col_char0 (col_char4,col_char0);
+--disable_result_log
+if($test_debug)
+{
+ --enable_result_log
+ SELECT UNIX_TIMESTAMP() - @start_time AS add_key_run_time;
+ eval $print_metrics;
+}
+SHOW ENGINE INNODB STATUS;
+--enable_result_log
+--echo # pass
+
+--echo # TC-15 One session performs a fat update on the fat table t1.
+--echo # The system MUST survive this.
+SET @start_time = UNIX_TIMESTAMP();
+SET @extra_int = 13;
+SET @extra_string = f_thread_id(@extra_int);
+eval UPDATE t1 SET
+ col_int1 = f_col_int1(col_int0), col_int2 = f_col_int2(col_int0),
+ col_int3 = f_col_int3(col_int0), col_blob = f_col_blob(col_int0),
+ col_char0 = f_col_char0(col_int0), col_char1 = f_col_char1(col_int0),
+ col_char2 = f_col_char2(col_int0), col_char3 = f_col_char3(col_int0),
+ col_char4 = f_col_char4(col_int0)
+WHERE col_int0 BETWEEN @t1_half - 2500 AND @t1_half + 2500;
+COMMIT;
+--disable_result_log
+if($test_debug)
+{
+ --enable_result_log
+ SELECT UNIX_TIMESTAMP() - @start_time AS total_update_run_time;
+ eval $print_metrics;
+}
+SHOW ENGINE INNODB STATUS;
+--enable_result_log
+--echo # pass
+
+# Basically every of the big activities causes some counter growth.
+# But caused by
+# - the architecture of InnoDB (certain things happen asynchronous)
+# - the actual test configuration (server/InnoDB options)
+# - conditions like parallel (./mtr --parallel=auto?) load on the testing box
+# this might be not fulfilled per single big activity every time except
+# we go with huge waits or similar.
+# Observation:
+# - non debug binaries: expectation frequent not fulfilled
+# - debug binaries: expectation rare not fulfilled
+#
+let $wait_timeout= 121;
+let $wait_condition=
+SELECT COUNT(*) = @sx_count
+FROM information_schema.innodb_metrics t_after
+JOIN my_metrics t_before
+ON t_after.COUNT_RESET > t_before.COUNT_RESET AND t_after.NAME = t_before.NAME;
+--source include/wait_condition.inc
+eval $after_my_metrics;
+
+--echo # TC-16 The following activities happend after reset in innodb_metrics
+--echo # - Insert some significant amount of rows into t1.
+--echo # - Several concurrent users perform excessive updates in t1.
+--echo # - ALTER TABLE ... ADD KEY <sufficient big enough structure>
+--echo # - One UPDATE statement modifying a huge slice of t1.
+--echo # Any of them causes heavy use of SX lock and therefore COUNT_RESET
+--echo # must have grown for ALL = @sx_count entries.
+# The former testcases TC-10 and TC12 had to be made a part of this testcase
+# because their results were unstable.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics t_after JOIN my_metrics t_before
+ON t_after.COUNT_RESET > t_before.COUNT_RESET AND t_after.NAME = t_before.NAME
+WHERE t_after.phase = 'after' AND t_before.phase = 'before';
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT * FROM my_metrics
+ ORDER BY NAME, phase;
+ exit;
+}
+--echo # pass
+
+--echo # TC-09 Heavy activity after reset.
+--echo # COUNT_RESET = MAX_COUNT_RESET for ALL = @sx_count entries
+--echo # needs to stay valid though he counters will have grown.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics
+WHERE phase = 'after' AND COUNT_RESET = MAX_COUNT_RESET;
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT * FROM my_metrics
+ ORDER BY NAME, phase;
+ exit;
+}
+--echo # pass
+
+eval $empty_my_metrics;
+eval $before_my_metrics;
+SET GLOBAL innodb_monitor_reset = "innodb_rwlock_sx_%";
+eval $after_my_metrics;
+--echo # TC-08 There was a reset. COUNT_RESET = MAX_COUNT_RESET for ALL
+--echo # = @sx_count entries.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics
+WHERE phase = 'before' AND COUNT_RESET = MAX_COUNT_RESET;
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT * FROM my_metrics
+ ORDER BY NAME, phase;
+ exit;
+}
+--echo # pass
+
+--echo # TC-17 We had heavy activity causing big counters and after that a reset.
+--echo # Reset causes COUNT > COUNT_RESET AND MAX_COUNT > MAX_COUNT_RESET
+--echo # for ALL @sx_count entries.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics
+WHERE phase = 'after'
+ AND COUNT > COUNT_RESET
+ AND MAX_COUNT > MAX_COUNT_RESET;
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT * FROM my_metrics
+ ORDER BY NAME, phase;
+ exit;
+}
+--echo # pass
+
+--echo # TC-18 We had some reset but this must not decrease COUNT or MAX_COUNT
+--echo # after.COUNT >= before.COUNT AND
+--echo # after.MAX_COUNT >= before.MAX_COUNT for ALL @sx_count entries.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics t_after JOIN my_metrics t_before
+ON t_after.COUNT >= t_before.COUNT AND t_after.MAX_COUNT >= t_before.MAX_COUNT
+ AND t_after.NAME = t_before.NAME
+WHERE t_after.phase = 'after' AND t_before.phase = 'before';
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT * FROM my_metrics
+ ORDER BY NAME, phase;
+ exit;
+}
+--echo # pass
+
+--echo # TC-19 We had some reset after heavy activity and this must cause
+--echo # after.COUNT_RESET < before.COUNT_RESET
+--echo # AND after.MAX_COUNT_RESET < before.MAX_COUNT_RESET AND
+--echo # for ALL @sx_count entries.
+let $check_statement=
+SELECT COUNT(*) <> @sx_count FROM my_metrics t_after JOIN my_metrics t_before
+ON t_after.COUNT_RESET < t_before.COUNT_RESET
+ AND t_after.MAX_COUNT_RESET < t_before.MAX_COUNT_RESET
+ AND t_after.NAME = t_before.NAME
+WHERE t_after.phase = 'after' AND t_before.phase = 'before';
+if(`$check_statement`)
+{
+ --echo # fail
+ eval $check_statement;
+ SELECT * FROM my_metrics
+ ORDER BY NAME, phase;
+ exit;
+}
+--echo # pass
+
+# Cleanup
+let $num= $max_con;
+while ($num)
+{
+ --connection con$num
+ --disconnect con$num
+ --source include/wait_until_disconnected.inc
+ dec $num;
+}
+--connection default
+USE test;
+DROP SCHEMA my_schema;
+SET GLOBAL innodb_monitor_disable = all;
+SET GLOBAL innodb_monitor_reset_all = all;
+--disable_warnings
+SET GLOBAL innodb_monitor_enable = default;
+SET GLOBAL innodb_monitor_disable = default;
+SET GLOBAL innodb_monitor_reset = default;
+SET GLOBAL innodb_monitor_reset_all = default;
+--enable_warnings
+SET GLOBAL innodb_monitor_disable = "innodb_rwlock_sx_%";
+SET GLOBAL innodb_monitor_reset = "innodb_rwlock_sx_%";
+
diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test
index 12d8b877d05..be79d7437c3 100644
--- a/mysql-test/suite/innodb/t/instant_alter.test
+++ b/mysql-test/suite/innodb/t/instant_alter.test
@@ -396,6 +396,18 @@ DELETE FROM t1;
CHECK TABLE t1;
DROP TABLE t1;
+# MDEV-21172 Memory leak during ADD PRIMARY KEY
+
+SET innodb_strict_mode = ON;
+eval CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) $engine;
+ALTER TABLE t1 ADD d TEXT;
+--error 0,ER_TOO_BIG_ROWSIZE
+ALTER TABLE t1 ADD PRIMARY KEY (b,a);
+# Exploit MDEV-17468 to force the table definition to be reloaded
+ALTER TABLE t1 ADD va INT AS (a) VIRTUAL;
+DROP TABLE t1;
+SET innodb_strict_mode = OFF;
+
dec $format;
let $redundant_4k= 0;
}
diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test
index 0edbb672584..a2626ba34a1 100644
--- a/mysql-test/suite/innodb/t/instant_alter_bugs.test
+++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test
@@ -169,3 +169,5 @@ ALTER TABLE t2
CHANGE b d INT UNSIGNED,
ADD c INT;
DROP TABLE t2, t1;
+
+--echo # End of 10.3 tests
diff --git a/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test b/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test
index 9ff01739f60..f1d1537237e 100644
--- a/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test
+++ b/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test
@@ -33,8 +33,8 @@ while ($i)
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" > $_expect_file_name
-set debug_dbug = '+d,increase_mtr_checkpoint_size';
-set debug_dbug = '+d,crash_after_checkpoint';
+SET debug_dbug = '+d,increase_mtr_checkpoint_size';
+SET debug_dbug = '+d,crash_after_checkpoint';
--error 2013
set global innodb_log_checkpoint_now = 1;
@@ -64,7 +64,7 @@ while ($i)
--enable_query_log
--exec echo "wait" > $_expect_file_name
-set debug_dbug = '+d,crash_after_checkpoint';
+SET debug_dbug = '+d,crash_after_checkpoint';
--error 2013
set global innodb_log_checkpoint_now = 1;
diff --git a/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test b/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test
new file mode 100644
index 00000000000..af6c15e0e6b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test
@@ -0,0 +1,32 @@
+--source include/have_innodb.inc
+
+call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
+
+SET innodb_strict_mode = 0;
+SET @@global.log_warnings = 3;
+
+CREATE TABLE t1 (
+ col_1 TEXT
+ ,col_2 TEXT
+ ,col_3 TEXT
+ ,col_4 TEXT
+ ,col_5 TEXT
+ ,col_6 TEXT
+ ,col_7 TEXT
+ ,col_8 TEXT
+ ,col_9 TEXT
+ ,col_10 TEXT
+ ,col_11 TEXT
+) ENGINE=INNODB ROW_FORMAT=COMPACT;
+--enable_warnings
+TRUNCATE TABLE t1;
+OPTIMIZE TABLE t1;
+ALTER TABLE t1 FORCE;
+SET innodb_strict_mode = ON;
+TRUNCATE TABLE t1;
+OPTIMIZE TABLE t1;
+ALTER TABLE t1 FORCE;
+DROP TABLE t1;
+--disable_warnings
+
+SET @@global.log_warnings = 2;
diff --git a/mysql-test/suite/innodb/t/undo_log.test b/mysql-test/suite/innodb/t/undo_log.test
index 94322868b06..150d50c2e75 100644
--- a/mysql-test/suite/innodb/t/undo_log.test
+++ b/mysql-test/suite/innodb/t/undo_log.test
@@ -1,7 +1,5 @@
--source include/have_innodb.inc
-call mtr.add_suppression("Cannot add field `b_str_20` in table `test`.`test_tab` because after adding it, the row size is");
-
SET innodb_strict_mode=OFF;
CREATE TABLE test_tab (
a_str_18 mediumtext,
diff --git a/mysql-test/suite/innodb_fts/r/concurrent_insert.result b/mysql-test/suite/innodb_fts/r/concurrent_insert.result
index 9871d43119a..e91ea02b1de 100644
--- a/mysql-test/suite/innodb_fts/r/concurrent_insert.result
+++ b/mysql-test/suite/innodb_fts/r/concurrent_insert.result
@@ -17,6 +17,7 @@ INSERT INTO t1 VALUES('test');
CREATE TABLE t2 (f1 char(100), FULLTEXT idx1(f1))ENGINE=InnoDB;
INSERT INTO t2 VALUES('mariadb');
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug ='+d,fts_instrument_sync_request,ib_optimize_wq_hang';
SET DEBUG_SYNC= 'fts_instrument_sync_request
SIGNAL drop_index_start WAIT_FOR sync_op';
@@ -28,7 +29,7 @@ ALTER TABLE t2 drop index idx1;
connection default;
set DEBUG_SYNC= 'now SIGNAL fts_drop_index';
connection con1;
-SET global DEBUG_DBUG=RESET;
drop table t1, t2;
connection default;
set DEBUG_SYNC=RESET;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/innodb_fts/r/misc_debug.result b/mysql-test/suite/innodb_fts/r/misc_debug.result
index 3a156049fe2..f1110797f33 100644
--- a/mysql-test/suite/innodb_fts/r/misc_debug.result
+++ b/mysql-test/suite/innodb_fts/r/misc_debug.result
@@ -17,3 +17,12 @@ ALTER TABLE t ADD FULLTEXT INDEX (b(64));
ERROR HY000: Unknown error
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t;
+CREATE TABLE t1 (pk INT, a VARCHAR(8), PRIMARY KEY(pk),
+FULLTEXT KEY(a)) ENGINE=InnoDB;
+CREATE TABLE t2 (b INT, FOREIGN KEY(b) REFERENCES t1(pk)) ENGINE=InnoDB;
+DROP TABLE t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+SET DEBUG_DBUG="+d,fts_instrument_sync";
+INSERT INTO t1 VALUES(1, "mariadb");
+ALTER TABLE t1 FORCE;
+DROP TABLE t2, t1;
diff --git a/mysql-test/suite/innodb_fts/r/misc_debug2.result b/mysql-test/suite/innodb_fts/r/misc_debug2.result
new file mode 100644
index 00000000000..b3bc12f92cc
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/r/misc_debug2.result
@@ -0,0 +1,7 @@
+call mtr.add_suppression("InnoDB: Table '.*' tablespace is set as discarded.");
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+CREATE TABLE mdev21563(f1 VARCHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
+set debug_dbug="+d,fts_instrument_sync_request";
+INSERT INTO mdev21563 VALUES('This is a test');
+ALTER TABLE mdev21563 DISCARD TABLESPACE;
+DROP TABLE mdev21563;
diff --git a/mysql-test/suite/innodb_fts/r/sync_block.result b/mysql-test/suite/innodb_fts/r/sync_block.result
index f9f695c42f4..65bee127e80 100644
--- a/mysql-test/suite/innodb_fts/r/sync_block.result
+++ b/mysql-test/suite/innodb_fts/r/sync_block.result
@@ -39,7 +39,7 @@ SLEEP(2)
SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
sql_text
INSERT INTO t1(title) VALUES('mysql database')
-SET GLOBAL debug_dbug = @old_debug_dbug;
+SET GLOBAL debug_dbug = @old_debug;
TRUNCATE TABLE mysql.slow_log;
DROP TABLE t1;
# Case 2: Sync blocks DML(insert) on other tables.
@@ -71,7 +71,7 @@ SLEEP(2)
# slow log results should be empty here.
SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
sql_text
-SET GLOBAL debug_dbug = @old_debug_dbug;
+SET GLOBAL debug_dbug = @old_debug;
TRUNCATE TABLE mysql.slow_log;
DROP TABLE t1,t2;
disconnect con1;
diff --git a/mysql-test/suite/innodb_fts/t/concurrent_insert.test b/mysql-test/suite/innodb_fts/t/concurrent_insert.test
index 77097d44dc5..35debd87cea 100644
--- a/mysql-test/suite/innodb_fts/t/concurrent_insert.test
+++ b/mysql-test/suite/innodb_fts/t/concurrent_insert.test
@@ -29,6 +29,7 @@ CREATE TABLE t2 (f1 char(100), FULLTEXT idx1(f1))ENGINE=InnoDB;
INSERT INTO t2 VALUES('mariadb');
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug ='+d,fts_instrument_sync_request,ib_optimize_wq_hang';
SET DEBUG_SYNC= 'fts_instrument_sync_request
SIGNAL drop_index_start WAIT_FOR sync_op';
@@ -45,7 +46,7 @@ set DEBUG_SYNC= 'now SIGNAL fts_drop_index';
connection con1;
reap;
-SET global DEBUG_DBUG=RESET;
drop table t1, t2;
connection default;
set DEBUG_SYNC=RESET;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/innodb_fts/t/misc_debug.test b/mysql-test/suite/innodb_fts/t/misc_debug.test
index 4b32afb848c..aaf628abe6d 100644
--- a/mysql-test/suite/innodb_fts/t/misc_debug.test
+++ b/mysql-test/suite/innodb_fts/t/misc_debug.test
@@ -39,3 +39,16 @@ ALTER TABLE t ADD FULLTEXT INDEX (b(64));
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t;
+
+# MDEV-21550 Assertion `!table->fts->in_queue' failed in
+# fts_optimize_remove_table
+CREATE TABLE t1 (pk INT, a VARCHAR(8), PRIMARY KEY(pk),
+ FULLTEXT KEY(a)) ENGINE=InnoDB;
+CREATE TABLE t2 (b INT, FOREIGN KEY(b) REFERENCES t1(pk)) ENGINE=InnoDB;
+--error ER_ROW_IS_REFERENCED_2
+DROP TABLE t1;
+SET DEBUG_DBUG="+d,fts_instrument_sync";
+INSERT INTO t1 VALUES(1, "mariadb");
+ALTER TABLE t1 FORCE;
+# Cleanup
+DROP TABLE t2, t1;
diff --git a/mysql-test/suite/innodb_fts/t/misc_debug2.test b/mysql-test/suite/innodb_fts/t/misc_debug2.test
new file mode 100644
index 00000000000..0a9e137dd80
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/misc_debug2.test
@@ -0,0 +1,12 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/not_embedded.inc
+call mtr.add_suppression("InnoDB: Table '.*' tablespace is set as discarded.");
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+
+CREATE TABLE mdev21563(f1 VARCHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
+set debug_dbug="+d,fts_instrument_sync_request";
+INSERT INTO mdev21563 VALUES('This is a test');
+ALTER TABLE mdev21563 DISCARD TABLESPACE;
+--source include/restart_mysqld.inc
+DROP TABLE mdev21563;
diff --git a/mysql-test/suite/innodb_fts/t/sync_block.test b/mysql-test/suite/innodb_fts/t/sync_block.test
index 1dd3c2bc38e..895d2ba8a59 100644
--- a/mysql-test/suite/innodb_fts/t/sync_block.test
+++ b/mysql-test/suite/innodb_fts/t/sync_block.test
@@ -61,7 +61,7 @@ SELECT SLEEP(2);
-- echo # slow log results should only contain INSERT INTO t1.
SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
-SET GLOBAL debug_dbug = @old_debug_dbug;
+SET GLOBAL debug_dbug = @old_debug;
TRUNCATE TABLE mysql.slow_log;
DROP TABLE t1;
@@ -107,7 +107,7 @@ SELECT SLEEP(2);
-- echo # slow log results should be empty here.
SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
-SET GLOBAL debug_dbug = @old_debug_dbug;
+SET GLOBAL debug_dbug = @old_debug;
TRUNCATE TABLE mysql.slow_log;
DROP TABLE t1,t2;
diff --git a/mysql-test/suite/innodb_gis/r/rtree_debug.result b/mysql-test/suite/innodb_gis/r/rtree_debug.result
index 11e2cd40e25..e8d2418af57 100644
--- a/mysql-test/suite/innodb_gis/r/rtree_debug.result
+++ b/mysql-test/suite/innodb_gis/r/rtree_debug.result
@@ -42,7 +42,7 @@ SET @save_dbug = @@SESSION.debug_dbug;
SET debug_dbug='+d,row_merge_ins_spatial_fail';
create spatial index idx2 on t1(c2);
ERROR HY000: Got error 1000 "Unknown error 1000" from storage engine InnoDB
-SET debug_dbug = @save_dbug;
+SET @@SESSION.debug_dbug = @save_dbug;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/innodb_gis/t/rtree_debug.test b/mysql-test/suite/innodb_gis/t/rtree_debug.test
index 2f7c2806c68..580f3cf48a1 100644
--- a/mysql-test/suite/innodb_gis/t/rtree_debug.test
+++ b/mysql-test/suite/innodb_gis/t/rtree_debug.test
@@ -53,7 +53,7 @@ SET @save_dbug = @@SESSION.debug_dbug;
SET debug_dbug='+d,row_merge_ins_spatial_fail';
--error ER_GET_ERRNO
create spatial index idx2 on t1(c2);
-SET debug_dbug = @save_dbug;
+SET @@SESSION.debug_dbug = @save_dbug;
show create table t1;
# Check table.
diff --git a/mysql-test/suite/innodb_gis/t/rtree_rollback1.test b/mysql-test/suite/innodb_gis/t/rtree_rollback1.test
index 123bccf76a1..3dea75bc026 100644
--- a/mysql-test/suite/innodb_gis/t/rtree_rollback1.test
+++ b/mysql-test/suite/innodb_gis/t/rtree_rollback1.test
@@ -1,9 +1,6 @@
# WL#6745 InnoDB R-tree support
# This test case will test R-tree split.
-# Not supported in embedded
---source include/not_embedded.inc
-
--source include/have_innodb.inc
--source include/big_test.inc
--source include/not_valgrind.inc
diff --git a/mysql-test/suite/innodb_gis/t/rtree_rollback2.test b/mysql-test/suite/innodb_gis/t/rtree_rollback2.test
index cddbaf5592d..78b251bd696 100644
--- a/mysql-test/suite/innodb_gis/t/rtree_rollback2.test
+++ b/mysql-test/suite/innodb_gis/t/rtree_rollback2.test
@@ -1,9 +1,6 @@
# WL#6745 InnoDB R-tree support
# This test case will test R-tree split.
-# Not supported in embedded
---source include/not_embedded.inc
-
--source include/have_innodb.inc
--source include/big_test.inc
--source include/not_valgrind.inc
diff --git a/mysql-test/suite/innodb_zip/r/cmp_per_index.result b/mysql-test/suite/innodb_zip/r/cmp_per_index.result
index 7b27fa722b9..b4e34040630 100644
--- a/mysql-test/suite/innodb_zip/r/cmp_per_index.result
+++ b/mysql-test/suite/innodb_zip/r/cmp_per_index.result
@@ -1,5 +1,4 @@
-SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
-SET GLOBAL innodb_fast_shutdown=0;
+SET @save_enabled= @@GLOBAL.innodb_cmp_per_index_enabled;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
SELECT * FROM information_schema.innodb_cmp_per_index;
CREATE TABLE t (
@@ -72,33 +71,5 @@ index_name PRIMARY
compress_ops 65
compress_ops_ok 65
uncompress_ops 0
-SHOW CREATE TABLE t;
-Table t
-Create Table CREATE TABLE `t` (
- `a` int(11) NOT NULL,
- `b` varchar(512) DEFAULT NULL,
- `c` varchar(16) DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2
-SET GLOBAL innodb_cmp_per_index_enabled=ON;
-SELECT COUNT(*) FROM t IGNORE INDEX(b);
-COUNT(*) 128
-SELECT
-database_name,
-table_name,
-index_name,
-compress_ops,
-compress_ops_ok,
-CASE WHEN uncompress_ops=6 and @@innodb_compression_level IN (4,8,9) THEN 9
-ELSE uncompress_ops END as uncompress_ops
-FROM information_schema.innodb_cmp_per_index
-ORDER BY 1, 2, 3;
-database_name test
-table_name t
-index_name PRIMARY
-compress_ops 0
-compress_ops_ok 0
-uncompress_ops 4
DROP TABLE t;
-SET GLOBAL innodb_cmp_per_index_enabled=default;
+SET GLOBAL innodb_cmp_per_index_enabled=@save_enabled;
diff --git a/mysql-test/suite/innodb_zip/r/wl5522_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_zip.result
index f57e2191d9f..a8e06835d85 100644
--- a/mysql-test/suite/innodb_zip/r/wl5522_zip.result
+++ b/mysql-test/suite/innodb_zip/r/wl5522_zip.result
@@ -410,7 +410,7 @@ SELECT * FROM t1;
ERROR HY000: Tablespace has been discarded for table `t1`
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Column c2 precise type mismatch.)
+ERROR HY000: Schema mismatch (Column c2 precise type mismatch, it's 0X408 in the table and 0X403 in the tablespace meta file)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_zip/t/cmp_per_index.test b/mysql-test/suite/innodb_zip/t/cmp_per_index.test
index 15f5b2de6e4..74ed17b1213 100644
--- a/mysql-test/suite/innodb_zip/t/cmp_per_index.test
+++ b/mysql-test/suite/innodb_zip/t/cmp_per_index.test
@@ -19,12 +19,9 @@ if (`SELECT @@innodb_log_compressed_pages = 0`)
# include/restart_mysqld.inc does not work in embedded mode
-- source include/not_embedded.inc
-# ensure that all history gets purged on shutdown
-SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
-SET GLOBAL innodb_fast_shutdown=0;
-
-- vertical_results
+SET @save_enabled= @@GLOBAL.innodb_cmp_per_index_enabled;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
# reset any leftover stats from previous tests
@@ -96,29 +93,6 @@ ELSE compress_ops_ok END as compress_ops_ok,
uncompress_ops
FROM information_schema.innodb_cmp_per_index
ORDER BY 1, 2, 3;
-
-# restart mysqld and see that uncompress ops also gets increased when
-# selecting from the table again
-
--- source include/restart_mysqld.inc
-
-SHOW CREATE TABLE t;
-
-SET GLOBAL innodb_cmp_per_index_enabled=ON;
-
-SELECT COUNT(*) FROM t IGNORE INDEX(b);
-
-SELECT
-database_name,
-table_name,
-index_name,
-compress_ops,
-compress_ops_ok,
-CASE WHEN uncompress_ops=6 and @@innodb_compression_level IN (4,8,9) THEN 9
-ELSE uncompress_ops END as uncompress_ops
-FROM information_schema.innodb_cmp_per_index
-ORDER BY 1, 2, 3;
-
DROP TABLE t;
-SET GLOBAL innodb_cmp_per_index_enabled=default;
+SET GLOBAL innodb_cmp_per_index_enabled=@save_enabled;
diff --git a/mysql-test/suite/maria/aria_pack_mdev14183.result b/mysql-test/suite/maria/aria_pack_mdev14183.result
new file mode 100644
index 00000000000..b20f60c5b8a
--- /dev/null
+++ b/mysql-test/suite/maria/aria_pack_mdev14183.result
@@ -0,0 +1,22 @@
+CREATE TABLE `t` (
+`col_1` varchar(255) NOT NULL DEFAULT '',
+`col_2` varchar(255) NOT NULL,
+`col_3` int(11) NOT NULL DEFAULT '0',
+`col_4` int(11) NOT NULL DEFAULT '0'
+) ENGINE=Aria TRANSACTIONAL=0 PAGE_CHECKSUM=0;
+insert into t values
+('foobar','qux',0,0),('abcdef','qux',0,0);
+Compressing test/t.MAD: (2 records)
+- Calculating statistics
+
+normal: 0 empty-space: 0 empty-zero: 0 empty-fill: 0
+pre-space: 0 end-space: 0 intervall-fields: 0 zero: 2
+Original trees: 4 After join: 1
+- Compressing file
+Min record length: 5 Max length: 5 Mean total length: 35
+99.57%
+SELECT * FROM t;
+col_1 col_2 col_3 col_4
+foobar qux 0 0
+abcdef qux 0 0
+DROP TABLE t;
diff --git a/mysql-test/suite/maria/aria_pack_mdev14183.test b/mysql-test/suite/maria/aria_pack_mdev14183.test
new file mode 100644
index 00000000000..5386ae774a0
--- /dev/null
+++ b/mysql-test/suite/maria/aria_pack_mdev14183.test
@@ -0,0 +1,23 @@
+--source include/have_aria.inc
+--source include/have_debug.inc
+--source include/not_embedded.inc
+
+CREATE TABLE `t` (
+ `col_1` varchar(255) NOT NULL DEFAULT '',
+ `col_2` varchar(255) NOT NULL,
+ `col_3` int(11) NOT NULL DEFAULT '0',
+ `col_4` int(11) NOT NULL DEFAULT '0'
+) ENGINE=Aria TRANSACTIONAL=0 PAGE_CHECKSUM=0;
+
+insert into t values
+ ('foobar','qux',0,0),('abcdef','qux',0,0);
+
+--let $datadir= `SELECT @@datadir`
+--source include/shutdown_mysqld.inc
+# maria_pack crashes by assert() if the bug is not fixed
+--exec cd $datadir && $MARIA_PACK -t test/t
+
+--source include/start_mysqld.inc
+SELECT * FROM t;
+
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/incremental_backup.result b/mysql-test/suite/mariabackup/incremental_backup.result
index cc7277bdde9..70cc2cf8c4a 100644
--- a/mysql-test/suite/mariabackup/incremental_backup.result
+++ b/mysql-test/suite/mariabackup/incremental_backup.result
@@ -1,4 +1,5 @@
call mtr.add_suppression("InnoDB: New log files created");
+CREATE TABLE t_aria(i INT) ENGINE ARIA;
CREATE TABLE t(i INT PRIMARY KEY) ENGINE INNODB;
BEGIN;
INSERT INTO t VALUES(2);
@@ -11,11 +12,13 @@ INSERT INTO t VALUES(0);
DELETE FROM t WHERE i=0;
connection default;
COMMIT;
+# Generate enough aria log records to increase area log file size
SELECT * FROM t;
i
1
2
# Prepare full backup, apply incremental one
+# Aria log file was updated during applying incremental backup
disconnect con1;
# Restore and check results
# shutdown server
@@ -27,3 +30,4 @@ i
1
2
DROP TABLE t;
+DROP TABLE t_aria;
diff --git a/mysql-test/suite/mariabackup/incremental_backup.test b/mysql-test/suite/mariabackup/incremental_backup.test
index 8fbfa701999..3e877af1398 100644
--- a/mysql-test/suite/mariabackup/incremental_backup.test
+++ b/mysql-test/suite/mariabackup/incremental_backup.test
@@ -1,10 +1,12 @@
+--source include/have_aria.inc
--source include/innodb_page_size.inc
call mtr.add_suppression("InnoDB: New log files created");
-let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
-let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
+let basedir=$MYSQLTEST_VARDIR/tmp/backup;
+let incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
+CREATE TABLE t_aria(i INT) ENGINE ARIA;
CREATE TABLE t(i INT PRIMARY KEY) ENGINE INNODB;
BEGIN;
INSERT INTO t VALUES(2);
@@ -14,21 +16,73 @@ INSERT INTO t VALUES(1);
echo # Create full backup , modify table, then create incremental/differential backup;
--disable_result_log
-exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$basedir;
--enable_result_log
BEGIN;
INSERT INTO t VALUES(0);
DELETE FROM t WHERE i=0;
connection default;
COMMIT;
+
+--echo # Generate enough aria log records to increase area log file size
+--disable_query_log
+--disable_result_log
+INSERT INTO t_aria VALUES
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+--let $i = 4
+while ($i) {
+INSERT INTO t_aria SELECT * FROM seq_1_to_2000;
+--dec $i
+}
+--enable_query_log
+--enable_result_log
+
SELECT * FROM t;
-exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir;
+# wf_incremental_init() allocates (page_size/4)*page_size bytes with mmap()
+# in each data file copy thread, what can fail on 32-bit platforms if threads
+# are too much, that's why don't set too big --parallel option value.
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=2 --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir;
--disable_result_log
echo # Prepare full backup, apply incremental one;
exec $XTRABACKUP --prepare --target-dir=$basedir;
exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir ;
+let perl_result_file=$MYSQLTEST_VARDIR/tmp/check_file_size_result.inc;
+
+--perl END_OF_FILE
+ use strict;
+ use warnings;
+
+ my $dst_file = "$ENV{'basedir'}/aria_log.00000001";
+ my $src_file = "$ENV{'incremental_dir'}/aria_log.00000001";
+ my $out_file = $ENV{'perl_result_file'};
+
+ my $dst_size = -s $dst_file;
+ my $src_size = -s $src_file;
+
+ open (my $output, '>', $out_file) or die $!;
+ if ($dst_size >= $src_size) {
+ print $output '--echo # Aria log file was updated during applying incremental backup'."\n";
+ }
+ else {
+ print $output '--echo # Aria log file was NOT updated during applying incremental backup'."\n";
+ }
+ close $output;
+END_OF_FILE
+
+--source $perl_result_file
+--remove_file $perl_result_file
+
disconnect con1;
echo # Restore and check results;
let $targetdir=$basedir;
@@ -37,6 +91,7 @@ let $targetdir=$basedir;
SELECT * FROM t;
DROP TABLE t;
+DROP TABLE t_aria;
# Cleanup
rmdir $basedir;
diff --git a/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.opt b/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.opt
new file mode 100644
index 00000000000..7111d384b40
--- /dev/null
+++ b/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.opt
@@ -0,0 +1 @@
+--loose-innodb-log-file-size=1048576 --loose-innodb-log-files-in-group=2
diff --git a/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.result b/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.result
new file mode 100644
index 00000000000..29abe038afe
--- /dev/null
+++ b/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.result
@@ -0,0 +1,2 @@
+CREATE TABLE t(i INT) ENGINE=INNODB;
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.test b/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.test
new file mode 100644
index 00000000000..22165ff29be
--- /dev/null
+++ b/mysql-test/suite/mariabackup/innodb_redo_log_overwrite.test
@@ -0,0 +1,20 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_sequence.inc
+
+CREATE TABLE t(i INT) ENGINE=INNODB;
+
+--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
+
+# Generate enough redo log records to make at least one loop in log group
+--let before_innodb_log_copy_thread_started=INSERT INTO test.t SELECT * from test.seq_1_to_102400
+
+--disable_result_log
+# mariabackup must exit with error instead of hanging
+--error 1
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events;
+--enable_result_log
+
+DROP TABLE t;
+--rmdir $targetdir
+
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug36981.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug36981.result
index 760d7342752..a0be9e23818 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug36981.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug36981.result
@@ -1,3 +1,4 @@
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
create table `t1` (`c1` char(1) default null,`c2` char(10) default null,
key (`c1`))
@@ -7,3 +8,4 @@ select * from `t1` where `c1`='3' for update;
c1 c2
3 NULL
drop table `t1`;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug40992.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug40992.result
index 5e53649c538..59ab7607a40 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug40992.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug40992.result
@@ -1,6 +1,7 @@
#
# Bug#40992 - InnoDB: Crash when engine_condition_pushdown is on
#
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
CREATE TABLE t (
dummy INT PRIMARY KEY,
@@ -13,3 +14,4 @@ dummy a b
3 3 3
5 5 5
DROP TABLE t;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug41996.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug41996.result
index 31e39d4421d..acc18b06ea0 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug41996.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug41996.result
@@ -1,3 +1,4 @@
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
drop table if exists `t1`;
Warnings:
@@ -6,3 +7,4 @@ create table `t1` (`c` bigint, key(`c`),`a` int)engine=innodb;
insert into `t1` values(2,2);
delete `t1` from `t1` `a`, `t1` where `a`.`a`=`t1`.`c` ;
drop table `t1`;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result
index e4fdf0d03a7..f5554563a18 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result
@@ -1,3 +1,4 @@
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -252,3 +253,4 @@ Warning 1292 Truncated incorrect DOUBLE value: 'd'
Warning 1292 Truncated incorrect DOUBLE value: 'd'
Warning 1292 Truncated incorrect DOUBLE value: 'd'
drop table `table5`;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43249.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43249.result
index 0cd801280c8..f6f5cd7c6fd 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43249.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43249.result
@@ -1,3 +1,4 @@
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NULL, c3 DATE, PRIMARY
KEY(c1), UNIQUE INDEX(c2)) engine=innodb;
@@ -9,3 +10,4 @@ SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c2 LIMIT 2;
c1 c2 c3
08:29:45 NULL 2009-02-01
drop table `t1`;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43360.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43360.result
index 899bf04e635..7e838906114 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43360.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43360.result
@@ -1,6 +1,7 @@
#
# Bug#43360 - Server crash with a simple multi-table update
#
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
CREATE TABLE t1 (
a CHAR(2) NOT NULL PRIMARY KEY,
@@ -42,3 +43,4 @@ AB Sweden
MS United States of Ame
JA USA
DROP TABLE t1,t2;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43448.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43448.result
index a8f56923386..9b7a2c459c3 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43448.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43448.result
@@ -1,6 +1,7 @@
#
# Bug#43448 - Server crashes on multi table delete with Innodb
#
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
CREATE TABLE t1 (
id1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -28,3 +29,4 @@ DELETE t1, t2, t3
FROM t1, t2, t3
WHERE t1.id1 = t2.id2 AND t2.id2 = t3.id3 AND t1.id1 > 5;
DROP TABLE t1, t2, t3;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result
index 0d88ff3d2cb..11f915aaf8e 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result
@@ -1,6 +1,7 @@
set storage_engine=innodb;
set @save_time_zone= @@time_zone;
set time_zone='+03:00';
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
CREATE TABLE t1(c1 TIMESTAMP NOT NULL, c2 TIMESTAMP NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1), UNIQUE INDEX(c2));
INSERT INTO t1 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28');
@@ -100,3 +101,4 @@ c1 c2 c3 c4
2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00
DROP TABLE t1;
set time_zone= @save_time_zone;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug36981.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug36981.test
index da9de306b09..5c316c0a4d6 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug36981.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug36981.test
@@ -4,6 +4,7 @@
--source include/have_innodb.inc
# crash requires this
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
create table `t1` (`c1` char(1) default null,`c2` char(10) default null,
@@ -12,3 +13,4 @@ engine=innodb default charset=latin1;
insert into `t1` values ('3',null);
select * from `t1` where `c1`='3' for update;
drop table `t1`;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug40992.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug40992.test
index b16f55aa951..41d38445095 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug40992.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug40992.test
@@ -5,6 +5,7 @@
--source include/have_debug.inc
--source include/have_innodb.inc
+SET @saved_dbug = @@SESSION.debug_dbug;
# Crash requires that we enable Index Condition Pushdown in InnoDB
set session debug_dbug="+d,optimizer_innodb_icp";
@@ -19,3 +20,4 @@ INSERT INTO t VALUES (1,1,1),(3,3,3),(5,5,5);
SELECT * FROM t WHERE a > 2 FOR UPDATE;
DROP TABLE t;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug41996.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug41996.test
index 7d6237fa536..0eb7e34a9dd 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug41996.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug41996.test
@@ -5,6 +5,7 @@
--source include/have_innodb.inc
# crash requires this
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
drop table if exists `t1`;
@@ -12,3 +13,4 @@ create table `t1` (`c` bigint, key(`c`),`a` int)engine=innodb;
insert into `t1` values(2,2);
delete `t1` from `t1` `a`, `t1` where `a`.`a`=`t1`.`c` ;
drop table `t1`;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test
index 2b5864a3e69..d59e9e1fbeb 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test
@@ -6,6 +6,7 @@
--source include/have_innodb.inc
+SET @saved_dbug = @@SESSION.debug_dbug;
# Valgrind errors happen only with this:
set session debug_dbug="+d,optimizer_innodb_icp";
@@ -246,3 +247,4 @@ UNLOCK TABLES;
select * from `table5` where (col2 <= '6566-06-15' AND col24 <> 'd') group by `col83` order by `col83` desc ;
drop table `table5`;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test
index 6275038a650..c647b777059 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43249.test
@@ -4,6 +4,7 @@
--source include/have_debug.inc
--source include/have_innodb.inc
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NULL, c3 DATE, PRIMARY
@@ -15,3 +16,4 @@ SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c2 LIMIT 2;
SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c2 LIMIT 2;
drop table `t1`;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43360.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43360.test
index 9bfff0ccdb7..0896caa7712 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43360.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43360.test
@@ -6,6 +6,7 @@
--source include/have_debug.inc
--source include/have_innodb.inc
+SET @saved_dbug = @@SESSION.debug_dbug;
# crash requires this
set session debug_dbug="+d,optimizer_innodb_icp";
@@ -42,3 +43,4 @@ SELECT * FROM t1;
SELECT * FROM t2;
DROP TABLE t1,t2;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test
index f7f40a6d3bf..4e1df63b45b 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test
@@ -5,6 +5,7 @@
--source include/have_debug.inc
--source include/have_innodb.inc
+SET @saved_dbug = @@SESSION.debug_dbug;
# crash requires ICP support in InnoDB
set session debug_dbug="+d,optimizer_innodb_icp";
@@ -58,3 +59,4 @@ FROM t1, t2, t3
WHERE t1.id1 = t2.id2 AND t2.id2 = t3.id3 AND t1.id1 > 5;
DROP TABLE t1, t2, t3;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43617.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43617.test
index 2b5b5fd96dd..02d0ab6d566 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43617.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43617.test
@@ -6,6 +6,7 @@
set storage_engine=innodb;
set @save_time_zone= @@time_zone;
set time_zone='+03:00';
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,optimizer_innodb_icp";
######## Running INSERT tests for TIMESTAMP ########
@@ -83,4 +84,4 @@ SELECT * FROM t1 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER
DROP TABLE t1;
set time_zone= @save_time_zone;
-
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/parts/r/partition_debug.result b/mysql-test/suite/parts/r/partition_debug.result
index 7460fe8dd74..e438cae7a14 100644
--- a/mysql-test/suite/parts/r/partition_debug.result
+++ b/mysql-test/suite/parts/r/partition_debug.result
@@ -6,11 +6,11 @@ CREATE TABLE t1 (a INT, b VARCHAR(64), KEY(b,a))
PARTITION BY HASH (a) PARTITIONS 3;
INSERT INTO t1 VALUES (1, "1"), (2, "2"), (3, "3"), (4, "Four"), (5, "Five"),
(6, "Six"), (7, "Seven"), (8, "Eight"), (9, "Nine");
-SET @save_dbug=@@debug_dbug;
+SET @saved_dbug=@@debug_dbug;
SET SESSION debug_dbug="+d,ha_partition_fail_index_init";
SELECT * FROM t1 WHERE b = "Seven";
ERROR HY000: Table has no partition for value 0
-SET SESSION debug_dbug=@save_dbug;
+SET SESSION debug_dbug=@saved_dbug;
SELECT * FROM t1 WHERE b = "Seven";
a b
7 Seven
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
index 03ef0ed2c09..2e31fc57dd4 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
@@ -10,8 +10,8 @@ current_user()
test1@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test1@localhost
-GRANT USAGE ON *.* TO 'test1'@'localhost'
-GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
+GRANT USAGE ON *.* TO `test1`@`localhost`
+GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO `test1`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
@@ -22,8 +22,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
@@ -80,8 +80,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test2'@'localhost' for table 'tp'
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
index 03ef0ed2c09..2e31fc57dd4 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
@@ -10,8 +10,8 @@ current_user()
test1@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test1@localhost
-GRANT USAGE ON *.* TO 'test1'@'localhost'
-GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
+GRANT USAGE ON *.* TO `test1`@`localhost`
+GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO `test1`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
@@ -22,8 +22,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
@@ -80,8 +80,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test2'@'localhost' for table 'tp'
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_6.result b/mysql-test/suite/parts/r/partition_exch_qa_6.result
index 6de40ee614a..880886b4fac 100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_6.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_6.result
@@ -59,8 +59,8 @@ GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
@@ -114,8 +114,8 @@ connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: INSERT command denied to user 'test2'@'localhost' for table 'tp'
disconnect test2;
@@ -126,8 +126,8 @@ connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
ERROR 42000: CREATE command denied to user 'test2'@'localhost' for table 'tsp'
disconnect test2;
@@ -137,8 +137,8 @@ REVOKE DROP ON test.* FROM test2@localhost;
connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: DROP command denied to user 'test2'@'localhost' for table 'tp'
disconnect test2;
diff --git a/mysql-test/suite/parts/t/partition_debug.test b/mysql-test/suite/parts/t/partition_debug.test
index ef12ee99948..864452f8d8b 100644
--- a/mysql-test/suite/parts/t/partition_debug.test
+++ b/mysql-test/suite/parts/t/partition_debug.test
@@ -18,11 +18,11 @@ CREATE TABLE t1 (a INT, b VARCHAR(64), KEY(b,a))
PARTITION BY HASH (a) PARTITIONS 3;
INSERT INTO t1 VALUES (1, "1"), (2, "2"), (3, "3"), (4, "Four"), (5, "Five"),
(6, "Six"), (7, "Seven"), (8, "Eight"), (9, "Nine");
-SET @save_dbug=@@debug_dbug;
+SET @saved_dbug=@@debug_dbug;
SET SESSION debug_dbug="+d,ha_partition_fail_index_init";
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
SELECT * FROM t1 WHERE b = "Seven";
-SET SESSION debug_dbug=@save_dbug;
+SET SESSION debug_dbug=@saved_dbug;
SELECT * FROM t1 WHERE b = "Seven";
DROP TABLE t1;
diff --git a/mysql-test/suite/parts/t/partition_debug_innodb.test b/mysql-test/suite/parts/t/partition_debug_innodb.test
index c3fa85ba5ba..0d065d0e3f2 100644
--- a/mysql-test/suite/parts/t/partition_debug_innodb.test
+++ b/mysql-test/suite/parts/t/partition_debug_innodb.test
@@ -30,7 +30,7 @@ INSERT INTO t1 VALUES (6, 'X 6 row'), (7, 'Seventh row'), (8, 'Last row');
ALTER TABLE t1 ADD INDEX new_b_index (b);
ALTER TABLE t1 DROP INDEX new_b_index;
-SET @save_dbug=@@debug_dbug;
+SET @saved_dbug=@@debug_dbug;
SET SESSION debug_dbug = "+d,ha_partition_fail_final_add_index";
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
@@ -46,7 +46,7 @@ SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;
-SET SESSION debug_dbug = @save_dbug;
+SET SESSION debug_dbug = @saved_dbug;
SHOW CREATE TABLE t1;
DROP TABLE t1;
}
diff --git a/mysql-test/suite/perfschema/r/column_privilege.result b/mysql-test/suite/perfschema/r/column_privilege.result
index f88a5615e16..b8fff059240 100644
--- a/mysql-test/suite/perfschema/r/column_privilege.result
+++ b/mysql-test/suite/perfschema/r/column_privilege.result
@@ -1,6 +1,6 @@
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
create user 'pfs_user_5'@localhost;
grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
index 27243b52422..86cab03c4c6 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
@@ -22,6 +22,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -99,4 +100,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
revoke select on test.* from 'root'@'192.0.2.4';
drop user 'root'@'192.0.2.4';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result
index 7879919b09d..f824c319afa 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
index 1d5923483c9..33948013822 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
@@ -22,6 +22,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -99,4 +100,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
revoke select on test.* from 'root'@'192.0.2.4';
drop user 'root'@'192.0.2.4';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result
index 87fc75817df..096c5c3dbd5 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
index 949fa8f9c3e..f36e4604a7c 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
@@ -22,6 +22,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -99,4 +100,4 @@ FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
drop user 'root'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result
index b2e0fb60811..d84ffe2e9df 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
index bfc7fde5be8..ff2a93efec4 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
@@ -24,6 +24,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -103,4 +104,4 @@ revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
revoke select on test.* from 'root'@'192.0.2.4';
drop user 'root'@'santa.claus.ipv4.example.com';
drop user 'root'@'192.0.2.4';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result
index 41eb9636e31..c300d6a50af 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result
index 22dd7e7632c..1c34faa9457 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result
@@ -24,6 +24,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
uninstall plugin test_plugin_server;
ERROR HY000: Plugin 'test_plugin_server' is not loaded
@@ -194,5 +195,5 @@ REVOKE PROXY ON 'plug_dest'@'santa.claus.ipv4.example.com'
FROM 'plug'@'santa.claus.ipv4.example.com';
DROP USER 'plug'@'santa.claus.ipv4.example.com';
DROP USER 'plug_dest'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
delete from mysql.plugin where name='test_plugin_server';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
index f301df94ce6..2751dbd7edb 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
@@ -25,6 +25,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4,native_password_bad_reply";
ERROR 08S01: Bad handshake
connection default;
@@ -427,4 +428,4 @@ drop user 'root'@'santa.claus.ipv4.example.com';
revoke select on test.* from 'quota'@'santa.claus.ipv4.example.com';
drop user 'quota'@'santa.claus.ipv4.example.com';
set global max_connect_errors = @saved_max_connect_errors;
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result
index 14a6ace09e4..18e437559e4 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_format_ipv4";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
index 6cca75f9775..3d41f013ba9 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
@@ -25,6 +25,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
connect con2a,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con2a is alive";
@@ -702,4 +703,4 @@ disconnect tmp_con7;
set global max_connections = @saved_max_connections;
set global max_user_connections = @saved_max_user_connections;
drop user 'quota'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
index 5aa80d90d84..7bafd9e636f 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
@@ -24,6 +24,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -178,4 +179,4 @@ revoke select on test.* from 'root'@'192.0.2.4';
revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
drop user 'root'@'192.0.2.4';
drop user 'root'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result
index abe9a606bc4..3896ed086ba 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
connection default;
@@ -142,4 +143,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
index 18986674491..236bc12d9bf 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
@@ -22,6 +22,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -99,4 +100,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
revoke select on test.* from 'root'@'192.0.2.4';
drop user 'root'@'192.0.2.4';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result
index 88ac817ce17..5479393c29b 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result
index a5f70873ed9..4c2a9d48a63 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result
@@ -24,6 +24,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv4.example.com' (using password: YES)
connection default;
@@ -207,4 +208,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
drop user 'user_with'@'santa.claus.ipv4.example.com';
drop user 'user_without'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result
index 86e7bf5780b..267f346836d 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result
@@ -28,6 +28,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv4.example.com' (using password: NO)
connection default;
@@ -151,4 +152,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
drop user 'user_ssl'@'santa.claus.ipv4.example.com';
drop user 'user_ssl_x509'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
index 42d86e858fb..4325cfec6dc 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
@@ -22,6 +22,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -99,4 +100,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
revoke select on test.* from 'root'@'2001:db8::6:6';
drop user 'root'@'2001:db8::6:6';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result
index 87e97ba2138..12435dd54f5 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
index bcd47243d03..57e14dfe913 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
@@ -22,6 +22,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -99,4 +100,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
revoke select on test.* from 'root'@'2001:db8::6:6';
drop user 'root'@'2001:db8::6:6';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result
index 5c24a86248a..654ed7759b1 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
index 68ea9a1d826..f68d90978e7 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
@@ -22,6 +22,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -99,4 +100,4 @@ FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
drop user 'root'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result
index 5b1f546b30e..e63c84bf352 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result
@@ -19,6 +19,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
ERROR HY000: Host 'santa.claus.ipv6.example.com' is not allowed to connect to this MariaDB server
connection default;
@@ -80,4 +81,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
index 0a3a3329c1e..50297797f6a 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
@@ -24,6 +24,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -103,4 +104,4 @@ revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
revoke select on test.* from 'root'@'2001:db8::6:6';
drop user 'root'@'santa.claus.ipv6.example.com';
drop user 'root'@'2001:db8::6:6';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result
index 493ada909b7..549e83369df 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result
index a36d1442ee6..5312958bd91 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result
@@ -24,6 +24,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
uninstall plugin test_plugin_server;
ERROR HY000: Plugin 'test_plugin_server' is not loaded
@@ -194,5 +195,5 @@ REVOKE PROXY ON 'plug_dest'@'santa.claus.ipv6.example.com'
FROM 'plug'@'santa.claus.ipv6.example.com';
DROP USER 'plug'@'santa.claus.ipv6.example.com';
DROP USER 'plug_dest'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
delete from mysql.plugin where name='test_plugin_server';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
index 7cfb6f87277..757285b1033 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
@@ -25,6 +25,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6,native_password_bad_reply";
ERROR 08S01: Bad handshake
connection default;
@@ -427,4 +428,4 @@ drop user 'root'@'santa.claus.ipv6.example.com';
revoke select on test.* from 'quota'@'santa.claus.ipv6.example.com';
drop user 'quota'@'santa.claus.ipv6.example.com';
set global max_connect_errors = @saved_max_connect_errors;
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
index f9d2b556804..f2e25ab6ca1 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
@@ -25,6 +25,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
connect con2a,"::1",quota,,test,$MASTER_MYPORT,;
select "Con2a is alive";
@@ -702,4 +703,4 @@ disconnect tmp_con7;
set global max_connections = @saved_max_connections;
set global max_user_connections = @saved_max_user_connections;
drop user 'quota'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
index 6140f655e7c..2bb23e99203 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
@@ -24,6 +24,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -178,4 +179,4 @@ revoke select on test.* from 'root'@'2001:db8::6:6';
revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
drop user 'root'@'2001:db8::6:6';
drop user 'root'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result
index 22ce0c3e809..5befbd98087 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
connection default;
@@ -142,4 +143,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
index a78ba09513c..f899cb935e9 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
@@ -22,6 +22,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
@@ -99,4 +100,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
revoke select on test.* from 'root'@'2001:db8::6:6';
drop user 'root'@'2001:db8::6:6';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result
index da1570f1b37..6d50530ffa0 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result
@@ -20,6 +20,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
connection default;
@@ -81,4 +82,4 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result
index a4cc3eeb0d0..670a3713d91 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result
@@ -24,6 +24,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv6.example.com' (using password: YES)
connection default;
@@ -207,4 +208,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
drop user 'user_with'@'santa.claus.ipv6.example.com';
drop user 'user_without'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result
index 75f8e5391cf..9ec33df2fee 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result
@@ -28,6 +28,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv6.example.com' (using password: NO)
connection default;
@@ -151,4 +152,4 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
drop user 'user_ssl'@'santa.claus.ipv6.example.com';
drop user 'user_ssl_x509'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/r/hostcache_peer_addr.result b/mysql-test/suite/perfschema/r/hostcache_peer_addr.result
index ddb44157f44..6d15f2f5b25 100644
--- a/mysql-test/suite/perfschema/r/hostcache_peer_addr.result
+++ b/mysql-test/suite/perfschema/r/hostcache_peer_addr.result
@@ -27,6 +27,7 @@ current_user()
root@localhost
disconnect con1;
connection default;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_error";
ERROR HY000: Can't get hostname for your address
connection default;
@@ -50,7 +51,7 @@ Connection_errors_peer_address 2
Connection_errors_select 0
Connection_errors_tcpwrap 0
"Dumping performance_schema.host_cache"
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
flush status;
show global status like "connection_errors_%";
Variable_name Value
diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result
index 7bb7627142e..0a038000536 100644
--- a/mysql-test/suite/perfschema/r/privilege.result
+++ b/mysql-test/suite/perfschema/r/privilege.result
@@ -1,6 +1,6 @@
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
create user 'pfs_user_1'@localhost;
create user 'pfs_user_2'@localhost;
diff --git a/mysql-test/suite/perfschema/r/read_only.result b/mysql-test/suite/perfschema/r/read_only.result
index 045e3232fda..32e3a724b5e 100644
--- a/mysql-test/suite/perfschema/r/read_only.result
+++ b/mysql-test/suite/perfschema/r/read_only.result
@@ -12,8 +12,8 @@ select @@global.read_only;
0
show grants;
Grants for pfsuser@localhost
-GRANT USAGE ON *.* TO 'pfsuser'@'localhost'
-GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
+GRANT USAGE ON *.* TO `pfsuser`@`localhost`
+GRANT SELECT, UPDATE ON `performance_schema`.* TO `pfsuser`@`localhost`
select * from performance_schema.setup_instruments;
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
@@ -25,8 +25,8 @@ select @@global.read_only;
1
show grants;
Grants for pfsuser@localhost
-GRANT USAGE ON *.* TO 'pfsuser'@'localhost'
-GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
+GRANT USAGE ON *.* TO `pfsuser`@`localhost`
+GRANT SELECT, UPDATE ON `performance_schema`.* TO `pfsuser`@`localhost`
select * from performance_schema.setup_instruments;
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
@@ -40,8 +40,8 @@ select @@global.read_only;
1
show grants;
Grants for pfsuser@localhost
-GRANT SUPER ON *.* TO 'pfsuser'@'localhost'
-GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
+GRANT SUPER ON *.* TO `pfsuser`@`localhost`
+GRANT SELECT, UPDATE ON `performance_schema`.* TO `pfsuser`@`localhost`
select * from performance_schema.setup_instruments;
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
diff --git a/mysql-test/suite/perfschema/t/ddl_esms_by_digest.test b/mysql-test/suite/perfschema/t/ddl_esms_by_digest.test
index cea7ea27299..9cf1775c8e5 100644
--- a/mysql-test/suite/perfschema/t/ddl_esms_by_digest.test
+++ b/mysql-test/suite/perfschema/t/ddl_esms_by_digest.test
@@ -1,13 +1,20 @@
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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.
+# it under the terms of the GNU General Public License, version 2.0,
+# as published by the Free Software Foundation.
+#
+# This program is also distributed with certain software (including
+# but not limited to OpenSSL) that is licensed under separate terms,
+# as designated in a particular file or component or in included license
+# documentation. The authors of MySQL hereby grant you an additional
+# permission to link the program and your derivative works with the
+# separately licensed software that they have included with MySQL.
#
# 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.
+# GNU General Public License, version 2.0, 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,
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_digest.test b/mysql-test/suite/perfschema/t/dml_esms_by_digest.test
index 88729e6a7a8..b71c6f2815b 100644
--- a/mysql-test/suite/perfschema/t/dml_esms_by_digest.test
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_digest.test
@@ -1,13 +1,20 @@
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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.
+# it under the terms of the GNU General Public License, version 2.0,
+# as published by the Free Software Foundation.
+#
+# This program is also distributed with certain software (including
+# but not limited to OpenSSL) that is licensed under separate terms,
+# as designated in a particular file or component or in included license
+# documentation. The authors of MySQL hereby grant you an additional
+# permission to link the program and your derivative works with the
+# separately licensed software that they have included with MySQL.
#
# 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.
+# GNU General Public License, version 2.0, 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,
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test
index 6bed01e50bf..c96c8ea37c8 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test
@@ -27,6 +27,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
@@ -48,5 +49,5 @@ disconnect con3;
revoke select on test.* from 'root'@'192.0.2.4';
drop user 'root'@'192.0.2.4';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test
index 3c72de8a05e..00f5d218e17 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test
@@ -25,6 +25,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
--disable_query_log
@@ -43,5 +44,5 @@ connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test
index 5cbe4c30530..d2dff92834e 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test
@@ -30,6 +30,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
@@ -51,5 +52,5 @@ disconnect con3;
revoke select on test.* from 'root'@'192.0.2.4';
drop user 'root'@'192.0.2.4';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test
index c0639cd6b86..f37e1ed3b90 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test
@@ -27,6 +27,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
--disable_query_log
@@ -45,5 +46,5 @@ connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test
index 3b69e0731a0..d2b5352d3a6 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test
@@ -28,6 +28,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
@@ -49,5 +50,5 @@ disconnect con3;
revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
drop user 'root'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test
index e6478c13951..55afb6f0c4f 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test
@@ -25,6 +25,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
--disable_query_log
@@ -43,5 +44,5 @@ connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test
index b4b11526af6..a6bd4c751e2 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test
@@ -30,6 +30,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
@@ -53,5 +54,5 @@ revoke select on test.* from 'root'@'192.0.2.4';
drop user 'root'@'santa.claus.ipv4.example.com';
drop user 'root'@'192.0.2.4';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test
index 06f0f7d29ee..41b8b25efc4 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test
@@ -25,6 +25,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
--disable_query_log
@@ -43,5 +44,5 @@ connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test
index 325460e66ba..6e149b838ef 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_plugin.test
@@ -30,6 +30,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
uninstall plugin test_plugin_server;
@@ -86,6 +87,6 @@ REVOKE PROXY ON 'plug_dest'@'santa.claus.ipv4.example.com'
DROP USER 'plug'@'santa.claus.ipv4.example.com';
DROP USER 'plug_dest'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
delete from mysql.plugin where name='test_plugin_server';
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
index 6990a4e7118..d304cc5a1b8 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
@@ -33,6 +33,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4,native_password_bad_reply";
--disable_query_log
@@ -156,5 +157,5 @@ revoke select on test.* from 'quota'@'santa.claus.ipv4.example.com';
drop user 'quota'@'santa.claus.ipv4.example.com';
set global max_connect_errors = @saved_max_connect_errors;
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_format.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_format.test
index b37bfc79ada..989c82ef0ad 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_format.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_format.test
@@ -24,6 +24,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_format_ipv4";
--disable_query_log
@@ -42,5 +43,5 @@ connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test
index c0349184506..6420b8b5300 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_max_con.test
@@ -31,6 +31,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
connect (con2a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
@@ -259,5 +260,5 @@ set global max_user_connections = @saved_max_user_connections;
# revoke all privileges on test.* from 'quota'@'santa.claus.ipv4.example.com';
drop user 'quota'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test
index 187879985c9..5a2caf5849e 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test
@@ -30,6 +30,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
@@ -71,5 +72,5 @@ revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
drop user 'root'@'192.0.2.4';
drop user 'root'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test
index a78c0dab4eb..6cd2664a04f 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test
@@ -25,6 +25,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
--disable_query_log
@@ -61,5 +62,5 @@ connect (con5,"127.0.0.1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test
index 23ecd51eb4f..19a3ebe9892 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test
@@ -28,6 +28,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
@@ -49,5 +50,5 @@ disconnect con3;
revoke select on test.* from 'root'@'192.0.2.4';
drop user 'root'@'192.0.2.4';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test
index 4b6c91c3df3..28e5615d273 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test
@@ -25,6 +25,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
--disable_query_log
@@ -43,5 +44,5 @@ connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test
index ea331647b48..c6ff89f0902 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test
@@ -29,6 +29,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
--disable_query_log
@@ -82,5 +83,5 @@ connect (con2f,"127.0.0.1",user_with,wrong_password,test,$MASTER_MYPORT,);
drop user 'user_with'@'santa.claus.ipv4.example.com';
drop user 'user_without'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test
index 2b949098bad..bd8d48984e4 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test
@@ -30,6 +30,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
--disable_query_log
@@ -67,5 +68,5 @@ connect (con2d,"127.0.0.1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL)
drop user 'user_ssl'@'santa.claus.ipv4.example.com';
drop user 'user_ssl_x509'@'santa.claus.ipv4.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
index 11c45724f70..100fdffa377 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test
@@ -29,6 +29,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
connect (con2,"::1",root,,test,$MASTER_MYPORT,);
@@ -50,5 +51,5 @@ disconnect con3;
revoke select on test.* from 'root'@'2001:db8::6:6';
drop user 'root'@'2001:db8::6:6';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test
index bdbc0e3c025..8aafff745c4 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test
@@ -26,6 +26,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
--disable_query_log
@@ -44,5 +45,5 @@ connect (con3,"::1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
index 1eb0d3ec41f..eaf46a5c57e 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test
@@ -31,6 +31,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
connect (con2,"::1",root,,test,$MASTER_MYPORT,);
@@ -52,5 +53,5 @@ disconnect con3;
revoke select on test.* from 'root'@'2001:db8::6:6';
drop user 'root'@'2001:db8::6:6';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test
index f8a3cc23c00..6c4ede9da8e 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test
@@ -28,6 +28,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
--disable_query_log
@@ -46,5 +47,5 @@ connect (con3,"::1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
index 6493bb61a1a..e290a5f8ab4 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test
@@ -29,6 +29,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
connect (con2,"::1",root,,test,$MASTER_MYPORT,);
@@ -50,5 +51,5 @@ disconnect con3;
revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
drop user 'root'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test
index 065ae02dd49..4feb0ffb7c8 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test
@@ -22,6 +22,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
--disable_query_log
@@ -40,5 +41,5 @@ connect (con3,"::1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
index 9ebafc9627d..6b422a19dbd 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test
@@ -31,6 +31,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
connect (con2,"::1",root,,test,$MASTER_MYPORT,);
@@ -54,5 +55,4 @@ revoke select on test.* from 'root'@'2001:db8::6:6';
drop user 'root'@'santa.claus.ipv6.example.com';
drop user 'root'@'2001:db8::6:6';
-set global debug_dbug= default;
-
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test
index 136b3c7a24f..c81b799edd1 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test
@@ -26,6 +26,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
--disable_query_log
@@ -44,5 +45,4 @@ connect (con3,"::1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
-
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test
index 3a822bfacb3..d2e4ed69d79 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test
@@ -31,6 +31,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
uninstall plugin test_plugin_server;
@@ -87,6 +88,6 @@ REVOKE PROXY ON 'plug_dest'@'santa.claus.ipv6.example.com'
DROP USER 'plug'@'santa.claus.ipv6.example.com';
DROP USER 'plug_dest'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
delete from mysql.plugin where name='test_plugin_server';
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
index 0a04ec306cf..6da99e02444 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
@@ -33,6 +33,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6,native_password_bad_reply";
--disable_query_log
@@ -156,5 +157,5 @@ revoke select on test.* from 'quota'@'santa.claus.ipv6.example.com';
drop user 'quota'@'santa.claus.ipv6.example.com';
set global max_connect_errors = @saved_max_connect_errors;
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
index b14fff1cc72..6f83221c496 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test
@@ -32,6 +32,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
connect (con2a,"::1",quota,,test,$MASTER_MYPORT,);
@@ -241,5 +242,5 @@ set global max_user_connections = @saved_max_user_connections;
# revoke all privileges on test.* from 'quota'@'santa.claus.ipv6.example.com';
drop user 'quota'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
index b44b58eb0d5..896b9bb4886 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test
@@ -31,6 +31,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
connect (con2,"::1",root,,test,$MASTER_MYPORT,);
@@ -72,5 +73,5 @@ revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
drop user 'root'@'2001:db8::6:6';
drop user 'root'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test
index 073451c7e75..17cc1ffa528 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test
@@ -26,6 +26,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
--disable_query_log
@@ -62,5 +63,5 @@ connect (con5,"::1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
index a7b1a961f09..8e31420b6f1 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test
@@ -29,6 +29,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
connect (con2,"::1",root,,test,$MASTER_MYPORT,);
@@ -50,5 +51,5 @@ disconnect con3;
revoke select on test.* from 'root'@'2001:db8::6:6';
drop user 'root'@'2001:db8::6:6';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test
index 5c3d643b166..ddffc820a2b 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test
@@ -26,6 +26,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
--disable_query_log
@@ -44,5 +45,5 @@ connect (con3,"::1",root,,test,$MASTER_MYPORT,);
--connection default
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test
index 7dcfbb922e5..7281a8b36ec 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test
@@ -27,6 +27,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
--disable_query_log
@@ -80,5 +81,5 @@ connect (con2f,"::1",user_with,wrong_password,test,$MASTER_MYPORT,);
drop user 'user_with'@'santa.claus.ipv6.example.com';
drop user 'user_without'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test
index 3ea4451c7aa..d822d9f9bed 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test
@@ -31,6 +31,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
--disable_query_log
@@ -68,5 +69,5 @@ connect (con2d,"::1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL);
drop user 'user_ssl'@'santa.claus.ipv6.example.com';
drop user 'user_ssl_x509'@'santa.claus.ipv6.example.com';
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/perfschema/t/hostcache_peer_addr.test b/mysql-test/suite/perfschema/t/hostcache_peer_addr.test
index 65f33ce73a8..827421312dc 100644
--- a/mysql-test/suite/perfschema/t/hostcache_peer_addr.test
+++ b/mysql-test/suite/perfschema/t/hostcache_peer_addr.test
@@ -22,6 +22,7 @@ select current_user();
disconnect con1;
--connection default
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_error";
--disable_query_log
@@ -42,7 +43,7 @@ connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
show global status like "connection_errors_%";
--source ../include/hostcache_dump.inc
-set global debug_dbug= default;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
flush status;
show global status like "connection_errors_%";
diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result
index 4785bef3ef7..7ae385b79cb 100644
--- a/mysql-test/suite/plugins/r/auth_ed25519.result
+++ b/mysql-test/suite/plugins/r/auth_ed25519.result
@@ -37,7 +37,7 @@ PLUGIN_AUTH_VERSION 1.0
create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';
show grants for test1@localhost;
Grants for test1@localhost
-GRANT USAGE ON *.* TO 'test1'@'localhost' IDENTIFIED VIA ed25519 USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'
+GRANT USAGE ON *.* TO `test1`@`localhost` IDENTIFIED VIA ed25519 USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'
connect(localhost,test1,public,test,PORT,SOCKET);
connect con1, localhost, test1, public;
ERROR 28000: Access denied for user 'test1'@'localhost' (using password: YES)
diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result
index 4088b36d440..7da9c840202 100644
--- a/mysql-test/suite/plugins/r/server_audit.result
+++ b/mysql-test/suite/plugins/r/server_audit.result
@@ -212,8 +212,22 @@ select 2;
2
2
drop table t1;
+set global server_audit_events='table';
+set global server_audit_incl_users='user1';
+create user user1@localhost;
+grant all on sa_db.* to user1@localhost;
+connect cn1,localhost,user1,,sa_db;
+connection cn1;
+create table t1(id int) engine=myisam;
+insert delayed into t1 values (1), (2);
+connection default;
+# Waiting until INSERT DELAYED thread does the insert.
+drop table t1;
set global server_audit_logging= off;
+set global server_audit_incl_users='root';
set global server_audit_logging= on;
+disconnect cn1;
+drop user user1@localhost;
set global server_audit_events='';
set global server_audit_query_log_limit= 15;
select (1), (2), (3), (4);
@@ -250,7 +264,7 @@ server_audit_file_path
server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
-server_audit_incl_users odin, root, dva, tri
+server_audit_incl_users root
server_audit_logging ON
server_audit_mode 1
server_audit_output_type file
@@ -381,8 +395,16 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0
+TIME,HOSTNAME,user1,localhost,ID,ID,CREATE,sa_db,t1,
+TIME,HOSTNAME,user1,localhost,ID,ID,WRITE,sa_db,t1,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_logging= off',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_logging= on',0
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv,
+TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0
diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test
index f19c8f53b61..67b855871a3 100644
--- a/mysql-test/suite/plugins/t/server_audit.test
+++ b/mysql-test/suite/plugins/t/server_audit.test
@@ -136,8 +136,28 @@ select * from t1;
select 2;
drop table t1;
+set global server_audit_events='table';
+set global server_audit_incl_users='user1';
+
+create user user1@localhost;
+grant all on sa_db.* to user1@localhost;
+
+connect (cn1,localhost,user1,,sa_db);
+connection cn1;
+
+create table t1(id int) engine=myisam;
+insert delayed into t1 values (1), (2);
+connection default;
+--echo # Waiting until INSERT DELAYED thread does the insert.
+let $wait_condition= SELECT COUNT(*) = 2 FROM t1;
+--source include/wait_condition.inc
+drop table t1;
+
set global server_audit_logging= off;
+set global server_audit_incl_users='root';
set global server_audit_logging= on;
+disconnect cn1;
+drop user user1@localhost;
set global server_audit_events='';
diff --git a/mysql-test/suite/roles/admin.result b/mysql-test/suite/roles/admin.result
index 87d2888b47c..a7841fd3b57 100644
--- a/mysql-test/suite/roles/admin.result
+++ b/mysql-test/suite/roles/admin.result
@@ -27,22 +27,22 @@ grant select on *.* to foo@localhost with admin option;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'admin option' at line 1
show grants for foo@localhost;
Grants for foo@localhost
-GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role1 TO 'foo'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT CREATE USER ON *.* TO `foo`@`localhost`
+GRANT `role1` TO `foo`@`localhost` WITH ADMIN OPTION
+GRANT `role2` TO `foo`@`localhost`
+GRANT `role5` TO `foo`@`localhost` WITH ADMIN OPTION
show grants for role1;
Grants for role1
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1'
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT `role2` TO `role1`
+GRANT `role3` TO `role1` WITH ADMIN OPTION
+GRANT `role4` TO `role3` WITH ADMIN OPTION
show grants for role4;
Grants for role4
-GRANT USAGE ON *.* TO 'role4'
+GRANT USAGE ON *.* TO `role4`
select * from mysql.roles_mapping;
Host User Role Admin_option
role1 role2 N
@@ -58,22 +58,22 @@ localhost root role4 Y
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
-GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role1 TO 'foo'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT CREATE USER ON *.* TO `foo`@`localhost`
+GRANT `role1` TO `foo`@`localhost` WITH ADMIN OPTION
+GRANT `role2` TO `foo`@`localhost`
+GRANT `role5` TO `foo`@`localhost` WITH ADMIN OPTION
show grants for role1;
Grants for role1
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1'
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT `role2` TO `role1`
+GRANT `role3` TO `role1` WITH ADMIN OPTION
+GRANT `role4` TO `role3` WITH ADMIN OPTION
show grants for role4;
Grants for role4
-GRANT USAGE ON *.* TO 'role4'
+GRANT USAGE ON *.* TO `role4`
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 NO NULL
@@ -89,21 +89,21 @@ revoke admin option for role2 from foo@localhost;
revoke admin option for role1 from root@localhost;
show grants for foo@localhost;
Grants for foo@localhost
-GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT CREATE USER ON *.* TO `foo`@`localhost`
+GRANT `role2` TO `foo`@`localhost`
+GRANT `role5` TO `foo`@`localhost` WITH ADMIN OPTION
show grants for role1;
Grants for role1
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1' WITH ADMIN OPTION
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3'
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT `role2` TO `role1` WITH ADMIN OPTION
+GRANT `role3` TO `role1` WITH ADMIN OPTION
+GRANT `role4` TO `role3`
show grants for role4;
Grants for role4
-GRANT USAGE ON *.* TO 'role4'
+GRANT USAGE ON *.* TO `role4`
select * from mysql.roles_mapping;
Host User Role Admin_option
role1 role2 Y
@@ -118,21 +118,21 @@ localhost root role4 Y
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
-GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT CREATE USER ON *.* TO `foo`@`localhost`
+GRANT `role2` TO `foo`@`localhost`
+GRANT `role5` TO `foo`@`localhost` WITH ADMIN OPTION
show grants for role1;
Grants for role1
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1' WITH ADMIN OPTION
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3'
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT `role2` TO `role1` WITH ADMIN OPTION
+GRANT `role3` TO `role1` WITH ADMIN OPTION
+GRANT `role4` TO `role3`
show grants for role4;
Grants for role4
-GRANT USAGE ON *.* TO 'role4'
+GRANT USAGE ON *.* TO `role4`
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 YES NULL
diff --git a/mysql-test/suite/roles/create_and_drop_role.result b/mysql-test/suite/roles/create_and_drop_role.result
index a163ee82f42..ad0561aed4d 100644
--- a/mysql-test/suite/roles/create_and_drop_role.result
+++ b/mysql-test/suite/roles/create_and_drop_role.result
@@ -66,8 +66,8 @@ localhost r1 r2 N
localhost root r2 Y
SHOW GRANTS FOR r1@localhost;
Grants for r1@localhost
-GRANT r2 TO 'r1'@'localhost'
-GRANT USAGE ON *.* TO 'r1'@'localhost'
+GRANT `r2` TO `r1`@`localhost`
+GRANT USAGE ON *.* TO `r1`@`localhost`
DROP USER u1;
DROP ROLE r2;
DROP USER r1@localhost;
@@ -85,5 +85,5 @@ select * from mysql.roles_mapping;
Host User Role Admin_option
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
diff --git a/mysql-test/suite/roles/create_and_grant_role.result b/mysql-test/suite/roles/create_and_grant_role.result
index 883ae44397d..2a676115a2d 100644
--- a/mysql-test/suite/roles/create_and_grant_role.result
+++ b/mysql-test/suite/roles/create_and_grant_role.result
@@ -13,14 +13,14 @@ Host User Role Admin_option
localhost root r1 Y
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON *.* TO 'r1'
-GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `r1`
+GRANT `r1` TO `root`@`localhost` WITH ADMIN OPTION
drop role r1;
select * from mysql.roles_mapping;
Host User Role Admin_option
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result
index 0a83262add1..30911265436 100644
--- a/mysql-test/suite/roles/definer.result
+++ b/mysql-test/suite/roles/definer.result
@@ -38,9 +38,9 @@ connect c1, localhost, foo,,mysqltest1;
connection c1;
show grants;
Grants for foo@localhost
-GRANT role4 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT CREATE VIEW ON `mysqltest1`.* TO 'foo'@'localhost'
+GRANT `role4` TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT CREATE VIEW ON `mysqltest1`.* TO `foo`@`localhost`
select * from test.v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select * from test.v2;
@@ -622,13 +622,13 @@ prepare stmt1 from 'grant select on *.* to utest';
execute stmt1;
show grants for utest;
Grants for utest@%
-GRANT SELECT ON *.* TO 'utest'@'%'
+GRANT SELECT ON *.* TO `utest`@`%`
drop user utest;
create role utest;
execute stmt1;
show grants for utest;
Grants for utest
-GRANT SELECT ON *.* TO 'utest'
+GRANT SELECT ON *.* TO `utest`
drop role utest;
#
# MDEV-13676: Field "create Procedure" is NULL, even if the the user
diff --git a/mysql-test/suite/roles/drop_routines.result b/mysql-test/suite/roles/drop_routines.result
index 11eda3a290f..7facb9fd1c9 100644
--- a/mysql-test/suite/roles/drop_routines.result
+++ b/mysql-test/suite/roles/drop_routines.result
@@ -7,15 +7,15 @@ grant r3 to r2;
grant r1 to u1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
grant SELECT on *.* to u1;
grant INSERT on mysql.* to r1;
grant DELETE on mysql.roles_mapping to r2;
@@ -33,30 +33,30 @@ revoke execute on procedure mysql.test_proc from r2;
ERROR 42000: There is no such grant defined for user 'r2' on host '' on routine 'test_proc'
show grants for r1;
Grants for r1
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r3 TO 'r2'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r3` TO `r2`
show grants for r3;
Grants for r3
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r3'
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r3`
drop function mysql.test_func;
drop procedure mysql.test_proc;
create function mysql.test_func (s CHAR(20))
@@ -64,11 +64,11 @@ returns CHAR(50) DETERMINISTIC
return concat('Test string: ',s);
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r3 TO 'r2'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r3` TO `r2`
connect u1,localhost,u1,,;
select mysql.test_func("none");
ERROR 42000: execute command denied to user 'u1'@'%' for routine 'mysql.test_func'
diff --git a/mysql-test/suite/roles/flush_roles-17898.result b/mysql-test/suite/roles/flush_roles-17898.result
index ae8fb0a27d2..970c0d12195 100644
--- a/mysql-test/suite/roles/flush_roles-17898.result
+++ b/mysql-test/suite/roles/flush_roles-17898.result
@@ -24,15 +24,15 @@ grant select on m_.* to r2;
grant r2 to r1;
show grants for u1@localhost;
Grants for u1@localhost
-GRANT r1 TO 'u1'@'localhost'
-GRANT USAGE ON *.* TO 'u1'@'localhost'
+GRANT `r1` TO `u1`@`localhost`
+GRANT USAGE ON *.* TO `u1`@`localhost`
show grants for r1;
Grants for r1
-GRANT r2 TO 'r1'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT SELECT ON `test`.* TO 'r2'
-GRANT SELECT ON `m_`.* TO 'r2'
+GRANT `r2` TO `r1`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT SELECT ON `test`.* TO `r2`
+GRANT SELECT ON `m_`.* TO `r2`
drop user u1@localhost;
drop role r1, r2;
insert mysql.db select * from db_copy;
diff --git a/mysql-test/suite/roles/grant-5771.result b/mysql-test/suite/roles/grant-5771.result
index 87797d8b9a4..14e033f4c29 100644
--- a/mysql-test/suite/roles/grant-5771.result
+++ b/mysql-test/suite/roles/grant-5771.result
@@ -21,13 +21,13 @@ show tables in mysqltest2;
Tables_in_mysqltest2
show grants;
Grants for foo@localhost
-GRANT r2 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT r1 TO 'r2'
-GRANT USAGE ON *.* TO 'r2'
-GRANT ALL PRIVILEGES ON `mysqltest2`.* TO 'r2'
-GRANT USAGE ON *.* TO 'r1'
-GRANT ALL PRIVILEGES ON `mysqltest1`.* TO 'r1'
+GRANT `r2` TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT `r1` TO `r2`
+GRANT USAGE ON *.* TO `r2`
+GRANT ALL PRIVILEGES ON `mysqltest2`.* TO `r2`
+GRANT USAGE ON *.* TO `r1`
+GRANT ALL PRIVILEGES ON `mysqltest1`.* TO `r1`
connection default;
drop user foo@localhost;
drop role r1;
diff --git a/mysql-test/suite/roles/grant_empty.result b/mysql-test/suite/roles/grant_empty.result
index 3316c755b9f..2e4542993ba 100644
--- a/mysql-test/suite/roles/grant_empty.result
+++ b/mysql-test/suite/roles/grant_empty.result
@@ -9,8 +9,8 @@ current_user
@localhost
show grants;
Grants for @localhost
-GRANT r1 TO ''@'localhost'
-GRANT USAGE ON *.* TO ''@'localhost'
+GRANT `r1` TO ``@`localhost`
+GRANT USAGE ON *.* TO ``@`localhost`
connection default;
drop role r1;
drop user ''@localhost;
diff --git a/mysql-test/suite/roles/grant_proxy-5526.result b/mysql-test/suite/roles/grant_proxy-5526.result
index 7921969299a..8bfa8e3929c 100644
--- a/mysql-test/suite/roles/grant_proxy-5526.result
+++ b/mysql-test/suite/roles/grant_proxy-5526.result
@@ -3,7 +3,7 @@ create user user;
grant proxy on r1 to user;
show grants for user;
Grants for user@%
-GRANT USAGE ON *.* TO 'user'@'%'
+GRANT USAGE ON *.* TO `user`@`%`
GRANT PROXY ON 'r1'@'%' TO 'user'@'%'
drop user user;
drop role r1;
diff --git a/mysql-test/suite/roles/grant_revoke_current.result b/mysql-test/suite/roles/grant_revoke_current.result
index 436bec92a8f..e231a465317 100644
--- a/mysql-test/suite/roles/grant_revoke_current.result
+++ b/mysql-test/suite/roles/grant_revoke_current.result
@@ -14,30 +14,30 @@ r1
grant select on *.* to current_role;
show grants for current_role;
Grants for r1
-GRANT SELECT ON *.* TO 'r1'
-GRANT INSERT ON `test`.* TO 'r1'
+GRANT SELECT ON *.* TO `r1`
+GRANT INSERT ON `test`.* TO `r1`
revoke insert on test.* from current_role;
show grants for current_role;
Grants for r1
-GRANT SELECT ON *.* TO 'r1'
+GRANT SELECT ON *.* TO `r1`
revoke all, grant option from current_role;
show grants for current_role;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
set password=password('foobar');
show grants;
Grants for root@localhost
-GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
+GRANT `r1` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
grant r1 to current_user() identified by 'barfoo';
show grants;
Grants for root@localhost
-GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
+GRANT `r1` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
set password='';
update mysql.user set plugin='';
drop role r1;
diff --git a/mysql-test/suite/roles/ip-6401.result b/mysql-test/suite/roles/ip-6401.result
index 1afd649636e..723916f9211 100644
--- a/mysql-test/suite/roles/ip-6401.result
+++ b/mysql-test/suite/roles/ip-6401.result
@@ -4,8 +4,8 @@ grant r1 to foo@'127.0.0.1';
connect con1,127.0.0.1,foo,,;
show grants;
Grants for foo@127.0.0.1
-GRANT r1 TO 'foo'@'127.0.0.1'
-GRANT USAGE ON *.* TO 'foo'@'127.0.0.1'
+GRANT `r1` TO `foo`@`127.0.0.1`
+GRANT USAGE ON *.* TO `foo`@`127.0.0.1`
set role r1;
select * from information_schema.enabled_roles;
ROLE_NAME
diff --git a/mysql-test/suite/roles/prepare_stmt_with_role.result b/mysql-test/suite/roles/prepare_stmt_with_role.result
index 0352502c35c..ecd662c7d3e 100644
--- a/mysql-test/suite/roles/prepare_stmt_with_role.result
+++ b/mysql-test/suite/roles/prepare_stmt_with_role.result
@@ -17,8 +17,8 @@ user host is_role
developers Y
SHOW GRANTS;
Grants for root@localhost
-GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT `developers` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
# Test reexecution.
EXECUTE stmtCreateRole;
@@ -40,8 +40,8 @@ Host User Role Admin_option
localhost root developers Y
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT developers TO 'test_user'@'%'
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT `developers` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
#
# Test revoking a role.
#
@@ -52,16 +52,16 @@ EXECUTE stmtRevokeRole;
ERROR HY000: Cannot revoke role 'developers' from: 'test_user'@'%'
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT USAGE ON *.* TO `test_user`@`%`
EXECUTE stmtGrantRole;
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT developers TO 'test_user'@'%'
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT `developers` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
EXECUTE stmtRevokeRole;
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT USAGE ON *.* TO `test_user`@`%`
#
# Now drop the role.
#
@@ -78,11 +78,11 @@ SELECT * FROM mysql.roles_mapping;
Host User Role Admin_option
SHOW GRANTS;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT USAGE ON *.* TO `test_user`@`%`
#
# Test reexecution.
#
@@ -96,12 +96,12 @@ Host User Role Admin_option
localhost root developers Y
SHOW GRANTS;
Grants for root@localhost
-GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT `developers` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT USAGE ON *.* TO `test_user`@`%`
EXECUTE stmtDropRole;
# Cleanup.
DROP USER test_user;
diff --git a/mysql-test/suite/roles/rebuild_role_grants.result b/mysql-test/suite/roles/rebuild_role_grants.result
index 1068be9bc01..f8297d91024 100644
--- a/mysql-test/suite/roles/rebuild_role_grants.result
+++ b/mysql-test/suite/roles/rebuild_role_grants.result
@@ -3,16 +3,16 @@ create user u1;
grant r1 to u1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
create user u2;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
show grants for u2;
Grants for u2@%
-GRANT USAGE ON *.* TO 'u2'@'%'
+GRANT USAGE ON *.* TO `u2`@`%`
select * from mysql.roles_mapping;
Host User Role Admin_option
% u1 r1 N
@@ -22,7 +22,7 @@ revoke r1 from u1;
ERROR HY000: Cannot revoke role 'r1' from: 'u1'@'%'
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
select * from mysql.roles_mapping;
Host User Role Admin_option
localhost root r1 Y
@@ -30,8 +30,8 @@ grant r1 to u1;
grant r1 to u1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
select * from mysql.roles_mapping;
Host User Role Admin_option
% u1 r1 N
@@ -39,7 +39,7 @@ localhost root r1 Y
drop role r1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
select * from mysql.roles_mapping;
Host User Role Admin_option
create role r1;
diff --git a/mysql-test/suite/roles/recursive.result b/mysql-test/suite/roles/recursive.result
index 897577ba2ff..0d45a0e03d0 100644
--- a/mysql-test/suite/roles/recursive.result
+++ b/mysql-test/suite/roles/recursive.result
@@ -26,8 +26,8 @@ ERROR HY000: Cannot grant role 'role10' to: 'role2'
connect foo, localhost, foo;
show grants;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT role10 TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT `role10` TO `foo`@`localhost`
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@localhost role10 NO NO
@@ -56,27 +56,27 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON *.* TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
select * from information_schema.enabled_roles;
ROLE_NAME
role1
@@ -114,28 +114,28 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON `mysql`.* TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON `mysql`.* TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select on mysql.* from role1;
show status like 'debug%';
@@ -157,28 +157,28 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select on mysql.roles_mapping from role1;
show status like 'debug%';
@@ -202,28 +202,28 @@ count(concat(User))
22
show grants;
Grants for foo@localhost
-GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT (User) ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
grant select(Host) on mysql.roles_mapping to role3;
show status like 'debug%';
@@ -236,29 +236,29 @@ count(concat(User,Host))
22
show grants;
Grants for foo@localhost
-GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO 'role3'
-GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO `role3`
+GRANT SELECT (User) ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select(User) on mysql.roles_mapping from role1;
show status like 'debug%';
diff --git a/mysql-test/suite/roles/recursive_dbug.result b/mysql-test/suite/roles/recursive_dbug.result
index cec461be4a2..417602c5c60 100644
--- a/mysql-test/suite/roles/recursive_dbug.result
+++ b/mysql-test/suite/roles/recursive_dbug.result
@@ -30,8 +30,8 @@ ERROR HY000: Cannot grant role 'role10' to: 'role2'
connect foo, localhost, foo;
show grants;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT role10 TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT `role10` TO `foo`@`localhost`
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@localhost role10 NO NO
@@ -70,27 +70,27 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON *.* TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
select * from information_schema.enabled_roles;
ROLE_NAME
role1
@@ -138,28 +138,28 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON `mysql`.* TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON `mysql`.* TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select on mysql.* from role1;
show status like 'debug%';
@@ -191,28 +191,28 @@ count(*)
22
show grants;
Grants for foo@localhost
-GRANT SELECT ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select on mysql.roles_mapping from role1;
show status like 'debug%';
@@ -246,28 +246,28 @@ count(concat(User))
22
show grants;
Grants for foo@localhost
-GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT (User) ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
grant select(Host) on mysql.roles_mapping to role3;
show status like 'debug%';
@@ -285,29 +285,29 @@ count(concat(User,Host))
22
show grants;
Grants for foo@localhost
-GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO 'role3'
-GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role10'
-GRANT USAGE ON *.* TO 'role2'
-GRANT USAGE ON *.* TO 'role3'
-GRANT USAGE ON *.* TO 'role4'
-GRANT USAGE ON *.* TO 'role5'
-GRANT USAGE ON *.* TO 'role6'
-GRANT USAGE ON *.* TO 'role7'
-GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
+GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO `role3`
+GRANT SELECT (User) ON `mysql`.`roles_mapping` TO `role1`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role10`
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT USAGE ON *.* TO `role3`
+GRANT USAGE ON *.* TO `role4`
+GRANT USAGE ON *.* TO `role5`
+GRANT USAGE ON *.* TO `role6`
+GRANT USAGE ON *.* TO `role7`
+GRANT USAGE ON *.* TO `role9`
+GRANT `role10` TO `foo`@`localhost`
+GRANT `role1` TO `role2`
+GRANT `role2` TO `role4`
+GRANT `role2` TO `role5`
+GRANT `role3` TO `role5`
+GRANT `role4` TO `role6`
+GRANT `role5` TO `role6`
+GRANT `role5` TO `role7`
+GRANT `role6` TO `role9`
+GRANT `role7` TO `role9`
+GRANT `role9` TO `role10`
connection default;
revoke select(User) on mysql.roles_mapping from role1;
show status like 'debug%';
diff --git a/mysql-test/suite/roles/revoke_all.result b/mysql-test/suite/roles/revoke_all.result
index 7e72b5bc766..864cc57a830 100644
--- a/mysql-test/suite/roles/revoke_all.result
+++ b/mysql-test/suite/roles/revoke_all.result
@@ -10,18 +10,18 @@ grant r1 to u1;
grant r4 to r1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
+GRANT `r1` TO `u1`@`%`
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
-GRANT r4 TO 'r3'
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r1`
+GRANT `r4` TO `r3`
grant SELECT on *.* to u1;
grant INSERT on mysql.* to r1;
grant DELETE on mysql.roles_mapping to r2;
@@ -38,146 +38,146 @@ grant execute on procedure mysql.test_proc to r3;
grant execute on mysql.* to r4;
show grants for r1;
Grants for r1
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT EXECUTE ON `mysql`.* TO 'r4'
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
-GRANT r4 TO 'r3'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT EXECUTE ON `mysql`.* TO `r4`
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r1`
+GRANT `r4` TO `r3`
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT EXECUTE ON `mysql`.* TO 'r4'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r3'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT EXECUTE ON `mysql`.* TO `r4`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r3`
show grants for r3;
Grants for r3
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT EXECUTE ON `mysql`.* TO 'r4'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r4 TO 'r3'
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT EXECUTE ON `mysql`.* TO `r4`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r4` TO `r3`
show grants for r4;
Grants for r4
-GRANT EXECUTE ON `mysql`.* TO 'r4'
-GRANT USAGE ON *.* TO 'r4'
+GRANT EXECUTE ON `mysql`.* TO `r4`
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from r4;
show grants for r1;
Grants for r1
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
-GRANT r4 TO 'r3'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r1`
+GRANT `r4` TO `r3`
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r3'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r3`
show grants for r3;
Grants for r3
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
-GRANT UPDATE ON `mysql`.`user` TO 'r3'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r4 TO 'r3'
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `r3`
+GRANT UPDATE ON `mysql`.`user` TO `r3`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r4` TO `r3`
show grants for r4;
Grants for r4
-GRANT USAGE ON *.* TO 'r4'
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from r3;
show grants for r1;
Grants for r1
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r3` TO `r2`
+GRANT `r4` TO `r1`
show grants for r2;
Grants for r2
-GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r3'
-GRANT r3 TO 'r2'
+GRANT DELETE ON `mysql`.`roles_mapping` TO `r2`
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `r2`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r3`
+GRANT `r3` TO `r2`
show grants for r3;
Grants for r3
-GRANT USAGE ON *.* TO 'r3'
+GRANT USAGE ON *.* TO `r3`
show grants for r4;
Grants for r4
-GRANT USAGE ON *.* TO 'r4'
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from r2;
show grants for r1;
Grants for r1
-GRANT INSERT ON `mysql`.* TO 'r1'
-GRANT USAGE ON *.* TO 'r1'
-GRANT USAGE ON *.* TO 'r2'
-GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r4 TO 'r1'
+GRANT INSERT ON `mysql`.* TO `r1`
+GRANT USAGE ON *.* TO `r1`
+GRANT USAGE ON *.* TO `r2`
+GRANT USAGE ON *.* TO `r4`
+GRANT `r2` TO `r1`
+GRANT `r4` TO `r1`
show grants for r2;
Grants for r2
-GRANT USAGE ON *.* TO 'r2'
+GRANT USAGE ON *.* TO `r2`
show grants for r3;
Grants for r3
-GRANT USAGE ON *.* TO 'r3'
+GRANT USAGE ON *.* TO `r3`
show grants for r4;
Grants for r4
-GRANT USAGE ON *.* TO 'r4'
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from r1;
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
show grants for r2;
Grants for r2
-GRANT USAGE ON *.* TO 'r2'
+GRANT USAGE ON *.* TO `r2`
show grants for r3;
Grants for r3
-GRANT USAGE ON *.* TO 'r3'
+GRANT USAGE ON *.* TO `r3`
show grants for r4;
Grants for r4
-GRANT USAGE ON *.* TO 'r4'
+GRANT USAGE ON *.* TO `r4`
revoke all privileges, grant option from u1;
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
drop function mysql.test_func;
drop procedure mysql.test_proc;
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
drop role r1, r2, r3, r4;
drop user u1;
diff --git a/mysql-test/suite/roles/role_case_sensitive-10744.result b/mysql-test/suite/roles/role_case_sensitive-10744.result
index b898310e83c..05ac5c95e31 100644
--- a/mysql-test/suite/roles/role_case_sensitive-10744.result
+++ b/mysql-test/suite/roles/role_case_sensitive-10744.result
@@ -21,8 +21,8 @@ grant select on secret_db.* to test_role;
grant test_role to test_user;
show grants for test_user;
Grants for test_user@%
-GRANT test_role TO 'test_user'@'%'
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT `test_role` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
#
# Now test the UPPER case role.
#
@@ -30,9 +30,9 @@ grant test_ROLE to test_user;
grant insert on secret_db.t1 to test_ROLE;
show grants for test_user;
Grants for test_user@%
-GRANT test_role TO 'test_user'@'%'
-GRANT test_ROLE TO 'test_user'@'%'
-GRANT USAGE ON *.* TO 'test_user'@'%'
+GRANT `test_role` TO `test_user`@`%`
+GRANT `test_ROLE` TO `test_user`@`%`
+GRANT USAGE ON *.* TO `test_user`@`%`
connect test_user,localhost,test_user;
#
# Test users privileges when interacting with those roles;
diff --git a/mysql-test/suite/roles/rpl_definer.result b/mysql-test/suite/roles/rpl_definer.result
index 2d10dc6cd7a..185b17fd51b 100644
--- a/mysql-test/suite/roles/rpl_definer.result
+++ b/mysql-test/suite/roles/rpl_definer.result
@@ -7,14 +7,14 @@ grant role2 to role1;
set role role1;
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-GRANT EXECUTE ON `test`.* TO 'role2'
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
+GRANT EXECUTE ON `test`.* TO `role2`
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT role1 TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'role1'
-GRANT role2 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT `role1` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT `role2` TO `role1`
+GRANT `role2` TO `root`@`localhost` WITH ADMIN OPTION
create definer=current_user procedure pcu() select current_user;
create definer=root@localhost procedure pu() select "root@localhost";
create definer=current_role procedure pcr() select current_role;
@@ -39,14 +39,14 @@ connection slave;
set role role1;
show grants;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-GRANT EXECUTE ON `test`.* TO 'role2'
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
+GRANT EXECUTE ON `test`.* TO `role2`
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON *.* TO 'role1'
-GRANT USAGE ON *.* TO 'role2'
-GRANT role1 TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'role1'
-GRANT role2 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT USAGE ON *.* TO `role1`
+GRANT USAGE ON *.* TO `role2`
+GRANT `role1` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT `role2` TO `role1`
+GRANT `role2` TO `root`@`localhost` WITH ADMIN OPTION
show create procedure pcu;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
pcu STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`()
diff --git a/mysql-test/suite/roles/set_and_drop.result b/mysql-test/suite/roles/set_and_drop.result
index 2d3e675ebd0..87ccad2b447 100644
--- a/mysql-test/suite/roles/set_and_drop.result
+++ b/mysql-test/suite/roles/set_and_drop.result
@@ -56,9 +56,9 @@ drop role role2;
connection foo;
show grants;
Grants for foo@localhost
-GRANT role1 TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT USAGE ON *.* TO 'role1'
+GRANT `role1` TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `foo`@`localhost`
+GRANT USAGE ON *.* TO `role1`
select * from information_schema.enabled_roles;
ROLE_NAME
role1
@@ -112,7 +112,7 @@ select a from mysqltest1.t2;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't2'
show grants;
Grants for foo@localhost
-GRANT USAGE ON *.* TO 'foo'@'localhost'
+GRANT USAGE ON *.* TO `foo`@`localhost`
select * from information_schema.enabled_roles;
ROLE_NAME
NULL
diff --git a/mysql-test/suite/roles/set_default_role_clear.result b/mysql-test/suite/roles/set_default_role_clear.result
index 7f54b5eabcc..56e9662154c 100644
--- a/mysql-test/suite/roles/set_default_role_clear.result
+++ b/mysql-test/suite/roles/set_default_role_clear.result
@@ -4,8 +4,8 @@ grant select on *.* to test_role;
grant test_role to test_user@localhost;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
+GRANT `test_role` TO `test_user`@`localhost`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
set default role test_role;
select user, host, default_role from mysql.user;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
@@ -14,9 +14,9 @@ user host default_role
test_user localhost test_role
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT SELECT ON *.* TO 'test_role'
+GRANT `test_role` TO `test_user`@`localhost`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT SELECT ON *.* TO `test_role`
select user, host, default_role from mysql.user where user='test_user';
user host default_role
test_user localhost test_role
diff --git a/mysql-test/suite/roles/set_default_role_for.result b/mysql-test/suite/roles/set_default_role_for.result
index 9880671ba09..f88dc83dfd9 100644
--- a/mysql-test/suite/roles/set_default_role_for.result
+++ b/mysql-test/suite/roles/set_default_role_for.result
@@ -18,9 +18,9 @@ ERROR OP000: Invalid role specification `role_b`
set default role role_b for user_b@localhost;
show grants;
Grants for user_a@localhost
-GRANT role_a TO 'user_a'@'localhost'
-GRANT USAGE ON *.* TO 'user_a'@'localhost'
-GRANT SELECT ON *.* TO 'role_a'
+GRANT `role_a` TO `user_a`@`localhost`
+GRANT USAGE ON *.* TO `user_a`@`localhost`
+GRANT SELECT ON *.* TO `role_a`
select user, host, default_role from mysql.user where user like 'user_%';
user host default_role
user_a localhost role_a
@@ -39,9 +39,9 @@ set default role role_b for current_user;
ERROR OP000: Invalid role specification `role_b`
show grants;
Grants for user_b@localhost
-GRANT role_b TO 'user_b'@'localhost'
-GRANT USAGE ON *.* TO 'user_b'@'localhost'
-GRANT INSERT, UPDATE ON *.* TO 'role_b'
+GRANT `role_b` TO `user_b`@`localhost`
+GRANT USAGE ON *.* TO `user_b`@`localhost`
+GRANT INSERT, UPDATE ON *.* TO `role_b`
select user, host, default_role from mysql.user where user like 'user_%';
ERROR 42000: SELECT command denied to user 'user_b'@'localhost' for table 'user'
insert ignore into mysql.user (user, host) values ('someuser', 'somehost');
@@ -53,9 +53,9 @@ Warning 1364 Field 'authentication_string' doesn't have a default value
set default role NONE for user_a@localhost;
show grants;
Grants for user_a@localhost
-GRANT role_a TO 'user_a'@'localhost'
-GRANT USAGE ON *.* TO 'user_a'@'localhost'
-GRANT INSERT, UPDATE ON *.* TO 'role_b'
+GRANT `role_a` TO `user_a`@`localhost`
+GRANT USAGE ON *.* TO `user_a`@`localhost`
+GRANT INSERT, UPDATE ON *.* TO `role_b`
select user, host, default_role from mysql.user where user like 'user_%';
ERROR 42000: SELECT command denied to user 'user_a'@'localhost' for table 'user'
drop role role_a;
diff --git a/mysql-test/suite/roles/set_default_role_invalid.result b/mysql-test/suite/roles/set_default_role_invalid.result
index 5bcaa9acb86..4a3b88f0ef8 100644
--- a/mysql-test/suite/roles/set_default_role_invalid.result
+++ b/mysql-test/suite/roles/set_default_role_invalid.result
@@ -5,8 +5,8 @@ grant select on *.* to test_role;
grant test_role to test_user@localhost;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
+GRANT `test_role` TO `test_user`@`localhost`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
select user, host, default_role from mysql.user;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
set default role invalid_role;
@@ -21,9 +21,9 @@ user host default_role
test_user localhost test_role
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT SELECT ON *.* TO 'test_role'
+GRANT `test_role` TO `test_user`@`localhost`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT SELECT ON *.* TO `test_role`
select user, host, default_role from mysql.user where user='test_user';
user host default_role
test_user localhost test_role
diff --git a/mysql-test/suite/roles/set_default_role_new_connection.result b/mysql-test/suite/roles/set_default_role_new_connection.result
index a59ecbd75f7..03575e8aa8a 100644
--- a/mysql-test/suite/roles/set_default_role_new_connection.result
+++ b/mysql-test/suite/roles/set_default_role_new_connection.result
@@ -5,8 +5,8 @@ grant test_role to test_user@localhost;
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
+GRANT `test_role` TO `test_user`@`localhost`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
select user, host, default_role from mysql.user where user = 'test_user';
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
set default role test_role;
@@ -20,9 +20,9 @@ test_user localhost test_role
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT SELECT ON *.* TO 'test_role'
+GRANT `test_role` TO `test_user`@`localhost`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT SELECT ON *.* TO `test_role`
select user, host, default_role from mysql.user where user = 'test_user';
user host default_role
test_user localhost test_role
@@ -35,8 +35,8 @@ test_user localhost
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
+GRANT `test_role` TO `test_user`@`localhost`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
select user, host, default_role from mysql.user where user = 'test_user';
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
disconnect c1;
@@ -48,9 +48,9 @@ set default role test_role for test_user@localhost;
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT SELECT ON *.* TO 'test_role'
+GRANT `test_role` TO `test_user`@`localhost`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT SELECT ON *.* TO `test_role`
select user, host, default_role from mysql.user where user = 'test_user';
user host default_role
test_user localhost test_role
diff --git a/mysql-test/suite/roles/set_role-13655.result b/mysql-test/suite/roles/set_role-13655.result
index c30e4115953..9da16c1dd51 100644
--- a/mysql-test/suite/roles/set_role-13655.result
+++ b/mysql-test/suite/roles/set_role-13655.result
@@ -18,10 +18,10 @@ create role admin;
grant simple to admin;
show grants for admin;
Grants for admin
-GRANT simple TO 'admin'
-GRANT USAGE ON *.* TO 'admin'
-GRANT USAGE ON *.* TO 'simple'
-GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO 'simple'
+GRANT `simple` TO `admin`
+GRANT USAGE ON *.* TO `admin`
+GRANT USAGE ON *.* TO `simple`
+GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO `simple`
#
# Finally, we give the admin all the available privileges for the db.
#
@@ -37,13 +37,13 @@ ERROR 42000: Access denied for user 'foo'@'%' to database 't'
set role admin;
show grants;
Grants for foo@%
-GRANT admin TO 'foo'@'%'
-GRANT USAGE ON *.* TO 'foo'@'%'
-GRANT simple TO 'admin'
-GRANT USAGE ON *.* TO 'admin'
-GRANT ALL PRIVILEGES ON `t`.* TO 'admin'
-GRANT USAGE ON *.* TO 'simple'
-GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO 'simple'
+GRANT `admin` TO `foo`@`%`
+GRANT USAGE ON *.* TO `foo`@`%`
+GRANT `simple` TO `admin`
+GRANT USAGE ON *.* TO `admin`
+GRANT ALL PRIVILEGES ON `t`.* TO `admin`
+GRANT USAGE ON *.* TO `simple`
+GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO `simple`
create database t;
drop database t;
connection default;
diff --git a/mysql-test/suite/roles/set_role-9614.result b/mysql-test/suite/roles/set_role-9614.result
index 37f6db070c0..7085d2287e2 100644
--- a/mysql-test/suite/roles/set_role-9614.result
+++ b/mysql-test/suite/roles/set_role-9614.result
@@ -35,16 +35,16 @@ GRANT `client` TO `usertestjohn`@`%`;
#
SHOW GRANTS FOR `john`@`%`;
Grants for john@%
-GRANT client TO 'john'@'%'
-GRANT USAGE ON *.* TO 'john'@'%'
+GRANT `client` TO `john`@`%`
+GRANT USAGE ON *.* TO `john`@`%`
SHOW GRANTS FOR `usertestjohn`@`%`;
Grants for usertestjohn@%
-GRANT client TO 'usertestjohn'@'%'
-GRANT USAGE ON *.* TO 'usertestjohn'@'%'
+GRANT `client` TO `usertestjohn`@`%`
+GRANT USAGE ON *.* TO `usertestjohn`@`%`
SHOW GRANTS FOR `client`;
Grants for client
-GRANT USAGE ON *.* TO 'client'
-GRANT SELECT ON `bug_db`.`t0` TO 'client'
+GRANT USAGE ON *.* TO `client`
+GRANT SELECT ON `bug_db`.`t0` TO `client`
show databases;
Database
bug_db
@@ -84,10 +84,10 @@ information_schema
test
show grants;
Grants for usertestjohn@%
-GRANT client TO 'usertestjohn'@'%'
-GRANT USAGE ON *.* TO 'usertestjohn'@'%'
-GRANT USAGE ON *.* TO 'client'
-GRANT SELECT ON `bug_db`.`t0` TO 'client'
+GRANT `client` TO `usertestjohn`@`%`
+GRANT USAGE ON *.* TO `usertestjohn`@`%`
+GRANT USAGE ON *.* TO `client`
+GRANT SELECT ON `bug_db`.`t0` TO `client`
use bug_db;
#
# Cleanup
diff --git a/mysql-test/suite/roles/set_role-database-recursive.result b/mysql-test/suite/roles/set_role-database-recursive.result
index 479e553c3d1..c919a800220 100644
--- a/mysql-test/suite/roles/set_role-database-recursive.result
+++ b/mysql-test/suite/roles/set_role-database-recursive.result
@@ -67,17 +67,17 @@ set role test_role1;
delete from mysql.user where user='no such user';
show grants;
Grants for test_user@localhost
-GRANT DELETE ON `mysql`.* TO 'test_role4'
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role3'
-GRANT USAGE ON *.* TO 'test_role4'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
-GRANT test_role2 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_role2'
-GRANT test_role4 TO 'test_role3'
+GRANT DELETE ON `mysql`.* TO `test_role4`
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role3`
+GRANT USAGE ON *.* TO `test_role4`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
+GRANT `test_role2` TO `test_user`@`localhost`
+GRANT `test_role3` TO `test_role2`
+GRANT `test_role4` TO `test_role3`
drop user test_user@localhost;
drop role test_role1, test_role2, test_role3, test_role4;
diff --git a/mysql-test/suite/roles/set_role-multiple-role.result b/mysql-test/suite/roles/set_role-multiple-role.result
index fca53b4d645..2ddd1e8a510 100644
--- a/mysql-test/suite/roles/set_role-multiple-role.result
+++ b/mysql-test/suite/roles/set_role-multiple-role.result
@@ -25,14 +25,14 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT r_crt TO 'test_user'@'localhost'
-GRANT r_del TO 'test_user'@'localhost'
-GRANT r_drp TO 'test_user'@'localhost'
-GRANT r_ins TO 'test_user'@'localhost'
-GRANT r_rld TO 'test_user'@'localhost'
-GRANT r_sel TO 'test_user'@'localhost'
-GRANT r_upd TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `r_crt` TO `test_user`@`localhost`
+GRANT `r_del` TO `test_user`@`localhost`
+GRANT `r_drp` TO `test_user`@`localhost`
+GRANT `r_ins` TO `test_user`@`localhost`
+GRANT `r_rld` TO `test_user`@`localhost`
+GRANT `r_sel` TO `test_user`@`localhost`
+GRANT `r_upd` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -42,15 +42,15 @@ current_user() current_role()
test_user@localhost r_sel
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'r_sel'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT r_crt TO 'test_user'@'localhost'
-GRANT r_del TO 'test_user'@'localhost'
-GRANT r_drp TO 'test_user'@'localhost'
-GRANT r_ins TO 'test_user'@'localhost'
-GRANT r_rld TO 'test_user'@'localhost'
-GRANT r_sel TO 'test_user'@'localhost'
-GRANT r_upd TO 'test_user'@'localhost'
+GRANT SELECT ON *.* TO `r_sel`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `r_crt` TO `test_user`@`localhost`
+GRANT `r_del` TO `test_user`@`localhost`
+GRANT `r_drp` TO `test_user`@`localhost`
+GRANT `r_ins` TO `test_user`@`localhost`
+GRANT `r_rld` TO `test_user`@`localhost`
+GRANT `r_sel` TO `test_user`@`localhost`
+GRANT `r_upd` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
Host User Role Admin_option
localhost root r_crt Y
@@ -73,15 +73,15 @@ current_user() current_role()
test_user@localhost r_ins
show grants;
Grants for test_user@localhost
-GRANT INSERT ON *.* TO 'r_ins'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT r_crt TO 'test_user'@'localhost'
-GRANT r_del TO 'test_user'@'localhost'
-GRANT r_drp TO 'test_user'@'localhost'
-GRANT r_ins TO 'test_user'@'localhost'
-GRANT r_rld TO 'test_user'@'localhost'
-GRANT r_sel TO 'test_user'@'localhost'
-GRANT r_upd TO 'test_user'@'localhost'
+GRANT INSERT ON *.* TO `r_ins`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `r_crt` TO `test_user`@`localhost`
+GRANT `r_del` TO `test_user`@`localhost`
+GRANT `r_drp` TO `test_user`@`localhost`
+GRANT `r_ins` TO `test_user`@`localhost`
+GRANT `r_rld` TO `test_user`@`localhost`
+GRANT `r_sel` TO `test_user`@`localhost`
+GRANT `r_upd` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
insert into mysql.roles_mapping values ('', 'r_sel', 'r_rld', 'N');
diff --git a/mysql-test/suite/roles/set_role-recursive.result b/mysql-test/suite/roles/set_role-recursive.result
index 2b34c3eeebe..945cadfb2b2 100644
--- a/mysql-test/suite/roles/set_role-recursive.result
+++ b/mysql-test/suite/roles/set_role-recursive.result
@@ -25,8 +25,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -36,35 +36,35 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
select * from mysql.roles_mapping where Host='';
Host User Role Admin_option
test_role1 test_role2 N
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
set role test_role2;
ERROR OP000: Invalid role specification `test_role2`
select current_user(), current_role();
@@ -72,43 +72,43 @@ current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
set role test_role1;
select current_user(), current_role();
current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
select * from mysql.roles_mapping where Host='';
Host User Role Admin_option
test_role1 test_role2 N
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
delete from mysql.user where user='test_role1';
diff --git a/mysql-test/suite/roles/set_role-routine-simple.result b/mysql-test/suite/roles/set_role-routine-simple.result
index 3e17a78ad77..2df370b273d 100644
--- a/mysql-test/suite/roles/set_role-routine-simple.result
+++ b/mysql-test/suite/roles/set_role-routine-simple.result
@@ -31,9 +31,9 @@ grant execute on procedure mysql.test_proc to test_role2;
grant execute on mysql.* to test_role3;
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role3` TO `test_user`@`localhost`
use mysql;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
select current_user(), current_role();
@@ -53,23 +53,23 @@ test_func('AABBCCDD')
Test string: AABBCCDD
show grants;
Grants for test_user@localhost
-GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'test_role2'
-GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
-GRANT test_role3 TO 'test_user'@'localhost'
+GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO `test_role2`
+GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
+GRANT `test_role3` TO `test_user`@`localhost`
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role3` TO `test_user`@`localhost`
call test_proc(@a);
ERROR 42000: execute command denied to user 'test_user'@'localhost' for routine 'mysql.test_proc'
SELECT test_func('AABBCCDD');
@@ -80,11 +80,11 @@ current_user() current_role()
test_user@localhost test_role3
show grants;
Grants for test_user@localhost
-GRANT EXECUTE ON `mysql`.* TO 'test_role3'
-GRANT USAGE ON *.* TO 'test_role3'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_user'@'localhost'
+GRANT EXECUTE ON `mysql`.* TO `test_role3`
+GRANT USAGE ON *.* TO `test_role3`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role3` TO `test_user`@`localhost`
call test_proc(@a);
SELECT @a;
@a
diff --git a/mysql-test/suite/roles/set_role-simple.result b/mysql-test/suite/roles/set_role-simple.result
index 9af698c7b09..af237113bb3 100644
--- a/mysql-test/suite/roles/set_role-simple.result
+++ b/mysql-test/suite/roles/set_role-simple.result
@@ -17,8 +17,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -28,9 +28,9 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT SELECT ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select * from mysql.roles_mapping;
Host User Role Admin_option
localhost root test_role1 Y
@@ -52,7 +52,7 @@ current_user
user1@%
show grants;
Grants for user1@%
-GRANT USAGE ON *.* TO 'user1'@'%'
+GRANT USAGE ON *.* TO `user1`@`%`
set role none;
connection default;
drop user user1;
diff --git a/mysql-test/suite/roles/set_role-table-column-priv.result b/mysql-test/suite/roles/set_role-table-column-priv.result
index 721bd3039a3..738b3313bb2 100644
--- a/mysql-test/suite/roles/set_role-table-column-priv.result
+++ b/mysql-test/suite/roles/set_role-table-column-priv.result
@@ -19,8 +19,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -30,12 +30,12 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for column 'Host' in table 'roles_mapping'
select Role from mysql.roles_mapping;
@@ -46,12 +46,12 @@ test_role2
test_role2
show grants;
Grants for test_user@localhost
-GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
use mysql;
set role none;
select current_user(), current_role();
diff --git a/mysql-test/suite/roles/set_role-table-simple.result b/mysql-test/suite/roles/set_role-table-simple.result
index f5688dbe62e..dcd0914db8d 100644
--- a/mysql-test/suite/roles/set_role-table-simple.result
+++ b/mysql-test/suite/roles/set_role-table-simple.result
@@ -19,8 +19,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -30,12 +30,12 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON `mysql`.`roles_mapping` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON `mysql`.`roles_mapping` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
select * from mysql.roles_mapping;
Host User Role Admin_option
test_role1 test_role2 N
@@ -44,12 +44,12 @@ localhost root test_role2 Y
localhost test_user test_role1 N
show grants;
Grants for test_user@localhost
-GRANT SELECT ON `mysql`.`roles_mapping` TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON `mysql`.`roles_mapping` TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
use mysql;
set role none;
select current_user(), current_role();
diff --git a/mysql-test/suite/roles/show_grants.result b/mysql-test/suite/roles/show_grants.result
index 5d46b038cf8..634fab34131 100644
--- a/mysql-test/suite/roles/show_grants.result
+++ b/mysql-test/suite/roles/show_grants.result
@@ -34,9 +34,9 @@ test_user@localhost test_role1 NO NO
test_user@localhost test_role2 NO NO
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -50,13 +50,13 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_role1`
+GRANT `test_role2` TO `test_user`@`localhost`
set role none;
select * from information_schema.enabled_roles;
ROLE_NAME
@@ -66,28 +66,28 @@ current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for test_user@localhost;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for test_role1;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
show grants for test_role2;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
show grants for CURRENT_USER;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for CURRENT_USER();
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for CURRENT_ROLE;
ERROR 42000: There is no such grant defined for user 'test_user' on host 'localhost'
show grants for CURRENT_ROLE();
@@ -101,44 +101,44 @@ current_user() current_role()
test_user@localhost test_role2
show grants;
Grants for test_user@localhost
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for test_user@localhost;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for test_role1;
Grants for test_role1
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role1'
-GRANT USAGE ON *.* TO 'test_role2'
-GRANT test_role2 TO 'test_role1'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role1`
+GRANT USAGE ON *.* TO `test_role2`
+GRANT `test_role2` TO `test_role1`
show grants for test_role2;
Grants for test_role2
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role2'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role2`
show grants for CURRENT_USER;
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for CURRENT_USER();
Grants for test_user@localhost
-GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
+GRANT USAGE ON *.* TO `test_user`@`localhost`
+GRANT `test_role1` TO `test_user`@`localhost`
+GRANT `test_role2` TO `test_user`@`localhost`
show grants for CURRENT_ROLE;
Grants for test_role2
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role2'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role2`
show grants for CURRENT_ROLE();
Grants for test_role2
-GRANT SELECT ON `mysql`.* TO 'test_role2'
-GRANT USAGE ON *.* TO 'test_role2'
+GRANT SELECT ON `mysql`.* TO `test_role2`
+GRANT USAGE ON *.* TO `test_role2`
drop user 'test_user'@'localhost';
revoke select on mysql.* from test_role2;
drop role test_role1;
diff --git a/mysql-test/suite/roles/show_grants_replicated.result b/mysql-test/suite/roles/show_grants_replicated.result
index cb9df65dbbd..f635aa0827e 100644
--- a/mysql-test/suite/roles/show_grants_replicated.result
+++ b/mysql-test/suite/roles/show_grants_replicated.result
@@ -6,10 +6,10 @@ create role r1;
# On master SHOW GRANTS work both for the user and the role:
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
#
connection slave;
#
@@ -27,30 +27,30 @@ root@localhost r1 YES NO
# Check show grants for the new user.
show grants for u1;
Grants for u1@%
-GRANT USAGE ON *.* TO 'u1'@'%'
+GRANT USAGE ON *.* TO `u1`@`%`
#
# Check show grants for the new role.
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
#
# Check if flushing privileges preserves the state.
flush privileges;
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
#
# Check SHOW GRANTS after setting the role.
set role r1;
show grants;
Grants for root@localhost
-GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT `r1` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
show grants for r1;
Grants for r1
-GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO `r1`
connection master;
drop role r1;
drop user u1;
diff --git a/mysql-test/suite/rpl/include/rpl_checksum.inc b/mysql-test/suite/rpl/include/rpl_checksum.inc
index b5e70abe4d0..17a986dc308 100644
--- a/mysql-test/suite/rpl/include/rpl_checksum.inc
+++ b/mysql-test/suite/rpl/include/rpl_checksum.inc
@@ -108,6 +108,7 @@ insert into t1 values (1) /* will not be applied on slave due to simulation */;
# instruction to the dump thread
connection slave;
+set @saved_dbug = @@global.debug_dbug;
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
start slave;
--let $slave_io_errno= 1236
@@ -116,8 +117,7 @@ source include/wait_for_slave_io_error.inc;
select count(*) as zero from t1;
-###connection master;
-set @@global.debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
connection slave;
source include/start_slave.inc;
@@ -129,10 +129,11 @@ source include/start_slave.inc;
# C1. Failure by a client thread
connection master;
set @@global.master_verify_checksum = 1;
+set @save_dbug = @@session.debug_dbug;
set @@session.debug_dbug='d,simulate_checksum_test_failure';
--error ER_ERROR_WHEN_EXECUTING_COMMAND
show binlog events;
-set @@session.debug_dbug='';
+SET debug_dbug= @save_dbug;
set @@global.master_verify_checksum = default;
#connection master;
@@ -149,6 +150,7 @@ connection slave;
# C2. Failure by IO thread
# instruction to io thread
+set @saved_dbug = @@global.debug_dbug;
set @@global.debug_dbug='d,simulate_checksum_test_failure';
start slave io_thread;
# When the checksum error is detected, the slave sets error code 1913
@@ -158,7 +160,7 @@ start slave io_thread;
--let $slave_io_errno= 1595,1913
--let $show_slave_io_error= 0
source include/wait_for_slave_io_error.inc;
-set @@global.debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
# to make IO thread re-read it again w/o the failure
start slave io_thread;
@@ -179,7 +181,7 @@ source include/wait_for_slave_sql_error.inc;
# resuming SQL thread to parse out the event w/o the failure
-set @@global.debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
source include/start_slave.inc;
connection master;
diff --git a/mysql-test/suite/rpl/include/rpl_corruption.inc b/mysql-test/suite/rpl/include/rpl_corruption.inc
index 1726ee4ba2f..4106bb45eef 100644
--- a/mysql-test/suite/rpl/include/rpl_corruption.inc
+++ b/mysql-test/suite/rpl/include/rpl_corruption.inc
@@ -73,6 +73,7 @@ while ($i) {
# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing
--echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
--echo SHOW BINLOG EVENTS;
--disable_query_log
@@ -130,12 +131,13 @@ let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_R
--source include/wait_for_slave_io_error.inc
--connection master
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
-SET GLOBAL debug_dbug= "";
+SET GLOBAL debug_dbug=@saved_dbug;
SET GLOBAL master_verify_checksum=1;
# Emulate corruption in network
--echo # 5. Slave. Corruption in network
--connection slave
+SET @saved_dbug_slave = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,corrupt_queue_event";
START SLAVE IO_THREAD;
let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE
@@ -152,7 +154,7 @@ let $slave_sql_errno= 1593;
--source include/wait_for_slave_sql_error.inc
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
-SET GLOBAL debug_dbug= "";
+SET GLOBAL debug_dbug=@saved_dbug_slave;
# Start normal replication and compare same table on master
# and slave
@@ -167,10 +169,9 @@ let $diff_tables= master:test.t1, slave:test.t1;
# Clean up
--echo # 8. Clean up
--connection master
-SET GLOBAL debug_dbug= "";
+set @@global.debug_dbug = @saved_dbug;
SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
DROP TABLE t1;
--sync_slave_with_master
-SET GLOBAL debug_dbug= "";
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_incident.inc b/mysql-test/suite/rpl/include/rpl_incident.inc
index 350a2086681..75d28d6a6c6 100644
--- a/mysql-test/suite/rpl/include/rpl_incident.inc
+++ b/mysql-test/suite/rpl/include/rpl_incident.inc
@@ -20,7 +20,7 @@ CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT * FROM t1;
-let $debug_save= `SELECT @@GLOBAL.debug`;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
# This will generate an incident log event and store it in the binary
@@ -29,9 +29,7 @@ REPLACE INTO t1 VALUES (4);
--save_master_pos
SELECT * FROM t1;
---disable_query_log
-eval SET GLOBAL debug_dbug= '$debug_save';
---enable_query_log
+set @@global.debug_dbug = @saved_dbug;
connection slave;
# Wait until SQL thread stops with error LOST_EVENT on master
diff --git a/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc b/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc
index 4fdea651edd..46673ea4764 100644
--- a/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc
+++ b/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc
@@ -51,6 +51,7 @@ reset slave;
connection slave;
# Set debug flags on slave to force errors to occur
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
@@ -66,7 +67,7 @@ start slave;
call mtr.add_suppression("Failed during slave.* thread initialization");
-SET GLOBAL debug_dbug= "";
+set @@global.debug_dbug = @saved_dbug;
######################################################################
# Injecting faults in the init_slave option
diff --git a/mysql-test/suite/rpl/include/rpl_parallel.inc b/mysql-test/suite/rpl/include/rpl_parallel.inc
index 42354343084..b88d2126d4d 100644
--- a/mysql-test/suite/rpl/include/rpl_parallel.inc
+++ b/mysql-test/suite/rpl/include/rpl_parallel.inc
@@ -1951,7 +1951,6 @@ SELECT * FROM t2 WHERE a >= 1040 ORDER BY a;
--source include/stop_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
-
--echo *** MDEV-6676 - test disabling domain-based parallel replication ***
--connection server_1
# Let's do a bunch of transactions that will conflict if run out-of-order in
@@ -2000,7 +1999,7 @@ SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
# so sleep is ok here. And it's in general not possible to trigger reliably
# the race with debug_sync, since the bugfix makes the race impossible).
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
# Group commit with cid=10000, two event groups.
@@ -2012,7 +2011,7 @@ INSERT INTO t3 VALUES (120, 0);
SET @commit_id= 10001;
INSERT INTO t3 VALUES (121, 0);
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
--source include/save_master_gtid.inc
@@ -2044,7 +2043,7 @@ SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
# We inject a small sleep in the corresponding record_gtid() to make the race
# easier to hit.
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
# Group commit with cid=10010, two event groups.
@@ -2059,8 +2058,7 @@ INSERT INTO t3 VALUES (130, 0);
SET @commit_id= 10011;
INSERT INTO t3 VALUES (131, 0);
-SET SESSION debug_dbug=@old_dbug;
-
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
--source include/save_master_gtid.inc
@@ -2097,7 +2095,7 @@ SET GLOBAL debug_dbug= '+d,inject_mdev8031';
# complete. Finally an extra KILL check catches an unhandled, lingering
# deadlock kill. So rather artificial, but at least it exercises the
# relevant code paths.
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10200;
@@ -2119,7 +2117,7 @@ UPDATE t3 SET b=b+1 WHERE a=204;
UPDATE t3 SET b=b+1 WHERE a=203;
UPDATE t3 SET b=b+1 WHERE a=205;
UPDATE t3 SET b=b+1 WHERE a=205;
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a>=200 ORDER BY a;
--source include/save_master_gtid.inc
@@ -2144,7 +2142,7 @@ SET @old_max= @@GLOBAL.max_relay_log_size;
SET GLOBAL max_relay_log_size= 4096;
--connection server_1
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
--let $large= `SELECT REPEAT("*", 8192)`
@@ -2167,7 +2165,7 @@ eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */;
eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */;
--enable_query_log
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a>=200 ORDER BY a;
--source include/save_master_gtid.inc
@@ -2178,7 +2176,7 @@ SELECT * FROM t3 WHERE a>=200 ORDER BY a;
SELECT * FROM t3 WHERE a>=200 ORDER BY a;
--source include/stop_slave.inc
-SET GLOBAL debug_dbug= @old_debg;
+SET GLOBAL debug_dbug= @old_dbug;
SET GLOBAL max_relay_log_size= @old_max;
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc b/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc
index 25da12f30a3..7a6a758a508 100644
--- a/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc
+++ b/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc
@@ -47,7 +47,7 @@
--source include/stop_slave.inc
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
-SET @old_dbug= @@GLOBAL.debug_dbug;
+SET @old_debug= @@GLOBAL.debug_dbug;
SET GLOBAL slave_parallel_mode='optimistic';
SET GLOBAL slave_parallel_threads= 3;
CHANGE MASTER TO master_use_gtid=slave_pos;
diff --git a/mysql-test/suite/rpl/include/rpl_stop_middle_group.test b/mysql-test/suite/rpl/include/rpl_stop_middle_group.test
index 43c561c5b85..5c88c14d9b5 100644
--- a/mysql-test/suite/rpl/include/rpl_stop_middle_group.test
+++ b/mysql-test/suite/rpl/include/rpl_stop_middle_group.test
@@ -13,6 +13,7 @@ create table tm (a int auto_increment primary key) engine=myisam;
create table ti (a int auto_increment primary key) engine=innodb;
sync_slave_with_master;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set @@global.debug_dbug="+d,stop_slave_middle_group";
connection master;
@@ -135,8 +136,7 @@ eval SELECT "$error" AS Last_SQL_Error, @check as `true`;
select max(a) as two from tm;
select max(a) as one from ti;
-set @@global.debug_dbug="-d";
-
+SET @@GLOBAL.debug_dbug = @saved_dbug;
#
# clean-up
#
diff --git a/mysql-test/suite/rpl/r/circular_serverid0.result b/mysql-test/suite/rpl/r/circular_serverid0.result
index 112f9359ac4..928a0a48888 100644
--- a/mysql-test/suite/rpl/r/circular_serverid0.result
+++ b/mysql-test/suite/rpl/r/circular_serverid0.result
@@ -1,9 +1,9 @@
include/rpl_init.inc [topology=1->2->1]
include/rpl_connect.inc [creating M4]
include/rpl_connect.inc [creating M2]
-SET @old_debug= @@global.debug;
connection M2;
STOP SLAVE;
+SET @old_debug= @@global.debug;
SET GLOBAL debug_dbug= "+d,dbug.rows_events_to_delay_relay_logging";
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
diff --git a/mysql-test/suite/rpl/r/kill_race_condition.result b/mysql-test/suite/rpl/r/kill_race_condition.result
index 1181eb0b0b1..8e8645cdb58 100644
--- a/mysql-test/suite/rpl/r/kill_race_condition.result
+++ b/mysql-test/suite/rpl/r/kill_race_condition.result
@@ -4,6 +4,7 @@ connection master;
create table t1 (a int);
connection slave;
connection slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug='d,rows_log_event_before_open_table';
connection master;
insert t1 values (1),(2),(3);
@@ -13,7 +14,7 @@ kill slave_sql_thread;
set debug_sync='now SIGNAL go_ahead_sql';
include/wait_for_slave_sql_error.inc [errno=1927]
Last_SQL_Error = Error executing row event: 'Connection was killed'
-set global debug_dbug='';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
set debug_sync='RESET';
connection master;
drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
index 0c780122e38..3f01c80b195 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
@@ -11,8 +11,8 @@ grant select on t to x@y;
rollback;
show grants for x@y;
Grants for x@y
-GRANT USAGE ON *.* TO 'x'@'y'
-GRANT SELECT ON `d1`.`t` TO 'x'@'y'
+GRANT USAGE ON *.* TO `x`@`y`
+GRANT SELECT ON `d1`.`t` TO `x`@`y`
start transaction;
insert into t values (2);
revoke select on t from x@y;
@@ -23,7 +23,7 @@ s1
2
show grants for x@y;
Grants for x@y
-GRANT USAGE ON *.* TO 'x'@'y'
+GRANT USAGE ON *.* TO `x`@`y`
drop user x@y;
drop database d1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_rollback_cleanup.result b/mysql-test/suite/rpl/r/rpl_binlog_rollback_cleanup.result
new file mode 100644
index 00000000000..a677cbfecf6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_binlog_rollback_cleanup.result
@@ -0,0 +1,9 @@
+include/master-slave.inc
+[connection master]
+connection master;
+SET GLOBAL max_binlog_cache_size = 65536;
+CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=INNODB;
+ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result
index 74ba945b027..bdf2c707e9b 100644
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result
@@ -5,10 +5,11 @@ call mtr.add_suppression("Failed during slave I/O thread initialization");
call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593");
include/stop_slave.inc
reset slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
include/wait_for_slave_sql_error.inc [errno=1593]
Last_SQL_Error = 'Failed during slave thread initialization'
-SET GLOBAL debug_dbug="";
+SET @@GLOBAL.debug_dbug = @saved_dbug;
RESET SLAVE;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug41902.result b/mysql-test/suite/rpl/r/rpl_bug41902.result
index 8667795bd77..7d676ea73e3 100644
--- a/mysql-test/suite/rpl/r/rpl_bug41902.result
+++ b/mysql-test/suite/rpl/r/rpl_bug41902.result
@@ -2,6 +2,7 @@ include/master-slave.inc
[connection master]
connection slave;
stop slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@debug_dbug="d,simulate_find_log_pos_error";
reset slave;
ERROR HY000: Target log not found in binlog index
@@ -19,6 +20,7 @@ SET @@debug_dbug="";
reset slave;
change master to master_host='dummy';
connection master;
+SET @saved_dbug_m = @@global.debug_dbug;
SET @@debug_dbug="d,simulate_find_log_pos_error";
reset master;
ERROR HY000: Target log not found in binlog index
@@ -29,6 +31,7 @@ purge binary logs to 'master-bin.000001';
ERROR HY000: Target log not found in binlog index
SET @@debug_dbug="";
purge binary logs to 'master-bin.000001';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
==== clean up ====
CHANGE MASTER TO MASTER_HOST = '127.0.0.1';
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result
index a74b688d722..21d8ca22feb 100644
--- a/mysql-test/suite/rpl/r/rpl_checksum.result
+++ b/mysql-test/suite/rpl/r/rpl_checksum.result
@@ -76,6 +76,7 @@ connection master;
set @@global.binlog_checksum = CRC32;
insert into t1 values (1) /* will not be applied on slave due to simulation */;
connection slave;
+set @saved_dbug = @@global.debug_dbug;
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
@@ -83,15 +84,16 @@ Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary
select count(*) as zero from t1;
zero
0
-set @@global.debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
connection slave;
include/start_slave.inc
connection master;
set @@global.master_verify_checksum = 1;
+set @save_dbug = @@session.debug_dbug;
set @@session.debug_dbug='d,simulate_checksum_test_failure';
show binlog events;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
-set @@session.debug_dbug='';
+SET debug_dbug= @save_dbug;
set @@global.master_verify_checksum = default;
connection slave;
connection slave;
@@ -99,10 +101,11 @@ include/stop_slave.inc
connection master;
create table t2 (a int);
connection slave;
+set @saved_dbug = @@global.debug_dbug;
set @@global.debug_dbug='d,simulate_checksum_test_failure';
start slave io_thread;
include/wait_for_slave_io_error.inc [errno=1595,1913]
-set @@global.debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
start slave io_thread;
include/wait_for_slave_param.inc [Read_Master_Log_Pos]
set @@global.slave_sql_verify_checksum = 1;
@@ -110,7 +113,7 @@ set @@global.debug_dbug='d,simulate_checksum_test_failure';
start slave sql_thread;
include/wait_for_slave_sql_error.inc [errno=1593]
Last_SQL_Error = 'Error initializing relay log position: I/O error reading event at position 4'
-set @@global.debug_dbug='';
+set @@global.debug_dbug = @saved_dbug;
include/start_slave.inc
connection master;
connection slave;
diff --git a/mysql-test/suite/rpl/r/rpl_corruption.result b/mysql-test/suite/rpl/r/rpl_corruption.result
index 25a82fd60cd..f32b7c58ad1 100644
--- a/mysql-test/suite/rpl/r/rpl_corruption.result
+++ b/mysql-test/suite/rpl/r/rpl_corruption.result
@@ -13,6 +13,7 @@ connection master;
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
include/stop_slave.inc
# 2. Corruption in master binlog and SHOW BINLOG EVENTS
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
SHOW BINLOG EVENTS;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
@@ -33,10 +34,11 @@ START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1595,1743]
connection master;
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
-SET GLOBAL debug_dbug= "";
+SET GLOBAL debug_dbug=@saved_dbug;
SET GLOBAL master_verify_checksum=1;
# 5. Slave. Corruption in network
connection slave;
+SET @saved_dbug_slave = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,corrupt_queue_event";
START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1595,1743]
@@ -46,7 +48,7 @@ SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
START SLAVE SQL_THREAD;
include/wait_for_slave_sql_error.inc [errno=1593]
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
-SET GLOBAL debug_dbug= "";
+SET GLOBAL debug_dbug=@saved_dbug_slave;
# 7. Seek diff for tables on master and slave
connection slave;
include/start_slave.inc
@@ -55,9 +57,8 @@ connection slave;
include/diff_tables.inc [master:test.t1, slave:test.t1]
# 8. Clean up
connection master;
-SET GLOBAL debug_dbug= "";
+set @@global.debug_dbug = @saved_dbug;
SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
DROP TABLE t1;
connection slave;
-SET GLOBAL debug_dbug= "";
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index 9eca21b38e4..0797e66e9ec 100644
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
@@ -15,8 +15,8 @@ grant drop on test.* to rpl_do_grant@localhost;
connection slave;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
-GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost'
-GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost'
+GRANT SELECT ON *.* TO `rpl_do_grant`@`localhost`
+GRANT DROP ON `test`.* TO `rpl_do_grant`@`localhost`
connection master;
set password for rpl_do_grant@localhost=password("does it work?");
connection slave;
@@ -54,55 +54,55 @@ connection master;
create user rpl_do_grant@localhost;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant`@`localhost`
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
connection slave;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant`@`localhost`
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
connection master;
rename user rpl_do_grant@localhost to rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
connection master;
grant DELETE,INSERT on mysqltest1.* to rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
-GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
+GRANT INSERT, DELETE ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost`
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
-GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
+GRANT INSERT, DELETE ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost`
connection master;
revoke DELETE on mysqltest1.* from rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
-GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
+GRANT INSERT ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost`
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
-GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
+GRANT INSERT ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost`
connection master;
revoke all privileges, grant option from rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
-GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost`
connection master;
drop user rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
@@ -142,9 +142,9 @@ Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@localhost Execute,Alter Routine #
SHOW GRANTS FOR 'create_rout_db'@'localhost';
Grants for create_rout_db@localhost
-GRANT USAGE ON *.* TO 'create_rout_db'@'localhost' IDENTIFIED BY PASSWORD '*08792480350CBA057BDE781B9DF183B263934601'
-GRANT CREATE ROUTINE ON `bug42217_db`.* TO 'create_rout_db'@'localhost' WITH GRANT OPTION
-GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO 'create_rout_db'@'localhost'
+GRANT USAGE ON *.* TO `create_rout_db`@`localhost` IDENTIFIED BY PASSWORD '*08792480350CBA057BDE781B9DF183B263934601'
+GRANT CREATE ROUTINE ON `bug42217_db`.* TO `create_rout_db`@`localhost` WITH GRANT OPTION
+GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO `create_rout_db`@`localhost`
USE bug42217_db;
SHOW CREATE FUNCTION upgrade_del_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
@@ -236,11 +236,11 @@ GRANT EXECUTE ON PROCEDURE p1 TO 'user49119'@'localhost';
### Showing grants for both users: root and user49119 (master)
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
-GRANT USAGE ON *.* TO 'user49119'@'localhost'
-GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
+GRANT USAGE ON *.* TO `user49119`@`localhost`
+GRANT EXECUTE ON PROCEDURE `test`.`p1` TO `user49119`@`localhost`
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection slave;
@@ -248,11 +248,11 @@ connection slave;
### Showing grants for both users: root and user49119 (master)
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
-GRANT USAGE ON *.* TO 'user49119'@'localhost'
-GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
+GRANT USAGE ON *.* TO `user49119`@`localhost`
+GRANT EXECUTE ON PROCEDURE `test`.`p1` TO `user49119`@`localhost`
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection master;
@@ -266,10 +266,10 @@ ERROR 42000: There is no such grant defined for user 'root' on host 'localhost'
### after revoke statement failure
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
-GRANT USAGE ON *.* TO 'user49119'@'localhost'
+GRANT USAGE ON *.* TO `user49119`@`localhost`
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection slave;
@@ -278,10 +278,10 @@ connection slave;
### after revoke statement failure (should match
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
-GRANT USAGE ON *.* TO 'user49119'@'localhost'
+GRANT USAGE ON *.* TO `user49119`@`localhost`
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result
index a2b1d03c4fd..b8415977154 100644
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result
@@ -26,6 +26,7 @@ CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) :
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
connection master;
START TRANSACTION;
@@ -414,4 +415,5 @@ connection slave;
include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
include/start_slave.inc
+SET @@GLOBAL.debug_dbug = @saved_dbug;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result
index 457947cabe0..0a414cb3b1f 100644
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result
@@ -37,7 +37,6 @@ IGNORE_DOMAIN_IDS (AFTER) : 1
connection master;
include/rpl_start_server.inc [server_number=1]
# Master has restarted successfully
-set @@global.debug_dbug="-d";
connection slave;
include/stop_slave.inc
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result
index d5037f8cf94..4f50d7c6d85 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result
@@ -27,7 +27,7 @@ a
connection server_1;
include/kill_binlog_dump_threads.inc
INSERT INTO t1 VALUES (10);
-SET @old_dbug= @@GLOBAL.debug_dbug;
+SET @old_debug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
connection server_2;
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result b/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result
index cf26c3bf04a..dc45c0b9ab3 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result
@@ -7,7 +7,7 @@ set @@global.slave_net_timeout= 10;
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 60.000
-SET @save_dbug= @@GLOBAL.debug_dbug;
+SET @saved_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,simulate_slave_heartbeat_network_error";
CALL mtr.add_suppression('SET @master_heartbeat_period to master failed with error');
CALL mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again');
@@ -25,7 +25,7 @@ connection master;
drop table t1;
connection slave;
include/stop_slave.inc
-SET GLOBAL debug_dbug=@save_dbug;
+SET GLOBAL debug_dbug=@saved_dbug;
set @@global.slave_net_timeout= @restore_slave_net_timeout;
include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
index f3d69112efd..64da944a5dc 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
@@ -17,8 +17,8 @@ grant select on *.* to rpl_ignore_grant@localhost;
grant drop on test.* to rpl_ignore_grant@localhost;
show grants for rpl_ignore_grant@localhost;
Grants for rpl_ignore_grant@localhost
-GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost'
-GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost'
+GRANT SELECT ON *.* TO `rpl_ignore_grant`@`localhost`
+GRANT DROP ON `test`.* TO `rpl_ignore_grant`@`localhost`
connection slave;
show grants for rpl_ignore_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost'
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index 4eeb333d10c..1e0d6f537ab 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
@@ -44,54 +44,54 @@ GRANT INSERT ON test.* TO mysqltest6@localhost;
GRANT INSERT ON test.t1 TO mysqltest6@localhost;
show grants for mysqltest1@localhost;
Grants for mysqltest1@localhost
-GRANT USAGE ON *.* TO 'mysqltest1'@'localhost'
-GRANT SELECT ON `test`.`t1` TO 'mysqltest1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest1`@`localhost`
+GRANT SELECT ON `test`.`t1` TO `mysqltest1`@`localhost`
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
-GRANT USAGE ON *.* TO 'mysqltest2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, REFERENCES ON `test`.`t1` TO 'mysqltest2'@'localhost'
-GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, REFERENCES ON `test`.`t1` TO `mysqltest2`@`localhost`
+GRANT INSERT ON `test`.`t4` TO `mysqltest2`@`localhost`
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
-GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
-GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
-GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest3`@`localhost`
+GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost`
+GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost`
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
-GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
-GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
+GRANT SELECT ON `mysqltest2`.`t2` TO `mysqltest4`@`localhost`
show grants for mysqltest6@localhost;
Grants for mysqltest6@localhost
-GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost'
-GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost'
-GRANT INSERT ON `test`.`t1` TO 'mysqltest6'@'localhost'
+GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost`
+GRANT INSERT ON `test`.* TO `mysqltest6`@`localhost`
+GRANT INSERT ON `test`.`t1` TO `mysqltest6`@`localhost`
flush privileges;
show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
-GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
+GRANT USAGE ON *.* TO `mysqltest5`@`somehost`
set sql_mode="";
connection slave;
**** Checking grants on slave ****
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
-GRANT USAGE ON *.* TO 'mysqltest2'@'localhost'
-GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest2`@`localhost`
+GRANT INSERT ON `test`.`t4` TO `mysqltest2`@`localhost`
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
-GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
-GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
-GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest3`@`localhost`
+GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost`
+GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost`
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
-GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
-GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
+GRANT SELECT ON `mysqltest2`.`t2` TO `mysqltest4`@`localhost`
show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
-GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
+GRANT USAGE ON *.* TO `mysqltest5`@`somehost`
show grants for mysqltest6@localhost;
Grants for mysqltest6@localhost
-GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost'
-GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost'
+GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost`
+GRANT INSERT ON `test`.* TO `mysqltest6`@`localhost`
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
**** Revoking grants on master ****
@@ -102,27 +102,27 @@ REVOKE select(a) on t4
from mysqltest3@localhost;
show grants for mysqltest1@localhost;
Grants for mysqltest1@localhost
-GRANT USAGE ON *.* TO 'mysqltest1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest1`@`localhost`
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
-GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
-GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
-GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest3`@`localhost`
+GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost`
+GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost`
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
-GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
+GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
connection slave;
**** Checking grants on slave ****
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
-GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
-GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
-GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest3`@`localhost`
+GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost`
+GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost`
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
-GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
+GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
set global slave_exec_mode='IDEMPOTENT';
call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* error.* 1032");
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result
index 8fb4aa907cc..6dbe4417c5a 100644
--- a/mysql-test/suite/rpl/r/rpl_incident.result
+++ b/mysql-test/suite/rpl/r/rpl_incident.result
@@ -14,6 +14,7 @@ a
1
2
3
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
REPLACE INTO t1 VALUES (4);
SELECT * FROM t1;
@@ -22,6 +23,7 @@ a
2
3
4
+set @@global.debug_dbug = @saved_dbug;
connection slave;
call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
include/wait_for_slave_sql_error.inc [errno=1590]
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
index 91742814b4c..fc23734c645 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
@@ -4,12 +4,13 @@ connection slave;
stop slave;
reset slave;
connection slave;
+set @saved_dbug = @@global.debug_dbug;
SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
include/wait_for_slave_sql_error.inc [errno=1593]
Last_SQL_Error = 'Failed during slave thread initialization'
call mtr.add_suppression("Failed during slave.* thread initialization");
-SET GLOBAL debug_dbug= "";
+set @@global.debug_dbug = @saved_dbug;
connection slave;
reset slave;
SET GLOBAL init_slave= "garbage";
diff --git a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
index b96153a226a..d384422f88a 100644
--- a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
+++ b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
@@ -2,10 +2,10 @@ include/master-slave.inc
[connection master]
connection master;
set @old_master_binlog_checksum= @@global.binlog_checksum;
-set @old_slave_dbug= @@global.debug_dbug;
connection slave;
include/stop_slave.inc
# Test slave with no capability gets dummy event, which is ignored.
+set @old_dbug= @@global.debug_dbug;
SET @@global.debug_dbug='+d,simulate_slave_capability_none';
include/start_slave.inc
connection master;
@@ -50,7 +50,7 @@ slave-relay-bin.000005 # Annotate_rows # # INSERT INTO t1 /* A comment just to m
slave-relay-bin.000005 # Table_map # # table_id: # (test.t1)
slave-relay-bin.000005 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-relay-bin.000005 # Query # # COMMIT
-set @@global.debug_dbug= @old_slave_dbug;
+set @@global.debug_dbug= @old_dbug;
# Test dummy event is checksummed correctly.
connection master;
set @@global.binlog_checksum = CRC32;
@@ -148,10 +148,10 @@ select @@global.log_slave_updates;
select @@global.replicate_annotate_row_events;
@@global.replicate_annotate_row_events
1
-set @@global.debug_dbug= @old_slave_dbug;
Clean up.
connection master;
set @@global.binlog_checksum = @old_master_binlog_checksum;
DROP TABLE t1, t2;
connection slave;
+set @@global.debug_dbug= @old_dbug;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev-11092.result b/mysql-test/suite/rpl/r/rpl_mdev-11092.result
index 90b809477b2..8bc8fe4a20b 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev-11092.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev-11092.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*");
+call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*");
SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
SET GLOBAL max_binlog_stmt_cache_size = 4096;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result
index d994e4fdef6..657b3ba7448 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel.result
@@ -1512,7 +1512,7 @@ SET GLOBAL slave_parallel_threads=10;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
connection server_1;
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10000;
ANALYZE TABLE t2;
@@ -1521,7 +1521,7 @@ test.t2 analyze status OK
INSERT INTO t3 VALUES (120, 0);
SET @commit_id= 10001;
INSERT INTO t3 VALUES (121, 0);
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
a b
120 0
@@ -1543,7 +1543,7 @@ include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
connection server_1;
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @old_server_id= @@SESSION.server_id;
SET SESSION server_id= 100;
@@ -1553,7 +1553,7 @@ SET SESSION server_id= @old_server_id;
INSERT INTO t3 VALUES (130, 0);
SET @commit_id= 10011;
INSERT INTO t3 VALUES (131, 0);
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
a b
130 0
@@ -1579,7 +1579,7 @@ include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_mdev8031';
connection server_1;
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10200;
INSERT INTO t3 VALUES (203, 1);
@@ -1600,7 +1600,7 @@ UPDATE t3 SET b=b+1 WHERE a=204;
UPDATE t3 SET b=b+1 WHERE a=203;
UPDATE t3 SET b=b+1 WHERE a=205;
UPDATE t3 SET b=b+1 WHERE a=205;
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a>=200 ORDER BY a;
a b
201 3
@@ -1630,11 +1630,11 @@ SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill';
SET @old_max= @@GLOBAL.max_relay_log_size;
SET GLOBAL max_relay_log_size= 4096;
connection server_1;
-SET @old_dbug= @@SESSION.debug_dbug;
+SET @old_dbug_slave= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10210;
Omit long queries that cause relaylog rotations and transaction retries...
-SET SESSION debug_dbug=@old_dbug;
+SET SESSION debug_dbug=@old_dbug_slave;
SELECT * FROM t3 WHERE a>=200 ORDER BY a;
a b
201 6
@@ -1654,7 +1654,7 @@ a b
204 7
205 5
include/stop_slave.inc
-SET GLOBAL debug_dbug= @old_debg;
+SET GLOBAL debug_dbug= @old_dbug;
SET GLOBAL max_relay_log_size= @old_max;
include/start_slave.inc
*** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result b/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result
index 570d2534ed7..3dd5a3ea83c 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result
@@ -4,7 +4,7 @@ connection server_2;
include/stop_slave.inc
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
-SET @old_dbug= @@GLOBAL.debug_dbug;
+SET @old_debug= @@GLOBAL.debug_dbug;
SET GLOBAL slave_parallel_mode='optimistic';
SET GLOBAL slave_parallel_threads= 3;
CHANGE MASTER TO master_use_gtid=slave_pos;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
index ca202a66b0e..74d9cf55cd4 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
@@ -352,7 +352,7 @@ include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
-SET @old_dbug= @@GLOBAL.debug_dbug;
+SET @old_debug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
connection server_1;
ALTER TABLE t2 COMMENT "123abc";
diff --git a/mysql-test/suite/rpl/r/rpl_row_big_table_id.result b/mysql-test/suite/rpl/r/rpl_row_big_table_id.result
index 6fece52dda3..9a7a97e3d00 100644
--- a/mysql-test/suite/rpl/r/rpl_row_big_table_id.result
+++ b/mysql-test/suite/rpl/r/rpl_row_big_table_id.result
@@ -2,6 +2,7 @@ include/master-slave.inc
[connection master]
connection master;
include/rpl_restart_server.inc [server_number=1]
+SET @saved_dbug = @@SESSION.debug_dbug;
SET @@debug_dbug="d,simulate_big_table_id";
CREATE TABLE t (a int);
INSERT INTO t SET a= 0;
@@ -42,5 +43,6 @@ master-bin.000002 # Query 1 # COMMIT
connection slave;
connection master;
DROP TABLE t;
+SET debug_dbug= @saved_dbug;
connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result b/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
index 269dc16733a..f1a0059a04f 100644
--- a/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
+++ b/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
@@ -2,6 +2,7 @@ include/master-slave.inc
[connection master]
connection slave;
include/stop_slave.inc
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET GLOBAL log_warnings = 2;
SET GLOBAL debug_dbug="d,inject_long_find_row_note";
include/start_slave.inc
@@ -18,7 +19,7 @@ connection slave;
FOUND 1 /The slave is applying a ROW event on behalf of an UPDATE statement on table t1 and is currently taking a considerable amount/ in mysqld.2.err
FOUND 1 /The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount/ in mysqld.2.err
include/stop_slave.inc
-SET GLOBAL debug_dbug = '';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
SET GLOBAL log_warnings = 2;
include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_skip_repl.result b/mysql-test/suite/rpl/r/rpl_semi_sync_skip_repl.result
index ec9607148d4..d517d53c6da 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_skip_repl.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_skip_repl.result
@@ -11,6 +11,7 @@ SET @@GLOBAL.rpl_semi_sync_slave_enabled = 1;
include/start_slave.inc
connection master;
CREATE TABLE t1 (a INT) ENGINE=innodb;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug="d,dbug_master_binlog_over_2GB";
SET @@SESSION.skip_replication=1;
INSERT INTO t1 SET a=1;
@@ -20,7 +21,7 @@ SET @@GLOBAL.debug_dbug="";
FLUSH LOGS;
connection slave;
connection master;
-SET @@GLOBAL.debug_dbug=@@GLOBAL.debug_dbug;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
SET @@GLOBAL.rpl_semi_sync_master_timeout = 10000;
SET @@GLOBAL.rpl_semi_sync_master_enabled = 0;
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_running.result b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
index 729c718390a..353ff379776 100644
--- a/mysql-test/suite/rpl/r/rpl_show_slave_running.result
+++ b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
@@ -3,6 +3,7 @@ include/master-slave.inc
connection slave;
SET DEBUG_SYNC= 'RESET';
include/stop_slave.inc
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= 'd,dbug.before_get_running_status_yes';
Slave_running, Slave_IO_Running, Slave_SQL_Running, must be OFF, NO, NO in three following queries
SHOW STATUS LIKE 'Slave_running';
@@ -34,7 +35,7 @@ Slave_running ON
Slave_IO_Running= Yes
Slave_SQL_Running= Yes
connection slave;
-set global debug_dbug= '';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
SET DEBUG_SYNC= 'RESET';
End of tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
index be2a17ea2b7..8f855813554 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
connection slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@global.debug_dbug= '+d,remove_slave_load_file_before_write';
connection master;
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
@@ -21,5 +22,5 @@ call mtr.add_suppression("Slave: Can't get stat of .*");
call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* error.* 13");
call mtr.add_suppression("Slave: File.* not found.*");
call mtr.add_suppression("Slave SQL: Error .File.* not found.* error.* 29");
-SET @@global.debug_dbug= '';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
index f08f50f2467..b670a16bfcd 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
@@ -6,6 +6,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
create table tm (a int auto_increment primary key) engine=myisam;
create table ti (a int auto_increment primary key) engine=innodb;
connection slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set @@global.debug_dbug="+d,stop_slave_middle_group";
connection master;
begin;
@@ -74,7 +75,7 @@ two
select max(a) as one from ti;
one
1
-set @@global.debug_dbug="-d";
+SET @@GLOBAL.debug_dbug = @saved_dbug;
include/rpl_reset.inc
connection master;
drop table tm, ti;
diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result
index 4b9c544527b..a4dbf13290a 100644
--- a/mysql-test/suite/rpl/r/rpl_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result
@@ -15,7 +15,7 @@ include/stop_slave.inc
# Suspend the INSERT statement in current transaction on SQL thread.
# It guarantees that SQL thread is applying the transaction when
# STOP SLAVE command launchs.
-set @old_debug=@@global.debug;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= '+d,after_mysql_insert';
include/start_slave.inc
@@ -75,6 +75,7 @@ connection master;
connection slave;
# Test end
+SET @@GLOBAL.debug_dbug = @saved_dbug;
include/restart_slave.inc
connection slave;
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
@@ -99,7 +100,7 @@ connection slave;
include/stop_slave.inc
connection master;
include/stop_dump_threads.inc
-set @old_debug=@@global.debug;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= '+d,dump_thread_wait_before_send_xid';
connection slave;
include/start_slave.inc
@@ -122,6 +123,7 @@ connection slave;
include/wait_for_slave_to_stop.inc
connection slave1;
connection master;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
include/stop_dump_threads.inc
connection slave1;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_view_debug.result b/mysql-test/suite/rpl/r/rpl_view_debug.result
index 497f4303698..1ec3dda9daa 100644
--- a/mysql-test/suite/rpl/r/rpl_view_debug.result
+++ b/mysql-test/suite/rpl/r/rpl_view_debug.result
@@ -21,6 +21,7 @@ Tables_in_test
t1
v1
connection master;
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug="d,simulate_register_view_failure";
CREATE VIEW v2 as SELECT * FROM t1;
ERROR HY000: Out of memory.
@@ -36,4 +37,5 @@ v1
connection master;
DROP VIEW IF EXISTS v1;
DROP TABLE t1;
+SET debug_dbug= @saved_dbug;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/circular_serverid0.test b/mysql-test/suite/rpl/t/circular_serverid0.test
index 20ad58e2c52..097a2932404 100644
--- a/mysql-test/suite/rpl/t/circular_serverid0.test
+++ b/mysql-test/suite/rpl/t/circular_serverid0.test
@@ -22,10 +22,9 @@
# The parameter reflects binlog-row-event-max-size @cnf.
--let $row_size=1024
-SET @old_debug= @@global.debug;
-
--connection M2
STOP SLAVE;
+SET @old_debug= @@global.debug;
SET GLOBAL debug_dbug= "+d,dbug.rows_events_to_delay_relay_logging";
START SLAVE IO_THREAD;
--source include/wait_for_slave_io_to_start.inc
diff --git a/mysql-test/suite/rpl/t/kill_race_condition.test b/mysql-test/suite/rpl/t/kill_race_condition.test
index 0f3b44864fe..25a7b18bac2 100644
--- a/mysql-test/suite/rpl/t/kill_race_condition.test
+++ b/mysql-test/suite/rpl/t/kill_race_condition.test
@@ -7,6 +7,7 @@ create table t1 (a int);
--sync_slave_with_master
connection slave;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug='d,rows_log_event_before_open_table';
connection master;
@@ -22,7 +23,7 @@ set debug_sync='now SIGNAL go_ahead_sql';
--source include/wait_for_slave_sql_error.inc
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo Last_SQL_Error = $error
-set global debug_dbug='';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
set debug_sync='RESET';
connection master;
drop table t1;
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_rollback_cleanup.test b/mysql-test/suite/rpl/t/rpl_binlog_rollback_cleanup.test
new file mode 100644
index 00000000000..ed4d713f626
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_rollback_cleanup.test
@@ -0,0 +1,46 @@
+# ==== Purpose ====
+#
+# Test verifies that when flushing an event to binary log fails the transaction
+# is successfully rolled back and following COMMIT command doesn't report any
+# assert.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - SET max_binlog_cache_size=64K
+# 1 - Create an Innodb table and insert required amount of data. Execute an
+# UPDATE operation which generates a big update event whose size exceeds
+# max_binlog_cache_size.
+# 2 - Wait for error 1197. Execute COMMIT command.
+# 3 - COMMIT should be successful.
+#
+# ==== References ====
+#
+# MDEV-18514: Assertion `!writer.checksum_len || writer.remains == 0' failed
+#
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+--connection master
+let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1);
+SET GLOBAL max_binlog_cache_size = 65536;
+CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=INNODB;
+let $data = `select concat('"', repeat('a',6000), '"')`;
+let $data1 = `select concat('"', repeat('b',6000), '"')`;
+--disable_query_log
+eval INSERT INTO t1 (a, data) VALUES (1, CONCAT($data, $data));
+eval INSERT INTO t1 (a, data) VALUES (2, CONCAT($data, $data));
+eval INSERT INTO t1 (a, data) VALUES (3, CONCAT($data, $data));
+eval INSERT INTO t1 (a, data) VALUES (4, CONCAT($data, $data));
+eval INSERT INTO t1 (a, data) VALUES (5, CONCAT($data, $data));
+START TRANSACTION;
+--error ER_TRANS_CACHE_FULL
+eval UPDATE t1 SET data=$data1;
+COMMIT;
+--enable_query_log
+
+--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test
index 2273219a821..0b2cbb6365c 100644
--- a/mysql-test/suite/rpl/t/rpl_bug33931.test
+++ b/mysql-test/suite/rpl/t/rpl_bug33931.test
@@ -15,6 +15,7 @@ call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.*
reset slave;
# Set debug flags on slave to force errors to occur
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
--disable_query_log
@@ -39,7 +40,7 @@ start slave;
#
# Cleanup
#
-SET GLOBAL debug_dbug="";
+SET @@GLOBAL.debug_dbug = @saved_dbug;
# Clear Last_SQL_Error
RESET SLAVE;
diff --git a/mysql-test/suite/rpl/t/rpl_bug41902.test b/mysql-test/suite/rpl/t/rpl_bug41902.test
index fe9452b0eda..bb6c572580f 100644
--- a/mysql-test/suite/rpl/t/rpl_bug41902.test
+++ b/mysql-test/suite/rpl/t/rpl_bug41902.test
@@ -15,7 +15,7 @@ source include/master-slave.inc;
connection slave;
stop slave;
-
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@debug_dbug="d,simulate_find_log_pos_error";
--error ER_UNKNOWN_TARGET_BINLOG
@@ -36,6 +36,7 @@ reset slave;
change master to master_host='dummy';
connection master;
+SET @saved_dbug_m = @@global.debug_dbug;
SET @@debug_dbug="d,simulate_find_log_pos_error";
--error ER_UNKNOWN_TARGET_BINLOG
reset master;
@@ -53,10 +54,12 @@ purge binary logs to 'master-bin.000001';
--disable_query_log
call mtr.add_suppression("Failed to locate old binlog or relay log files");
call mtr.add_suppression("MYSQL_BIN_LOG::purge_logs was called with file ..master-bin.000001 not listed in the index");
+set @@global.debug_dbug = @saved_dbug_m;
connection slave;
call mtr.add_suppression("Failed to locate old binlog or relay log files");
call mtr.add_suppression("MYSQL_BIN_LOG::purge_logs was called with file ..master-bin.000001 not listed in the index");
--enable_query_log
+SET @@GLOBAL.debug_dbug = @saved_dbug;
--echo ==== clean up ====
CHANGE MASTER TO MASTER_HOST = '127.0.0.1';
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test
index 9088866d28b..f3ba39fb330 100644
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test
@@ -35,6 +35,7 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
connection master;
@@ -379,5 +380,5 @@ connection slave;
--source include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
--source include/start_slave.inc
-
+SET @@GLOBAL.debug_dbug = @saved_dbug;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test
index 3619ede2c01..6dafab192a0 100644
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test
@@ -64,7 +64,6 @@ connection master;
#--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--echo # Master has restarted successfully
-set @@global.debug_dbug="-d";
save_master_pos;
--connection slave
diff --git a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
index 9c4cc1bc34d..02665c70b9e 100644
--- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
@@ -26,7 +26,7 @@ call mtr.add_suppression("Fatal error: The slave I/O thread stops because master
call mtr.add_suppression("Slave I/O thread .* register on master");
#Test case 1: Try to get the value of the UNIX_TIMESTAMP from master under network disconnection
-let $debug_saved= `select @@global.debug`;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
# set up two parameters to pass into include/rpl_get_master_version_and_clock
let $dbug_sync_point= 'debug_lock.before_get_UNIX_TIMESTAMP';
@@ -40,11 +40,9 @@ let $dbug_sync_point= 'debug_lock.before_get_SERVER_ID';
let $debug_sync_action= 'now SIGNAL signal.get_server_id';
source include/rpl_get_master_version_and_clock.test;
-eval set global debug_dbug= '$debug_saved';
-
# cleanup
-
+SET @@GLOBAL.debug_dbug = @saved_dbug;
# is not really necessary but avoids mtr post-run env check warnings
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test b/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test
index 22cf10afba3..bc28ebddf5e 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_reconnect.test
@@ -42,7 +42,7 @@ SELECT * FROM t1 ORDER BY a;
# interfere with our DBUG error injection.
--source include/kill_binlog_dump_threads.inc
INSERT INTO t1 VALUES (10);
-SET @old_dbug= @@GLOBAL.debug_dbug;
+SET @old_debug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
--save_master_pos
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_debug.test b/mysql-test/suite/rpl/t/rpl_heartbeat_debug.test
index 6a426ed1e9f..bd66a249ada 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_debug.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_debug.test
@@ -18,7 +18,7 @@ set @@global.slave_net_timeout= 10;
# default period slave_net_timeout/2
#
--query_vertical show status like 'Slave_heartbeat_period';
-SET @save_dbug= @@GLOBAL.debug_dbug;
+SET @saved_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,simulate_slave_heartbeat_network_error";
CALL mtr.add_suppression('SET @master_heartbeat_period to master failed with error');
CALL mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again');
@@ -44,7 +44,7 @@ drop table t1;
connection slave;
--source include/stop_slave.inc
--disable_warnings
-SET GLOBAL debug_dbug=@save_dbug;
+SET GLOBAL debug_dbug=@saved_dbug;
set @@global.slave_net_timeout= @restore_slave_net_timeout;
--enable_warnings
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
index ed26e61d9b6..046a65f77db 100644
--- a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
+++ b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
@@ -5,9 +5,7 @@
--source include/master-slave.inc
connection master;
-
set @old_master_binlog_checksum= @@global.binlog_checksum;
-set @old_slave_dbug= @@global.debug_dbug;
# MDEV-4475: Cannot replicate to old server when binlog contains
# empty Gtid_list event
@@ -16,6 +14,7 @@ set @old_slave_dbug= @@global.debug_dbug;
connection slave;
--source include/stop_slave.inc
--echo # Test slave with no capability gets dummy event, which is ignored.
+set @old_dbug= @@global.debug_dbug;
SET @@global.debug_dbug='+d,simulate_slave_capability_none';
--source include/start_slave.inc
@@ -52,7 +51,7 @@ let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
let $binlog_start= $relaylog_start;
let $binlog_limit=0,10;
--source include/show_relaylog_events.inc
-set @@global.debug_dbug= @old_slave_dbug;
+set @@global.debug_dbug= @old_dbug;
--echo # Test dummy event is checksummed correctly.
@@ -150,11 +149,10 @@ let $binlog_limit=0,5;
select @@global.log_slave_updates;
select @@global.replicate_annotate_row_events;
-set @@global.debug_dbug= @old_slave_dbug;
-
--echo Clean up.
connection master;
set @@global.binlog_checksum = @old_master_binlog_checksum;
DROP TABLE t1, t2;
sync_slave_with_master;
+set @@global.debug_dbug= @old_dbug;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mdev-11092.test b/mysql-test/suite/rpl/t/rpl_mdev-11092.test
index 31a385b40e6..782d24803c7 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev-11092.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev-11092.test
@@ -6,7 +6,7 @@
########################################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*");
+call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*");
let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1);
let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
index e08472d5f51..0b10dd3cda7 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
@@ -325,7 +325,7 @@ INSERT INTO t2 VALUES (1,1), (2,1), (3,1), (4,1), (5,1);
--connection server_2
--source include/sync_with_master_gtid.inc
--source include/stop_slave.inc
-SET @old_dbug= @@GLOBAL.debug_dbug;
+SET @old_debug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
--connection server_1
diff --git a/mysql-test/suite/rpl/t/rpl_row_big_table_id.test b/mysql-test/suite/rpl/t/rpl_row_big_table_id.test
index 0c6f9d5e862..abf22cc876e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_big_table_id.test
+++ b/mysql-test/suite/rpl/t/rpl_row_big_table_id.test
@@ -17,6 +17,7 @@
--let $rpl_server_number= 1
--source include/rpl_restart_server.inc
+SET @saved_dbug = @@SESSION.debug_dbug;
SET @@debug_dbug="d,simulate_big_table_id";
CREATE TABLE t (a int);
@@ -51,7 +52,7 @@ if (`SELECT sum(a) != 6 FROM t`)
--connection master
DROP TABLE t;
-
+SET debug_dbug= @saved_dbug;
--sync_slave_with_master
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test b/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test
index 9c0ee1cdbbb..e3edabe239d 100644
--- a/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test
+++ b/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test
@@ -9,7 +9,7 @@
# - setup log_warnings and debug
--connection slave
--source include/stop_slave.inc
---let $debug_save= `SELECT @@GLOBAL.debug_dbug`
+SET @saved_dbug = @@GLOBAL.debug_dbug;
--let $log_warnings_save= `SELECT @@GLOBAL.log_warnings`
SET GLOBAL log_warnings = 2;
@@ -50,7 +50,7 @@ DROP TABLE t1;
# cleanup
--source include/stop_slave.inc
---eval SET GLOBAL debug_dbug = '$debug_save'
+SET @@GLOBAL.debug_dbug = @saved_dbug;
--eval SET GLOBAL log_warnings = $log_warnings_save
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_index_choice.test b/mysql-test/suite/rpl/t/rpl_row_index_choice.test
index 0ad9b315d66..958fa2352c2 100644
--- a/mysql-test/suite/rpl/t/rpl_row_index_choice.test
+++ b/mysql-test/suite/rpl/t/rpl_row_index_choice.test
@@ -47,6 +47,7 @@ sync_slave_with_master;
connection slave;
ANALYZE TABLE t2;
--echo # Slave will crash if using the wrong or no index
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
connection master;
@@ -238,6 +239,5 @@ connection master;
DROP TABLE t1;
sync_slave_with_master;
connection slave;
-SET GLOBAL debug_dbug="";
-
+SET @@GLOBAL.debug_dbug = @saved_dbug;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test b/mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test
index 8dd30b8a161..587e1290187 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_skip_repl.test
@@ -32,7 +32,7 @@ source include/start_slave.inc;
CREATE TABLE t1 (a INT) ENGINE=innodb;
# Make the following events as if they offset over 2GB from the beginning of binlog
---let $sav_debug_dbug=@@GLOBAL.debug_dbug
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug="d,dbug_master_binlog_over_2GB";
SET @@SESSION.skip_replication=1;
INSERT INTO t1 SET a=1;
@@ -50,7 +50,7 @@ FLUSH LOGS;
# Clean up
#
--connection master
---eval SET @@GLOBAL.debug_dbug=$sav_debug_dbug
+SET @@GLOBAL.debug_dbug = @saved_dbug;
--eval SET @@GLOBAL.rpl_semi_sync_master_timeout = $sav_timeout_master
--eval SET @@GLOBAL.rpl_semi_sync_master_enabled = $sav_enabled_master
diff --git a/mysql-test/suite/rpl/t/rpl_show_slave_running.test b/mysql-test/suite/rpl/t/rpl_show_slave_running.test
index 2cb44fc6ac1..cb4a8819a5b 100644
--- a/mysql-test/suite/rpl/t/rpl_show_slave_running.test
+++ b/mysql-test/suite/rpl/t/rpl_show_slave_running.test
@@ -11,7 +11,7 @@ connection slave;
SET DEBUG_SYNC= 'RESET';
source include/stop_slave.inc;
-let $debug_saved= `select @@global.debug`;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= 'd,dbug.before_get_running_status_yes'; # to block due-started IO
# Test 1. Slave is stopped
@@ -77,7 +77,7 @@ echo Slave_SQL_Running= $status;
connection slave;
-eval set global debug_dbug= '$debug_saved';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
SET DEBUG_SYNC= 'RESET';
--echo End of tests
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
index 69319bad4a0..100514089d5 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
@@ -29,7 +29,7 @@
##########################################################################
connection slave;
---let $old_debug= `SELECT @@global.debug_dbug`
+SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@global.debug_dbug= '+d,remove_slave_load_file_before_write';
connection master;
@@ -74,7 +74,7 @@ call mtr.add_suppression("Slave: File.* not found.*");
call mtr.add_suppression("Slave SQL: Error .File.* not found.* error.* 29");
--let $rpl_only_running_threads= 1
-eval SET @@global.debug_dbug= '$old_debug';
+SET @@GLOBAL.debug_dbug = @saved_dbug;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
index 305c5b4b530..619b57994c2 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
@@ -3,10 +3,10 @@
# For details look into extra/rpl_tests/rpl_lower_case_table_names.test
#
+-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
-- source include/have_innodb.inc
-- source include/not_windows.inc
--- source include/have_binlog_format_mixed_or_statement.inc
-- let $engine=InnoDB
-- source include/rpl_lower_case_table_names.test
diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test
index 291524126ec..17efa7ade3b 100644
--- a/mysql-test/suite/rpl/t/rpl_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test
@@ -22,7 +22,7 @@ source include/stop_slave.inc;
--echo # Suspend the INSERT statement in current transaction on SQL thread.
--echo # It guarantees that SQL thread is applying the transaction when
--echo # STOP SLAVE command launchs.
-set @old_debug=@@global.debug;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= '+d,after_mysql_insert';
source include/start_slave.inc;
@@ -44,9 +44,7 @@ source include/rpl_stop_slave.test;
--echo
--echo # Test end
---disable_query_log
-set global debug_dbug= @old_debug;
---enable_query_log
+SET @@GLOBAL.debug_dbug = @saved_dbug;
source include/restart_slave_sql.inc;
connection slave;
@@ -79,7 +77,7 @@ connection master;
# make sure that there are no zombie threads
--source include/stop_dump_threads.inc
-set @old_debug=@@global.debug;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set global debug_dbug= '+d,dump_thread_wait_before_send_xid';
connection slave;
@@ -126,9 +124,7 @@ reap;
# sure that we disable the DBUG_EXECUTE_IF
# that would set the dump thread to wait
connection master;
---disable_query_log
-set global debug_dbug= @old_debug;
---enable_query_log
+SET @@GLOBAL.debug_dbug = @saved_dbug;
# make sure that there are no zombie threads
--source include/stop_dump_threads.inc
diff --git a/mysql-test/suite/rpl/t/rpl_view_debug.test b/mysql-test/suite/rpl/t/rpl_view_debug.test
index a00b6733dea..0803692496e 100644
--- a/mysql-test/suite/rpl/t/rpl_view_debug.test
+++ b/mysql-test/suite/rpl/t/rpl_view_debug.test
@@ -18,6 +18,7 @@ sync_slave_with_master;
# view already has to be on slave
show tables;
connection master;
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug="d,simulate_register_view_failure";
--error ER_OUT_OF_RESOURCES
@@ -30,5 +31,5 @@ show tables;
connection master;
DROP VIEW IF EXISTS v1;
DROP TABLE t1;
-
+SET debug_dbug= @saved_dbug;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/sql_sequence/rebuild.result b/mysql-test/suite/sql_sequence/rebuild.result
new file mode 100644
index 00000000000..c8dc47ad8fa
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/rebuild.result
@@ -0,0 +1,161 @@
+#
+# MDEV-15977 Assertion `! thd->in_sub_stmt' failed in trans_commit_stmt
+#
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+ALTER TABLE s1 FORCE;
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+CREATE TABLE t2 (b VARCHAR(64)) ENGINE=MyISAM;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT TABLE_NAME FROM INFORMATION_SCHEMA.PARTITIONS;
+INSERT INTO t1 VALUES (1);
+select * from t1;
+a
+1
+select * from t2;
+b
+ALL_PLUGINS
+APPLICABLE_ROLES
+CHARACTER_SETS
+CHECK_CONSTRAINTS
+CLIENT_STATISTICS
+COLLATIONS
+COLLATION_CHARACTER_SET_APPLICABILITY
+COLUMNS
+COLUMN_PRIVILEGES
+ENABLED_ROLES
+ENGINES
+EVENTS
+FILES
+GEOMETRY_COLUMNS
+GLOBAL_STATUS
+GLOBAL_VARIABLES
+INDEX_STATISTICS
+INNODB_BUFFER_PAGE
+INNODB_BUFFER_PAGE_LRU
+INNODB_BUFFER_POOL_STATS
+INNODB_CMPMEM
+INNODB_CMP_PER_INDEX
+INNODB_LOCKS
+INNODB_LOCK_WAITS
+INNODB_METRICS
+INNODB_SYS_COLUMNS
+INNODB_SYS_FIELDS
+INNODB_SYS_FOREIGN
+INNODB_SYS_FOREIGN_COLS
+INNODB_SYS_INDEXES
+INNODB_SYS_TABLES
+INNODB_SYS_VIRTUAL
+INNODB_TRX
+KEY_CACHES
+KEY_COLUMN_USAGE
+PARAMETERS
+PARTITIONS
+PLUGINS
+PROCESSLIST
+PROFILING
+REFERENTIAL_CONSTRAINTS
+ROUTINES
+SCHEMATA
+SCHEMA_PRIVILEGES
+SESSION_STATUS
+SESSION_VARIABLES
+SPATIAL_REF_SYS
+STATISTICS
+SYSTEM_VARIABLES
+TABLES
+TABLESPACES
+TABLE_CONSTRAINTS
+TABLE_PRIVILEGES
+TABLE_STATISTICS
+TRIGGERS
+USER_PRIVILEGES
+USER_STATISTICS
+VIEWS
+accounts
+column_stats
+columns_priv
+cond_instances
+db
+event
+events_stages_current
+events_stages_history
+events_stages_history_long
+events_stages_summary_by_account_by_event_name
+events_stages_summary_by_host_by_event_name
+events_stages_summary_by_thread_by_event_name
+events_stages_summary_by_user_by_event_name
+events_stages_summary_global_by_event_name
+events_statements_current
+events_statements_history
+events_statements_history_long
+events_statements_summary_by_account_by_event_name
+events_statements_summary_by_digest
+events_statements_summary_by_host_by_event_name
+events_statements_summary_by_thread_by_event_name
+events_statements_summary_by_user_by_event_name
+events_statements_summary_global_by_event_name
+events_waits_current
+events_waits_history
+events_waits_history_long
+events_waits_summary_by_account_by_event_name
+events_waits_summary_by_host_by_event_name
+events_waits_summary_by_instance
+events_waits_summary_by_thread_by_event_name
+events_waits_summary_by_user_by_event_name
+events_waits_summary_global_by_event_name
+file_instances
+file_summary_by_event_name
+file_summary_by_instance
+func
+general_log
+global_suppressions
+gtid_slave_pos
+help_category
+help_keyword
+help_relation
+help_topic
+host
+host_cache
+hosts
+index_stats
+innodb_index_stats
+innodb_table_stats
+mutex_instances
+objects_summary_global_by_type
+performance_timers
+plugin
+proc
+procs_priv
+proxies_priv
+roles_mapping
+rwlock_instances
+s1
+servers
+session_account_connect_attrs
+session_connect_attrs
+setup_actors
+setup_consumers
+setup_instruments
+setup_objects
+setup_timers
+slow_log
+socket_instances
+socket_summary_by_event_name
+socket_summary_by_instance
+t1
+t2
+table_io_waits_summary_by_index_usage
+table_io_waits_summary_by_table
+table_lock_waits_summary_by_table
+table_stats
+tables_priv
+test_suppressions
+threads
+time_zone
+time_zone_leap_second
+time_zone_name
+time_zone_transition
+time_zone_transition_type
+transaction_registry
+user
+users
+DROP TABLE t1, t2, s1;
diff --git a/mysql-test/suite/sql_sequence/rebuild.test b/mysql-test/suite/sql_sequence/rebuild.test
new file mode 100644
index 00000000000..7c00e0be7cc
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/rebuild.test
@@ -0,0 +1,20 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-15977 Assertion `! thd->in_sub_stmt' failed in trans_commit_stmt
+--echo #
+
+CREATE SEQUENCE s1 ENGINE=InnoDB;
+ALTER TABLE s1 FORCE;
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+CREATE TABLE t2 (b VARCHAR(64)) ENGINE=MyISAM;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT TABLE_NAME FROM INFORMATION_SCHEMA.PARTITIONS;
+INSERT INTO t1 VALUES (1);
+--sorted_result
+select * from t1;
+--sorted_result
+select * from t2;
+
+# Cleanup
+DROP TABLE t1, t2, s1;
+
diff --git a/mysql-test/suite/sql_sequence/view.result b/mysql-test/suite/sql_sequence/view.result
index bd773dcc042..0f39a637deb 100644
--- a/mysql-test/suite/sql_sequence/view.result
+++ b/mysql-test/suite/sql_sequence/view.result
@@ -24,3 +24,13 @@ ERROR 42S02: 'test.v1' is not a SEQUENCE
SELECT PREVIOUS VALUE FOR v1;
ERROR 42S02: 'test.v1' is not a SEQUENCE
drop view v1;
+#
+# MDEV 17978 Server crashes in mysqld_show_create_get_fields
+# upon SHOW CREATE SEQUENCE on a broken view
+#
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+DROP TABLE t1;
+SHOW CREATE SEQUENCE v1;
+ERROR 42S02: 'test.v1' is not a SEQUENCE
+DROP VIEW v1;
diff --git a/mysql-test/suite/sql_sequence/view.test b/mysql-test/suite/sql_sequence/view.test
index fe968604b5b..5b970432a34 100644
--- a/mysql-test/suite/sql_sequence/view.test
+++ b/mysql-test/suite/sql_sequence/view.test
@@ -27,3 +27,14 @@ SELECT NEXT VALUE FOR v1;
--error ER_NOT_SEQUENCE
SELECT PREVIOUS VALUE FOR v1;
drop view v1;
+
+--echo #
+--echo # MDEV 17978 Server crashes in mysqld_show_create_get_fields
+--echo # upon SHOW CREATE SEQUENCE on a broken view
+--echo #
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+DROP TABLE t1;
+--error ER_NOT_SEQUENCE
+SHOW CREATE SEQUENCE v1;
+DROP VIEW v1;
diff --git a/mysql-test/suite/sys_vars/r/debug_dbug_func.result b/mysql-test/suite/sys_vars/r/debug_dbug_func.result
index 1c7ae4e2832..d0c002cf111 100644
--- a/mysql-test/suite/sys_vars/r/debug_dbug_func.result
+++ b/mysql-test/suite/sys_vars/r/debug_dbug_func.result
@@ -1,55 +1,55 @@
-SET @old_debug = @@GLOBAL.debug;
-set debug_dbug= 'T';
-select @@debug;
-@@debug
+SET @old_debug = @@GLOBAL.debug_dbug;
+SET debug_dbug= 'T';
+select @@debug_dbug;
+@@debug_dbug
T
-set debug_dbug= '+P';
-select @@debug;
-@@debug
+SET debug_dbug= '+P';
+select @@debug_dbug;
+@@debug_dbug
P:T
-set debug_dbug= '-P';
-select @@debug;
-@@debug
+SET debug_dbug= '-P';
+select @@debug_dbug;
+@@debug_dbug
T
-SELECT @@session.debug, @@global.debug;
-@@session.debug @@global.debug
+SELECT @@session.debug_dbug, @@global.debug_dbug;
+@@session.debug_dbug @@global.debug_dbug
T
SET SESSION debug_dbug= '';
-SELECT @@session.debug, @@global.debug;
-@@session.debug @@global.debug
+SELECT @@session.debug_dbug, @@global.debug_dbug;
+@@session.debug_dbug @@global.debug_dbug
#
# Bug #52629: memory leak from sys_var_thd_dbug in
# binlog.binlog_write_error
#
SET GLOBAL debug_dbug='d,injecting_fault_writing';
-SELECT @@global.debug;
-@@global.debug
+SELECT @@global.debug_dbug;
+@@global.debug_dbug
d,injecting_fault_writing
SET GLOBAL debug_dbug='';
-SELECT @@global.debug;
-@@global.debug
+SELECT @@global.debug_dbug;
+@@global.debug_dbug
SET GLOBAL debug_dbug=@old_debug;
#
# Bug #56709: Memory leaks at running the 5.1 test suite
#
-SET @old_local_debug = @@debug;
+SET @old_local_debug = @@debug_dbug;
SET @@debug_dbug='d,foo';
-SELECT @@debug;
-@@debug
+SELECT @@debug_dbug;
+@@debug_dbug
d,foo
SET @@debug_dbug='';
-SELECT @@debug;
-@@debug
+SELECT @@debug_dbug;
+@@debug_dbug
SET @@debug_dbug= @old_local_debug;
End of 5.1 tests
#
# Bug#46165 server crash in dbug
#
-SET @old_globaldebug = @@global.debug;
-SET @old_sessiondebug= @@session.debug;
+SET @old_globaldebug = @@global.debug_dbug;
+SET @old_sessiondebug= @@session.debug_dbug;
# Test 1 - Bug test case, single connection
SET GLOBAL debug_dbug= '+O,MYSQL_TMP_DIR/bug46165.1.trace';
SET SESSION debug_dbug= '-d:-t:-i';
diff --git a/mysql-test/suite/sys_vars/r/host_cache_size_auto.result b/mysql-test/suite/sys_vars/r/host_cache_size_auto.result
index a0a849c1d7a..a9a683e017b 100644
--- a/mysql-test/suite/sys_vars/r/host_cache_size_auto.result
+++ b/mysql-test/suite/sys_vars/r/host_cache_size_auto.result
@@ -1,3 +1,3 @@
select @@global.host_cache_size;
@@global.host_cache_size
-632
+653
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result
index e6210165436..e50890a341c 100644
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result
@@ -50,5 +50,3 @@ COUNT(@@GLOBAL.innodb_buffer_pool_size)
1 Expected
SELECT innodb_buffer_pool_size = @@SESSION.innodb_buffer_pool_size;
ERROR 42S22: Unknown column 'innodb_buffer_pool_size' in 'field list'
-Expected error 'Readonly variable'
-SET @@GLOBAL.innodb_buffer_pool_size = @start_buffer_pool_size;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index 93d0cac7f24..6a85883b9f1 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -3355,7 +3355,7 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SESSION_TRACK_TRANSACTION_INFO
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Track changes to the transaction attributes. OFF to disable; STATE to track just transaction state (Is there an active transaction? Does it have any data? etc.); CHARACTERISTICS to track transaction state and report all statements needed to start a transaction withthe same characteristics (isolation level, read only/read write,snapshot - but not any work done / data modified within the transaction).
+VARIABLE_COMMENT Track changes to the transaction attributes. OFF to disable; STATE to track just transaction state (Is there an active transaction? Does it have any data? etc.); CHARACTERISTICS to track transaction state and report all statements needed to start a transaction with the same characteristics (isolation level, read only/read write,snapshot - but not any work done / data modified within the transaction).
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
diff --git a/mysql-test/suite/sys_vars/t/debug_dbug_func.test b/mysql-test/suite/sys_vars/t/debug_dbug_func.test
index b4cd4aefd5e..a72636131ee 100644
--- a/mysql-test/suite/sys_vars/t/debug_dbug_func.test
+++ b/mysql-test/suite/sys_vars/t/debug_dbug_func.test
@@ -1,27 +1,27 @@
--source include/have_debug.inc
-SET @old_debug = @@GLOBAL.debug;
+SET @old_debug = @@GLOBAL.debug_dbug;
#
-# Bug#34678 @@debug variable's incremental mode
+# Bug#34678 @@debug_dbug variable's incremental mode
#
-set debug_dbug= 'T';
-select @@debug;
-set debug_dbug= '+P';
-select @@debug;
-set debug_dbug= '-P';
-select @@debug;
+SET debug_dbug= 'T';
+select @@debug_dbug;
+SET debug_dbug= '+P';
+select @@debug_dbug;
+SET debug_dbug= '-P';
+select @@debug_dbug;
#
-# Bug#38054: "SET SESSION debug" modifies @@global.debug variable
+# Bug#38054: "SET SESSION debug" modifies @@global.debug_dbug variable
#
-SELECT @@session.debug, @@global.debug;
+SELECT @@session.debug_dbug, @@global.debug_dbug;
SET SESSION debug_dbug= '';
-SELECT @@session.debug, @@global.debug;
+SELECT @@session.debug_dbug, @@global.debug_dbug;
--echo #
--echo # Bug #52629: memory leak from sys_var_thd_dbug in
@@ -29,9 +29,9 @@ SELECT @@session.debug, @@global.debug;
--echo #
SET GLOBAL debug_dbug='d,injecting_fault_writing';
-SELECT @@global.debug;
+SELECT @@global.debug_dbug;
SET GLOBAL debug_dbug='';
-SELECT @@global.debug;
+SELECT @@global.debug_dbug;
SET GLOBAL debug_dbug=@old_debug;
@@ -39,12 +39,12 @@ SET GLOBAL debug_dbug=@old_debug;
--echo # Bug #56709: Memory leaks at running the 5.1 test suite
--echo #
-SET @old_local_debug = @@debug;
+SET @old_local_debug = @@debug_dbug;
SET @@debug_dbug='d,foo';
-SELECT @@debug;
+SELECT @@debug_dbug;
SET @@debug_dbug='';
-SELECT @@debug;
+SELECT @@debug_dbug;
SET @@debug_dbug= @old_local_debug;
@@ -55,8 +55,8 @@ SET @@debug_dbug= @old_local_debug;
--echo # Bug#46165 server crash in dbug
--echo #
-SET @old_globaldebug = @@global.debug;
-SET @old_sessiondebug= @@session.debug;
+SET @old_globaldebug = @@global.debug_dbug;
+SET @old_sessiondebug= @@session.debug_dbug;
--echo # Test 1 - Bug test case, single connection
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
diff --git a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
index 454b5d7477e..1d925a5e8c1 100644
--- a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
+++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test
@@ -64,7 +64,7 @@ SELECT @@global.ft_boolean_syntax;
--echo '#--------------------FN_DYNVARS_033_03-------------------------#'
######################################################################
-# see if it is accessable using session scope #
+# see if it is accessible using session scope #
######################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.ft_boolean_syntax = '# -><()!*:""&|';
diff --git a/mysql-test/suite/sys_vars/t/init_connect_basic.test b/mysql-test/suite/sys_vars/t/init_connect_basic.test
index b2f2cb92e40..6aba83d3675 100644
--- a/mysql-test/suite/sys_vars/t/init_connect_basic.test
+++ b/mysql-test/suite/sys_vars/t/init_connect_basic.test
@@ -66,7 +66,7 @@ SELECT @@global.init_connect;
--echo '#--------------------FN_DYNVARS_036_03-------------------------#'
######################################################################
-# see if it is accessable using session scope #
+# see if it is accessible using session scope #
######################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.init_connect = '';
diff --git a/mysql-test/suite/sys_vars/t/init_slave_basic.test b/mysql-test/suite/sys_vars/t/init_slave_basic.test
index b137a525090..4dd7fd80d82 100644
--- a/mysql-test/suite/sys_vars/t/init_slave_basic.test
+++ b/mysql-test/suite/sys_vars/t/init_slave_basic.test
@@ -66,7 +66,7 @@ SELECT @@global.init_slave;
--echo '#--------------------FN_DYNVARS_037_03-------------------------#'
######################################################################
-# see if it is accessable using session scope #
+# see if it is accessible using session scope #
######################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.init_slave = '';
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
index c5b4c118da2..4dd4a3aba0a 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
@@ -27,7 +27,6 @@
--disable_query_log
if (`select (version() like '%debug%') > 0`)
{
- set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
set global innodb_disable_resize_buffer_pool_debug = OFF;
}
--enable_query_log
@@ -116,15 +115,7 @@ SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size);
--Error ER_BAD_FIELD_ERROR
SELECT innodb_buffer_pool_size = @@SESSION.innodb_buffer_pool_size;
---echo Expected error 'Readonly variable'
-SET @@GLOBAL.innodb_buffer_pool_size = @start_buffer_pool_size;
---source include/wait_condition.inc
-
---disable_query_log
-if (`select (version() like '%debug%') > 0`)
-{
- set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
-}
---enable_query_log
+# Restore the original buffer pool size.
+--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic.test b/mysql-test/suite/sys_vars/t/timestamp_basic.test
index 8b26622443d..5f780e7ab40 100644
--- a/mysql-test/suite/sys_vars/t/timestamp_basic.test
+++ b/mysql-test/suite/sys_vars/t/timestamp_basic.test
@@ -47,7 +47,7 @@ SELECT floor(@@timestamp) = UNIX_TIMESTAMP(), @@timestamp = UNIX_TIMESTAMP(NOW(6
--echo '#---------------------FN_DYNVARS_001_02-------------------------#'
##############################################################
-# see if accessable using global scope #
+# see if accessible using global scope #
##############################################################
--Error ER_LOCAL_VARIABLE
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
index 532412e3574..53e169812b4 100644
--- a/mysql-test/suite/versioning/r/alter.result
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -528,9 +528,9 @@ ERROR HY000: Table `t` is already system-versioned
#
use mysql;
create or replace table t (x int) with system versioning;
-ERROR HY000: System versioning tables in the `mysql` database are not suported
+ERROR HY000: System versioning tables in the `mysql` database are not supported
alter table user add system versioning;
-ERROR HY000: System versioning tables in the `mysql` database are not suported
+ERROR HY000: System versioning tables in the `mysql` database are not supported
use test;
# MDEV-15956 Strange ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN upon ALTER on versioning column
create or replace table t1 (i int, j int as (i), s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) with system versioning;
diff --git a/mysql-test/suite/versioning/r/delete.result b/mysql-test/suite/versioning/r/delete.result
index 77b7fc80286..5aa239b9cb8 100644
--- a/mysql-test/suite/versioning/r/delete.result
+++ b/mysql-test/suite/versioning/r/delete.result
@@ -1,3 +1,4 @@
+# Basic + delete from view
create or replace table t1(
XNo int unsigned,
sys_start SYS_DATATYPE as row start invisible,
@@ -44,6 +45,7 @@ XNo_vt1
5
drop view vt1;
drop table t1;
+# Check sys_start, sys_end
create or replace table t1(
x int,
sys_start SYS_DATATYPE as row start invisible,
@@ -59,6 +61,7 @@ select x = 1 as A, sys_start = @sys_start as B, sys_end > sys_start as C from t1
A B C
1 1 1
drop table t1;
+# Multi-delete
create or replace table t1(
x int,
y int,
@@ -103,9 +106,6 @@ t2_x_all
14
drop table t1;
drop table t2;
-# Basic + delete from view
-# Check sys_start, sys_end
-# Multi-delete
# Update + delete
create or replace table t1 (x int) with system versioning;
insert into t1 values (1);
@@ -116,3 +116,17 @@ x
2
1
drop table t1;
+#
+# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+#
+create or replace table t1 (a int) with system versioning;
+replace into t1 values (1), (2);
+create or replace trigger tr before delete on t1 for each row delete from xx;
+create or replace procedure pr() delete from t1;
+call pr;
+ERROR 42S02: Table 'test.xx' doesn't exist
+call pr;
+ERROR 42S02: Table 'test.xx' doesn't exist
+drop procedure pr;
+drop trigger tr;
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/truncate.result b/mysql-test/suite/versioning/r/delete_history.result
index 93f240272c1..93f240272c1 100644
--- a/mysql-test/suite/versioning/r/truncate.result
+++ b/mysql-test/suite/versioning/r/delete_history.result
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 2163ebeb1a0..aa884743b2f 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -504,6 +504,14 @@ delete from t1 where a is not null;
create or replace table t1 (i int) with system versioning partition by system_time limit 10 (partition p0 history, partition pn current);
select * from t1 partition (p0) for system_time all;
ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query
+# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+create or replace procedure sp()
+select * from t1 partition (p0) for system_time all;
+call sp;
+ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query
+call sp;
+ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query
+drop procedure sp;
# MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE
create or replace table t1 (pk int primary key)
engine=myisam
@@ -566,3 +574,43 @@ execute immediate 'select * from t1 for update';
pk
drop view v1;
drop tables t, t1, t2, t3, t4;
+#
+# MDEV-18957 UPDATE with LIMIT clause is wrong for versioned partitioned tables
+#
+create or replace table t1 (
+x int,
+a varchar(255)
+) with system versioning partition by system_time (partition p1 history, partition pn current);
+insert into t1 (x) values (1), (2), (3), (4);
+update t1 set a= 'foo' limit 3;
+update t1 set a= 'bar' limit 4;
+select * from t1;
+x a
+1 bar
+2 bar
+3 bar
+4 bar
+drop table t1;
+#
+# MDEV-21011 Table corruption reported for versioned partitioned table after DELETE: "Found a misplaced row"
+#
+create table t1 (a int) with system versioning
+partition by system_time limit 3
+(partition p1 history, partition p2 history, partition pn current);
+insert into t1 values (1),(2),(3),(4);
+delete from t1;
+delete from t1;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check note Not supported for non-INTERVAL history partitions
+test.t1 check note The storage engine for the table doesn't support check
+drop table t1;
+#
+# MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache
+#
+create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2;
+insert into t1 values (1,'foo'),(2,'bar');
+create table t2 (b int);
+insert into t2 values (1),(2);
+update t1, t2 set a = 1;
+drop table t1, t2;
diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result
index c887e524e63..f1bdcccce59 100644
--- a/mysql-test/suite/versioning/r/select.result
+++ b/mysql-test/suite/versioning/r/select.result
@@ -320,6 +320,21 @@ ERROR HY000: Table `t` is not system-versioned
create or replace table t1 (x int) with system versioning engine myisam;
select * from t1 for system_time as of transaction 1;
ERROR HY000: Transaction-precise system versioning for `t1` is not supported
+# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+create or replace procedure sp()
+select * from t1 for system_time as of transaction 1;
+call sp;
+ERROR HY000: Transaction-precise system versioning for `t1` is not supported
+call sp;
+ERROR HY000: Transaction-precise system versioning for `t1` is not supported
+create or replace table t1 (a int);
+create or replace procedure sp()
+select * from t1 for system_time all;
+call sp;
+ERROR HY000: Table `t1` is not system-versioned
+call sp;
+ERROR HY000: Table `t1` is not system-versioned
+drop procedure sp;
create or replace table t1 (
x int,
sys_trx_start bigint unsigned as row start invisible,
@@ -571,6 +586,30 @@ call p;
i
drop procedure p;
drop table t1;
+#
+# MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SP
+#
+create table t1 (a varchar(8));
+insert into t1 values ('foo'),('bar');
+create table t2 (b date);
+create procedure pr() insert into t2 select * from t1;
+call pr;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+prepare stmt from 'insert into t2 select * from t1';
+execute stmt;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+alter table t1 add system versioning;
+call pr;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+call pr;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+execute stmt;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+execute stmt;
+ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
+drop prepare stmt;
+drop procedure pr;
+drop table t1, t2;
call verify_trt_dummy(34);
No A B C D
1 1 1 1 1
diff --git a/mysql-test/suite/versioning/r/sysvars.result b/mysql-test/suite/versioning/r/sysvars.result
index b23742462d1..899eda91a81 100644
--- a/mysql-test/suite/versioning/r/sysvars.result
+++ b/mysql-test/suite/versioning/r/sysvars.result
@@ -31,6 +31,14 @@ set global system_versioning_asof= 1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set global system_versioning_asof= 1.1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
+set global system_versioning_asof= '2011-02-29 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
+set global system_versioning_asof= '2011-02-28 24:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
+set global system_versioning_asof= '2011-00-28 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
+set global system_versioning_asof= '0000-00-00 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
set system_versioning_asof= 'alley';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
set system_versioning_asof= null;
@@ -39,6 +47,14 @@ set system_versioning_asof= 1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set system_versioning_asof= 1.1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
+set system_versioning_asof= '2011-02-29 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
+set system_versioning_asof= '2011-02-28 24:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
+set system_versioning_asof= '2011-00-28 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
+set system_versioning_asof= '0000-00-00 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
# GLOBAL @@system_versioning_asof
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
Warnings:
diff --git a/mysql-test/suite/versioning/r/truncate_privilege.result b/mysql-test/suite/versioning/r/truncate_privilege.result
index 3242c4557c5..e2b48c494be 100644
--- a/mysql-test/suite/versioning/r/truncate_privilege.result
+++ b/mysql-test/suite/versioning/r/truncate_privilege.result
@@ -9,7 +9,7 @@ create table mysqltest.t (a int) with system versioning;
connection user1;
show grants;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
delete history from mysqltest.t before system_time now();
ERROR 42000: DELETE HISTORY command denied to user 'mysqltest_1'@'localhost' for table 't'
connection root;
@@ -18,16 +18,16 @@ grant delete history on mysqltest.t to mysqltest_1@localhost;
connection user1;
show grants;
Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT DELETE HISTORY ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-GRANT DELETE HISTORY ON `mysqltest`.`t` TO 'mysqltest_1'@'localhost'
+GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
+GRANT DELETE HISTORY ON `mysqltest`.* TO `mysqltest_1`@`localhost`
+GRANT DELETE HISTORY ON `mysqltest`.`t` TO `mysqltest_1`@`localhost`
delete history from mysqltest.t before system_time now();
connection root;
grant all on *.* to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'localhost'
-GRANT DELETE HISTORY ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-GRANT DELETE HISTORY ON `mysqltest`.`t` TO 'mysqltest_1'@'localhost'
+GRANT ALL PRIVILEGES ON *.* TO `mysqltest_1`@`localhost`
+GRANT DELETE HISTORY ON `mysqltest`.* TO `mysqltest_1`@`localhost`
+GRANT DELETE HISTORY ON `mysqltest`.`t` TO `mysqltest_1`@`localhost`
drop user mysqltest_1@localhost;
drop database mysqltest;
diff --git a/mysql-test/suite/versioning/r/trx_id.result b/mysql-test/suite/versioning/r/trx_id.result
index 413272f55f9..a140052439c 100644
--- a/mysql-test/suite/versioning/r/trx_id.result
+++ b/mysql-test/suite/versioning/r/trx_id.result
@@ -476,3 +476,25 @@ SET @@SYSTEM_VERSIONING_ALTER_HISTORY=ERROR;
SELECT count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
count(*)
0
+# MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null ||
+# trans == &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon
+# ALTER TABLE with versioning
+create or replace table t (x int) engine=innodb;
+set autocommit= 0;
+alter table t
+algorithm=copy,
+add column row_start bigint unsigned as row start,
+add column row_end bigint unsigned as row end,
+add period for system_time(row_start,row_end),
+with system versioning;
+set autocommit= 1;
+# MDEV-18865 Assertion `t->first->versioned_by_id()'
+# failed in innodb_prepare_commit_versioned
+create or replace table t (x int) engine=innodb;
+insert into t values (0);
+alter table t add `row_start` bigint unsigned as row start,
+add `row_end` bigint unsigned as row end,
+add period for system_time(`row_start`,`row_end`),
+modify x int after row_start,
+with system versioning;
+create or replace database test;
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
index eaa8549b38a..a2ec02a7ec1 100644
--- a/mysql-test/suite/versioning/r/update.result
+++ b/mysql-test/suite/versioning/r/update.result
@@ -249,6 +249,8 @@ replace t1 values (1,2),(1,3),(2,4);
#
# MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE
#
+set @old_lock_wait_timeout= @@innodb_lock_wait_timeout;
+set @@innodb_lock_wait_timeout= 1073741824;
create or replace table t1 (pk int, a char(3), b char(3), primary key(pk))
engine=innodb with system versioning;
insert into t1 (pk) values (1);
@@ -265,6 +267,7 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
disconnect con1;
connection default;
drop table t1;
+set @@innodb_lock_wait_timeout= @old_lock_wait_timeout;
#
# MDEV-19406 Assertion on updating view of join with versioned table
#
@@ -276,3 +279,36 @@ update t1 set a= '2012-12-12';
update v set a= '2000-01-01' order by b limit 1;
drop view v;
drop table t1, t2;
+#
+# MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria table
+#
+create or replace table t1 (a varchar(8))
+engine=aria row_format=fixed
+with system versioning;
+insert into t1 (a) values ('foo');
+update t1 set a = 'bar';
+drop table t1;
+#
+# MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
+#
+create or replace table t1 (
+pk int, a char(8), b char(8),
+primary key (pk)
+) with system versioning;
+create or replace view v1 as select * from t1;
+insert into t1 values (1, null, 'd') , (2, null, 'i') ;
+update v1 set a= null where b = '';
+create or replace table t1 (id int, k int, primary key (id)) engine=innodb with system versioning;
+insert into t1 values (1,1),(2,2);
+create or replace view v1 as select * from t1;
+update v1 set id= 2 where k = 0;
+create or replace table t1 (a int) with system versioning;
+create or replace view v1 as select * from t1;
+create or replace procedure sp() update v1 set xx = 1;
+call sp;
+ERROR 42S22: Unknown column 'xx' in 'field list'
+call sp;
+ERROR 42S22: Unknown column 'xx' in 'field list'
+drop procedure sp;
+drop view v1;
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/view.result b/mysql-test/suite/versioning/r/view.result
index 850eba32c0d..3b3fe580af4 100644
--- a/mysql-test/suite/versioning/r/view.result
+++ b/mysql-test/suite/versioning/r/view.result
@@ -64,13 +64,13 @@ select * from vt1;
x
1
2
-# VIEW with parameters [#151]
+# VIEW with parameters [tempesta-tech/mariadb#151]
create or replace table t1 (x int) with system versioning;
create or replace view vt1(c) as select x from t1;
show create view vt1;
View Create View character_set_client collation_connection
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`x` AS `c` from `t1` latin1 latin1_swedish_ci
-# VIEW over JOIN of versioned tables [#153]
+# VIEW over JOIN of versioned tables [tempesta-tech/mariadb#153]
create or replace table t1 (a int) with system versioning;
create or replace table t2 (b int) with system versioning;
insert into t1 values (1);
@@ -82,7 +82,7 @@ a b
create or replace view vt12 as select * from t1 for system_time as of timestamp ('0-0-0') cross join t2;
select * from vt12;
a b
-# VIEW improvements [#183]
+# VIEW improvements [tempesta-tech/mariadb#183]
create or replace table t3 (x int);
create or replace view vt1 as select * from t1, t2, t3;
show create view vt1;
@@ -96,12 +96,12 @@ create or replace view vt1 as select a, t2.row_end as endo from t3, t1, t2;
show create view vt1;
View Create View character_set_client collation_connection
vt1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vt1` AS select `t1`.`a` AS `a`,`t2`.`row_end` AS `endo` from ((`t3` join `t1`) join `t2`) latin1 latin1_swedish_ci
-# VIEW over UNION [#269]
+# VIEW over UNION [tempesta-tech/mariadb#269]
create or replace view vt1 as select * from t1 union select * from t1;
select * from vt1;
a
1
-# VIEW over UNION with non-versioned [#393]
+# VIEW over UNION with non-versioned [tempesta-tech/mariadb#393]
create or replace table t2 (a int);
create or replace view vt1 as select * from t1 union select * from t2;
select * from vt1;
@@ -123,10 +123,10 @@ drop tables t1, t2;
#
# MDEV-15146 SQLError[4122]: View is not system versioned
#
-create table t1 (a int) with system versioning;
+create or replace table t1 (a int) with system versioning;
insert t1 values (1),(2);
set @a=now(6);
-create view v1 as select * from t1;
+create or replace view v1 as select * from t1;
delete from t1;
select * from v1;
a
@@ -146,6 +146,136 @@ i
create or replace view v1 as select * from t1 for system_time as of date_sub(now(), interval 6 second);
show create view v1;
View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` FOR SYSTEM_TIME AS OF current_timestamp() - interval 6 second latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp() - interval 6 second latin1 latin1_swedish_ci
drop view v1, vt1, vt12;
drop tables t1, t3;
+#
+# MDEV-18727 improve DML operation of System Versioning
+#
+create or replace table t1 (
+x int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1), (2);
+create or replace view v1 as select * from t1 where x > 1;
+# update, delete
+update v1 set x= x + 1;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 CURRENT ROW
+insert v1 values (4);
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 CURRENT ROW
+4 CURRENT ROW
+delete from v1 where x < 4;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 HISTORICAL ROW
+4 CURRENT ROW
+# multi-update
+create or replace table t2 like t1;
+insert into t2 values (1), (2);
+create or replace view v2 as select * from t2 where x > 1;
+update v1, v2 set v1.x= v1.x + 1, v2.x= v2.x + 1 where v1.x = v2.x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 HISTORICAL ROW
+4 HISTORICAL ROW
+5 CURRENT ROW
+select *, check_row(row_start, row_end) from t2 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 CURRENT ROW
+# multi-delete
+delete v1, v2 from v1 join v2 where v1.x = v2.x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 HISTORICAL ROW
+4 HISTORICAL ROW
+5 HISTORICAL ROW
+select *, check_row(row_start, row_end) from t2 for system_time all order by x;
+x check_row(row_start, row_end)
+1 CURRENT ROW
+2 HISTORICAL ROW
+3 HISTORICAL ROW
+# replace
+create or replace table t1 (
+x int primary key, y int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1, 0), (2, 0);
+create or replace view v1 as select * from t1 where x > 1;
+replace v1 values (1, 1);
+replace v1 values (2, 1);
+replace v1 values (3, 1);
+# REPLACE ignores VIEW condition because itself doesn't use WHERE
+select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
+x y check_row(row_start, row_end)
+1 0 HISTORICAL ROW
+1 1 CURRENT ROW
+2 0 HISTORICAL ROW
+2 1 CURRENT ROW
+3 1 CURRENT ROW
+# insert-select, on duplicate key
+insert v1 select * from t1 where x = 1 on duplicate key update x = v1.x - 1;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
+x y check_row(row_start, row_end)
+0 1 CURRENT ROW
+1 0 HISTORICAL ROW
+1 1 HISTORICAL ROW
+2 0 HISTORICAL ROW
+2 1 CURRENT ROW
+3 1 CURRENT ROW
+drop view v1, v2;
+drop tables t1, t2;
+#
+# MDEV-21146 Assertion `m_lock_type == 2' in handler::ha_drop_table upon LOAD DATA
+#
+create table t1 (a int);
+create view v1 as select * from t1;
+create or replace table t1 (b int) with system versioning;
+load data infile 'xx' into table v1;
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+drop view v1;
+drop table t1;
+#
+# MDEV-21155 Assertion with versioned table upon DELETE from view of view after replacing first view
+#
+create table t1 (a int);
+insert into t1 values (1);
+create table t2 (
+b int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)
+) with system versioning;
+insert into t2 values (2);
+create view v1 as select * from t1;
+create view v2 as select * from v1;
+create or replace view v1 as select * from t2;
+delete from v2;
+select * from t1;
+a
+1
+select *, check_row(row_start, row_end) from t2 for system_time all;
+b check_row(row_start, row_end)
+2 HISTORICAL ROW
+drop view v2;
+drop view v1;
+drop table t1, t2;
diff --git a/mysql-test/suite/versioning/t/delete.test b/mysql-test/suite/versioning/t/delete.test
index b9045898bb0..492463f9395 100644
--- a/mysql-test/suite/versioning/t/delete.test
+++ b/mysql-test/suite/versioning/t/delete.test
@@ -1,6 +1,7 @@
source suite/versioning/engines.inc;
source suite/versioning/common.inc;
+--echo # Basic + delete from view
replace_result $sys_datatype_expl SYS_DATATYPE;
eval create or replace table t1(
XNo int unsigned,
@@ -31,7 +32,7 @@ select XNo as XNo_vt1 from vt1;
drop view vt1;
drop table t1;
-
+--echo # Check sys_start, sys_end
replace_result $sys_datatype_expl SYS_DATATYPE;
eval create or replace table t1(
x int,
@@ -47,6 +48,7 @@ select * from t1;
select x = 1 as A, sys_start = @sys_start as B, sys_end > sys_start as C from t1 for system_time all;
drop table t1;
+--echo # Multi-delete
replace_result $sys_datatype_expl SYS_DATATYPE;
eval create or replace table t1(
x int,
@@ -69,12 +71,6 @@ select x as t2_x_all from t2 for system_time all;
drop table t1;
drop table t2;
---echo # Basic + delete from view
-
---echo # Check sys_start, sys_end
-
---echo # Multi-delete
-
--echo # Update + delete
create or replace table t1 (x int) with system versioning;
insert into t1 values (1);
@@ -83,4 +79,19 @@ delete from t1;
select x from t1 for system_time all;
drop table t1;
+--echo #
+--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+--echo #
+create or replace table t1 (a int) with system versioning;
+replace into t1 values (1), (2);
+create or replace trigger tr before delete on t1 for each row delete from xx;
+create or replace procedure pr() delete from t1;
+--error ER_NO_SUCH_TABLE
+call pr;
+--error ER_NO_SUCH_TABLE
+call pr;
+drop procedure pr;
+drop trigger tr;
+drop table t1;
+
--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/truncate.test b/mysql-test/suite/versioning/t/delete_history.test
index 8a7f8e84a76..8a7f8e84a76 100644
--- a/mysql-test/suite/versioning/t/truncate.test
+++ b/mysql-test/suite/versioning/t/delete_history.test
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index eca322d9ef4..8898088b1bc 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -455,6 +455,14 @@ delete from t1 where a is not null;
create or replace table t1 (i int) with system versioning partition by system_time limit 10 (partition p0 history, partition pn current);
--error ER_VERS_QUERY_IN_PARTITION
select * from t1 partition (p0) for system_time all;
+--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+create or replace procedure sp()
+select * from t1 partition (p0) for system_time all;
+--error ER_VERS_QUERY_IN_PARTITION
+call sp;
+--error ER_VERS_QUERY_IN_PARTITION
+call sp;
+drop procedure sp;
--echo # MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE
create or replace table t1 (pk int primary key)
@@ -517,4 +525,46 @@ execute immediate 'select * from t1 for update';
drop view v1;
drop tables t, t1, t2, t3, t4;
+--echo #
+--echo # MDEV-18957 UPDATE with LIMIT clause is wrong for versioned partitioned tables
+--echo #
+create or replace table t1 (
+ x int,
+ a varchar(255)
+) with system versioning partition by system_time (partition p1 history, partition pn current);
+
+insert into t1 (x) values (1), (2), (3), (4);
+update t1 set a= 'foo' limit 3;
+update t1 set a= 'bar' limit 4;
+select * from t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-21011 Table corruption reported for versioned partitioned table after DELETE: "Found a misplaced row"
+--echo #
+create table t1 (a int) with system versioning
+partition by system_time limit 3
+(partition p1 history, partition p2 history, partition pn current);
+insert into t1 values (1),(2),(3),(4);
+delete from t1;
+delete from t1;
+check table t1;
+
+# cleanup
+drop table t1;
+
+--echo #
+--echo # MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache
+--echo #
+create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2;
+insert into t1 values (1,'foo'),(2,'bar');
+
+create table t2 (b int);
+insert into t2 values (1),(2);
+
+update t1, t2 set a = 1;
+
+# cleanup
+drop table t1, t2;
+
--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/select.test b/mysql-test/suite/versioning/t/select.test
index 53366994882..069fe7a9a8d 100644
--- a/mysql-test/suite/versioning/t/select.test
+++ b/mysql-test/suite/versioning/t/select.test
@@ -202,6 +202,21 @@ for system_time all as t;
create or replace table t1 (x int) with system versioning engine myisam;
--error ER_VERS_ENGINE_UNSUPPORTED
select * from t1 for system_time as of transaction 1;
+--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
+create or replace procedure sp()
+select * from t1 for system_time as of transaction 1;
+--error ER_VERS_ENGINE_UNSUPPORTED
+call sp;
+--error ER_VERS_ENGINE_UNSUPPORTED
+call sp;
+create or replace table t1 (a int);
+create or replace procedure sp()
+select * from t1 for system_time all;
+--error ER_VERS_NOT_VERSIONED
+call sp;
+--error ER_VERS_NOT_VERSIONED
+call sp;
+drop procedure sp;
create or replace table t1 (
x int,
@@ -377,6 +392,35 @@ call p;
drop procedure p;
drop table t1;
+--echo #
+--echo # MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SP
+--echo #
+create table t1 (a varchar(8));
+insert into t1 values ('foo'),('bar');
+create table t2 (b date);
+
+create procedure pr() insert into t2 select * from t1;
+--error ER_TRUNCATED_WRONG_VALUE
+call pr;
+prepare stmt from 'insert into t2 select * from t1';
+--error ER_TRUNCATED_WRONG_VALUE
+execute stmt;
+alter table t1 add system versioning;
+--error ER_TRUNCATED_WRONG_VALUE
+call pr;
+--error ER_TRUNCATED_WRONG_VALUE
+call pr;
+--error ER_TRUNCATED_WRONG_VALUE
+execute stmt;
+--error ER_TRUNCATED_WRONG_VALUE
+execute stmt;
+drop prepare stmt;
+
+# cleanup
+drop procedure pr;
+drop table t1, t2;
+
+
call verify_trt_dummy(34);
-- source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/sysvars.test b/mysql-test/suite/versioning/t/sysvars.test
index 160af12fe02..8c8311d66fc 100644
--- a/mysql-test/suite/versioning/t/sysvars.test
+++ b/mysql-test/suite/versioning/t/sysvars.test
@@ -23,6 +23,14 @@ set global system_versioning_asof= null;
set global system_versioning_asof= 1;
--error ER_WRONG_TYPE_FOR_VAR
set global system_versioning_asof= 1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '2011-02-29 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '2011-02-28 24:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '2011-00-28 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '0000-00-00 00:00';
# session
--error ER_WRONG_VALUE_FOR_VAR
@@ -33,6 +41,14 @@ set system_versioning_asof= null;
set system_versioning_asof= 1;
--error ER_WRONG_TYPE_FOR_VAR
set system_versioning_asof= 1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '2011-02-29 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '2011-02-28 24:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '2011-00-28 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '0000-00-00 00:00';
--echo # GLOBAL @@system_versioning_asof
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
diff --git a/mysql-test/suite/versioning/t/trx_id.test b/mysql-test/suite/versioning/t/trx_id.test
index 617c46a9332..38724a47fd1 100644
--- a/mysql-test/suite/versioning/t/trx_id.test
+++ b/mysql-test/suite/versioning/t/trx_id.test
@@ -498,3 +498,30 @@ DROP TABLE t;
SET @@SYSTEM_VERSIONING_ALTER_HISTORY=ERROR;
SELECT count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
+
+--echo # MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null ||
+--echo # trans == &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon
+--echo # ALTER TABLE with versioning
+create or replace table t (x int) engine=innodb;
+set autocommit= 0;
+alter table t
+ algorithm=copy,
+ add column row_start bigint unsigned as row start,
+ add column row_end bigint unsigned as row end,
+ add period for system_time(row_start,row_end),
+ with system versioning;
+set autocommit= 1;
+
+--echo # MDEV-18865 Assertion `t->first->versioned_by_id()'
+--echo # failed in innodb_prepare_commit_versioned
+
+create or replace table t (x int) engine=innodb;
+insert into t values (0);
+alter table t add `row_start` bigint unsigned as row start,
+ add `row_end` bigint unsigned as row end,
+ add period for system_time(`row_start`,`row_end`),
+ modify x int after row_start,
+ with system versioning;
+
+
+create or replace database test;
diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test
index e41c7d15995..71e946e6c2b 100644
--- a/mysql-test/suite/versioning/t/update.test
+++ b/mysql-test/suite/versioning/t/update.test
@@ -157,7 +157,8 @@ replace t1 values (1,2),(1,3),(2,4);
--echo #
--echo # MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE
--echo #
-
+set @old_lock_wait_timeout= @@innodb_lock_wait_timeout;
+set @@innodb_lock_wait_timeout= 1073741824;
create or replace table t1 (pk int, a char(3), b char(3), primary key(pk))
engine=innodb with system versioning;
@@ -176,6 +177,7 @@ disconnect con1;
connection default;
reap;
drop table t1;
+set @@innodb_lock_wait_timeout= @old_lock_wait_timeout;
--echo #
--echo # MDEV-19406 Assertion on updating view of join with versioned table
@@ -192,4 +194,45 @@ drop view v;
drop table t1, t2;
--enable_warnings
+--echo #
+--echo # MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria table
+--echo #
+create or replace table t1 (a varchar(8))
+engine=aria row_format=fixed
+with system versioning;
+
+insert into t1 (a) values ('foo');
+update t1 set a = 'bar';
+drop table t1;
+
+--echo #
+--echo # MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
+--echo #
+create or replace table t1 (
+ pk int, a char(8), b char(8),
+ primary key (pk)
+) with system versioning;
+
+create or replace view v1 as select * from t1;
+insert into t1 values (1, null, 'd') , (2, null, 'i') ;
+update v1 set a= null where b = '';
+
+create or replace table t1 (id int, k int, primary key (id)) engine=innodb with system versioning;
+insert into t1 values (1,1),(2,2);
+create or replace view v1 as select * from t1;
+update v1 set id= 2 where k = 0;
+
+create or replace table t1 (a int) with system versioning;
+create or replace view v1 as select * from t1;
+create or replace procedure sp() update v1 set xx = 1;
+--error ER_BAD_FIELD_ERROR
+call sp;
+--error ER_BAD_FIELD_ERROR
+call sp;
+
+# cleanup
+drop procedure sp;
+drop view v1;
+drop table t1;
+
source suite/versioning/common_finish.inc;
diff --git a/mysql-test/suite/versioning/t/view.test b/mysql-test/suite/versioning/t/view.test
index 5a03a50f1d3..288f1eb6e21 100644
--- a/mysql-test/suite/versioning/t/view.test
+++ b/mysql-test/suite/versioning/t/view.test
@@ -52,13 +52,13 @@ prepare stmt from @tmp; execute stmt; drop prepare stmt;
select * from vt1;
---echo # VIEW with parameters [#151]
+--echo # VIEW with parameters [tempesta-tech/mariadb#151]
create or replace table t1 (x int) with system versioning;
create or replace view vt1(c) as select x from t1;
--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
show create view vt1;
---echo # VIEW over JOIN of versioned tables [#153]
+--echo # VIEW over JOIN of versioned tables [tempesta-tech/mariadb#153]
create or replace table t1 (a int) with system versioning;
create or replace table t2 (b int) with system versioning;
insert into t1 values (1);
@@ -68,7 +68,7 @@ select * from vt12;
create or replace view vt12 as select * from t1 for system_time as of timestamp ('0-0-0') cross join t2;
select * from vt12;
---echo # VIEW improvements [#183]
+--echo # VIEW improvements [tempesta-tech/mariadb#183]
create or replace table t3 (x int);
create or replace view vt1 as select * from t1, t2, t3;
--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
@@ -80,11 +80,11 @@ create or replace view vt1 as select a, t2.row_end as endo from t3, t1, t2;
--replace_result 18446744073709551615 MAX_RESULT "TIMESTAMP'2038-01-19 03:14:07.999999'" MAX_RESULT
show create view vt1;
---echo # VIEW over UNION [#269]
+--echo # VIEW over UNION [tempesta-tech/mariadb#269]
create or replace view vt1 as select * from t1 union select * from t1;
select * from vt1;
---echo # VIEW over UNION with non-versioned [#393]
+--echo # VIEW over UNION with non-versioned [tempesta-tech/mariadb#393]
create or replace table t2 (a int);
create or replace view vt1 as select * from t1 union select * from t2;
select * from vt1;
@@ -104,10 +104,10 @@ drop tables t1, t2;
--echo #
--echo # MDEV-15146 SQLError[4122]: View is not system versioned
--echo #
-create table t1 (a int) with system versioning;
+create or replace table t1 (a int) with system versioning;
insert t1 values (1),(2);
set @a=now(6);
-create view v1 as select * from t1;
+create or replace view v1 as select * from t1;
delete from t1;
select * from v1;
select * from v1 for system_time as of @a;
@@ -124,4 +124,93 @@ show create view v1;
drop view v1, vt1, vt12;
drop tables t1, t3;
+--echo #
+--echo # MDEV-18727 improve DML operation of System Versioning
+--echo #
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ x int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1), (2);
+create or replace view v1 as select * from t1 where x > 1;
+--echo # update, delete
+update v1 set x= x + 1;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+insert v1 values (4);
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+delete from v1 where x < 4;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+--echo # multi-update
+create or replace table t2 like t1;
+insert into t2 values (1), (2);
+create or replace view v2 as select * from t2 where x > 1;
+update v1, v2 set v1.x= v1.x + 1, v2.x= v2.x + 1 where v1.x = v2.x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+select *, check_row(row_start, row_end) from t2 for system_time all order by x;
+--echo # multi-delete
+delete v1, v2 from v1 join v2 where v1.x = v2.x + 2;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x;
+select *, check_row(row_start, row_end) from t2 for system_time all order by x;
+--echo # replace
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create or replace table t1 (
+ x int primary key, y int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t1 values (1, 0), (2, 0);
+create or replace view v1 as select * from t1 where x > 1;
+replace v1 values (1, 1);
+replace v1 values (2, 1);
+replace v1 values (3, 1);
+--echo # REPLACE ignores VIEW condition because itself doesn't use WHERE
+select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
+--echo # insert-select, on duplicate key
+insert v1 select * from t1 where x = 1 on duplicate key update x = v1.x - 1;
+select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
+drop view v1, v2;
+drop tables t1, t2;
+
+--echo #
+--echo # MDEV-21146 Assertion `m_lock_type == 2' in handler::ha_drop_table upon LOAD DATA
+--echo #
+create table t1 (a int);
+create view v1 as select * from t1;
+create or replace table t1 (b int) with system versioning;
+--error ER_VIEW_INVALID
+load data infile 'xx' into table v1;
+
+# cleanup
+drop view v1;
+drop table t1;
+
+--echo #
+--echo # MDEV-21155 Assertion with versioned table upon DELETE from view of view after replacing first view
+--echo #
+create table t1 (a int);
+insert into t1 values (1);
+--replace_result $sys_datatype_expl SYS_DATATYPE
+eval create table t2 (
+ b int,
+ row_start $sys_datatype_expl as row start invisible,
+ row_end $sys_datatype_expl as row end invisible,
+ period for system_time (row_start, row_end)
+) with system versioning;
+insert into t2 values (2);
+create view v1 as select * from t1;
+create view v2 as select * from v1;
+create or replace view v1 as select * from t2;
+delete from v2;
+select * from t1;
+select *, check_row(row_start, row_end) from t2 for system_time all;
+
+# cleanup
+drop view v2;
+drop view v1;
+drop table t1, t2;
+
--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def
index 66722b0bda3..ab3f9fe3604 100644
--- a/mysql-test/suite/wsrep/disabled.def
+++ b/mysql-test/suite/wsrep/disabled.def
@@ -10,4 +10,4 @@
#
##############################################################################
-foreign_key : Sporadic failure "WSREP has not yet prepared node for application use"
+variables : MDEV-17585 wsrep.variables
diff --git a/mysql-test/suite/wsrep/my.cnf b/mysql-test/suite/wsrep/my.cnf
index 7e51b0750a1..f65306ffca5 100644
--- a/mysql-test/suite/wsrep/my.cnf
+++ b/mysql-test/suite/wsrep/my.cnf
@@ -1,10 +1,8 @@
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
-[mysqld]
-wsrep-on=1
-
[mysqld.1]
+wsrep-on=1
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
diff --git a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result
index 9a0abd4460a..1e6ebbbd34d 100644
--- a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result
+++ b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result
@@ -4,7 +4,7 @@
# Verbose run
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=InnoDB;
ALTER TABLE time_zone_name ENGINE=InnoDB;
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -36,7 +36,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -46,7 +46,7 @@ END IF|
# Silent run
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=InnoDB;
ALTER TABLE time_zone_name ENGINE=InnoDB;
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -75,7 +75,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -93,7 +93,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -105,21 +105,21 @@ END IF|
#
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
END IF|
\d ;
TRUNCATE TABLE time_zone_leap_second;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=MyISAM;
END IF|
\d ;
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
\d |
IF (select count(*) from information_schema.global_variables where
-variable_name='wsrep_on') = 1 THEN
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
diff --git a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result
index 4ce57c641b3..85c4d858be2 100644
--- a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result
+++ b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result
@@ -2,7 +2,7 @@
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
#
# Verbose run
-set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
+set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
prepare set_wsrep_write_binlog from @prep1;
set @toggle=0; execute set_wsrep_write_binlog using @toggle;
TRUNCATE TABLE time_zone;
@@ -29,7 +29,7 @@ Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid in
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
# Silent run
-set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
+set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
prepare set_wsrep_write_binlog from @prep1;
set @toggle=0; execute set_wsrep_write_binlog using @toggle;
TRUNCATE TABLE time_zone;
@@ -55,7 +55,7 @@ ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
#
# Testing with explicit timezonefile
#
-set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
+set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
prepare set_wsrep_write_binlog from @prep1;
set @toggle=0; execute set_wsrep_write_binlog using @toggle;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
@@ -67,7 +67,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
#
# Testing --leap
#
-set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
+set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
prepare set_wsrep_write_binlog from @prep1;
set @toggle=0; execute set_wsrep_write_binlog using @toggle;
TRUNCATE TABLE time_zone_leap_second;
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
index ebd6c41d9bc..d1e5b9a4a28 100644
--- a/mysql-test/suite/wsrep/r/variables.result
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -166,6 +166,9 @@ SELECT @@global.wsrep_slave_threads;
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
+SELECT @@global.wsrep_on;
+@@global.wsrep_on
+1
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
@@ -179,6 +182,9 @@ libgalera_smm.so
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
+SELECT @@global.wsrep_on;
+@@global.wsrep_on
+1
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
@@ -206,6 +212,9 @@ libgalera_smm.so
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
gcomm://
+SELECT @@global.wsrep_on;
+@@global.wsrep_on
+1
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
diff --git a/mysql-test/suite/wsrep/t/alter_table_innodb.cnf b/mysql-test/suite/wsrep/t/alter_table_innodb.cnf
new file mode 100644
index 00000000000..d8e27463cc1
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/alter_table_innodb.cnf
@@ -0,0 +1,12 @@
+!include include/default_mysqld.cnf
+
+[mysqld]
+wsrep-on=0
+
+[mysqld.1]
+wsrep-on=0
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
+wsrep_cluster_address='not empty but invalid'
diff --git a/mysql-test/suite/wsrep/t/alter_table_innodb.opt b/mysql-test/suite/wsrep/t/alter_table_innodb.opt
deleted file mode 100644
index 1e84570d7f6..00000000000
--- a/mysql-test/suite/wsrep/t/alter_table_innodb.opt
+++ /dev/null
@@ -1 +0,0 @@
---wsrep-on=0
diff --git a/mysql-test/suite/wsrep/t/binlog_format.opt b/mysql-test/suite/wsrep/t/binlog_format.opt
index e3f2470c6e5..6504506e267 100644
--- a/mysql-test/suite/wsrep/t/binlog_format.opt
+++ b/mysql-test/suite/wsrep/t/binlog_format.opt
@@ -1 +1 @@
---innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://
+--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1
diff --git a/mysql-test/suite/wsrep/t/mdev_10186.cnf b/mysql-test/suite/wsrep/t/mdev_10186.cnf
new file mode 100644
index 00000000000..284c887648e
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mdev_10186.cnf
@@ -0,0 +1,15 @@
+!include include/default_mysqld.cnf
+
+[mysqld]
+wsrep-on=0
+
+[mysqld.1]
+wsrep-on=0
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
+wsrep_cluster_address='not empty but invalid'
+innodb_autoinc_lock_mode=2
+wsrep-provider=$WSREP_PROVIDER
+wsrep-cluster-address=gcomm://
diff --git a/mysql-test/suite/wsrep/t/mdev_10186.opt b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt
index e2655959c62..864f7342cc7 100644
--- a/mysql-test/suite/wsrep/t/mdev_10186.opt
+++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt
@@ -1 +1,3 @@
---wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=0
+--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --binlog_format=ROW
+
+
diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test
index 100e09d3afb..87554635666 100644
--- a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test
+++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test
@@ -1,6 +1,7 @@
--source include/have_wsrep.inc
--source include/have_symlink.inc
--source include/not_windows.inc
+--source include/have_innodb.inc
--echo #
--echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt
new file mode 100644
index 00000000000..864f7342cc7
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt
@@ -0,0 +1,3 @@
+--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --binlog_format=ROW
+
+
diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test
index bb3009bd432..ab1f94cc1cf 100644
--- a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test
+++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test
@@ -1,6 +1,7 @@
--source include/have_wsrep.inc
--source include/have_symlink.inc
--source include/not_windows.inc
+--source include/have_innodb.inc
--echo #
--echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.opt b/mysql-test/suite/wsrep/t/pool_of_threads.opt
index 814417e5b0f..e75bba669e8 100644
--- a/mysql-test/suite/wsrep/t/pool_of_threads.opt
+++ b/mysql-test/suite/wsrep/t/pool_of_threads.opt
@@ -1 +1 @@
---innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --thread_handling=pool-of-threads
+--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --thread_handling=pool-of-threads --wsrep-on=1
diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test
index 6caa5cff500..d3bcdd345af 100644
--- a/mysql-test/suite/wsrep/t/variables.test
+++ b/mysql-test/suite/wsrep/t/variables.test
@@ -80,6 +80,7 @@ eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_slave_threads;
SELECT @@global.wsrep_cluster_address;
+SELECT @@global.wsrep_on;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo
@@ -91,6 +92,7 @@ eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_cluster_address;
+SELECT @@global.wsrep_on;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo
@@ -113,6 +115,7 @@ SELECT VARIABLE_VALUE AS EXPECT_2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VA
--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_cluster_address;
+SELECT @@global.wsrep_on;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo
@@ -135,6 +138,7 @@ SHOW STATUS LIKE 'threads_connected';
#
set wsrep_on=0;
set wsrep_on=1;
+--source include/wait_until_connected_again.inc
create user test@localhost;
connect con1,localhost,test;
set auto_increment_increment=10;
diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests
index 8a8eca4dc67..07b4db37504 100644
--- a/mysql-test/unstable-tests
+++ b/mysql-test/unstable-tests
@@ -23,271 +23,149 @@
#
##############################################################################
#
-# Based on 10.3 9c6fec88b10bfe51d87f63e6a6ea474cd18d1952
+# Based on bb-10.3-release e10e922afd138aec491c646682f4989922527cfb
-main.alter_table : Modified in 10.3.18
-main.alter_table_mdev539_maria : Include file modified in 10.3.18
-main.alter_table_mdev539_myisam : Include file modified in 10.3.18
main.alter_table_trans : MDEV-12084 - timeout
-main.analyze : Modified in 10.3.18
-main.analyze_format_json : Modified in 10.3.18
-main.analyze_stmt : Modified in 10.3.18
-main.analyze_stmt_orderby : Modified in 10.3.18
-main.analyze_stmt_privileges2 : Modified in 10.3.18
main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result
main.auth_named_pipe : MDEV-14724 - System error 2
-main.auto_increment_ranges_innodb : Include file modified in 10.3.19
-main.auto_increment_ranges_myisam : Include file modified in 10.3.19
-main.bootstrap : Modified in 10.3.18
-main.bug13633383 : Modified in 10.3.18
-main.cast : Modified in 10.2.27
-main.compare : Modified in 10.3.19
-main.compound : Modified in 10.3.18
-main.compress : Include file modified in 10.3.18
+main.cache_temporal_4265 : Modified in 10.3.22
main.connect : MDEV-17282 - Wrong result
main.connect2 : MDEV-13885 - Server crash
-main.constraints : Modified in 10.3.18
+main.connect_debug : Modified in 10.3.22
main.count_distinct2 : MDEV-11768 - timeout
-main.create : Modified in 10.3.18
main.create_delayed : MDEV-10605 - failed with timeout
main.create_drop_event : MDEV-16271 - Wrong result
-main.cte_nonrecursive : Modified in 10.3.18
-main.cte_recursive : Modified in 10.3.18
-main.ctype_create : Modified in 10.2.27
-main.ctype_latin1_de : Modified in 10.2.27
-main.ctype_uca : Include file modified in 10.3.19
-main.ctype_uca_innodb : Include file modified in 10.3.19
+main.create_or_replace2 : Modified in 10.3.22
+main.cte_nonrecursive : Modified in 10.3.22
main.ctype_ucs : MDEV-17681 - Data too long for column
main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade
main.ctype_utf16 : MDEV-10675: timeout or extra warnings
-main.ctype_utf16_def : Configuration modified in 10.3.18
main.ctype_utf16le : MDEV-10675: timeout or extra warnings
-main.ctype_utf8 : Include file modified in 10.3.19
-main.ctype_utf8mb4 : Modified in 10.3.18
-main.ctype_utf8mb4_heap : Include file modified in 10.3.18
-main.ctype_utf8mb4_innodb : MDEV-17744 - Timeout; MDEV-18567 - ASAN use-after-poison; include file modified in 10.3.18
-main.ctype_utf8mb4_myisam : Include file modified in 10.3.18
-main.custom_aggregates_i_s : Modified in 10.3.18
+main.ctype_utf8mb4_innodb : MDEV-17744 - Timeout; MDEV-18567 - ASAN use-after-poison
main.debug_sync : MDEV-10607 - internal error
-main.default : Modified in 10.3.18
-main.derived : Modified in 10.3.18
-main.derived_cond_pushdown : MDEV-20532 - Floating point differences; modified in 10.3.18
+main.default_session : Modified in 10.3.22
+main.delete_use_source : Modified in 10.3.22
+main.derived_cond_pushdown : MDEV-20532 - Floating point differences; modified in 10.3.22
main.derived_opt : MDEV-11768 - timeout
-main.derived_split_innodb : Modified in 10.3.18
-main.derived_view : Modified in 10.3.18
main.dirty_close : MDEV-19368 - mysqltest failed but provided no output
-main.distinct : MDEV-14194 - Crash; modified in 10.3.18
-main.drop_bad_db_type : MDEV-15676 - Wrong result; modified in 10.3.19
-main.drop_debug : Modified in 10.1.42
-main.dyncol : MDEV-19455 - Extra warning; modified in 10.3.18
-main.events_1 : Modified in 10.3.18
-main.events_2 : MDEV-13277 - Crash; modified in 10.3.18
-main.events_bugs : MDEV-12892 - Crash; modified in 10.3.18
-main.events_grant : Modified in 10.3.18
+main.distinct : MDEV-14194 - Crash
+main.drop_bad_db_type : MDEV-15676 - Wrong result; modified in 10.3.22
+main.dyncol : MDEV-19455 - Extra warning
+main.engine_error_in_alter-8453 : Modified in 10.3.22
+main.error_simulation : Modified in 10.3.22
+main.events_2 : MDEV-13277 - Crash
+main.events_bugs : MDEV-12892 - Crash; modified in 10.3.22
main.events_restart : MDEV-12236 - Server shutdown problem
main.events_slowlog : MDEV-12821 - Wrong result
-main.except : Modified in 10.3.18
-main.explain_json : Modified in 10.3.18
main.flush : MDEV-19368 - mysqltest failed but provided no output
-main.flush2 : Modified in 10.2.27
-main.func_hybrid_type : Modified in 10.3.18
-main.func_isnull : Modified in 10.3.18
-main.func_json : Modified in 10.3.19
-main.func_math : MDEV-20532 - Floating point differences; modified in 10.3.19
-main.func_misc : Modified in 10.3.19
-main.func_str : Modified in 10.3.18
-main.function_defaults : Modified in 10.3.18
+main.foreign_key : Modified in 10.3.22
+main.func_math : MDEV-20532 - Floating point differences
+main.func_misc : Modified in 10.3.22
+main.func_regexp_pcre : Modified in 10.3.22
+main.func_regexp_pcre_debug : Modified in 10.3.22
+main.func_time : Modified in 10.3.22
main.gis : MDEV-13411 - wrong result on P8
-main.grant : Configuration added in 10.3.18
-main.grant2 : Configuration added in 10.3.18
-main.grant4 : Configuration added in 10.3.18
-main.grant_cache_no_prot : Include file modified in 10.2.27
-main.grant_cache_ps_prot : Include file modified in 10.2.27
-main.grant_explain_non_select : Modified in 10.3.18
-main.greedy_optimizer : Modified in 10.3.18
-main.group_by : Modified in 10.3.18
-main.group_min_max : Modified in 10.3.18
-main.handlersocket : Configuration added in 10.3.18
+main.gis_notembedded : MDEV-21264 - Wrong result with different default charset
+main.group_by : Modified in 10.3.22
main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown
-main.index_intersect : Modified in 10.3.18
main.index_intersect_innodb : MDEV-10643 - failed with timeout
-main.index_merge_innodb : MDEV-7142 - Plan mismatch; modified in 10.3.19
-main.index_merge_myisam : Modified in 10.3.19
-main.information_schema : Modified in 10.3.18
-main.information_schema-big : Modified in 10.3.18
-main.information_schema_db : Modified in 10.3.19
-main.information_schema_parameters : Modified in 10.3.18
-main.information_schema_routines : Modified in 10.3.18
-main.innodb_ext_key : Modified in 10.3.18
-main.innodb_icp : Modified in 10.3.18
+main.index_merge_innodb : MDEV-7142 - Plan mismatch
main.innodb_mysql_lock : MDEV-7861 - Wrong result
-main.intersect : Modified in 10.3.18
-main.invisible_field_debug : Modified in 10.3.18
-main.join : Modified in 10.3.18
-main.join_cache : MDEV-17743 - Bad address from storage engine MyISAM; modified in 10.3.18
-main.join_nested_jcl6 : Modified in 10.3.18
-main.join_outer : Modified in 10.2.27
-main.join_outer_innodb : Modified in 10.3.18
-main.join_outer_jcl6 : Modified in 10.3.18
-main.kill : Modified in 10.3.18
+main.insert_debug : Added in 10.3.22
+main.join : Modified in 10.3.22
+main.join_cache : MDEV-17743 - Bad address from storage engine MyISAM; modified in 10.3.22
main.kill-2 : MDEV-13257 - Wrong result
main.kill_processlist-6619 : MDEV-10793 - Wrong result
-main.limit_rows_examined : Modified in 10.3.18
main.loaddata : MDEV-19368 - mysqltest failed but provided no output
main.locale : MDEV-20521 - Missing warning
-main.log_slow : MDEV-13263 - Wrong result; modified in 10.3.18
-main.log_slow_debug : Modified in 10.3.19
+main.log_slow : MDEV-13263 - Wrong result
+main.log_slow_debug : Modified in 10.3.22
main.log_tables-big : MDEV-13408 - wrong result
main.mdev-504 : MDEV-15171 - warning
-main.mdev13607 : Modified in 10.3.18
main.mdev375 : MDEV-10607 - sporadic "can't connect"
-main.merge : MDEV-10607 - sporadic "can't connect"; modified in 10.3.18
-main.mrr_icp_extra : Modified in 10.3.18
-main.multi_update : Modified in 10.3.18
+main.mdev6830 : Modified in 10.3.22
+main.merge : MDEV-10607 - sporadic "can't connect"
+main.merge-big : Modified in 10.3.22
+main.merge_debug : Modified in 10.3.22
main.multi_update_debug : MDEV-20136 - Debug sync point wait timed out
-main.myisam : Modified in 10.3.19
-main.myisam_explain_non_select_all : Modified in 10.3.18
-main.myisam_icp : Modified in 10.3.18
-main.myisam_mrr : Modified in 10.3.18
-main.mysql : Modified in 10.3.18
-main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2; modified in 10.3.18
+main.myisam_debug : Modified in 10.3.22
+main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2
main.mysql_client_test_comp : MDEV-16641 - Error in exec
main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed
-main.mysql_comments : Modified in 10.3.18
main.mysql_upgrade_noengine : MDEV-14355 - Wrong result
-main.mysql_upgrade_ssl : MDEV-13492 - Unknown SSL error
-main.mysqlcheck : Modified in 10.3.18
-main.mysqldump : MDEV-14800 - Stack smashing detected; modified in 10.3.18
-main.mysqldump-compat-102 : Modified in 10.3.18
-main.mysqldump-max : Modified in 10.2.27
-main.mysqldump-nl : Modified in 10.3.18
-main.mysqldump-utf8mb4 : Modified in 10.3.18
+main.mysqld_option_err : MDEV-21236 - Wrong error; MDEV-21571 - Crash on bootstrap
+main.mysqldump : MDEV-14800 - Stack smashing detected
main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug
main.mysqlslap : MDEV-11801 - timeout
main.mysqltest : MDEV-13887 - Wrong result
-main.named_pipe : Include file modified in 10.3.18
main.old-mode : MDEV-19373 - Wrong result
-main.openssl_1 : MDEV-13492 - Unknown SSL error; modified in 10.3.18
main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1
-main.opt_tvc : Modified in 10.3.18
-main.order_by_innodb : Modified in 10.3.19
+main.opt_tvc : Modified in 10.3.22
+main.order_by : Modified in 10.3.21
main.order_by_optimizer_innodb : MDEV-10683 - Wrong result
-main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock; modified in 10.3.19
-main.partition_example : Configuration added in 10.3.18
-main.partition_innodb : Modified in 10.3.19
+main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock
main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings
main.partition_innodb_semi_consistent : MDEV-19411 - Failed to start mysqld.1
-main.partition_key_cache : Modified in 10.2.27
-main.partition_pruning : Modified in 10.3.18
-main.partition_range : Modified in 10.3.18
-main.partition_ucs2 : Added in 10.3.19
-main.partition_utf8 : Modified in 10.3.19
-main.plugin : Configuration added in 10.3.18
-main.plugin_innodb : Configuration added in 10.3.18
-main.plugin_load : Configuration modified in 10.3.18
-main.plugin_load_option : Configuration modified in 10.3.18
-main.plugin_not_embedded : Configuration added in 10.3.18
-main.pool_of_threads : MDEV-18135 - SSL error: key too small; modified in 10.3.18
-main.processlist : Modified in 10.3.19
-main.processlist_notembedded : Added in 10.3.19
-main.ps : MDEV-11017 - Sporadic wrong Prepared_stmt_count; configuration modified in 10.3.18
+main.partition_mrr_aria : Added in 10.3.21
+main.partition_mrr_innodb : Added in 10.3.21
+main.partition_mrr_myisam : Added in 10.3.21
+main.partition_pruning : Modified in 10.3.21
+main.pool_of_threads : MDEV-18135 - SSL error: key too small
+main.ps : MDEV-11017 - Sporadic wrong Prepared_stmt_count
main.query_cache : MDEV-16180 - Wrong result
-main.query_cache_debug : MDEV-15281 - Query cache is disabled; modified in 10.3.18
-main.query_cache_notembedded : Modified in 10.3.18
-main.query_cache_ps_no_prot : Modified in 10.3.18
-main.range : Modified in 10.3.18
-main.range_interrupted-13751 : Modified in 10.3.18
-main.range_mrr_icp : Modified in 10.3.18
-main.range_vs_index_merge : Modified in 10.3.18
+main.query_cache_debug : MDEV-15281 - Query cache is disabled
+main.range_innodb : Modified in 10.3.22
+main.range_interrupted-13751 : Modified in 10.3.22
main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away
-main.repair : Modified in 10.3.18
-main.schema : Modified in 10.3.18
-main.select : MDEV-20532 - Floating point differences; modified in 10.3.18
+main.select : MDEV-20532 - Floating point differences
+main.select_debug : Modified in 10.3.22
main.select_jcl6 : MDEV-20532 - Floating point differences
main.select_pkeycache : MDEV-20532 - Floating point differences
-main.selectivity : Modified in 10.3.19
-main.selectivity_innodb : Modified in 10.3.18
-main.selectivity_no_engine : Modified in 10.3.18
+main.selectivity : Modified in 10.3.21
main.set_statement : MDEV-13183 - Wrong result
main.set_statement_notembedded : MDEV-19414 - Wrong result
-main.shm : MDEV-12727 - Mismatch, ERROR 2013; include file modified in 10.3.18
-main.show_bad_definer-5553 : Modified in 10.3.18
-main.show_check : Modified in 10.3.18
-main.show_explain : MDEV-10674 - Wrong result code
-main.sp : MDEV-7866 - Mismatch; modified in 10.3.19
-main.sp-anchor-type : Modified in 10.3.18
-main.sp-code : Modified in 10.3.19
-main.sp-error : Modified in 10.3.18
-main.sp-security : MDEV-10607 - sporadic "can't connect"; modified in 10.3.18
+main.shm : MDEV-12727 - Mismatch, ERROR 2013
+main.show_explain : MDEV-10674 - Wrong result code; modified in 10.3.22
+main.show_explain_non_select : Modified in 10.3.22
+main.show_explain_ps : Modified in 10.3.22
+main.slowlog_enospace-10508 : Modified in 10.3.22
+main.sp : MDEV-7866 - Mismatch
+main.sp-security : MDEV-10607 - sporadic "can't connect"
main.sp_notembedded : MDEV-10607 - internal error
-main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1; modified in 10.3.18
-main.ssl-big : Modified in 10.3.18
+main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1
+main.ssl_7937 : Modified in 10.3.22
+main.ssl_8k_key : Modified in 10.3.22
main.ssl_ca : MDEV-10895 - SSL connection error on Power
main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1
-main.ssl_compress : Modified in 10.3.18
-main.ssl_connect : MDEV-13492 - Unknown SSL error
-main.ssl_crl : MDEV-19119 - Wrong error code
+main.ssl_crl : MDEV-19119 - Wrong error code; modified in 10.3.21
+main.ssl_crl_clients : Modified in 10.3.22
+main.ssl_system_ca : Added in 10.3.22
main.ssl_timeout : MDEV-11244 - Crash
-main.stat_tables : Modified in 10.3.19
-main.stat_tables-enospc : Modified in 10.3.18
+main.stat_tables-enospc : Modified in 10.3.22
main.stat_tables_par : MDEV-13266 - Wrong result
main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding
-main.statistics : Modified in 10.3.18
main.status : MDEV-13255 - Wrong result
-main.subselect : MDEV-20551 - Valgrind failure; modified in 10.3.18
-main.subselect2 : Modified in 10.3.18
-main.subselect3 : Modified in 10.3.18
-main.subselect3_jcl6 : Modified in 10.3.18
-main.subselect4 : Modified in 10.3.18
-main.subselect_exists2in : Modified in 10.3.18
-main.subselect_extra : Modified in 10.3.18
+main.subselect : MDEV-20551 - Valgrind failure
main.subselect_innodb : MDEV-10614 - Wrong result
-main.subselect_mat_cost : Modified in 10.3.18
-main.subselect_mat_cost_bugs : Modified in 10.3.18
-main.subselect_sj : Modified in 10.3.19
-main.subselect_sj2 : Modified in 10.2.27
-main.subselect_sj2_jcl6 : Modified in 10.3.18
-main.subselect_sj2_mat : Modified in 10.3.18
-main.subselect_sj_jcl6 : Modified in 10.3.18
-main.subselect_sj_mat : Modified in 10.3.18
-main.subselect_sj_nonmerged : Modified in 10.3.18
-main.sum_distinct-big : Modified in 10.3.19
-main.system_mysql_db_fix50117 : Modified in 10.3.18
-main.system_time_debug : Added in 10.3.18
-main.table_options-5867 : Configuration added in 10.3.18
-main.table_value_constr : Modified in 10.3.19
main.tc_heuristic_recover : MDEV-14189 - Wrong result
-main.trigger : Modified in 10.3.18
-main.trigger-compat : Modified in 10.3.18
-main.trigger_notembedded : Modified in 10.3.18
-main.truncate_badse : Configuration added in 10.3.18
main.type_blob : MDEV-15195 - Wrong result
-main.type_date : Modified in 10.3.18
-main.type_datetime : Modified in 10.3.18
+main.type_datetime : Modified in 10.3.22
main.type_datetime_hires : MDEV-10687 - Timeout
main.type_float : MDEV-20532 - Floating point differences
-main.type_int : Modified in 10.3.18
-main.type_newdecimal : Modified in 10.3.19
-main.type_time_6065 : Modified in 10.3.18
-main.type_varchar : Configuration added in 10.3.18
-main.union : Modified in 10.3.18
-main.upgrade : Configuration added in 10.3.18
-main.userstat : MDEV-12904 - SSL errors; configuration added in 10.3.18
-main.variables : Modified in 10.3.18
-main.variables-notembedded : Modified in 10.2.27
-main.view : Modified in 10.3.18
+main.type_int : Modified in 10.3.22
+main.type_time : Modified in 10.3.22
+main.union_crash-714 : Modified in 10.3.22
+main.userstat : MDEV-12904 - SSL errors
main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query
-main.win : Modified in 10.3.18
-main.win_percentile : Modified in 10.3.18
+main.warnings_debug : Modified in 10.3.22
+main.win : Modified in 10.3.22
main.xa : MDEV-11769 - lock wait timeout
-main.xtradb_mrr : Modified in 10.3.18
#-----------------------------------------------------------------------
archive.archive_bitfield : MDEV-11771 - table is marked as crashed
archive.archive_symlink : MDEV-12170 - unexpected error on rmdir
archive.discover : MDEV-10510 - Table is marked as crashed
-archive.discover_5438 : Configuration added in 10.3.18
archive.mysqlhotcopy_archive : MDEV-10995 - Hang on debug
#-----------------------------------------------------------------------
@@ -296,41 +174,42 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed
#-----------------------------------------------------------------------
-binlog.binlog_commit_wait : MDEV-10150 - Mismatch
-binlog.binlog_innodb : Configuration added in 10.3.18
-binlog.binlog_killed : MDEV-12925 - Wrong result
-binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown; modified in 10.3.18
-binlog.binlog_mixed_cache_stat : Include file modified in 10.3.18
-binlog.binlog_mysqlbinlog2 : Modified in 10.2.27
-binlog.binlog_mysqlbinlog_row : Modified in 10.3.19
-binlog.binlog_mysqlbinlog_row_innodb : MDEV-20530 - Binary files differ
-binlog.binlog_mysqlbinlog_row_myisam : MDEV-20530 - Binary files differ
-binlog.binlog_row_cache_stat : Include file modified in 10.3.18
-binlog.binlog_row_drop_tmp_tbl : Include file modified in 10.3.18
-binlog.binlog_stm_cache_stat : Include file modified in 10.3.18
-binlog.binlog_stm_drop_tmp_tbl : Include file modified in 10.3.18
-binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint
-binlog.flashback-largebinlog : MDEV-19764 - Out of memory; modified in 10.3.18
-binlog.load_data_stm_view : MDEV-16948 - Wrong result
-binlog.read_only : Added in 10.3.19
-binlog.read_only_statement : Added in 10.3.19
+binlog.binlog_commit_wait : MDEV-10150 - Mismatch
+binlog.binlog_index : Include file modified in 10.2.31
+binlog.binlog_invalid_read_in_rotate : Added in 10.3.22
+binlog.binlog_ioerr : Include file modified in 10.2.31
+binlog.binlog_killed : MDEV-12925 - Wrong result
+binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown
+binlog.binlog_mysqlbinlog_row_innodb : MDEV-20530 - Binary files differ
+binlog.binlog_mysqlbinlog_row_myisam : MDEV-20530 - Binary files differ
+binlog.binlog_parallel_replication_marks_row : Include file modified in 10.3.22
+binlog.binlog_parallel_replication_marks_stm_mix : Include file modified in 10.3.22
+binlog.binlog_show_binlog_event_random_pos : Added in 10.3.22
+binlog.binlog_write_error : Include file Include file modified in 10.2.31
+binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint
+binlog.flashback-largebinlog : MDEV-19764 - Out of memory
+binlog.load_data_stm_view : MDEV-16948 - Wrong result
#-----------------------------------------------------------------------
-binlog_encryption.binlog_mdev_20574_old_binlog : Added in 10.3.19
+binlog_encryption.binlog_index : Include file modified in 10.3.22
+binlog_encryption.binlog_ioerr : Include file modified in 10.3.22
+binlog_encryption.binlog_write_error : Include file Include file modified in 10.3.22
binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint
binlog_encryption.encrypted_master : MDEV-14201 - Extra warnings
binlog_encryption.encrypted_master_switch_to_unencrypted : MDEV-14190 - Can't init tc log
binlog_encryption.encrypted_slave : MDEV-18135 - SSL error: key too small
binlog_encryption.encryption_combo : MDEV-14199 - Table is marked as crashed
-binlog_encryption.mysqlbinlog : Modified in 10.3.19
-binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash; include file modified in 10.3.19
-binlog_encryption.rpl_checksum : MDEV-16951 - Wrong result
-binlog_encryption.rpl_corruption : MDEV-20953 - Wrong error code
+binlog_encryption.multisource : MDEV-21289 - Wrong error code
+binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash
+binlog_encryption.rpl_checksum : MDEV-16951 - Wrong result; include file modified in 10.3.22
+binlog_encryption.rpl_corruption : Include file modified in 10.3.22
binlog_encryption.rpl_gtid_basic : MDEV-16947 - Server failed to start
+binlog_encryption.rpl_incident : Include file modified in 10.3.22
+binlog_encryption.rpl_init_slave_errors : Include file modified in 10.3.22
binlog_encryption.rpl_loadfile : MDEV-16645 - Timeout in include
-binlog_encryption.rpl_parallel : MDEV-10653 - Timeout in include
-binlog_encryption.rpl_parallel_ignored_errors : Added in 10.3.19
+binlog_encryption.rpl_parallel : MDEV-10653 - Timeout in include; include file modified in 10.3.22
+binlog_encryption.rpl_parallel_ignored_errors : Include file modified in 10.3.22
binlog_encryption.rpl_relayrotate : MDEV-15194 - Timeout
binlog_encryption.rpl_semi_sync : MDEV-11673 - Valgrind
binlog_encryption.rpl_skip_replication : MDEV-13571 - Unexpected warning; MDEV-20573 - Wrong result
@@ -341,39 +220,34 @@ binlog_encryption.rpl_typeconv : MDEV-14362 - Lost con
#-----------------------------------------------------------------------
-compat/oracle.sp : Modified in 10.3.18
-compat/oracle.sp-package : Modified in 10.3.18
-compat/oracle.sp-package-mysqldump : Modified in 10.3.18
-compat/oracle.sp-package-security : Modified in 10.3.18
-compat/oracle.type_blob : Modified in 10.3.18
+compat/oracle.sp-goto : Modified in 10.3.22
+compat/oracle.sp-goto-debug : Added in 10.3.22
#-----------------------------------------------------------------------
connect.alter : MDEV-18135 - SSL error: key too small
connect.drop-open-error : MDEV-18135 - SSL error: key too small
-connect.grant : Modified in 10.3.19
-connect.grant2 : Modified in 10.3.19
-connect.ini_grant : Modified in 10.3.19
+connect.grant : Modified in 10.1.44
+connect.grant2 : Modified in 10.1.44
+connect.ini_grant : Modified in 10.1.44
connect.json : MDEV-18135 - SSL error: key too small
-connect.mysql_grant : Modified in 10.3.19
+connect.mysql_grant : Modified in 10.1.44
connect.part_file : MDEV-18135 - SSL error: key too small
connect.part_table : MDEV-18135 - SSL error: key too small
connect.pivot : MDEV-14803 - Failed to discover table
connect.secure_file_priv : MDEV-18135 - SSL error: key too small
connect.vcol : MDEV-12374 - Fails on Windows
-connect.xml2_grant : Include file modified in 10.3.19
-connect.xml_grant : Include file modified in 10.3.19
+connect.xml2_grant : Include file modified in 10.1.44
+connect.xml_grant : Include file modified in 10.1.44
connect.zip : MDEV-13884 - Wrong result
#-----------------------------------------------------------------------
-encryption.create_or_replace : MDEV-12694 - Timeout; MDEV-16115 - Trying to access tablespace
+encryption.create_or_replace : MDEV-16115 - Trying to access tablespace
encryption.debug_key_management : MDEV-13841 - Timeout
encryption.encrypt_and_grep : MDEV-13765 - Wrong result
-encryption.file_creation : Added in 10.3.18
encryption.innochecksum : MDEV-13644 - Assertion failure
encryption.innodb-bad-key-change2 : MDEV-19118 - Can't connect to local MySQL server through socket
-encryption.innodb-checksum-algorithm : MDEV-16896 - Server crash
encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate
encryption.innodb-discard-import : MDEV-19113 - Timeout
encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout
@@ -383,17 +257,18 @@ encryption.innodb-missing-key : MDEV-14728 - SSL error
encryption.innodb-page_encryption : MDEV-10641 - mutex problem
encryption.innodb-page_encryption_log_encryption : MDEV-17339 - Crash on restart
encryption.innodb-read-only : MDEV-16563 - Crash on startup
-encryption.innodb-redo-badkey : Re-enabled in 10.3.19; modified in 10.3.19
+encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup
encryption.innodb-remove-encryption : MDEV-16493 - Timeout in wait condition
encryption.innodb-spatial-index : MDEV-13746 - Wrong result
encryption.innodb_encrypt_key_rotation_age : MDEV-19763 - Timeout
encryption.innodb_encrypt_log : MDEV-13725 - Wrong result
-encryption.innodb_encrypt_log_corruption : Configuration modified in 10.3.18
+encryption.innodb_encrypt_log_corruption : MDEV-14379 - Server crash
encryption.innodb_encrypt_temporary_tables : MDEV-20142 - Wrong result
encryption.innodb_encryption : MDEV-15675 - Timeout
encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure
encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result
encryption.innodb_encryption_filekeys : MDEV-15673 - Timeout
+encryption.innodb_encryption_is : MDEV-12898 - Server hang on startup
encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash
encryption.innodb_encryption_tables : MDEV-17339 - Crash on restart
encryption.innodb_first_page : MDEV-10689 - Crash
@@ -401,7 +276,6 @@ encryption.innodb_onlinealter_encryption : MDEV-17287 - SIGABRT on serve
encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing
encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing
encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing
-encryption.tempfiles : Modified in 10.2.27
#-----------------------------------------------------------------------
@@ -422,42 +296,14 @@ federated.federated_bug_585688 : MDEV-14805 - Server crash, MDEV-12907 - Valgr
federated.federated_innodb : MDEV-10617 - Wrong checksum
federated.federated_partition : MDEV-10417 - Fails on Mips
federated.federated_transactions : MDEV-10617 - Wrong checksum
-federated.federatedx : MDEV-10617 - Wrong checksum
-federated.federatedx_versioning : Modified in 10.3.19
+federated.federatedx : MDEV-10617 - Wrong checksum; modified in 10.3.21
#-----------------------------------------------------------------------
-funcs_1.innodb_storedproc_07 : Include file modified in 10.3.18
-funcs_1.innodb_storedproc_08 : Include file modified in 10.3.18
-funcs_1.innodb_trig_03e : Modified in 10.3.18
-funcs_1.is_basics_mixed : Modified in 10.3.19
-funcs_1.is_columns : Modified in 10.3.18
-funcs_1.is_columns_innodb : Modified in 10.3.18
-funcs_1.is_columns_memory : Modified in 10.3.18
-funcs_1.is_columns_myisam : Modified in 10.3.18
-funcs_1.is_routines : Include file modified in 10.3.18
-funcs_1.is_routines_embedded : Include file modified in 10.3.18
-funcs_1.is_schemata : Include file modified in 10.3.18
-funcs_1.is_schemata_embedded : Include file modified in 10.3.18
-funcs_1.is_schemata_is_mysql_test : Modified in 10.3.18
-funcs_1.is_tables : Include file modified in 10.3.18
-funcs_1.is_tables_embedded : Include file modified in 10.3.18
-funcs_1.is_tables_innodb : Include file modified in 10.3.18
-funcs_1.is_tables_memory : Include file modified in 10.3.18
-funcs_1.is_tables_myisam : Include file modified in 10.3.18
-funcs_1.is_tables_myisam_embedded : Include file modified in 10.3.18
-funcs_1.is_triggers : Include file modified in 10.3.18
-funcs_1.is_triggers_embedded : Include file modified in 10.3.18
-funcs_1.memory_storedproc_07 : Include file modified in 10.3.18
-funcs_1.memory_storedproc_08 : Include file modified in 10.3.18
-funcs_1.memory_trig_03e : Modified in 10.3.18
-funcs_1.memory_views : MDEV-11773 - timeout
-funcs_1.myisam_storedproc_07 : Include file modified in 10.3.18
-funcs_1.myisam_storedproc_08 : Include file modified in 10.3.18
-funcs_1.myisam_trig_03e : Modified in 10.3.18
-funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result
-funcs_1.processlist_val_ps : MDEV-12175 - Wrong plan
-funcs_1.storedproc : Modified in 10.3.18
+funcs_1.is_check_constraints : Modified in 10.3.22
+funcs_1.memory_views : MDEV-11773 - timeout
+funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result
+funcs_1.processlist_val_ps : MDEV-12175 - Wrong plan
#-----------------------------------------------------------------------
@@ -466,8 +312,7 @@ funcs_2.myisam_charset : MDEV-11535 - Timeout
#-----------------------------------------------------------------------
-funcs_2/charset.* : MDEV-10999 - Not maintained
-funcs_2/charset.charset_master : Modified in 10.3.18
+funcs_2/charset.* : MDEV-10999 - Not maintained
#-----------------------------------------------------------------------
@@ -480,87 +325,76 @@ galera_3nodes.* : Suite is not stable yet
#-----------------------------------------------------------------------
gcol.gcol_rollback : MDEV-16954 - Unknown storage engine 'InnoDB'
-gcol.gcol_select_innodb : Include file modified in 10.2.27
-gcol.gcol_select_myisam : Include file modified in 10.2.27
-gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion; modified in 10.3.18
+gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion
gcol.innodb_virtual_debug : MDEV-19114 - Assertion failure
-gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result; modified in 10.3.19
+gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result; modified in 10.3.22
gcol.innodb_virtual_fk_restart : MDEV-17466 - Assertion failure
-gcol.innodb_virtual_index : Modified in 10.3.18
#-----------------------------------------------------------------------
innodb.101_compatibility : MDEV-13891 - Wrong result
-innodb.alter_algorithm : Modified in 10.3.19
-innodb.alter_copy : MDEV-16181 - Assertion failure; modified in 10.3.18
+innodb.alter_copy : MDEV-16181 - Assertion failure
innodb.alter_crash : MDEV-16944 - The process cannot access the file
innodb.alter_large_dml : MDEV-20148 - Debug sync point wait timed out
-innodb.auto_increment_dup : Modified in 10.3.18
innodb.autoinc_persist : MDEV-15282 - Assertion failure
innodb.binlog_consistent : MDEV-10618 - Server fails to start
innodb.blob-crash : MDEV-20481 - Crash during recovery
+innodb.blob-update-debug : Modified in 10.3.22
innodb.doublewrite : MDEV-12905 - Server crash
-innodb.foreign-keys : Modified in 10.3.18
-innodb.foreign_key : Modified in 10.3.18
innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed
innodb.group_commit_crash_no_optimize_thread : MDEV-13830 - Assertion failure
-innodb.ibuf_not_empty : MDEV-19021 - Wrong result; modified in 10.3.19
-innodb.information_schema_grants : Added in 10.3.19
-innodb.innodb-32k-crash : MDEV-20194 - Extra warning
-innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup
-innodb.innodb-alter : Modified in 10.3.18
+innodb.ibuf_not_empty : MDEV-19021 - Wrong result; modified in 10.3.21
+innodb.innodb-32k-crash : MDEV-20194 - Extra warning; modified in 10.3.21
+innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup; modified in 10.3.21
innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS
-innodb.innodb-alter-nullable : Modified in 10.3.19
innodb.innodb-alter-table : MDEV-10619 - Testcase timeout
-innodb.innodb-autoinc : Modified in 10.3.19
innodb.innodb-bigblob : MDEV-18655 - ASAN unknown crash
innodb.innodb-blob : MDEV-12053 - Client crash
-innodb.innodb-change-buffer-recovery : MDEV-19115 - Lost connection to MySQL server during query; modified in 10.3.19
+innodb.innodb-change-buffer-recovery : MDEV-19115 - Lost connection to MySQL server during query
innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown
-innodb.innodb-fkcheck : Modified in 10.3.18
-innodb.innodb-get-fk : MDEV-13276 - Server crash; modified in 10.3.18
+innodb.innodb-get-fk : MDEV-13276 - Server crash
innodb.innodb-index-online : MDEV-14809 - Cannot save statistics
-innodb.innodb-mdev7046 : Modified in 10.3.18
+innodb.innodb-mdev-7513 : Modified in 10.3.21
innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure
innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result
innodb.innodb-page_compression_snappy : MDEV-13644 - Assertion failure
innodb.innodb-page_compression_tables : MDEV-13644 - Assertion failure
innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem
-innodb.innodb-read-view : Added in 10.3.18
-innodb.innodb-system-table-view : Modified in 10.3.18
+innodb.innodb-replace-debug : Modified in 10.3.22
+innodb.innodb-stats-initialize-failure : Modified in 10.3.22
innodb.innodb-table-online : MDEV-13894 - Wrong result
-innodb.innodb-virtual-columns-debug : Modified in 10.3.19
innodb.innodb-wl5522 : MDEV-13644 - Assertion failure
-innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno; modified in 10.3.18
+innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno
innodb.innodb_buffer_pool_dump_pct : MDEV-20139 - Timeout in wait_condition.inc
innodb.innodb_buffer_pool_resize : MDEV-16964 - Assertion failure
innodb.innodb_buffer_pool_resize_with_chunks : MDEV-16964 - Assertion failure
+innodb.innodb_bug11754376 : Modified in 10.3.22
innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt
+innodb.innodb_bug30113362 : Added in 10.3.22
innodb.innodb_bug30423 : MDEV-7311 - Wrong result
innodb.innodb_bug47167 : MDEV-20524 - Table 'user' is marked as crashed and should be repaired
innodb.innodb_bug48024 : MDEV-14352 - Assertion failure
+innodb.innodb_bug56947 : Modified in 10.3.22
innodb.innodb_bug59641 : MDEV-13830 - Assertion failure
-innodb.innodb_bug68148 : Modified in 10.3.18
-innodb.innodb_bug84958 : Added in 10.3.18
-innodb.innodb_bulk_create_index_debug : Include file modified in 10.3.18
-innodb.innodb_bulk_create_index_flush : Configuration added in 10.3.18
innodb.innodb_bulk_create_index_replication : MDEV-15273 - Slave failed to start
+innodb.innodb_corrupt_bit : Modified in 10.3.22
innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full
-innodb.innodb_force_recovery : Modified in 10.3.19
innodb.innodb_information_schema : MDEV-8851 - Wrong result
-innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed
-innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result
+innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed; modified in 10.3.21
+innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result; modified in 10.3.21
innodb.innodb_monitor : MDEV-10939 - Testcase timeout
innodb.innodb_mysql : MDEV-19873 - Wrong result
innodb.innodb_simulate_comp_failures_small : MDEV-20526 - ASAN use-after-poison
innodb.innodb_stats : MDEV-10682 - wrong result
-innodb.innodb_stats_persistent : MDEV-17745 - Wrong result; modified in 10.3.19
+innodb.innodb_stats_persistent : MDEV-17745 - Wrong result; MDEV-21567 - Wrong result in execution plan
innodb.innodb_stats_persistent_debug : MDEV-14801 - Operation failed
-innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait
+innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait; modified in 10.3.22
+innodb.innodb_wl6326 : Added in 10.3.22
+innodb.innodb_wl6326_big : Added in 10.3.22
innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks
-innodb.instant_alter : Modified in 10.3.18
-innodb.instant_alter_bugs : Modified in 10.3.19
-innodb.log_alter_table : Configuration added in 10.3.18
+innodb.instant_alter : Modified in 10.3.21
+innodb.instant_alter_debug : Modified in 10.3.21
+innodb.leaf_page_corrupted_during_recovery : MDEV-21572 - Server crash
innodb.log_corruption : MDEV-13251 - Wrong result
innodb.log_data_file_size : MDEV-14204 - Server failed to start
innodb.log_file_name : MDEV-14193 - Exception
@@ -570,81 +404,77 @@ innodb.purge_secondary : MDEV-15681 - Wrong result
innodb.purge_secondary_mdev-16222 : MDEV-20528 - Debug sync point wait timed out
innodb.purge_thread_shutdown : MDEV-13792 - Wrong result
innodb.read_only_recovery : MDEV-13886 - Server crash
-innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile; modified in 10.3.18
+innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile
+innodb.redo_log_during_checkpoint : Modified in 10.3.22
innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace
-innodb.stat_tables : Added in 10.3.19
+innodb.row_size_error_log_warnings_3 : Modified in 10.3.22
innodb.table_definition_cache_debug : MDEV-14206 - Extra warning
innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start
innodb.temporary_table : MDEV-13265 - Wrong result
-innodb.temporary_table_optimization : Modified in 10.3.19
-innodb.trx_id_future : Modified in 10.3.18
+innodb.truncate_inject : Modified in 10.2.31
+innodb.undo_log : Modified in 10.3.21
innodb.undo_truncate : MDEV-17340 - Server hung; MDEV-20840 - Sporadic timeout
-innodb.undo_truncate_recover : MDEV-17679 - Server has gone away; modified in 10.3.18
+innodb.undo_truncate_recover : MDEV-17679 - Server has gone away
innodb.update_time : MDEV-14804 - Wrong result
innodb.xa_recovery : MDEV-15279 - mysqld got exception
#-----------------------------------------------------------------------
-innodb_fts.concurrent_insert : Modified in 10.3.19
-innodb_fts.crash_recovery : Modified in 10.3.19
-innodb_fts.innodb_fts_misc : Modified in 10.3.19
+innodb_fts.concurrent_insert : Modified in 10.3.22
+innodb_fts.innodb_fts_misc : Modified in 10.3.21
innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning
innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log
innodb_fts.innodb_fts_stopword_charset : MDEV-13259 - Table crashed
innodb_fts.sync : MDEV-14808 - Wrong result
+innodb_fts.sync_block : Modified in 10.3.22
innodb_fts.sync_ddl : MDEV-18654 - Assertion failure
#-----------------------------------------------------------------------
innodb_gis.alter_spatial_index : MDEV-13745 - Server crash
-innodb_gis.rtree_compress2 : MDEV-16269 - Wrong result; modified in 10.3.18
+innodb_gis.rtree_compress2 : MDEV-16269 - Wrong result
innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded
+innodb_gis.rtree_debug : Modified in 10.3.22
innodb_gis.rtree_purge : MDEV-15275 - Timeout
innodb_gis.rtree_recovery : MDEV-15274 - Error on check
+innodb_gis.rtree_rollback1 : Modified in 10.3.22
+innodb_gis.rtree_rollback2 : Modified in 10.3.22
innodb_gis.rtree_split : MDEV-14208 - Too many arguments
innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file
innodb_gis.types : MDEV-15679 - Table is marked as crashed
-innodb_gis.update_root : Modified in 10.3.18
#-----------------------------------------------------------------------
-innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed
-innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings
-innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2; modified in 10.3.18
-innodb_zip.wl6470_1 : MDEV-14240 - Assertion failure
-innodb_zip.wl6501_1 : MDEV-10891 - Can't create UNIX socket
-innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error 192
+innodb_zip.bug53591 : Modified in 10.3.21
+innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed; modified in 10.3.22
+innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings
+innodb_zip.prefix_index_liftedlimit : Modified in 10.3.21
+innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2
+innodb_zip.wl6470_1 : MDEV-14240 - Assertion failure
+innodb_zip.wl6501_1 : MDEV-10891 - Can't create UNIX socket
+innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error 192
#-----------------------------------------------------------------------
-maria.icp : Modified in 10.3.18
-maria.insert_select : MDEV-12757 - Timeout
-maria.insert_select-7314 : MDEV-16492 - Timeout
-maria.lock : Modified in 10.3.19
-maria.maria : MDEV-14430 - Extra warning
-maria.maria-big : Modified in 10.3.18
-maria.maria-gis-recovery : Modified in 10.3.18
-maria.maria-no-logging : MDEV-20196 - Crash on shutdown or server can't start; modified in 10.3.18
-maria.maria-recover : Modified in 10.3.18
-maria.maria-recovery : Modified in 10.3.18
-maria.maria3 : Modified in 10.3.18
-maria.partition : Added in 10.3.18
+maria.aria_pack_mdev14183 : Added in 10.3.22
+maria.insert_select : MDEV-12757 - Timeout
+maria.insert_select-7314 : MDEV-16492 - Timeout
+maria.maria : MDEV-14430 - Extra warning
+maria.maria-no-logging : MDEV-20196 - Crash on shutdown or server can't start
#-----------------------------------------------------------------------
mariabackup.absolute_ibdata_paths : MDEV-16571 - Wrong result
mariabackup.apply-log-only : MDEV-20135 - Timeout
-mariabackup.big_innodb_log : Added in 10.3.18
mariabackup.data_directory : MDEV-15270 - Error on exec
-mariabackup.extra_lsndir_stream : Added in 10.3.19
mariabackup.full_backup : MDEV-16571 - Wrong result
mariabackup.huge_lsn : MDEV-15662 - Sequence number is in the future; MDEV-18569 - Table doesn't exist
+mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure; modified in 10.3.21
mariabackup.incremental_encrypted : MDEV-15667 - timeout
mariabackup.incremental_rocksdb : MDEV-20954 - Cannot access the file
+mariabackup.innodb_redo_log_overwrite : Added in 10.3.22
mariabackup.log_checksum_mismatch : MDEV-16571 - Wrong result
mariabackup.mdev-14447 : MDEV-15201 - Timeout
-mariabackup.mdev-18438 : Added in 10.3.19
-mariabackup.partial : Modified in 10.3.19
mariabackup.partial_exclude : MDEV-15270 - Error on exec
mariabackup.unencrypted_page_compressed : MDEV-18653 - Wrong error
mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault
@@ -671,8 +501,9 @@ mroonga/wrapper.repair_table_no_index_file : MDEV-14807 - Wrong error message
#-----------------------------------------------------------------------
multi_source.gtid : MDEV-14202 - Crash
-multi_source.info_logs : MDEV-12629 - Valgrind, MDEV-10042 - wrong result
-multi_source.mdev-8874 : Re-enabled in 10.3.18
+multi_source.info_logs : MDEV-12629 - Valgrind, MDEV-10042 - wrong result; MDEV-21290 - Wrong result
+multi_source.load_data : MDEV-21235 - Slave crash
+multi_source.mdev-8874 : MDEV-19415 - AddressSanitizer: heap-use-after-free
multi_source.mdev-9544 : MDEV-19415 - AddressSanitizer: heap-use-after-free
multi_source.multisource : MDEV-10417 - Fails on Mips
multi_source.reset_slave : MDEV-10690 - Wrong result
@@ -681,35 +512,28 @@ multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_h
#-----------------------------------------------------------------------
+optimizer_unfixed_bugs.bug36981 : Modified in 10.3.22
+optimizer_unfixed_bugs.bug40992 : Modified in 10.3.22
+optimizer_unfixed_bugs.bug41996 : Modified in 10.3.22
+optimizer_unfixed_bugs.bug42991 : Modified in 10.3.22
+optimizer_unfixed_bugs.bug43249 : Modified in 10.3.22
+optimizer_unfixed_bugs.bug43360 : Modified in 10.3.22
+optimizer_unfixed_bugs.bug43448 : Modified in 10.3.22
+optimizer_unfixed_bugs.bug43617 : Modified in 10.3.22
+
+#-----------------------------------------------------------------------
+
parts.partition_alter1_1_2_innodb : MDEV-18655 - ASAN unknown crash
parts.partition_alter1_1_innodb : MDEV-18655 - ASAN unknown crash
parts.partition_alter1_2_innodb : MDEV-18655 - ASAN unknown crash
parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query
parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired
parts.partition_auto_increment_maria : MDEV-14430 - Extra warning
-parts.partition_debug : Modified in 10.3.19
-parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist; modified in 10.3.19
-parts.partition_debug_myisam : Modified in 10.3.19
+parts.partition_debug : Modified in 10.3.22
+parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist; modified in 10.3.22
parts.partition_exch_qa_10 : MDEV-11765 - wrong result
-parts.partition_exch_qa_4_innodb : Include file modified in 10.3.18
-parts.partition_exch_qa_4_myisam : Include file modified in 10.3.18
-parts.partition_exch_qa_8_innodb : Include file modified in 10.3.18
-parts.partition_exch_qa_8_myisam : Include file modified in 10.3.18
parts.partition_innodb_status_file : MDEV-12901 - Valgrind
-parts.partition_mgm_lc0_archive : Include file modified in 10.3.18
-parts.partition_mgm_lc0_innodb : Include file modified in 10.3.18
-parts.partition_mgm_lc0_memory : Include file modified in 10.3.18
-parts.partition_mgm_lc0_myisam : Include file modified in 10.3.18
-parts.partition_mgm_lc1_archive : Include file modified in 10.3.18
-parts.partition_mgm_lc1_innodb : Include file modified in 10.3.18
-parts.partition_mgm_lc1_memory : Include file modified in 10.3.18
-parts.partition_mgm_lc1_myisam : Include file modified in 10.3.18
-parts.partition_mgm_lc2_archive : Include file modified in 10.3.18
-parts.partition_mgm_lc2_innodb : Include file modified in 10.3.18
-parts.partition_mgm_lc2_memory : Include file modified in 10.3.18
-parts.partition_mgm_lc2_myisam : Include file modified in 10.3.18
parts.partition_special_innodb : MDEV-16942 - Timeout
-parts.reorganize_partition_innodb : Added in 10.3.19
#-----------------------------------------------------------------------
@@ -722,34 +546,53 @@ perfschema.dml_file_instances : MDEV-15179 - Wrong result
perfschema.dml_threads : MDEV-17746 - Wrong errno
perfschema.func_file_io : MDEV-5708 - fails for s390x
perfschema.func_mutex : MDEV-5708 - fails for s390x
-perfschema.hostcache_ipv4_addrinfo_again_allow : MDEV-12759 - Crash
-perfschema.hostcache_ipv6_addrinfo_again_allow : MDEV-12752 - Crash; configuration modified in 10.3.18
-perfschema.hostcache_ipv6_addrinfo_again_deny : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_addrinfo_bad_allow : MDEV-13260 - Crash; configuration modified in 10.3.18
-perfschema.hostcache_ipv6_addrinfo_bad_deny : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_addrinfo_good_allow : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_addrinfo_good_deny : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_addrinfo_noname_allow : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_addrinfo_noname_deny : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_auth_plugin : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_blocked : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_max_con : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_nameinfo_again_allow : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_nameinfo_again_deny : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_nameinfo_noname_allow : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_nameinfo_noname_deny : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_passwd : Configuration modified in 10.3.18
-perfschema.hostcache_ipv6_ssl : MDEV-10696 - Crash; configuration modified in 10.3.18
+perfschema.hostcache_ipv4_addrinfo_again_allow : MDEV-12759 - Crash; modified in 10.3.22
+perfschema.hostcache_ipv4_addrinfo_again_deny : Modified in 10.3.22
+perfschema.hostcache_ipv4_addrinfo_bad_allow : Modified in 10.3.22
+perfschema.hostcache_ipv4_addrinfo_bad_deny : Modified in 10.3.22
+perfschema.hostcache_ipv4_addrinfo_good_allow : Modified in 10.3.22
+perfschema.hostcache_ipv4_addrinfo_good_deny : Modified in 10.3.22
+perfschema.hostcache_ipv4_addrinfo_noname_allow : Modified in 10.3.22
+perfschema.hostcache_ipv4_addrinfo_noname_deny : Modified in 10.3.22
+perfschema.hostcache_ipv4_auth_plugin : Modified in 10.3.22
+perfschema.hostcache_ipv4_blocked : Modified in 10.3.22
+perfschema.hostcache_ipv4_format : Modified in 10.3.22
+perfschema.hostcache_ipv4_max_con : Modified in 10.3.22
+perfschema.hostcache_ipv4_nameinfo_again_allow : Modified in 10.3.22
+perfschema.hostcache_ipv4_nameinfo_again_deny : Modified in 10.3.22
+perfschema.hostcache_ipv4_nameinfo_noname_allow : Modified in 10.3.22
+perfschema.hostcache_ipv4_nameinfo_noname_deny : Modified in 10.3.22
+perfschema.hostcache_ipv4_passwd : Modified in 10.3.22
+perfschema.hostcache_ipv4_ssl : Modified in 10.3.22
+perfschema.hostcache_ipv6_addrinfo_again_allow : MDEV-12752 - Crash; modified in 10.3.22
+perfschema.hostcache_ipv6_addrinfo_again_deny : Modified in 10.3.22
+perfschema.hostcache_ipv6_addrinfo_bad_allow : MDEV-13260 - Crash; modified in 10.3.22
+perfschema.hostcache_ipv6_addrinfo_bad_deny : Modified in 10.3.22
+perfschema.hostcache_ipv6_addrinfo_good_allow : Modified in 10.3.22
+perfschema.hostcache_ipv6_addrinfo_good_deny : Modified in 10.3.22
+perfschema.hostcache_ipv6_addrinfo_noname_allow : Modified in 10.3.22
+perfschema.hostcache_ipv6_addrinfo_noname_deny : Modified in 10.3.22
+perfschema.hostcache_ipv6_auth_plugin : Modified in 10.3.22
+perfschema.hostcache_ipv6_blocked : Modified in 10.3.22
+perfschema.hostcache_ipv6_max_con : Modified in 10.3.22
+perfschema.hostcache_ipv6_nameinfo_again_allow : Modified in 10.3.22
+perfschema.hostcache_ipv6_nameinfo_again_deny : Modified in 10.3.22
+perfschema.hostcache_ipv6_nameinfo_noname_allow : Modified in 10.3.22
+perfschema.hostcache_ipv6_nameinfo_noname_deny : Modified in 10.3.22
+perfschema.hostcache_ipv6_passwd : Modified in 10.3.22
+perfschema.hostcache_ipv6_ssl : MDEV-10696 - Crash; modified in 10.3.22
+perfschema.hostcache_peer_addr : MDEV-21462 - Test condition timeout; modified in 10.3.22
+perfschema.misc : Modified in 10.3.21
perfschema.privilege_table_io : MDEV-13184 - Extra lines
perfschema.relaylog : MDEV-18134 - Wrong result
perfschema.rpl_gtid_func : MDEV-16897 - Wrong result
perfschema.socket_instances_func : MDEV-20140 - Wrong result
perfschema.socket_summary_by_event_name_func : MDEV-10622 - Wrong result
perfschema.socket_summary_by_instance_func : MDEV-19413 - Wrong result
-perfschema.stage_mdl_function : Include file modified in 10.3.18
-perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders; include file modified in 10.3.18
-perfschema.stage_mdl_procedure : MDEV-11545 - Missing row; include file modified in 10.3.18
-perfschema.stage_mdl_table : MDEV-12638 - Wrong result; include file modified in 10.3.18
+perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders
+perfschema.stage_mdl_procedure : MDEV-11545 - Missing row
+perfschema.stage_mdl_table : MDEV-12638 - Wrong result
+perfschema.start_server_low_digest : MDEV-21221 - Wrong result
perfschema.threads_mysql : MDEV-10677 - Wrong result
#-----------------------------------------------------------------------
@@ -758,11 +601,9 @@ perfschema_stress.* : MDEV-10996 - Not maintained
#-----------------------------------------------------------------------
-plugins.feedback_plugin_load : Modified in 10.3.19
plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such
plugins.processlist : MDEV-16574 - Wrong result
-plugins.qc_info : Modified in 10.3.18
-plugins.server_audit : MDEV-14295 - Wrong result
+plugins.server_audit : MDEV-14295 - Wrong result; modified in 10.3.21
plugins.thread_pool_server_audit : MDEV-14295 - Wrong result
#-----------------------------------------------------------------------
@@ -778,7 +619,6 @@ rocksdb.drop_index_inplace : MDEV-14162 - Crash on shutdown
rocksdb.drop_table : MDEV-14308 - Timeout
rocksdb.drop_table3 : MDEV-16949 - Server crash
rocksdb.dup_key_update : MDEV-17284 - Wrong result
-rocksdb.index_merge_rocksdb2 : Include file modified in 10.3.19
rocksdb.locking_issues : MDEV-14464 - Wrong result
rocksdb.mariadb_ignore_dirs : MDEV-16639 - Server crash
rocksdb.mariadb_port_fixes : MDEV-16387 - Wrong plan
@@ -803,126 +643,124 @@ rocksdb_sys_vars.rocksdb_rate_limiter_bytes_per_sec_basic : MDEV-16639 - Crash
#-----------------------------------------------------------------------
-roles.acl_statistics : Configuration added in 10.3.18
-roles.create_and_grant_role : MDEV-11772 - wrong result
-roles.definer : Modified in 10.3.18
-roles.show_create_database-10463 : Modified in 10.3.18
-
-#-----------------------------------------------------------------------
-
-rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free
-rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server
-rpl.create_or_replace_mix : MDEV-20523 - Wrong result
-rpl.create_or_replace_statement : MDEV-20523 - Wrong result
-rpl.create_select : MDEV-14121 - Assertion failure
-rpl.last_insert_id : MDEV-10625 - warnings in error log
-rpl.mdev_17588 : Modified in 10.3.18
-rpl.rpl_000011 : Modified in 10.3.19
-rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips
-rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips
-rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log
-rpl.rpl_binlog_errors : MDEV-12742 - Crash
-rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master
-rpl.rpl_colSize : MDEV-16112 - Server crash
-rpl.rpl_corruption : MDEV-20527 - Slave stopped with wrong error code
-rpl.rpl_create_or_replace_fail : Added in 10.3.18
-rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac
-rpl.rpl_ddl : MDEV-10417 - Fails on Mips
-rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash
-rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Table marked as crashed
-rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Table marked as crashed
-rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start
-rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning
-rpl.rpl_extra_col_master_myisam : MDEV-14203 - Extra warning
-rpl.rpl_failed_drop_tbl_binlog : Added in 10.3.18
-rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output
-rpl.rpl_gtid_basic : MDEV-10681 - server startup problem
-rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection
-rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout
-rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash
-rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings
-rpl.rpl_gtid_reconnect : MDEV-14497 - Crash
-rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output
-rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings
-rpl.rpl_gtid_until : MDEV-10625 - warnings in error log
-rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips
-rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x
-rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x
-rpl.rpl_insert_id : MDEV-15197 - Wrong result
-rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure
-rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query
-rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips
-rpl.rpl_ip_mix : Modified in 10.3.19
-rpl.rpl_ip_mix2 : Modified in 10.3.19
-rpl.rpl_ipv4_as_ipv6 : MDEV-20147 - Incorrect checksum for freed object
-rpl.rpl_known_bugs_detection : Modified in 10.2.27
-rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog
-rpl.rpl_mdev12179 : MDEV-19043 - Table marked as crashed
-rpl.rpl_mdev6020 : MDEV-15272 - Server crash
-rpl.rpl_mdev_17614 : Added in 10.3.18
-rpl.rpl_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed
-rpl.rpl_non_direct_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed
-rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait
-rpl.rpl_non_direct_stm_mixing_engines : MDEV-14489 - Failed sync_slave_with_master
-rpl.rpl_parallel : MDEV-10653 - Timeouts
-rpl.rpl_parallel2 : MDEV-17390 - Operation cannot be performed
-rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash
-rpl.rpl_parallel_ignored_errors : Added in 10.3.19
-rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure
-rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout
-rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master
-rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master
-rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout
-rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result
-rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips
-rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings
-rpl.rpl_read_only2 : Added in 10.3.19
-rpl.rpl_rotate_logs : Modified in 10.3.19
-rpl.rpl_row_001 : MDEV-16653 - MTR's internal check fails
-rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start
-rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed
-rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result
-rpl.rpl_row_find_row_debug : Modified in 10.3.19
-rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed
-rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed
-rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed
-rpl.rpl_row_index_choice : MDEV-15196 - Slave crash
-rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x
-rpl.rpl_row_type_conv_err_msg : Added in 10.3.18
-rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum
-rpl.rpl_semi_sync : MDEV-11220 - Wrong result
-rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result
-rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result
-rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings
-rpl.rpl_semi_sync_slave_reply_fail : Added in 10.3.19
-rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures
-rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition
-rpl.rpl_semisync_ali_issues : MDEV-16272 - Wrong result
-rpl.rpl_set_statement_default_master : MDEV-13258 - Extra warning
-rpl.rpl_show_slave_hosts : MDEV-10681 - Crash
-rpl.rpl_skip_error : Modified in 10.3.19
-rpl.rpl_skip_replication : MDEV-13258 - Extra warning
-rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock
-rpl.rpl_slave_load_tmpdir_not_exist : MDEV-14203 - Extra warning
-rpl.rpl_slow_query_log : MDEV-13250 - Test abort
-rpl.rpl_sp_effects : MDEV-13249 - Crash
-rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout
-rpl.rpl_stm_mixing_engines : MDEV-14489 - Sync slave with master failed
-rpl.rpl_stm_multi_query : MDEV-9501 - Failed registering on master
-rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion
-rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash
-rpl.rpl_sync : MDEV-13830 - Assertion failure
-rpl.rpl_sync_with_innodb_thd_conc : Added in 10.3.18
-rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master
-rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries
-rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output
-rpl.rpl_trigger : MDEV-18055 - Wrong result
-rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error
-rpl.rpl_unsafe_statements : Modified in 10.1.42
-rpl.rpl_user_variables : MDEV-20522 - Wrong result
-rpl.rpl_variables : MDEV-20150 - Server crash
-rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result
-rpl.show_status_stop_slave_race-7126 : MDEV-17438 - Timeout
+roles.create_and_grant_role : MDEV-11772 - wrong result
+
+#-----------------------------------------------------------------------
+
+rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free; modified in 10.3.22
+rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server
+rpl.create_or_replace_mix : MDEV-20523 - Wrong result
+rpl.create_or_replace_statement : MDEV-20523 - Wrong result
+rpl.create_select : MDEV-14121 - Assertion failure
+rpl.kill_race_condition : Modified in 10.3.22
+rpl.last_insert_id : MDEV-10625 - warnings in error log
+rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips
+rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips
+rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log
+rpl.rpl_binlog_errors : MDEV-12742 - Crash
+rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master
+rpl.rpl_binlog_rollback_cleanup : Added in 10.3.22
+rpl.rpl_bug33931 : Modified in 10.3.22
+rpl.rpl_bug41902 : Modified in 10.3.22
+rpl.rpl_checksum : Include file modified in 10.2.31
+rpl.rpl_colSize : MDEV-16112 - Server crash
+rpl.rpl_corruption : MDEV-20527 - Slave stopped with wrong error code
+rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac
+rpl.rpl_ddl : MDEV-10417 - Fails on Mips
+rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash; modified in 10.3.22
+rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Table marked as crashed; modified in 10.3.22
+rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Table marked as crashed
+rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start
+rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning
+rpl.rpl_extra_col_master_myisam : MDEV-14203 - Extra warning
+rpl.rpl_flushlog_loop : MDEV-21570 - Server crash
+rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output
+rpl.rpl_get_master_version_and_clock : Modified in 10.3.22
+rpl.rpl_gtid_basic : MDEV-10681 - server startup problem
+rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection
+rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout
+rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash
+rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings
+rpl.rpl_gtid_reconnect : MDEV-14497 - Crash; modified in 10.3.22
+rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output
+rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings
+rpl.rpl_gtid_until : MDEV-10625 - warnings in error log
+rpl.rpl_heartbeat_debug : Modified in 10.3.22
+rpl.rpl_incident : Include file modified in 10.2.31
+rpl.rpl_init_slave_errors : Include file modified in 10.2.31
+rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips
+rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x
+rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x
+rpl.rpl_insert_id : MDEV-15197 - Wrong result
+rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure
+rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query
+rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips
+rpl.rpl_ipv4_as_ipv6 : MDEV-20147 - Incorrect checksum for freed object
+rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog; modified in 10.3.22
+rpl.rpl_mdev12179 : MDEV-19043 - Table marked as crashed
+rpl.rpl_mdev6020 : MDEV-15272 - Server crash
+rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout
+rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait
+rpl.rpl_parallel : MDEV-10653 - Timeouts
+rpl.rpl_parallel2 : MDEV-17390 - Operation cannot be performed
+rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash
+rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure
+rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout
+rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master; modified in 10.3.22
+rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master
+rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout
+rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result
+rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips
+rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings
+rpl.rpl_row_001 : MDEV-16653 - MTR's internal check fails
+rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start
+rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed
+rpl.rpl_row_big_table_id : Modified in 10.3.22
+rpl.rpl_row_corruption : MDEV-21569 - mutex: LOCK_global_system_variables unlocking
+rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result
+rpl.rpl_row_end_of_statement_loss : MDEV-21237 - Server crash
+rpl.rpl_row_find_row_debug : Modified in 10.3.22
+rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed
+rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed
+rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed
+rpl.rpl_row_index_choice : MDEV-15196 - Slave crash; modified in 10.3.22
+rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x
+rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum
+rpl.rpl_semi_sync : MDEV-11220 - Wrong result
+rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result
+rpl.rpl_semi_sync_after_sync_row : MDEV-21031 - Wrong result; MDEV-14366 - Wrong result
+rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings
+rpl.rpl_semi_sync_gtid_reconnect : Added in 10.3.21
+rpl.rpl_semi_sync_skip_repl : Modified in 10.3.22
+rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures
+rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition
+rpl.rpl_semisync_ali_issues : MDEV-16272 - Wrong result
+rpl.rpl_set_statement_default_master : MDEV-13258 - Extra warning
+rpl.rpl_show_slave_hosts : MDEV-10681 - Crash
+rpl.rpl_show_slave_running : Modified in 10.3.22
+rpl.rpl_skip_replication : MDEV-13258 - Extra warning
+rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock
+rpl.rpl_slave_load_remove_tmpfile : Modified in 10.3.22
+rpl.rpl_slave_load_tmpdir_not_exist : MDEV-14203 - Extra warning
+rpl.rpl_slow_query_log : MDEV-13250 - Test abort
+rpl.rpl_sp_effects : MDEV-13249 - Crash
+rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout
+rpl.rpl_stm_lcase_tblnames : Modified in 10.3.22
+rpl.rpl_stm_multi_query : MDEV-9501 - Failed registering on master
+rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion
+rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash; include file modified in 10.3.22
+rpl.rpl_stop_slave : Modified in 10.3.22
+rpl.rpl_sync : MDEV-13830 - Assertion failure
+rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master
+rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries
+rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output
+rpl.rpl_trigger : MDEV-18055 - Wrong result
+rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error
+rpl.rpl_user_variables : MDEV-20522 - Wrong result
+rpl.rpl_variables : MDEV-20150 - Server crash
+rpl.rpl_view_debug : Modified in 10.3.22
+rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result
+rpl.show_status_stop_slave_race-7126 : MDEV-17438 - Timeout
#-----------------------------------------------------------------------
@@ -936,18 +774,15 @@ rpl/extra/rpl_tests.* : MDEV-10994 - Not maintained
#-----------------------------------------------------------------------
-sequence.group_by : Modified in 10.3.19
-
-#-----------------------------------------------------------------------
-
-sphinx.* : MDEV-10986 - Tests have not been maintained; suite.pm modified in 10.3.19
-sphinx.sphinx : MDEV-10986 - Sporadic failures; modified in 10.3.19
+sphinx.* : MDEV-10986 - Tests have not been maintained
+sphinx.sphinx : MDEV-10986 - Sporadic failures
sphinx.union-5539 : MDEV-10986 - Sporadic failures
#-----------------------------------------------------------------------
-spider.* : MDEV-9329, MDEV-18737 - tests are too memory-consuming
-spider.basic_sql : MDEV-11186 - Internal check fails
+spider.* : MDEV-9329, MDEV-18737 - tests are too memory-consuming
+spider.basic_sql : MDEV-11186 - Internal check fails
+spider.pushdown_not_like : Added in 10.3.21
#-----------------------------------------------------------------------
@@ -963,16 +798,13 @@ spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x
#-----------------------------------------------------------------------
-spider/bugfix.select_by_null : Added in 10.3.19
-
-#-----------------------------------------------------------------------
-
spider/handler.* : MDEV-10987, MDEV-10990 - Tests have not been maintained
#-----------------------------------------------------------------------
sql_sequence.concurrent_create : MDEV-16635 - Server crash
-sql_sequence.other : Modified in 10.3.19
+sql_sequence.rebuild : Added in 10.3.21
+sql_sequence.view : Modified in 10.3.21
#-----------------------------------------------------------------------
@@ -984,51 +816,17 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout
#-----------------------------------------------------------------------
-sys_vars.aria_recover_options_basic : Modified in 10.3.18
sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x
-sys_vars.binlog_cache_size_basic : Modified in 10.3.18
-sys_vars.binlog_stmt_cache_size_basic : Modified in 10.3.18
-sys_vars.character_set_client_basic : Modified in 10.3.18
-sys_vars.character_set_connection_basic : Modified in 10.3.18
-sys_vars.character_set_database_basic : Modified in 10.3.18
-sys_vars.character_set_results_basic : Modified in 10.3.18
-sys_vars.character_set_server_basic : Modified in 10.3.18
-sys_vars.character_set_server_func : Modified in 10.3.18
-sys_vars.collation_connection_basic : Modified in 10.3.18
-sys_vars.collation_database_basic : Modified in 10.3.18
-sys_vars.collation_server_basic : Modified in 10.3.18
-sys_vars.delayed_insert_limit_func : Modified in 10.3.19
-sys_vars.expire_logs_days_basic : Modified in 10.2.27
-sys_vars.histogram_size_basic : Modified in 10.2.27
+sys_vars.debug_dbug_func : Modified in 10.3.22
sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error
-sys_vars.innodb_change_buffering_debug_basic : Modified in 10.3.19
-sys_vars.innodb_max_dirty_pages_pct_basic : Modified in 10.3.18
-sys_vars.innodb_max_dirty_pages_pct_lwm_basic : Modified in 10.3.18
-sys_vars.innodb_read_io_threads_basic : Configuration added in 10.3.18
-sys_vars.innodb_write_io_threads_basic : Configuration added in 10.3.18
+sys_vars.innodb_buffer_pool_size_basic : Modified in 10.3.22
+sys_vars.innodb_checksum_algorithm_basic : MDEV-21568 - Errno: 2000
sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout
sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash
-sys_vars.log_slow_verbosity_basic : Modified in 10.3.18
-sys_vars.max_connect_errors_basic : Modified in 10.2.27
-sys_vars.max_connections_basic : Modified in 10.3.18
-sys_vars.max_heap_table_size_basic : Modified in 10.2.27
-sys_vars.max_seeks_for_key_func : Modified in 10.3.18
-sys_vars.myisam_recover_options_basic : Configuration added in 10.3.18
-sys_vars.myisam_sort_buffer_size_basic : Modified in 10.3.18
-sys_vars.optimizer_switch_basic : Modified in 10.3.18
-sys_vars.optimizer_use_condition_selectivity_basic : Modified in 10.3.18
-sys_vars.replicate_ignore_table_basic : Modified in 10.3.18
sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion
sys_vars.slow_query_log_func : MDEV-14273 - Wrong result
-sys_vars.sync_binlog_basic : Modified in 10.3.18
-sys_vars.sysvars_debug : Modified in 10.3.18
-sys_vars.sysvars_innodb : Modified in 10.3.18
-sys_vars.sysvars_server_embedded : Include file modified in 10.3.18
-sys_vars.sysvars_server_notembedded : Include file modified in 10.3.18
sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result
-sys_vars.userstat_basic : Modified in 10.3.18
sys_vars.wait_timeout_func : MDEV-12896 - Wrong result
-sys_vars.wsrep_provider_basic : MDEV-19457 - Assertion failure
#-----------------------------------------------------------------------
@@ -1036,10 +834,6 @@ tokudb.change_column_all_1000_10 : MDEV-12640 - Lost connection
tokudb.change_column_bin : MDEV-12640 - Lost connection
tokudb.change_column_char : MDEV-12822 - Lost connection
tokudb.change_column_varbin : MDEV-17682 - Timeout
-tokudb.cluster_2968-0 : Modified in 10.3.18
-tokudb.cluster_2968-1 : Modified in 10.3.18
-tokudb.cluster_2968-2 : Modified in 10.3.18
-tokudb.cluster_2968-3 : Modified in 10.3.18
tokudb.cluster_filter : MDEV-10678 - Wrong execution plan
tokudb.cluster_filter_hidden : MDEV-10678 - Wrong execution plan
tokudb.cluster_filter_unpack_varchar : MDEV-10636 - Wrong execution plan
@@ -1057,7 +851,6 @@ tokudb.rows-32m-rand-insert : MDEV-12640 - Crash
tokudb.rows-32m-seq-insert : MDEV-12640 - Crash
tokudb.savepoint-5 : MDEV-15280 - Wrong result
tokudb.type_datetime : MDEV-15193 - Wrong result
-tokudb.type_varchar : Modified in 10.3.18
#-----------------------------------------------------------------------
@@ -1078,14 +871,7 @@ tokudb_bugs.xa : MDEV-11804 - Lock wait timeout
#-----------------------------------------------------------------------
-tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection
-tokudb_parts.partition_debug_tokudb : Include file modified in 10.3.19
-tokudb_parts.partition_exch_qa_4_tokudb : Include file modified in 10.3.18
-tokudb_parts.partition_exch_qa_8_tokudb : Include file modified in 10.3.18
-tokudb_parts.partition_mgm_lc0_tokudb : Include file modified in 10.3.18
-tokudb_parts.partition_mgm_lc10_tokudb : Include file modified in 10.3.18
-tokudb_parts.partition_mgm_lc1_tokudb : Include file modified in 10.3.18
-tokudb_parts.partition_mgm_lc2_tokudb : Include file modified in 10.3.18
+tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection
#-----------------------------------------------------------------------
@@ -1109,50 +895,32 @@ unit.mf_iocache : MDEV-20952 - ASAN stack-buffer-overflow
#-----------------------------------------------------------------------
-vcol.cross_db : Modified in 10.3.18
-vcol.not_supported : MDEV-10639 - Testcase timeout
-vcol.update : Modified in 10.3.18
-vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout; modified in 10.3.19
-vcol.vcol_misc : MDEV-16651 - Wrong error message
-vcol.vcol_select_innodb : Modified in 10.3.18
-vcol.vcol_select_myisam : Modified in 10.3.18
-vcol.vcol_sql_mode : Added in 10.3.18
-vcol.vcol_sql_mode_upgrade : Added in 10.3.18
-vcol.vcol_trigger_sp_innodb : Include file modified in 10.3.18
-vcol.vcol_trigger_sp_myisam : Include file modified in 10.3.18
+vcol.not_supported : MDEV-10639 - Testcase timeout
+vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout
+vcol.vcol_misc : MDEV-16651 - Wrong error message
#-----------------------------------------------------------------------
-versioning.alter : Modified in 10.3.19
-versioning.auto_increment : Include file modified in 10.3.19
-versioning.commit_id : Include file modified in 10.3.19
-versioning.create : Modified in 10.3.19
-versioning.cte : Modified in 10.3.18
-versioning.delete : Modified in 10.3.19
-versioning.derived : Modified in 10.3.18
-versioning.foreign : Modified in 10.3.19
-versioning.insert : Include file modified in 10.3.19
-versioning.key_type : Combinations added in 10.3.19
-versioning.online : Modified in 10.3.19
-versioning.partition : Modified in 10.3.19
-versioning.partition_innodb : Modified in 10.3.19
-versioning.replace : Modified in 10.3.19
-versioning.select : Include file modified in 10.3.19
-versioning.select2 : Include file modified in 10.3.19
-versioning.truncate : Include file modified in 10.3.19
-versioning.trx_id : Modified in 10.3.19
-versioning.update : MDEV-20955 - Wrong result code; modified in 10.3.19
-versioning.update-big : Modified in 10.3.19
-versioning.view : Modified in 10.3.19
+versioning.delete : Modified in 10.3.21
+versioning.partition : Modified in 10.3.21
+versioning.select : Modified in 10.3.21
+versioning.trx_id : Modified in 10.3.22
+versioning.update : MDEV-20955 - Wrong result code; modified in 10.3.21
+versioning.view : Modified in 10.3.21
#-----------------------------------------------------------------------
-wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node
+wsrep.* : Config file changed in 10.2.31; Config file changed in 10.3.22
+wsrep.alter_table_innodb : Configuration deleted in 10.3.22
+wsrep.binlog_format : Configuration modified in 10.3.22
+wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node; re-enabled in 10.3.22
+wsrep.mdev_10186 : Configuration changed in 10.2.31; configuration added in 10.3.22
wsrep.mdev_6832 : MDEV-14195 - Check testcase failed
-wsrep.mysql_tzinfo_to_sql_symlink_skip : Added in 10.3.18
-wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use
-wsrep.variables : MDEV-14311 - Wrong result; MDEV-17585 - Deadlock; modified in 10.3.19
+wsrep.mysql_tzinfo_to_sql_symlink : Modified in 10.3.22
+wsrep.mysql_tzinfo_to_sql_symlink_skip : Modified in 10.3.22
+wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use; re-enabled in 10.3.22; configuration modified in 10.3.22
+wsrep.variables : MDEV-17585 - Deadlock; modified in 10.3.22
#-----------------------------------------------------------------------
-wsrep_info.plugin : MDEV-13569 - No nodes coming from prim view
+wsrep_info.* : Config file changed in 10.2.31; Config file changed in 10.3.22
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 438d6b428e0..0a61c856506 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -102,7 +102,3 @@ SET_TARGET_PROPERTIES(thr_timer PROPERTIES COMPILE_FLAGS "-DMAIN")
ADD_EXECUTABLE(test_hash hash.c)
TARGET_LINK_LIBRARIES(test_hash mysys)
SET_TARGET_PROPERTIES(test_hash PROPERTIES COMPILE_FLAGS "-DMAIN")
-
-IF(MSVC)
- INSTALL_DEBUG_TARGET(mysys DESTINATION ${INSTALL_LIBDIR}/debug)
-ENDIF()
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index 2a0ee7fddf9..b98684556c3 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -151,7 +151,6 @@ void lf_pinbox_destroy(LF_PINBOX *pinbox)
*/
LF_PINS *lf_pinbox_get_pins(LF_PINBOX *pinbox)
{
- struct st_my_thread_var *var;
uint32 pins, next, top_ver;
LF_PINS *el;
/*
@@ -194,12 +193,7 @@ LF_PINS *lf_pinbox_get_pins(LF_PINBOX *pinbox)
el->link= pins;
el->purgatory_count= 0;
el->pinbox= pinbox;
- var= my_thread_var;
- /*
- Threads that do not call my_thread_init() should still be
- able to use the LF_HASH.
- */
- el->stack_ends_here= (var ? & var->stack_ends_here : NULL);
+
return el;
}
@@ -335,16 +329,18 @@ static void lf_pinbox_real_free(LF_PINS *pins)
void *list;
void **addr= NULL;
void *first= NULL, *last= NULL;
+ struct st_my_thread_var *var= my_thread_var;
+ void *stack_ends_here= var ? var->stack_ends_here : NULL;
LF_PINBOX *pinbox= pins->pinbox;
npins= pinbox->pins_in_array+1;
#ifdef HAVE_ALLOCA
- if (pins->stack_ends_here != NULL)
+ if (stack_ends_here != NULL)
{
int alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins;
/* create a sorted list of pinned addresses, to speed up searches */
- if (available_stack_size(&pinbox, *pins->stack_ends_here) >
+ if (available_stack_size(&pinbox, stack_ends_here) >
alloca_size + ALLOCA_SAFETY_MARGIN)
{
struct st_harvester hv;
diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c
index 7590d576a7c..3f20f535d37 100644
--- a/mysys/my_addr_resolve.c
+++ b/mysys/my_addr_resolve.c
@@ -56,6 +56,18 @@ static ElfW(Addr) offset= 0;
#define offset 0
#endif
+#ifndef bfd_get_section_flags
+#define bfd_get_section_flags(H, S) bfd_section_flags(S)
+#endif /* bfd_get_section_flags */
+
+#ifndef bfd_get_section_size
+#define bfd_get_section_size(S) bfd_section_size(S)
+#endif /* bfd_get_section_size */
+
+#ifndef bfd_get_section_vma
+#define bfd_get_section_vma(H, S) bfd_section_vma(S)
+#endif /* bfd_get_section_vma */
+
/**
finds a file name, a line number, and a function name corresponding to addr.
diff --git a/mysys/my_default.c b/mysys/my_default.c
index deeb9b4a5b8..7c6ef8fffa0 100644
--- a/mysys/my_default.c
+++ b/mysys/my_default.c
@@ -1035,6 +1035,11 @@ void my_print_default_files(const char *conf_file)
char name[FN_REFLEN], **ext;
puts("\nDefault options are read from the following files in the given order:");
+ if (my_defaults_file)
+ {
+ puts(my_defaults_file);
+ return;
+ }
if (dirname_length(conf_file))
fputs(conf_file,stdout);
@@ -1059,7 +1064,12 @@ void my_print_default_files(const char *conf_file)
if (**dirs)
pos= *dirs;
else if (my_defaults_extra_file)
+ {
pos= my_defaults_extra_file;
+ fputs(pos, stdout);
+ fputs(" ", stdout);
+ continue;
+ }
else
continue;
end= convert_dirname(name, pos, NullS);
diff --git a/mysys/my_getncpus.c b/mysys/my_getncpus.c
index 38585161c22..6890de4f827 100644
--- a/mysys/my_getncpus.c
+++ b/mysys/my_getncpus.c
@@ -21,30 +21,61 @@
#include <unistd.h>
#endif
+#if defined(__FreeBSD__) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+#include <pthread_np.h>
+#include <sys/cpuset.h>
+#endif
+
static int ncpus=0;
-int my_getncpus()
+int my_getncpus(void)
{
if (!ncpus)
{
+ /*
+ First attempt to get the total number of available cores. sysconf is
+ the fallback, but it can return a larger number. It will return the
+ total number of cores, not the ones available to the process - as
+ configured via core affinity.
+ */
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
+ cpu_set_t set;
+ if (pthread_getaffinity_np(pthread_self(), sizeof(set), &set) == 0)
+ {
+#ifdef CPU_COUNT
+ /* CPU_COUNT was introduced with glibc 2.6. */
+ ncpus= CPU_COUNT(&set);
+#else
+ /* Implementation for platforms with glibc < 2.6 */
+ size_t i;
+
+ for (i= 0; i < CPU_SETSIZE; i++)
+ if (CPU_ISSET(i, &set))
+ ncpus++;
+#endif
+ return ncpus;
+ }
+#endif /* (__linux__ || __FreeBSD__) && HAVE_PTHREAD_GETAFFINITY_NP */
+
#ifdef _SC_NPROCESSORS_ONLN
ncpus= sysconf(_SC_NPROCESSORS_ONLN);
#elif defined(__WIN__)
SYSTEM_INFO sysinfo;
/*
- * We are not calling GetNativeSystemInfo here because (1) we
- * don't believe that they return different values for number
- * of processors and (2) if WOW64 limits processors for Win32
- * then we don't want to try to override that.
+ We are not calling GetNativeSystemInfo here because (1) we
+ don't believe that they return different values for number
+ of processors and (2) if WOW64 limits processors for Win32
+ then we don't want to try to override that.
*/
GetSystemInfo(&sysinfo);
ncpus= sysinfo.dwNumberOfProcessors;
#else
- /* unknown so play safe: assume SMP and forbid uniprocessor build */
+ /* Unknown so play safe: assume SMP and forbid uniprocessor build */
ncpus= 2;
#endif
}
+
return ncpus;
}
diff --git a/pcre/ChangeLog b/pcre/ChangeLog
index e4d2d9fa24c..3973337fe35 100644
--- a/pcre/ChangeLog
+++ b/pcre/ChangeLog
@@ -1605,7 +1605,7 @@ Version 8.21 12-Dec-2011
are added as well.
3. Fix cache-flush issue on PowerPC (It is still an experimental JIT port).
- PCRE_EXTRA_TABLES is not suported by JIT, and should be checked before
+ PCRE_EXTRA_TABLES is not supported by JIT, and should be checked before
calling _pcre_jit_exec. Some extra comments are added.
4. (*MARK) settings inside atomic groups that do not contain any capturing
diff --git a/pcre/doc/html/pcredemo.html b/pcre/doc/html/pcredemo.html
index 894a9308261..d84c5c8c99c 100644
--- a/pcre/doc/html/pcredemo.html
+++ b/pcre/doc/html/pcredemo.html
@@ -161,7 +161,7 @@ if (rc &lt; 0)
return 1;
}
-/* Match succeded */
+/* Match succeeded */
printf("\nMatch succeeded at offset %d\n", ovector[0]);
@@ -379,7 +379,7 @@ for (;;)
return 1;
}
- /* Match succeded */
+ /* Match succeeded */
printf("\nMatch succeeded again at offset %d\n", ovector[0]);
diff --git a/pcre/doc/html/pcrejit.html b/pcre/doc/html/pcrejit.html
index abb342522f9..c1e0310defc 100644
--- a/pcre/doc/html/pcrejit.html
+++ b/pcre/doc/html/pcrejit.html
@@ -299,7 +299,7 @@ recommended.
This is a suggestion for how a multithreaded program that needs to set up
non-default JIT stacks might operate:
<pre>
- During thread initalization
+ During thread initialization
thread_local_var = pcre_jit_stack_alloc(...)
During thread exit
diff --git a/pcre/doc/pcre.txt b/pcre/doc/pcre.txt
index c027538f500..f4302bd7ee8 100644
--- a/pcre/doc/pcre.txt
+++ b/pcre/doc/pcre.txt
@@ -8578,7 +8578,7 @@ CONTROLLING THE JIT STACK
This is a suggestion for how a multithreaded program that needs to set
up non-default JIT stacks might operate:
- During thread initalization
+ During thread initialization
thread_local_var = pcre_jit_stack_alloc(...)
During thread exit
diff --git a/pcre/doc/pcredemo.3 b/pcre/doc/pcredemo.3
index 194629b1fac..4115ef1e36e 100644
--- a/pcre/doc/pcredemo.3
+++ b/pcre/doc/pcredemo.3
@@ -161,7 +161,7 @@ if (rc < 0)
return 1;
}
-/* Match succeded */
+/* Match succeeded */
printf("\enMatch succeeded at offset %d\en", ovector[0]);
@@ -379,7 +379,7 @@ for (;;)
return 1;
}
- /* Match succeded */
+ /* Match succeeded */
printf("\enMatch succeeded again at offset %d\en", ovector[0]);
diff --git a/pcre/doc/pcrejit.3 b/pcre/doc/pcrejit.3
index 3b785f0f631..fe42db56170 100644
--- a/pcre/doc/pcrejit.3
+++ b/pcre/doc/pcrejit.3
@@ -285,7 +285,7 @@ recommended.
This is a suggestion for how a multithreaded program that needs to set up
non-default JIT stacks might operate:
.sp
- During thread initalization
+ During thread initialization
thread_local_var = pcre_jit_stack_alloc(...)
.sp
During thread exit
diff --git a/pcre/pcre_compile.c b/pcre/pcre_compile.c
index 734875de2fb..c32b0226162 100644
--- a/pcre/pcre_compile.c
+++ b/pcre/pcre_compile.c
@@ -8352,7 +8352,7 @@ save_hwm_offset = cd->hwm - cd->start_workspace;
/* Accumulate the length for use in the pre-compile phase. Start with the
length of the BRA and KET and any extra bytes that are required at the
beginning. We accumulate in a local variable to save frequent testing of
-lenthptr for NULL. We cannot do this by looking at the value of code at the
+lengthptr for NULL. We cannot do this by looking at the value of code at the
start and end of each alternative, because compiled items are discarded during
the pre-compile phase so that the work space is not exceeded. */
diff --git a/pcre/pcre_internal.h b/pcre/pcre_internal.h
index 97ff55d03b3..b1e096ceb3d 100644
--- a/pcre/pcre_internal.h
+++ b/pcre/pcre_internal.h
@@ -2188,7 +2188,7 @@ regex. The lengths are used when searching for specific things, and also in the
debugging printing of a compiled regex. We use a macro so that it can be
defined close to the definitions of the opcodes themselves.
-As things have been extended, some of these are no longer fixed lenths, but are
+As things have been extended, some of these are no longer fixed lengths, but are
minima instead. For example, the length of a single-character repeat may vary
in UTF-8 mode. The code that uses this table must know about such things. */
diff --git a/pcre/pcredemo.c b/pcre/pcredemo.c
index 946aba45cdc..1ca77f1537a 100644
--- a/pcre/pcredemo.c
+++ b/pcre/pcredemo.c
@@ -144,7 +144,7 @@ if (rc < 0)
return 1;
}
-/* Match succeded */
+/* Match succeeded */
printf("\nMatch succeeded at offset %d\n", ovector[0]);
@@ -362,7 +362,7 @@ for (;;)
return 1;
}
- /* Match succeded */
+ /* Match succeeded */
printf("\nMatch succeeded again at offset %d\n", ovector[0]);
diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt
index 606fef002e7..c826b422240 100644
--- a/plugin/auth_pam/CMakeLists.txt
+++ b/plugin/auth_pam/CMakeLists.txt
@@ -1,14 +1,38 @@
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckFunctionExists)
+CHECK_INCLUDE_FILES (security/pam_ext.h HAVE_PAM_EXT_H)
CHECK_INCLUDE_FILES (security/pam_appl.h HAVE_PAM_APPL_H)
CHECK_FUNCTION_EXISTS (strndup HAVE_STRNDUP)
+SET(CMAKE_REQUIRED_LIBRARIES pam)
+CHECK_FUNCTION_EXISTS(pam_syslog HAVE_PAM_SYSLOG)
+SET(CMAKE_REQUIRED_LIBRARIES)
+
+IF(HAVE_PAM_SYSLOG)
+ ADD_DEFINITIONS(-DHAVE_PAM_SYSLOG)
+ENDIF()
+
+IF(HAVE_PAM_EXT_H)
+ ADD_DEFINITIONS(-DHAVE_PAM_EXT_H)
+ENDIF()
+
IF(HAVE_PAM_APPL_H)
+ ADD_DEFINITIONS(-DHAVE_PAM_APPL_H)
IF(HAVE_STRNDUP)
ADD_DEFINITIONS(-DHAVE_STRNDUP)
ENDIF(HAVE_STRNDUP)
FIND_LIBRARY(PAM_LIBRARY pam)
MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY)
+
+ IF(TARGET auth_pam)
+ ADD_LIBRARY(pam_user_map MODULE mapper/pam_user_map.c)
+ TARGET_LINK_LIBRARIES(pam_user_map pam)
+ SET_TARGET_PROPERTIES (pam_user_map PROPERTIES PREFIX "")
+ IF(INSTALL_PAMDIR)
+ INSTALL(TARGETS pam_user_map DESTINATION ${INSTALL_PAMDIR} COMPONENT Server)
+ INSTALL(FILES mapper/user_map.conf DESTINATION /etc/security COMPONENT Server)
+ ENDIF()
+ ENDIF()
ENDIF(HAVE_PAM_APPL_H)
diff --git a/plugin/auth_pam/mapper/pam_user_map.c b/plugin/auth_pam/mapper/pam_user_map.c
index e1d11acabb9..9d7ed53f8b1 100644
--- a/plugin/auth_pam/mapper/pam_user_map.c
+++ b/plugin/auth_pam/mapper/pam_user_map.c
@@ -2,7 +2,7 @@
Pam module to change user names arbitrarily in the pam stack.
Compile as
-
+
gcc pam_user_map.c -shared -lpam -fPIC -o pam_user_map.so
Install as appropriate (for example, in /lib/security/).
@@ -39,14 +39,36 @@ and usually end up in /var/log/secure file.
#include <grp.h>
#include <pwd.h>
+#ifdef HAVE_PAM_EXT_H
#include <security/pam_ext.h>
+#endif
+
+#ifdef HAVE_PAM_APPL_H
+#include <unistd.h>
+#include <security/pam_appl.h>
+#endif
+
#include <security/pam_modules.h>
+#ifndef HAVE_PAM_SYSLOG
+#include <stdarg.h>
+static void
+pam_syslog (const pam_handle_t *pamh, int priority,
+ const char *fmt, ...)
+{
+ va_list args;
+ va_start (args, fmt);
+ vsyslog (priority, fmt, args);
+ va_end (args);
+}
+#endif
+
#define FILENAME "/etc/security/user_map.conf"
#define skip(what) while (*s && (what)) s++
+#define SYSLOG_DEBUG if (mode_debug) pam_syslog
#define GROUP_BUFFER_SIZE 100
-
+static const char debug_keyword[]= "debug";
static int populate_user_groups(const char *user, gid_t **groups)
{
@@ -128,10 +150,6 @@ static void print_groups(pam_handle_t *pamh, const gid_t *user_groups, int ng)
ng, (ng == 1) ? "group" : "groups", buf+1);
}
-
-static const char debug_keyword[]= "debug";
-#define SYSLOG_DEBUG if (mode_debug) pam_syslog
-
int pam_sm_authenticate(pam_handle_t *pamh, int flags,
int argc, const char *argv[])
{
diff --git a/plugin/auth_pam/mapper/user_map.conf b/plugin/auth_pam/mapper/user_map.conf
new file mode 100644
index 00000000000..4af8fb0fe10
--- /dev/null
+++ b/plugin/auth_pam/mapper/user_map.conf
@@ -0,0 +1,13 @@
+#
+# Configuration file for pam_user_map.so
+#
+# defines mapping in the form
+#
+# orig_user_name: mapped_user_name
+#
+# or (to map all users in a specific group)
+#
+# @group_name: mapped_user_name
+#
+# comments and empty lines are ignored
+#
diff --git a/plugin/win_auth_client/CMakeLists.txt b/plugin/win_auth_client/CMakeLists.txt
index 435c5b8966a..8c7696347aa 100644
--- a/plugin/win_auth_client/CMakeLists.txt
+++ b/plugin/win_auth_client/CMakeLists.txt
@@ -31,7 +31,4 @@ IF(WIN32)
LINK_LIBRARIES Secur32
MODULE_ONLY COMPONENT ClientPlugins)
- #IF(MSVC)
- # INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug)
- #ENDIF()
ENDIF(WIN32)
diff --git a/plugin/wsrep_info/mysql-test/wsrep_info/my.cnf b/plugin/wsrep_info/mysql-test/wsrep_info/my.cnf
index 52c7789e9f7..c9d47e40d4b 100644
--- a/plugin/wsrep_info/mysql-test/wsrep_info/my.cnf
+++ b/plugin/wsrep_info/mysql-test/wsrep_info/my.cnf
@@ -11,6 +11,7 @@ wsrep_provider=@ENV.WSREP_PROVIDER
[mysqld.1]
#galera_port=@OPT.port
#sst_port=@OPT.port
+wsrep-on=1
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
wsrep_node_name=test-node-1
@@ -18,6 +19,7 @@ wsrep_node_name=test-node-1
[mysqld.2]
#galera_port=@OPT.port
#sst_port=@OPT.port
+wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 025e4439940..3b4ed381e47 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -243,7 +243,7 @@ cannot_find_file()
echo "If you compiled from source, you need to either run 'make install' to"
echo "copy the software into the correct location ready for operation."
echo "If you don't want to do a full install, you can use the --srcdir"
- echo "option to only install the mysql database and privilege tables"
+ echo "option to only install the mysql database and privilege tables."
echo
echo "If you are using a binary release, you must either be at the top"
echo "level of the extracted archive, or pass the --basedir option"
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index e708704a1fe..3a6c29b7674 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -14,7 +14,7 @@
-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
--
--- The inital data for system tables of MySQL Server
+-- The initial data for system tables of MySQL Server
--
-- When setting up a "cross bootstrap" database (e.g., creating data on a Unix
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index c56cdea470c..2a601559e9c 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -296,7 +296,7 @@ foreach my $rdb ( @db_desc ) {
if ($db =~ m/^mysql$/i)
{
@dbh_base_tables = grep
- { !/^(apply_status|schema|general_log|slow_log)$/ } @dbh_base_tables
+ { !/^(apply_status|schema|general_log|slow_log|transaction_registry)$/ } @dbh_base_tables
}
## generate regex for tables/files
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index 16607470f2c..16607470f2c 100755..100644
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 8d1a36561d3..799276258f2 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -385,8 +385,8 @@ read_cnf()
get_stream()
{
- if [[ $sfmt == 'xbstream' ]];then
- wsrep_log_info "Streaming with xbstream"
+ if [[ $sfmt == 'mbstream' || $sfmt == 'xbstream' ]];then
+ wsrep_log_info "Streaming with ${sfmt}"
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
strmcmd="${XBSTREAM_BIN} -x"
else
diff --git a/sql-bench/bench-init.pl.sh b/sql-bench/bench-init.pl.sh
index 1b6509cebcc..a6a12603e6d 100644
--- a/sql-bench/bench-init.pl.sh
+++ b/sql-bench/bench-init.pl.sh
@@ -566,7 +566,7 @@ All benchmarks takes the following options:
When using --fast the suffix is automaticly set to '_fast'.
--random
- Inform test suite that we are generate random inital values for sequence of
+ Inform test suite that we are generate random initial values for sequence of
test executions. It should be used for imitation of real conditions.
--threads=# **DEPRECATED**
diff --git a/sql-common/client.c b/sql-common/client.c
index eea6122535a..158b817ae59 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -3341,7 +3341,10 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
scramble_data_len= pkt_scramble_len;
scramble_plugin= scramble_data + scramble_data_len;
if (scramble_data + scramble_data_len > pkt_end)
- scramble_data_len= (int)(pkt_end - scramble_data);
+ {
+ set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate);
+ goto error;
+ }
}
else
{
@@ -3527,7 +3530,7 @@ my_bool mysql_reconnect(MYSQL *mysql)
if (ctxt)
my_context_install_suspend_resume_hook(ctxt, NULL, NULL);
- DBUG_PRINT("info", ("reconnect succeded"));
+ DBUG_PRINT("info", ("reconnect succeeded"));
tmp_mysql.reconnect= 1;
tmp_mysql.free_me= mysql->free_me;
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 06d9f7187f3..e7e0c055f8e 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -406,15 +406,18 @@ IF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
ENDIF()
MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/data)
ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
- COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM}
- -DTOP_SRCDIR="${CMAKE_SOURCE_DIR}"
- -DBINDIR="${CMAKE_CURRENT_BINARY_DIR}"
- -DMYSQLD_EXECUTABLE="$<TARGET_FILE:mysqld>"
- -DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}"
- -P ${CMAKE_SOURCE_DIR}/cmake/create_initial_db.cmake
+ OUTPUT initdb.dep
+ COMMAND ${CMAKE_COMMAND} -E remove_directory data
+ COMMAND ${CMAKE_COMMAND} -E make_directory data
+ COMMAND ${CMAKE_COMMAND} -E chdir data ${CMAKE_COMMAND}
+ ${CONFIG_PARAM}
+ -DTOP_SRCDIR="${CMAKE_SOURCE_DIR}"
+ -DBINDIR="${CMAKE_CURRENT_BINARY_DIR}"
+ -DMYSQLD_EXECUTABLE="$<TARGET_FILE:mysqld>"
+ -DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}"
+ -P ${CMAKE_SOURCE_DIR}/cmake/create_initial_db.cmake
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
DEPENDS mysqld
)
ADD_CUSTOM_TARGET(initial_database
diff --git a/sql/derror.cc b/sql/derror.cc
index a1150596ee3..7a79833c26c 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (C) 2011 Monty Program Ab
+ 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
@@ -69,6 +69,9 @@ bool init_errmessage(void)
{
const char **errmsgs;
bool error= FALSE;
+ const char *lang= my_default_lc_messages->errmsgs->language;
+ my_bool use_english;
+
DBUG_ENTER("init_errmessage");
free_error_messages();
@@ -77,35 +80,65 @@ bool init_errmessage(void)
error_message_charset_info= system_charset_info;
- /* Read messages from file. */
- if (read_texts(ERRMSG_FILE, my_default_lc_messages->errmsgs->language,
- &original_error_messages))
+ use_english= !strcmp(lang, "english");
+ if (!use_english)
{
- /*
- No error messages. Create a temporary empty error message so
- that we don't get a crash if some code wrongly tries to access
- a non existing error message.
- */
+ /* Read messages from file. */
+ use_english= read_texts(ERRMSG_FILE,lang, &original_error_messages);
+ error= use_english != FALSE;
+ if (error)
+ sql_print_error("Could not load error messages for %s",lang);
+ }
+
+ if (use_english)
+ {
+ static const struct
+ {
+ const char* name;
+ uint id;
+ const char* fmt;
+ }
+ english_msgs[]=
+ {
+ #include <mysqld_ername.h>
+ };
+
+ memset(errors_per_range, 0, sizeof(errors_per_range));
+ /* Calculate nr of messages per range. */
+ for (size_t i= 0; i < array_elements(english_msgs); i++)
+ {
+ uint id= english_msgs[i].id;
+
+ // We rely on the fact the array is sorted by id.
+ DBUG_ASSERT(i == 0 || english_msgs[i-1].id < id);
+
+ errors_per_range[id/ERRORS_PER_RANGE-1]= id%ERRORS_PER_RANGE + 1;
+ }
+
+ size_t all_errors= 0;
+ for (size_t i= 0; i < MAX_ERROR_RANGES; i++)
+ all_errors+= errors_per_range[i];
+
if (!(original_error_messages= (const char***)
- my_malloc(MAX_ERROR_RANGES * sizeof(char**) +
- (ERRORS_PER_RANGE * sizeof(char*)),
- MYF(0))))
+ my_malloc((all_errors + MAX_ERROR_RANGES)* sizeof(void*),
+ MYF(MY_ZEROFILL))))
DBUG_RETURN(TRUE);
- errmsgs= (const char**) (original_error_messages + MAX_ERROR_RANGES);
- for (uint i=0 ; i < MAX_ERROR_RANGES ; i++)
+ errmsgs= (const char**)(original_error_messages + MAX_ERROR_RANGES);
+
+ original_error_messages[0]= errmsgs;
+ for (uint i= 1; i < MAX_ERROR_RANGES; i++)
{
- original_error_messages[i]= errmsgs;
- errors_per_range[i]= ERRORS_PER_RANGE;
+ original_error_messages[i]=
+ original_error_messages[i-1] + errors_per_range[i-1];
}
- errors_per_range[2]= 0; // MYSYS error messages
-
- for (const char **ptr= errmsgs;
- ptr < errmsgs + ERRORS_PER_RANGE ;
- ptr++)
- *ptr= "";
- error= TRUE;
+ for (uint i= 0; i < array_elements(english_msgs); i++)
+ {
+ uint id= english_msgs[i].id;
+ original_error_messages[id/ERRORS_PER_RANGE-1][id%ERRORS_PER_RANGE]=
+ english_msgs[i].fmt;
+ }
}
/* Register messages for use with my_error(). */
diff --git a/sql/events.cc b/sql/events.cc
index 46393e385ee..0de8f2aefb2 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -1202,9 +1202,9 @@ Events::load_events_from_db(THD *thd)
#ifdef WITH_WSREP
/**
- IF SST is done from a galera node that is also acting as MASTER
- newly synced node in galera eco-system will also copy-over the event state
- enabling duplicate event in galera eco-system.
+ If SST is done from a galera node that is also acting as MASTER
+ newly synced node in galera eco-system will also copy-over the
+ event state enabling duplicate event in galera eco-system.
DISABLE such events if the current node is not event orginator.
(Also, make sure you skip disabling it if is already disabled to avoid
creation of redundant action)
@@ -1214,7 +1214,7 @@ Events::load_events_from_db(THD *thd)
Infact, based on galera use-case it seems like it recommends to have each
node with different server-id.
*/
- if (et->originator != thd->variables.server_id)
+ if (WSREP(thd) && et->originator != thd->variables.server_id)
{
if (et->status == Event_parse_data::SLAVESIDE_DISABLED)
continue;
diff --git a/sql/filesort.cc b/sql/filesort.cc
index b847a5f61ec..c94bbd1e55d 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -315,6 +315,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
param.max_keys_per_buffer=((param.max_keys_per_buffer *
(param.rec_length + sizeof(char*))) /
param.rec_length - 1);
+ set_if_bigger(param.max_keys_per_buffer, 1);
maxbuffer--; // Offset from 0
if (merge_many_buff(&param,
(uchar*) sort->get_sort_keys(),
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 232111d5a98..48610cabd4f 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -564,7 +564,7 @@ bool ha_partition::initialize_partition(MEM_ROOT *mem_root)
point.
If you do not implement this, the default delete_table() is called from
- handler.cc and it will delete all files with the file extentions returned
+ handler.cc and it will delete all files with the file extensions returned
by bas_ext().
Called from handler.cc by delete_table and ha_create_table(). Only used
@@ -596,7 +596,7 @@ int ha_partition::delete_table(const char *name)
Renames a table from one name to another from alter table call.
If you do not implement this, the default rename_table() is called from
- handler.cc and it will rename all files with the file extentions returned
+ handler.cc and it will rename all files with the file extensions returned
by bas_ext().
Called from sql_table.cc by mysql_rename_table().
@@ -4538,7 +4538,7 @@ int ha_partition::delete_row(const uchar *buf)
or last historical partition, but DELETE HISTORY can delete from any
historical partition. So, skip the check in this case.
*/
- if (!thd->lex->vers_conditions.is_set()) // if not DELETE HISTORY
+ if (!thd->lex->vers_conditions.delete_history)
{
uint32 part_id;
error= get_part_for_buf(buf, m_rec0, m_part_info, &part_id);
@@ -6235,7 +6235,7 @@ static range_seq_t partition_multi_range_key_init(void *init_params,
ha_partition *partition= hld->partition;
uint i= hld->part_id;
DBUG_ENTER("partition_multi_range_key_init");
- partition->m_mrr_range_init_flags= flags;
+ // not used: partition->m_mrr_range_init_flags= flags;
hld->partition_part_key_multi_range= partition->m_part_mrr_range_first[i];
DBUG_RETURN(init_params);
}
@@ -6264,9 +6264,10 @@ static bool partition_multi_range_key_skip_record(range_seq_t seq,
{
PARTITION_PART_KEY_MULTI_RANGE_HLD *hld=
(PARTITION_PART_KEY_MULTI_RANGE_HLD *)seq;
+ PARTITION_KEY_MULTI_RANGE *pkmr= (PARTITION_KEY_MULTI_RANGE *)range_info;
DBUG_ENTER("partition_multi_range_key_skip_record");
DBUG_RETURN(hld->partition->m_seq_if->skip_record(hld->partition->m_seq,
- range_info, rowid));
+ pkmr->ptr, rowid));
}
@@ -6275,9 +6276,10 @@ static bool partition_multi_range_key_skip_index_tuple(range_seq_t seq,
{
PARTITION_PART_KEY_MULTI_RANGE_HLD *hld=
(PARTITION_PART_KEY_MULTI_RANGE_HLD *)seq;
+ PARTITION_KEY_MULTI_RANGE *pkmr= (PARTITION_KEY_MULTI_RANGE *)range_info;
DBUG_ENTER("partition_multi_range_key_skip_index_tuple");
DBUG_RETURN(hld->partition->m_seq_if->skip_index_tuple(hld->partition->m_seq,
- range_info));
+ pkmr->ptr));
}
ha_rows ha_partition::multi_range_read_info_const(uint keyno,
@@ -9227,7 +9229,6 @@ void ha_partition::late_extra_cache(uint partition_id)
}
if (m_extra_prepare_for_update)
{
- DBUG_ASSERT(m_extra_cache);
(void) file->extra(HA_EXTRA_PREPARE_FOR_UPDATE);
}
m_extra_cache_part_id= partition_id;
@@ -10697,8 +10698,8 @@ int ha_partition::indexes_are_disabled(void)
@param repair If true, move misplaced rows to correct partition.
@return Operation status.
- @retval 0 Success
- @retval != 0 Error
+ @retval HA_ADMIN_OK Success
+ @retval != HA_ADMIN_OK Error
*/
int ha_partition::check_misplaced_rows(uint read_part_id, bool do_repair)
@@ -10712,6 +10713,17 @@ int ha_partition::check_misplaced_rows(uint read_part_id, bool do_repair)
DBUG_ASSERT(m_file);
+ if (m_part_info->vers_info &&
+ read_part_id != m_part_info->vers_info->now_part->id &&
+ !m_part_info->vers_info->interval.is_set())
+ {
+ print_admin_msg(ha_thd(), MYSQL_ERRMSG_SIZE, "note",
+ table_share->db.str, table->alias,
+ opt_op_name[CHECK_PARTS],
+ "Not supported for non-INTERVAL history partitions");
+ DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
+ }
+
if (do_repair)
{
/* We must read the full row, if we need to move it! */
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 1085eca72cc..6bc067af3e7 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -184,17 +184,61 @@ private:
bool is_subpart);
};
+
+/*
+ List of ranges to be scanned by ha_partition's MRR implementation
+
+ This object is
+ - A KEY_MULTI_RANGE structure (the MRR range)
+ - Storage for the range endpoints that the KEY_MULTI_RANGE has pointers to
+ - list of such ranges (connected through the "next" pointer).
+*/
+
typedef struct st_partition_key_multi_range
{
+ /*
+ Number of the range. The ranges are numbered in the order RANGE_SEQ_IF has
+ emitted them, starting from 1. The numbering in used by ordered MRR scans.
+ */
uint id;
uchar *key[2];
+ /*
+ Sizes of allocated memory in key[]. These may be larger then the actual
+ values as this structure is reused across MRR scans
+ */
uint length[2];
+
+ /*
+ The range.
+ key_multi_range.ptr is a pointer to the this PARTITION_KEY_MULTI_RANGE
+ object
+ */
KEY_MULTI_RANGE key_multi_range;
+
+ // Range id from the SQL layer
range_id_t ptr;
+
+ // The next element in the list of MRR ranges.
st_partition_key_multi_range *next;
} PARTITION_KEY_MULTI_RANGE;
+/*
+ List of ranges to be scanned in a certain [sub]partition
+
+ The idea is that there's a list of ranges to be scanned in the table
+ (formed by PARTITION_KEY_MULTI_RANGE structures),
+ and for each [sub]partition, we only need to scan a subset of that list.
+
+ PKMR1 --> PKMR2 --> PKMR3 -->... // list of PARTITION_KEY_MULTI_RANGE
+ ^ ^
+ | |
+ PPKMR1 ----------> PPKMR2 -->... // list of PARTITION_PART_KEY_MULTI_RANGE
+
+ This way, per-partition lists of PARTITION_PART_KEY_MULTI_RANGE have pointers
+ to the elements of the global list of PARTITION_KEY_MULTI_RANGE.
+*/
+
typedef struct st_partition_part_key_multi_range
{
PARTITION_KEY_MULTI_RANGE *partition_key_multi_range;
@@ -203,10 +247,23 @@ typedef struct st_partition_part_key_multi_range
class ha_partition;
+
+/*
+ The structure holding information about range sequence to be used with one
+ partition.
+ (pointer to this is used as seq_init_param for RANGE_SEQ_IF structure when
+ invoking MRR for an individual partition)
+*/
+
typedef struct st_partition_part_key_multi_range_hld
{
+ /* Owner object */
ha_partition *partition;
+
+ /* id of the the partition this structure is for */
uint32 part_id;
+
+ /* Current range we're iterating through */
PARTITION_PART_KEY_MULTI_RANGE *partition_part_key_multi_range;
} PARTITION_PART_KEY_MULTI_RANGE_HLD;
@@ -810,21 +867,52 @@ public:
uint m_mrr_new_full_buffer_size;
MY_BITMAP m_mrr_used_partitions;
uint *m_stock_range_seq;
- uint m_current_range_seq;
+ /* not used: uint m_current_range_seq; */
+
+ /* Value of mrr_mode passed to ha_partition::multi_range_read_init */
uint m_mrr_mode;
+
+ /* Value of n_ranges passed to ha_partition::multi_range_read_init */
uint m_mrr_n_ranges;
+
+ /*
+ Ordered MRR mode: m_range_info[N] has the range_id of the last record that
+ we've got from partition N
+ */
range_id_t *m_range_info;
+
+ /*
+ TRUE <=> This ha_partition::multi_range_read_next() call is the first one
+ */
bool m_multi_range_read_first;
- uint m_mrr_range_init_flags;
+
+ /* not used: uint m_mrr_range_init_flags; */
+
+ /* Number of elements in the list pointed by m_mrr_range_first. Not used */
uint m_mrr_range_length;
+
+ /* Linked list of ranges to scan */
PARTITION_KEY_MULTI_RANGE *m_mrr_range_first;
PARTITION_KEY_MULTI_RANGE *m_mrr_range_current;
+
+ /*
+ For each partition: number of ranges MRR scan will scan in the partition
+ */
uint *m_part_mrr_range_length;
+
+ /* For each partition: List of ranges to scan in this partition */
PARTITION_PART_KEY_MULTI_RANGE **m_part_mrr_range_first;
PARTITION_PART_KEY_MULTI_RANGE **m_part_mrr_range_current;
PARTITION_PART_KEY_MULTI_RANGE_HLD *m_partition_part_key_multi_range_hld;
+
+ /*
+ Sequence of ranges to be scanned (TODO: why not store this in
+ handler::mrr_{iter,funcs}?)
+ */
range_seq_t m_seq;
RANGE_SEQ_IF *m_seq_if;
+
+ /* Range iterator structure to be supplied to partitions */
RANGE_SEQ_IF m_part_seq_if;
virtual int multi_range_key_create_key(
diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc
index 65bb0daf8cf..4fa075444d8 100644
--- a/sql/ha_sequence.cc
+++ b/sql/ha_sequence.cc
@@ -108,7 +108,7 @@ int ha_sequence::open(const char *name, int mode, uint flags)
MY_TEST(flags & HA_OPEN_INTERNAL_TABLE);
reset_statistics();
- /* Don't try to read the inital row the call is part of create code */
+ /* Don't try to read the initial row the call is part of create code */
if (!(flags & (HA_OPEN_FOR_CREATE | HA_OPEN_FOR_REPAIR)))
{
if (unlikely((error= table->s->sequence->read_initial_values(table))))
diff --git a/sql/handler.cc b/sql/handler.cc
index 1494060e24d..4e2c6afda80 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1446,7 +1446,8 @@ int ha_commit_trans(THD *thd, bool all)
#if 1 // FIXME: This should be done in ha_prepare().
if (rw_trans || (thd->lex->sql_command == SQLCOM_ALTER_TABLE &&
- thd->lex->alter_info.flags & ALTER_ADD_SYSTEM_VERSIONING))
+ thd->lex->alter_info.flags & ALTER_ADD_SYSTEM_VERSIONING &&
+ is_real_trans))
{
ulonglong trx_start_id= 0, trx_end_id= 0;
for (Ha_trx_info *ha_info= trans->ha_list; ha_info; ha_info= ha_info->next())
diff --git a/sql/handler.h b/sql/handler.h
index 345e0bc1f00..e3bfcaa1ed2 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1490,9 +1490,9 @@ struct handlerton
Used by open_table_error(), by the default rename_table and delete_table
handler methods, and by the default discovery implementation.
- For engines that have more than one file name extentions (separate
+ For engines that have more than one file name extensions (separate
metadata, index, and/or data files), the order of elements is relevant.
- First element of engine file name extentions array should be metadata
+ First element of engine file name extensions array should be metadata
file extention. This is implied by the open_table_error()
and the default discovery implementation.
diff --git a/sql/item.cc b/sql/item.cc
index ca93c71cd7b..0a42912dd91 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2797,7 +2797,7 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll,
@retval
clone of the item
- 0 if an error occured
+ 0 if an error occurred
*/
Item* Item_func_or_sum::build_clone(THD *thd)
@@ -3097,7 +3097,7 @@ Item_sp::init_result_field(THD *thd, uint max_length, uint maybe_null,
@retval
clone of the item
- 0 if an error occured
+ 0 if an error occurred
*/
Item* Item_ref::build_clone(THD *thd)
@@ -3461,12 +3461,13 @@ bool Item_field::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
bool Item_field::get_date_result(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
- if (result_field->is_null() || result_field->get_date(ltime,fuzzydate))
+ if ((null_value= result_field->is_null()) ||
+ result_field->get_date(ltime, fuzzydate))
{
bzero((char*) ltime,sizeof(*ltime));
- return (null_value= 1);
+ return true;
}
- return (null_value= 0);
+ return false;
}
@@ -8404,7 +8405,7 @@ bool Item_ref::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
longlong Item_ref::val_datetime_packed()
{
DBUG_ASSERT(fixed);
- longlong tmp= (*ref)->val_datetime_packed();
+ longlong tmp= (*ref)->val_datetime_packed_result();
null_value= (*ref)->null_value;
return tmp;
}
@@ -8413,7 +8414,7 @@ longlong Item_ref::val_datetime_packed()
longlong Item_ref::val_time_packed()
{
DBUG_ASSERT(fixed);
- longlong tmp= (*ref)->val_time_packed();
+ longlong tmp= (*ref)->val_time_packed_result();
null_value= (*ref)->null_value;
return tmp;
}
@@ -9250,6 +9251,46 @@ bool Item_direct_view_ref::excl_dep_on_grouping_fields(st_select_lex *sel)
}
+double Item_direct_view_ref::val_result()
+{
+ double tmp=(*ref)->val_result();
+ null_value=(*ref)->null_value;
+ return tmp;
+}
+
+
+longlong Item_direct_view_ref::val_int_result()
+{
+ longlong tmp=(*ref)->val_int_result();
+ null_value=(*ref)->null_value;
+ return tmp;
+}
+
+
+String *Item_direct_view_ref::str_result(String* tmp)
+{
+ tmp=(*ref)->str_result(tmp);
+ null_value=(*ref)->null_value;
+ return tmp;
+}
+
+
+my_decimal *Item_direct_view_ref::val_decimal_result(my_decimal *val)
+{
+ my_decimal *tmp= (*ref)->val_decimal_result(val);
+ null_value=(*ref)->null_value;
+ return tmp;
+}
+
+
+bool Item_direct_view_ref::val_bool_result()
+{
+ bool tmp= (*ref)->val_bool_result();
+ null_value=(*ref)->null_value;
+ return tmp;
+}
+
+
bool Item_default_value::eq(const Item *item, bool binary_cmp) const
{
return item->type() == DEFAULT_VALUE_ITEM &&
@@ -10318,6 +10359,8 @@ bool Item_cache_str::cache_value()
value_buff.copy(*value);
value= &value_buff;
}
+ else
+ value_buff.copy();
return TRUE;
}
diff --git a/sql/item.h b/sql/item.h
index 694672deabc..d28371be8f5 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -5392,6 +5392,15 @@ public:
item_equal= NULL;
Item_direct_ref::cleanup();
}
+ /*
+ TODO move these val_*_result function to Item_dierct_ref (maybe)
+ */
+ double val_result();
+ longlong val_int_result();
+ String *str_result(String* tmp);
+ my_decimal *val_decimal_result(my_decimal *val);
+ bool val_bool_result();
+
Item *get_copy(THD *thd)
{ return get_item_copy<Item_direct_view_ref>(thd, this); }
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index f35b68c15a6..ee371b8f896 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -4976,7 +4976,7 @@ void Item_cond::neg_arguments(THD *thd)
@retval
clone of the item
- 0 if an error occured
+ 0 if an error occurred
*/
Item *Item_cond::build_clone(THD *thd)
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 4bb2e0a5dee..29c32be1c80 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -2418,6 +2418,7 @@ public:
bool to_be_transformed_into_in_subq(THD *thd);
bool create_value_list_for_tvc(THD *thd, List< List<Item> > *values);
Item *in_predicate_to_in_subs_transformer(THD *thd, uchar *arg);
+ uint32 max_length_of_left_expr();
};
class cmp_item_row :public cmp_item
@@ -2611,7 +2612,6 @@ class Item_func_like :public Item_bool_func2
bool escape_used_in_parsing;
bool use_sampling;
- bool negated;
DTCollation cmp_collation;
String cmp_value1, cmp_value2;
@@ -2628,6 +2628,7 @@ protected:
Item_func::Functype type, Item *value);
public:
int escape;
+ bool negated;
Item_func_like(THD *thd, Item *a, Item *b, Item *escape_arg, bool escape_used):
Item_bool_func2(thd, a, b), canDoTurboBM(FALSE), pattern(0), pattern_len(0),
diff --git a/sql/item_func.cc b/sql/item_func.cc
index bf4909e1846..e7be4211d19 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -123,7 +123,8 @@ Item_args::Item_args(THD *thd, const Item_args *other)
arg_count= 0;
return;
}
- memcpy(args, other->args, sizeof(Item*) * arg_count);
+ if (arg_count)
+ memcpy(args, other->args, sizeof(Item*) * arg_count);
}
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 4fb83960bc9..78857f377f5 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2404,7 +2404,7 @@ String *Item_func_sqlerrm::val_str(String *str)
system_charset_info);
return str;
}
- str->copy(STRING_WITH_LEN("normal, successful completition"),
+ str->copy(STRING_WITH_LEN("normal, successful completion"),
system_charset_info);
return str;
}
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 08ee190e96c..91b75b776e2 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1094,19 +1094,6 @@ void Aggregator_distinct::endup()
String *
-Item_sum_num::val_str(String *str)
-{
- return val_string_from_real(str);
-}
-
-
-my_decimal *Item_sum_num::val_decimal(my_decimal *decimal_value)
-{
- return val_decimal_from_real(decimal_value);
-}
-
-
-String *
Item_sum_int::val_str(String *str)
{
return val_string_from_int(str);
@@ -2188,7 +2175,7 @@ static double variance_fp_recurrence_result(double s, ulonglong count, bool is_s
Item_sum_variance::Item_sum_variance(THD *thd, Item_sum_variance *item):
- Item_sum_num(thd, item),
+ Item_sum_double(thd, item),
count(item->count), sample(item->sample),
prec_increment(item->prec_increment)
{
@@ -2314,13 +2301,6 @@ double Item_sum_variance::val_real()
}
-my_decimal *Item_sum_variance::val_decimal(my_decimal *dec_buf)
-{
- DBUG_ASSERT(fixed == 1);
- return val_decimal_from_real(dec_buf);
-}
-
-
void Item_sum_variance::reset_field()
{
double nr;
diff --git a/sql/item_sum.h b/sql/item_sum.h
index a3e10c25763..243b6f28944 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -578,6 +578,7 @@ public:
void mark_as_window_func_sum_expr() { window_func_sum_expr_flag= true; }
bool is_window_func_sum_expr() { return window_func_sum_expr_flag; }
virtual void setup_caches(THD *thd) {};
+ virtual void set_partition_row_count(ulonglong count) { DBUG_ASSERT(0); }
};
@@ -713,33 +714,45 @@ public:
class Item_sum_num :public Item_sum
{
-protected:
- /*
- val_xxx() functions may be called several times during the execution of a
- query. Derived classes that require extensive calculation in val_xxx()
- maintain cache of aggregate value. This variable governs the validity of
- that cache.
- */
- bool is_evaluated;
public:
- Item_sum_num(THD *thd): Item_sum(thd), is_evaluated(FALSE) {}
+ Item_sum_num(THD *thd): Item_sum(thd) {}
Item_sum_num(THD *thd, Item *item_par):
- Item_sum(thd, item_par), is_evaluated(FALSE) {}
+ Item_sum(thd, item_par) {}
Item_sum_num(THD *thd, Item *a, Item* b):
- Item_sum(thd, a, b), is_evaluated(FALSE) {}
+ Item_sum(thd, a, b) {}
Item_sum_num(THD *thd, List<Item> &list):
- Item_sum(thd, list), is_evaluated(FALSE) {}
+ Item_sum(thd, list) {}
Item_sum_num(THD *thd, Item_sum_num *item):
- Item_sum(thd, item),is_evaluated(item->is_evaluated) {}
+ Item_sum(thd, item) {}
bool fix_fields(THD *, Item **);
- longlong val_int() { return val_int_from_real(); /* Real as default */ }
- String *val_str(String*str);
- my_decimal *val_decimal(my_decimal *);
+ void reset_field();
+};
+
+
+class Item_sum_double :public Item_sum_num
+{
+public:
+ Item_sum_double(THD *thd): Item_sum_num(thd) {}
+ Item_sum_double(THD *thd, Item *item_par): Item_sum_num(thd, item_par) {}
+ Item_sum_double(THD *thd, List<Item> &list): Item_sum_num(thd, list) {}
+ Item_sum_double(THD *thd, Item_sum_double *item) :Item_sum_num(thd, item) {}
+ longlong val_int()
+ {
+ return val_int_from_real();
+ }
+ String *val_str(String*str)
+ {
+ return val_string_from_real(str);
+ }
+ my_decimal *val_decimal(my_decimal *to)
+ {
+ return val_decimal_from_real(to);
+ }
bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
- return type_handler()->Item_get_date(this, ltime, fuzzydate);
+ return get_date_from_real(ltime, fuzzydate);
}
- void reset_field();
+ const Type_handler *type_handler() const { return &type_handler_double; }
};
@@ -753,6 +766,10 @@ public:
double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
String *val_str(String*str);
my_decimal *val_decimal(my_decimal *);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
+ {
+ return get_date_from_int(ltime, fuzzydate);
+ }
const Type_handler *type_handler() const { return &type_handler_longlong; }
bool fix_length_and_dec()
{ decimals=0; max_length=21; maybe_null=null_value=0; return FALSE; }
@@ -794,6 +811,10 @@ public:
longlong val_int();
String *val_str(String*str);
my_decimal *val_decimal(my_decimal *);
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
+ {
+ return type_handler()->Item_get_date(this, ltime, fuzzydate);
+ }
const Type_handler *type_handler() const
{ return Type_handler_hybrid_field_type::type_handler(); }
void fix_length_and_dec_double();
@@ -964,7 +985,7 @@ But, this falls prey to catastrophic cancellation. Instead, use the recurrence
*/
-class Item_sum_variance : public Item_sum_num
+class Item_sum_variance : public Item_sum_double
{
bool fix_length_and_dec();
@@ -975,7 +996,7 @@ public:
uint prec_increment;
Item_sum_variance(THD *thd, Item *item_par, uint sample_arg):
- Item_sum_num(thd, item_par), count(0),
+ Item_sum_double(thd, item_par), count(0),
sample(sample_arg)
{}
Item_sum_variance(THD *thd, Item_sum_variance *item);
@@ -985,7 +1006,6 @@ public:
void clear();
bool add();
double val_real();
- my_decimal *val_decimal(my_decimal *);
void reset_field();
void update_field();
Item *result_item(THD *thd, Field *field);
@@ -994,11 +1014,10 @@ public:
{ return sample ? "var_samp(" : "variance("; }
Item *copy_or_same(THD* thd);
Field *create_tmp_field(bool group, TABLE *table);
- const Type_handler *type_handler() const { return &type_handler_double; }
void cleanup()
{
count= 0;
- Item_sum_num::cleanup();
+ Item_sum_double::cleanup();
}
Item *get_copy(THD *thd)
{ return get_item_copy<Item_sum_variance>(thd, this); }
@@ -1679,15 +1698,15 @@ public:
#else /* Dummy functions to get sql_yacc.cc compiled */
-class Item_sum_udf_float :public Item_sum_num
+class Item_sum_udf_float :public Item_sum_double
{
public:
Item_sum_udf_float(THD *thd, udf_func *udf_arg):
- Item_sum_num(thd) {}
+ Item_sum_double(thd) {}
Item_sum_udf_float(THD *thd, udf_func *udf_arg, List<Item> &list):
- Item_sum_num(thd) {}
+ Item_sum_double(thd) {}
Item_sum_udf_float(THD *thd, Item_sum_udf_float *item)
- :Item_sum_num(thd, item) {}
+ :Item_sum_double(thd, item) {}
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
double val_real() { DBUG_ASSERT(fixed == 1); return 0.0; }
void clear() {}
@@ -1696,15 +1715,15 @@ class Item_sum_udf_float :public Item_sum_num
};
-class Item_sum_udf_int :public Item_sum_num
+class Item_sum_udf_int :public Item_sum_double
{
public:
Item_sum_udf_int(THD *thd, udf_func *udf_arg):
- Item_sum_num(thd) {}
+ Item_sum_double(thd) {}
Item_sum_udf_int(THD *thd, udf_func *udf_arg, List<Item> &list):
- Item_sum_num(thd) {}
+ Item_sum_double(thd) {}
Item_sum_udf_int(THD *thd, Item_sum_udf_int *item)
- :Item_sum_num(thd, item) {}
+ :Item_sum_double(thd, item) {}
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
longlong val_int() { DBUG_ASSERT(fixed == 1); return 0; }
double val_real() { DBUG_ASSERT(fixed == 1); return 0; }
@@ -1714,15 +1733,15 @@ public:
};
-class Item_sum_udf_decimal :public Item_sum_num
+class Item_sum_udf_decimal :public Item_sum_double
{
public:
Item_sum_udf_decimal(THD *thd, udf_func *udf_arg):
- Item_sum_num(thd) {}
+ Item_sum_double(thd) {}
Item_sum_udf_decimal(THD *thd, udf_func *udf_arg, List<Item> &list):
- Item_sum_num(thd) {}
+ Item_sum_double(thd) {}
Item_sum_udf_decimal(THD *thd, Item_sum_udf_float *item)
- :Item_sum_num(thd, item) {}
+ :Item_sum_double(thd, item) {}
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
double val_real() { DBUG_ASSERT(fixed == 1); return 0.0; }
my_decimal *val_decimal(my_decimal *) { DBUG_ASSERT(fixed == 1); return 0; }
@@ -1732,15 +1751,15 @@ class Item_sum_udf_decimal :public Item_sum_num
};
-class Item_sum_udf_str :public Item_sum_num
+class Item_sum_udf_str :public Item_sum_double
{
public:
Item_sum_udf_str(THD *thd, udf_func *udf_arg):
- Item_sum_num(thd) {}
+ Item_sum_double(thd) {}
Item_sum_udf_str(THD *thd, udf_func *udf_arg, List<Item> &list):
- Item_sum_num(thd) {}
+ Item_sum_double(thd) {}
Item_sum_udf_str(THD *thd, Item_sum_udf_str *item)
- :Item_sum_num(thd, item) {}
+ :Item_sum_double(thd, item) {}
String *val_str(String *)
{ DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
double val_real() { DBUG_ASSERT(fixed == 1); null_value=1; return 0.0; }
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 06214918693..34b12ee9b55 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1094,14 +1094,10 @@ longlong Item_func_yearweek::val_int()
longlong Item_func_weekday::val_int()
{
DBUG_ASSERT(fixed == 1);
- MYSQL_TIME ltime;
-
- if (get_arg0_date(&ltime, TIME_NO_ZERO_DATE | TIME_NO_ZERO_IN_DATE))
+ Datetime dt(current_thd, args[0], TIME_NO_ZERO_DATE | TIME_NO_ZERO_IN_DATE);
+ if ((null_value= !dt.is_valid_datetime()))
return 0;
-
- return (longlong) calc_weekday(calc_daynr(ltime.year, ltime.month,
- ltime.day),
- odbc_type) + MY_TEST(odbc_type);
+ return dt.weekday(odbc_type) + MY_TEST(odbc_type);
}
bool Item_func_dayname::fix_length_and_dec()
@@ -1120,14 +1116,14 @@ bool Item_func_dayname::fix_length_and_dec()
String* Item_func_dayname::val_str(String* str)
{
DBUG_ASSERT(fixed == 1);
- uint weekday=(uint) val_int(); // Always Item_func_weekday()
const char *day_name;
uint err;
+ Datetime dt(current_thd, args[0], TIME_NO_ZERO_DATE | TIME_NO_ZERO_IN_DATE);
- if (null_value)
+ if ((null_value= !dt.is_valid_datetime()))
return (String*) 0;
- day_name= locale->day_names->type_names[weekday];
+ day_name= locale->day_names->type_names[dt.weekday(false)];
str->copy(day_name, (uint) strlen(day_name), &my_charset_utf8_bin,
collation.collation, &err);
return str;
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 46f0da2ed2a..8b39092e09a 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -170,28 +170,13 @@ public:
};
-class Item_func_month :public Item_func
+class Item_func_month :public Item_long_func
{
public:
- Item_func_month(THD *thd, Item *a): Item_func(thd, a)
- { collation.set_numeric(); }
+ Item_func_month(THD *thd, Item *a): Item_long_func(thd, a)
+ { }
longlong val_int();
- double val_real()
- { DBUG_ASSERT(fixed == 1); return (double) Item_func_month::val_int(); }
- String *val_str(String *str)
- {
- longlong nr= val_int();
- if (null_value)
- return 0;
- str->set(nr, collation.collation);
- return str;
- }
- bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
- {
- return get_date_from_int(ltime, fuzzydate);
- }
const char *func_name() const { return "month"; }
- const Type_handler *type_handler() const { return &type_handler_long; }
bool fix_length_and_dec()
{
decimals= 0;
@@ -441,20 +426,13 @@ public:
};
-class Item_func_weekday :public Item_func
+class Item_func_weekday :public Item_long_func
{
bool odbc_type;
public:
Item_func_weekday(THD *thd, Item *a, bool type_arg):
- Item_func(thd, a), odbc_type(type_arg) { collation.set_numeric(); }
+ Item_long_func(thd, a), odbc_type(type_arg) { }
longlong val_int();
- double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
- String *val_str(String *str)
- {
- DBUG_ASSERT(fixed == 1);
- str->set(val_int(), &my_charset_bin);
- return null_value ? 0 : str;
- }
const char *func_name() const
{
return (odbc_type ? "dayofweek" : "weekday");
@@ -463,7 +441,6 @@ public:
{
return type_handler()->Item_get_date(this, ltime, fuzzydate);
}
- const Type_handler *type_handler() const { return &type_handler_long; }
bool fix_length_and_dec()
{
decimals= 0;
@@ -481,11 +458,11 @@ public:
{ return get_item_copy<Item_func_weekday>(thd, this); }
};
-class Item_func_dayname :public Item_func_weekday
+class Item_func_dayname :public Item_str_func
{
MY_LOCALE *locale;
public:
- Item_func_dayname(THD *thd, Item *a): Item_func_weekday(thd, a, 0) {}
+ Item_func_dayname(THD *thd, Item *a): Item_str_func(thd, a) {}
const char *func_name() const { return "dayname"; }
String *val_str(String *str);
const Type_handler *type_handler() const { return &type_handler_varchar; }
@@ -495,6 +472,12 @@ class Item_func_dayname :public Item_func_weekday
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
}
+ bool check_valid_arguments_processor(void *int_arg)
+ {
+ return !has_date_args();
+ }
+ Item *get_copy(THD *thd)
+ { return get_item_copy<Item_func_dayname>(thd, this); }
};
@@ -918,6 +901,10 @@ class Item_func_from_unixtime :public Item_datetimefunc
const char *func_name() const { return "from_unixtime"; }
bool fix_length_and_dec();
bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
+ bool check_vcol_func_processor(void *arg)
+ {
+ return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
+ }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_from_unixtime>(thd, this); }
};
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index cc67c02f1ee..971b316ca99 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -438,27 +438,38 @@ class Item_sum_lag : public Item_sum_hybrid_simple
{ return get_item_copy<Item_sum_lag>(thd, this); }
};
-/*
- A base window function (aggregate) that also holds a counter for the number
- of rows.
-*/
-class Item_sum_window_with_row_count : public Item_sum_num
-{
- public:
- Item_sum_window_with_row_count(THD *thd) : Item_sum_num(thd),
- partition_row_count_(0) {}
-
- Item_sum_window_with_row_count(THD *thd, Item *arg) :
- Item_sum_num(thd, arg), partition_row_count_(0) {};
- void set_row_count(ulonglong count) { partition_row_count_ = count; }
-
- protected:
+class Partition_row_count
+{
+public:
+ Partition_row_count() :partition_row_count_(0) { }
+ void set_partition_row_count(ulonglong count)
+ {
+ partition_row_count_ = count;
+ }
+ double calc_val_real(bool *null_value,
+ ulonglong current_row_count)
+ {
+ if ((*null_value= (partition_row_count_ == 0)))
+ return 0;
+ return static_cast<double>(current_row_count) / partition_row_count_;
+ }
+protected:
longlong get_row_count() { return partition_row_count_; }
- private:
ulonglong partition_row_count_;
};
+
+class Current_row_count
+{
+public:
+ Current_row_count() :current_row_count_(0) { }
+protected:
+ ulonglong get_row_number() { return current_row_count_ ; }
+ ulonglong current_row_count_;
+};
+
+
/*
@detail
"The relative rank of a row R is defined as (RK-1)/(NR-1), where RK is
@@ -470,11 +481,12 @@ class Item_sum_window_with_row_count : public Item_sum_num
This is held within the row_count context.
- Second pass to compute rank of current row and the value of the function
*/
-class Item_sum_percent_rank: public Item_sum_window_with_row_count
+class Item_sum_percent_rank: public Item_sum_double,
+ public Partition_row_count
{
public:
Item_sum_percent_rank(THD *thd)
- : Item_sum_window_with_row_count(thd), cur_rank(1), peer_tracker(NULL) {}
+ : Item_sum_double(thd), cur_rank(1), peer_tracker(NULL) {}
longlong val_int()
{
@@ -527,6 +539,12 @@ class Item_sum_percent_rank: public Item_sum_window_with_row_count
}
void setup_window_func(THD *thd, Window_spec *window_spec);
+
+ void set_partition_row_count(ulonglong count)
+ {
+ Partition_row_count::set_partition_row_count(count);
+ }
+
Item *get_copy(THD *thd)
{ return get_item_copy<Item_sum_percent_rank>(thd, this); }
@@ -561,25 +579,17 @@ class Item_sum_percent_rank: public Item_sum_window_with_row_count
two passes.
*/
-class Item_sum_cume_dist: public Item_sum_window_with_row_count
+class Item_sum_cume_dist: public Item_sum_double,
+ public Partition_row_count,
+ public Current_row_count
{
public:
- Item_sum_cume_dist(THD *thd) : Item_sum_window_with_row_count(thd),
- current_row_count_(0) {}
-
- Item_sum_cume_dist(THD *thd, Item *arg) : Item_sum_window_with_row_count(thd,arg),
- current_row_count_(0) {}
+ Item_sum_cume_dist(THD *thd) :Item_sum_double(thd) { }
+ Item_sum_cume_dist(THD *thd, Item *arg) :Item_sum_double(thd, arg) { }
double val_real()
{
- if (get_row_count() == 0)
- {
- null_value= true;
- return 0;
- }
- ulonglong partition_row_count= get_row_count();
- null_value= false;
- return static_cast<double>(current_row_count_) / partition_row_count;
+ return calc_val_real(&null_value, current_row_count_);
}
bool add()
@@ -596,7 +606,7 @@ class Item_sum_cume_dist: public Item_sum_window_with_row_count
void clear()
{
current_row_count_= 0;
- set_row_count(0);
+ partition_row_count_= 0;
}
const char*func_name() const
@@ -614,29 +624,24 @@ class Item_sum_cume_dist: public Item_sum_window_with_row_count
return FALSE;
}
- Item *get_copy(THD *thd)
- { return get_item_copy<Item_sum_cume_dist>(thd, this); }
-
- ulonglong get_row_number()
+ void set_partition_row_count(ulonglong count)
{
- return current_row_count_ ;
+ Partition_row_count::set_partition_row_count(count);
}
- private:
- ulonglong current_row_count_;
+ Item *get_copy(THD *thd)
+ { return get_item_copy<Item_sum_cume_dist>(thd, this); }
+
};
-class Item_sum_ntile : public Item_sum_window_with_row_count
+class Item_sum_ntile : public Item_sum_int,
+ public Partition_row_count,
+ public Current_row_count
{
public:
Item_sum_ntile(THD* thd, Item* num_quantiles_expr) :
- Item_sum_window_with_row_count(thd, num_quantiles_expr),
- current_row_count_(0) {};
-
- double val_real()
- {
- return (double) val_int();
- }
+ Item_sum_int(thd, num_quantiles_expr)
+ { }
longlong val_int()
{
@@ -677,7 +682,7 @@ class Item_sum_ntile : public Item_sum_window_with_row_count
void clear()
{
current_row_count_= 0;
- set_row_count(0);
+ partition_row_count_= 0;
}
const char*func_name() const
@@ -687,21 +692,25 @@ class Item_sum_ntile : public Item_sum_window_with_row_count
void update_field() {}
- const Type_handler *type_handler() const { return &type_handler_longlong; }
-
+ void set_partition_row_count(ulonglong count)
+ {
+ Partition_row_count::set_partition_row_count(count);
+ }
+
Item *get_copy(THD *thd)
{ return get_item_copy<Item_sum_ntile>(thd, this); }
private:
longlong get_num_quantiles() { return args[0]->val_int(); }
- ulong current_row_count_;
};
-class Item_sum_percentile_disc : public Item_sum_cume_dist,
- public Type_handler_hybrid_field_type
+class Item_sum_percentile_disc : public Item_sum_num,
+ public Type_handler_hybrid_field_type,
+ public Partition_row_count,
+ public Current_row_count
{
public:
- Item_sum_percentile_disc(THD *thd, Item* arg) : Item_sum_cume_dist(thd, arg),
+ Item_sum_percentile_disc(THD *thd, Item* arg) : Item_sum_num(thd, arg),
Type_handler_hybrid_field_type(&type_handler_longlong),
value(NULL), val_calculated(FALSE), first_call(TRUE),
prev_value(0), order_item(NULL){}
@@ -750,6 +759,17 @@ public:
return value->val_str(str);
}
+ bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
+ {
+ if (get_row_count() == 0 || get_arg(0)->is_null())
+ {
+ null_value= true;
+ return 0;
+ }
+ null_value= false;
+ return value->get_date(ltime, fuzzydate);
+ }
+
bool add()
{
Item *arg= get_arg(0);
@@ -783,8 +803,8 @@ public:
if (value->null_value)
return false;
- Item_sum_cume_dist::add();
- double val= Item_sum_cume_dist::val_real();
+ current_row_count_++;
+ double val= calc_val_real(&null_value, current_row_count_);
if (val >= prev_value && !val_calculated)
val_calculated= true;
@@ -801,7 +821,8 @@ public:
val_calculated= false;
first_call= true;
value->clear();
- Item_sum_cume_dist::clear();
+ partition_row_count_= 0;
+ current_row_count_= 0;
}
const char*func_name() const
@@ -810,7 +831,6 @@ public:
}
void update_field() {}
- void set_type_handler(Window_spec *window_spec);
const Type_handler *type_handler() const
{return Type_handler_hybrid_field_type::type_handler();}
@@ -821,6 +841,11 @@ public:
return FALSE;
}
+ void set_partition_row_count(ulonglong count)
+ {
+ Partition_row_count::set_partition_row_count(count);
+ }
+
Item *get_copy(THD *thd)
{ return get_item_copy<Item_sum_percentile_disc>(thd, this); }
void setup_window_func(THD *thd, Window_spec *window_spec);
@@ -835,12 +860,12 @@ private:
Item *order_item;
};
-class Item_sum_percentile_cont : public Item_sum_cume_dist,
- public Type_handler_hybrid_field_type
+class Item_sum_percentile_cont : public Item_sum_double,
+ public Partition_row_count,
+ public Current_row_count
{
public:
- Item_sum_percentile_cont(THD *thd, Item* arg) : Item_sum_cume_dist(thd, arg),
- Type_handler_hybrid_field_type(&type_handler_double),
+ Item_sum_percentile_cont(THD *thd, Item* arg) : Item_sum_double(thd, arg),
floor_value(NULL), ceil_value(NULL), first_call(TRUE),prev_value(0),
ceil_val_calculated(FALSE), floor_val_calculated(FALSE), order_item(NULL){}
@@ -910,7 +935,7 @@ public:
return false;
}
- Item_sum_cume_dist::add();
+ current_row_count_++;
double val= 1 + prev_value * (get_row_count()-1);
if (!floor_val_calculated && get_row_number() == floor(val))
@@ -933,7 +958,8 @@ public:
ceil_value->clear();
floor_val_calculated= false;
ceil_val_calculated= false;
- Item_sum_cume_dist::clear();
+ partition_row_count_= 0;
+ current_row_count_= 0;
}
const char*func_name() const
@@ -941,9 +967,6 @@ public:
return "percentile_cont";
}
void update_field() {}
- void set_type_handler(Window_spec *window_spec);
- const Type_handler *type_handler() const
- {return Type_handler_hybrid_field_type::type_handler();}
bool fix_length_and_dec()
{
@@ -952,6 +975,11 @@ public:
return FALSE;
}
+ void set_partition_row_count(ulonglong count)
+ {
+ Partition_row_count::set_partition_row_count(count);
+ }
+
Item *get_copy(THD *thd)
{ return get_item_copy<Item_sum_percentile_cont>(thd, this); }
void setup_window_func(THD *thd, Window_spec *window_spec);
diff --git a/sql/lex.h b/sql/lex.h
index a8b7000d6da..070ac5cc147 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -23,7 +23,7 @@
#include "lex_symbol.h"
SYM_GROUP sym_group_common= {"", ""};
-SYM_GROUP sym_group_geom= {"Spatial extentions", "HAVE_SPATIAL"};
+SYM_GROUP sym_group_geom= {"Spatial extensions", "HAVE_SPATIAL"};
SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"};
/* We don't want to include sql_yacc.h into gen_lex_hash */
diff --git a/sql/log.cc b/sql/log.cc
index 900cc1b8197..bde301452be 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
- Copyright (c) 2009, 2019, MariaDB Corporation
+ Copyright (c) 2009, 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
@@ -484,6 +484,7 @@ private:
void truncate(my_off_t pos, bool reset_cache=0)
{
DBUG_PRINT("info", ("truncating to position %lu", (ulong) pos));
+ cache_log.error=0;
if (pending())
{
delete pending();
@@ -492,7 +493,7 @@ private:
reinit_io_cache(&cache_log, WRITE_CACHE, pos, 0, reset_cache);
cache_log.end_of_file= saved_max_binlog_cache_size;
}
-
+
binlog_cache_data& operator=(const binlog_cache_data& info);
binlog_cache_data(const binlog_cache_data& info);
};
@@ -3263,7 +3264,7 @@ void MYSQL_BIN_LOG::cleanup()
DBUG_ASSERT(!binlog_xid_count_list.head());
WSREP_XID_LIST_ENTRY("MYSQL_BIN_LOG::cleanup(): Removing xid_list_entry "
"for %s (%lu)", b);
- my_free(b);
+ delete b;
}
mysql_mutex_destroy(&LOCK_log);
@@ -3628,19 +3629,10 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
know from where to start recovery.
*/
size_t off= dirname_length(log_file_name);
- size_t len= strlen(log_file_name) - off;
- char *entry_mem, *name_mem;
- if (!(new_xid_list_entry = (xid_count_per_binlog *)
- my_multi_malloc(MYF(MY_WME),
- &entry_mem, sizeof(xid_count_per_binlog),
- &name_mem, len,
- NULL)))
+ uint len= static_cast<uint>(strlen(log_file_name) - off);
+ new_xid_list_entry= new xid_count_per_binlog(log_file_name+off, len);
+ if (!new_xid_list_entry)
goto err;
- memcpy(name_mem, log_file_name+off, len);
- new_xid_list_entry->binlog_name= name_mem;
- new_xid_list_entry->binlog_name_len= (int)len;
- new_xid_list_entry->xid_count= 0;
- new_xid_list_entry->notify_count= 0;
/*
Find the name for the Initial binlog checkpoint.
@@ -3657,8 +3649,11 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
mysql_mutex_unlock(&LOCK_xid_list);
if (!b)
b= new_xid_list_entry;
- strmake(buf, b->binlog_name, b->binlog_name_len);
- Binlog_checkpoint_log_event ev(buf, (uint)len);
+ if (b->binlog_name)
+ strmake(buf, b->binlog_name, b->binlog_name_len);
+ else
+ goto err;
+ Binlog_checkpoint_log_event ev(buf, len);
DBUG_EXECUTE_IF("crash_before_write_checkpoint_event",
flush_io_cache(&log_file);
mysql_file_sync(log_file.file, MYF(MY_WME));
@@ -3761,7 +3756,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
{
WSREP_XID_LIST_ENTRY("MYSQL_BIN_LOG::open(): Removing xid_list_entry for "
"%s (%lu)", b);
- my_free(binlog_xid_count_list.get());
+ delete binlog_xid_count_list.get();
}
mysql_cond_broadcast(&COND_xid_list);
WSREP_XID_LIST_ENTRY("MYSQL_BIN_LOG::open(): Adding new xid_list_entry for "
@@ -3811,7 +3806,7 @@ err:
#endif
sql_print_error(fatal_log_error, name, tmp_errno);
if (new_xid_list_entry)
- my_free(new_xid_list_entry);
+ delete new_xid_list_entry;
if (file >= 0)
mysql_file_close(file, MYF(0));
close(LOG_CLOSE_INDEX);
@@ -4297,7 +4292,7 @@ err:
DBUG_ASSERT(b->xid_count == 0);
WSREP_XID_LIST_ENTRY("MYSQL_BIN_LOG::reset_logs(): Removing "
"xid_list_entry for %s (%lu)", b);
- my_free(binlog_xid_count_list.get());
+ delete binlog_xid_count_list.get();
}
mysql_cond_broadcast(&COND_xid_list);
reset_master_pending--;
@@ -9832,7 +9827,7 @@ TC_LOG_BINLOG::mark_xid_done(ulong binlog_id, bool write_checkpoint)
break;
WSREP_XID_LIST_ENTRY("TC_LOG_BINLOG::mark_xid_done(): Removing "
"xid_list_entry for %s (%lu)", b);
- my_free(binlog_xid_count_list.get());
+ delete binlog_xid_count_list.get();
}
mysql_mutex_unlock(&LOCK_xid_list);
diff --git a/sql/log.h b/sql/log.h
index 8dfd34d98f1..2ec7fb70da4 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2005, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2017, MariaDB Corporation.
+ Copyright (c) 2009, 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
@@ -600,7 +600,18 @@ public:
long notify_count;
/* For linking in requests to the binlog background thread. */
xid_count_per_binlog *next_in_queue;
- xid_count_per_binlog(); /* Give link error if constructor used. */
+ xid_count_per_binlog(char *log_file_name, uint log_file_name_len)
+ :binlog_id(0), xid_count(0), notify_count(0)
+ {
+ binlog_name_len= log_file_name_len;
+ binlog_name= (char *) my_malloc(binlog_name_len, MYF(MY_ZEROFILL));
+ if (binlog_name)
+ memcpy(binlog_name, log_file_name, binlog_name_len);
+ }
+ ~xid_count_per_binlog()
+ {
+ my_free(binlog_name);
+ }
};
I_List<xid_count_per_binlog> binlog_xid_count_list;
mysql_mutex_t LOCK_binlog_background_thread;
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 78111e86f20..d7113b12743 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1058,9 +1058,14 @@ row_log_event_uncompress(const Format_description_log_event *description_event,
uint32 binlog_get_uncompress_len(const char *buf)
{
- DBUG_ASSERT((buf[0] & 0xe0) == 0x80);
- uint32 lenlen = buf[0] & 0x07;
uint32 len = 0;
+ uint32 lenlen = 0;
+
+ if ((buf == NULL) || ((buf[0] & 0xe0) != 0x80))
+ return len;
+
+ lenlen = buf[0] & 0x07;
+
switch(lenlen)
{
case 1:
@@ -4572,6 +4577,18 @@ code_name(int code)
}
#endif
+#define VALIDATE_BYTES_READ(CUR_POS, START, EVENT_LEN) \
+ do { \
+ uchar *cur_pos= (uchar *)CUR_POS; \
+ uchar *start= (uchar *)START; \
+ uint len= EVENT_LEN; \
+ uint bytes_read= (uint)(cur_pos - start); \
+ DBUG_PRINT("info", ("Bytes read: %u event_len:%u.\n",\
+ bytes_read, len)); \
+ if (bytes_read >= len) \
+ DBUG_VOID_RETURN; \
+ } while (0)
+
/**
Macro to check that there is enough space to read from memory.
@@ -4582,7 +4599,6 @@ code_name(int code)
#define CHECK_SPACE(PTR,END,CNT) \
do { \
DBUG_PRINT("info", ("Read %s", code_name(pos[-1]))); \
- DBUG_ASSERT((PTR) + (CNT) <= (END)); \
if ((PTR) + (CNT) > (END)) { \
DBUG_PRINT("info", ("query= 0")); \
query= 0; \
@@ -4893,7 +4909,9 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
uint32 max_length= uint32(event_len - ((const char*)(end + db_len + 1) -
(buf - common_header_len)));
- if (q_len != max_length)
+ if (q_len != max_length ||
+ (event_len < uint((const char*)(end + db_len + 1) -
+ (buf - common_header_len))))
{
q_len= 0;
query= NULL;
@@ -7073,6 +7091,8 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
{
DBUG_ENTER("Load_log_event::copy_log_event");
uint data_len;
+ if ((int) event_len <= body_offset)
+ DBUG_RETURN(1);
char* buf_end = (char*)buf + event_len;
/* this is the beginning of the post-header */
const char* data_head = buf + description_event->common_header_len;
@@ -7082,9 +7102,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
table_name_len = (uint)data_head[L_TBL_LEN_OFFSET];
db_len = (uint)data_head[L_DB_LEN_OFFSET];
num_fields = uint4korr(data_head + L_NUM_FIELDS_OFFSET);
-
- if ((int) event_len < body_offset)
- DBUG_RETURN(1);
+
/*
Sql_ex.init() on success returns the pointer to the first byte after
the sql_ex structure, which is the start of field lengths array.
@@ -7093,7 +7111,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
buf_end,
(uchar)buf[EVENT_TYPE_OFFSET] != LOAD_EVENT)))
DBUG_RETURN(1);
-
+
data_len = event_len - body_offset;
if (num_fields > data_len) // simple sanity check against corruption
DBUG_RETURN(1);
@@ -7657,7 +7675,7 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
// The caller will ensure that event_len is what we have at EVENT_LEN_OFFSET
uint8 post_header_len= description_event->post_header_len[ROTATE_EVENT-1];
uint ident_offset;
- if (event_len < LOG_EVENT_MINIMAL_HEADER_LEN)
+ if (event_len < (uint)(LOG_EVENT_MINIMAL_HEADER_LEN + post_header_len))
DBUG_VOID_RETURN;
buf+= LOG_EVENT_MINIMAL_HEADER_LEN;
pos= post_header_len ? uint8korr(buf + R_POS_OFFSET) : 4;
@@ -9002,8 +9020,16 @@ int Xid_log_event::do_apply_event(rpl_group_info *rgi)
res= trans_commit(thd); /* Automatically rolls back on error. */
thd->mdl_context.release_transactional_locks();
+#ifdef WITH_WSREP
+ if (WSREP(thd)) mysql_mutex_lock(&thd->LOCK_thd_data);
+ if ((!res || (WSREP(thd) && thd->wsrep_conflict_state == MUST_REPLAY)) && sub_id)
+#else
if (likely(!res) && sub_id)
+#endif /* WITH_WSREP */
rpl_global_gtid_slave_state->update_state_hash(sub_id, &gtid, hton, rgi);
+#ifdef WITH_WSREP
+ if (WSREP(thd)) mysql_mutex_unlock(&thd->LOCK_thd_data);
+#endif /* WITH_WSREP */
/*
Increment the global status commit count variable
@@ -9236,6 +9262,11 @@ User_var_log_event(const char* buf, uint event_len,
we keep the flags set to UNDEF_F.
*/
size_t bytes_read= (val + val_len) - buf_start;
+ if (bytes_read > event_len)
+ {
+ error= true;
+ goto err;
+ }
if ((data_written - bytes_read) > 0)
{
flags= (uint) *(buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE +
@@ -10859,9 +10890,16 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
uint8 const common_header_len= description_event->common_header_len;
Log_event_type event_type= (Log_event_type)(uchar)buf[EVENT_TYPE_OFFSET];
m_type= event_type;
-
+ m_cols_ai.bitmap= 0;
+
uint8 const post_header_len= description_event->post_header_len[event_type-1];
+ if (event_len < (uint)(common_header_len + post_header_len))
+ {
+ m_cols.bitmap= 0;
+ DBUG_VOID_RETURN;
+ }
+
DBUG_PRINT("enter",("event_len: %u common_header_len: %d "
"post_header_len: %d",
event_len, common_header_len,
@@ -10893,7 +10931,14 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
which includes length bytes
*/
var_header_len= uint2korr(post_start);
- assert(var_header_len >= 2);
+ /* Check length and also avoid out of buffer read */
+ if (var_header_len < 2 ||
+ event_len < static_cast<unsigned int>(var_header_len +
+ (post_start - buf)))
+ {
+ m_cols.bitmap= 0;
+ DBUG_VOID_RETURN;
+ }
var_header_len-= 2;
/* Iterate over var-len header, extracting 'chunks' */
@@ -12558,14 +12603,12 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
m_data_size(0), m_field_metadata(0), m_field_metadata_size(0),
m_null_bits(0), m_meta_memory(NULL)
{
- unsigned int bytes_read= 0;
DBUG_ENTER("Table_map_log_event::Table_map_log_event(const char*,uint,...)");
uint8 common_header_len= description_event->common_header_len;
uint8 post_header_len= description_event->post_header_len[TABLE_MAP_EVENT-1];
DBUG_PRINT("info",("event_len: %u common_header_len: %d post_header_len: %d",
event_len, common_header_len, post_header_len));
-
/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
@@ -12574,10 +12617,14 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
DBUG_DUMP("event buffer", (uchar*) buf, event_len);
#endif
+ if (event_len < (uint)(common_header_len + post_header_len))
+ DBUG_VOID_RETURN;
+
/* Read the post-header */
const char *post_start= buf + common_header_len;
post_start+= TM_MAPID_OFFSET;
+ VALIDATE_BYTES_READ(post_start, buf, event_len);
if (post_header_len == 6)
{
/* Master is of an intermediate source tree before 5.1.4. Id is 4 bytes */
@@ -12600,15 +12647,18 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
/* Extract the length of the various parts from the buffer */
uchar const *const ptr_dblen= (uchar const*)vpart + 0;
+ VALIDATE_BYTES_READ(ptr_dblen, buf, event_len);
m_dblen= *(uchar*) ptr_dblen;
/* Length of database name + counter + terminating null */
uchar const *const ptr_tbllen= ptr_dblen + m_dblen + 2;
+ VALIDATE_BYTES_READ(ptr_tbllen, buf, event_len);
m_tbllen= *(uchar*) ptr_tbllen;
/* Length of table name + counter + terminating null */
uchar const *const ptr_colcnt= ptr_tbllen + m_tbllen + 2;
uchar *ptr_after_colcnt= (uchar*) ptr_colcnt;
+ VALIDATE_BYTES_READ(ptr_after_colcnt, buf, event_len);
m_colcnt= net_field_length(&ptr_after_colcnt);
DBUG_PRINT("info",("m_dblen: %lu off: %ld m_tbllen: %lu off: %ld m_colcnt: %lu off: %ld",
@@ -12631,23 +12681,27 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
memcpy(m_coltype, ptr_after_colcnt, m_colcnt);
ptr_after_colcnt= ptr_after_colcnt + m_colcnt;
- bytes_read= (uint) (ptr_after_colcnt - (uchar *)buf);
- DBUG_PRINT("info", ("Bytes read: %d", bytes_read));
- if (bytes_read < event_len)
+ VALIDATE_BYTES_READ(ptr_after_colcnt, buf, event_len);
+ m_field_metadata_size= net_field_length(&ptr_after_colcnt);
+ if(m_field_metadata_size <= (m_colcnt * 2))
{
- m_field_metadata_size= net_field_length(&ptr_after_colcnt);
- DBUG_ASSERT(m_field_metadata_size <= (m_colcnt * 2));
uint num_null_bytes= (m_colcnt + 7) / 8;
m_meta_memory= (uchar *)my_multi_malloc(MYF(MY_WME),
- &m_null_bits, num_null_bytes,
- &m_field_metadata, m_field_metadata_size,
- NULL);
+ &m_null_bits, num_null_bytes,
+ &m_field_metadata, m_field_metadata_size,
+ NULL);
memcpy(m_field_metadata, ptr_after_colcnt, m_field_metadata_size);
ptr_after_colcnt= (uchar*)ptr_after_colcnt + m_field_metadata_size;
memcpy(m_null_bits, ptr_after_colcnt, num_null_bytes);
}
+ else
+ {
+ m_coltype= NULL;
+ my_free(m_memory);
+ m_memory= NULL;
+ DBUG_VOID_RETURN;
+ }
}
-
DBUG_VOID_RETURN;
}
#endif
@@ -14502,9 +14556,12 @@ void Update_rows_log_event::init(MY_BITMAP const *cols)
Update_rows_log_event::~Update_rows_log_event()
{
- if (m_cols_ai.bitmap == m_bitbuf_ai) // no my_malloc happened
- m_cols_ai.bitmap= 0; // so no my_free in my_bitmap_free
- my_bitmap_free(&m_cols_ai); // To pair with my_bitmap_init().
+ if (m_cols_ai.bitmap)
+ {
+ if (m_cols_ai.bitmap == m_bitbuf_ai) // no my_malloc happened
+ m_cols_ai.bitmap= 0; // so no my_free in my_bitmap_free
+ my_bitmap_free(&m_cols_ai); // To pair with my_bitmap_init().
+ }
}
diff --git a/sql/log_event.h b/sql/log_event.h
index a12dfbc6c48..73809953d70 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -2223,7 +2223,15 @@ public:
****************************************************************************/
struct sql_ex_info
{
- sql_ex_info() {} /* Remove gcc warning */
+ sql_ex_info():
+ cached_new_format(-1),
+ field_term_len(0),
+ enclosed_len(0),
+ line_term_len(0),
+ line_start_len(0),
+ escaped_len(0),
+ empty_flags(0)
+ {} /* Remove gcc warning */
const char* field_term;
const char* enclosed;
const char* line_term;
@@ -3590,7 +3598,7 @@ public:
bool write_data_header();
bool write_data_body();
/*
- Cut out Create_file extentions and
+ Cut out Create_file extensions and
write it as Load event - used on the slave
*/
bool write_base();
@@ -5211,6 +5219,9 @@ bool event_that_should_be_ignored(const char *buf);
bool event_checksum_test(uchar *buf, ulong event_len, enum_binlog_checksum_alg alg);
enum enum_binlog_checksum_alg get_checksum_alg(const char* buf, ulong len);
extern TYPELIB binlog_checksum_typelib;
+#ifdef WITH_WSREP
+enum Log_event_type wsrep_peak_event(rpl_group_info *rgi, ulonglong* event_size);
+#endif /* WITH_WSREP */
/**
@} (end of group Replication)
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 829a278f215..e01488abbb3 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -835,7 +835,7 @@ int Write_rows_log_event_old::do_after_row_operations(TABLE *table, int error)
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
/*
- reseting the extra with
+ resetting the extra with
table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY);
fires bug#27077
todo: explain or fix
@@ -2459,7 +2459,7 @@ Write_rows_log_event_old::do_after_row_operations(const Slave_reporting_capabili
m_table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
m_table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
/*
- reseting the extra with
+ resetting the extra with
table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY);
fires bug#27077
todo: explain or fix
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index 01fad3dde37..8acb46b9ef2 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -345,12 +345,12 @@ void my_decimal_trim(ulonglong *precision, uint *scale)
*/
int my_decimal2int(uint mask, const decimal_t *d, bool unsigned_flag,
- longlong *l)
+ longlong *l, decimal_round_mode round_type)
{
int res;
my_decimal rounded;
/* decimal_round can return only E_DEC_TRUNCATED */
- decimal_round(d, &rounded, 0, HALF_UP);
+ decimal_round(d, &rounded, 0, round_type);
res= (unsigned_flag ?
decimal2ulonglong(&rounded, (ulonglong *) l) :
decimal2longlong(&rounded, l));
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index 6d6bb258293..b409a87bdd4 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -348,7 +348,7 @@ my_decimal *seconds2my_decimal(bool sign, ulonglong sec, ulong microsec,
(TIME)->second_part, (DECIMAL))
int my_decimal2int(uint mask, const decimal_t *d, bool unsigned_flag,
- longlong *l);
+ longlong *l, decimal_round_mode round_type= HALF_UP);
inline
int my_decimal2double(uint, const decimal_t *d, double *result)
diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc
index 06bd543f72f..b3683618e6e 100644
--- a/sql/mysql_upgrade_service.cc
+++ b/sql/mysql_upgrade_service.cc
@@ -134,7 +134,7 @@ static void die(const char *fmt, ...)
}
/*
- Stop service that we started, if it was not initally running at
+ Stop service that we started, if it was not initially running at
program start.
*/
if (initial_service_state != UINT_MAX && initial_service_state != SERVICE_RUNNING)
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index fcb3390e0ff..60b87b60be4 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4495,7 +4495,7 @@ static int init_common_variables()
min_connections= 10;
/* MyISAM requires two file handles per table. */
wanted_files= (extra_files + max_connections + extra_max_connections +
- tc_size * 2);
+ tc_size * 2 * tc_instances);
#if defined(HAVE_POOL_OF_THREADS) && !defined(__WIN__)
// add epoll or kevent fd for each threadpool group, in case pool of threads is used
wanted_files+= (thread_handling > SCHEDULER_NO_THREADS) ? 0 : threadpool_size;
@@ -4524,6 +4524,14 @@ static int init_common_variables()
if (files < wanted_files && global_system_variables.log_warnings)
sql_print_warning("Could not increase number of max_open_files to more than %u (request: %u)", files, wanted_files);
+ /* If we required too much tc_instances than we reduce */
+ SYSVAR_AUTOSIZE_IF_CHANGED(tc_instances,
+ (uint32) MY_MIN(MY_MAX((files - extra_files -
+ max_connections)/
+ 2/tc_size,
+ 1),
+ tc_instances),
+ uint32);
/*
If we have requested too much file handles than we bring
max_connections in supported bounds. Still leave at least
@@ -4531,7 +4539,7 @@ static int init_common_variables()
*/
SYSVAR_AUTOSIZE_IF_CHANGED(max_connections,
(ulong) MY_MAX(MY_MIN(files- extra_files-
- min_tc_size*2,
+ min_tc_size*2*tc_instances,
max_connections),
min_connections),
ulong);
@@ -4544,7 +4552,7 @@ static int init_common_variables()
*/
SYSVAR_AUTOSIZE_IF_CHANGED(tc_size,
(ulong) MY_MIN(MY_MAX((files - extra_files -
- max_connections) / 2,
+ max_connections) / 2 / tc_instances,
min_tc_size),
tc_size), ulong);
DBUG_PRINT("warning",
@@ -8907,8 +8915,8 @@ static void usage(void)
"\nbecause execution stopped before plugins were initialized.");
}
- puts("\nTo see what values a running MySQL server is using, type"
- "\n'mysqladmin variables' instead of 'mysqld --verbose --help'.");
+ puts("\nTo see what variables a running MySQL server is using, type"
+ "\n'mysqladmin variables' instead of 'mysqld --verbose --help'.");
}
DBUG_VOID_RETURN;
}
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 11871155355..dc0641502ce 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -189,7 +189,8 @@ enum vers_system_time_t
SYSTEM_TIME_AS_OF,
SYSTEM_TIME_FROM_TO,
SYSTEM_TIME_BETWEEN,
- SYSTEM_TIME_BEFORE,
+ SYSTEM_TIME_BEFORE, // used for DELETE HISTORY ... BEFORE
+ SYSTEM_TIME_HISTORY, // used for DELETE HISTORY
SYSTEM_TIME_ALL
};
diff --git a/sql/opt_index_cond_pushdown.cc b/sql/opt_index_cond_pushdown.cc
index 8f3f9cdac72..af6a75cdef2 100644
--- a/sql/opt_index_cond_pushdown.cc
+++ b/sql/opt_index_cond_pushdown.cc
@@ -393,8 +393,23 @@ void push_index_cond(JOIN_TAB *tab, uint keyno)
~(tab->table->map | tab->join->const_table_map)))
tab->cache_idx_cond= idx_cond;
else
+ {
idx_remainder_cond= tab->table->file->idx_cond_push(keyno, idx_cond);
+ /*
+ If (1) there is an index condition that we couldn't push using ICP,
+ (2) we are using Join Buffering
+ (3) and we are using BKA
+ then use BKA's Index Condition Pushdown mechanism to check it.
+ */
+ if (idx_remainder_cond && tab->use_join_cache && // (1) && (2)
+ tab->icp_other_tables_ok) // (3)
+ {
+ tab->cache_idx_cond= idx_remainder_cond;
+ idx_remainder_cond= NULL;
+ }
+ }
+
/*
Disable eq_ref's "lookup cache" if we've pushed down an index
condition.
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 32e6a767f15..bd5f25d67c2 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -8999,6 +8999,8 @@ and_all_keys(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2,
}
if (key1->type == SEL_ARG::MAYBE_KEY)
{
+ if (key2->type == SEL_ARG::KEY_RANGE)
+ return key2;
key1->right= key1->left= &null_element;
key1->next= key1->prev= 0;
}
diff --git a/sql/opt_split.cc b/sql/opt_split.cc
index cfac0c93544..6f8248c315c 100644
--- a/sql/opt_split.cc
+++ b/sql/opt_split.cc
@@ -307,7 +307,7 @@ struct SplM_field_ext_info: public SplM_field_info
8. P contains some references on the columns of the joined tables C
occurred also in the select list of this join
9. There are defined some keys usable for ref access of fields from C
- with available statistics.
+ with available statistics.
@retval
true if the answer is positive
@@ -477,6 +477,15 @@ bool JOIN::check_for_splittable_materialized()
/* Attach this info to the table T */
derived->table->set_spl_opt_info(spl_opt_info);
+ /*
+ If this is specification of a materialized derived table T that is
+ potentially splittable and is used in the from list of the right operand
+ of an IN predicand transformed to a semi-join then the embedding semi-join
+ nest is not allowed to be materialized.
+ */
+ if (derived && derived->is_materialized_derived() &&
+ derived->embedding && derived->embedding->sj_subq_pred)
+ derived->embedding->sj_subq_pred->types_allow_materialization= FALSE;
return true;
}
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index a8afd952a4d..50f7efd6d65 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -829,7 +829,12 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs)
in_subs->types_allow_materialization= FALSE; // Assign default values
in_subs->sjm_scan_allowed= FALSE;
-
+
+ /*
+ The checks here must be kept in sync with the one in
+ Item_func_in::in_predicate_to_in_subs_transformer().
+ */
+
bool all_are_fields= TRUE;
uint32 total_key_length = 0;
for (uint i= 0; i < elements; i++)
@@ -4399,7 +4404,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd)
field->reset();
/*
Test if there is a default field value. The test for ->ptr is to skip
- 'offset' fields generated by initalize_tables
+ 'offset' fields generated by initialize_tables
*/
// Initialize the table field:
bzero(field->ptr, field->pack_length());
diff --git a/sql/proxy_protocol.cc b/sql/proxy_protocol.cc
index b54af619487..550813c6457 100644
--- a/sql/proxy_protocol.cc
+++ b/sql/proxy_protocol.cc
@@ -470,7 +470,7 @@ static int compare_bits(const void *s1, const void *s2, int bit_count)
int byte_count= bit_count / 8;
if (byte_count && (result= memcmp(s1, s2, byte_count)))
return result;
- int rem= byte_count % 8;
+ int rem= bit_count % 8;
if (rem)
{
// compare remaining bits i.e partial bytes.
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 3542933318a..87bb995ba9a 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -1173,7 +1173,7 @@ bool Master_info_index::init_all_master_info()
}
else
{
- /* Initialization of Master_info succeded. Add it to HASH */
+ /* Initialization of Master_info succeeded. Add it to HASH */
if (global_system_variables.log_warnings > 1)
sql_print_information("Initialized Master_info from '%s'",
buf_master_info_file);
diff --git a/sql/session_tracker.cc b/sql/session_tracker.cc
index 778b65889a0..45d7db91fb4 100644
--- a/sql/session_tracker.cc
+++ b/sql/session_tracker.cc
@@ -810,7 +810,7 @@ bool Transaction_state_tracker::store(THD *thd, String *buf)
statement even for a transaction that isn't the first in an
ongoing chain. Consider
- SET TRANSACTION ISOLATION LEVEL READ UNCOMMITED;
+ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
START TRANSACTION READ ONLY, WITH CONSISTENT SNAPSHOT;
# work
COMMIT AND CHAIN;
@@ -818,7 +818,7 @@ bool Transaction_state_tracker::store(THD *thd, String *buf)
If we switch away at this point, the replay in the new session
needs to be
- SET TRANSACTION ISOLATION LEVEL READ UNCOMMITED;
+ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
START TRANSACTION READ ONLY;
When a transaction ends (COMMIT/ROLLBACK sans CHAIN), all
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 07b6df38c86..e3c1accc058 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -7455,7 +7455,7 @@ ER_GIS_UNSUPPORTED_ARGUMENT
eng "Calling geometry function %s with unsupported types of arguments."
ER_GIS_UNKNOWN_ERROR
- eng "Unknown GIS error occured in function %s."
+ eng "Unknown GIS error occurred in function %s."
ER_GIS_UNKNOWN_EXCEPTION
eng "Unknown exception caught in GIS function %s."
@@ -7869,7 +7869,7 @@ ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION
eng "Can not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIME"
ER_VERS_DB_NOT_SUPPORTED
- eng "System versioning tables in the %`s database are not suported"
+ eng "System versioning tables in the %`s database are not supported"
ER_VERS_TRT_IS_DISABLED
eng "Transaction registry is disabled"
diff --git a/sql/slave.cc b/sql/slave.cc
index 7d0ce253976..709834df06c 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -481,6 +481,9 @@ handle_slave_background(void *arg __attribute__((unused)))
thd->store_globals();
thd->security_ctx->skip_grants();
thd->set_command(COM_DAEMON);
+#ifdef WITH_WSREP
+ thd->variables.wsrep_on= 0;
+#endif
thd_proc_info(thd, "Loading slave GTID position from table");
if (rpl_load_gtid_slave_state(thd))
@@ -3911,14 +3914,34 @@ apply_event_and_update_pos_apply(Log_event* ev, THD* thd, rpl_group_info *rgi,
exec_res= ev->apply_event(rgi);
#ifdef WITH_WSREP
- if (exec_res && thd->wsrep_conflict_state != NO_CONFLICT)
- {
+ if (exec_res)
+ {
+ switch (thd->wsrep_conflict_state) {
+ case NO_CONFLICT: break;
+ case MUST_REPLAY:
+ WSREP_DEBUG("SQL apply failed for MUST_REPLAY, res %d", exec_res);
+ mysql_mutex_lock(&thd->LOCK_thd_data);
+ wsrep_replay_transaction(thd);
+ switch (thd->wsrep_conflict_state) {
+ case NO_CONFLICT:
+ exec_res = 0; /* replaying succeeded, and slave may continue */
+ break;
+ case ABORTED: break; /* replaying has failed, trx is rolled back */
+ default:
+ WSREP_WARN("unexpected result of slave transaction replaying: %lld, %d",
+ thd->thread_id, thd->wsrep_conflict_state);
+ }
+ mysql_mutex_unlock(&thd->LOCK_thd_data);
+ break;
+ default:
WSREP_DEBUG("SQL apply failed, res %d conflict state: %d",
exec_res, thd->wsrep_conflict_state);
rli->abort_slave= 1;
rli->report(ERROR_LEVEL, ER_UNKNOWN_COM_ERROR, rgi->gtid_info(),
"Node has dropped from cluster");
+ break;
}
+ }
#endif
#ifndef DBUG_OFF
@@ -4656,6 +4679,9 @@ pthread_handler_t handle_slave_io(void *arg)
}
+#ifdef WITH_WSREP
+ thd->variables.wsrep_on= 0;
+#endif
if (DBUG_EVALUATE_IF("failed_slave_start", 1, 0)
|| repl_semisync_slave.slave_start(mi))
{
@@ -6459,7 +6485,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
error= ER_SLAVE_HEARTBEAT_FAILURE;
error_msg.append(STRING_WITH_LEN("inconsistent heartbeat event content;"));
error_msg.append(STRING_WITH_LEN("the event's data: log_file_name "));
- error_msg.append(hb.get_log_ident(), (uint) strlen(hb.get_log_ident()));
+ error_msg.append(hb.get_log_ident(), (uint) hb.get_ident_len());
error_msg.append(STRING_WITH_LEN(" log_pos "));
error_msg.append_ulonglong(hb.log_pos);
goto err;
@@ -6485,7 +6511,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
error= ER_SLAVE_HEARTBEAT_FAILURE;
error_msg.append(STRING_WITH_LEN("heartbeat is not compatible with local info;"));
error_msg.append(STRING_WITH_LEN("the event's data: log_file_name "));
- error_msg.append(hb.get_log_ident(), (uint) strlen(hb.get_log_ident()));
+ error_msg.append(hb.get_log_ident(), (uint) hb.get_ident_len());
error_msg.append(STRING_WITH_LEN(" log_pos "));
error_msg.append_ulonglong(hb.log_pos);
goto err;
@@ -7844,7 +7870,39 @@ err:
sql_print_error("Error reading relay log event: %s", errmsg);
DBUG_RETURN(0);
}
+#ifdef WITH_WSREP
+enum Log_event_type wsrep_peak_event(rpl_group_info *rgi, ulonglong* event_size)
+{
+ enum Log_event_type ev_type;
+
+ mysql_mutex_lock(&rgi->rli->data_lock);
+
+ unsigned long long event_pos= rgi->event_relay_log_pos;
+ unsigned long long orig_future_pos= rgi->future_event_relay_log_pos;
+ unsigned long long future_pos= rgi->future_event_relay_log_pos;
+
+ /* scan the log to read next event and we skip
+ annotate events. */
+ do {
+ my_b_seek(rgi->rli->cur_log, future_pos);
+ rgi->rli->event_relay_log_pos= future_pos;
+ rgi->event_relay_log_pos= future_pos;
+ Log_event* ev= next_event(rgi, event_size);
+ ev_type= (ev) ? ev->get_type_code() : UNKNOWN_EVENT;
+ delete ev;
+ future_pos+= *event_size;
+ } while (ev_type == ANNOTATE_ROWS_EVENT);
+ /* scan the log back and re-set the positions to original values */
+ rgi->rli->event_relay_log_pos= event_pos;
+ rgi->event_relay_log_pos= event_pos;
+ my_b_seek(rgi->rli->cur_log, orig_future_pos);
+
+ mysql_mutex_unlock(&rgi->rli->data_lock);
+
+ return ev_type;
+}
+#endif /* WITH_WSREP */
/*
Rotate a relay log (this is used only by FLUSH LOGS; the automatic rotation
because of size is simpler because when we do it we already have all relevant
diff --git a/sql/sp.cc b/sql/sp.cc
index 5661c6910cb..5e162e5dfec 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -854,7 +854,7 @@ static sp_head *sp_compile(THD *thd, String *defstr, sql_mode_t sql_mode,
if (parse_sql(thd, & parser_state, creation_ctx) || thd->lex == NULL)
{
sp= thd->lex->sphead;
- delete sp;
+ sp_head::destroy(sp);
sp= 0;
}
else
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index 99e68cd2595..e4ffbdcb155 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -283,7 +283,7 @@ uchar *hash_get_key_for_sp_head(const uchar *ptr, size_t *plen,
void hash_free_sp_head(void *p)
{
sp_head *sp= (sp_head *)p;
- delete sp;
+ sp_head::destroy(sp);
}
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 48166fac4c6..ba130881d68 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -473,48 +473,46 @@ check_routine_name(const LEX_CSTRING *ident)
* sp_head
*
*/
-
-void *
-sp_head::operator new(size_t size) throw()
+
+sp_head *sp_head::create(sp_package *parent, const Sp_handler *handler)
{
- DBUG_ENTER("sp_head::operator new");
MEM_ROOT own_root;
+ init_sql_alloc(&own_root, "sp_head", MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC,
+ MYF(0));
sp_head *sp;
+ if (!(sp= new (&own_root) sp_head(&own_root, parent, handler)))
+ free_root(&own_root, MYF(0));
- init_sql_alloc(&own_root, "sp_head",
- MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC, MYF(0));
- sp= (sp_head *) alloc_root(&own_root, size);
- if (sp == NULL)
- DBUG_RETURN(NULL);
- sp->main_mem_root= own_root;
- DBUG_PRINT("info", ("mem_root %p", &sp->mem_root));
- DBUG_RETURN(sp);
+ return sp;
}
-void
-sp_head::operator delete(void *ptr, size_t size) throw()
-{
- DBUG_ENTER("sp_head::operator delete");
- MEM_ROOT own_root;
-
- if (ptr == NULL)
- DBUG_VOID_RETURN;
-
- sp_head *sp= (sp_head *) ptr;
- /* Make a copy of main_mem_root as free_root will free the sp */
- own_root= sp->main_mem_root;
- DBUG_PRINT("info", ("mem_root %p moved to %p",
- &sp->mem_root, &own_root));
- free_root(&own_root, MYF(0));
-
- DBUG_VOID_RETURN;
+void sp_head::destroy(sp_head *sp)
+{
+ if (sp)
+ {
+ /* Make a copy of main_mem_root as free_root will free the sp */
+ MEM_ROOT own_root= sp->main_mem_root;
+ DBUG_PRINT("info", ("mem_root %p moved to %p",
+ &sp->mem_root, &own_root));
+ delete sp;
+
+
+ free_root(&own_root, MYF(0));
+ }
}
+/*
+ *
+ * sp_head
+ *
+ */
-sp_head::sp_head(sp_package *parent, const Sp_handler *sph)
- :Query_arena(&main_mem_root, STMT_INITIALIZED_FOR_SP),
+sp_head::sp_head(MEM_ROOT *mem_root_arg, sp_package *parent,
+ const Sp_handler *sph)
+ :Query_arena(NULL, STMT_INITIALIZED_FOR_SP),
Database_qualified_name(&null_clex_str, &null_clex_str),
+ main_mem_root(*mem_root_arg),
m_parent(parent),
m_handler(sph),
m_flags(0),
@@ -545,6 +543,8 @@ sp_head::sp_head(sp_package *parent, const Sp_handler *sph)
m_pcont(new (&main_mem_root) sp_pcontext()),
m_cont_level(0)
{
+ mem_root= &main_mem_root;
+
m_first_instance= this;
m_first_free_instance= this;
m_last_cached_sp= this;
@@ -567,10 +567,25 @@ sp_head::sp_head(sp_package *parent, const Sp_handler *sph)
}
-sp_package::sp_package(LEX *top_level_lex,
+sp_package *sp_package::create(LEX *top_level_lex, const sp_name *name,
+ const Sp_handler *sph)
+{
+ MEM_ROOT own_root;
+ init_sql_alloc(&own_root, "sp_package", MEM_ROOT_BLOCK_SIZE,
+ MEM_ROOT_PREALLOC, MYF(0));
+ sp_package *sp;
+ if (!(sp= new (&own_root) sp_package(&own_root, top_level_lex, name, sph)))
+ free_root(&own_root, MYF(0));
+
+ return sp;
+}
+
+
+sp_package::sp_package(MEM_ROOT *mem_root_arg,
+ LEX *top_level_lex,
const sp_name *name,
const Sp_handler *sph)
- :sp_head(NULL, sph),
+ :sp_head(mem_root_arg, NULL, sph),
m_current_routine(NULL),
m_top_level_lex(top_level_lex),
m_rcontext(NULL),
@@ -588,7 +603,7 @@ sp_package::~sp_package()
m_routine_declarations.cleanup();
m_body= null_clex_str;
if (m_current_routine)
- delete m_current_routine->sphead;
+ sp_head::destroy(m_current_routine->sphead);
delete m_rcontext;
}
@@ -845,7 +860,7 @@ sp_head::~sp_head()
my_hash_free(&m_sptabs);
my_hash_free(&m_sroutines);
- delete m_next_cached_sp;
+ sp_head::destroy(m_next_cached_sp);
DBUG_VOID_RETURN;
}
@@ -2571,7 +2586,7 @@ sp_head::backpatch_goto(THD *thd, sp_label *lab,sp_label *lab_begin_block)
}
if (bp->instr_type == CPOP)
{
- uint n= lab->ctx->diff_cursors(lab_begin_block->ctx, true);
+ uint n= bp->instr->m_ctx->diff_cursors(lab_begin_block->ctx, true);
if (n == 0)
{
// Remove cpop instr
@@ -2588,7 +2603,7 @@ sp_head::backpatch_goto(THD *thd, sp_label *lab,sp_label *lab_begin_block)
}
if (bp->instr_type == HPOP)
{
- uint n= lab->ctx->diff_handlers(lab_begin_block->ctx, true);
+ uint n= bp->instr->m_ctx->diff_handlers(lab_begin_block->ctx, true);
if (n == 0)
{
// Remove hpop instr
@@ -3082,6 +3097,8 @@ void sp_head::optimize()
sp_instr *i;
uint src, dst;
+ DBUG_EXECUTE_IF("sp_head_optimize_disable", return; );
+
opt_mark();
bp.empty();
@@ -3379,11 +3396,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
Update the state of the active arena if no errors on
open_tables stage.
*/
- if (likely(!res) || likely(!thd->is_error()) ||
- (thd->get_stmt_da()->sql_errno() != ER_CANT_REOPEN_TABLE &&
- thd->get_stmt_da()->sql_errno() != ER_NO_SUCH_TABLE &&
- thd->get_stmt_da()->sql_errno() != ER_NO_SUCH_TABLE_IN_ENGINE &&
- thd->get_stmt_da()->sql_errno() != ER_UPDATE_TABLE_USED))
+ if (likely(!res) || likely(!thd->is_error()))
thd->stmt_arena->state= Query_arena::STMT_EXECUTED;
/*
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 75c95d6705d..493bb777bdf 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -127,7 +127,8 @@ bool
check_routine_name(const LEX_CSTRING *ident);
class sp_head :private Query_arena,
- public Database_qualified_name
+ public Database_qualified_name,
+ public Sql_alloc
{
sp_head(const sp_head &); /**< Prevent use of these */
void operator=(sp_head &);
@@ -316,13 +317,12 @@ public:
*/
SQL_I_List<Item_trigger_field> m_trg_table_fields;
- static void *
- operator new(size_t size) throw ();
-
- static void
- operator delete(void *ptr, size_t size) throw ();
-
- sp_head(sp_package *parent, const Sp_handler *handler);
+protected:
+ sp_head(MEM_ROOT *mem_root, sp_package *parent, const Sp_handler *handler);
+ virtual ~sp_head();
+public:
+ static void destroy(sp_head *sp);
+ static sp_head *create(sp_package *parent, const Sp_handler *handler);
/// Initialize after we have reset mem_root
void
@@ -340,7 +340,6 @@ public:
void
set_stmt_end(THD *thd);
- virtual ~sp_head();
bool
execute_trigger(THD *thd,
@@ -964,10 +963,16 @@ public:
bool m_is_instantiated;
bool m_is_cloning_routine;
- sp_package(LEX *top_level_lex,
+private:
+ sp_package(MEM_ROOT *mem_root,
+ LEX *top_level_lex,
const sp_name *name,
const Sp_handler *sph);
~sp_package();
+public:
+ static sp_package *create(LEX *top_level_lex, const sp_name *name,
+ const Sp_handler *sph);
+
bool add_routine_declaration(LEX *lex)
{
return m_routine_declarations.check_dup_qualified(lex->sphead) ||
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index c92dc3f9f71..e29fd0345da 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -8361,13 +8361,12 @@ static void add_user_option(String *grant, double value, const char *name)
}
}
-static void add_user_parameters(String *result, ACL_USER* acl_user,
+static void add_user_parameters(THD *thd, String *result, ACL_USER* acl_user,
bool with_grant)
{
- result->append(STRING_WITH_LEN("@'"));
- result->append(acl_user->host.hostname, acl_user->hostname_length,
- system_charset_info);
- result->append('\'');
+ result->append('@');
+ append_identifier(thd, result, acl_user->host.hostname,
+ acl_user->hostname_length);
if (acl_user->plugin.str == native_password_plugin_name.str ||
acl_user->plugin.str == old_password_plugin_name.str)
@@ -8548,11 +8547,9 @@ bool mysql_show_create_user(THD *thd, LEX_USER *lex_user)
goto end;
}
- result.append("CREATE USER '");
- result.append(username);
- result.append('\'');
-
- add_user_parameters(&result, acl_user, false);
+ result.append("CREATE USER ");
+ append_identifier(thd, &result, username, strlen(username));
+ add_user_parameters(thd, &result, acl_user, false);
protocol->prepare_for_resend();
protocol->store(result.ptr(), result.length(), result.charset());
@@ -8797,17 +8794,14 @@ static bool show_role_grants(THD *thd, const char *username,
grant.append(STRING_WITH_LEN("GRANT "));
ACL_ROLE *acl_role= *(dynamic_element(&acl_entry->role_grants, counter,
ACL_ROLE**));
- grant.append(acl_role->user.str, acl_role->user.length,
- system_charset_info);
- grant.append(STRING_WITH_LEN(" TO '"));
- grant.append(acl_entry->user.str, acl_entry->user.length,
- system_charset_info);
+ append_identifier(thd, &grant, acl_role->user.str, acl_role->user.length);
+ grant.append(STRING_WITH_LEN(" TO "));
+ append_identifier(thd, &grant, acl_entry->user.str, acl_entry->user.length);
if (!(acl_entry->flags & IS_ROLE))
{
- grant.append(STRING_WITH_LEN("'@'"));
- grant.append(&host);
+ grant.append('@');
+ append_identifier(thd, &grant, host.str, host.length);
}
- grant.append('\'');
ROLE_GRANT_PAIR *pair=
find_role_grant_pair(&acl_entry->user, &host, &acl_role->user);
@@ -8861,13 +8855,12 @@ static bool show_global_privileges(THD *thd, ACL_USER_BASE *acl_entry,
}
}
}
- global.append (STRING_WITH_LEN(" ON *.* TO '"));
- global.append(acl_entry->user.str, acl_entry->user.length,
- system_charset_info);
- global.append('\'');
+ global.append (STRING_WITH_LEN(" ON *.* TO "));
+ append_identifier(thd, &global, acl_entry->user.str, acl_entry->user.length);
if (!handle_as_role)
- add_user_parameters(&global, (ACL_USER *)acl_entry, (want_access & GRANT_ACL));
+ add_user_parameters(thd, &global, (ACL_USER *)acl_entry,
+ (want_access & GRANT_ACL));
protocol->prepare_for_resend();
protocol->store(global.ptr(),global.length(),global.charset());
@@ -8878,6 +8871,21 @@ static bool show_global_privileges(THD *thd, ACL_USER_BASE *acl_entry,
}
+
+static void add_to_user(THD *thd, String *result, const char *user,
+ bool is_user, const char *host)
+{
+ result->append(STRING_WITH_LEN(" TO "));
+ append_identifier(thd, result, user, strlen(user));
+ if (is_user)
+ {
+ result->append('@');
+ // host and lex_user->host are equal except for case
+ append_identifier(thd, result, host, strlen(host));
+ }
+}
+
+
static bool show_database_privileges(THD *thd, const char *username,
const char *hostname,
char *buff, size_t buffsize)
@@ -8938,16 +8946,8 @@ static bool show_database_privileges(THD *thd, const char *username,
}
db.append (STRING_WITH_LEN(" ON "));
append_identifier(thd, &db, acl_db->db, strlen(acl_db->db));
- db.append (STRING_WITH_LEN(".* TO '"));
- db.append(username, strlen(username),
- system_charset_info);
- if (*hostname)
- {
- db.append (STRING_WITH_LEN("'@'"));
- // host and lex_user->host are equal except for case
- db.append(host, strlen(host), system_charset_info);
- }
- db.append ('\'');
+ db.append (STRING_WITH_LEN(".*"));
+ add_to_user(thd, &db, username, (*hostname), host);
if (want_access & GRANT_ACL)
db.append(STRING_WITH_LEN(" WITH GRANT OPTION"));
protocol->prepare_for_resend();
@@ -9078,16 +9078,7 @@ static bool show_table_and_column_privileges(THD *thd, const char *username,
global.append('.');
append_identifier(thd, &global, grant_table->tname,
strlen(grant_table->tname));
- global.append(STRING_WITH_LEN(" TO '"));
- global.append(username, strlen(username),
- system_charset_info);
- if (*hostname)
- {
- global.append(STRING_WITH_LEN("'@'"));
- // host and lex_user->host are equal except for case
- global.append(host, strlen(host), system_charset_info);
- }
- global.append('\'');
+ add_to_user(thd, &global, username, (*hostname), host);
if (table_access & GRANT_ACL)
global.append(STRING_WITH_LEN(" WITH GRANT OPTION"));
protocol->prepare_for_resend();
@@ -9173,16 +9164,7 @@ static int show_routine_grants(THD* thd,
global.append('.');
append_identifier(thd, &global, grant_proc->tname,
strlen(grant_proc->tname));
- global.append(STRING_WITH_LEN(" TO '"));
- global.append(username, strlen(username),
- system_charset_info);
- if (*hostname)
- {
- global.append(STRING_WITH_LEN("'@'"));
- // host and lex_user->host are equal except for case
- global.append(host, strlen(host), system_charset_info);
- }
- global.append('\'');
+ add_to_user(thd, &global, username, (*hostname), host);
if (proc_access & GRANT_ACL)
global.append(STRING_WITH_LEN(" WITH GRANT OPTION"));
protocol->prepare_for_resend();
@@ -12253,6 +12235,7 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio,
int2store(end+5, thd->client_capabilities >> 16);
end[7]= data_len;
DBUG_EXECUTE_IF("poison_srv_handshake_scramble_len", end[7]= -100;);
+ DBUG_EXECUTE_IF("increase_srv_handshake_scramble_len", end[7]= 50;);
bzero(end + 8, 6);
int4store(end + 14, thd->client_capabilities >> 32);
end+= 18;
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index dde194053b9..92e88a74217 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -175,7 +175,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
/*
Check if this is a table type that stores index and data separately,
like ISAM or MyISAM. We assume fixed order of engine file name
- extentions array. First element of engine file name extentions array
+ extensions array. First element of engine file name extensions array
is meta/index file extention. Second element - data file extention.
*/
ext= table->file->bas_ext();
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index 59cced13b0a..97317203e34 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -284,7 +284,9 @@ void mysql_audit_notify_connection_change_user(THD *thd)
}
static inline
-void mysql_audit_external_lock(THD *thd, TABLE_SHARE *share, int lock)
+void mysql_audit_external_lock_ex(THD *thd, my_thread_id thread_id,
+ const char *user, const char *host, const char *ip, query_id_t query_id,
+ TABLE_SHARE *share, int lock)
{
if (lock != F_UNLCK && mysql_audit_table_enabled())
{
@@ -293,25 +295,33 @@ void mysql_audit_external_lock(THD *thd, TABLE_SHARE *share, int lock)
event.event_subclass= MYSQL_AUDIT_TABLE_LOCK;
event.read_only= lock == F_RDLCK;
- event.thread_id= (unsigned long)thd->thread_id;
- event.user= sctx->user;
+ event.thread_id= (unsigned long)thread_id;
+ event.user= user;
event.priv_user= sctx->priv_user;
event.priv_host= sctx->priv_host;
event.external_user= sctx->external_user;
event.proxy_user= sctx->proxy_user;
- event.host= sctx->host;
- event.ip= sctx->ip;
+ event.host= host;
+ event.ip= ip;
event.database= share->db;
event.table= share->table_name;
event.new_database= null_clex_str;
event.new_table= null_clex_str;
- event.query_id= thd->query_id;
+ event.query_id= query_id;
mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, &event);
}
}
static inline
+void mysql_audit_external_lock(THD *thd, TABLE_SHARE *share, int lock)
+{
+ mysql_audit_external_lock_ex(thd, thd->thread_id, thd->security_ctx->user,
+ thd->security_ctx->host, thd->security_ctx->ip, thd->query_id,
+ share, lock);
+}
+
+static inline
void mysql_audit_create_table(TABLE *table)
{
if (mysql_audit_table_enabled())
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 604d6da6606..7b1ca52239c 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -50,7 +50,7 @@
#define MAX_DROP_TABLE_Q_LEN 1024
const char *del_exts[]= {".BAK", ".opt", NullS};
-static TYPELIB deletable_extentions=
+static TYPELIB deletable_extensions=
{array_elements(del_exts)-1,"del_exts", del_exts, NULL};
static bool find_db_tables_and_rm_known_files(THD *, MY_DIR *, const char *,
@@ -1140,7 +1140,7 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp,
}
if (!(extension= strrchr(file->name, '.')))
extension= strend(file->name);
- if (find_type(extension, &deletable_extentions, FIND_TYPE_NO_PREFIX) > 0)
+ if (find_type(extension, &deletable_extensions, FIND_TYPE_NO_PREFIX) > 0)
{
strxmov(filePath, path, "/", file->name, NullS);
/*
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index e3d17174b8b..929455977e6 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -225,19 +225,11 @@ bool Update_plan::save_explain_data_intern(MEM_ROOT *mem_root,
static bool record_should_be_deleted(THD *thd, TABLE *table, SQL_SELECT *sel,
Explain_delete *explain, bool truncate_history)
{
- bool check_delete= true;
-
- if (table->versioned())
- {
- bool historical= !table->vers_end_field()->is_max();
- check_delete= truncate_history ? historical : !historical;
- }
-
explain->tracker.on_record_read();
thd->inc_examined_row_count(1);
if (table->vfield)
(void) table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_DELETE);
- if (check_delete && (!sel || sel->skip_record(thd) > 0))
+ if (!sel || sel->skip_record(thd) > 0)
{
explain->tracker.on_record_after_where();
return true;
@@ -305,29 +297,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
THD_STAGE_INFO(thd, stage_init_update);
- bool delete_history= table_list->vers_conditions.is_set();
- if (delete_history)
- {
- if (table_list->is_view_or_derived())
- {
- my_error(ER_IT_IS_A_VIEW, MYF(0), table_list->table_name.str);
- DBUG_RETURN(true);
- }
-
- DBUG_ASSERT(table_list->table);
-
- DBUG_ASSERT(!conds || thd->stmt_arena->is_stmt_execute());
-
- // conds could be cached from previous SP call
- if (!conds)
- {
- if (select_lex->vers_setup_conds(thd, table_list))
- DBUG_RETURN(TRUE);
-
- conds= table_list->on_expr;
- table_list->on_expr= NULL;
- }
- }
+ const bool delete_history= table_list->vers_conditions.delete_history;
if (thd->lex->handle_list_of_derived(table_list, DT_MERGE_FOR_INSERT))
DBUG_RETURN(TRUE);
@@ -940,16 +910,22 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list,
select_lex->leaf_tables, FALSE,
DELETE_ACL, SELECT_ACL, TRUE))
DBUG_RETURN(TRUE);
- if (table_list->vers_conditions.is_set())
+
+ if (table_list->vers_conditions.is_set() && table_list->is_view_or_derived())
{
- if (table_list->is_view())
- {
- my_error(ER_IT_IS_A_VIEW, MYF(0), table_list->table_name.str);
- DBUG_RETURN(true);
- }
- if (select_lex->vers_setup_conds(thd, table_list))
- DBUG_RETURN(true);
+ my_error(ER_IT_IS_A_VIEW, MYF(0), table_list->table_name.str);
+ DBUG_RETURN(true);
}
+
+ DBUG_ASSERT(table_list->table);
+ // conds could be cached from previous SP call
+ DBUG_ASSERT(!table_list->vers_conditions.need_setup() ||
+ !*conds || thd->stmt_arena->is_stmt_execute());
+ if (select_lex->vers_setup_conds(thd, table_list))
+ DBUG_RETURN(TRUE);
+
+ *conds= select_lex->where;
+
if ((wild_num && setup_wild(thd, table_list, field_list, NULL, wild_num,
&select_lex->hidden_bit_fields)) ||
setup_fields(thd, Ref_ptr_array(),
@@ -1238,11 +1214,6 @@ int multi_delete::send_data(List<Item> &values)
if (table->status & (STATUS_NULL_ROW | STATUS_DELETED))
continue;
- if (table->versioned() && !table->vers_end_field()->is_max())
- {
- continue;
- }
-
table->file->position(table->record[0]);
found++;
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 44ea6a18663..1f465a100c9 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -689,7 +689,39 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
!(derived->is_multitable() &&
(thd->lex->sql_command == SQLCOM_UPDATE_MULTI ||
thd->lex->sql_command == SQLCOM_DELETE_MULTI))))
+ {
+ /*
+ System versioned tables may still require to get versioning conditions
+ when modifying view (see vers_setup_conds()). Only UPDATE and DELETE are
+ affected because they use WHERE condition.
+ */
+ if (!unit->prepared &&
+ derived->table->versioned() &&
+ derived->merge_underlying_list &&
+ /* choose only those merged views that do not select from other views */
+ !derived->merge_underlying_list->merge_underlying_list)
+ {
+ switch (thd->lex->sql_command)
+ {
+ case SQLCOM_DELETE:
+ case SQLCOM_DELETE_MULTI:
+ case SQLCOM_UPDATE:
+ case SQLCOM_UPDATE_MULTI:
+ if ((res= first_select->vers_setup_conds(thd,
+ derived->merge_underlying_list)))
+ goto exit;
+ if (derived->merge_underlying_list->where)
+ {
+ Query_arena_stmt on_stmt_arena(thd);
+ derived->where= and_items(thd, derived->where,
+ derived->merge_underlying_list->where);
+ }
+ default:
+ break;
+ }
+ }
DBUG_RETURN(FALSE);
+ }
/* prevent name resolving out of derived table */
for (SELECT_LEX *sl= first_select; sl; sl= sl->next_select())
@@ -807,7 +839,7 @@ exit:
{
if (!derived->is_with_table_recursive_reference())
{
- if (derived->table)
+ if (derived->table && derived->table->s->tmp_table)
free_tmp_table(thd, derived->table);
delete derived->derived_result;
}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 334b6b2d667..bbd639b91d3 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1646,6 +1646,8 @@ static int last_uniq_key(TABLE *table,uint keynr)
int vers_insert_history_row(TABLE *table)
{
DBUG_ASSERT(table->versioned(VERS_TIMESTAMP));
+ if (!table->vers_write)
+ return 0;
restore_record(table,record[1]);
// Set Sys_end to now()
@@ -2113,11 +2115,15 @@ public:
ulong auto_increment_offset;
LEX_STRING query;
Time_zone *time_zone;
+ char *user, *host, *ip;
+ query_id_t query_id;
+ my_thread_id thread_id;
delayed_row(LEX_STRING const query_arg, enum_duplicates dup_arg,
bool ignore_arg, bool log_query_arg)
: record(0), dup(dup_arg), ignore(ignore_arg), log_query(log_query_arg),
- forced_insert_id(0), query(query_arg), time_zone(0)
+ forced_insert_id(0), query(query_arg), time_zone(0),
+ user(0), host(0), ip(0)
{}
~delayed_row()
{
@@ -2165,7 +2171,6 @@ public:
passed from connection thread to the handler thread.
*/
MDL_request grl_protection;
-
Delayed_insert(SELECT_LEX *current_select)
:locks_in_memory(0), thd(next_thread_id()),
table(0),tables_in_use(0), stacked_inserts(0),
@@ -2174,6 +2179,8 @@ public:
DBUG_ENTER("Delayed_insert constructor");
thd.security_ctx->user=(char*) delayed_user;
thd.security_ctx->host=(char*) my_localhost;
+ thd.security_ctx->ip= NULL;
+ thd.query_id= 0;
strmake_buf(thd.security_ctx->priv_user, thd.security_ctx->user);
thd.current_tablenr=0;
thd.set_command(COM_DELAYED_INSERT);
@@ -2680,6 +2687,7 @@ int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic,
delayed_row *row= 0;
Delayed_insert *di=thd->di;
const Discrete_interval *forced_auto_inc;
+ size_t user_len, host_len, ip_len;
DBUG_ENTER("write_delayed");
DBUG_PRINT("enter", ("query = '%s' length %lu", query.str,
(ulong) query.length));
@@ -2713,11 +2721,45 @@ int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic,
goto err;
}
+ user_len= host_len= ip_len= 0;
+ row->user= row->host= row->ip= NULL;
+ if (thd->security_ctx)
+ {
+ if (thd->security_ctx->user)
+ user_len= strlen(thd->security_ctx->user) + 1;
+ if (thd->security_ctx->host)
+ host_len= strlen(thd->security_ctx->host) + 1;
+ if (thd->security_ctx->ip)
+ ip_len= strlen(thd->security_ctx->ip) + 1;
+ }
/* This can't be THREAD_SPECIFIC as it's freed in delayed thread */
- if (!(row->record= (char*) my_malloc(table->s->reclength,
+ if (!(row->record= (char*) my_malloc(table->s->reclength +
+ user_len + host_len + ip_len,
MYF(MY_WME))))
goto err;
memcpy(row->record, table->record[0], table->s->reclength);
+
+ if (thd->security_ctx)
+ {
+ if (thd->security_ctx->user)
+ {
+ row->user= row->record + table->s->reclength;
+ memcpy(row->user, thd->security_ctx->user, user_len);
+ }
+ if (thd->security_ctx->host)
+ {
+ row->host= row->record + table->s->reclength + user_len;
+ memcpy(row->host, thd->security_ctx->host, host_len);
+ }
+ if (thd->security_ctx->ip)
+ {
+ row->ip= row->record + table->s->reclength + user_len + host_len;
+ memcpy(row->ip, thd->security_ctx->ip, ip_len);
+ }
+ }
+ row->query_id= thd->query_id;
+ row->thread_id= thd->thread_id;
+
row->start_time= thd->start_time;
row->start_time_sec_part= thd->start_time_sec_part;
row->query_start_sec_part_used= thd->query_start_sec_part_used;
@@ -3135,6 +3177,20 @@ pthread_handler_t handle_delayed_insert(void *arg)
}
if (di->stacked_inserts)
{
+ delayed_row *row;
+ I_List_iterator<delayed_row> it(di->rows);
+ my_thread_id cur_thd= di->thd.thread_id;
+
+ while ((row= it++))
+ {
+ if (cur_thd != row->thread_id)
+ {
+ mysql_audit_external_lock_ex(&di->thd, row->thread_id,
+ row->user, row->host, row->ip, row->query_id,
+ di->table->s, F_WRLCK);
+ cur_thd= row->thread_id;
+ }
+ }
if (di->handle_inserts())
{
/* Some fatal error */
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index 3b051259ad6..3a509b3d750 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -2141,7 +2141,7 @@ enum_nested_loop_state JOIN_CACHE::join_records(bool skip_last)
DBUG_ASSERT(!is_key_access());
/*
Restore the last record from the join buffer to generate
- all extentions for it.
+ all extensions for it.
*/
get_record();
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 3e5411c3428..58c91ab21e7 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -203,6 +203,7 @@ init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex)
table->map= 1; //To ensure correct calculation of const item
table_list->table= table;
table_list->cacheable_table= false;
+ lex->create_last_non_select_table= table_list;
return FALSE;
}
@@ -793,7 +794,7 @@ void lex_end_stage1(LEX *lex)
}
else
{
- delete lex->sphead;
+ sp_head::destroy(lex->sphead);
lex->sphead= NULL;
}
@@ -3049,13 +3050,13 @@ void LEX::cleanup_lex_after_parse_error(THD *thd)
DBUG_ASSERT(pkg == pkg->m_top_level_lex->sphead);
pkg->restore_thd_mem_root(thd);
LEX *top= pkg->m_top_level_lex;
- delete pkg;
+ sp_package::destroy(pkg);
thd->lex= top;
thd->lex->sphead= NULL;
}
else
{
- delete thd->lex->sphead;
+ sp_head::destroy(thd->lex->sphead);
thd->lex->sphead= NULL;
}
}
@@ -4480,7 +4481,7 @@ void SELECT_LEX::update_used_tables()
}
Item *item;
- List_iterator_fast<Item> it(join->fields_list);
+ List_iterator_fast<Item> it(join->all_fields);
select_list_tables= 0;
while ((item= it++))
{
@@ -6190,7 +6191,7 @@ sp_head *LEX::make_sp_head(THD *thd, const sp_name *name,
sp_head *sp;
/* Order is important here: new - reset - init */
- if (likely((sp= new sp_head(package, sph))))
+ if (likely((sp= sp_head::create(package, sph))))
{
sp->reset_thd_mem_root(thd);
sp->init(this);
@@ -7829,7 +7830,7 @@ sp_package *LEX::create_package_start(THD *thd,
return 0;
}
}
- if (unlikely(!(pkg= new sp_package(this, name_arg, sph))))
+ if (unlikely(!(pkg= sp_package::create(this, name_arg, sph))))
return NULL;
pkg->reset_thd_mem_root(thd);
pkg->init(this);
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 87eea6c0a8b..ea2ca10a444 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1522,28 +1522,6 @@ public:
uint sroutines_list_own_elements;
/**
- Locking state of tables in this particular statement.
-
- If we under LOCK TABLES or in prelocked mode we consider tables
- for the statement to be "locked" if there was a call to lock_tables()
- (which called handler::start_stmt()) for tables of this statement
- and there was no matching close_thread_tables() call.
-
- As result this state may differ significantly from one represented
- by Open_tables_state::lock/locked_tables_mode more, which are always
- "on" under LOCK TABLES or in prelocked mode.
- */
- enum enum_lock_tables_state {
- LTS_NOT_LOCKED = 0,
- LTS_LOCKED
- };
- enum_lock_tables_state lock_tables_state;
- bool is_query_tables_locked()
- {
- return (lock_tables_state == LTS_LOCKED);
- }
-
- /**
Number of tables which were open by open_tables() and to be locked
by lock_tables().
Note that we set this member only in some cases, when this value
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a8e66d2a230..59b4e148005 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1858,7 +1858,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
while (!thd->killed && (parser_state.m_lip.found_semicolon != NULL) &&
! thd->is_error())
{
- thd->get_stmt_da()->set_skip_flush();
/*
Multiple queries exist, execute them individually
*/
@@ -4710,8 +4709,10 @@ mysql_execute_command(THD *thd)
{
result= new (thd->mem_root) multi_delete(thd, aux_tables,
lex->table_count);
- if (unlikely(result))
+ if (likely(result))
{
+ if (unlikely(select_lex->vers_setup_conds(thd, aux_tables)))
+ goto multi_delete_error;
res= mysql_select(thd,
select_lex->get_table_list(),
select_lex->with_wild,
@@ -4733,6 +4734,7 @@ mysql_execute_command(THD *thd)
if (lex->describe || lex->analyze_stmt)
res= thd->lex->explain->send_explain(thd);
}
+ multi_delete_error:
delete result;
}
}
@@ -5080,7 +5082,7 @@ mysql_execute_command(THD *thd)
/* Don't do it, if we are inside a SP */
if (!thd->spcont)
{
- delete lex->sphead;
+ sp_head::destroy(lex->sphead);
lex->sphead= NULL;
}
/* lex->unit.cleanup() is called outside, no need to call it here */
@@ -9483,7 +9485,7 @@ bool update_precheck(THD *thd, TABLE_LIST *tables)
bool delete_precheck(THD *thd, TABLE_LIST *tables)
{
DBUG_ENTER("delete_precheck");
- if (tables->vers_conditions.is_set())
+ if (tables->vers_conditions.delete_history)
{
if (check_one_table_access(thd, DELETE_HISTORY_ACL, tables))
DBUG_RETURN(TRUE);
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 00a78ce3199..febd88c4b9b 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -2840,14 +2840,34 @@ bool partition_key_modified(TABLE *table, const MY_BITMAP *fields)
static inline int part_val_int(Item *item_expr, longlong *result)
{
- *result= item_expr->val_int();
+ switch (item_expr->cmp_type())
+ {
+ case DECIMAL_RESULT:
+ {
+ my_decimal buf;
+ my_decimal *val= item_expr->val_decimal(&buf);
+ if (val && my_decimal2int(E_DEC_FATAL_ERROR, val, item_expr->unsigned_flag,
+ result, FLOOR) != E_DEC_OK)
+ return true;
+ break;
+ }
+ case INT_RESULT:
+ *result= item_expr->val_int();
+ break;
+ case STRING_RESULT:
+ case REAL_RESULT:
+ case ROW_RESULT:
+ case TIME_RESULT:
+ DBUG_ASSERT(0);
+ break;
+ }
if (item_expr->null_value)
{
if (unlikely(current_thd->is_error()))
- return TRUE;
+ return true;
*result= LONGLONG_MIN;
}
- return FALSE;
+ return false;
}
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index da6ec106208..d273db7d0d4 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -3848,7 +3848,7 @@ Prepared_statement::~Prepared_statement()
free_items();
if (lex)
{
- delete lex->sphead;
+ sp_head::destroy(lex->sphead);
delete lex->result;
delete (st_lex_local *) lex;
}
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index bb25ca69924..aa81d33f2e7 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -3289,7 +3289,7 @@ int reset_slave(THD *thd, Master_info* mi)
char fname[FN_REFLEN];
int thread_mask= 0, error= 0;
uint sql_errno=ER_UNKNOWN_ERROR;
- const char* errmsg= "Unknown error occurred while reseting slave";
+ const char* errmsg= "Unknown error occurred while resetting slave";
char master_info_file_tmp[FN_REFLEN];
char relay_log_info_file_tmp[FN_REFLEN];
DBUG_ENTER("reset_slave");
@@ -3875,7 +3875,7 @@ int reset_master(THD* thd, rpl_gtid *init_state, uint32 init_state_len,
}
bool ret= 0;
- /* Temporarily disable master semisync before reseting master. */
+ /* Temporarily disable master semisync before resetting master. */
repl_semisync_master.before_reset_master();
ret= mysql_bin_log.reset_logs(thd, 1, init_state, init_state_len,
next_log_number);
@@ -3899,6 +3899,11 @@ bool mysql_show_binlog_events(THD* thd)
List<Item> field_list;
const char *errmsg = 0;
bool ret = TRUE;
+ /*
+ Using checksum validate the correctness of event pos specified in show
+ binlog events command.
+ */
+ bool verify_checksum_once= false;
IO_CACHE log;
File file = -1;
MYSQL_BIN_LOG *binary_log= NULL;
@@ -3954,6 +3959,10 @@ bool mysql_show_binlog_events(THD* thd)
mi= 0;
}
+ /* Validate user given position using checksum */
+ if (lex_mi->pos == pos && !opt_master_verify_checksum)
+ verify_checksum_once= true;
+
unit->set_limit(thd->lex->current_select);
limit_start= unit->offset_limit_cnt;
limit_end= unit->select_limit_cnt;
@@ -4033,15 +4042,16 @@ bool mysql_show_binlog_events(THD* thd)
for (event_count = 0;
(ev = Log_event::read_log_event(&log,
description_event,
- opt_master_verify_checksum)); )
+ (opt_master_verify_checksum ||
+ verify_checksum_once))); )
{
if (event_count >= limit_start &&
- ev->net_send(protocol, linfo.log_file_name, pos))
+ ev->net_send(protocol, linfo.log_file_name, pos))
{
- errmsg = "Net error";
- delete ev;
+ errmsg = "Net error";
+ delete ev;
mysql_mutex_unlock(log_lock);
- goto err;
+ goto err;
}
if (ev->get_type_code() == FORMAT_DESCRIPTION_EVENT)
@@ -4067,10 +4077,11 @@ bool mysql_show_binlog_events(THD* thd)
delete ev;
}
+ verify_checksum_once= false;
pos = my_b_tell(&log);
if (++event_count >= limit_end)
- break;
+ break;
}
if (unlikely(event_count < limit_end && log.error))
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index c7501e4fd1d..ae26458d451 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -677,6 +677,7 @@ bool vers_select_conds_t::init_from_sysvar(THD *thd)
{
vers_asof_timestamp_t &in= thd->variables.vers_asof_timestamp;
type= (vers_system_time_t) in.type;
+ delete_history= false;
start.unit= VERS_TIMESTAMP;
if (type != SYSTEM_TIME_UNSPECIFIED && type != SYSTEM_TIME_ALL)
{
@@ -709,6 +710,7 @@ void vers_select_conds_t::print(String *str, enum_query_type query_type) const
end.print(str, query_type, STRING_WITH_LEN(" AND "));
break;
case SYSTEM_TIME_BEFORE:
+ case SYSTEM_TIME_HISTORY:
DBUG_ASSERT(0);
break;
case SYSTEM_TIME_ALL:
@@ -717,23 +719,22 @@ void vers_select_conds_t::print(String *str, enum_query_type query_type) const
}
}
+static
+bool skip_setup_conds(THD *thd)
+{
+ return (!thd->stmt_arena->is_conventional()
+ && !thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
+ || thd->lex->is_view_context_analysis();
+}
+
int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
{
DBUG_ENTER("SELECT_LEX::vers_setup_cond");
#define newx new (thd->mem_root)
+ const bool update_conds= !skip_setup_conds(thd);
TABLE_LIST *table;
- if (!thd->stmt_arena->is_conventional() &&
- !thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
- {
- // statement is already prepared
- DBUG_RETURN(0);
- }
-
- if (thd->lex->is_view_context_analysis())
- DBUG_RETURN(0);
-
if (!versioned_tables)
{
for (table= tables; table; table= table->next_local)
@@ -776,9 +777,22 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
}
}
+ bool is_select= false;
+ switch (thd->lex->sql_command)
+ {
+ case SQLCOM_SELECT:
+ case SQLCOM_INSERT_SELECT:
+ case SQLCOM_REPLACE_SELECT:
+ case SQLCOM_DELETE_MULTI:
+ case SQLCOM_UPDATE_MULTI:
+ is_select= true;
+ default:
+ break;
+ }
+
for (table= tables; table; table= table->next_local)
{
- if (!table->table || !table->table->versioned())
+ if (!table->table || table->is_view() || !table->table->versioned())
continue;
vers_select_conds_t &vers_conditions= table->vers_conditions;
@@ -790,13 +804,15 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
*/
if (table->partition_names && table->table->part_info->vers_info)
{
- if (vers_conditions.is_set())
+ /* If the history is stored in partitions, then partitions
+ themselves are not versioned. */
+ if (vers_conditions.was_set())
{
my_error(ER_VERS_QUERY_IN_PARTITION, MYF(0), table->alias.str);
DBUG_RETURN(-1);
}
- else
- vers_conditions.init(SYSTEM_TIME_ALL);
+ else if (!vers_conditions.is_set())
+ vers_conditions.type= SYSTEM_TIME_ALL;
}
#endif
@@ -808,7 +824,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
}
// propagate system_time from sysvar
- if (!vers_conditions.is_set())
+ if (!vers_conditions.is_set() && is_select)
{
if (vers_conditions.init_from_sysvar(thd))
DBUG_RETURN(-1);
@@ -834,7 +850,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
bool timestamps_only= table->table->versioned(VERS_TIMESTAMP);
- if (vers_conditions.is_set())
+ if (vers_conditions.is_set() && vers_conditions.type != SYSTEM_TIME_HISTORY)
{
thd->where= "FOR SYSTEM_TIME";
/* TODO: do resolve fix_length_and_dec(), fix_fields(). This requires
@@ -851,6 +867,9 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
}
}
+ if (!update_conds)
+ continue;
+
Item *cond1= NULL, *cond2= NULL, *cond3= NULL, *curr= NULL;
Item *point_in_time1= vers_conditions.start.item;
Item *point_in_time2= vers_conditions.end.item;
@@ -861,10 +880,14 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
switch (vers_conditions.type)
{
case SYSTEM_TIME_UNSPECIFIED:
+ case SYSTEM_TIME_HISTORY:
thd->variables.time_zone->gmt_sec_to_TIME(&max_time, TIMESTAMP_MAX_VALUE);
max_time.second_part= TIME_MAX_SECOND_PART;
curr= newx Item_datetime_literal(thd, &max_time, TIME_SECOND_PART_DIGITS);
- cond1= newx Item_func_eq(thd, row_end, curr);
+ if (vers_conditions.type == SYSTEM_TIME_UNSPECIFIED)
+ cond1= newx Item_func_eq(thd, row_end, curr);
+ else
+ cond1= newx Item_func_lt(thd, row_end, curr);
break;
case SYSTEM_TIME_AS_OF:
cond1= newx Item_func_le(thd, row_start, point_in_time1);
@@ -896,8 +919,12 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
switch (vers_conditions.type)
{
case SYSTEM_TIME_UNSPECIFIED:
+ case SYSTEM_TIME_HISTORY:
curr= newx Item_int(thd, ULONGLONG_MAX);
- cond1= newx Item_func_eq(thd, row_end, curr);
+ if (vers_conditions.type == SYSTEM_TIME_UNSPECIFIED)
+ cond1= newx Item_func_eq(thd, row_end, curr);
+ else
+ cond1= newx Item_func_lt(thd, row_end, curr);
break;
case SYSTEM_TIME_AS_OF:
trx_id0= vers_conditions.start.unit == VERS_TIMESTAMP
@@ -938,7 +965,19 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
{
cond1= and_items(thd, cond2, cond1);
cond1= and_items(thd, cond3, cond1);
- table->on_expr= and_items(thd, table->on_expr, cond1);
+ if (is_select)
+ table->on_expr= and_items(thd, table->on_expr, cond1);
+ else
+ {
+ if (join)
+ {
+ where= and_items(thd, join->conds, cond1);
+ join->conds= where;
+ }
+ else
+ where= and_items(thd, where, cond1);
+ table->where= and_items(thd, table->where, cond1);
+ }
}
table->vers_conditions.type= SYSTEM_TIME_ALL;
@@ -1674,7 +1713,20 @@ JOIN::optimize_inner()
}
}
- conds= optimize_cond(this, conds, join_list, FALSE,
+ bool ignore_on_expr= false;
+ /*
+ PS/SP note: on_expr of versioned table can not be reallocated
+ (see build_equal_items() below) because it can be not rebuilt
+ at second invocation.
+ */
+ if (!thd->stmt_arena->is_conventional() && thd->mem_root != thd->stmt_arena->mem_root)
+ for (TABLE_LIST *tbl= tables_list; tbl; tbl= tbl->next_local)
+ if (tbl->table && tbl->on_expr && tbl->table->versioned())
+ {
+ ignore_on_expr= true;
+ break;
+ }
+ conds= optimize_cond(this, conds, join_list, ignore_on_expr,
&cond_value, &cond_equal, OPT_LINK_EQUAL_FIELDS);
if (thd->is_error())
@@ -1760,6 +1812,7 @@ JOIN::optimize_inner()
zero_result_cause= "Zero limit";
}
table_count= top_join_tab_count= 0;
+ handle_implicit_grouping_with_window_funcs();
error= 0;
subq_exit_fl= true;
goto setup_subq_exit;
@@ -1807,6 +1860,7 @@ JOIN::optimize_inner()
table_count= top_join_tab_count= 0;
error=0;
subq_exit_fl= true;
+ handle_implicit_grouping_with_window_funcs();
goto setup_subq_exit;
}
if (res > 1)
@@ -1822,6 +1876,7 @@ JOIN::optimize_inner()
tables_list= 0; // All tables resolved
select_lex->min_max_opt_list.empty();
const_tables= top_join_tab_count= table_count;
+ handle_implicit_grouping_with_window_funcs();
/*
Extract all table-independent conditions and replace the WHERE
clause with them. All other conditions were computed by opt_sum_query
@@ -1967,6 +2022,7 @@ int JOIN::optimize_stage2()
zero_result_cause= "no matching row in const table";
DBUG_PRINT("error",("Error: %s", zero_result_cause));
error= 0;
+ handle_implicit_grouping_with_window_funcs();
goto setup_subq_exit;
}
if (!(thd->variables.option_bits & OPTION_BIG_SELECTS) &&
@@ -1998,6 +2054,7 @@ int JOIN::optimize_stage2()
zero_result_cause=
"Impossible WHERE noticed after reading const tables";
select_lex->mark_const_derived(zero_result_cause);
+ handle_implicit_grouping_with_window_funcs();
goto setup_subq_exit;
}
@@ -2143,6 +2200,7 @@ int JOIN::optimize_stage2()
zero_result_cause=
"Impossible WHERE noticed after reading const tables";
select_lex->mark_const_derived(zero_result_cause);
+ handle_implicit_grouping_with_window_funcs();
goto setup_subq_exit;
}
@@ -10485,6 +10543,74 @@ make_outerjoin_info(JOIN *join)
}
+/*
+ @brief
+ Build a temporary join prefix condition for JOIN_TABs up to the last tab
+
+ @param ret OUT the condition is returned here
+
+ @return
+ false OK
+ true Out of memory
+
+ @detail
+ Walk through the join prefix (from the first table to the last_tab) and
+ build a condition:
+
+ join_tab_1_cond AND join_tab_2_cond AND ... AND last_tab_conds
+
+ The condition is only intended to be used by the range optimizer, so:
+ - it is not normalized (can have Item_cond_and inside another
+ Item_cond_and)
+ - it does not include join->exec_const_cond and other similar conditions.
+*/
+
+bool build_tmp_join_prefix_cond(JOIN *join, JOIN_TAB *last_tab, Item **ret)
+{
+ THD *const thd= join->thd;
+ Item_cond_and *all_conds= NULL;
+
+ Item *res= NULL;
+
+ // Pick the ON-expression. Use the same logic as in get_sargable_cond():
+ if (last_tab->on_expr_ref)
+ res= *last_tab->on_expr_ref;
+ else if (last_tab->table->pos_in_table_list &&
+ last_tab->table->pos_in_table_list->embedding &&
+ !last_tab->table->pos_in_table_list->embedding->sj_on_expr)
+ {
+ res= last_tab->table->pos_in_table_list->embedding->on_expr;
+ }
+
+ for (JOIN_TAB *tab= first_depth_first_tab(join);
+ tab;
+ tab= next_depth_first_tab(join, tab))
+ {
+ if (tab->select_cond)
+ {
+ if (!res)
+ res= tab->select_cond;
+ else
+ {
+ if (!all_conds)
+ {
+ if (!(all_conds= new (thd->mem_root)Item_cond_and(thd, res,
+ tab->select_cond)))
+ return true;
+ res= all_conds;
+ }
+ else
+ all_conds->add(tab->select_cond, thd->mem_root);
+ }
+ }
+ if (tab == last_tab)
+ break;
+ }
+ *ret= all_conds? all_conds: res;
+ return false;
+}
+
+
static bool
make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
@@ -10832,7 +10958,9 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
/* Join with outer join condition */
COND *orig_cond=sel->cond;
- sel->cond= and_conds(thd, sel->cond, *tab->on_expr_ref);
+
+ if (build_tmp_join_prefix_cond(join, tab, &sel->cond))
+ return true;
/*
We can't call sel->cond->fix_fields,
@@ -10908,6 +11036,13 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
if (i != join->const_tables && tab->use_quick != 2 &&
!tab->first_inner)
{ /* Read with cache */
+ /*
+ TODO: the execution also gets here when we will not be using
+ join buffer. Review these cases and perhaps, remove this call.
+ (The final decision whether to use join buffer is made in
+ check_join_cache_usage, so we should only call make_scan_filter()
+ there, too).
+ */
if (tab->make_scan_filter())
DBUG_RETURN(1);
}
@@ -11870,6 +12005,9 @@ uint check_join_cache_usage(JOIN_TAB *tab,
if ((tab->cache= new (root) JOIN_CACHE_BNL(join, tab, prev_cache)))
{
tab->icp_other_tables_ok= FALSE;
+ /* If make_join_select() hasn't called make_scan_filter(), do it now */
+ if (!tab->cache_select && tab->make_scan_filter())
+ goto no_join_cache;
return (2 - MY_TEST(!prev_cache));
}
goto no_join_cache;
@@ -14475,12 +14613,15 @@ static int compare_fields_by_table_order(Item *field1,
{
int cmp= 0;
bool outer_ref= 0;
- Item_field *f1= (Item_field *) (field1->real_item());
- Item_field *f2= (Item_field *) (field2->real_item());
- if (field1->const_item() || f1->const_item())
+ Item *field1_real= field1->real_item();
+ Item *field2_real= field2->real_item();
+
+ if (field1->const_item() || field1_real->const_item())
return -1;
- if (field2->const_item() || f2->const_item())
+ if (field2->const_item() || field2_real->const_item())
return 1;
+ Item_field *f1= (Item_field *) field1_real;
+ Item_field *f2= (Item_field *) field2_real;
if (f1->used_tables() & OUTER_REF_TABLE_BIT)
{
outer_ref= 1;
@@ -14972,7 +15113,7 @@ static COND* substitute_for_best_equal_field(THD *thd, JOIN_TAB *context_tab,
}
}
else if (cond->type() == Item::FUNC_ITEM &&
- ((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
+ ((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
{
item_equal= (Item_equal *) cond;
item_equal->sort(&compare_fields_by_table_order, table_join_idx);
@@ -17779,7 +17920,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
/*
Test if there is a default field value. The test for ->ptr is to skip
- 'offset' fields generated by initalize_tables
+ 'offset' fields generated by initialize_tables
*/
if (default_field[i] && default_field[i]->ptr)
{
@@ -18894,7 +19035,8 @@ void set_postjoin_aggr_write_func(JOIN_TAB *tab)
}
}
else if (join->sort_and_group && !tmp_tbl->precomputed_group_by &&
- !join->sort_and_group_aggr_tab && join->tables_list)
+ !join->sort_and_group_aggr_tab && join->tables_list &&
+ join->top_join_tab_count)
{
DBUG_PRINT("info",("Using end_write_group"));
aggr->set_write_func(end_write_group);
@@ -20547,7 +20689,7 @@ join_read_last(JOIN_TAB *tab)
{
TABLE *table=tab->table;
int error= 0;
- DBUG_ENTER("join_read_first");
+ DBUG_ENTER("join_read_last");
DBUG_ASSERT(table->no_keyread ||
!table->covering_keys.is_set(tab->index) ||
@@ -24307,7 +24449,8 @@ change_to_use_tmp_fields(THD *thd, Ref_ptr_array ref_pointer_array,
for (uint i= 0; (item= it++); i++)
{
Field *field;
- if (item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM)
+ if ((item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM) ||
+ item->with_window_func)
item_field= item;
else if (item->type() == Item::FIELD_ITEM)
{
@@ -27699,6 +27842,28 @@ Item *remove_pushed_top_conjuncts(THD *thd, Item *cond)
return cond;
}
+/*
+ There are 5 cases in which we shortcut the join optimization process as we
+ conclude that the join would be a degenerate one
+ 1) IMPOSSIBLE WHERE
+ 2) MIN/MAX optimization (@see opt_sum_query)
+ 3) EMPTY CONST TABLE
+ If a window function is present in any of the above cases then to get the
+ result of the window function, we need to execute it. So we need to
+ create a temporary table for its execution. Here we need to take in mind
+ that aggregate functions and non-aggregate function need not be executed.
+
+*/
+
+
+void JOIN::handle_implicit_grouping_with_window_funcs()
+{
+ if (select_lex->have_window_funcs() && send_row_on_empty_set())
+ {
+ const_tables= top_join_tab_count= table_count= 0;
+ }
+}
+
/**
@} (end of group Query_Optimizer)
*/
diff --git a/sql/sql_select.h b/sql/sql_select.h
index a63ce24bf3b..abcf9764009 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1103,6 +1103,7 @@ protected:
Join_plan_state *save_to);
/* Choose a subquery plan for a table-less subquery. */
bool choose_tableless_subquery_plan();
+ void handle_implicit_grouping_with_window_funcs();
public:
void save_query_plan(Join_plan_state *save_to);
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc
index a7b5def9193..b69b52505f4 100644
--- a/sql/sql_sequence.cc
+++ b/sql/sql_sequence.cc
@@ -487,9 +487,12 @@ int SEQUENCE::read_initial_values(TABLE *table)
Doing mysql_lock_tables() may have started a read only transaction.
If that happend, it's better that we commit it now, as a lot of
code assumes that there is no active stmt transaction directly after
- open_tables()
+ open_tables().
+ But we also don't want to commit the stmt transaction while in a
+ substatement, see MDEV-15977.
*/
- if (!has_active_transaction && !thd->transaction.stmt.is_empty())
+ if (!has_active_transaction && !thd->transaction.stmt.is_empty() &&
+ !thd->in_sub_stmt)
trans_commit_stmt(thd);
}
write_unlock(table);
diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc
index 8f0f08da075..7913a7d2b9f 100644
--- a/sql/sql_servers.cc
+++ b/sql/sql_servers.cc
@@ -431,7 +431,7 @@ insert_server_record_into_cache(FOREIGN_SERVER *server)
int error=0;
DBUG_ENTER("insert_server_record_into_cache");
/*
- We succeded in insertion of the server to the table, now insert
+ We succeeded in insertion of the server to the table, now insert
the server to the cache
*/
DBUG_PRINT("info", ("inserting server %s at %p, length %zd",
@@ -686,7 +686,7 @@ delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options)
goto end;
}
/*
- We succeded in deletion of the server to the table, now delete
+ We succeeded in deletion of the server to the table, now delete
the server from the cache
*/
DBUG_PRINT("info",("deleting server %s length %zd",
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index a853d3df6f6..7240cb3264c 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -592,7 +592,7 @@ static struct show_privileges_st sys_privileges[]=
{"Create view", "Tables", "To create new views"},
{"Create user", "Server Admin", "To create new users"},
{"Delete", "Tables", "To delete existing rows"},
- {"Delete versioning rows", "Tables", "To delete versioning table historical rows"},
+ {"Delete history", "Tables", "To delete versioning table historical rows"},
{"Drop", "Databases,Tables", "To drop databases, tables, and views"},
#ifdef HAVE_EVENT_SCHEDULER
{"Event","Server Admin","To create, alter, drop and execute events"},
@@ -1316,7 +1316,8 @@ mysqld_show_create_get_fields(THD *thd, TABLE_LIST *table_list,
goto exit;
}
else if (lex->table_type == TABLE_TYPE_SEQUENCE &&
- table_list->table->s->table_type != TABLE_TYPE_SEQUENCE)
+ (!table_list->table ||
+ table_list->table->s->table_type != TABLE_TYPE_SEQUENCE))
{
my_error(ER_NOT_SEQUENCE, MYF(0),
table_list->db.str, table_list->table_name.str);
@@ -6330,7 +6331,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
{
free_table_share(&share);
if (free_sp_head)
- delete sp;
+ sp_head::destroy(sp);
DBUG_RETURN(1);
}
}
@@ -6377,7 +6378,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
}
}
if (free_sp_head)
- delete sp;
+ sp_head::destroy(sp);
}
free_table_share(&share);
DBUG_RETURN(error);
@@ -6456,7 +6457,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
store_column_type(table, field, cs, 5);
free_table_share(&share);
if (free_sp_head)
- delete sp;
+ sp_head::destroy(sp);
}
}
@@ -6864,23 +6865,35 @@ static int get_check_constraints_record(THD *thd, TABLE_LIST *tables,
thd->clear_error();
DBUG_RETURN(0);
}
- else if (!tables->view)
+ if (!tables->view)
{
- if (tables->table->s->table_check_constraints)
+ StringBuffer<MAX_FIELD_WIDTH> str(system_charset_info);
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ TABLE_LIST table_acl_check;
+ bzero((char*) &table_acl_check, sizeof(table_acl_check));
+#endif
+ for (uint i= 0; i < tables->table->s->table_check_constraints; i++)
{
- for (uint i= 0; i < tables->table->s->table_check_constraints; i++)
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ if (!(thd->col_access & TABLE_ACLS))
{
- StringBuffer<MAX_FIELD_WIDTH> str(system_charset_info);
- Virtual_column_info *check= tables->table->check_constraints[i];
- restore_record(table, s->default_values);
- table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
- table->field[1]->store(db_name->str, db_name->length, system_charset_info);
- table->field[2]->store(check->name.str, check->name.length, system_charset_info);
- table->field[3]->store(table_name->str, table_name->length, system_charset_info);
- check->print(&str);
- table->field[4]->store(str.ptr(), str.length(), system_charset_info);
- schema_table_store_record(thd, table);
+ table_acl_check.db= *db_name;
+ table_acl_check.table_name= *table_name;
+ table_acl_check.grant.privilege= thd->col_access;
+ if (check_grant(thd, TABLE_ACLS, &table_acl_check, FALSE, 1, TRUE))
+ continue;
}
+#endif
+ Virtual_column_info *check= tables->table->check_constraints[i];
+ table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
+ table->field[3]->store(check->name.str, check->name.length,
+ system_charset_info);
+ /* Make sure the string is empty between each print. */
+ str.length(0);
+ check->print(&str);
+ table->field[4]->store(str.ptr(), str.length(), system_charset_info);
+ if (schema_table_store_record(thd, table))
+ DBUG_RETURN(1);
}
}
DBUG_RETURN(res);
@@ -9805,9 +9818,9 @@ ST_FIELD_INFO check_constraints_fields_info[]=
{"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
+ {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
{"CHECK_CLAUSE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
OPEN_FULL_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
@@ -9827,8 +9840,8 @@ ST_SCHEMA_TABLE schema_tables[]=
fill_schema_applicable_roles, 0, 0, -1, -1, 0, 0},
{"CHARACTER_SETS", charsets_fields_info, 0,
fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0, 0},
- {"CHECK_CONSTRAINTS", check_constraints_fields_info, 0,
- get_all_tables, 0, get_check_constraints_record, 1, 2, 0, OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
+ {"CHECK_CONSTRAINTS", check_constraints_fields_info, 0, get_all_tables, 0,
+ get_check_constraints_record, 1, 2, 0, OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
{"COLLATIONS", collation_fields_info, 0,
fill_schema_collation, make_old_format, 0, -1, -1, 0, 0},
{"COLLATION_CHARACTER_SET_APPLICABILITY", coll_charset_app_fields_info,
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 170c02c0f7f..8642bd47da5 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4238,10 +4238,10 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
continue;
{
- /* Check that there's no repeating constraint names. */
+ /* Check that there's no repeating table CHECK constraint names. */
List_iterator_fast<Virtual_column_info>
dup_it(alter_info->check_constraint_list);
- Virtual_column_info *dup_check;
+ const Virtual_column_info *dup_check;
while ((dup_check= dup_it++) && dup_check != check)
{
if (!lex_string_cmp(system_charset_info,
@@ -4253,6 +4253,27 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
}
}
+ /* Check that there's no repeating key constraint names. */
+ List_iterator_fast<Key> key_it(alter_info->key_list);
+ while (const Key *key= key_it++)
+ {
+ /*
+ Not all keys considered to be the CONSTRAINT
+ Noly Primary Key UNIQUE and Foreign keys.
+ */
+ if (key->type != Key::PRIMARY && key->type != Key::UNIQUE &&
+ key->type != Key::FOREIGN_KEY)
+ continue;
+
+ if (check->name.length == key->name.length &&
+ my_strcasecmp(system_charset_info,
+ check->name.str, key->name.str) == 0)
+ {
+ my_error(ER_DUP_CONSTRAINT_NAME, MYF(0), "CHECK", check->name.str);
+ DBUG_RETURN(TRUE);
+ }
+ }
+
if (check_string_char_length(&check->name, 0, NAME_CHAR_LEN,
system_charset_info, 1))
{
@@ -8497,6 +8518,35 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
}
}
}
+
+ if (!alter_info->check_constraint_list.is_empty())
+ {
+ /* Check the table FOREIGN KEYs for name duplications. */
+ List <FOREIGN_KEY_INFO> fk_child_key_list;
+ FOREIGN_KEY_INFO *f_key;
+ table->file->get_foreign_key_list(thd, &fk_child_key_list);
+ List_iterator<FOREIGN_KEY_INFO> fk_key_it(fk_child_key_list);
+ while ((f_key= fk_key_it++))
+ {
+ List_iterator_fast<Virtual_column_info>
+ c_it(alter_info->check_constraint_list);
+ Virtual_column_info *check;
+ while ((check= c_it++))
+ {
+ if (!check->name.length || check->automatic_name)
+ continue;
+
+ if (check->name.length == f_key->foreign_id->length &&
+ my_strcasecmp(system_charset_info, f_key->foreign_id->str,
+ check->name.str) == 0)
+ {
+ my_error(ER_DUP_CONSTRAINT_NAME, MYF(0), "CHECK", check->name.str);
+ goto err;
+ }
+ }
+ }
+ }
+
/* Add new constraints */
new_constraint_list.append(&alter_info->check_constraint_list);
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index b8ce5d743b4..26ec04cb89e 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -338,7 +338,7 @@ public:
Trigger::~Trigger()
{
- delete body;
+ sp_head::destroy(body);
}
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc
index 816c6fe1089..b4538248e07 100644
--- a/sql/sql_tvc.cc
+++ b/sql/sql_tvc.cc
@@ -796,6 +796,38 @@ bool Item_subselect::wrap_tvc_into_select(THD *thd, st_select_lex *tvc_sl)
}
+/*
+ @brief
+ Check whether the items are of comparable type or not
+
+ @details
+ This check are done because materialization is not performed
+ if the left expr and right expr are of the same types.
+ @see subquery_types_allow_materialization()
+
+ @retval
+ 0 comparable
+ 1 not comparable
+*/
+
+static bool cmp_row_types(Item* item1, Item* item2)
+{
+ uint n= item1->cols();
+ if (item2->check_cols(n))
+ return true;
+
+ for (uint i=0; i < n; i++)
+ {
+ Item *inner= item1->element_index(i);
+ Item *outer= item2->element_index(i);
+ if (!inner->type_handler()->subquery_type_allows_materialization(inner,
+ outer))
+ return true;
+ }
+ return false;
+}
+
+
/**
@brief
Transform IN predicate into IN subquery
@@ -840,10 +872,22 @@ Item *Item_func_in::in_predicate_to_in_subs_transformer(THD *thd,
/* SELECT_LEX object where the transformation is performed */
SELECT_LEX *parent_select= lex->current_select;
uint8 save_derived_tables= lex->derived_tables;
+
+ /*
+ Make sure that create_tmp_table will not fail due to too long keys.
+ Here the strategy would mainly use materialization, so we need to make
+ sure that the materialized table can be created.
+
+ The checks here are the same as in subquery_type_allows_materialization()
+ */
+ uint32 length= max_length_of_left_expr();
+ if (!length || length > tmp_table_max_key_length() ||
+ args[0]->cols() > tmp_table_max_key_parts())
+ return this;
for (uint i=1; i < arg_count; i++)
{
- if (!args[i]->const_item())
+ if (!args[i]->const_item() || cmp_row_types(args[0], args[i]))
return this;
}
@@ -948,6 +992,16 @@ err:
}
+uint32 Item_func_in::max_length_of_left_expr()
+{
+ uint n= args[0]->cols();
+ uint32 length= 0;
+ for (uint i=0; i < n; i++)
+ length+= args[0]->element_index(i)->max_length;
+ return length;
+}
+
+
/**
@brief
Check if this IN-predicate can be transformed in IN-subquery
diff --git a/sql/sql_type.h b/sql/sql_type.h
index df4b99569c1..75e0bac33c3 100644
--- a/sql/sql_type.h
+++ b/sql/sql_type.h
@@ -292,6 +292,15 @@ class Temporal_with_date: protected MYSQL_TIME
{
protected:
void make_from_item(THD *thd, Item *item, sql_mode_t flags);
+
+ ulong daynr() const
+ {
+ return (ulong) ::calc_daynr((uint) year, (uint) month, (uint) day);
+ }
+ int weekday(bool sunday_first_day_of_week) const
+ {
+ return ::calc_weekday(daynr(), sunday_first_day_of_week);
+ }
Temporal_with_date(THD *thd, Item *item, sql_mode_t flags)
{
make_from_item(thd, item, flags);
@@ -389,6 +398,11 @@ public:
DBUG_ASSERT(is_valid_datetime_slow());
return hour == 0 && minute == 0 && second == 0 && second_part == 0;
}
+ int weekday(bool sunday_first_day_of_week) const
+ {
+ DBUG_ASSERT(is_valid_datetime_slow());
+ return Temporal_with_date::weekday(sunday_first_day_of_week);
+ }
const MYSQL_TIME *get_mysql_time() const
{
DBUG_ASSERT(is_valid_datetime_slow());
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index c119f1e0116..b71b62b35ed 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -976,9 +976,21 @@ bool st_select_lex_unit::prepare(TABLE_LIST *derived_arg,
if (sl->tvc->prepare(thd, sl, tmp_result, this))
goto err;
}
- else if (prepare_join(thd, first_sl, tmp_result, additional_options,
+ else
+ {
+ if (prepare_join(thd, first_sl, tmp_result, additional_options,
is_union_select))
- goto err;
+ goto err;
+
+ if (derived_arg && derived_arg->table &&
+ derived_arg->derived_type == VIEW_ALGORITHM_MERGE &&
+ derived_arg->table->versioned())
+ {
+ /* Got versioning conditions (see vers_setup_conds()), need to update
+ derived_arg. */
+ derived_arg->where= first_sl->where;
+ }
+ }
types= first_sl->item_list;
goto cont;
}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 32adc4420b3..10b62af3d6f 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -184,10 +184,10 @@ static bool check_fields(THD *thd, List<Item> &items, bool update_view)
return FALSE;
}
-static bool check_has_vers_fields(TABLE *table, List<Item> &items)
+bool TABLE::vers_check_update(List<Item> &items)
{
List_iterator<Item> it(items);
- if (!table->versioned())
+ if (!versioned_write())
return false;
while (Item *item= it++)
@@ -195,8 +195,11 @@ static bool check_has_vers_fields(TABLE *table, List<Item> &items)
if (Item_field *item_field= item->field_for_view_update())
{
Field *field= item_field->field;
- if (field->table == table && !field->vers_update_unversioned())
+ if (field->table == this && !field->vers_update_unversioned())
+ {
+ no_cache= true;
return true;
+ }
}
}
return false;
@@ -415,7 +418,7 @@ int mysql_update(THD *thd,
{
DBUG_RETURN(1);
}
- bool has_vers_fields= check_has_vers_fields(table, fields);
+ bool has_vers_fields= table->vers_check_update(fields);
if (check_key_in_view(thd, table_list))
{
my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias.str, "UPDATE");
@@ -878,11 +881,6 @@ update_begin:
THD_STAGE_INFO(thd, stage_updating);
while (!(error=info.read_record()) && !thd->killed)
{
- if (table->versioned() && !table->vers_end_field()->is_max())
- {
- continue;
- }
-
explain->tracker.on_record_read();
thd->inc_examined_row_count(1);
if (!select || select->skip_record(thd) > 0)
@@ -1266,6 +1264,15 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
thd->lex->allow_sum_func.clear_all();
+ DBUG_ASSERT(table_list->table);
+ // conds could be cached from previous SP call
+ DBUG_ASSERT(!table_list->vers_conditions.need_setup() ||
+ !*conds || thd->stmt_arena->is_stmt_execute());
+ if (select_lex->vers_setup_conds(thd, table_list))
+ DBUG_RETURN(TRUE);
+
+ *conds= select_lex->where;
+
/*
We do not call DT_MERGE_FOR_INSERT because it has no sense for simple
(not multi-) update
@@ -1786,6 +1793,9 @@ bool mysql_multi_update(THD *thd, TABLE_LIST *table_list, List<Item> *fields,
thd->abort_on_warning= !ignore && thd->is_strict_mode();
List<Item> total_list;
+ if (select_lex->vers_setup_conds(thd, table_list))
+ DBUG_RETURN(1);
+
res= mysql_select(thd,
table_list, select_lex->with_wild, total_list, conds,
select_lex->order_list.elements,
@@ -2126,7 +2136,7 @@ multi_update::initialize_tables(JOIN *join)
if (safe_update_on_fly(thd, join->join_tab, table_ref, all_tables))
{
table_to_update= table; // Update table on the fly
- has_vers_fields= check_has_vers_fields(table, *fields);
+ has_vers_fields= table->vers_check_update(*fields);
continue;
}
}
@@ -2345,11 +2355,6 @@ int multi_update::send_data(List<Item> &not_used_values)
if (table->status & (STATUS_NULL_ROW | STATUS_UPDATED))
continue;
- if (table->versioned() && !table->vers_end_field()->is_max())
- {
- continue;
- }
-
if (table == table_to_update)
{
/*
@@ -2607,7 +2612,7 @@ int multi_update::do_updates()
if (table->vfield)
empty_record(table);
- has_vers_fields= check_has_vers_fields(table, *fields);
+ has_vers_fields= table->vers_check_update(*fields);
check_opt_it.rewind();
while(TABLE *tbl= check_opt_it++)
diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index a6c9dd3fea7..7e319c96000 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -1779,11 +1779,7 @@ protected:
List_iterator_fast<Item_sum> it(sum_functions);
Item_sum* item;
while ((item= it++))
- {
- Item_sum_window_with_row_count* item_with_row_count =
- static_cast<Item_sum_window_with_row_count *>(item);
- item_with_row_count->set_row_count(num_rows_in_partition);
- }
+ item->set_partition_row_count(num_rows_in_partition);
}
};
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 235be9b0f89..2a382dc7666 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -8033,10 +8033,10 @@ alter:
lex->server_options.reset($3);
} OPTIONS_SYM '(' server_options_list ')' { }
/* ALTER USER foo is allowed for MySQL compatibility. */
- | ALTER opt_if_exists USER_SYM clear_privileges grant_list
+ | ALTER USER_SYM opt_if_exists clear_privileges grant_list
opt_require_clause opt_resource_options
{
- Lex->create_info.set($2);
+ Lex->create_info.set($3);
Lex->sql_command= SQLCOM_ALTER_USER;
}
| ALTER SEQUENCE_SYM opt_if_exists
@@ -13785,7 +13785,7 @@ delete:
opt_delete_system_time:
/* empty */
{
- Lex->vers_conditions.init(SYSTEM_TIME_ALL);
+ Lex->vers_conditions.init(SYSTEM_TIME_HISTORY);
}
| BEFORE_SYM SYSTEM_TIME_SYM history_point
{
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy
index 12ac95dedee..c8620543d08 100644
--- a/sql/sql_yacc_ora.yy
+++ b/sql/sql_yacc_ora.yy
@@ -7970,10 +7970,10 @@ alter:
lex->server_options.reset($3);
} OPTIONS_SYM '(' server_options_list ')' { }
/* ALTER USER foo is allowed for MySQL compatibility. */
- | ALTER opt_if_exists USER_SYM clear_privileges grant_list
+ | ALTER USER_SYM opt_if_exists clear_privileges grant_list
opt_require_clause opt_resource_options
{
- Lex->create_info.set($2);
+ Lex->create_info.set($3);
Lex->sql_command= SQLCOM_ALTER_USER;
}
| ALTER SEQUENCE_SYM opt_if_exists
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index c20fcc4fe85..824b6583404 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -6164,7 +6164,7 @@ static Sys_var_enum Sys_session_track_transaction_info(
"Track changes to the transaction attributes. OFF to disable; "
"STATE to track just transaction state (Is there an active transaction? "
"Does it have any data? etc.); CHARACTERISTICS to track transaction "
- "state and report all statements needed to start a transaction with"
+ "state and report all statements needed to start a transaction with "
"the same characteristics (isolation level, read only/read write,"
"snapshot - but not any work done / data modified within the "
"transaction).",
diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic
index c6d7b0593d0..ec8d9ef201a 100644
--- a/sql/sys_vars.ic
+++ b/sql/sys_vars.ic
@@ -2634,7 +2634,7 @@ public:
if (!Sys_var_enum::do_check(thd, var))
return false;
MYSQL_TIME ltime;
- bool res= var->value->get_date(&ltime, 0);
+ bool res= var->value->get_date(&ltime, TIME_NO_ZERO_IN_DATE|TIME_NO_ZERO_DATE);
if (!res)
{
var->save_result.ulonglong_value= SYSTEM_TIME_AS_OF;
@@ -2651,7 +2651,7 @@ private:
{
if (var->value)
{
- res= var->value->get_date(&out.ltime, 0);
+ res= var->value->get_date(&out.ltime, TIME_NO_ZERO_IN_DATE|TIME_NO_ZERO_DATE);
}
else // set DEFAULT from global var
{
diff --git a/sql/table.cc b/sql/table.cc
index 278423ec0c2..5fc05bf34b1 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -4251,7 +4251,6 @@ bool check_column_name(const char *name)
been opened.
@param[in] table The table to check
- @param[in] table_f_count Expected number of columns in the table
@param[in] table_def Expected structure of the table (column name
and type)
@@ -4688,6 +4687,7 @@ void TABLE::init(THD *thd, TABLE_LIST *tl)
cond_selectivity_sampling_explain= NULL;
vers_write= s->versioned;
quick_condition_rows=0;
+ no_cache= false;
initialize_quick_structures();
#ifdef HAVE_REPLICATION
/* used in RBR Triggers */
@@ -6612,12 +6612,8 @@ void TABLE::mark_columns_needed_for_update()
/*
For System Versioning we have to read all columns since we store
a copy of previous row with modified row_end back to a table.
-
- Without write_set versioning.rpl,row is unstable until MDEV-16370 is
- applied.
*/
bitmap_union(read_set, &s->all_set);
- bitmap_union(write_set, &s->all_set);
need_signal= true;
}
if (check_constraints)
@@ -6780,8 +6776,16 @@ void TABLE::mark_columns_per_binlog_row_image()
binary log will include all columns read anyway.
*/
mark_columns_used_by_index_no_reset(s->primary_key, read_set);
- /* Only write columns that have changed */
- rpl_write_set= write_set;
+ if (versioned())
+ {
+ // TODO: After MDEV-18432 we don't pass history rows, so remove this:
+ rpl_write_set= &s->all_set;
+ }
+ else
+ {
+ /* Only write columns that have changed */
+ rpl_write_set= write_set;
+ }
break;
default:
@@ -9172,6 +9176,8 @@ bool vers_select_conds_t::eq(const vers_select_conds_t &conds) const
return true;
case SYSTEM_TIME_BEFORE:
break;
+ case SYSTEM_TIME_HISTORY:
+ break;
case SYSTEM_TIME_AS_OF:
return start.eq(conds.start);
case SYSTEM_TIME_FROM_TO:
diff --git a/sql/table.h b/sql/table.h
index bec0fdd10ba..a1e7db36ced 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -321,7 +321,7 @@ typedef struct st_grant_info
enum tmp_table_type
{
- NO_TMP_TABLE, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
+ NO_TMP_TABLE= 0, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE
};
enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP };
@@ -1536,9 +1536,16 @@ public:
return s->versioned == type;
}
- bool versioned_write(vers_sys_type_t type= VERS_UNDEFINED) const
+ bool versioned_write() const
{
DBUG_ASSERT(versioned() || !vers_write);
+ return versioned() ? vers_write : false;
+ }
+
+ bool versioned_write(vers_sys_type_t type) const
+ {
+ DBUG_ASSERT(type);
+ DBUG_ASSERT(versioned() || !vers_write);
return versioned(type) ? vers_write : false;
}
@@ -1557,6 +1564,8 @@ public:
ulonglong vers_start_id() const;
ulonglong vers_end_id() const;
+ bool vers_check_update(List<Item> &items);
+
int delete_row();
void vers_update_fields();
void vers_update_end();
@@ -1862,14 +1871,18 @@ public:
struct vers_select_conds_t
{
vers_system_time_t type;
+ vers_system_time_t orig_type;
bool used:1;
+ bool delete_history:1;
Vers_history_point start;
Vers_history_point end;
void empty()
{
type= SYSTEM_TIME_UNSPECIFIED;
+ orig_type= SYSTEM_TIME_UNSPECIFIED;
used= false;
+ delete_history= false;
start.empty();
end.empty();
}
@@ -1879,7 +1892,10 @@ struct vers_select_conds_t
Vers_history_point _end= Vers_history_point())
{
type= _type;
+ orig_type= _type;
used= false;
+ delete_history= (type == SYSTEM_TIME_HISTORY ||
+ type == SYSTEM_TIME_BEFORE);
start= _start;
end= _end;
}
@@ -1892,6 +1908,14 @@ struct vers_select_conds_t
{
return type != SYSTEM_TIME_UNSPECIFIED;
}
+ bool was_set() const
+ {
+ return orig_type != SYSTEM_TIME_UNSPECIFIED;
+ }
+ bool need_setup() const
+ {
+ return type != SYSTEM_TIME_UNSPECIFIED && type != SYSTEM_TIME_ALL;
+ }
bool resolve_units(THD *thd);
bool eq(const vers_select_conds_t &conds) const;
};
@@ -3091,7 +3115,7 @@ public:
@param[in] timestamp
@param[in] true if we search for a lesser timestamp, false if greater
- @retval true if exists, false it not exists or an error occured
+ @retval true if exists, false it not exists or an error occurred
*/
bool query(MYSQL_TIME &commit_time, bool backwards);
/**
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc
index b0221fcb941..884ecccba01 100644
--- a/sql/temporary_tables.cc
+++ b/sql/temporary_tables.cc
@@ -351,6 +351,13 @@ bool THD::open_temporary_table(TABLE_LIST *tl)
DBUG_RETURN(false);
}
+ if (!tl->db.str)
+ {
+ DBUG_PRINT("info",
+ ("Table reference to a temporary table must have database set"));
+ DBUG_RETURN(false);
+ }
+
/*
Temporary tables are not safe for parallel replication. They were
designed to be visible to one thread only, so have no table locking.
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index 6a4139197f9..157a76a5150 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -185,7 +185,7 @@ void tp_callback(TP_connection *c)
}
else if (threadpool_process_request(thd))
{
- /* QUIT or an error occured. */
+ /* QUIT or an error occurred. */
goto error;
}
diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc
index be320788aa7..6531ce06360 100644
--- a/sql/threadpool_generic.cc
+++ b/sql/threadpool_generic.cc
@@ -1336,7 +1336,7 @@ void wait_begin(thread_group_t *thread_group)
DBUG_ASSERT(thread_group->connection_count > 0);
if ((thread_group->active_thread_count == 0) &&
- (is_queue_empty(thread_group) || !thread_group->listener))
+ (!is_queue_empty(thread_group) || !thread_group->listener))
{
/*
Group might stall while this thread waits, thus wake
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 3307f58818c..af9014d9d42 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -2432,7 +2432,7 @@ print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp)
if (!opt_skip_write_binlog)
printf("\\d |\n"
"IF (select count(*) from information_schema.global_variables where\n"
- "variable_name='wsrep_on') = 1 THEN\n"
+ "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n"
"ALTER TABLE time_zone_leap_second ENGINE=InnoDB;\n"
"END IF|\n"
"\\d ;\n");
@@ -2452,7 +2452,7 @@ print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp)
if (!opt_skip_write_binlog)
printf("\\d |\n"
"IF (select count(*) from information_schema.global_variables where\n"
- "variable_name='wsrep_on') = 1 THEN\n"
+ "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n"
"ALTER TABLE time_zone_leap_second ENGINE=MyISAM;\n"
"END IF|\n"
"\\d ;\n");
@@ -2709,7 +2709,7 @@ main(int argc, char **argv)
sql_log_bin and wsrep_on to avoid Galera replicating below
truncate table clauses. This will allow user to set different
time zones to nodes in Galera cluster. */
- printf("set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');\n"
+ printf("set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');\n"
"prepare set_wsrep_write_binlog from @prep1;\n"
"set @toggle=0; execute set_wsrep_write_binlog using @toggle;\n");
@@ -2725,7 +2725,7 @@ main(int argc, char **argv)
// to allow changes to them to replicate with Galera
printf("\\d |\n"
"IF (select count(*) from information_schema.global_variables where\n"
- "variable_name='wsrep_on') = 1 THEN\n"
+ "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n"
"ALTER TABLE time_zone ENGINE=InnoDB;\n"
"ALTER TABLE time_zone_name ENGINE=InnoDB;\n"
"ALTER TABLE time_zone_transition ENGINE=InnoDB;\n"
@@ -2780,7 +2780,7 @@ main(int argc, char **argv)
// Fall back to MyISAM
printf("\\d |\n"
"IF (select count(*) from information_schema.global_variables where\n"
- "variable_name='wsrep_on') = 1 THEN\n"
+ "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n"
"ALTER TABLE time_zone ENGINE=MyISAM;\n"
"ALTER TABLE time_zone_name ENGINE=MyISAM;\n"
"ALTER TABLE time_zone_transition ENGINE=MyISAM;\n"
diff --git a/sql/uniques.h b/sql/uniques.h
index 654b3692aaa..7cdf6607dd0 100644
--- a/sql/uniques.h
+++ b/sql/uniques.h
@@ -29,14 +29,20 @@
class Unique :public Sql_alloc
{
DYNAMIC_ARRAY file_ptrs;
- ulong max_elements;
+ ulong max_elements; /* Total number of elements that will be stored in-memory */
size_t max_in_memory_size;
IO_CACHE file;
TREE tree;
+ /* Number of elements filtered out due to min_dupl_count when storing results
+ to table. See Unique::get */
ulong filtered_out_elems;
uint size;
- uint full_size;
- uint min_dupl_count; /* always 0 for unions, > 0 for intersections */
+
+ uint full_size; /* Size of element + space needed to store the number of
+ duplicates found for the element. */
+ uint min_dupl_count; /* Minimum number of occurences of element required for
+ it to be written to record_pointers.
+ always 0 for unions, > 0 for intersections */
bool with_counters;
bool merge(TABLE *table, uchar *buff, bool without_last_merge);
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 40fde228f80..5c691116d22 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -398,7 +398,8 @@ LEX_CUSTRING build_frm_image(THD *thd, const LEX_CSTRING *table,
pos+= reclength;
int2store(pos, create_info->connect_string.length);
pos+= 2;
- memcpy(pos, create_info->connect_string.str, create_info->connect_string.length);
+ if (create_info->connect_string.length)
+ memcpy(pos, create_info->connect_string.str, create_info->connect_string.length);
pos+= create_info->connect_string.length;
int2store(pos, str_db_type.length);
pos+= 2;
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index 4c1b06e66e1..1feb46ecdaf 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -95,7 +95,7 @@ void wsrep_register_hton(THD* thd, bool all)
{
trans_register_ha(thd, all, wsrep_hton);
- /* follow innodb read/write settting
+ /* follow innodb read/write setting
* but, as an exception: CTAS with empty result set will not be
* replicated unless we declare wsrep hton as read/write here
*/
@@ -275,7 +275,7 @@ static int wsrep_rollback(handlerton *hton, THD *thd, bool all)
if (wsrep && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle))
{
DBUG_PRINT("wsrep", ("setting rollback fail"));
- WSREP_ERROR("settting rollback fail: thd: %llu, schema: %s, SQL: %s",
+ WSREP_ERROR("setting rollback fail: thd: %llu, schema: %s, SQL: %s",
(long long)thd->real_id, thd->get_db(), thd->query());
}
wsrep_cleanup_transaction(thd);
@@ -316,7 +316,7 @@ int wsrep_commit(handlerton *hton, THD *thd, bool all)
if (wsrep && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle))
{
DBUG_PRINT("wsrep", ("setting rollback fail"));
- WSREP_ERROR("settting rollback fail: thd: %llu, schema: %s, SQL: %s",
+ WSREP_ERROR("setting rollback fail: thd: %llu, schema: %s, SQL: %s",
(long long)thd->real_id, thd->get_db(),
thd->query());
}
@@ -488,11 +488,27 @@ wsrep_run_wsrep_commit(THD *thd, bool all)
if (WSREP_UNDEFINED_TRX_ID == thd->wsrep_ws_handle.trx_id)
{
- WSREP_WARN("SQL statement was ineffective thd: %lld buf: %zu\n"
+ /*
+ Async replication slave may have applied some non-innodb workload,
+ and then has written replication "meta data" into gtid_slave_pos
+ innodb table. Writes to gtid_slave_pos must not be replicated,
+ but this activity has caused that innodb hton is registered for this
+ transaction, but no wsrep keys have been appended.
+ We enter in this code path, because IO cache has events for non-innodb
+ tables.
+ => we should not treat it an error if trx is not introduced for provider
+ */
+ if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL)
+ {
+ WSREP_DEBUG("skipping wsrep replication for async slave, error not raised");
+ DBUG_RETURN(WSREP_TRX_OK);
+ }
+
+ WSREP_WARN("SQL statement was ineffective thd: %llu buf: %zu\n"
"schema: %s \n"
"QUERY: %s\n"
" => Skipping replication",
- (longlong) thd->thread_id, data_len,
+ (ulonglong) thd->thread_id, data_len,
thd->get_db(), thd->query());
rcode = WSREP_TRX_FAIL;
}
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index c639f3a0d58..fe949298a76 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -37,7 +37,6 @@
#include <cstdio>
#include <cstdlib>
#include "log_event.h"
-#include <slave.h>
wsrep_t *wsrep = NULL;
/*
@@ -638,7 +637,6 @@ int wsrep_init()
{
// enable normal operation in case no provider is specified
wsrep_ready_set(TRUE);
- wsrep_inited= 1;
global_system_variables.wsrep_on = 0;
wsrep_init_args args;
args.logger_cb = wsrep_log_cb;
@@ -649,10 +647,15 @@ int wsrep_init()
{
DBUG_PRINT("wsrep",("wsrep::init() failed: %d", rcode));
WSREP_ERROR("wsrep::init() failed: %d, must shutdown", rcode);
+ wsrep_ready_set(FALSE);
wsrep->free(wsrep);
free(wsrep);
wsrep = NULL;
}
+ else
+ {
+ wsrep_inited= 1;
+ }
return rcode;
}
else
@@ -1546,6 +1549,39 @@ static bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table,
{
return false;
}
+ /*
+ If mariadb master has replicated a CTAS, we should not replicate the create table
+ part separately as TOI, but to replicate both create table and following inserts
+ as one write set.
+ Howver, if CTAS creates empty table, we should replicate the create table alone
+ as TOI. We have to do relay log event lookup to see if row events follow the
+ create table event.
+ */
+ if (thd->slave_thread && !(thd->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_STANDALONE))
+ {
+ /* this is CTAS, either empty or populated table */
+ ulonglong event_size = 0;
+ enum Log_event_type ev_type= wsrep_peak_event(thd->rgi_slave, &event_size);
+ switch (ev_type)
+ {
+ case QUERY_EVENT:
+ /* CTAS with empty table, we replicate create table as TOI */
+ break;
+
+ case TABLE_MAP_EVENT:
+ WSREP_DEBUG("replicating CTAS of empty table as TOI");
+ // fall through
+ case WRITE_ROWS_EVENT:
+ /* CTAS with populated table, we replicate later at commit time */
+ WSREP_DEBUG("skipping create table of CTAS replication");
+ return false;
+
+ default:
+ WSREP_WARN("unexpected async replication event: %d", ev_type);
+ }
+ return true;
+ }
+ /* no next async replication event */
return true;
case SQLCOM_CREATE_VIEW:
@@ -1753,7 +1789,7 @@ static int wsrep_RSU_begin(THD *thd, const char *db_, const char *table_)
}
my_error(ER_LOCK_DEADLOCK, MYF(0));
- return(1);
+ return(-1);
}
wsrep_seqno_t seqno = wsrep->pause(wsrep);
@@ -2270,6 +2306,7 @@ static my_bool have_committing_connections()
if (is_committing_connection(tmp))
{
+ mysql_mutex_unlock(&LOCK_thread_count);
return TRUE;
}
}
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index e251df956c4..6f7dd002a1a 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -153,8 +153,9 @@ static void wsrep_prepare_bf_thd(THD *thd, struct wsrep_thd_shadow* shadow)
if (!thd->wsrep_rgi) thd->wsrep_rgi= wsrep_relay_group_init("wsrep_relay");
/* thd->system_thread_info.rpl_sql_info isn't initialized. */
- thd->system_thread_info.rpl_sql_info=
- new rpl_sql_thread_info(thd->wsrep_rgi->rli->mi->rpl_filter);
+ if (!thd->slave_thread)
+ thd->system_thread_info.rpl_sql_info=
+ new rpl_sql_thread_info(thd->wsrep_rgi->rli->mi->rpl_filter);
thd->wsrep_exec_mode= REPL_RECV;
thd->net.vio= 0;
@@ -182,7 +183,8 @@ static void wsrep_return_from_bf_mode(THD *thd, struct wsrep_thd_shadow* shadow)
thd->user_time = shadow->user_time;
thd->reset_db(&db);
- delete thd->system_thread_info.rpl_sql_info;
+ if (!thd->slave_thread)
+ delete thd->system_thread_info.rpl_sql_info;
delete thd->wsrep_rgi->rli->mi;
delete thd->wsrep_rgi->rli;
@@ -415,29 +417,46 @@ static void wsrep_replication_process(THD *thd)
DBUG_VOID_RETURN;
}
-static bool create_wsrep_THD(wsrep_thread_args* args)
+static bool create_wsrep_THD(wsrep_thread_args* args, bool thread_count_lock)
{
- mysql_mutex_lock(&LOCK_thread_count);
+ if (!thread_count_lock)
+ mysql_mutex_lock(&LOCK_thread_count);
+
ulong old_wsrep_running_threads= wsrep_running_threads;
+
DBUG_ASSERT(args->thread_type == WSREP_APPLIER_THREAD ||
args->thread_type == WSREP_ROLLBACKER_THREAD);
+
bool res= mysql_thread_create(args->thread_type == WSREP_APPLIER_THREAD
? key_wsrep_applier : key_wsrep_rollbacker,
&args->thread_id, &connection_attrib,
start_wsrep_THD, (void*)args);
+
+ if (res)
+ {
+ WSREP_ERROR("Can't create wsrep thread");
+ }
+
/*
if starting a thread on server startup, wait until the this thread's THD
is fully initialized (otherwise a THD initialization code might
try to access a partially initialized server data structure - MDEV-8208).
*/
if (!mysqld_server_initialized)
+ {
while (old_wsrep_running_threads == wsrep_running_threads)
+ {
mysql_cond_wait(&COND_thread_count, &LOCK_thread_count);
- mysql_mutex_unlock(&LOCK_thread_count);
+ }
+ }
+
+ if (!thread_count_lock)
+ mysql_mutex_unlock(&LOCK_thread_count);
+
return res;
}
-void wsrep_create_appliers(long threads)
+bool wsrep_create_appliers(long threads, bool thread_count_lock)
{
if (!wsrep_connected)
{
@@ -449,26 +468,32 @@ void wsrep_create_appliers(long threads)
"connection at '%s'", wsrep_cluster_address);
assert(0);
}
- return;
+ return false;
}
- long wsrep_threads=0;
+ long wsrep_threads= 0;
+
while (wsrep_threads++ < threads) {
wsrep_thread_args* arg;
- if((arg = (wsrep_thread_args*)my_malloc(sizeof(wsrep_thread_args), MYF(0))) == NULL) {
+
+ if((arg= (wsrep_thread_args*)my_malloc(sizeof(wsrep_thread_args), MYF(0))) == NULL)
+ {
WSREP_ERROR("Can't allocate memory for wsrep replication thread %ld\n", wsrep_threads);
assert(0);
}
- arg->thread_type = WSREP_APPLIER_THREAD;
- arg->processor = wsrep_replication_process;
+ arg->thread_type= WSREP_APPLIER_THREAD;
+ arg->processor= wsrep_replication_process;
- if (create_wsrep_THD(arg)) {
- WSREP_WARN("Can't create thread to manage wsrep replication");
+ if (create_wsrep_THD(arg, thread_count_lock))
+ {
+ WSREP_ERROR("Can't create thread to manage wsrep replication");
my_free(arg);
- return;
+ return true;
}
}
+
+ return false;
}
static void wsrep_rollback_process(THD *thd)
@@ -564,7 +589,7 @@ void wsrep_create_rollbacker()
arg->processor = wsrep_rollback_process;
/* create rollbacker */
- if (create_wsrep_THD(arg)) {
+ if (create_wsrep_THD(arg, false)) {
WSREP_WARN("Can't create thread to manage wsrep rollback");
my_free(arg);
return;
diff --git a/sql/wsrep_thd.h b/sql/wsrep_thd.h
index 6ce14a4eb0e..8d928014518 100644
--- a/sql/wsrep_thd.h
+++ b/sql/wsrep_thd.h
@@ -26,7 +26,7 @@ int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope);
void wsrep_client_rollback(THD *thd);
void wsrep_replay_transaction(THD *thd);
-void wsrep_create_appliers(long threads);
+bool wsrep_create_appliers(long threads, bool thread_count_lock=false);
void wsrep_create_rollbacker();
int wsrep_abort_thd(void *bf_thd_ptr, void *victim_thd_ptr,
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index 258c00b9f88..f18dc565329 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -602,16 +602,22 @@ static void wsrep_slave_count_change_update ()
bool wsrep_slave_threads_update (sys_var *self, THD* thd, enum_var_type type)
{
+ mysql_mutex_lock(&LOCK_thread_count);
+ bool res= false;
+
wsrep_slave_count_change_update();
if (wsrep_slave_count_change > 0)
{
WSREP_DEBUG("Creating %d applier threads, total %ld", wsrep_slave_count_change, wsrep_slave_threads);
- wsrep_create_appliers(wsrep_slave_count_change);
+ res= wsrep_create_appliers(wsrep_slave_count_change, true);
WSREP_DEBUG("Running %lu applier threads", wsrep_running_applier_threads);
wsrep_slave_count_change = 0;
}
- return false;
+
+ mysql_mutex_unlock(&LOCK_thread_count);
+
+ return res;
}
bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var)
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index 0bb1576a0fa..916aa1aad3e 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -346,6 +346,9 @@ ENDIF(CONNECT_WITH_REST)
OPTION(CONNECT_WITH_REST "Compile CONNECT storage engine with REST support" ON)
IF(CONNECT_WITH_REST)
+ MESSAGE(STATUS "=====> REST support is ON")
+ SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp tabrest.h)
+ add_definitions(-DREST_SUPPORT)
FIND_PACKAGE(cpprestsdk QUIET)
IF (cpprestsdk_FOUND)
IF(UNIX)
@@ -359,10 +362,10 @@ IF(CONNECT_WITH_REST)
# Comment it out if not needed depending on your cpprestsdk installation.
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
ENDIF(UNIX)
- IF(REST_LIBRARY)
- SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h)
- add_definitions(-DREST_SUPPORT)
- ENDIF()
+# IF(REST_LIBRARY) why this? how about Windows
+ SET(CONNECT_SOURCES ${CONNECT_SOURCES} restget.cpp)
+ add_definitions(-DREST_SOURCE)
+# ENDIF()
ELSE(NOT cpprestsdk_FOUND)
# MESSAGE(STATUS "=====> cpprestsdk package not found")
ENDIF (cpprestsdk_FOUND)
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index 461391d2896..dfc619cf4af 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -566,7 +566,7 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort)
rc = tdbp->DeleteDB(g, RC_EF); // Specific A.M. delete routine
} else if (tdbp->GetMode() == MODE_UPDATE && tdbp->IsIndexed())
- rc = ((PTDBDOX)tdbp)->Txfp->UpdateSortedRows(g);
+ rc = ((PTDBDOS)tdbp)->GetTxfp()->UpdateSortedRows(g);
switch (rc) {
case RC_FX:
@@ -593,7 +593,7 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort)
if (!tdbp->IsRemote()) {
// Make all the eventual indexes
- PTDBDOX tbxp = (PTDBDOX)tdbp;
+ PTDBDOS tbxp = (PTDBDOS)tdbp;
tbxp->ResetKindex(g, NULL);
tbxp->SetKey_Col(NULL);
rc = tbxp->ResetTableOpt(g, true, tbxp->GetDef()->Indexable() == 1);
@@ -622,8 +622,8 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort)
int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
{
PIXDEF xdp;
- PTDBDOX tdbp;
- DOXDEF *dfp;
+ PTDBDOS tdbp;
+ DOSDEF *dfp;
if (!ptdb)
return -1;
@@ -633,9 +633,9 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
} else if (ptdb->GetDef()->Indexable() == 3) {
return 1;
} else
- tdbp= (PTDBDOX)ptdb;
+ tdbp= (PTDBDOS)ptdb;
- dfp= (DOXDEF*)tdbp->To_Def;
+ dfp= (DOSDEF*)tdbp->GetDef();
//if (!(k= colp->GetKey()))
// if (colp->GetOpt() >= 2) {
@@ -645,16 +645,16 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
// This is a pseudo indexed sorted block optimized column
// return 0;
- if (tdbp->To_Kindex)
- if (((XXBASE*)tdbp->To_Kindex)->GetID() == id) {
- tdbp->To_Kindex->Reset(); // Same index
- return (tdbp->To_Kindex->IsMul()) ? 2 : 1;
+ if (tdbp->GetKindex())
+ if (((XXBASE*)tdbp->GetKindex())->GetID() == id) {
+ tdbp->GetKindex()->Reset(); // Same index
+ return (tdbp->GetKindex()->IsMul()) ? 2 : 1;
} else {
- tdbp->To_Kindex->Close();
- tdbp->To_Kindex= NULL;
+ tdbp->GetKindex()->Close();
+ tdbp->SetKindex(NULL);
} // endif colp
- for (xdp= dfp->To_Indx; xdp; xdp= xdp->GetNext())
+ for (xdp= dfp->GetIndx(); xdp; xdp= xdp->GetNext())
if (xdp->GetID() == id)
break;
@@ -676,7 +676,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
if (tdbp->InitialyzeIndex(g, xdp, sorted))
return 0;
- return (tdbp->To_Kindex->IsMul()) ? 2 : 1;
+ return (tdbp->GetKindex()->IsMul()) ? 2 : 1;
} // end of CntIndexInit
#if defined(WORDS_BIGENDIAN)
@@ -710,7 +710,7 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
int n, x;
RCODE rc;
XXBASE *xbp;
- PTDBDOX tdbp;
+ PTDBDOS tdbp;
if (!ptdb)
return RC_FX;
@@ -736,12 +736,12 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
goto rnd;
} else
- tdbp= (PTDBDOX)ptdb;
+ tdbp= (PTDBDOS)ptdb;
// Set reference values and index operator
- if (!tdbp->To_Link || !tdbp->To_Kindex) {
+ if (!tdbp->GetLink() || !tdbp->GetKindex()) {
// if (!tdbp->To_Xdp) {
- sprintf(g->Message, "Index not initialized for table %s", tdbp->Name);
+ sprintf(g->Message, "Index not initialized for table %s", tdbp->GetName());
return RC_FX;
#if 0
} // endif !To_Xdp
@@ -754,7 +754,7 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
#endif // 0
} // endif !To_Kindex
- xbp= (XXBASE*)tdbp->To_Kindex;
+ xbp= (XXBASE*)tdbp->GetKindex();
if (kr) {
char *kp= (char*)kr->key;
@@ -764,13 +764,13 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
PVAL valp;
PCOL colp;
- for (n= 0; n < tdbp->Knum; n++) {
- colp= (PCOL)tdbp->To_Key_Col[n];
+ for (n= 0; n < tdbp->GetKnum(); n++) {
+ colp= (PCOL)tdbp->Key(n);
if (colp->GetColUse(U_NULLS))
kp++; // Skip null byte
- valp= tdbp->To_Link[n]->GetValue();
+ valp= tdbp->Link(n)->GetValue();
if (!valp->IsTypeNum()) {
if (colp->GetColUse(U_VAR)) {
@@ -840,7 +840,7 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
bool b, rcb;
PVAL valp;
PCOL colp;
- PTDBDOX tdbp;
+ PTDBDOS tdbp;
XXBASE *xbp;
if (!ptdb)
@@ -865,35 +865,35 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
return k[1] - k[0] + 1;
} else
- tdbp= (PTDBDOX)ptdb;
+ tdbp= (PTDBDOS)ptdb;
- if (!tdbp->To_Kindex || !tdbp->To_Link) {
- if (!tdbp->To_Xdp) {
- sprintf(g->Message, "Index not initialized for table %s", tdbp->Name);
+ if (!tdbp->GetKindex() || !tdbp->GetLink()) {
+ if (!tdbp->GetXdp()) {
+ sprintf(g->Message, "Index not initialized for table %s", tdbp->GetName());
DBUG_PRINT("Range", ("%s", g->Message));
return -1;
} else // Dynamic index
- return tdbp->To_Xdp->GetMaxSame(); // TODO a better estimate
+ return tdbp->GetXdp()->GetMaxSame(); // TODO a better estimate
} else
- xbp= (XXBASE*)tdbp->To_Kindex;
+ xbp= (XXBASE*)tdbp->GetKindex();
for (b= false, i= 0; i < 2; i++) {
p= kp= key[i];
if (kp) {
- for (n= 0; n < tdbp->Knum; n++) {
+ for (n= 0; n < tdbp->GetKnum(); n++) {
if (kmap[i] & (key_part_map)(1 << n)) {
if (b == true)
// Cannot do indexing with missing intermediate key
return -1;
- colp= (PCOL)tdbp->To_Key_Col[n];
+ colp= (PCOL)tdbp->Key(n);
if (colp->GetColUse(U_NULLS))
p++; // Skip null byte ???
- valp= tdbp->To_Link[n]->GetValue();
+ valp= tdbp->Link(n)->GetValue();
if (!valp->IsTypeNum()) {
if (colp->GetColUse(U_VAR)) {
diff --git a/storage/connect/connect.h b/storage/connect/connect.h
index cf0373ba635..af1b9ba726e 100644
--- a/storage/connect/connect.h
+++ b/storage/connect/connect.h
@@ -46,6 +46,7 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
bool *incl, key_part_map *kmap);
PGLOBAL CntExit(PGLOBAL g);
+#if 0
/***********************************************************************/
/* Definition of classes XKPDEF, DOXDEF, TDBDOX */
/* These classes purpose is chiefly to access protected items! */
@@ -76,3 +77,4 @@ class XKPDEF: public KPARTDEF {
public:
XKPDEF(const char *name, int n) : KPARTDEF((PSZ)name, n) {}
}; // end of class XKPDEF
+#endif // 0
diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp
index e76dc496246..f7866b9dae1 100644
--- a/storage/connect/filamzip.cpp
+++ b/storage/connect/filamzip.cpp
@@ -700,7 +700,7 @@ bool UNZIPUTL::openEntry(PGLOBAL g)
} // endif rc
if (trace(1))
- htrc("Openning entry%s %s\n", fn, (entryopen) ? "oked" : "failed");
+ htrc("Opening entry%s %s\n", fn, (entryopen) ? "oked" : "failed");
return !entryopen;
} // end of openEntry
diff --git a/storage/connect/filter.h b/storage/connect/filter.h
index b0fea3d69e0..c6ab8fddd35 100644
--- a/storage/connect/filter.h
+++ b/storage/connect/filter.h
@@ -48,7 +48,6 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */
PVAL &Val(int i) {return Test[i].Value;}
bool &Conv(int i) {return Test[i].Conv;}
void SetNext(PFIL filp) {Next = filp;}
- bool MakeSelector(PGLOBAL g, PSTRG s);
// Methods
virtual void Reset(void);
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index da9c41ba247..d64ed0022ed 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -170,9 +170,13 @@
#define JSONMAX 10 // JSON Default max grp size
extern "C" {
+<<<<<<< HEAD
char version[]= "Version 1.06.0010 August 22, 2019";
+=======
+ char version[]= "Version 1.07.0001 November 12, 2019";
+>>>>>>> 51e9381dcc01ebd72d4f0adc057a64213f850d70
#if defined(__WIN__)
- char compver[]= "Version 1.06.0010 " __DATE__ " " __TIME__;
+ char compver[]= "Version 1.07.0001 " __DATE__ " " __TIME__;
char slash= '\\';
#else // !__WIN__
char slash= '/';
@@ -704,9 +708,9 @@ DllExport LPCSTR PlugSetPath(LPSTR to, LPCSTR name, LPCSTR dir)
used by the default rename_table and delete_table method in
handler.cc.
- For engines that have two file name extentions (separate meta/index file
+ For engines that have two file name extensions (separate meta/index file
and data file), the order of elements is relevant. First element of engine
- file name extentions array should be meta/index file extention. Second
+ file name extensions array should be meta/index file extention. Second
element - data file extention. This order is assumed by
prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued.
@@ -1043,6 +1047,8 @@ TABTYPE ha_connect::GetRealType(PTOS pos)
case TAB_REST:
type = TAB_NIY;
break;
+ default:
+ break;
} // endswitch type
#endif // REST_SUPPORT
@@ -2962,10 +2968,19 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
case Item_func::LE_FUNC: vop= OP_LE; break;
case Item_func::GE_FUNC: vop= OP_GE; break;
case Item_func::GT_FUNC: vop= OP_GT; break;
+<<<<<<< HEAD
//case Item_func::LIKE_FUNC:
// vop= OP_LIKE;
// neg= ((Item_func_like *)condf)->negated;
// break;
+=======
+#if MYSQL_VERSION_ID > 100200
+ case Item_func::LIKE_FUNC:
+ vop = OP_LIKE;
+ neg= ((Item_func_like*)condf)->negated;
+ break;
+#endif // VERSION_ID > 100200
+>>>>>>> 51e9381dcc01ebd72d4f0adc057a64213f850d70
case Item_func::ISNOTNULL_FUNC:
neg= true;
// fall through
@@ -3783,9 +3798,9 @@ int ha_connect::index_init(uint idx, bool sorted)
active_index= MAX_KEY;
rc= HA_ERR_INTERNAL_ERROR;
} else if (tdbp->GetKindex()) {
- if (((PTDBDOX)tdbp)->To_Kindex->GetNum_K()) {
+ if (((PTDBDOS)tdbp)->GetKindex()->GetNum_K()) {
if (tdbp->GetFtype() != RECFM_NAF)
- ((PTDBDOX)tdbp)->GetTxfp()->ResetBuffer(g);
+ ((PTDBDOS)tdbp)->GetTxfp()->ResetBuffer(g);
active_index= idx;
// } else { // Void table
@@ -4503,7 +4518,9 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, const char *dbn, bool
case TAB_OEM:
if (table && table->pos_in_table_list) // if SELECT
{
- Switch_to_definer_security_ctx backup_ctx(thd, table->pos_in_table_list);
+#if MYSQL_VERSION_ID > 100200
+ Switch_to_definer_security_ctx backup_ctx(thd, table->pos_in_table_list);
+#endif // VERSION_ID > 100200
return check_global_access(thd, FILE_ACL);
}
else
@@ -5630,6 +5647,8 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
case TAB_CSV:
ttp = TAB_REST;
break;
+ default:
+ break;
} // endswitch type
#endif // REST_SUPPORT
} // endif ttp
@@ -6039,7 +6058,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
} // endif !nblin
for (i= 0; !rc && i < qrp->Nblin; i++) {
- typ= len= prec= dec= 0;
+ typ= len= prec= dec= flg= 0;
tm= NOT_NULL_FLAG;
cnm= (char*)"noname";
dft= xtra= key= fmt= tn= NULL;
@@ -6080,6 +6099,9 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
tm= 0; // Nullable
break;
+ case FLD_FLAG:
+ flg = crp->Kdata->GetIntValue(i);
+ break;
case FLD_FORMAT:
fmt= (crp->Kdata) ? crp->Kdata->GetCharValue(i) : NULL;
break;
@@ -6210,7 +6232,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
// Now add the field
if (add_field(&sql, cnm, typ, prec, dec, key, tm, rem, dft, xtra,
- fmt, 0, dbf, v))
+ fmt, flg, dbf, v))
rc= HA_ERR_OUT_OF_MEM;
} // endfor i
@@ -7362,14 +7384,14 @@ maria_declare_plugin(connect)
&connect_storage_engine,
"CONNECT",
"Olivier Bertrand",
- "Management of External Data (SQL/NOSQL/MED), including many file formats",
+ "Management of External Data (SQL/NOSQL/MED), including Rest query results",
PLUGIN_LICENSE_GPL,
connect_init_func, /* Plugin Init */
connect_done_func, /* Plugin Deinit */
- 0x0106, /* version number (1.06) */
+ 0x0107, /* version number (1.07) */
NULL, /* status variables */
connect_system_variables, /* system variables */
- "1.06.0010", /* string version */
+ "1.07.0001", /* string version */
MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
}
maria_declare_plugin_end;
diff --git a/storage/connect/javaconn.cpp b/storage/connect/javaconn.cpp
index f919344f20b..e3f64d17064 100644
--- a/storage/connect/javaconn.cpp
+++ b/storage/connect/javaconn.cpp
@@ -142,7 +142,7 @@ bool JAVAConn::Check(jint rc)
s = (jstring)env->CallObjectMethod(exc, tid);
Msg = GetUTFString(s);
} else
- Msg = "Exception occured";
+ Msg = "Exception occurred";
env->ExceptionClear();
} else if (rc < 0) {
diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc
index 411e96e3dc8..f8b3dc03aa5 100644
--- a/storage/connect/mycat.cc
+++ b/storage/connect/mycat.cc
@@ -95,7 +95,7 @@
#endif // ZIP_SUPPORT
#if defined(REST_SUPPORT)
#include "tabrest.h"
-#endif // Rest_SUPPORT
+#endif // REST_SUPPORT
#include "mycat.h"
/***********************************************************************/
@@ -104,8 +104,9 @@
#if defined(__WIN__)
extern "C" HINSTANCE s_hModule; // Saved module handle
#endif // !__WIN__
-
-PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info);
+#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT)
+bool MongoEnabled(void);
+#endif // JAVA_SUPPORT || CMGO_SUPPORT
/***********************************************************************/
/* Get the plugin directory. */
@@ -347,100 +348,6 @@ uint GetFuncID(const char *func)
return fnc;
} // end of GetFuncID
-/***********************************************************************/
-/* OEMColumn: Get table column info for an OEM table. */
-/***********************************************************************/
-PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info)
- {
- typedef PQRYRES (__stdcall *XCOLDEF) (PGLOBAL, void*, char*, char*, bool);
- const char *module, *subtype;
- char c, soname[_MAX_PATH], getname[40] = "Col";
-#if defined(__WIN__)
- HANDLE hdll; /* Handle to the external DLL */
-#else // !__WIN__
- void *hdll; /* Handle for the loaded shared library */
-#endif // !__WIN__
- XCOLDEF coldef = NULL;
- PQRYRES qrp = NULL;
-
- module = topt->module;
- subtype = topt->subtype;
-
- if (!module || !subtype)
- return NULL;
-
- /*********************************************************************/
- /* Ensure that the .dll doesn't have a path. */
- /* This is done to ensure that only approved dll from the system */
- /* directories are used (to make this even remotely secure). */
- /*********************************************************************/
- if (check_valid_path(module, strlen(module))) {
- strcpy(g->Message, "Module cannot contain a path");
- return NULL;
- } else
- PlugSetPath(soname, module, GetPluginDir());
-
- // The exported name is always in uppercase
- for (int i = 0; ; i++) {
- c = subtype[i];
- getname[i + 3] = toupper(c);
- if (!c) break;
- } // endfor i
-
-#if defined(__WIN__)
- // Load the Dll implementing the table
- if (!(hdll = LoadLibrary(soname))) {
- char buf[256];
- DWORD rc = GetLastError();
-
- sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, soname);
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0,
- (LPTSTR)buf, sizeof(buf), NULL);
- strcat(strcat(g->Message, ": "), buf);
- return NULL;
- } // endif hDll
-
- // Get the function returning an instance of the external DEF class
- if (!(coldef = (XCOLDEF)GetProcAddress((HINSTANCE)hdll, getname))) {
- sprintf(g->Message, MSG(PROCADD_ERROR), GetLastError(), getname);
- FreeLibrary((HMODULE)hdll);
- return NULL;
- } // endif coldef
-#else // !__WIN__
- const char *error = NULL;
-
- // Load the desired shared library
- if (!(hdll = dlopen(soname, RTLD_LAZY))) {
- error = dlerror();
- sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error));
- return NULL;
- } // endif Hdll
-
- // Get the function returning an instance of the external DEF class
- if (!(coldef = (XCOLDEF)dlsym(hdll, getname))) {
- error = dlerror();
- sprintf(g->Message, MSG(GET_FUNC_ERR), getname, SVP(error));
- dlclose(hdll);
- return NULL;
- } // endif coldef
-#endif // !__WIN__
-
- // Just in case the external Get function does not set error messages
- sprintf(g->Message, "Error getting column info from %s", subtype);
-
- // Get the table column definition
- qrp = coldef(g, topt, tab, db, info);
-
-#if defined(__WIN__)
- FreeLibrary((HMODULE)hdll);
-#else // !__WIN__
- dlclose(hdll);
-#endif // !__WIN__
-
- return qrp;
- } // end of OEMColumns
-
/* ------------------------- Class CATALOG --------------------------- */
/***********************************************************************/
@@ -481,10 +388,10 @@ void MYCAT::Reset(void)
/* GetTableDesc: retrieve a table descriptor. */
/* Look for a table descriptor matching the name and type. */
/***********************************************************************/
-PRELDEF MYCAT::GetTableDesc(PGLOBAL g, PTABLE tablep,
+PTABDEF MYCAT::GetTableDesc(PGLOBAL g, PTABLE tablep,
LPCSTR type, PRELDEF *)
{
- PRELDEF tdp= NULL;
+ PTABDEF tdp= NULL;
if (trace(1))
htrc("GetTableDesc: name=%s am=%s\n", tablep->GetName(), SVP(type));
@@ -505,12 +412,12 @@ PRELDEF MYCAT::GetTableDesc(PGLOBAL g, PTABLE tablep,
/* MakeTableDesc: make a table/view description. */
/* Note: caller must check if name already exists before calling it. */
/***********************************************************************/
-PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am)
+PTABDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am)
{
TABTYPE tc;
LPCSTR name= (PSZ)PlugDup(g, tablep->GetName());
LPCSTR schema= (PSZ)PlugDup(g, tablep->GetSchema());
- PRELDEF tdp= NULL;
+ PTABDEF tdp= NULL;
if (trace(1))
htrc("MakeTableDesc: name=%s schema=%s am=%s\n",
@@ -578,8 +485,8 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am)
} // endswitch
// Do make the table/view definition
- if (tdp && tdp->Define(g, this, name, schema, am))
- tdp= NULL;
+ if (tdp && tdp->Define(g, this, name, schema, am))
+ tdp = NULL;
if (trace(1))
htrc("Table %s made\n", am);
@@ -592,7 +499,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am)
/***********************************************************************/
PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type)
{
- PRELDEF tdp;
+ PTABDEF tdp;
PTDB tdbp= NULL;
// LPCSTR name= tablep->GetName();
diff --git a/storage/connect/mycat.h b/storage/connect/mycat.h
index 818e535b32d..6473f7a5c11 100644
--- a/storage/connect/mycat.h
+++ b/storage/connect/mycat.h
@@ -102,14 +102,14 @@ class MYCAT : public CATALOG {
// Methods
void Reset(void);
bool StoreIndex(PGLOBAL, PTABDEF) {return false;} // Temporary
- PRELDEF GetTableDesc(PGLOBAL g, PTABLE tablep,
+ PTABDEF GetTableDesc(PGLOBAL g, PTABLE tablep,
LPCSTR type, PRELDEF *prp = NULL);
PTDB GetTable(PGLOBAL g, PTABLE tablep,
MODE mode = MODE_READ, LPCSTR type = NULL);
void ClearDB(PGLOBAL g);
protected:
- PRELDEF MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am);
+ PTABDEF MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am);
// Members
ha_connect *Hc; // The Connect handler
diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp
index 6de5a73875c..4303a9e191b 100644
--- a/storage/connect/myconn.cpp
+++ b/storage/connect/myconn.cpp
@@ -472,7 +472,7 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db,
int pt, const char *csname)
{
const char *pipe = NULL;
- uint cto = 10, nrt = 20;
+ //uint cto = 10, nrt = 20;
my_bool my_true= 1;
m_DB = mysql_init(NULL);
@@ -485,11 +485,11 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db,
if (trace(1))
htrc("MYSQLC Open: m_DB=%.4X size=%d\n", m_DB, (int)sizeof(*m_DB));
- // Removed to do like FEDERATED do
+ // Removed to do like FEDERATED does
//mysql_options(m_DB, MYSQL_READ_DEFAULT_GROUP, "client-mariadb");
- mysql_options(m_DB, MYSQL_OPT_USE_REMOTE_CONNECTION, NULL);
- mysql_options(m_DB, MYSQL_OPT_CONNECT_TIMEOUT, &cto);
- mysql_options(m_DB, MYSQL_OPT_READ_TIMEOUT, &nrt);
+//mysql_options(m_DB, MYSQL_OPT_USE_REMOTE_CONNECTION, NULL);
+//mysql_options(m_DB, MYSQL_OPT_CONNECT_TIMEOUT, &cto);
+//mysql_options(m_DB, MYSQL_OPT_READ_TIMEOUT, &nrt);
//mysql_options(m_DB, MYSQL_OPT_WRITE_TIMEOUT, ...);
#if defined(__WIN__)
diff --git a/storage/connect/mysql-test/connect/disabled.def b/storage/connect/mysql-test/connect/disabled.def
index 1de4deb0a60..a4d629fc3d1 100644
--- a/storage/connect/mysql-test/connect/disabled.def
+++ b/storage/connect/mysql-test/connect/disabled.def
@@ -20,4 +20,5 @@ mongo_c : Need MongoDB running and its C Driver installed
mongo_java_2 : Need MongoDB running and its Java Driver installed
mongo_java_3 : Need MongoDB running and its Java Driver installed
tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed
+grant2 : Until fixed
#vcol : Different error code on different versions
diff --git a/storage/connect/mysql-test/connect/t/ini_grant.result b/storage/connect/mysql-test/connect/t/ini_grant.result
new file mode 100644
index 00000000000..96d5e192c7d
--- /dev/null
+++ b/storage/connect/mysql-test/connect/t/ini_grant.result
@@ -0,0 +1,89 @@
+#
+# Checking FILE privileges
+#
+set sql_mode="";
+GRANT ALL PRIVILEGES ON *.* TO user@localhost;
+REVOKE FILE ON *.* FROM user@localhost;
+set sql_mode=default;
+connect user,localhost,user,,;
+connection user;
+SELECT user();
+user()
+user@localhost
+CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI;
+Warnings:
+Warning 1105 No file name. Table will use t1.ini
+INSERT INTO t1 VALUES ('sec1','val1');
+SELECT * FROM t1;
+sec val
+sec1 val1
+UPDATE t1 SET val='val11';
+SELECT * FROM t1;
+sec val
+sec1 val11
+DELETE FROM t1;
+SELECT * FROM t1;
+sec val
+INSERT INTO t1 VALUES('sec2','val2');
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+sec val
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM v1;
+sec val
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+connection default;
+SELECT user();
+user()
+root@localhost
+CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
+INSERT INTO t1 VALUES ('sec1','val1');
+connection user;
+SELECT user();
+user()
+user@localhost
+INSERT INTO t1 VALUES ('sec2','val2');
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+SELECT * FROM t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+UPDATE t1 SET val='val11';
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+DELETE FROM t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+TRUNCATE TABLE t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+ALTER TABLE t1 READONLY=1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+DROP TABLE t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+CREATE VIEW v1 AS SELECT * FROM t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
+SELECT user();
+user()
+root@localhost
+CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
+SELECT user();
+user()
+user@localhost
+SELECT * FROM v1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+INSERT INTO v1 VALUES ('sec3','val3');
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+UPDATE v1 SET val='val11';
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+DELETE FROM v1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+disconnect user;
+connection default;
+DROP VIEW v1;
+DROP TABLE t1;
+DROP USER user@localhost;
+#
+# Checking FILE privileges: done
+#
diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h
index f10ae209e9d..a40e32bcfb2 100644
--- a/storage/connect/plgdbsem.h
+++ b/storage/connect/plgdbsem.h
@@ -149,16 +149,22 @@ enum AMT {TYPE_AM_ERROR = 0, /* Type not defined */
TYPE_AM_MGO = 194, /* MGO access method type no */
TYPE_AM_OUT = 200}; /* Output relations (storage) */
-enum RECFM {RECFM_NAF = -2, /* Not a file */
- RECFM_OEM = -1, /* OEM file access method */
- RECFM_VAR = 0, /* Varying length DOS files */
- RECFM_FIX = 1, /* Fixed length DOS files */
- RECFM_BIN = 2, /* Binary DOS files (also fixed) */
- RECFM_VCT = 3, /* VCT formatted files */
- RECFM_ODBC = 4, /* Table accessed via ODBC */
- RECFM_JDBC = 5, /* Table accessed via JDBC */
- RECFM_PLG = 6, /* Table accessed via PLGconn */
- RECFM_DBF = 7}; /* DBase formatted file */
+enum RECFM {RECFM_DFLT = 0, /* Default table type */
+ RECFM_NAF = 1, /* Not a file table */
+ RECFM_OEM = 2, /* OEM table */
+ RECFM_VAR = 3, /* Varying length DOS files */
+ RECFM_FIX = 4, /* Fixed length DOS files */
+ RECFM_BIN = 5, /* Binary DOS files (also fixed) */
+ RECFM_DBF = 6, /* DBase formatted file */
+ RECFM_CSV = 7, /* CSV file */
+ RECFM_FMT = 8, /* FMT formatted file */
+ RECFM_VCT = 9, /* VCT formatted files */
+ RECFM_XML = 10, /* XML formatted files */
+ RECFM_JASON = 11, /* JASON formatted files */
+ RECFM_DIR = 12, /* DIR table */
+ RECFM_ODBC = 13, /* Table accessed via ODBC */
+ RECFM_JDBC = 14, /* Table accessed via JDBC */
+ RECFM_PLG = 15}; /* Table accessed via PLGconn */
enum MISC {DB_TABNO = 1, /* DB routines in Utility Table */
MAX_MULT_KEY = 10, /* Max multiple key number */
@@ -537,7 +543,8 @@ enum XFLD {FLD_NO = 0, /* Not a field definition item */
FLD_FORMAT = 16, /* Field format */
FLD_CAT = 17, /* Table catalog */
FLD_SCHEM = 18, /* Table schema */
- FLD_TABNAME = 19}; /* Column Table name */
+ FLD_TABNAME = 19, /* Column Table name */
+ FLD_FLAG = 20}; /* Field flag (CONNECT specific) */
/***********************************************************************/
/* Result of last SQL noconv query. */
diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp
index 8ba8aac3621..2d3c6a6aacd 100644
--- a/storage/connect/reldef.cpp
+++ b/storage/connect/reldef.cpp
@@ -1,11 +1,11 @@
/************* RelDef CPP Program Source Code File (.CPP) **************/
/* PROGRAM NAME: RELDEF */
/* ------------- */
-/* Version 1.6 */
+/* Version 1.7 */
/* */
/* COPYRIGHT: */
/* ---------- */
-/* (C) Copyright to the author Olivier BERTRAND 2004-2016 */
+/* (C) Copyright to the author Olivier BERTRAND 2004-2019 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@@ -20,7 +20,7 @@
#if defined(__WIN__)
#include <sqlext.h>
#else
-#include <dlfcn.h> // dlopen(), dlclose(), dlsym() ...
+//#include <dlfcn.h> // dlopen(), dlclose(), dlsym() ...
#include "osutil.h"
//#include "sqlext.h"
#endif
@@ -61,6 +61,102 @@ extern handlerton *connect_hton;
/***********************************************************************/
USETEMP UseTemp(void);
char *GetPluginDir(void);
+PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char* tab, char* db, bool info);
+
+/***********************************************************************/
+/* OEMColumns: Get table column info for an OEM table. */
+/***********************************************************************/
+PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char* tab, char* db, bool info)
+{
+ typedef PQRYRES(__stdcall* XCOLDEF) (PGLOBAL, void*, char*, char*, bool);
+ const char* module, * subtype;
+ char c, soname[_MAX_PATH], getname[40] = "Col";
+#if defined(__WIN__)
+ HANDLE hdll; /* Handle to the external DLL */
+#else // !__WIN__
+ void* hdll; /* Handle for the loaded shared library */
+#endif // !__WIN__
+ XCOLDEF coldef = NULL;
+ PQRYRES qrp = NULL;
+
+ module = topt->module;
+ subtype = topt->subtype;
+
+ if (!module || !subtype)
+ return NULL;
+
+ /*********************************************************************/
+ /* Ensure that the .dll doesn't have a path. */
+ /* This is done to ensure that only approved dll from the system */
+ /* directories are used (to make this even remotely secure). */
+ /*********************************************************************/
+ if (check_valid_path(module, strlen(module))) {
+ strcpy(g->Message, "Module cannot contain a path");
+ return NULL;
+ }
+ else
+ PlugSetPath(soname, module, GetPluginDir());
+
+ // The exported name is always in uppercase
+ for (int i = 0; ; i++) {
+ c = subtype[i];
+ getname[i + 3] = toupper(c);
+ if (!c) break;
+ } // endfor i
+
+#if defined(__WIN__)
+ // Load the Dll implementing the table
+ if (!(hdll = LoadLibrary(soname))) {
+ char buf[256];
+ DWORD rc = GetLastError();
+
+ sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, soname);
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0,
+ (LPTSTR)buf, sizeof(buf), NULL);
+ strcat(strcat(g->Message, ": "), buf);
+ return NULL;
+ } // endif hDll
+
+// Get the function returning an instance of the external DEF class
+ if (!(coldef = (XCOLDEF)GetProcAddress((HINSTANCE)hdll, getname))) {
+ sprintf(g->Message, MSG(PROCADD_ERROR), GetLastError(), getname);
+ FreeLibrary((HMODULE)hdll);
+ return NULL;
+ } // endif coldef
+#else // !__WIN__
+ const char* error = NULL;
+
+ // Load the desired shared library
+ if (!(hdll = dlopen(soname, RTLD_LAZY))) {
+ error = dlerror();
+ sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error));
+ return NULL;
+ } // endif Hdll
+
+// Get the function returning an instance of the external DEF class
+ if (!(coldef = (XCOLDEF)dlsym(hdll, getname))) {
+ error = dlerror();
+ sprintf(g->Message, MSG(GET_FUNC_ERR), getname, SVP(error));
+ dlclose(hdll);
+ return NULL;
+ } // endif coldef
+#endif // !__WIN__
+
+ // Just in case the external Get function does not set error messages
+ sprintf(g->Message, "Error getting column info from %s", subtype);
+
+ // Get the table column definition
+ qrp = coldef(g, topt, tab, db, info);
+
+#if defined(__WIN__)
+ FreeLibrary((HMODULE)hdll);
+#else // !__WIN__
+ dlclose(hdll);
+#endif // !__WIN__
+
+ return qrp;
+} // end of OEMColumns
/* --------------------------- Class RELDEF -------------------------- */
@@ -208,6 +304,7 @@ TABDEF::TABDEF(void)
{
Schema = NULL;
Desc = NULL;
+ Recfm = RECFM_DFLT;
Catfunc = FNC_NO;
Card = 0;
Elemt = 0;
@@ -221,11 +318,38 @@ TABDEF::TABDEF(void)
} // end of TABDEF constructor
/***********************************************************************/
+/* Return the table format. */
+/***********************************************************************/
+RECFM TABDEF::GetTableFormat(const char* type)
+{
+ RECFM recfm = Recfm;
+
+ if (Catfunc != FNC_NO)
+ recfm = RECFM_NAF;
+ else if (recfm == RECFM_DFLT)
+ // Default format depends on the table type
+ switch (GetTypeID(type)) {
+ case TAB_DOS: recfm = RECFM_VAR; break;
+ case TAB_CSV: recfm = RECFM_CSV; break;
+ case TAB_FMT: recfm = RECFM_FMT; break;
+ case TAB_FIX: recfm = RECFM_FIX; break;
+ case TAB_BIN: recfm = RECFM_BIN; break;
+ case TAB_VEC: recfm = RECFM_VCT; break;
+ case TAB_DBF: recfm = RECFM_DBF; break;
+ case TAB_XML: recfm = RECFM_XML; break;
+ case TAB_DIR: recfm = RECFM_DIR; break;
+ default: recfm = RECFM_NAF; break;
+ } // endswitch type
+
+ return recfm;
+} // end of GetTableFormat
+
+/***********************************************************************/
/* Define: initialize the table definition block from XDB file. */
/***********************************************************************/
bool TABDEF::Define(PGLOBAL g, PCATLG cat,
LPCSTR name, LPCSTR schema, LPCSTR am)
- {
+{
int poff = 0;
Hc = ((MYCAT*)cat)->GetHandler();
@@ -243,13 +367,17 @@ bool TABDEF::Define(PGLOBAL g, PCATLG cat,
NULL;
csname = GetStringCatInfo(g, "Table_charset", NULL);
- // Get The column definitions
- if ((poff = GetColCatInfo(g)) < 0)
- return true;
+ // Do the definition of AM specific fields
+ if (DefineAM(g, am, 0))
+ return true;
- // Do the definition of AM specific fields
- return DefineAM(g, am, poff);
- } // end of Define
+ // Get The column definitions
+ if (stricmp(am, "OEM") && GetColCatInfo(g) < 0)
+ return true;
+
+ Hc->tshp = NULL; // TO BE CHECKED
+ return false;
+} // end of Define
/***********************************************************************/
/* This function returns the database data path. */
@@ -264,71 +392,71 @@ PCSZ TABDEF::GetPath(void)
/***********************************************************************/
int TABDEF::GetColCatInfo(PGLOBAL g)
{
- char *type= GetStringCatInfo(g, "Type", "*");
+ char *type = GetStringCatInfo(g, "Type", "*");
char c, fty, eds;
int i, n, loff, poff, nof, nlg;
- void *field= NULL;
- TABTYPE tc;
- PCOLDEF cdp, lcdp= NULL, tocols= NULL;
+ void *field = NULL;
+ RECFM trf;
+ PCOLDEF cdp, lcdp = NULL, tocols= NULL;
PCOLINFO pcf= (PCOLINFO)PlugSubAlloc(g, NULL, sizeof(COLINFO));
memset(pcf, 0, sizeof(COLINFO));
- // Get a unique char identifier for type
- tc= (Catfunc == FNC_NO) ? GetTypeID(type) : TAB_PRX;
+ // Get the table format
+ trf = GetTableFormat(type);
// Take care of the column definitions
i= poff= nof= nlg= 0;
#if defined(__WIN__)
// Offsets of HTML and DIR tables start from 0, DBF at 1
- loff= (tc == TAB_DBF) ? 1 : (tc == TAB_XML || tc == TAB_DIR) ? -1 : 0;
+ loff= (trf == RECFM_DBF) ? 1 : (trf == RECFM_XML || trf == RECFM_DIR) ? -1 : 0;
#else // !__WIN__
// Offsets of HTML tables start from 0, DIR and DBF at 1
- loff = (tc == TAB_DBF || tc == TAB_DIR) ? 1 : (tc == TAB_XML) ? -1 : 0;
+ loff = (trf == RECFM_DBF || trf == RECFM_DIR) ? 1 : (trf == RECFM_XML) ? -1 : 0;
#endif // !__WIN__
while (true) {
- // Default Offset depends on table type
- switch (tc) {
- case TAB_DOS:
- case TAB_FIX:
- case TAB_BIN:
- case TAB_VEC:
- case TAB_DBF:
+ // Default Offset depends on table format
+ switch (trf ) {
+ case RECFM_VAR:
+ case RECFM_FIX:
+ case RECFM_BIN:
+ case RECFM_VCT:
+ case RECFM_DBF:
poff= loff + nof; // Default next offset
nlg= MY_MAX(nlg, poff); // Default lrecl
break;
- case TAB_CSV:
- case TAB_FMT:
+ case RECFM_CSV:
+ case RECFM_FMT:
nlg+= nof;
- case TAB_DIR:
- case TAB_XML:
+ case RECFM_DIR:
+ case RECFM_XML:
poff= loff + (pcf->Flags & U_VIRTUAL ? 0 : 1);
break;
- case TAB_INI:
- case TAB_MAC:
- case TAB_TBL:
- case TAB_XCL:
- case TAB_OCCUR:
- case TAB_PRX:
- case TAB_OEM:
+ //case RECFM_INI:
+ //case RECFM_MAC:
+ //case RECFM_TBL:
+ //case RECFM_XCL:
+ //case RECFM_OCCUR:
+ //case RECFM_PRX:
+ case RECFM_OEM:
poff = 0; // Offset represents an independant flag
break;
- default: // VCT PLG ODBC JDBC MYSQL WMI...
+ default: // PLG ODBC JDBC MYSQL WMI...
poff = 0; // NA
break;
- } // endswitch tc
+ } // endswitch trf
// do {
field= Hc->GetColumnOption(g, field, pcf);
// } while (field && (*pcf->Name =='*' /*|| pcf->Flags & U_VIRTUAL*/));
- if (tc == TAB_DBF && pcf->Type == TYPE_DATE && !pcf->Datefmt) {
+ if (trf == RECFM_DBF && pcf->Type == TYPE_DATE && !pcf->Datefmt) {
// DBF date format defaults to 'YYYMMDD'
pcf->Datefmt= "YYYYMMDD";
pcf->Length= 8;
- } // endif tc
+ } // endif trf
if (!field)
break;
@@ -341,10 +469,10 @@ int TABDEF::GetColCatInfo(PGLOBAL g)
else
loff= cdp->GetOffset();
- switch (tc) {
- case TAB_VEC:
+ switch (trf ) {
+ case RECFM_VCT:
cdp->SetOffset(0); // Not to have shift
- case TAB_BIN:
+ case RECFM_BIN:
// BIN/VEC are packed by default
if (nof) {
// Field width is the internal representation width
@@ -395,7 +523,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g)
default:
break;
- } // endswitch tc
+ } // endswitch trf
if (lcdp)
lcdp->SetNext(cdp);
@@ -413,21 +541,15 @@ int TABDEF::GetColCatInfo(PGLOBAL g)
if (GetDefType() == TYPE_AM_DOS) {
int ending, recln= 0;
- // Was commented because sometimes ending is 0 even when
- // not specified (for instance if quoted is specified)
-// if ((ending= Hc->GetIntegerOption("Ending")) < 0) {
- if ((ending= Hc->GetIntegerOption("Ending")) <= 0) {
- ending= (tc == TAB_BIN || tc == TAB_VEC) ? 0 : CRLF;
- Hc->SetIntegerOption("Ending", ending);
- } // endif ending
+ ending = Hc->GetIntegerOption("Ending");
// Calculate the default record size
- switch (tc) {
- case TAB_FIX:
- case TAB_BIN:
+ switch (trf ) {
+ case RECFM_FIX:
+ case RECFM_BIN:
recln= nlg + ending; // + length of line ending
break;
- case TAB_VEC:
+ case RECFM_VCT:
recln= nlg;
// if ((k= (pak < 0) ? 8 : pak) > 1)
@@ -436,18 +558,18 @@ int TABDEF::GetColCatInfo(PGLOBAL g)
// recln= ((recln + k - 1) / k) * k;
break;
- case TAB_DOS:
- case TAB_DBF:
+ case RECFM_VAR:
+ case RECFM_DBF:
recln= nlg;
break;
- case TAB_CSV:
- case TAB_FMT:
+ case RECFM_CSV:
+ case RECFM_FMT:
// The number of separators (assuming an extra one can exist)
// recln= poff * ((qotd) ? 3 : 1); to be investigated
recln= nlg + poff * 3; // To be safe
default:
break;
- } // endswitch tc
+ } // endswitch trf
// lrecl must be at least recln to avoid buffer overflow
if (trace(1))
@@ -461,7 +583,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g)
if (trace(1))
htrc("Lrecl set to %d\n", recln);
- } // endif Lrecl
+ } // endif TYPE
// Attach the column definition to the tabdef
SetCols(tocols);
@@ -500,7 +622,8 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
return NULL;
} else
// PlugSetPath(soname, Module, GetPluginDir()); // Crashes on Fedora
- strncat(strcpy(soname, GetPluginDir()), Module, _MAX_PATH);
+ strncat(strcpy(soname, GetPluginDir()), Module,
+ sizeof(soname) - strlen(soname) - 1);
#if defined(__WIN__)
// Is the DLL already loaded?
@@ -596,10 +719,6 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
cat->Cbuf = (char*)PlugSubAlloc(g, NULL, cat->Cblen);
} // endif Cbuf
- // Here "OEM" should be replace by a more useful value
- if (xdefp->Define(g, cat, Name, Schema, "OEM"))
- return NULL;
-
// Ok, return external block
return xdefp;
} // end of GetXdef
@@ -622,7 +741,7 @@ bool OEMDEF::DeleteTableFile(PGLOBAL g)
/***********************************************************************/
bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR, int)
{
- Module = GetStringCatInfo(g, "Module", "");
+ Module = GetStringCatInfo(g, "Module", "");
Subtype = GetStringCatInfo(g, "Subtype", Module);
if (!*Module)
@@ -632,7 +751,13 @@ bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR, int)
+ strlen(Subtype) + 3);
sprintf(desc, "%s(%s)", Module, Subtype);
Desc = desc;
- return false;
+
+ // If define block not here yet, get it now
+ if (!Pxdef && !(Pxdef = GetXdef(g)))
+ return true; // Error
+
+ // Here "OEM" should be replace by a more useful value
+ return Pxdef->Define(g, Cat, Name, Schema, Subtype);
} // end of DefineAM
/***********************************************************************/
@@ -640,7 +765,6 @@ bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR, int)
/***********************************************************************/
PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode)
{
- RECFM rfm;
PTDB tdbp = NULL;
// If define block not here yet, get it now
@@ -653,18 +777,10 @@ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode)
/*********************************************************************/
if (!(tdbp = Pxdef->GetTable(g, mode)))
return NULL;
- else
- rfm = tdbp->GetFtype();
-
- if (rfm == RECFM_NAF)
- return tdbp;
- else if (rfm == RECFM_OEM) {
- if (Multiple)
- tdbp = new(g) TDBMUL(tdbp); // No block optimization yet
-
- return tdbp;
- } // endif OEM
+ else if (Multiple && tdbp->GetFtype() == RECFM_OEM)
+ tdbp = new(g) TDBMUL(tdbp); // No block optimization yet
+#if 0
/*********************************************************************/
/* The OEM table is based on a file type (currently DOS+ only) */
/*********************************************************************/
@@ -723,7 +839,7 @@ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode)
if (Multiple)
tdbp = new(g) TDBMUL(tdbp);
-
+#endif // 0
return tdbp;
} // end of GetTable
diff --git a/storage/connect/reldef.h b/storage/connect/reldef.h
index f8256a59b3d..73e178ed51c 100644
--- a/storage/connect/reldef.h
+++ b/storage/connect/reldef.h
@@ -84,10 +84,12 @@ public:
void SetNext(PTABDEF tdfp) {Next = tdfp;}
int GetMultiple(void) {return Multiple;}
int GetPseudo(void) {return Pseudo;}
- PCSZ GetPath(void);
+ RECFM GetRecfm(void) {return Recfm;}
+ PCSZ GetPath(void);
//PSZ GetPath(void)
// {return (Database) ? (PSZ)Database : Cat->GetDataPath();}
- bool SepIndex(void) {return GetBoolCatInfo("SepIndex", false);}
+ RECFM GetTableFormat(const char* type);
+ bool SepIndex(void) {return GetBoolCatInfo("SepIndex", false);}
bool IsReadOnly(void) {return Read_Only;}
virtual AMT GetDefType(void) {return TYPE_AM_TAB;}
virtual PIXDEF GetIndx(void) {return NULL;}
@@ -108,7 +110,8 @@ public:
// Members
PCSZ Schema; /* Table schema (for ODBC) */
PCSZ Desc; /* Table description */
- uint Catfunc; /* Catalog function ID */
+ RECFM Recfm; /* File or table format */
+ uint Catfunc; /* Catalog function ID */
int Card; /* (max) number of rows in table */
int Elemt; /* Number of rows in blocks or rowset */
int Sort; /* Table already sorted ??? */
diff --git a/storage/connect/restget.cpp b/storage/connect/restget.cpp
index 6b184ae6926..29dae230780 100644
--- a/storage/connect/restget.cpp
+++ b/storage/connect/restget.cpp
@@ -4,12 +4,6 @@
/***********************************************************************/
#include <cpprest/filestream.h>
#include <cpprest/http_client.h>
-#if defined(MARIADB)
-#include <my_global.h>
-#else
-#include "mini-global.h"
-#define _OS_H_INCLUDED // Prevent os.h to be called
-#endif
using namespace utility::conversions; // String conversions utilities
using namespace web; // Common features like URIs.
@@ -17,24 +11,26 @@ using namespace web::http; // Common HTTP functionality
using namespace web::http::client; // HTTP client features
using namespace concurrency::streams; // Asynchronous streams
-#include "global.h"
+typedef const char* PCSZ;
+
+extern "C" int restGetFile(char* m, bool xt, PCSZ http, PCSZ uri, PCSZ fn);
/***********************************************************************/
/* Make a local copy of the requested file. */
/***********************************************************************/
-int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn)
+int restGetFile(char *m, bool xt, PCSZ http, PCSZ uri, PCSZ fn)
{
int rc = 0;
- bool xt = trace(515);
auto fileStream = std::make_shared<ostream>();
if (!http || !fn) {
- strcpy(g->Message, "Missing http or filename");
- return 2;
+ //strcpy(g->Message, "Missing http or filename");
+ strcpy(m, "Missing http or filename");
+ return 2;
} // endif
if (xt)
- htrc("restGetFile: fn=%s\n", fn);
+ fprintf(stderr, "restGetFile: fn=%s\n", fn);
// Open stream to output file.
pplx::task<void> requestTask = fstream::open_ostream(to_string_t(fn))
@@ -42,7 +38,7 @@ int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn)
*fileStream= outFile;
if (xt)
- htrc("Outfile isopen=%d\n", outFile.is_open());
+ fprintf(stderr, "Outfile isopen=%d\n", outFile.is_open());
// Create http_client to send the request.
http_client client(to_string_t(http));
@@ -58,8 +54,8 @@ int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn)
// Handle response headers arriving.
.then([=](http_response response) {
if (xt)
- htrc("Received response status code:%u\n",
- response.status_code());
+ fprintf(stderr, "Received response status code:%u\n",
+ response.status_code());
// Write response body into the file.
return response.body().read_to_end(fileStream->streambuf());
@@ -68,27 +64,27 @@ int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn)
// Close the file stream.
.then([=](size_t n) {
if (xt)
- htrc("Return size=%u\n", n);
+ fprintf(stderr, "Return size=%zu\n", n);
return fileStream->close();
});
// Wait for all the outstanding I/O to complete and handle any exceptions
try {
- requestTask.wait();
-
if (xt)
- htrc("In Wait\n");
+ fprintf(stderr, "Waiting\n");
+ requestTask.wait();
} catch (const std::exception &e) {
if (xt)
- htrc("Error exception: %s\n", e.what());
- sprintf(g->Message, "Error exception: %s", e.what());
- rc= 1;
+ fprintf(stderr, "Error exception: %s\n", e.what());
+
+ sprintf(m, "Error exception: %s", e.what());
+ rc= 1;
} // end try/catch
if (xt)
- htrc("restget done: rc=%d\n", rc);
+ fprintf(stderr, "restget done: rc=%d\n", rc);
return rc;
} // end of restGetFile
diff --git a/storage/connect/tabcmg.cpp b/storage/connect/tabcmg.cpp
index da1cfd34ac7..b9b7f6e4b60 100644
--- a/storage/connect/tabcmg.cpp
+++ b/storage/connect/tabcmg.cpp
@@ -53,25 +53,30 @@ bool CMGDISC::FindInDoc(PGLOBAL g, bson_iter_t *iter, const bson_t *doc,
{
if (!doc || bson_iter_init(iter, doc)) {
const char *key;
- char colname[65];
- char fmt[129];
- bool newcol;
+ char colname[65];
+ char fmt[129];
+ bool newcol;
+ size_t n;
while (bson_iter_next(iter)) {
key = bson_iter_key(iter);
newcol = true;
if (pcn) {
- strncpy(colname, pcn, 64);
- colname[64] = 0;
- strncat(strncat(colname, "_", 65), key, 65);
+ n = sizeof(colname) - 1;
+ strncpy(colname, pcn, n);
+ colname[n] = 0;
+ n -= strlen(colname);
+ strncat(strncat(colname, "_", n), key, n - 1);
} else
strcpy(colname, key);
if (pfmt) {
- strncpy(fmt, pfmt, 128);
- fmt[128] = 0;
- strncat(strncat(fmt, ".", 129), key, 129);
+ n = sizeof(fmt) - 1;
+ strncpy(fmt, pfmt, n);
+ fmt[n] = 0;
+ n -= strlen(fmt);
+ strncat(strncat(fmt, ".", n), key, n - 1);
} else
strcpy(fmt, key);
diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp
index 4f6e2c81744..8efe2aad702 100644
--- a/storage/connect/tabdos.cpp
+++ b/storage/connect/tabdos.cpp
@@ -45,7 +45,7 @@
#include "global.h"
#include "osutil.h"
#include "plgdbsem.h"
-#include "catalog.h"
+//#include "catalog.h"
#include "mycat.h"
#include "xindex.h"
#include "filamap.h"
@@ -161,7 +161,12 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
//Last = GetIntCatInfo("Last", 0);
Ending = GetIntCatInfo("Ending", CRLF);
- if (Recfm == RECFM_FIX || Recfm == RECFM_BIN) {
+ if (Ending <= 0) {
+ Ending = (Recfm == RECFM_BIN || Recfm == RECFM_VCT) ? 0 : CRLF;
+ SetIntCatInfo("Ending", Ending);
+ } // endif ending
+
+ if (Recfm == RECFM_FIX || Recfm == RECFM_BIN) {
Huge = GetBoolCatInfo("Huge", Cat->GetDefHuge());
Padded = GetBoolCatInfo("Padded", false);
Blksize = GetIntCatInfo("Blksize", 0);
@@ -191,7 +196,8 @@ bool DOSDEF::GetOptFileName(PGLOBAL g, char *filename)
case RECFM_FIX: ftype = ".fop"; break;
case RECFM_BIN: ftype = ".bop"; break;
case RECFM_VCT: ftype = ".vop"; break;
- case RECFM_DBF: ftype = ".dbp"; break;
+ case RECFM_CSV: ftype = ".cop"; break;
+ case RECFM_DBF: ftype = ".dbp"; break;
default:
sprintf(g->Message, MSG(INVALID_FTYPE), Recfm);
return true;
@@ -261,7 +267,8 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
case RECFM_FIX: ftype = ".fnx"; break;
case RECFM_BIN: ftype = ".bnx"; break;
case RECFM_VCT: ftype = ".vnx"; break;
- case RECFM_DBF: ftype = ".dbx"; break;
+ case RECFM_CSV: ftype = ".cnx"; break;
+ case RECFM_DBF: ftype = ".dbx"; break;
default:
sprintf(g->Message, MSG(BAD_RECFM_VAL), Recfm);
return true;
@@ -2257,7 +2264,7 @@ int TDBDOS::ReadDB(PGLOBAL g)
/***********************************************************************/
bool TDBDOS::PrepareWriting(PGLOBAL)
{
- if (!Ftype && (Mode == MODE_INSERT || Txfp->GetUseTemp())) {
+ if (Ftype == RECFM_VAR && (Mode == MODE_INSERT || Txfp->GetUseTemp())) {
char *p;
/*******************************************************************/
@@ -2542,7 +2549,8 @@ void DOSCOL::ReadColumn(PGLOBAL g)
/*********************************************************************/
/* For a variable length file, check if the field exists. */
/*********************************************************************/
- if (tdbp->Ftype == RECFM_VAR && strlen(tdbp->To_Line) < (unsigned)Deplac)
+ if ((tdbp->Ftype == RECFM_VAR || tdbp->Ftype == RECFM_CSV)
+ && strlen(tdbp->To_Line) < (unsigned)Deplac)
field = 0;
else if (Dsp)
for(i = 0; i < field; i++)
@@ -2552,7 +2560,8 @@ void DOSCOL::ReadColumn(PGLOBAL g)
switch (tdbp->Ftype) {
case RECFM_VAR:
case RECFM_FIX: // Fixed length text file
- case RECFM_DBF: // Fixed length DBase file
+ case RECFM_CSV: // Variable length CSV or FMT file
+ case RECFM_DBF: // Fixed length DBase file
if (Nod) switch (Buf_Type) {
case TYPE_INT:
case TYPE_SHORT:
diff --git a/storage/connect/tabdos.h b/storage/connect/tabdos.h
index bdde37adaad..207a1277fce 100644
--- a/storage/connect/tabdos.h
+++ b/storage/connect/tabdos.h
@@ -80,7 +80,6 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */
PCSZ Entry; /* Zip entry name or pattern */
PCSZ Pwd; /* Zip password */
PIXDEF To_Indx; /* To index definitions blocks */
- RECFM Recfm; /* 0:VAR, 1:FIX, 2:BIN, 3:VCT, 6:DBF */
bool Mapped; /* 0: disk file, 1: memory mapped file */
bool Zipped; /* true for zipped table file */
bool Mulentries; /* true for multiple entries */
diff --git a/storage/connect/tabfix.cpp b/storage/connect/tabfix.cpp
index 1969fd4465f..4a0a75460cd 100644
--- a/storage/connect/tabfix.cpp
+++ b/storage/connect/tabfix.cpp
@@ -84,7 +84,7 @@ PTDB TDBFIX::Clone(PTABS t)
tp = new(g) TDBFIX(g, this);
- if (Ftype < 2) {
+ if (Ftype == RECFM_VAR || Ftype == RECFM_FIX) {
// File is text
PDOSCOL cp1, cp2;
diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp
index 746382178fb..b395c49c95d 100644
--- a/storage/connect/tabfmt.cpp
+++ b/storage/connect/tabfmt.cpp
@@ -1,11 +1,11 @@
/************* TabFmt C++ Program Source Code File (.CPP) **************/
/* PROGRAM NAME: TABFMT */
/* ------------- */
-/* Version 3.9.2 */
+/* Version 3.9.3 */
/* */
/* COPYRIGHT: */
/* ---------- */
-/* (C) Copyright to the author Olivier BERTRAND 2001 - 2017 */
+/* (C) Copyright to the author Olivier BERTRAND 2001 - 2019 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@@ -477,6 +477,7 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
if (DOSDEF::DefineAM(g, "CSV", poff))
return true;
+ Recfm = RECFM_CSV;
GetCharCatInfo("Separator", ",", buf, sizeof(buf));
Sep = (strlen(buf) == 2 && buf[0] == '\\' && buf[1] == 't') ? '\t' : *buf;
Quoted = GetIntCatInfo("Quoted", -1);
diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp
index 0b282345c8a..7e8d6c8d9f0 100644
--- a/storage/connect/tabjson.cpp
+++ b/storage/connect/tabjson.cpp
@@ -394,10 +394,11 @@ err:
bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j)
{
- char *p, *pc = colname + strlen(colname);
- int ars;
- PJOB job;
- PJAR jar;
+ char *p, *pc = colname + strlen(colname);
+ int ars;
+ size_t n;
+ PJOB job;
+ PJAR jar;
if ((valp = jvp ? jvp->GetValue() : NULL)) {
jcol.Type = valp->GetType();
@@ -423,8 +424,10 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j)
PCSZ k = jrp->GetKey();
if (*k != '$') {
- strncat(strncat(fmt, sep, 128), k, 128);
- strncat(strncat(colname, "_", 64), k, 64);
+ n = sizeof(fmt) - strlen(fmt) -1;
+ strncat(strncat(fmt, sep, n), k, n - strlen(sep));
+ n = sizeof(colname) - strlen(colname) - 1;
+ strncat(strncat(colname, "_", n), k, n - 1);
} // endif Key
if (Find(g, jrp->GetVal(), k, j + 1))
@@ -443,19 +446,26 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j)
ars = MY_MIN(jar->GetSize(false), 1);
for (int k = 0; k < ars; k++) {
- if (!tdp->Xcol || stricmp(tdp->Xcol, key)) {
- sprintf(buf, "%d", k);
-
- if (tdp->Uri)
- strncat(strncat(fmt, sep, 128), buf, 128);
- else
- strncat(strncat(strncat(fmt, "[", 128), buf, 128), "]", 128);
+ n = sizeof(fmt) - (strlen(fmt) + 1);
- if (all)
- strncat(strncat(colname, "_", 64), buf, 64);
+ if (!tdp->Xcol || stricmp(tdp->Xcol, key)) {
+ sprintf(buf, "%d", k);
- } else
- strncat(fmt, (tdp->Uri ? sep : "[*]"), 128);
+ if (tdp->Uri) {
+ strncat(strncat(fmt, sep, n), buf, n - strlen(sep));
+ } else {
+ strncat(strncat(fmt, "[", n), buf, n - 1);
+ strncat(fmt, "]", n - (strlen(buf) + 1));
+ } // endif uri
+
+ if (all) {
+ n = sizeof(colname) - (strlen(colname) + 1);
+ strncat(strncat(colname, "_", n), buf, n - 1);
+ } // endif all
+
+ } else {
+ strncat(fmt, (tdp->Uri ? sep : "[*]"), n);
+ }
if (Find(g, jar->GetValue(k), "", j))
return true;
diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp
index ceffafac02c..7e165fb5a80 100644
--- a/storage/connect/tabmysql.cpp
+++ b/storage/connect/tabmysql.cpp
@@ -342,11 +342,13 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
Delayed = !!GetIntCatInfo("Delayed", 0);
} else {
// MYSQL access from a PROXY table
- Tabschema = GetStringCatInfo(g, "Database", Tabschema ? Tabschema : PlugDup(g, "*"));
+ TABLE_SHARE* s;
+
+ Tabschema = GetStringCatInfo(g, "Database", Tabschema ? Tabschema : PlugDup(g, "*"));
Isview = GetBoolCatInfo("View", false);
// We must get other connection parms from the calling table
- Remove_tshp(Cat);
+ s = Remove_tshp(Cat);
url = GetStringCatInfo(g, "Connect", NULL);
if (!url || !*url) {
@@ -365,6 +367,9 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
} // endif url
Tabname = Name;
+
+ // Needed for column description
+ Restore_tshp(Cat, s);
} // endif am
if ((Srcdef = GetStringCatInfo(g, "Srcdef", NULL))) {
diff --git a/storage/connect/tabrest.cpp b/storage/connect/tabrest.cpp
index 9e1a643c89f..9c6b724973f 100644
--- a/storage/connect/tabrest.cpp
+++ b/storage/connect/tabrest.cpp
@@ -1,5 +1,5 @@
-/*************** Rest C++ Program Source Code File (.CPP) **************/
-/* PROGRAM NAME: Rest Version 1.5 */
+/************** tabrest C++ Program Source Code File (.CPP) ************/
+/* PROGRAM NAME: tabrest Version 1.7 */
/* (C) Copyright to the author Olivier BERTRAND 2018 - 2019 */
/* This program is the REST Web API support for MariaDB. */
/* When compiled without MARIADB defined, it is the EOM module code. */
@@ -9,13 +9,18 @@
/* Definitions needed by the included files. */
/***********************************************************************/
#if defined(MARIADB)
-#include <my_global.h> // All MariaDB stuff
+#include <my_global.h> // All MariaDB stuff
#else // !MARIADB OEM module
#include "mini-global.h"
#define _MAX_PATH 260
-#if !defined(__WIN__)
+#if !defined(REST_SOURCE)
+#if defined(__WIN__) || defined(_WINDOWS)
+#include <windows.h>
+#else // !__WIN__
#define __stdcall
+#include <dlfcn.h> // dlopen(), dlclose(), dlsym() ...
#endif // !__WIN__
+#endif // !REST_SOURCE
#define _OS_H_INCLUDED // Prevent os.h to be called
#endif // !MARIADB
@@ -23,7 +28,6 @@
/* Include application header files: */
/* global.h is header containing all global declarations. */
/* plgdbsem.h is header containing the DB application declarations. */
-/* (x)table.h is header containing the TDBASE declarations. */
/***********************************************************************/
#include "global.h"
#include "plgdbsem.h"
@@ -31,22 +35,14 @@
#include "filamtxt.h"
#include "tabdos.h"
#include "plgxml.h"
+#if defined(XML_SUPPORT)
#include "tabxml.h"
+#endif // XML_SUPPORT
#include "tabjson.h"
#include "tabfmt.h"
#include "tabrest.h"
-/***********************************************************************/
-/* Get the file from the Web. */
-/***********************************************************************/
-int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn);
-
-#if defined(__WIN__)
-static PCSZ slash = "\\";
-#else // !__WIN__
-static PCSZ slash = "/";
-#define stricmp strcasecmp
-#endif // !__WIN__
+static XGETREST getRestFnc = NULL;
#if !defined(MARIADB)
/***********************************************************************/
@@ -76,6 +72,74 @@ PTABDEF __stdcall GetREST(PGLOBAL g, void *memp)
#endif // !MARIADB
/***********************************************************************/
+/* GetREST: get the external TABDEF from OEM module. */
+/***********************************************************************/
+XGETREST GetRestFunction(PGLOBAL g)
+{
+ if (getRestFnc)
+ return getRestFnc;
+
+#if !defined(MARIADB) || !defined(REST_SOURCE)
+ if (trace(515))
+ htrc("Looking for GetRest library\n");
+
+#if defined(__WIN__) || defined(_WINDOWS)
+ HANDLE Hdll;
+ const char* soname = "GetRest.dll"; // Module name
+
+ if (!(Hdll = LoadLibrary(soname))) {
+ char buf[256];
+ DWORD rc = GetLastError();
+
+ sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, soname);
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0,
+ (LPTSTR)buf, sizeof(buf), NULL);
+ strcat(strcat(g->Message, ": "), buf);
+ return NULL;
+ } // endif Hdll
+
+// Get the function returning an instance of the external DEF class
+ if (!(getRestFnc = (XGETREST)GetProcAddress((HINSTANCE)Hdll, "restGetFile"))) {
+ char buf[256];
+ DWORD rc = GetLastError();
+
+ sprintf(g->Message, MSG(PROCADD_ERROR), rc, "restGetFile");
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0,
+ (LPTSTR)buf, sizeof(buf), NULL);
+ strcat(strcat(g->Message, ": "), buf);
+ FreeLibrary((HMODULE)Hdll);
+ return NULL;
+ } // endif getRestFnc
+#else // !__WIN__
+ void* Hso;
+ const char* error = NULL;
+ const char* soname = "GetRest.so"; // Module name
+
+ // Load the desired shared library
+ if (!(Hso = dlopen(soname, RTLD_LAZY))) {
+ error = dlerror();
+ sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error));
+ return NULL;
+ } // endif Hdll
+
+// Get the function returning an instance of the external DEF class
+ if (!(getRestFnc = (XGETREST)dlsym(Hso, "restGetFile"))) {
+ error = dlerror();
+ sprintf(g->Message, MSG(GET_FUNC_ERR), "restGetFile", SVP(error));
+ dlclose(Hso);
+ return NULL;
+ } // endif getdef
+#endif // !__WIN__
+#else
+ getRestFnc = restGetFile;
+#endif
+
+ return getRestFnc;
+} // end of GetRestFunction
+
+/***********************************************************************/
/* Return the columns definition to MariaDB. */
/***********************************************************************/
#if defined(MARIADB)
@@ -87,6 +151,10 @@ PQRYRES __stdcall ColREST(PGLOBAL g, PTOS tp, char *tab, char *db, bool info)
PQRYRES qrp= NULL;
char filename[_MAX_PATH + 1]; // MAX PATH ???
PCSZ http, uri, fn, ftype;
+ XGETREST grf = GetRestFunction(g);
+
+ if (!grf)
+ return NULL;
http = GetStringTableOption(g, tp, "Http", NULL);
uri = GetStringTableOption(g, tp, "Uri", NULL);
@@ -100,18 +168,20 @@ PQRYRES __stdcall ColREST(PGLOBAL g, PTOS tp, char *tab, char *db, bool info)
// We used the file name relative to recorded datapath
strcat(strcat(strcat(strcpy(filename, "."), slash), db), slash);
- strncat(filename, fn, _MAX_PATH);
+ strncat(filename, fn, _MAX_PATH - strlen(filename));
// Retrieve the file from the web and copy it locally
- if (http && restGetFile(g, http, uri, filename)) {
- // sprintf(g->Message, "Failed to get file at %s", http);
- } else if (!stricmp(ftype, "XML"))
- qrp = XMLColumns(g, db, tab, tp, info);
- else if (!stricmp(ftype, "JSON"))
+ if (http && grf(g->Message, trace(515), http, uri, filename)) {
+ // sprintf(g->Message, "Failed to get file at %s", http);
+ } else if (!stricmp(ftype, "JSON"))
qrp = JSONColumns(g, db, NULL, tp, info);
else if (!stricmp(ftype, "CSV"))
qrp = CSVColumns(g, NULL, tp, info);
- else
+#if defined(XML_SUPPORT)
+ else if (!stricmp(ftype, "XML"))
+ qrp = XMLColumns(g, db, tab, tp, info);
+#endif // XML_SUPPORT
+ else
sprintf(g->Message, "Usupported file type %s", ftype);
return qrp;
@@ -124,9 +194,14 @@ PQRYRES __stdcall ColREST(PGLOBAL g, PTOS tp, char *tab, char *db, bool info)
/***********************************************************************/
bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
- char filename[_MAX_PATH + 1];
+ char filename[_MAX_PATH + 1];
int rc = 0, n;
- LPCSTR ftype;
+ bool xt = trace(515);
+ LPCSTR ftype;
+ XGETREST grf = GetRestFunction(g);
+
+ if (!grf)
+ return true;
#if defined(MARIADB)
ftype = GetStringCatInfo(g, "Type", "JSON");
@@ -135,11 +210,13 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
ftype = GetStringCatInfo(g, "Ftype", "JSON");
#endif // !MARIADB
- if (trace(515))
+ if (xt)
htrc("ftype = %s am = %s\n", ftype, SVP(am));
n = (!stricmp(ftype, "JSON")) ? 1
+#if defined(XML_SUPPORT)
: (!stricmp(ftype, "XML")) ? 2
+#endif // XML_SUPPORT
: (!stricmp(ftype, "CSV")) ? 3 : 0;
if (n == 0) {
@@ -154,19 +231,22 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
// We used the file name relative to recorded datapath
//PlugSetPath(filename, Fn, GetPath());
- strncat(strcpy(filename, GetPath()), Fn, _MAX_PATH);
+ strcpy(filename, GetPath());
+ strncat(filename, Fn, _MAX_PATH - strlen(filename));
// Retrieve the file from the web and copy it locally
- rc = restGetFile(g, Http, Uri, filename);
+ rc = grf(g->Message, xt, Http, Uri, filename);
- if (trace(515))
+ if (xt)
htrc("Return from restGetFile: rc=%d\n", rc);
if (rc)
return true;
else switch (n) {
case 1: Tdp = new (g) JSONDEF; break;
- case 2: Tdp = new (g) XMLDEF; break;
+#if defined(XML_SUPPORT)
+ case 2: Tdp = new (g) XMLDEF; break;
+#endif // XML_SUPPORT
case 3: Tdp = new (g) CSVDEF; break;
default: Tdp = NULL;
} // endswitch n
@@ -175,7 +255,7 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
if (Tdp && Tdp->Define(g, Cat, Name, Schema, "REST"))
Tdp = NULL; // Error occured
- if (trace(515))
+ if (xt)
htrc("Tdp defined\n", rc);
// Return true in case of error
diff --git a/storage/connect/tabrest.h b/storage/connect/tabrest.h
index 1725f256079..9cf2d10a6b8 100644
--- a/storage/connect/tabrest.h
+++ b/storage/connect/tabrest.h
@@ -5,6 +5,27 @@
/***********************************************************************/
#pragma once
+#if defined(__WIN__)
+static PCSZ slash = "\\";
+#else // !__WIN__
+static PCSZ slash = "/";
+#define stricmp strcasecmp
+#endif // !__WIN__
+
+typedef int(__stdcall* XGETREST) (char*, bool, PCSZ, PCSZ, PCSZ);
+
+/***********************************************************************/
+/* Functions used by REST. */
+/***********************************************************************/
+XGETREST GetRestFunction(PGLOBAL g);
+#if defined(REST_SOURCE)
+extern "C" int restGetFile(char* m, bool xt, PCSZ http, PCSZ uri, PCSZ fn);
+#endif // REST_SOURCE
+#if defined(MARIADB)
+PQRYRES RESTColumns(PGLOBAL g, PTOS tp, char* tab, char* db, bool info);
+#endif // !MARIADB
+
+
/***********************************************************************/
/* Restest table. */
/***********************************************************************/
diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp
index 325f36b1e19..f5a105a530d 100644
--- a/storage/connect/tabutil.cpp
+++ b/storage/connect/tabutil.cpp
@@ -59,12 +59,24 @@ int GetConvSize(void);
/* Used by MYSQL tables to get MySQL parameters from the calling proxy */
/* table (PROXY, TBL, XCL, or OCCUR) when used by one of these. */
/************************************************************************/
-void Remove_tshp(PCATLG cat)
+TABLE_SHARE *Remove_tshp(PCATLG cat)
{
- ((MYCAT*)cat)->GetHandler()->tshp = NULL;
+ TABLE_SHARE *s = ((MYCAT*)cat)->GetHandler()->tshp;
+
+ ((MYCAT*)cat)->GetHandler()->tshp = NULL;
+ return s;
} // end of Remove_thsp
/************************************************************************/
+/* Used by MYSQL tables to get MySQL parameters from the calling proxy */
+/* table (PROXY, TBL, XCL, or OCCUR) when used by one of these. */
+/************************************************************************/
+void Restore_tshp(PCATLG cat, TABLE_SHARE *s)
+{
+ ((MYCAT*)cat)->GetHandler()->tshp = s;
+} // end of Restore_thsp
+
+/************************************************************************/
/* GetTableShare: allocates and open a table share. */
/************************************************************************/
TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
diff --git a/storage/connect/tabutil.h b/storage/connect/tabutil.h
index 62678508ca1..c8e7e75106f 100644
--- a/storage/connect/tabutil.h
+++ b/storage/connect/tabutil.h
@@ -18,7 +18,8 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
const char *name, bool& info);
-void Remove_tshp(PCATLG cat);
+TABLE_SHARE *Remove_tshp(PCATLG cat);
+void Restore_tshp(PCATLG cat, TABLE_SHARE *s);
/* -------------------------- PROXY classes -------------------------- */
diff --git a/storage/connect/tabvct.cpp b/storage/connect/tabvct.cpp
index 40d020202ea..0ed466f6ffb 100644
--- a/storage/connect/tabvct.cpp
+++ b/storage/connect/tabvct.cpp
@@ -115,11 +115,14 @@ bool VCTDEF::DefineAM(PGLOBAL g, LPCSTR, int poff)
Recfm = RECFM_VCT;
+ // poff is no more in use; This will have to be revisited
+#if 0
// For packed files the logical record length is calculated in poff
if (poff != Lrecl) {
Lrecl = poff;
SetIntCatInfo("Lrecl", poff);
} // endif poff
+#endif // 0
Padded = false;
Blksize = 0;
diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp
index db4d6cbb00d..95f038d494c 100644
--- a/storage/connect/xindex.cpp
+++ b/storage/connect/xindex.cpp
@@ -659,7 +659,7 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp)
/* Not true for DBF tables because of eventual soft deleted lines. */
/* Note: for Num_K = 1 any non null value is Ok. */
/*********************************************************************/
- if (Srtd && !filp && Tdbp->Ftype != RECFM_VAR
+ if (Srtd && !filp && Tdbp->Ftype != RECFM_VAR && Tdbp->Ftype != RECFM_CSV
&& Tdbp->Txfp->GetAmType() != TYPE_AM_DBF) {
Incr = (Num_K > 1) ? To_Rec[1] : Num_K;
PlgDBfree(Record);
@@ -837,7 +837,8 @@ bool XINDEX::SaveIndex(PGLOBAL g, PIXDEF sxp)
case RECFM_FIX: ftype = ".fnx"; break;
case RECFM_BIN: ftype = ".bnx"; break;
case RECFM_VCT: ftype = ".vnx"; break;
- case RECFM_DBF: ftype = ".dbx"; break;
+ case RECFM_CSV: ftype = ".cnx"; break;
+ case RECFM_DBF: ftype = ".dbx"; break;
default:
sprintf(g->Message, MSG(INVALID_FTYPE), Tdbp->Ftype);
return true;
@@ -990,7 +991,8 @@ bool XINDEX::Init(PGLOBAL g)
case RECFM_FIX: ftype = ".fnx"; break;
case RECFM_BIN: ftype = ".bnx"; break;
case RECFM_VCT: ftype = ".vnx"; break;
- case RECFM_DBF: ftype = ".dbx"; break;
+ case RECFM_CSV: ftype = ".cnx"; break;
+ case RECFM_DBF: ftype = ".dbx"; break;
default:
sprintf(g->Message, MSG(INVALID_FTYPE), Tdbp->Ftype);
return true;
@@ -1243,7 +1245,8 @@ bool XINDEX::MapInit(PGLOBAL g)
case RECFM_FIX: ftype = ".fnx"; break;
case RECFM_BIN: ftype = ".bnx"; break;
case RECFM_VCT: ftype = ".vnx"; break;
- case RECFM_DBF: ftype = ".dbx"; break;
+ case RECFM_CSV: ftype = ".cnx"; break;
+ case RECFM_DBF: ftype = ".dbx"; break;
default:
sprintf(g->Message, MSG(INVALID_FTYPE), Tdbp->Ftype);
return true;
@@ -1457,7 +1460,8 @@ bool XINDEX::GetAllSizes(PGLOBAL g,/* int &ndif,*/ int &numk)
case RECFM_FIX: ftype = ".fnx"; break;
case RECFM_BIN: ftype = ".bnx"; break;
case RECFM_VCT: ftype = ".vnx"; break;
- case RECFM_DBF: ftype = ".dbx"; break;
+ case RECFM_CSV: ftype = ".cnx"; break;
+ case RECFM_DBF: ftype = ".dbx"; break;
default:
sprintf(g->Message, MSG(INVALID_FTYPE), Tdbp->Ftype);
return true;
diff --git a/storage/connect/xtable.h b/storage/connect/xtable.h
index bc9265e0223..1b499e09047 100644
--- a/storage/connect/xtable.h
+++ b/storage/connect/xtable.h
@@ -173,9 +173,12 @@ class DllExport TDBASE : public TDB {
inline void SetKindex(PKXBASE kxp) {To_Kindex = kxp;}
// Properties
- virtual PKXBASE GetKindex(void) {return To_Kindex;}
+ PKXBASE GetKindex(void) {return To_Kindex;}
+ PXOB *GetLink(void) {return To_Link;}
+ PIXDEF GetXdp(void) {return To_Xdp;}
void ResetKindex(PGLOBAL g, PKXBASE kxp);
PCOL Key(int i) {return (To_Key_Col) ? To_Key_Col[i] : NULL;}
+ PXOB Link(int i) { return (To_Link) ? To_Link[i] : NULL; }
// Methods
virtual bool IsUsingTemp(PGLOBAL) {return false;}
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 643fa1ae09a..ab402c636d1 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -225,9 +225,9 @@ static void init_example_psi_keys()
used by the default rename_table and delete_table method in
handler.cc and by the default discover_many method.
- For engines that have two file name extentions (separate meta/index file
+ For engines that have two file name extensions (separate meta/index file
and data file), the order of elements is relevant. First element of engine
- file name extentions array should be meta/index file extention. Second
+ file name extensions array should be meta/index file extention. Second
element - data file extention. This order is assumed by
prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued.
diff --git a/storage/federatedx/AUTHORS b/storage/federatedx/AUTHORS
index 6314d2e4a3d..cdd6600fb5a 100644
--- a/storage/federatedx/AUTHORS
+++ b/storage/federatedx/AUTHORS
@@ -7,5 +7,5 @@ Pluggable Storage Engine Skeleton setup
Brian Aker <brian@mysql.com> | <brian@tangent.org> - Original Design
Calvin Sun - Windows Support
Brian Miezejewski - Bug fixes
-Antony T Curtis - Help in inital development, transactions and various help
+Antony T Curtis - Help in initial development, transactions and various help
Michael Widenius - Bug fixes and some simple early optimizations
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index 74d547cb674..4a717eead20 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -798,12 +798,12 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share,
goto error;
if (share->hostname[0] == '\0')
- share->hostname= NULL;
+ share->hostname= strdup_root(mem_root, my_localhost);
}
if (!share->port)
{
- if (!share->hostname || strcmp(share->hostname, my_localhost) == 0)
+ if (0 == strcmp(share->hostname, my_localhost))
share->socket= (char *) MYSQL_UNIX_ADDR;
else
share->port= MYSQL_PORT;
@@ -3385,8 +3385,7 @@ int ha_federatedx::create(const char *name, TABLE *table_arg,
goto error;
/* loopback socket connections hang due to LOCK_open mutex */
- if ((!tmp_share.hostname || !strcmp(tmp_share.hostname,my_localhost)) &&
- !tmp_share.port)
+ if (0 == strcmp(tmp_share.hostname, my_localhost) && !tmp_share.port)
goto error;
/*
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 2f353c9e7e7..ed3b632b300 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -775,7 +775,7 @@ btr_node_ptr_set_child_page_no(
rec_t* rec, /*!< in: node pointer record */
page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed
part will be updated, or NULL */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint page_no,/*!< in: child node address */
mtr_t* mtr) /*!< in: mtr */
{
@@ -810,7 +810,7 @@ btr_node_ptr_get_child(
/*===================*/
const rec_t* node_ptr,/*!< in: node pointer */
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
mtr_t* mtr) /*!< in: mtr */
{
ut_ad(rec_offs_validate(node_ptr, index, offsets));
@@ -829,10 +829,10 @@ Returns the upper level node pointer to a page. It is assumed that mtr holds
an sx-latch on the tree.
@return rec_get_offsets() of the node pointer record */
static
-ulint*
+offset_t*
btr_page_get_father_node_ptr_func(
/*==============================*/
- ulint* offsets,/*!< in: work area for the return value */
+ offset_t* offsets,/*!< in: work area for the return value */
mem_heap_t* heap, /*!< in: memory heap to use */
btr_cur_t* cursor, /*!< in: cursor pointing to user record,
out: cursor on node pointer record,
@@ -936,10 +936,10 @@ Returns the upper level node pointer to a page. It is assumed that mtr holds
an x-latch on the tree.
@return rec_get_offsets() of the node pointer record */
static
-ulint*
+offset_t*
btr_page_get_father_block(
/*======================*/
- ulint* offsets,/*!< in: work area for the return value */
+ offset_t* offsets,/*!< in: work area for the return value */
mem_heap_t* heap, /*!< in: memory heap to use */
dict_index_t* index, /*!< in: b-tree index */
buf_block_t* block, /*!< in: child page in the index */
@@ -1823,7 +1823,7 @@ btr_root_raise_and_insert(
on the root page; when the function returns,
the cursor is positioned on the predecessor
of the inserted record */
- ulint** offsets,/*!< out: offsets on inserted record */
+ offset_t** offsets,/*!< out: offsets on inserted record */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
@@ -2156,7 +2156,7 @@ btr_page_get_split_rec(
rec_t* next_rec;
ulint n;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
page = btr_cur_get_page(cursor);
@@ -2262,7 +2262,7 @@ btr_page_insert_fits(
const rec_t* split_rec,/*!< in: suggestion for first record
on upper half-page, or NULL if
tuple to be inserted should be first */
- ulint** offsets,/*!< in: rec_get_offsets(
+ offset_t** offsets,/*!< in: rec_get_offsets(
split_rec, cursor->index); out: garbage */
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
@@ -2362,8 +2362,8 @@ btr_insert_on_non_leaf_level_func(
dberr_t err;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
rtr_info_t rtr_info;
@@ -2471,7 +2471,7 @@ btr_attach_half_pages(
if (direction == FSP_DOWN) {
btr_cur_t cursor;
- ulint* offsets;
+ offset_t* offsets;
lower_page = buf_block_get_frame(new_block);
lower_page_no = new_block->page.id.page_no();
@@ -2593,7 +2593,7 @@ btr_page_tuple_smaller(
/*===================*/
btr_cur_t* cursor, /*!< in: b-tree cursor */
const dtuple_t* tuple, /*!< in: tuple to consider */
- ulint** offsets,/*!< in/out: temporary storage */
+ offset_t** offsets,/*!< in/out: temporary storage */
ulint n_uniq, /*!< in: number of unique fields
in the index page records */
mem_heap_t** heap) /*!< in/out: heap for offsets */
@@ -2633,7 +2633,7 @@ rec_t*
btr_insert_into_right_sibling(
ulint flags,
btr_cur_t* cursor,
- ulint** offsets,
+ offset_t** offsets,
mem_heap_t* heap,
const dtuple_t* tuple,
ulint n_ext,
@@ -2769,7 +2769,7 @@ btr_page_split_and_insert(
btr_cur_t* cursor, /*!< in: cursor at which to insert; when the
function returns, the cursor is positioned
on the predecessor of the inserted record */
- ulint** offsets,/*!< out: offsets on inserted record */
+ offset_t** offsets,/*!< out: offsets on inserted record */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
@@ -3321,7 +3321,7 @@ btr_lift_page_up(
{
btr_cur_t cursor;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
mem_heap_t* heap = mem_heap_create(
sizeof(*offsets)
* (REC_OFFS_HEADER_SIZE + 1 + 1
@@ -3518,7 +3518,7 @@ btr_compress(
page_t* page;
btr_cur_t father_cursor;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
ulint nth_rec = 0; /* remove bogus warning */
bool mbr_changed = false;
#ifdef UNIV_DEBUG
@@ -3661,7 +3661,7 @@ retry:
if (is_left) {
btr_cur_t cursor2;
rtr_mbr_t new_mbr;
- ulint* offsets2 = NULL;
+ offset_t* offsets2 = NULL;
/* For rtree, we need to update father's mbr. */
if (dict_index_is_spatial(index)) {
@@ -3857,7 +3857,7 @@ retry:
/* For rtree, we need to update father's mbr. */
if (dict_index_is_spatial(index)) {
- ulint* offsets2;
+ offset_t* offsets2;
ulint rec_info;
offsets2 = rec_get_offsets(
@@ -4304,7 +4304,7 @@ btr_print_recursive(
ulint width, /*!< in: print this many entries from start
and end */
mem_heap_t** heap, /*!< in/out: heap for rec_get_offsets() */
- ulint** offsets,/*!< in/out: buffer for rec_get_offsets() */
+ offset_t** offsets,/*!< in/out: buffer for rec_get_offsets() */
mtr_t* mtr) /*!< in: mtr */
{
const page_t* page = buf_block_get_frame(block);
@@ -4368,8 +4368,8 @@ btr_print_index(
mtr_t mtr;
buf_block_t* root;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
fputs("--------------------------\n"
@@ -4403,7 +4403,7 @@ btr_check_node_ptr(
{
mem_heap_t* heap;
dtuple_t* tuple;
- ulint* offsets;
+ offset_t* offsets;
btr_cur_t cursor;
page_t* page = buf_block_get_frame(block);
@@ -4483,8 +4483,8 @@ btr_index_rec_validate(
ulint len;
const page_t* page;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
page = page_align(rec);
@@ -4716,8 +4716,8 @@ btr_validate_level(
bool ret = true;
mtr_t mtr;
mem_heap_t* heap = mem_heap_create(256);
- ulint* offsets = NULL;
- ulint* offsets2= NULL;
+ offset_t* offsets = NULL;
+ offset_t* offsets2= NULL;
#ifdef UNIV_ZIP_DEBUG
page_zip_des_t* page_zip;
#endif /* UNIV_ZIP_DEBUG */
diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc
index 6f11796487d..3e170017408 100644
--- a/storage/innobase/btr/btr0bulk.cc
+++ b/storage/innobase/btr/btr0bulk.cc
@@ -175,7 +175,7 @@ PageBulk::init()
void
PageBulk::insert(
const rec_t* rec,
- ulint* offsets)
+ offset_t* offsets)
{
ulint rec_size;
@@ -188,7 +188,7 @@ PageBulk::insert(
/* Check whether records are in order. */
if (!page_rec_is_infimum(m_cur_rec)) {
rec_t* old_rec = m_cur_rec;
- ulint* old_offsets = rec_get_offsets(
+ offset_t* old_offsets = rec_get_offsets(
old_rec, m_index, NULL, is_leaf,
ULINT_UNDEFINED, &m_heap);
@@ -401,7 +401,7 @@ rec_t*
PageBulk::getSplitRec()
{
rec_t* rec;
- ulint* offsets;
+ offset_t* offsets;
ulint total_used_size;
ulint total_recs_size;
ulint n_recs;
@@ -447,7 +447,7 @@ PageBulk::copyIn(
{
rec_t* rec = split_rec;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
ut_ad(m_rec_no == 0);
ut_ad(page_rec_is_user_rec(rec));
@@ -493,7 +493,7 @@ PageBulk::copyOut(
ut_ad(n > 0);
/* Set last record's next in page */
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
rec = page_rec_get_prev(split_rec);
offsets = rec_get_offsets(rec, m_index, offsets,
page_rec_is_leaf(split_rec),
@@ -602,7 +602,7 @@ the blob data is logged first, then the record is logged in bulk mode.
dberr_t
PageBulk::storeExt(
const big_rec_t* big_rec,
- ulint* offsets)
+ offset_t* offsets)
{
/* Note: not all fileds are initialized in btr_pcur. */
btr_pcur_t btr_pcur;
@@ -862,7 +862,7 @@ BtrBulk::insert(
ulint rec_size = rec_get_converted_size(m_index, tuple, n_ext);
big_rec_t* big_rec = NULL;
rec_t* rec = NULL;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
if (page_bulk->needExt(tuple, rec_size)) {
/* The record is so big that we have to store some fields
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 3465ff2edcb..c79ea1c5467 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -1,9 +1,9 @@
/*****************************************************************************
-Copyright (c) 1994, 2018, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+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
@@ -158,7 +158,7 @@ btr_cur_unmark_extern_fields(
part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
mtr_t* mtr); /*!< in: mtr, or NULL if not logged */
/*******************************************************************//**
Adds path information to the cursor for the current page, for which
@@ -183,7 +183,7 @@ btr_rec_free_updated_extern_fields(
rec_t* rec, /*!< in: record */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const upd_t* update, /*!< in: update vector */
bool rollback,/*!< in: performing rollback? */
mtr_t* mtr); /*!< in: mini-transaction handle which contains
@@ -197,7 +197,7 @@ btr_rec_free_externally_stored_fields(
dict_index_t* index, /*!< in: index of the data, the index
tree MUST be X-latched */
rec_t* rec, /*!< in: record */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */
bool rollback,/*!< in: performing rollback? */
@@ -476,8 +476,8 @@ incompatible:
from the cache. */
mem_heap_t* heap = NULL;
- ulint* offsets = rec_get_offsets(rec, index, NULL, true,
- ULINT_UNDEFINED, &heap);
+ offset_t* offsets = rec_get_offsets(rec, index, NULL, true,
+ ULINT_UNDEFINED, &heap);
if (rec_offs_any_default(offsets)) {
inconsistent:
mem_heap_free(heap);
@@ -804,46 +804,66 @@ btr_cur_will_modify_tree(
const ulint n_recs = page_get_n_recs(page);
if (lock_intention <= BTR_INTENTION_BOTH) {
- ulint margin;
+ compile_time_assert(BTR_INTENTION_DELETE < BTR_INTENTION_BOTH);
+ compile_time_assert(BTR_INTENTION_BOTH < BTR_INTENTION_INSERT);
- /* check delete will cause. (BTR_INTENTION_BOTH
- or BTR_INTENTION_DELETE) */
- /* first, 2nd, 2nd-last and last records are 4 records */
- if (n_recs < 5) {
- return(true);
+ if (!page_has_siblings(page)) {
+ return true;
}
- /* is first, 2nd or last record */
- if (page_rec_is_first(rec, page)
- || (page_has_next(page)
- && (page_rec_is_last(rec, page)
- || page_rec_is_second_last(rec, page)))
- || (page_has_prev(page)
- && page_rec_is_second(rec, page))) {
- return(true);
- }
+ ulint margin = rec_size;
if (lock_intention == BTR_INTENTION_BOTH) {
+ ulint level = btr_page_get_level(page);
+
+ /* This value is the worst expectation for the node_ptr
+ records to be deleted from this page. It is used to
+ expect whether the cursor position can be the left_most
+ record in this page or not. */
+ ulint max_nodes_deleted = 0;
+
+ /* By modifying tree operations from the under of this
+ level, logically (2 ^ (level - 1)) opportunities to
+ deleting records in maximum even unreally rare case. */
+ if (level > 7) {
+ /* TODO: adjust this practical limit. */
+ max_nodes_deleted = 64;
+ } else if (level > 0) {
+ max_nodes_deleted = (ulint)1 << (level - 1);
+ }
+ /* check delete will cause. (BTR_INTENTION_BOTH
+ or BTR_INTENTION_DELETE) */
+ if (n_recs <= max_nodes_deleted * 2
+ || page_rec_is_first(rec, page)) {
+ /* The cursor record can be the left most record
+ in this page. */
+ return true;
+ }
+
+ if (page_has_prev(page)
+ && page_rec_distance_is_at_most(
+ page_get_infimum_rec(page), rec,
+ max_nodes_deleted)) {
+ return true;
+ }
+
+ if (page_has_next(page)
+ && page_rec_distance_is_at_most(
+ rec, page_get_supremum_rec(page),
+ max_nodes_deleted)) {
+ return true;
+ }
+
/* Delete at leftmost record in a page causes delete
& insert at its parent page. After that, the delete
might cause btr_compress() and delete record at its
- parent page. Thus we should consider max 2 deletes. */
-
- margin = rec_size * 2;
- } else {
- ut_ad(lock_intention == BTR_INTENTION_DELETE);
-
- margin = rec_size;
+ parent page. Thus we should consider max deletes. */
+ margin *= max_nodes_deleted;
}
- /* NOTE: call mach_read_from_4() directly to avoid assertion
- failure. It is safe because we already have SX latch of the
- index tree */
+
+ /* Safe because we already have SX latch of the index tree */
if (page_get_data_size(page)
- < margin + BTR_CUR_PAGE_COMPRESS_LIMIT(index)
- || (mach_read_from_4(page + FIL_PAGE_NEXT)
- == FIL_NULL
- && mach_read_from_4(page + FIL_PAGE_PREV)
- == FIL_NULL)) {
+ < margin + BTR_CUR_PAGE_COMPRESS_LIMIT(index)) {
return(true);
}
}
@@ -1142,10 +1162,10 @@ btr_cur_search_to_nth_level_func(
btr_search_t* info;
#endif /* BTR_CUR_ADAPT */
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
- ulint offsets2_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets2 = offsets2_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
+ offset_t offsets2_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets2 = offsets2_;
rec_offs_init(offsets_);
rec_offs_init(offsets2_);
/* Currently, PAGE_CUR_LE is the only search mode used for searches
@@ -2025,9 +2045,9 @@ need_opposite_intention:
offsets2 = rec_get_offsets(
first_rec, index, offsets2,
false, ULINT_UNDEFINED, &heap);
- cmp_rec_rec_with_match(node_ptr, first_rec,
- offsets, offsets2, index, FALSE,
- &matched_fields);
+ cmp_rec_rec(node_ptr, first_rec,
+ offsets, offsets2, index, false,
+ &matched_fields);
if (matched_fields
>= rec_offs_n_fields(offsets) - 1) {
@@ -2043,10 +2063,10 @@ need_opposite_intention:
offsets2 = rec_get_offsets(
last_rec, index, offsets2,
false, ULINT_UNDEFINED, &heap);
- cmp_rec_rec_with_match(
+ cmp_rec_rec(
node_ptr, last_rec,
offsets, offsets2, index,
- FALSE, &matched_fields);
+ false, &matched_fields);
if (matched_fields
>= rec_offs_n_fields(offsets) - 1) {
detected_same_key_root = true;
@@ -2406,8 +2426,8 @@ btr_cur_open_at_index_side_func(
ulint n_blocks = 0;
ulint n_releases = 0;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
dberr_t err = DB_SUCCESS;
rec_offs_init(offsets_);
@@ -2775,8 +2795,8 @@ btr_cur_open_at_rnd_pos_func(
ulint n_blocks = 0;
ulint n_releases = 0;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(!index->is_spatial());
@@ -3065,7 +3085,7 @@ btr_cur_insert_if_possible(
cursor stays valid */
const dtuple_t* tuple, /*!< in: tuple to insert; the size info need not
have been stored to tuple */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in/out: mini-transaction */
@@ -3228,7 +3248,7 @@ btr_cur_optimistic_insert(
specified */
btr_cur_t* cursor, /*!< in: cursor on page after which to insert;
cursor stays valid */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
@@ -3528,7 +3548,7 @@ btr_cur_pessimistic_insert(
insertion will certainly succeed */
btr_cur_t* cursor, /*!< in: cursor after which to insert;
cursor stays valid */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap
that can be emptied */
dtuple_t* entry, /*!< in/out: entry to insert */
@@ -3666,8 +3686,8 @@ btr_cur_pessimistic_insert(
if (entry->info_bits & REC_INFO_MIN_REC_FLAG) {
ut_ad(entry->info_bits == REC_INFO_METADATA);
ut_ad(index->is_instant());
- ut_ad((flags & ulint(~BTR_KEEP_IBUF_BITMAP))
- == BTR_NO_LOCKING_FLAG);
+ ut_ad(flags & BTR_NO_LOCKING_FLAG);
+ ut_ad(!(flags & BTR_CREATE_FLAG));
} else {
btr_search_update_hash_on_insert(
cursor, btr_get_search_latch(index));
@@ -3696,7 +3716,7 @@ btr_cur_upd_lock_and_undo(
/*======================*/
ulint flags, /*!< in: undo logging and locking flags */
btr_cur_t* cursor, /*!< in: cursor on record to update */
- const ulint* offsets,/*!< in: rec_get_offsets() on cursor */
+ const offset_t* offsets,/*!< in: rec_get_offsets() on cursor */
const upd_t* update, /*!< in: update vector */
ulint cmpl_info,/*!< in: compiler info on secondary index
updates */
@@ -3827,7 +3847,7 @@ btr_cur_parse_update_in_place(
roll_ptr_t roll_ptr;
ulint rec_offset;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
if (end_ptr < ptr + 1) {
@@ -3912,7 +3932,7 @@ btr_cur_update_alloc_zip_func(
page_cur_t* cursor, /*!< in/out: B-tree page cursor */
dict_index_t* index, /*!< in: the index corresponding to cursor */
#ifdef UNIV_DEBUG
- ulint* offsets,/*!< in/out: offsets of the cursor record */
+ offset_t* offsets,/*!< in/out: offsets of the cursor record */
#endif /* UNIV_DEBUG */
ulint length, /*!< in: size needed */
bool create, /*!< in: true=delete-and-insert,
@@ -3994,7 +4014,7 @@ btr_cur_update_in_place(
btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the
same record */
- ulint* offsets,/*!< in/out: offsets on cursor->page_cur.rec */
+ offset_t* offsets,/*!< in/out: offsets on cursor->page_cur.rec */
const upd_t* update, /*!< in: update vector */
ulint cmpl_info,/*!< in: compiler info on secondary index
updates */
@@ -4215,7 +4235,7 @@ btr_cur_optimistic_update(
btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the
same record */
- ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
+ offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** heap, /*!< in/out: pointer to NULL or memory heap */
const upd_t* update, /*!< in: update vector; this must also
contain trx id and roll ptr fields */
@@ -4242,7 +4262,6 @@ btr_cur_optimistic_update(
dtuple_t* new_entry;
roll_ptr_t roll_ptr;
ulint i;
- ulint n_ext;
block = btr_cur_get_block(cursor);
page = buf_block_get_frame(block);
@@ -4319,10 +4338,8 @@ any_extern:
+ DTUPLE_EST_ALLOC(rec_offs_n_fields(*offsets)));
}
- new_entry = row_rec_to_index_entry(rec, index, *offsets,
- &n_ext, *heap);
- /* We checked above that there are no externally stored fields. */
- ut_a(!n_ext);
+ new_entry = row_rec_to_index_entry(rec, index, *offsets, *heap);
+ ut_ad(!dtuple_get_n_ext(new_entry));
/* The page containing the clustered index record
corresponding to new_entry is latched in mtr.
@@ -4553,7 +4570,7 @@ btr_cur_pessimistic_update(
btr_cur_t* cursor, /*!< in/out: cursor on the record to update;
cursor may become invalid if *big_rec == NULL
|| !(flags & BTR_KEEP_POS_FLAG) */
- ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
+ offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap
that can be emptied */
@@ -4586,7 +4603,6 @@ btr_cur_pessimistic_update(
roll_ptr_t roll_ptr;
ibool was_first;
ulint n_reserved = 0;
- ulint n_ext;
ulint max_ins_size = 0;
*offsets = NULL;
@@ -4651,7 +4667,7 @@ btr_cur_pessimistic_update(
ut_ad(rec_offs_validate(rec, index, *offsets));
dtuple_t* new_entry = row_rec_to_index_entry(
- rec, index, *offsets, &n_ext, entry_heap);
+ rec, index, *offsets, entry_heap);
/* The page containing the clustered index record
corresponding to new_entry is latched in mtr. If the
@@ -4671,7 +4687,6 @@ btr_cur_pessimistic_update(
ut_ad(!page_is_comp(page) || !rec_get_node_ptr_flag(rec));
ut_ad(rec_offs_validate(rec, index, *offsets));
- n_ext += btr_push_update_extern_fields(new_entry, update, entry_heap);
if ((flags & BTR_NO_UNDO_LOG_FLAG)
&& rec_offs_any_extern(*offsets)) {
@@ -4692,6 +4707,8 @@ btr_cur_pessimistic_update(
index, rec, page_zip, *offsets, update, true, mtr);
}
+ ulint n_ext = dtuple_get_n_ext(new_entry);
+
if (page_zip_rec_needs_ext(
rec_get_converted_size(index, new_entry, n_ext),
page_is_comp(page),
@@ -5098,7 +5115,7 @@ btr_cur_parse_del_mark_set_clust_rec(
clustered index fields. */
ut_ad(pos <= MAX_REF_PARTS);
- ulint offsets[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
+ offset_t offsets[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
rec_offs_init(offsets);
mem_heap_t* heap = NULL;
@@ -5141,7 +5158,7 @@ btr_cur_del_mark_set_clust_rec(
buf_block_t* block, /*!< in/out: buffer block of the record */
rec_t* rec, /*!< in/out: record */
dict_index_t* index, /*!< in: clustered index of the record */
- const ulint* offsets,/*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec) */
que_thr_t* thr, /*!< in: query thread */
const dtuple_t* entry, /*!< in: dtuple for the deleting record, also
contains the virtual cols if there are any */
@@ -5427,8 +5444,8 @@ btr_cur_optimistic_delete_func(
buf_block_t* block;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
ibool no_compress_needed;
rec_offs_init(offsets_);
@@ -5611,7 +5628,7 @@ btr_cur_pessimistic_delete(
bool success;
ibool ret = FALSE;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
#ifdef UNIV_DEBUG
bool parent_latched = false;
#endif /* UNIV_DEBUG */
@@ -5759,7 +5776,7 @@ discard_page:
rtr_mbr_t father_mbr;
rec_t* father_rec;
btr_cur_t father_cursor;
- ulint* offsets;
+ offset_t* offsets;
bool upd_ret;
ulint len;
@@ -6505,7 +6522,7 @@ btr_record_not_null_field_in_rec(
ulint n_unique, /*!< in: dict_index_get_n_unique(index),
number of columns uniquely determine
an index entry */
- const ulint* offsets, /*!< in: rec_get_offsets(rec, index),
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index),
its size could be for all fields or
that of "n_unique" */
ib_uint64_t* n_not_null) /*!< in/out: array to record number of
@@ -6559,8 +6576,8 @@ btr_estimate_number_of_different_key_vals(
uintmax_t add_on;
mtr_t mtr;
mem_heap_t* heap = NULL;
- ulint* offsets_rec = NULL;
- ulint* offsets_next_rec = NULL;
+ offset_t* offsets_rec = NULL;
+ offset_t* offsets_next_rec = NULL;
/* For spatial index, there is no such stats can be
fetched. */
@@ -6722,10 +6739,10 @@ btr_estimate_number_of_different_key_vals(
ULINT_UNDEFINED,
&heap);
- cmp_rec_rec_with_match(rec, next_rec,
- offsets_rec, offsets_next_rec,
- index, stats_null_not_equal,
- &matched_fields);
+ cmp_rec_rec(rec, next_rec,
+ offsets_rec, offsets_next_rec,
+ index, stats_null_not_equal,
+ &matched_fields);
for (j = matched_fields; j < n_cols; j++) {
/* We add one if this index record has
@@ -6748,7 +6765,7 @@ btr_estimate_number_of_different_key_vals(
and assign the old offsets_rec buffer to
offsets_next_rec. */
{
- ulint* offsets_tmp = offsets_rec;
+ offset_t* offsets_tmp = offsets_rec;
offsets_rec = offsets_next_rec;
offsets_next_rec = offsets_tmp;
}
@@ -6833,7 +6850,7 @@ static
ulint
btr_rec_get_field_ref_offs(
/*=======================*/
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: index of the external field */
{
ulint field_ref_offs;
@@ -6862,7 +6879,7 @@ btr_rec_get_field_ref_offs(
ulint
btr_rec_get_externally_stored_len(
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
ulint n_fields;
ulint total_extern_len = 0;
@@ -6901,7 +6918,7 @@ btr_cur_set_ownership_of_extern_field(
part will be updated, or NULL */
rec_t* rec, /*!< in/out: clustered index record */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint i, /*!< in: field number */
ibool val, /*!< in: value to set */
mtr_t* mtr) /*!< in: mtr, or NULL if not logged */
@@ -6951,7 +6968,7 @@ btr_cur_disown_inherited_fields(
part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
@@ -6982,7 +6999,7 @@ btr_cur_unmark_extern_fields(
part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
mtr_t* mtr) /*!< in: mtr, or NULL if not logged */
{
ulint n;
@@ -7006,84 +7023,6 @@ btr_cur_unmark_extern_fields(
}
/*******************************************************************//**
-Flags the data tuple fields that are marked as extern storage in the
-update vector. We use this function to remember which fields we must
-mark as extern storage in a record inserted for an update.
-@return number of flagged external columns */
-ulint
-btr_push_update_extern_fields(
-/*==========================*/
- dtuple_t* tuple, /*!< in/out: data tuple */
- const upd_t* update, /*!< in: update vector */
- mem_heap_t* heap) /*!< in: memory heap */
-{
- ulint n_pushed = 0;
- ulint n;
- const upd_field_t* uf;
-
- uf = update->fields;
- n = upd_get_n_fields(update);
-
- for (; n--; uf++) {
- if (dfield_is_ext(&uf->new_val)) {
- dfield_t* field
- = dtuple_get_nth_field(tuple, uf->field_no);
-
- if (!dfield_is_ext(field)) {
- dfield_set_ext(field);
- n_pushed++;
- }
-
- switch (uf->orig_len) {
- byte* data;
- ulint len;
- byte* buf;
- case 0:
- break;
- case BTR_EXTERN_FIELD_REF_SIZE:
- /* Restore the original locally stored
- part of the column. In the undo log,
- InnoDB writes a longer prefix of externally
- stored columns, so that column prefixes
- in secondary indexes can be reconstructed. */
- dfield_set_data(field,
- (byte*) dfield_get_data(field)
- + dfield_get_len(field)
- - BTR_EXTERN_FIELD_REF_SIZE,
- BTR_EXTERN_FIELD_REF_SIZE);
- dfield_set_ext(field);
- break;
- default:
- /* Reconstruct the original locally
- stored part of the column. The data
- will have to be copied. */
- ut_a(uf->orig_len > BTR_EXTERN_FIELD_REF_SIZE);
-
- data = (byte*) dfield_get_data(field);
- len = dfield_get_len(field);
-
- buf = (byte*) mem_heap_alloc(heap,
- uf->orig_len);
- /* Copy the locally stored prefix. */
- memcpy(buf, data,
- unsigned(uf->orig_len)
- - BTR_EXTERN_FIELD_REF_SIZE);
- /* Copy the BLOB pointer. */
- memcpy(buf + unsigned(uf->orig_len)
- - BTR_EXTERN_FIELD_REF_SIZE,
- data + len - BTR_EXTERN_FIELD_REF_SIZE,
- BTR_EXTERN_FIELD_REF_SIZE);
-
- dfield_set_data(field, buf, uf->orig_len);
- dfield_set_ext(field);
- }
- }
- }
-
- return(n_pushed);
-}
-
-/*******************************************************************//**
Returns the length of a BLOB part stored on the header page.
@return part length */
static
@@ -7155,7 +7094,7 @@ struct btr_blob_log_check_t {
/** Mini transaction holding the latches for m_pcur */
mtr_t* m_mtr;
/** rec_get_offsets(rec, index); offset of clust_rec */
- const ulint* m_offsets;
+ const offset_t* m_offsets;
/** The block containing clustered record */
buf_block_t** m_block;
/** The clustered record pointer */
@@ -7175,7 +7114,7 @@ struct btr_blob_log_check_t {
btr_blob_log_check_t(
btr_pcur_t* pcur,
mtr_t* mtr,
- const ulint* offsets,
+ const offset_t* offsets,
buf_block_t** block,
rec_t** rec,
enum blob_op op)
@@ -7246,7 +7185,7 @@ struct btr_blob_log_check_t {
*m_rec = btr_pcur_get_rec(m_pcur);
rec_offs_make_valid(*m_rec, index, true,
- const_cast<ulint*>(m_offsets));
+ const_cast<offset_t*>(m_offsets));
ut_ad(m_mtr->memo_contains_page_flagged(
*m_rec,
@@ -7277,7 +7216,7 @@ btr_store_big_rec_extern_fields(
btr_pcur_t* pcur, /*!< in/out: a persistent cursor. if
btr_mtr is restarted, then this can
be repositioned. */
- ulint* offsets, /*!< in/out: rec_get_offsets() on
+ offset_t* offsets, /*!< in/out: rec_get_offsets() on
pcur. the "external storage" flags
in offsets will correctly correspond
to rec when this function returns */
@@ -7537,33 +7476,6 @@ btr_store_big_rec_extern_fields(
/* Initialize the unused "prev page" pointer */
mlog_write_ulint(page + FIL_PAGE_PREV,
FIL_NULL, MLOG_4BYTES, &mtr);
- /* Write a back pointer to the record
- into the otherwise unused area. This
- information could be useful in
- debugging. Later, we might want to
- implement the possibility to relocate
- BLOB pages. Then, we would need to be
- able to adjust the BLOB pointer in the
- record. We do not store the heap
- number of the record, because it can
- change in page_zip_reorganize() or
- btr_page_reorganize(). However, also
- the page number of the record may
- change when B-tree nodes are split or
- merged.
- NOTE: FIL_PAGE_FILE_FLUSH_LSN space is
- used by R-tree index for a Split Sequence
- Number */
- ut_ad(!dict_index_is_spatial(index));
-
- mlog_write_ulint(page
- + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
- space_id,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(page
- + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + 4,
- rec_page_no,
- MLOG_4BYTES, &mtr);
/* Zero out the unused part of the page. */
memset(page + page_zip_get_size(page_zip)
@@ -7789,7 +7701,7 @@ btr_free_externally_stored_field(
byte* field_ref, /*!< in/out: field reference */
const rec_t* rec, /*!< in: record containing field_ref, for
page_zip_write_blob_ptr(), or NULL */
- const ulint* offsets, /*!< in: rec_get_offsets(rec, index),
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index),
or NULL */
page_zip_des_t* page_zip, /*!< in: compressed page corresponding
to rec, or NULL if rec == NULL */
@@ -7963,7 +7875,7 @@ btr_rec_free_externally_stored_fields(
dict_index_t* index, /*!< in: index of the data, the index
tree MUST be X-latched */
rec_t* rec, /*!< in/out: record */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */
bool rollback,/*!< in: performing rollback? */
@@ -8004,7 +7916,7 @@ btr_rec_free_updated_extern_fields(
rec_t* rec, /*!< in/out: record */
page_zip_des_t* page_zip,/*!< in: compressed page whose uncompressed
part will be updated, or NULL */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const upd_t* update, /*!< in: update vector */
bool rollback,/*!< in: performing rollback? */
mtr_t* mtr) /*!< in: mini-transaction handle which contains
@@ -8402,7 +8314,7 @@ protected by a lock or a page latch
byte*
btr_rec_copy_externally_stored_field(
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
const page_size_t& page_size,
ulint no,
ulint* len,
diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc
index 39007c34258..dd8a2546691 100644
--- a/storage/innobase/btr/btr0defragment.cc
+++ b/storage/innobase/btr/btr0defragment.cc
@@ -338,8 +338,8 @@ btr_defragment_calc_n_recs_for_size(
{
page_t* page = buf_block_get_frame(block);
ulint n_recs = 0;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
mem_heap_t* heap = NULL;
ulint size = 0;
diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc
index cf82657a3bc..46549c13c3d 100644
--- a/storage/innobase/btr/btr0pcur.cc
+++ b/storage/innobase/btr/btr0pcur.cc
@@ -302,16 +302,21 @@ btr_pcur_restore_position_func(
if (cursor->rel_pos == BTR_PCUR_ON) {
#ifdef UNIV_DEBUG
const rec_t* rec;
- const ulint* offsets1;
- const ulint* offsets2;
+ offset_t offsets1_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets2_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets1 = offsets1_;
+ offset_t* offsets2 = offsets2_;
rec = btr_pcur_get_rec(cursor);
+ rec_offs_init(offsets1_);
+ rec_offs_init(offsets2_);
+
heap = mem_heap_create(256);
offsets1 = rec_get_offsets(
- cursor->old_rec, index, NULL, true,
+ cursor->old_rec, index, offsets1, true,
cursor->old_n_fields, &heap);
offsets2 = rec_get_offsets(
- rec, index, NULL, true,
+ rec, index, offsets2, true,
cursor->old_n_fields, &heap);
ut_ad(!cmp_rec_rec(cursor->old_rec,
@@ -370,11 +375,13 @@ btr_pcur_restore_position_func(
ut_ad(cursor->rel_pos == BTR_PCUR_ON
|| cursor->rel_pos == BTR_PCUR_BEFORE
|| cursor->rel_pos == BTR_PCUR_AFTER);
+ offset_t offsets[REC_OFFS_NORMAL_SIZE];
+ rec_offs_init(offsets);
if (cursor->rel_pos == BTR_PCUR_ON
&& btr_pcur_is_on_user_rec(cursor)
&& !cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor),
rec_get_offsets(btr_pcur_get_rec(cursor),
- index, NULL, true,
+ index, offsets, true,
ULINT_UNDEFINED, &heap))) {
/* We have to store the NEW value for the modify clock,
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc
index 975520220c0..b0d1c91e5d8 100644
--- a/storage/innobase/btr/btr0scrub.cc
+++ b/storage/innobase/btr/btr0scrub.cc
@@ -478,7 +478,7 @@ btr_pessimistic_scrub(
/* arguments to btr_page_split_and_insert */
mem_heap_t* heap = NULL;
dtuple_t* entry = NULL;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
ulint n_ext = 0;
ulint flags = BTR_MODIFY_TREE;
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index a19c67ac1fd..ee1eaaac8ea 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -97,7 +97,7 @@ static inline
ulint
rec_fold(
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint n_fields,
ulint n_bytes,
index_id_t tree_id)
@@ -669,7 +669,7 @@ btr_search_update_hash_ref(
&& (block->curr_n_bytes == info->n_bytes)
&& (block->curr_left_side == info->left_side)) {
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
rec = btr_cur_get_rec(cursor);
@@ -722,8 +722,8 @@ btr_search_check_guess(
ulint match;
int cmp;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
ibool success = FALSE;
rec_offs_init(offsets_);
@@ -1082,7 +1082,7 @@ void btr_search_drop_page_hash_index(buf_block_t* block)
ulint i;
mem_heap_t* heap;
const dict_index_t* index;
- ulint* offsets;
+ offset_t* offsets;
rw_lock_t* latch;
btr_search_t* info;
@@ -1337,8 +1337,8 @@ btr_search_build_page_hash_index(
const rec_t** recs;
ulint i;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
#ifdef MYSQL_INDEX_DISABLE_AHI
if (index->disable_ahi) return;
@@ -1642,7 +1642,7 @@ void btr_search_update_hash_on_delete(btr_cur_t* cursor)
const rec_t* rec;
ulint fold;
dict_index_t* index;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
mem_heap_t* heap = NULL;
rec_offs_init(offsets_);
@@ -1797,8 +1797,8 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor, rw_lock_t* ahi_latch)
ibool left_side;
bool locked = false;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(ahi_latch == btr_get_search_latch(cursor->index));
@@ -1955,8 +1955,8 @@ btr_search_hash_table_validate(ulint hash_table_id)
ulint i;
ulint cell_count;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
if (!btr_search_enabled) {
return(TRUE);
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 6b46cc7097b..6f64709c9bb 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -103,6 +103,7 @@ struct set_numa_interleave_t
" policy to MPOL_INTERLEAVE: "
<< strerror(errno);
}
+ numa_bitmask_free(numa_mems_allowed);
}
}
@@ -130,29 +131,6 @@ struct set_numa_interleave_t
#include "snappy-c.h"
#endif
-inline void* aligned_malloc(size_t size, size_t align) {
- void *result;
-#ifdef _MSC_VER
- result = _aligned_malloc(size, align);
-#elif defined (HAVE_POSIX_MEMALIGN)
- if(posix_memalign(&result, align, size)) {
- result = 0;
- }
-#else
- /* Use unaligned malloc as fallback */
- result = malloc(size);
-#endif
- return result;
-}
-
-inline void aligned_free(void *ptr) {
-#ifdef _MSC_VER
- _aligned_free(ptr);
-#else
- free(ptr);
-#endif
-}
-
/*
IMPLEMENTATION OF THE BUFFER POOL
=================================
@@ -1663,6 +1641,7 @@ buf_chunk_init(
" buffer pool page frames to MPOL_INTERLEAVE"
" (error: " << strerror(errno) << ").";
}
+ numa_bitmask_free(numa_mems_allowed);
}
#endif /* HAVE_LIBNUMA */
@@ -2274,8 +2253,8 @@ buf_page_realloc(
ut_d(block->page.in_page_hash = FALSE);
ulint fold = block->page.id.fold();
ut_ad(fold == new_block->page.id.fold());
- HASH_DELETE(buf_page_t, hash, buf_pool->page_hash, fold, (&block->page));
- HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, (&new_block->page));
+ HASH_REPLACE(buf_page_t, hash, buf_pool->page_hash, fold,
+ &block->page, &new_block->page);
ut_ad(new_block->page.in_page_hash);
@@ -3393,8 +3372,8 @@ buf_relocate(
/* relocate buf_pool->page_hash */
ulint fold = bpage->id.fold();
ut_ad(fold == dpage->id.fold());
- HASH_DELETE(buf_page_t, hash, buf_pool->page_hash, fold, bpage);
- HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, dpage);
+ HASH_REPLACE(buf_page_t, hash, buf_pool->page_hash, fold, bpage,
+ dpage);
}
/** Hazard Pointer implementation. */
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index 3f998165ccc..55ce17513c2 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2019, 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 the Free Software
@@ -989,6 +989,7 @@ try_again:
int64_t sig_count = os_event_reset(buf_dblwr->b_event);
mutex_exit(&buf_dblwr->mutex);
+ os_aio_simulated_wake_handler_threads();
os_event_wait_low(buf_dblwr->b_event, sig_count);
goto try_again;
}
@@ -1118,6 +1119,7 @@ try_again:
checkpoint. */
int64_t sig_count = os_event_reset(buf_dblwr->b_event);
mutex_exit(&buf_dblwr->mutex);
+ os_aio_simulated_wake_handler_threads();
os_event_wait_low(buf_dblwr->b_event, sig_count);
goto try_again;
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index cfe3f9a6bcb..17583eb3399 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, 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
@@ -59,6 +59,7 @@ static const ulint BUF_LRU_OLD_TOLERANCE = 20;
@see buf_LRU_old_adjust_len */
#define BUF_LRU_NON_OLD_MIN_LEN 5
+#ifdef BTR_CUR_HASH_ADAPT
/** When dropping the search hash index entries before deleting an ibd
file, we build a local array of pages belonging to that tablespace
in the buffer pool. Following is the size of that array.
@@ -67,6 +68,7 @@ flush_list when dropping a table. This is to ensure that other threads
are not blocked for extended period of time when using very large
buffer pools. */
static const ulint BUF_LRU_DROP_SEARCH_SIZE = 1024;
+#endif /* BTR_CUR_HASH_ADAPT */
/** We scan these many blocks when looking for a clean page to evict
during LRU eviction. */
@@ -376,7 +378,6 @@ drop_ahi:
return true;
}
-#endif /* BTR_CUR_HASH_ADAPT */
/******************************************************************//**
While flushing (or removing dirty) pages from a tablespace we don't
@@ -465,6 +466,7 @@ buf_flush_try_yield(
return(false);
}
+#endif /* BTR_CUR_HASH_ADAPT */
/******************************************************************//**
Removes a single page from a given tablespace inside a specific
@@ -640,6 +642,7 @@ rescan:
goto rescan;
}
+#ifdef BTR_CUR_HASH_ADAPT
++processed;
/* Yield if we have hogged the CPU and mutexes for too long. */
@@ -649,6 +652,7 @@ rescan:
processed = 0;
}
+#endif /* BTR_CUR_HASH_ADAPT */
/* The check for trx is interrupted is expensive, we want
to check every N iterations. */
diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc
index c8b16c25b68..581be6a85c1 100644
--- a/storage/innobase/dict/dict0crea.cc
+++ b/storage/innobase/dict/dict0crea.cc
@@ -2345,49 +2345,6 @@ dict_replace_tablespace_in_dictionary(
return(error);
}
-/** Delete records from SYS_TABLESPACES and SYS_DATAFILES associated
-with a particular tablespace ID.
-@param[in] space Tablespace ID
-@param[in,out] trx Current transaction
-@return DB_SUCCESS if OK, dberr_t if the operation failed */
-
-dberr_t
-dict_delete_tablespace_and_datafiles(
- ulint space,
- trx_t* trx)
-{
- dberr_t err = DB_SUCCESS;
-
- ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_X));
- ut_ad(mutex_own(&dict_sys->mutex));
- ut_ad(srv_sys_tablespaces_open);
-
- trx->op_info = "delete tablespace and datafiles from dictionary";
-
- pars_info_t* info = pars_info_create();
- ut_a(!is_system_tablespace(space));
- pars_info_add_int4_literal(info, "space", space);
-
- err = que_eval_sql(info,
- "PROCEDURE P () IS\n"
- "BEGIN\n"
- "DELETE FROM SYS_TABLESPACES\n"
- "WHERE SPACE = :space;\n"
- "DELETE FROM SYS_DATAFILES\n"
- "WHERE SPACE = :space;\n"
- "END;\n",
- FALSE, trx);
-
- if (err != DB_SUCCESS) {
- ib::warn() << "Could not delete space_id "
- << space << " from data dictionary";
- }
-
- trx->op_info = "";
-
- return(err);
-}
-
/** Assign a new table ID and put it into the table cache and the transaction.
@param[in,out] table Table that needs an ID
@param[in,out] trx Transaction */
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 24dc3890ff9..eb7280b8673 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -2,7 +2,7 @@
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2019, 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 the Free Software
@@ -523,7 +523,10 @@ dict_table_close(
mutex_exit(&dict_sys->mutex);
- if (drop_aborted) {
+ /* dict_table_try_drop_aborted() can generate undo logs.
+ So it should be avoided after shutdown of background
+ threads */
+ if (drop_aborted && !srv_undo_sources) {
dict_table_try_drop_aborted(NULL, table_id, 0);
}
}
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index 567f39d67a1..425aa6c8270 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -1453,7 +1453,7 @@ void dict_table_t::rollback_instant(unsigned n)
bool
dict_index_t::vers_history_row(
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
ut_ad(is_primary());
@@ -1484,8 +1484,8 @@ dict_index_t::vers_history_row(
bool error = false;
mem_heap_t* heap = NULL;
dict_index_t* clust_index = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
mtr_t mtr;
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc
index faf6483e983..f60d574d3b9 100644
--- a/storage/innobase/dict/dict0stats.cc
+++ b/storage/innobase/dict/dict0stats.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2009, 2019, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+Copyright (c) 2015, 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
@@ -1014,8 +1014,8 @@ dict_stats_analyze_index_level(
bool prev_rec_is_copied;
byte* prev_rec_buf = NULL;
ulint prev_rec_buf_size = 0;
- ulint* rec_offsets;
- ulint* prev_rec_offsets;
+ offset_t* rec_offsets;
+ offset_t* prev_rec_offsets;
ulint i;
DEBUG_PRINTF(" %s(table=%s, index=%s, level=" ULINTPF ")\n",
@@ -1036,9 +1036,9 @@ dict_stats_analyze_index_level(
i = (REC_OFFS_HEADER_SIZE + 1 + 1) + n_uniq;
heap = mem_heap_create((2 * sizeof *rec_offsets) * i);
- rec_offsets = static_cast<ulint*>(
+ rec_offsets = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof *rec_offsets));
- prev_rec_offsets = static_cast<ulint*>(
+ prev_rec_offsets = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof *prev_rec_offsets));
rec_offs_set_n_alloc(rec_offsets, i);
rec_offs_set_n_alloc(prev_rec_offsets, i);
@@ -1169,13 +1169,9 @@ dict_stats_analyze_index_level(
prev_rec, index, prev_rec_offsets, !level,
n_uniq, &heap);
- cmp_rec_rec_with_match(rec,
- prev_rec,
- rec_offsets,
- prev_rec_offsets,
- index,
- FALSE,
- &matched_fields);
+ cmp_rec_rec(prev_rec, rec,
+ prev_rec_offsets, rec_offsets, index,
+ false, &matched_fields);
for (i = matched_fields; i < n_uniq; i++) {
@@ -1331,11 +1327,11 @@ to the number of externally stored pages which were encountered
@return offsets1 or offsets2 (the offsets of *out_rec),
or NULL if the page is empty and does not contain user records. */
UNIV_INLINE
-ulint*
+offset_t*
dict_stats_scan_page(
const rec_t** out_rec,
- ulint* offsets1,
- ulint* offsets2,
+ offset_t* offsets1,
+ offset_t* offsets2,
const dict_index_t* index,
const page_t* page,
ulint n_prefix,
@@ -1343,8 +1339,8 @@ dict_stats_scan_page(
ib_uint64_t* n_diff,
ib_uint64_t* n_external_pages)
{
- ulint* offsets_rec = offsets1;
- ulint* offsets_next_rec = offsets2;
+ offset_t* offsets_rec = offsets1;
+ offset_t* offsets_next_rec = offsets2;
const rec_t* rec;
const rec_t* next_rec;
/* A dummy heap, to be passed to rec_get_offsets().
@@ -1395,9 +1391,8 @@ dict_stats_scan_page(
/* check whether rec != next_rec when looking at
the first n_prefix fields */
- cmp_rec_rec_with_match(rec, next_rec,
- offsets_rec, offsets_next_rec,
- index, FALSE, &matched_fields);
+ cmp_rec_rec(rec, next_rec, offsets_rec, offsets_next_rec,
+ index, false, &matched_fields);
if (matched_fields < n_prefix) {
/* rec != next_rec, => rec is non-boring */
@@ -1410,23 +1405,16 @@ dict_stats_scan_page(
}
rec = next_rec;
- {
- /* Assign offsets_rec = offsets_next_rec
- so that offsets_rec matches with rec which
- was just assigned rec = next_rec above.
- Also need to point offsets_next_rec to the
- place where offsets_rec was pointing before
- because we have just 2 placeholders where
- data is actually stored:
- offsets1 and offsets2 and we
- are using them in circular fashion
- (offsets[_next]_rec are just pointers to
- those placeholders). */
- ulint* offsets_tmp;
- offsets_tmp = offsets_rec;
- offsets_rec = offsets_next_rec;
- offsets_next_rec = offsets_tmp;
- }
+ /* Assign offsets_rec = offsets_next_rec so that
+ offsets_rec matches with rec which was just assigned
+ rec = next_rec above. Also need to point
+ offsets_next_rec to the place where offsets_rec was
+ pointing before because we have just 2 placeholders
+ where data is actually stored: offsets1 and offsets2
+ and we are using them in circular fashion
+ (offsets[_next]_rec are just pointers to those
+ placeholders). */
+ std::swap(offsets_rec, offsets_next_rec);
if (should_count_external_pages) {
*n_external_pages += btr_rec_get_externally_stored_len(
@@ -1465,9 +1453,9 @@ dict_stats_analyze_index_below_cur(
const page_t* page;
mem_heap_t* heap;
const rec_t* rec;
- ulint* offsets1;
- ulint* offsets2;
- ulint* offsets_rec;
+ offset_t* offsets1;
+ offset_t* offsets2;
+ offset_t* offsets_rec;
ulint size;
mtr_t mtr;
@@ -1485,10 +1473,10 @@ dict_stats_analyze_index_below_cur(
heap = mem_heap_create(size * (sizeof *offsets1 + sizeof *offsets2));
- offsets1 = static_cast<ulint*>(mem_heap_alloc(
+ offsets1 = static_cast<offset_t*>(mem_heap_alloc(
heap, size * sizeof *offsets1));
- offsets2 = static_cast<ulint*>(mem_heap_alloc(
+ offsets2 = static_cast<offset_t*>(mem_heap_alloc(
heap, size * sizeof *offsets2));
rec_offs_set_n_alloc(offsets1, size);
@@ -1746,8 +1734,8 @@ dict_stats_analyze_index_for_n_prefix(
ut_a(left <= right);
ut_a(right <= last_idx_on_level);
- const ulint rnd = right == left ? 0 :
- ut_rnd_gen_ulint() % (right - left);
+ const ulint rnd = ut_rnd_interval(
+ static_cast<ulint>(right - left));
const ib_uint64_t dive_below_idx
= boundaries->at(static_cast<unsigned>(left + rnd));
diff --git a/storage/innobase/eval/eval0eval.cc b/storage/innobase/eval/eval0eval.cc
index 577157d2eb9..97540d00198 100644
--- a/storage/innobase/eval/eval0eval.cc
+++ b/storage/innobase/eval/eval0eval.cc
@@ -30,9 +30,6 @@ Created 12/29/1997 Heikki Tuuri
#include "row0sel.h"
#include "rem0cmp.h"
-/** The RND function seed */
-static ulint eval_rnd = 128367121;
-
/** Dummy adress used when we should allocate a buffer of size 0 in
eval_node_alloc_val_buf */
@@ -310,120 +307,18 @@ eval_aggregate(
/*===========*/
func_node_t* node) /*!< in: aggregate operation node */
{
- que_node_t* arg;
lint val;
- lint arg_val;
- int func;
ut_ad(que_node_get_type(node) == QUE_NODE_FUNC);
val = eval_node_get_int_val(node);
- func = node->func;
-
- if (func == PARS_COUNT_TOKEN) {
-
- val = val + 1;
- } else {
- ut_ad(func == PARS_SUM_TOKEN);
-
- arg = node->args;
- arg_val = eval_node_get_int_val(arg);
-
- val = val + arg_val;
- }
-
+ ut_a(node->func == PARS_COUNT_TOKEN);
+ val = val + 1;
eval_node_set_int_val(node, val);
}
/*****************************************************************//**
-Evaluates a predefined function node where the function is not relevant
-in benchmarks. */
-static
-void
-eval_predefined_2(
-/*==============*/
- func_node_t* func_node) /*!< in: predefined function node */
-{
- que_node_t* arg;
- que_node_t* arg1;
- que_node_t* arg2 = 0; /* remove warning (??? bug ???) */
- lint int_val;
- byte* data;
- ulint len1;
- ulint len2;
- int func;
- ulint i;
-
- ut_ad(que_node_get_type(func_node) == QUE_NODE_FUNC);
-
- arg1 = func_node->args;
-
- if (arg1) {
- arg2 = que_node_get_next(arg1);
- }
-
- func = func_node->func;
-
- if (func == PARS_PRINTF_TOKEN) {
-
- arg = arg1;
-
- while (arg) {
- dfield_print(que_node_get_val(arg));
-
- arg = que_node_get_next(arg);
- }
-
- putc('\n', stderr);
-
- } else if (func == PARS_ASSERT_TOKEN) {
-
- if (!eval_node_get_ibool_val(arg1)) {
- fputs("SQL assertion fails in a stored procedure!\n",
- stderr);
- }
-
- ut_a(eval_node_get_ibool_val(arg1));
-
- /* This function, or more precisely, a debug procedure,
- returns no value */
-
- } else if (func == PARS_RND_TOKEN) {
-
- len1 = (ulint) eval_node_get_int_val(arg1);
- len2 = (ulint) eval_node_get_int_val(arg2);
-
- ut_ad(len2 >= len1);
-
- if (len2 > len1) {
- int_val = (lint) (len1
- + (eval_rnd % (len2 - len1 + 1)));
- } else {
- int_val = (lint) len1;
- }
-
- eval_rnd = ut_rnd_gen_next_ulint(eval_rnd);
-
- eval_node_set_int_val(func_node, int_val);
-
- } else if (func == PARS_RND_STR_TOKEN) {
-
- len1 = (ulint) eval_node_get_int_val(arg1);
-
- data = eval_node_ensure_val_buf(func_node, len1);
-
- for (i = 0; i < len1; i++) {
- data[i] = (byte)(97 + (eval_rnd % 3));
-
- eval_rnd = ut_rnd_gen_next_ulint(eval_rnd);
- }
- } else {
- ut_error;
- }
-}
-
-/*****************************************************************//**
Evaluates a notfound-function node. */
UNIV_INLINE
void
@@ -494,46 +389,6 @@ eval_substr(
}
/*****************************************************************//**
-Evaluates a replstr-procedure node. */
-static
-void
-eval_replstr(
-/*=========*/
- func_node_t* func_node) /*!< in: function node */
-{
- que_node_t* arg1;
- que_node_t* arg2;
- que_node_t* arg3;
- que_node_t* arg4;
- byte* str1;
- byte* str2;
- ulint len1;
- ulint len2;
-
- arg1 = func_node->args;
- arg2 = que_node_get_next(arg1);
-
- ut_ad(que_node_get_type(arg1) == QUE_NODE_SYMBOL);
-
- arg3 = que_node_get_next(arg2);
- arg4 = que_node_get_next(arg3);
-
- str1 = static_cast<byte*>(dfield_get_data(que_node_get_val(arg1)));
- str2 = static_cast<byte*>(dfield_get_data(que_node_get_val(arg2)));
-
- len1 = (ulint) eval_node_get_int_val(arg3);
- len2 = (ulint) eval_node_get_int_val(arg4);
-
- if ((dfield_get_len(que_node_get_val(arg1)) < len1 + len2)
- || (dfield_get_len(que_node_get_val(arg2)) < len2)) {
-
- ut_error;
- }
-
- ut_memcpy(str1 + len1, str2, len2);
-}
-
-/*****************************************************************//**
Evaluates an instr-function node. */
static
void
@@ -607,44 +462,6 @@ match_found:
/*****************************************************************//**
Evaluates a predefined function node. */
-UNIV_INLINE
-void
-eval_binary_to_number(
-/*==================*/
- func_node_t* func_node) /*!< in: function node */
-{
- que_node_t* arg1;
- dfield_t* dfield;
- byte* str1;
- byte* str2;
- ulint len1;
- ulint int_val;
-
- arg1 = func_node->args;
-
- dfield = que_node_get_val(arg1);
-
- str1 = static_cast<byte*>(dfield_get_data(dfield));
- len1 = dfield_get_len(dfield);
-
- if (len1 > 4) {
- ut_error;
- }
-
- if (len1 == 4) {
- str2 = str1;
- } else {
- int_val = 0;
- str2 = (byte*) &int_val;
-
- ut_memcpy(str2 + (4 - len1), str1, len1);
- }
-
- eval_node_copy_and_alloc_val(func_node, str2, 4);
-}
-
-/*****************************************************************//**
-Evaluates a predefined function node. */
static
void
eval_concat(
@@ -734,95 +551,12 @@ eval_to_binary(
}
/*****************************************************************//**
-Evaluates a predefined function node. */
-UNIV_INLINE
-void
-eval_predefined(
-/*============*/
- func_node_t* func_node) /*!< in: function node */
+Evaluate LENGTH(). */
+inline void eval_length(func_node_t* func_node)
{
- que_node_t* arg1;
- lint int_val;
- byte* data;
- int func;
-
- func = func_node->func;
-
- arg1 = func_node->args;
-
- if (func == PARS_LENGTH_TOKEN) {
-
- int_val = (lint) dfield_get_len(que_node_get_val(arg1));
-
- } else if (func == PARS_TO_CHAR_TOKEN) {
-
- /* Convert number to character string as a
- signed decimal integer. */
-
- ulint uint_val;
- int int_len;
-
- int_val = eval_node_get_int_val(arg1);
-
- /* Determine the length of the string. */
-
- if (int_val == 0) {
- int_len = 1; /* the number 0 occupies 1 byte */
- } else {
- int_len = 0;
- if (int_val < 0) {
- uint_val = ((ulint) -int_val - 1) + 1;
- int_len++; /* reserve space for minus sign */
- } else {
- uint_val = (ulint) int_val;
- }
- for (; uint_val > 0; int_len++) {
- uint_val /= 10;
- }
- }
-
- /* allocate the string */
- data = eval_node_ensure_val_buf(func_node, ulint(int_len) + 1);
-
- /* add terminating NUL character */
- data[int_len] = 0;
-
- /* convert the number */
-
- if (int_val == 0) {
- data[0] = '0';
- } else {
- int tmp;
- if (int_val < 0) {
- data[0] = '-'; /* preceding minus sign */
- uint_val = ((ulint) -int_val - 1) + 1;
- } else {
- uint_val = (ulint) int_val;
- }
- for (tmp = int_len; uint_val > 0; uint_val /= 10) {
- data[--tmp] = (byte)
- ('0' + (byte)(uint_val % 10));
- }
- }
-
- dfield_set_len(que_node_get_val(func_node), ulint(int_len));
-
- return;
-
- } else if (func == PARS_TO_NUMBER_TOKEN) {
-
- int_val = atoi((char*)
- dfield_get_data(que_node_get_val(arg1)));
-
- } else if (func == PARS_SYSDATE_TOKEN) {
- int_val = (lint) time(NULL);
- } else {
- eval_predefined_2(func_node);
-
- return;
- }
-
- eval_node_set_int_val(func_node, int_val);
+ eval_node_set_int_val(func_node,
+ dfield_get_len(que_node_get_val
+ (func_node->args)));
}
/*****************************************************************//**
@@ -851,8 +585,7 @@ eval_func(
if (dfield_is_null(que_node_get_val(arg))
&& (fclass != PARS_FUNC_CMP)
- && (func != PARS_NOTFOUND_TOKEN)
- && (func != PARS_PRINTF_TOKEN)) {
+ && (func != PARS_NOTFOUND_TOKEN)) {
ut_error;
}
@@ -877,24 +610,20 @@ eval_func(
case PARS_SUBSTR_TOKEN:
eval_substr(func_node);
return;
- case PARS_REPLSTR_TOKEN:
- eval_replstr(func_node);
- return;
case PARS_INSTR_TOKEN:
eval_instr(func_node);
return;
- case PARS_BINARY_TO_NUMBER_TOKEN:
- eval_binary_to_number(func_node);
- return;
case PARS_CONCAT_TOKEN:
eval_concat(func_node);
return;
case PARS_TO_BINARY_TOKEN:
eval_to_binary(func_node);
return;
- default:
- eval_predefined(func_node);
+ case PARS_LENGTH_TOKEN:
+ eval_length(func_node);
return;
+ default:
+ ut_error;
}
case PARS_FUNC_LOGICAL:
eval_logical(func_node);
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 0375432b001..496f428c1ba 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2014, 2019, MariaDB Corporation.
+Copyright (c) 2014, 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
@@ -654,51 +654,10 @@ fil_space_encrypt(
return (src_frame);
}
- fil_space_crypt_t* crypt_data = space->crypt_data;
- const page_size_t page_size(space->flags);
ut_ad(space->pending_io());
- byte* tmp = fil_encrypt_buf(crypt_data, space->id, offset, lsn,
- src_frame, page_size, dst_frame);
-
-#ifdef UNIV_DEBUG
- if (tmp) {
- /* Verify that encrypted buffer is not corrupted */
- dberr_t err = DB_SUCCESS;
- byte* src = src_frame;
- bool page_compressed_encrypted = (mach_read_from_2(tmp+FIL_PAGE_TYPE) == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED);
- byte uncomp_mem[UNIV_PAGE_SIZE_MAX];
- byte tmp_mem[UNIV_PAGE_SIZE_MAX];
-
- if (page_compressed_encrypted) {
- memcpy(uncomp_mem, src, srv_page_size);
- ulint unzipped1 = fil_page_decompress(
- tmp_mem, uncomp_mem);
- ut_ad(unzipped1);
- if (unzipped1 != srv_page_size) {
- src = uncomp_mem;
- }
- }
-
- ut_ad(!buf_page_is_corrupted(true, src, page_size, space));
- ut_ad(fil_space_decrypt(crypt_data, tmp_mem, page_size, tmp,
- &err));
- ut_ad(err == DB_SUCCESS);
-
- /* Need to decompress the page if it was also compressed */
- if (page_compressed_encrypted) {
- byte buf[UNIV_PAGE_SIZE_MAX];
- memcpy(buf, tmp_mem, srv_page_size);
- ulint unzipped2 = fil_page_decompress(tmp_mem, buf);
- ut_ad(unzipped2);
- }
-
- memcpy(tmp_mem + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
- src + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 8);
- ut_ad(!memcmp(src, tmp_mem, page_size.physical()));
- }
-#endif /* UNIV_DEBUG */
-
- return tmp;
+ return fil_encrypt_buf(space->crypt_data, space->id, offset, lsn,
+ src_frame, page_size_t(space->flags),
+ dst_frame);
}
/** Decrypt a page.
@@ -2335,7 +2294,7 @@ static void fil_crypt_rotation_list_fill()
}
}
- UT_LIST_ADD_LAST(fil_system.rotation_list, space);
+ fil_system.rotation_list.push_back(*space);
}
}
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index e22b1c4e314..434490c002c 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2019, MariaDB Corporation.
+Copyright (c) 2014, 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
@@ -155,7 +155,7 @@ current working directory ".", but in the MySQL Embedded Server Library
it is an absolute path. */
const char* fil_path_to_mysql_datadir;
-/** Common InnoDB file extentions */
+/** Common InnoDB file extensions */
const char* dot_ext[] = { "", ".ibd", ".isl", ".cfg" };
/** The number of fsyncs done to the log */
@@ -861,9 +861,7 @@ skip_flush:
if (space->is_in_unflushed_spaces()
&& fil_space_is_flushed(space)) {
- UT_LIST_REMOVE(
- fil_system.unflushed_spaces,
- space);
+ fil_system.unflushed_spaces.remove(*space);
}
}
@@ -1165,7 +1163,7 @@ fil_node_close_to_free(
} else if (space->is_in_unflushed_spaces()
&& fil_space_is_flushed(space)) {
- UT_LIST_REMOVE(fil_system.unflushed_spaces, space);
+ fil_system.unflushed_spaces.remove(*space);
}
node->close();
@@ -1188,13 +1186,11 @@ fil_space_detach(
if (space->is_in_unflushed_spaces()) {
ut_ad(!fil_buffering_disabled(space));
-
- UT_LIST_REMOVE(fil_system.unflushed_spaces, space);
+ fil_system.unflushed_spaces.remove(*space);
}
if (space->is_in_rotation_list()) {
-
- UT_LIST_REMOVE(fil_system.rotation_list, space);
+ fil_system.rotation_list.remove(*space);
}
UT_LIST_REMOVE(fil_system.space_list, space);
@@ -1409,7 +1405,7 @@ fil_space_create(
srv_encrypt_tables)) {
/* Key rotation is not enabled, need to inform background
encryption threads. */
- UT_LIST_ADD_LAST(fil_system.rotation_list, space);
+ fil_system.rotation_list.push_back(*space);
mutex_exit(&fil_system.mutex);
os_event_set(fil_crypt_threads_event);
} else {
@@ -1707,7 +1703,7 @@ void fil_system_t::close()
{
ut_ad(this == &fil_system);
ut_a(!UT_LIST_GET_LEN(LRU));
- ut_a(!UT_LIST_GET_LEN(unflushed_spaces));
+ ut_a(unflushed_spaces.empty());
ut_a(!UT_LIST_GET_LEN(space_list));
ut_ad(!sys_space);
ut_ad(!temp_space);
@@ -4088,8 +4084,8 @@ fil_node_complete_io(fil_node_t* node, const IORequest& type)
node->needs_flush = true;
if (!node->space->is_in_unflushed_spaces()) {
- UT_LIST_ADD_FIRST(fil_system.unflushed_spaces,
- node->space);
+ fil_system.unflushed_spaces.push_front(
+ *node->space);
}
}
}
@@ -4573,7 +4569,6 @@ void
fil_flush_file_spaces(
fil_type_t purpose)
{
- fil_space_t* space;
ulint* space_ids;
ulint n_space_ids;
@@ -4581,30 +4576,25 @@ fil_flush_file_spaces(
mutex_enter(&fil_system.mutex);
- n_space_ids = UT_LIST_GET_LEN(fil_system.unflushed_spaces);
+ n_space_ids = fil_system.unflushed_spaces.size();
if (n_space_ids == 0) {
mutex_exit(&fil_system.mutex);
return;
}
- /* Assemble a list of space ids to flush. Previously, we
- traversed fil_system.unflushed_spaces and called UT_LIST_GET_NEXT()
- on a space that was just removed from the list by fil_flush().
- Thus, the space could be dropped and the memory overwritten. */
space_ids = static_cast<ulint*>(
ut_malloc_nokey(n_space_ids * sizeof(*space_ids)));
n_space_ids = 0;
- for (space = UT_LIST_GET_FIRST(fil_system.unflushed_spaces);
- space;
- space = UT_LIST_GET_NEXT(unflushed_spaces, space)) {
+ for (intrusive::list<fil_space_t, unflushed_spaces_tag_t>::iterator it
+ = fil_system.unflushed_spaces.begin(),
+ end = fil_system.unflushed_spaces.end();
+ it != end; ++it) {
- if (space->purpose == purpose
- && !space->is_stopping()) {
-
- space_ids[n_space_ids++] = space->id;
+ if (it->purpose == purpose && !it->is_stopping()) {
+ space_ids[n_space_ids++] = it->id;
}
}
@@ -5222,8 +5212,8 @@ fil_space_remove_from_keyrotation(fil_space_t* space)
ut_ad(space);
if (!space->referenced() && space->is_in_rotation_list()) {
- ut_a(UT_LIST_GET_LEN(fil_system.rotation_list) > 0);
- UT_LIST_REMOVE(fil_system.rotation_list, space);
+ ut_a(!fil_system.rotation_list.empty());
+ fil_system.rotation_list.remove(*space);
}
}
@@ -5239,53 +5229,45 @@ If NULL, use the first fil_space_t on fil_system.space_list.
@param[in] key_version key version of the key state thread
@return pointer to the next fil_space_t.
@retval NULL if this was the last */
-fil_space_t*
-fil_system_t::keyrotate_next(
- fil_space_t* prev_space,
- bool recheck,
- uint key_version)
+fil_space_t *fil_system_t::keyrotate_next(fil_space_t *prev_space,
+ bool recheck, uint key_version)
{
- mutex_enter(&fil_system.mutex);
+ mutex_enter(&fil_system.mutex);
- /* If one of the encryption threads already started the encryption
- of the table then don't remove the unencrypted spaces from
- rotation list
+ /* If one of the encryption threads already started the encryption
+ of the table then don't remove the unencrypted spaces from rotation list
- If there is a change in innodb_encrypt_tables variables value then
- don't remove the last processed tablespace from the rotation list. */
- const bool remove = ((!recheck || prev_space->crypt_data)
- && (!key_version == !srv_encrypt_tables));
+ If there is a change in innodb_encrypt_tables variables value then
+ don't remove the last processed tablespace from the rotation list. */
+ const bool remove= (!recheck || prev_space->crypt_data) &&
+ !key_version == !srv_encrypt_tables;
+ intrusive::list<fil_space_t, rotation_list_tag_t>::iterator it=
+ prev_space == NULL ? fil_system.rotation_list.end() : prev_space;
- fil_space_t* space = prev_space;
+ if (it == fil_system.rotation_list.end())
+ it= fil_system.rotation_list.begin();
+ else
+ {
+ /* Move on to the next fil_space_t */
+ prev_space->release();
- if (prev_space == NULL) {
- space = UT_LIST_GET_FIRST(fil_system.rotation_list);
+ ++it;
- /* We can trust that space is not NULL because we
- checked list length above */
- } else {
- /* Move on to the next fil_space_t */
- space->release();
+ while (it != fil_system.rotation_list.end() &&
+ (UT_LIST_GET_LEN(it->chain) == 0 || it->is_stopping()))
+ ++it;
- space = UT_LIST_GET_NEXT(rotation_list, space);
+ if (remove)
+ fil_space_remove_from_keyrotation(prev_space);
+ }
- while (space != NULL
- && (UT_LIST_GET_LEN(space->chain) == 0
- || space->is_stopping())) {
- space = UT_LIST_GET_NEXT(rotation_list, space);
- }
+ fil_space_t *space= it == fil_system.rotation_list.end() ? NULL : &*it;
- if (remove) {
- fil_space_remove_from_keyrotation(prev_space);
- }
- }
-
- if (space != NULL) {
- space->acquire();
- }
+ if (space)
+ space->acquire();
- mutex_exit(&fil_system.mutex);
- return(space);
+ mutex_exit(&fil_system.mutex);
+ return space;
}
/** Determine the block size of the data file.
@@ -5363,18 +5345,21 @@ fil_space_set_punch_hole(
/** Checks that this tablespace in a list of unflushed tablespaces.
@return true if in a list */
-bool fil_space_t::is_in_unflushed_spaces() const {
- ut_ad(mutex_own(&fil_system.mutex));
+bool fil_space_t::is_in_unflushed_spaces() const
+{
+ ut_ad(mutex_own(&fil_system.mutex));
- return fil_system.unflushed_spaces.start == this
- || unflushed_spaces.next || unflushed_spaces.prev;
+ return static_cast<const intrusive::list_node<unflushed_spaces_tag_t> *>(
+ this)
+ ->next;
}
/** Checks that this tablespace needs key rotation.
@return true if in a rotation list */
-bool fil_space_t::is_in_rotation_list() const {
- ut_ad(mutex_own(&fil_system.mutex));
+bool fil_space_t::is_in_rotation_list() const
+{
+ ut_ad(mutex_own(&fil_system.mutex));
- return fil_system.rotation_list.start == this || rotation_list.next
- || rotation_list.prev;
+ return static_cast<const intrusive::list_node<rotation_list_tag_t> *>(this)
+ ->next;
}
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index 3ca539c5f22..6b324354527 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -3202,7 +3202,7 @@ fts_fetch_doc_from_rec(
dict_index_t* clust_index, /*!< in: cluster index */
btr_pcur_t* pcur, /*!< in: cursor whose position
has been stored */
- ulint* offsets, /*!< in: offsets */
+ offset_t* offsets, /*!< in: offsets */
fts_doc_t* doc) /*!< out: fts doc to hold parsed
documents */
{
@@ -3486,7 +3486,7 @@ fts_add_doc_by_id(
btr_pcur_t* doc_pcur;
const rec_t* clust_rec;
btr_pcur_t clust_pcur;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
ulint num_idx = ib_vector_size(cache->get_docs);
rec = btr_pcur_get_rec(&pcur);
@@ -3677,8 +3677,8 @@ fts_get_max_doc_id(
if (!page_is_empty(btr_pcur_get_page(&pcur))) {
const rec_t* rec = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
mem_heap_t* heap = NULL;
ulint len;
const void* data;
@@ -5186,8 +5186,8 @@ fts_get_doc_id_from_rec(
const byte* data;
ulint col_no;
doc_id_t doc_id = 0;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
mem_heap_t* my_heap = heap;
ut_a(table->fts->doc_col != ULINT_UNDEFINED);
diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc
index 06cb70ed575..33b4c5d1bb5 100644
--- a/storage/innobase/fts/fts0opt.cc
+++ b/storage/innobase/fts/fts0opt.cc
@@ -2645,8 +2645,6 @@ fts_optimize_request_sync_table(
ib_wqueue_add(fts_optimize_wq, msg, msg->heap, true);
- table->fts->in_queue = true;
-
mutex_exit(&fts_optimize_wq->mutex);
}
diff --git a/storage/innobase/gis/gis0geo.cc b/storage/innobase/gis/gis0geo.cc
index d60a304f2f3..dad40d19da7 100644
--- a/storage/innobase/gis/gis0geo.cc
+++ b/storage/innobase/gis/gis0geo.cc
@@ -434,26 +434,6 @@ pick_seeds(
}
}
-/*********************************************************//**
-Generates a random iboolean value.
-@return the random value */
-static
-ibool
-ut_rnd_gen_ibool(void)
-/*=================*/
-{
- ulint x;
-
- x = ut_rnd_gen_ulint();
-
- if (((x >> 20) + (x >> 15)) & 1) {
-
- return(TRUE);
- }
-
- return(FALSE);
-}
-
/*************************************************************//**
Select next node and group where to add. */
static
@@ -490,8 +470,7 @@ pick_next(
/* Introduce some randomness if the record
is identical */
if (diff == 0) {
- diff = static_cast<double>(
- ut_rnd_gen_ibool());
+ diff = static_cast<double>(ut_rnd_gen() & 1);
}
*n_group = 1 + (diff > 0);
@@ -791,35 +770,3 @@ rtree_area_overlapping(
return(area);
}
-
-/** Get the wkb of default POINT value, which represents POINT(0 0)
-if it's of dimension 2, etc.
-@param[in] n_dims dimensions
-@param[out] wkb wkb buffer for default POINT
-@param[in] len length of wkb buffer
-@return non-0 indicate the length of wkb of the default POINT,
-0 if the buffer is too small */
-uint
-get_wkb_of_default_point(
- uint n_dims,
- uchar* wkb,
- uint len)
-{
- // JAN: TODO: MYSQL 5.7 GIS
- #define GEOM_HEADER_SIZE 16
- if (len < GEOM_HEADER_SIZE + sizeof(double) * n_dims) {
- return(0);
- }
-
- /** POINT wkb comprises SRID, wkb header(byte order and type)
- and coordinates of the POINT */
- len = GEOM_HEADER_SIZE + sizeof(double) * n_dims;
- /** We always use 0 as default coordinate */
- memset(wkb, 0, len);
- /** We don't need to write SRID, write 0x01 for Byte Order */
- mach_write_to_n_little_endian(wkb + SRID_SIZE, 1, 0x01);
- /** Write wkbType::wkbPoint for the POINT type */
- mach_write_to_n_little_endian(wkb + SRID_SIZE + 1, 4, wkbPoint);
-
- return(len);
-}
diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc
index 94256abfe71..5a80d394d77 100644
--- a/storage/innobase/gis/gis0rtree.cc
+++ b/storage/innobase/gis/gis0rtree.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, 2019, MariaDB Corporation.
+Copyright (c) 2018, 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
@@ -51,7 +51,7 @@ rtr_page_split_initialize_nodes(
btr_cur_t* cursor, /*!< in: cursor at which to insert; when the
function returns, the cursor is positioned
on the predecessor of the inserted record */
- ulint** offsets,/*!< in: offsets on inserted record */
+ offset_t** offsets,/*!< in: offsets on inserted record */
const dtuple_t* tuple, /*!< in: tuple to insert */
double** buf_pos)/*!< in/out: current buffer position */
{
@@ -192,7 +192,7 @@ rtr_update_mbr_field_in_place(
/*==========================*/
dict_index_t* index, /*!< in: spatial index. */
rec_t* rec, /*!< in/out: rec to be modified.*/
- ulint* offsets, /*!< in/out: offsets on rec. */
+ offset_t* offsets, /*!< in/out: offsets on rec. */
rtr_mbr_t* mbr, /*!< in: the new mbr. */
mtr_t* mtr) /*!< in: mtr */
{
@@ -266,7 +266,7 @@ bool
rtr_update_mbr_field(
/*=================*/
btr_cur_t* cursor, /*!< in/out: cursor pointed to rec.*/
- ulint* offsets, /*!< in/out: offsets on rec. */
+ offset_t* offsets, /*!< in/out: offsets on rec. */
btr_cur_t* cursor2, /*!< in/out: cursor pointed to rec
that should be deleted.
this cursor is for btr_compress to
@@ -295,7 +295,7 @@ rtr_update_mbr_field(
bool ins_suc = true;
ulint cur2_pos = 0;
ulint del_page_no = 0;
- ulint* offsets2;
+ offset_t* offsets2;
rec = btr_cur_get_rec(cursor);
page = page_align(rec);
@@ -382,7 +382,7 @@ rtr_update_mbr_field(
}
if (cursor2) {
- ulint* offsets2;
+ offset_t* offsets2;
if (page_zip) {
cursor2->page_cur.rec
@@ -404,7 +404,7 @@ rtr_update_mbr_field(
page_cur_t page_cur;
rec_t* insert_rec;
- ulint* insert_offsets = NULL;
+ offset_t* insert_offsets = NULL;
ulint old_pos;
rec_t* old_rec;
@@ -436,7 +436,7 @@ update_mbr:
/* When there're not only 1 rec in the page, we do delete/insert
to avoid page split. */
rec_t* insert_rec;
- ulint* insert_offsets = NULL;
+ offset_t* insert_offsets = NULL;
rec_t* next_rec;
/* Delete the rec which cursor point to. */
@@ -636,7 +636,7 @@ rtr_adjust_upper_level(
page_zip_des_t* new_page_zip;
dict_index_t* index = sea_cur->index;
btr_cur_t cursor;
- ulint* offsets;
+ offset_t* offsets;
mem_heap_t* heap;
ulint level;
dtuple_t* node_ptr_upper;
@@ -799,8 +799,8 @@ rtr_split_page_move_rec_list(
page_cur_t new_page_cursor;
page_t* page;
page_t* new_page;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
page_zip_des_t* new_page_zip
= buf_block_get_page_zip(new_block);
rec_t* rec;
@@ -960,7 +960,7 @@ rtr_page_split_and_insert(
btr_cur_t* cursor, /*!< in/out: cursor at which to insert; when the
function returns, the cursor is positioned
on the predecessor of the inserted record */
- ulint** offsets,/*!< out: offsets on inserted record */
+ offset_t** offsets,/*!< out: offsets on inserted record */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
@@ -1309,7 +1309,7 @@ rtr_ins_enlarge_mbr(
mem_heap_t* heap;
dict_index_t* index = btr_cur->index;
page_cur_t* page_cursor;
- ulint* offsets;
+ offset_t* offsets;
node_visit_t* node_visit;
btr_cur_t cursor;
page_t* page;
@@ -1393,10 +1393,10 @@ rtr_page_copy_rec_list_end_no_locks(
page_cur_t page_cur;
page_cur_t cur1;
rec_t* cur_rec;
- ulint offsets_1[REC_OFFS_NORMAL_SIZE];
- ulint* offsets1 = offsets_1;
- ulint offsets_2[REC_OFFS_NORMAL_SIZE];
- ulint* offsets2 = offsets_2;
+ offset_t offsets_1[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets1 = offsets_1;
+ offset_t offsets_2[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets2 = offsets_2;
ulint moved = 0;
bool is_leaf = page_is_leaf(new_page);
@@ -1436,10 +1436,9 @@ rtr_page_copy_rec_list_end_no_locks(
offsets2 = rec_get_offsets(cur_rec, index, offsets2,
is_leaf,
ULINT_UNDEFINED, &heap);
- cmp = cmp_rec_rec_with_match(cur1_rec, cur_rec,
- offsets1, offsets2,
- index, FALSE,
- &cur_matched_fields);
+ cmp = cmp_rec_rec(cur1_rec, cur_rec,
+ offsets1, offsets2, index, false,
+ &cur_matched_fields);
if (cmp < 0) {
page_cur_move_to_prev(&page_cur);
break;
@@ -1520,10 +1519,10 @@ rtr_page_copy_rec_list_start_no_locks(
{
page_cur_t cur1;
rec_t* cur_rec;
- ulint offsets_1[REC_OFFS_NORMAL_SIZE];
- ulint* offsets1 = offsets_1;
- ulint offsets_2[REC_OFFS_NORMAL_SIZE];
- ulint* offsets2 = offsets_2;
+ offset_t offsets_1[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets1 = offsets_1;
+ offset_t offsets_2[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets2 = offsets_2;
page_cur_t page_cur;
ulint moved = 0;
bool is_leaf = page_is_leaf(buf_block_get_frame(block));
@@ -1551,15 +1550,13 @@ rtr_page_copy_rec_list_start_no_locks(
while (!page_rec_is_supremum(cur_rec)) {
ulint cur_matched_fields = 0;
- int cmp;
offsets2 = rec_get_offsets(cur_rec, index, offsets2,
is_leaf,
ULINT_UNDEFINED, &heap);
- cmp = cmp_rec_rec_with_match(cur1_rec, cur_rec,
- offsets1, offsets2,
- index, FALSE,
- &cur_matched_fields);
+ int cmp = cmp_rec_rec(cur1_rec, cur_rec,
+ offsets1, offsets2, index, false,
+ &cur_matched_fields);
if (cmp < 0) {
page_cur_move_to_prev(&page_cur);
cur_rec = page_cur_get_rec(&page_cur);
@@ -1632,8 +1629,8 @@ rtr_merge_mbr_changed(
/*==================*/
btr_cur_t* cursor, /*!< in/out: cursor */
btr_cur_t* cursor2, /*!< in: the other cursor */
- ulint* offsets, /*!< in: rec offsets */
- ulint* offsets2, /*!< in: rec offsets */
+ offset_t* offsets, /*!< in: rec offsets */
+ offset_t* offsets2, /*!< in: rec offsets */
rtr_mbr_t* new_mbr) /*!< out: MBR to update */
{
double* mbr;
@@ -1676,8 +1673,8 @@ rtr_merge_and_update_mbr(
/*=====================*/
btr_cur_t* cursor, /*!< in/out: cursor */
btr_cur_t* cursor2, /*!< in: the other cursor */
- ulint* offsets, /*!< in: rec offsets */
- ulint* offsets2, /*!< in: rec offsets */
+ offset_t* offsets, /*!< in: rec offsets */
+ offset_t* offsets2, /*!< in: rec offsets */
page_t* child_page, /*!< in: the page. */
mtr_t* mtr) /*!< in: mtr */
{
@@ -1740,7 +1737,7 @@ rtr_check_same_block(
{
ulint page_no = childb->page.id.page_no();
- ulint* offsets;
+ offset_t* offsets;
rec_t* rec = page_rec_get_next(page_get_infimum_rec(
buf_block_get_frame(parentb)));
@@ -1771,7 +1768,7 @@ rtr_rec_cal_increase(
dtuple in some of the common fields, or which
has an equal number or more fields than
dtuple */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
double* area) /*!< out: increased area */
{
const dfield_t* dtuple_field;
diff --git a/storage/innobase/gis/gis0sea.cc b/storage/innobase/gis/gis0sea.cc
index 3b3de0b2514..c73e7e6dde8 100644
--- a/storage/innobase/gis/gis0sea.cc
+++ b/storage/innobase/gis/gis0sea.cc
@@ -526,7 +526,7 @@ rtr_compare_cursor_rec(
mem_heap_t** heap) /*!< in: memory heap */
{
const rec_t* rec;
- ulint* offsets;
+ offset_t* offsets;
rec = btr_cur_get_rec(cursor);
@@ -668,7 +668,7 @@ rtr_page_get_father(
{
mem_heap_t* heap = mem_heap_create(100);
#ifdef UNIV_DEBUG
- ulint* offsets;
+ offset_t* offsets;
offsets = rtr_page_get_father_block(
NULL, heap, index, block, mtr, sea_cur, cursor);
@@ -689,9 +689,9 @@ rtr_page_get_father(
that mtr holds an SX-latch or X-latch on the tree.
@return rec_get_offsets() of the node pointer record */
static
-ulint*
+offset_t*
rtr_page_get_father_node_ptr(
- ulint* offsets,/*!< in: work area for the return value */
+ offset_t* offsets,/*!< in: work area for the return value */
mem_heap_t* heap, /*!< in: memory heap to use */
btr_cur_t* sea_cur,/*!< in: search cursor */
btr_cur_t* cursor, /*!< in: cursor pointing to user record,
@@ -784,10 +784,10 @@ rtr_page_get_father_node_ptr(
Returns the father block to a page. It is assumed that mtr holds
an X or SX latch on the tree.
@return rec_get_offsets() of the node pointer record */
-ulint*
+offset_t*
rtr_page_get_father_block(
/*======================*/
- ulint* offsets,/*!< in: work area for the return value */
+ offset_t* offsets,/*!< in: work area for the return value */
mem_heap_t* heap, /*!< in: memory heap to use */
dict_index_t* index, /*!< in: b-tree index */
buf_block_t* block, /*!< in: child page in the index */
@@ -1302,8 +1302,8 @@ rtr_cur_restore_position(
#ifdef UNIV_DEBUG
do {
const rec_t* rec;
- const ulint* offsets1;
- const ulint* offsets2;
+ const offset_t* offsets1;
+ const offset_t* offsets2;
ulint comp;
rec = btr_pcur_get_rec(r_cursor);
@@ -1375,8 +1375,8 @@ search_again:
if (low_match == r_cursor->old_n_fields) {
const rec_t* rec;
- const ulint* offsets1;
- const ulint* offsets2;
+ const offset_t* offsets1;
+ const offset_t* offsets2;
ulint comp;
rec = btr_pcur_get_rec(r_cursor);
@@ -1422,7 +1422,7 @@ rtr_leaf_push_match_rec(
/*====================*/
const rec_t* rec, /*!< in: record to copy */
rtr_info_t* rtr_info, /*!< in/out: search stack */
- ulint* offsets, /*!< in: offsets */
+ offset_t* offsets, /*!< in: offsets */
bool is_comp) /*!< in: is compact format */
{
byte* buf;
@@ -1608,7 +1608,7 @@ void
rtr_get_mbr_from_rec(
/*=================*/
const rec_t* rec, /*!< in: data tuple */
- const ulint* offsets,/*!< in: offsets array */
+ const offset_t* offsets,/*!< in: offsets array */
rtr_mbr_t* mbr) /*!< out MBR */
{
ulint rec_f_len;
@@ -1655,8 +1655,8 @@ rtr_cur_search_with_match(
const page_t* page;
const rec_t* rec;
const rec_t* last_rec;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
mem_heap_t* heap = NULL;
int cmp = 1;
double least_inc = DBL_MAX;
@@ -1939,8 +1939,8 @@ rtr_cur_search_with_match(
test_rec = match_rec->matched_recs->back();
#ifdef UNIV_DEBUG
- ulint offsets_2[REC_OFFS_NORMAL_SIZE];
- ulint* offsets2 = offsets_2;
+ offset_t offsets_2[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets2 = offsets_2;
rec_offs_init(offsets_2);
ut_ad(found);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index eecc72ad1f6..79051b9c247 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4,7 +4,7 @@ Copyright (c) 2000, 2019, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2019, MariaDB Corporation.
+Copyright (c) 2013, 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -3429,17 +3429,6 @@ trx_is_interrupted(
return(trx && trx->mysql_thd && thd_kill_level(trx->mysql_thd));
}
-/**********************************************************************//**
-Determines if the currently running transaction is in strict mode.
-@return TRUE if strict */
-ibool
-trx_is_strict(
-/*==========*/
- trx_t* trx) /*!< in: transaction */
-{
- return(trx && trx->mysql_thd && THDVAR(trx->mysql_thd, strict_mode));
-}
-
/**************************************************************//**
Resets some fields of a m_prebuilt struct. The template is used in fast
retrieval of just those column values MySQL needs in its processing. */
@@ -10905,6 +10894,9 @@ create_table_info_t::create_table_def()
heap = mem_heap_create(1000);
+ ut_d(bool have_vers_start = false);
+ ut_d(bool have_vers_end = false);
+
for (ulint i = 0, j = 0; j < n_cols; i++) {
Field* field = m_form->field[i];
ulint vers_row = 0;
@@ -10912,8 +10904,10 @@ create_table_info_t::create_table_def()
if (m_form->versioned()) {
if (i == m_form->s->row_start_field) {
vers_row = DATA_VERS_START;
+ ut_d(have_vers_start = true);
} else if (i == m_form->s->row_end_field) {
vers_row = DATA_VERS_END;
+ ut_d(have_vers_end = true);
} else if (!(field->flags
& VERS_UPDATE_UNVERSIONED_FLAG)) {
vers_row = DATA_VERSIONED;
@@ -11034,6 +11028,10 @@ err_col:
j++;
}
+ ut_ad(have_vers_start == have_vers_end);
+ ut_ad(table->versioned() == have_vers_start);
+ ut_ad(!table->versioned() || table->vers_start != table->vers_end);
+
if (num_v) {
for (ulint i = 0, j = 0; i < n_cols; i++) {
dict_v_col_t* v_col;
@@ -12493,7 +12491,9 @@ int create_table_info_t::create_table(bool create_fk)
}
}
- if (!row_size_is_acceptable(*m_table)) {
+ /* In TRUNCATE TABLE, we will merely warn about the maximum
+ row size being too large. */
+ if (!row_size_is_acceptable(*m_table, create_fk)) {
DBUG_RETURN(convert_error_code_to_mysql(
DB_TOO_BIG_RECORD, m_flags, NULL));
}
@@ -12502,18 +12502,12 @@ int create_table_info_t::create_table(bool create_fk)
}
bool create_table_info_t::row_size_is_acceptable(
- const dict_table_t &table) const
+ const dict_table_t &table, bool strict) const
{
for (dict_index_t *index= dict_table_get_first_index(&table); index;
index= dict_table_get_next_index(index))
- {
-
- if (!row_size_is_acceptable(*index))
- {
+ if (!row_size_is_acceptable(*index, strict))
return false;
- }
- }
-
return true;
}
@@ -12692,7 +12686,7 @@ static void ib_warn_row_too_big(THD *thd, const dict_table_t *table)
}
bool create_table_info_t::row_size_is_acceptable(
- const dict_index_t &index) const
+ const dict_index_t &index, bool strict) const
{
if ((index.type & DICT_FTS) || index.table->is_system_db)
{
@@ -12701,7 +12695,7 @@ bool create_table_info_t::row_size_is_acceptable(
return true;
}
- const bool strict= THDVAR(m_thd, strict_mode);
+ const bool innodb_strict_mode= THDVAR(m_thd, strict_mode);
dict_index_t::record_size_info_t info= index.record_size_info();
if (info.row_is_too_big())
@@ -12712,18 +12706,19 @@ bool create_table_info_t::row_size_is_acceptable(
const size_t idx= info.get_first_overrun_field_index();
const dict_field_t *field= dict_index_get_nth_field(&index, idx);
- ib::error_or_warn(strict)
- << "Cannot add field " << field->name << " in table "
- << index.table->name << " because after adding it, the row size is "
- << info.get_overrun_size()
- << " which is greater than maximum allowed size ("
- << info.max_leaf_size << " bytes) for a record on index leaf page.";
-
- if (strict)
+ if (innodb_strict_mode || global_system_variables.log_warnings > 2)
{
- return false;
+ ib::error_or_warn(strict && innodb_strict_mode)
+ << "Cannot add field " << field->name << " in table "
+ << index.table->name << " because after adding it, the row size is "
+ << info.get_overrun_size()
+ << " which is greater than maximum allowed size ("
+ << info.max_leaf_size << " bytes) for a record on index leaf page.";
}
+ if (strict && innodb_strict_mode)
+ return false;
+
ib_warn_row_too_big(m_thd, index.table);
}
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index d4390374cd2..8e513ddd692 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2019, 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 the Free Software
@@ -690,9 +690,11 @@ public:
void allocate_trx();
/** Checks that every index have sane size. Depends on strict mode */
- bool row_size_is_acceptable(const dict_table_t& table) const;
+ bool row_size_is_acceptable(const dict_table_t& table,
+ bool strict) const;
/** Checks that given index have sane size. Depends on strict mode */
- bool row_size_is_acceptable(const dict_index_t& index) const;
+ bool row_size_is_acceptable(const dict_index_t& index,
+ bool strict) const;
/** Determines InnoDB table flags.
If strict_mode=OFF, this will adjust the flags to what should be assumed.
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 785c8a970d4..a2839d1a7ec 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2019, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2019, 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 the Free Software
@@ -122,6 +122,15 @@ static const alter_table_operations INNOBASE_ALTER_NOCREATE
= ALTER_DROP_NON_UNIQUE_NON_PRIM_INDEX
| ALTER_DROP_UNIQUE_INDEX;
+/** Operations that InnoDB cares about and can perform without validation */
+static const alter_table_operations INNOBASE_ALTER_NOVALIDATE
+ = INNOBASE_ALTER_NOCREATE
+ | ALTER_VIRTUAL_COLUMN_ORDER
+ | ALTER_COLUMN_NAME
+ | INNOBASE_FOREIGN_OPERATIONS
+ | ALTER_COLUMN_UNVERSIONED
+ | ALTER_DROP_VIRTUAL_COLUMN;
+
/** Operations that InnoDB cares about and can perform without rebuild */
static const alter_table_operations INNOBASE_ALTER_NOREBUILD
= INNOBASE_ONLINE_CREATE
@@ -2162,7 +2171,7 @@ innobase_rec_to_mysql(
struct TABLE* table, /*!< in/out: MySQL table */
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: index */
- const ulint* offsets)/*!< in: rec_get_offsets(
+ const offset_t* offsets)/*!< in: rec_get_offsets(
rec, index, ...) */
{
uint n_fields = table->s->fields;
@@ -4401,7 +4410,7 @@ innobase_add_instant_try(
uf->field_no = f;
uf->new_val = entry->fields[f];
}
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
mem_heap_t* offsets_heap = NULL;
big_rec_t* big_rec;
err = btr_cur_pessimistic_update(
@@ -5541,6 +5550,7 @@ new_table_failed:
if (index) {
dict_mem_index_free(index);
}
+error_handling_drop_uncached_1:
while (++a < ctx->num_to_add_index) {
dict_mem_index_free(ctx->add_index[a]);
}
@@ -5550,9 +5560,17 @@ new_table_failed:
}
ctx->add_index[a] = index;
- if (!info.row_size_is_acceptable(*index)) {
+ /* For ALTER TABLE...FORCE or OPTIMIZE TABLE,
+ we may only issue warnings, because there will
+ be no schema change from the user perspective. */
+ if (!info.row_size_is_acceptable(
+ *index,
+ !!(ha_alter_info->handler_flags
+ & ~(INNOBASE_INPLACE_IGNORE
+ | INNOBASE_ALTER_NOVALIDATE
+ | ALTER_RECREATE_TABLE)))) {
error = DB_TOO_BIG_RECORD;
- goto error_handling;
+ goto error_handling_drop_uncached_1;
}
index->parser = index_defs[a].parser;
index->has_new_v_col = has_new_v_col;
@@ -5652,7 +5670,7 @@ error_handling_drop_uncached:
DBUG_ASSERT(index != ctx->add_index[a]);
}
ctx->add_index[a]= index;
- if (!info.row_size_is_acceptable(*index)) {
+ if (!info.row_size_is_acceptable(*index, true)) {
error = DB_TOO_BIG_RECORD;
goto error_handling_drop_uncached;
}
@@ -5705,7 +5723,7 @@ error_handling_drop_uncached:
}
}
} else if (ctx->is_instant()
- && !info.row_size_is_acceptable(*user_table)) {
+ && !info.row_size_is_acceptable(*user_table, true)) {
error = DB_TOO_BIG_RECORD;
goto error_handling;
}
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 61703f947e2..4ee027290fd 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2019, MariaDB Corporation.
+Copyright (c) 2014, 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
@@ -9050,6 +9050,8 @@ i_s_innodb_mutexes_fill_table(
~Locking() { mutex_exit(&rw_lock_list_mutex); }
} locking;
+ 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) {
@@ -9062,11 +9064,16 @@ i_s_innodb_mutexes_fill_table(
continue;
}
- //OK(field_store_string(fields[MUTEXES_NAME],
- // lock->lock_name));
- OK(field_store_string(
- fields[MUTEXES_CREATE_FILE],
- innobase_basename(lock->cfile_name)));
+ const char* basename = innobase_basename(
+ lock->cfile_name);
+
+ snprintf(lock_name, sizeof lock_name, "%s:%u",
+ 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,
true));
fields[MUTEXES_CREATE_LINE]->set_notnull();
@@ -9082,8 +9089,8 @@ i_s_innodb_mutexes_fill_table(
snprintf(buf1, sizeof buf1, "combined %s",
innobase_basename(block_lock->cfile_name));
- //OK(field_store_string(fields[MUTEXES_NAME],
- // block_lock->lock_name));
+ OK(field_store_string(fields[MUTEXES_NAME],
+ "buf_block_t::lock"));
OK(field_store_string(fields[MUTEXES_CREATE_FILE],
buf1));
OK(fields[MUTEXES_CREATE_LINE]->store(block_lock->cline,
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index ae8b8cd4a8a..38814da0c8d 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -3310,7 +3310,7 @@ ibuf_insert_low(
dtuple_t* ibuf_entry;
mem_heap_t* offsets_heap = NULL;
mem_heap_t* heap;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
ulint buffered;
lint min_n_recs;
rec_t* ins_rec;
@@ -3770,7 +3770,7 @@ ibuf_insert_to_index_page_low(
buf_block_t* block, /*!< in/out: index page where the buffered
entry should be placed */
dict_index_t* index, /*!< in: record descriptor */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t* heap, /*!< in/out: memory heap */
mtr_t* mtr, /*!< in/out: mtr */
page_cur_t* page_cur)/*!< in/out: cursor positioned on the record
@@ -3850,7 +3850,7 @@ ibuf_insert_to_index_page(
ulint low_match;
page_t* page = buf_block_get_frame(block);
rec_t* rec;
- ulint* offsets;
+ offset_t* offsets;
mem_heap_t* heap;
DBUG_ENTER("ibuf_insert_to_index_page");
@@ -4107,8 +4107,8 @@ ibuf_delete(
/* TODO: the below should probably be a separate function,
it's a bastardized version of btr_cur_optimistic_delete. */
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
mem_heap_t* heap = NULL;
ulint max_ins_size = 0;
@@ -4559,7 +4559,7 @@ loop:
}
if (!btr_pcur_is_on_user_rec(&pcur)) {
- ut_ad(btr_pcur_is_after_last_in_tree(&pcur));
+ ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto reset_bit;
}
@@ -4792,7 +4792,7 @@ loop:
&pcur, &mtr);
if (!btr_pcur_is_on_user_rec(&pcur)) {
- ut_ad(btr_pcur_is_after_last_in_tree(&pcur));
+ ut_ad(btr_pcur_is_after_last_on_page(&pcur));
goto leave_loop;
}
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h
index d68b02eda4d..698343bf371 100644
--- a/storage/innobase/include/btr0btr.h
+++ b/storage/innobase/include/btr0btr.h
@@ -30,6 +30,7 @@ Created 6/2/1994 Heikki Tuuri
#include "dict0dict.h"
#include "data0data.h"
+#include "rem0types.h"
#include "page0cur.h"
#include "btr0types.h"
#include "gis0type.h"
@@ -319,7 +320,7 @@ ulint
btr_node_ptr_get_child_page_no(
/*===========================*/
const rec_t* rec, /*!< in: node pointer record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result));
/** Create the root node for a new index tree.
@@ -404,7 +405,7 @@ btr_root_raise_and_insert(
on the root page; when the function returns,
the cursor is positioned on the predecessor
of the inserted record */
- ulint** offsets,/*!< out: offsets on inserted record */
+ offset_t** offsets,/*!< out: offsets on inserted record */
mem_heap_t** heap, /*!< in/out: pointer to memory heap
that can be emptied, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */
@@ -487,7 +488,7 @@ btr_page_split_and_insert(
btr_cur_t* cursor, /*!< in: cursor at which to insert; when the
function returns, the cursor is positioned
on the predecessor of the inserted record */
- ulint** offsets,/*!< out: offsets on inserted record */
+ offset_t** offsets,/*!< out: offsets on inserted record */
mem_heap_t** heap, /*!< in/out: pointer to memory heap
that can be emptied, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */
diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.ic
index c3f0d5e305e..5bb7318fefb 100644
--- a/storage/innobase/include/btr0btr.ic
+++ b/storage/innobase/include/btr0btr.ic
@@ -192,7 +192,7 @@ ulint
btr_node_ptr_get_child_page_no(
/*===========================*/
const rec_t* rec, /*!< in: node pointer record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
const byte* field;
ulint len;
diff --git a/storage/innobase/include/btr0bulk.h b/storage/innobase/include/btr0bulk.h
index 2a434c673cb..9384cb578ed 100644
--- a/storage/innobase/include/btr0bulk.h
+++ b/storage/innobase/include/btr0bulk.h
@@ -28,6 +28,7 @@ Created 03/11/2014 Shaohua Wang
#define btr0bulk_h
#include "dict0dict.h"
+#include "rem0types.h"
#include "page0cur.h"
#include <vector>
@@ -103,7 +104,7 @@ public:
/** Insert a record in the page.
@param[in] rec record
@param[in] offsets record offsets */
- void insert(const rec_t* rec, ulint* offsets);
+ void insert(const rec_t* rec, offset_t* offsets);
/** Mark end of insertion to the page. Scan all records to set page
dirs, and set page header members. */
@@ -127,7 +128,7 @@ public:
@param[in] big_rec external recrod
@param[in] offsets record offsets
@return error code */
- dberr_t storeExt(const big_rec_t* big_rec, ulint* offsets);
+ dberr_t storeExt(const big_rec_t* big_rec, offset_t* offsets);
/** Get node pointer
@return node pointer */
diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h
index c748b4fbc41..13a420fd912 100644
--- a/storage/innobase/include/btr0cur.h
+++ b/storage/innobase/include/btr0cur.h
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
+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
@@ -30,6 +30,7 @@ Created 10/16/1994 Heikki Tuuri
#include "dict0dict.h"
#include "page0cur.h"
#include "btr0types.h"
+#include "rem0types.h"
#include "gis0type.h"
#include "my_base.h"
@@ -271,7 +272,7 @@ btr_cur_optimistic_insert(
specified */
btr_cur_t* cursor, /*!< in: cursor on page after which to insert;
cursor stays valid */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap */
dtuple_t* entry, /*!< in/out: entry to insert */
rec_t** rec, /*!< out: pointer to inserted record if
@@ -307,7 +308,7 @@ btr_cur_pessimistic_insert(
insertion will certainly succeed */
btr_cur_t* cursor, /*!< in: cursor after which to insert;
cursor stays valid */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap
that can be emptied */
dtuple_t* entry, /*!< in/out: entry to insert */
@@ -341,7 +342,7 @@ btr_cur_update_alloc_zip_func(
page_cur_t* cursor, /*!< in/out: B-tree page cursor */
dict_index_t* index, /*!< in: the index corresponding to cursor */
#ifdef UNIV_DEBUG
- ulint* offsets,/*!< in/out: offsets of the cursor record */
+ offset_t* offsets,/*!< in/out: offsets of the cursor record */
#endif /* UNIV_DEBUG */
ulint length, /*!< in: size needed */
bool create, /*!< in: true=delete-and-insert,
@@ -368,7 +369,7 @@ btr_cur_update_in_place(
btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the
same record */
- ulint* offsets,/*!< in/out: offsets on cursor->page_cur.rec */
+ offset_t* offsets,/*!< in/out: offsets on cursor->page_cur.rec */
const upd_t* update, /*!< in: update vector */
ulint cmpl_info,/*!< in: compiler info on secondary index
updates */
@@ -410,7 +411,7 @@ btr_cur_optimistic_update(
btr_cur_t* cursor, /*!< in: cursor on the record to update;
cursor stays valid and positioned on the
same record */
- ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
+ offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** heap, /*!< in/out: pointer to NULL or memory heap */
const upd_t* update, /*!< in: update vector; this must also
contain trx id and roll ptr fields */
@@ -437,7 +438,7 @@ btr_cur_pessimistic_update(
btr_cur_t* cursor, /*!< in/out: cursor on the record to update;
cursor may become invalid if *big_rec == NULL
|| !(flags & BTR_KEEP_POS_FLAG) */
- ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
+ offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap
that can be emptied */
@@ -469,7 +470,7 @@ btr_cur_del_mark_set_clust_rec(
buf_block_t* block, /*!< in/out: buffer block of the record */
rec_t* rec, /*!< in/out: record */
dict_index_t* index, /*!< in: clustered index of the record */
- const ulint* offsets,/*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec) */
que_thr_t* thr, /*!< in: query thread */
const dtuple_t* entry, /*!< in: dtuple for the deleting record */
mtr_t* mtr) /*!< in/out: mini-transaction */
@@ -636,7 +637,7 @@ btr_estimate_number_of_different_key_vals(
ulint
btr_rec_get_externally_stored_len(
const rec_t* rec,
- const ulint* offsets);
+ const offset_t* offsets);
/*******************************************************************//**
Marks non-updated off-page fields as disowned by this record. The ownership
@@ -650,7 +651,7 @@ btr_cur_disown_inherited_fields(
part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
mtr_t* mtr) /*!< in/out: mini-transaction */
MY_ATTRIBUTE((nonnull(2,3,4,5,6)));
@@ -689,7 +690,7 @@ btr_store_big_rec_extern_fields(
btr_pcur_t* pcur, /*!< in/out: a persistent cursor. if
btr_mtr is restarted, then this can
be repositioned. */
- ulint* offsets, /*!< in/out: rec_get_offsets() on
+ offset_t* offsets, /*!< in/out: rec_get_offsets() on
pcur. the "external storage" flags
in offsets will correctly correspond
to rec when this function returns */
@@ -720,7 +721,7 @@ btr_free_externally_stored_field(
byte* field_ref, /*!< in/out: field reference */
const rec_t* rec, /*!< in: record containing field_ref, for
page_zip_write_blob_ptr(), or NULL */
- const ulint* offsets, /*!< in: rec_get_offsets(rec, index),
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index),
or NULL */
page_zip_des_t* page_zip, /*!< in: compressed page corresponding
to rec, or NULL if rec == NULL */
@@ -777,24 +778,12 @@ protected by a lock or a page latch
byte*
btr_rec_copy_externally_stored_field(
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
const page_size_t& page_size,
ulint no,
ulint* len,
mem_heap_t* heap);
-/*******************************************************************//**
-Flags the data tuple fields that are marked as extern storage in the
-update vector. We use this function to remember which fields we must
-mark as extern storage in a record inserted for an update.
-@return number of flagged external columns */
-ulint
-btr_push_update_extern_fields(
-/*==========================*/
- dtuple_t* tuple, /*!< in/out: data tuple */
- const upd_t* update, /*!< in: update vector */
- mem_heap_t* heap) /*!< in: memory heap */
- MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Sets a secondary index record's delete mark to the given value. This
function is only used by the insert buffer merge mechanism. */
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index f04d3fe038f..c9529ee4b73 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -706,6 +706,27 @@ buf_page_is_corrupted(
#endif
MY_ATTRIBUTE((warn_unused_result));
+inline void *aligned_malloc(size_t size, size_t align)
+{
+#ifdef _MSC_VER
+ return _aligned_malloc(size, align);
+#else
+ void *result;
+ if (posix_memalign(&result, align, size))
+ result= NULL;
+ return result;
+#endif
+}
+
+inline void aligned_free(void *ptr)
+{
+#ifdef _MSC_VER
+ _aligned_free(ptr);
+#else
+ free(ptr);
+#endif
+}
+
#ifndef UNIV_INNOCHECKSUM
/**********************************************************************//**
Gets the space id, page offset, and byte offset within page of a
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index df364401172..79ec1e5d80b 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -113,7 +113,17 @@ ulint
buf_pool_get_n_pages(void)
/*======================*/
{
- return buf_pool_get_curr_size() >> srv_page_size_shift;
+ if (!buf_pool_ptr)
+ return buf_pool_get_curr_size() >> srv_page_size_shift;
+
+ ulint chunk_size= 0;
+ for (uint i= 0; i < srv_buf_pool_instances; i++)
+ {
+ buf_pool_t* buf_pool = buf_pool_from_array(i);
+ for (uint j= 0; j < buf_pool->n_chunks; j++)
+ chunk_size+= buf_pool->chunks[j].size;
+ }
+ return chunk_size;
}
/********************************************************************//**
diff --git a/storage/innobase/include/dict0crea.h b/storage/innobase/include/dict0crea.h
index 2a302dabae8..8ab987cd39a 100644
--- a/storage/innobase/include/dict0crea.h
+++ b/storage/innobase/include/dict0crea.h
@@ -224,16 +224,6 @@ dict_replace_tablespace_in_dictionary(
const char* path,
trx_t* trx);
-/** Delete records from SYS_TABLESPACES and SYS_DATAFILES associated
-with a particular tablespace ID.
-@param[in] space Tablespace ID
-@param[in,out] trx Current transaction
-@return DB_SUCCESS if OK, dberr_t if the operation failed */
-dberr_t
-dict_delete_tablespace_and_datafiles(
- ulint space,
- trx_t* trx);
-
/********************************************************************//**
Add a foreign key definition to the data dictionary tables.
@return error code or DB_SUCCESS */
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index df114b305c3..1a22470569e 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -832,10 +832,6 @@ a certain index.*/
system clustered index when there is no primary key. */
const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX";
-/* Estimated number of offsets in records (based on columns)
-to start with. */
-#define OFFS_IN_REC_NORMAL_SIZE 100
-
/** Data structure for an index. Most fields will be
initialized to 0, NULL or FALSE in dict_mem_index_create(). */
struct dict_index_t{
@@ -1112,7 +1108,7 @@ struct dict_index_t{
@param[in] offsets offsets
@return true if row is historical */
bool
- vers_history_row(const rec_t* rec, const ulint* offsets);
+ vers_history_row(const rec_t* rec, const offset_t* offsets);
/** Check if record in secondary index is historical row.
@param[in] rec record in a secondary index
@@ -1607,10 +1603,14 @@ struct dict_table_t {
/** Add the table definition to the data dictionary cache */
void add_to_cache();
+ /** @return whether the table is versioned.
+ It is assumed that both vers_start and vers_end set to 0
+ iff table is not versioned. In any other case,
+ these fields correspond to actual positions in cols[]. */
bool versioned() const { return vers_start || vers_end; }
bool versioned_by_id() const
{
- return vers_start && cols[vers_start].mtype == DATA_INT;
+ return versioned() && cols[vers_start].mtype == DATA_INT;
}
void inc_fk_checks()
diff --git a/storage/innobase/include/dyn0buf.h b/storage/innobase/include/dyn0buf.h
index db809c908ae..f66c7e3d405 100644
--- a/storage/innobase/include/dyn0buf.h
+++ b/storage/innobase/include/dyn0buf.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, 2019, MariaDB Corporation.
+Copyright (c) 2018, 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
@@ -29,7 +29,8 @@ Created 2013-03-16 Sunny Bains
#include "mem0mem.h"
#include "dyn0types.h"
-#include "ut0lst.h"
+#include "intrusive_list.h"
+
/** Class that manages dynamic buffers. It uses a UT_LIST of
mtr_buf_t::block_t instances. We don't use STL containers in
@@ -40,17 +41,11 @@ backend for the custom allocator because we would like the data in
the blocks to be contiguous. */
class mtr_buf_t {
public:
-
- class block_t;
-
- typedef UT_LIST_NODE_T(block_t) block_node_t;
- typedef UT_LIST_BASE_NODE_T(block_t) block_list_t;
-
/** SIZE - sizeof(m_node) + sizeof(m_used) */
enum { MAX_DATA_SIZE = DYN_ARRAY_DATA_SIZE
- - sizeof(block_node_t) + sizeof(ib_uint32_t) };
+ - sizeof(intrusive::list_node<>) + sizeof(uint32_t) };
- class block_t {
+ class block_t : public intrusive::list_node<> {
public:
block_t()
@@ -158,9 +153,6 @@ public:
/** Storage */
byte m_data[MAX_DATA_SIZE];
- /** Doubly linked list node. */
- block_node_t m_node;
-
/** number of data bytes used in this block;
DYN_BLOCK_FULL_FLAG is set when the block becomes full */
uint32_t m_used;
@@ -168,13 +160,14 @@ public:
friend class mtr_buf_t;
};
+ typedef intrusive::list<block_t> list_t;
+
/** Default constructor */
mtr_buf_t()
:
m_heap(),
m_size()
{
- UT_LIST_INIT(m_list, &block_t::m_node);
push_back(&m_first_block);
}
@@ -192,11 +185,11 @@ public:
m_heap = NULL;
/* Initialise the list and add the first block. */
- UT_LIST_INIT(m_list, &block_t::m_node);
- push_back(&m_first_block);
+ m_list.clear();
+ m_list.push_back(m_first_block);
} else {
m_first_block.init();
- ut_ad(UT_LIST_GET_LEN(m_list) == 1);
+ ut_ad(m_list.size() == 1);
}
m_size = 0;
@@ -228,7 +221,7 @@ public:
@param ptr end of used space */
void close(const byte* ptr)
{
- ut_ad(UT_LIST_GET_LEN(m_list) > 0);
+ ut_ad(!m_list.empty());
block_t* block = back();
m_size -= block->used();
@@ -310,11 +303,9 @@ public:
#ifdef UNIV_DEBUG
ulint total_size = 0;
- for (const block_t* block = UT_LIST_GET_FIRST(m_list);
- block != NULL;
- block = UT_LIST_GET_NEXT(m_node, block)) {
-
- total_size += block->used();
+ for (list_t::iterator it = m_list.begin(), end = m_list.end();
+ it != end; ++it) {
+ total_size += it->used();
}
ut_ad(total_size == m_size);
@@ -328,12 +319,11 @@ public:
template <typename Functor>
bool for_each_block(Functor& functor) const
{
- for (const block_t* block = UT_LIST_GET_FIRST(m_list);
- block != NULL;
- block = UT_LIST_GET_NEXT(m_node, block)) {
+ for (list_t::iterator it = m_list.begin(), end = m_list.end();
+ it != end; ++it) {
- if (!functor(block)) {
- return(false);
+ if (!functor(&*it)) {
+ return false;
}
}
@@ -346,12 +336,12 @@ public:
template <typename Functor>
bool for_each_block_in_reverse(Functor& functor) const
{
- for (block_t* block = UT_LIST_GET_LAST(m_list);
- block != NULL;
- block = UT_LIST_GET_PREV(m_node, block)) {
+ for (list_t::reverse_iterator it = m_list.rbegin(),
+ end = m_list.rend();
+ it != end; ++it) {
- if (!functor(block)) {
- return(false);
+ if (!functor(&*it)) {
+ return false;
}
}
@@ -364,12 +354,12 @@ public:
template <typename Functor>
bool for_each_block_in_reverse(const Functor& functor) const
{
- for (block_t* block = UT_LIST_GET_LAST(m_list);
- block != NULL;
- block = UT_LIST_GET_PREV(m_node, block)) {
+ for (list_t::reverse_iterator it = m_list.rbegin(),
+ end = m_list.rend();
+ it != end; ++it) {
- if (!functor(block)) {
- return(false);
+ if (!functor(&*it)) {
+ return false;
}
}
@@ -381,8 +371,7 @@ public:
block_t* front()
MY_ATTRIBUTE((warn_unused_result))
{
- ut_ad(UT_LIST_GET_LEN(m_list) > 0);
- return(UT_LIST_GET_FIRST(m_list));
+ return &m_list.front();
}
/**
@@ -403,14 +392,13 @@ private:
void push_back(block_t* block)
{
block->init();
-
- UT_LIST_ADD_LAST(m_list, block);
+ m_list.push_back(*block);
}
/** @return the last block in the list */
block_t* back() const
{
- return(UT_LIST_GET_LAST(m_list));
+ return &const_cast<block_t&>(m_list.back());
}
/*
@@ -433,25 +421,21 @@ private:
@return the block containing the pos. */
block_t* find(ulint& pos)
{
- block_t* block;
+ ut_ad(!m_list.empty());
- ut_ad(UT_LIST_GET_LEN(m_list) > 0);
+ for (list_t::iterator it = m_list.begin(), end = m_list.end();
+ it != end; ++it) {
- for (block = UT_LIST_GET_FIRST(m_list);
- block != NULL;
- block = UT_LIST_GET_NEXT(m_node, block)) {
+ if (pos < it->used()) {
+ ut_ad(it->used() >= pos);
- if (pos < block->used()) {
- break;
+ return &*it;
}
- pos -= block->used();
+ pos -= it->used();
}
- ut_ad(block != NULL);
- ut_ad(block->used() >= pos);
-
- return(block);
+ return NULL;
}
/**
@@ -477,7 +461,7 @@ private:
mem_heap_t* m_heap;
/** Allocated blocks */
- block_list_t m_list;
+ list_t m_list;
/** Total size used by all blocks */
ulint m_size;
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 0818d3f0ed1..d9840ea80f5 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2019, 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 the Free Software
@@ -32,6 +32,10 @@ Created 10/25/1995 Heikki Tuuri
#include "log0recv.h"
#include "dict0types.h"
#include "page0size.h"
+#include "intrusive_list.h"
+
+struct unflushed_spaces_tag_t;
+struct rotation_list_tag_t;
// Forward declaration
extern my_bool srv_use_doublewrite_buf;
@@ -73,7 +77,9 @@ fil_type_is_data(
struct fil_node_t;
/** Tablespace or log data space */
-struct fil_space_t {
+struct fil_space_t : intrusive::list_node<unflushed_spaces_tag_t>,
+ intrusive::list_node<rotation_list_tag_t>
+{
ulint id; /*!< space id */
hash_node_t hash; /*!< hash chain node */
char* name; /*!< Tablespace name */
@@ -151,9 +157,6 @@ struct fil_space_t {
ulint n_pending_ios;
rw_lock_t latch; /*!< latch protecting the file space storage
allocation */
- UT_LIST_NODE_T(fil_space_t) unflushed_spaces;
- /*!< list of spaces with at least one unflushed
- file we have written to */
UT_LIST_NODE_T(fil_space_t) named_spaces;
/*!< list of spaces for which MLOG_FILE_NAME
records have been issued */
@@ -162,8 +165,6 @@ struct fil_space_t {
bool is_in_unflushed_spaces() const;
UT_LIST_NODE_T(fil_space_t) space_list;
/*!< list of all spaces */
- /** other tablespaces needing key rotation */
- UT_LIST_NODE_T(fil_space_t) rotation_list;
/** Checks that this tablespace needs key rotation.
@return true if in a rotation list */
bool is_in_rotation_list() const;
@@ -350,7 +351,7 @@ struct fil_node_t {
/** Value of fil_node_t::magic_n */
#define FIL_NODE_MAGIC_N 89389
-/** Common InnoDB file extentions */
+/** Common InnoDB file extensions */
enum ib_extention {
NO_EXT = 0,
IBD = 1,
@@ -579,8 +580,6 @@ struct fil_system_t {
{
UT_LIST_INIT(LRU, &fil_node_t::LRU);
UT_LIST_INIT(space_list, &fil_space_t::space_list);
- UT_LIST_INIT(rotation_list, &fil_space_t::rotation_list);
- UT_LIST_INIT(unflushed_spaces, &fil_space_t::unflushed_spaces);
UT_LIST_INIT(named_spaces, &fil_space_t::named_spaces);
}
@@ -616,8 +615,8 @@ public:
not put to this list: they are opened
after the startup, and kept open until
shutdown */
- UT_LIST_BASE_NODE_T(fil_space_t) unflushed_spaces;
- /*!< base node for the list of those
+ intrusive::list<fil_space_t, unflushed_spaces_tag_t> unflushed_spaces;
+ /*!< list of those
tablespaces whose files contain
unflushed writes; those spaces have
at least one file node where
@@ -637,7 +636,7 @@ public:
record has been written since
the latest redo log checkpoint.
Protected only by log_sys.mutex. */
- UT_LIST_BASE_NODE_T(fil_space_t) rotation_list;
+ intrusive::list<fil_space_t, rotation_list_tag_t> rotation_list;
/*!< list of all file spaces needing
key rotation.*/
diff --git a/storage/innobase/include/fil0fil.ic b/storage/innobase/include/fil0fil.ic
index 457b5e1a03e..31466f38546 100644
--- a/storage/innobase/include/fil0fil.ic
+++ b/storage/innobase/include/fil0fil.ic
@@ -69,7 +69,7 @@ fil_get_page_type_name(
case FIL_PAGE_TYPE_ZBLOB2:
return "ZBLOB2";
case FIL_PAGE_TYPE_UNKNOWN:
- return "OLD UNKOWN PAGE TYPE";
+ return "OLD UNKNOWN PAGE TYPE";
default:
return "PAGE TYPE CORRUPTED";
}
diff --git a/storage/innobase/include/gis0geo.h b/storage/innobase/include/gis0geo.h
index 3b71815d0fe..dea6d63f4e0 100644
--- a/storage/innobase/include/gis0geo.h
+++ b/storage/innobase/include/gis0geo.h
@@ -54,19 +54,6 @@ enum wkbByteOrder
wkbNDR = 1 /* Little Endian */
};
-/** Get the wkb of default POINT value, which represents POINT(0 0)
-if it's of dimension 2, etc.
-@param[in] n_dims dimensions
-@param[out] wkb wkb buffer for default POINT
-@param[in] len length of wkb buffer
-@return non-0 indicate the length of wkb of the default POINT,
-0 if the buffer is too small */
-uint
-get_wkb_of_default_point(
- uint n_dims,
- uchar* wkb,
- uint len);
-
/*************************************************************//**
Calculate minimal bounding rectangle (mbr) of the spatial object
stored in "well-known binary representation" (wkb) format.
diff --git a/storage/innobase/include/gis0rtree.h b/storage/innobase/include/gis0rtree.h
index 126ca680c1d..b863f1cf3ef 100644
--- a/storage/innobase/include/gis0rtree.h
+++ b/storage/innobase/include/gis0rtree.h
@@ -28,6 +28,7 @@ Created 2013/03/27 Jimmy Yang and Allen Lai
#define gis0rtree_h
#include "btr0cur.h"
+#include "rem0types.h"
/* Whether MBR 'a' contains 'b' */
#define MBR_CONTAIN_CMP(a, b) \
@@ -88,7 +89,7 @@ rtr_page_split_and_insert(
btr_cur_t* cursor, /*!< in/out: cursor at which to insert; when the
function returns, the cursor is positioned
on the predecessor of the inserted record */
- ulint** offsets,/*!< out: offsets on inserted record */
+ offset_t** offsets,/*!< out: offsets on inserted record */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
@@ -150,7 +151,7 @@ rtr_rec_cal_increase(
dtuple in some of the common fields, or which
has an equal number or more fields than
dtuple */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
double* area); /*!< out: increased area */
/****************************************************************//**
@@ -273,7 +274,7 @@ void
rtr_get_mbr_from_rec(
/*=================*/
const rec_t* rec, /*!< in: data tuple */
- const ulint* offsets,/*!< in: offsets array */
+ const offset_t* offsets,/*!< in: offsets array */
rtr_mbr_t* mbr); /*!< out MBR */
/****************************************************************//**
@@ -305,10 +306,10 @@ rtr_page_get_father(
Returns the father block to a page. It is assumed that mtr holds
an X or SX latch on the tree.
@return rec_get_offsets() of the node pointer record */
-ulint*
+offset_t*
rtr_page_get_father_block(
/*======================*/
- ulint* offsets,/*!< in: work area for the return value */
+ offset_t* offsets,/*!< in: work area for the return value */
mem_heap_t* heap, /*!< in: memory heap to use */
dict_index_t* index, /*!< in: b-tree index */
buf_block_t* block, /*!< in: child page in the index */
@@ -415,8 +416,8 @@ rtr_merge_and_update_mbr(
/*=====================*/
btr_cur_t* cursor, /*!< in/out: cursor */
btr_cur_t* cursor2, /*!< in: the other cursor */
- ulint* offsets, /*!< in: rec offsets */
- ulint* offsets2, /*!< in: rec offsets */
+ offset_t* offsets, /*!< in: rec offsets */
+ offset_t* offsets2, /*!< in: rec offsets */
page_t* child_page, /*!< in: the child page. */
mtr_t* mtr); /*!< in: mtr */
@@ -436,8 +437,8 @@ rtr_merge_mbr_changed(
/*==================*/
btr_cur_t* cursor, /*!< in: cursor */
btr_cur_t* cursor2, /*!< in: the other cursor */
- ulint* offsets, /*!< in: rec offsets */
- ulint* offsets2, /*!< in: rec offsets */
+ offset_t* offsets, /*!< in: rec offsets */
+ offset_t* offsets2, /*!< in: rec offsets */
rtr_mbr_t* new_mbr); /*!< out: MBR to update */
@@ -448,7 +449,7 @@ bool
rtr_update_mbr_field(
/*=================*/
btr_cur_t* cursor, /*!< in: cursor pointed to rec.*/
- ulint* offsets, /*!< in: offsets on rec. */
+ offset_t* offsets, /*!< in: offsets on rec. */
btr_cur_t* cursor2, /*!< in/out: cursor pointed to rec
that should be deleted.
this cursor is for btr_compress to
diff --git a/storage/innobase/include/gis0rtree.ic b/storage/innobase/include/gis0rtree.ic
index d9309550a5f..03e23830e70 100644
--- a/storage/innobase/include/gis0rtree.ic
+++ b/storage/innobase/include/gis0rtree.ic
@@ -40,7 +40,7 @@ rtr_page_cal_mbr(
rec_t* rec;
const byte* field;
ulint len;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
double bmin, bmax;
double* amin;
double* amax;
diff --git a/storage/innobase/include/handler0alter.h b/storage/innobase/include/handler0alter.h
index 45811c591c9..9b70c607459 100644
--- a/storage/innobase/include/handler0alter.h
+++ b/storage/innobase/include/handler0alter.h
@@ -22,6 +22,8 @@ this program; if not, write to the Free Software Foundation, Inc.,
Smart ALTER TABLE
*******************************************************/
+#include "rem0types.h"
+
/*************************************************************//**
Copies an InnoDB record to table->record[0]. */
void
@@ -30,7 +32,7 @@ innobase_rec_to_mysql(
struct TABLE* table, /*!< in/out: MySQL table */
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: index */
- const ulint* offsets)/*!< in: rec_get_offsets(
+ const offset_t* offsets)/*!< in: rec_get_offsets(
rec, index, ...) */
MY_ATTRIBUTE((nonnull));
diff --git a/storage/innobase/include/hash0hash.h b/storage/innobase/include/hash0hash.h
index 5d317a23d4e..4f55b051d80 100644
--- a/storage/innobase/include/hash0hash.h
+++ b/storage/innobase/include/hash0hash.h
@@ -184,6 +184,18 @@ do {\
HASH_INVALIDATE(DATA, NAME);\
} while (0)
+#define HASH_REPLACE(TYPE, NAME, TABLE, FOLD, DATA_OLD, DATA_NEW) \
+ do { \
+ (DATA_NEW)->NAME = (DATA_OLD)->NAME; \
+ \
+ hash_cell_t& cell3333 \
+ = TABLE->array[hash_calc_hash(FOLD, TABLE)]; \
+ TYPE** struct3333 = (TYPE**)&cell3333.node; \
+ while (*struct3333 != DATA_OLD) { \
+ struct3333 = &((*struct3333)->NAME); \
+ } \
+ *struct3333 = DATA_NEW; \
+ } while (0)
/*******************************************************************//**
Gets the first struct in a hash chain, NULL if none. */
diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h
index 8ae0b062729..11000620e8c 100644
--- a/storage/innobase/include/lock0lock.h
+++ b/storage/innobase/include/lock0lock.h
@@ -300,7 +300,7 @@ lock_clust_rec_modify_check_and_lock(
const rec_t* rec, /*!< in: record which should be
modified */
dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */
MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
@@ -338,7 +338,7 @@ lock_sec_rec_read_check_and_lock(
be read or passed over by a
read cursor */
dict_index_t* index, /*!< in: secondary index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
lock_mode mode, /*!< in: mode of the lock which
the read cursor should set on
records: LOCK_S or LOCK_X; the
@@ -366,7 +366,7 @@ lock_clust_rec_read_check_and_lock(
be read or passed over by a
read cursor */
dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
lock_mode mode, /*!< in: mode of the lock which
the read cursor should set on
records: LOCK_S or LOCK_X; the
@@ -415,7 +415,7 @@ lock_clust_rec_cons_read_sees(
const rec_t* rec, /*!< in: user record which should be read or
passed over by a read cursor */
dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ReadView* view); /*!< in: consistent read view */
/*********************************************************************//**
Checks that a non-clustered index record is seen in a consistent read.
@@ -547,7 +547,7 @@ lock_report_trx_id_insanity(
trx_id_t trx_id, /*!< in: trx id */
const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */
trx_id_t max_trx_id); /*!< in: trx_sys.get_max_trx_id() */
/*********************************************************************//**
Prints info of locks for all transactions.
@@ -772,7 +772,7 @@ lock_check_trx_id_sanity(
trx_id_t trx_id, /*!< in: trx id */
const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets); /*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets); /*!< in: rec_get_offsets(rec, index) */
#ifdef UNIV_DEBUG
/*******************************************************************//**
Check if the transaction holds any locks on the sys tables
diff --git a/storage/innobase/include/lock0priv.h b/storage/innobase/include/lock0priv.h
index 9b80f593e30..5e00e1bb6f1 100644
--- a/storage/innobase/include/lock0priv.h
+++ b/storage/innobase/include/lock0priv.h
@@ -35,6 +35,7 @@ those functions in lock/ */
#endif
#include "hash0hash.h"
+#include "rem0types.h"
#include "trx0trx.h"
#ifndef UINT32_MAX
@@ -468,7 +469,7 @@ lock_clust_rec_some_has_impl(
/*=========================*/
const rec_t* rec, /*!< in: user record */
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
diff --git a/storage/innobase/include/lock0priv.ic b/storage/innobase/include/lock0priv.ic
index 80a63271256..7062e3f7082 100644
--- a/storage/innobase/include/lock0priv.ic
+++ b/storage/innobase/include/lock0priv.ic
@@ -59,7 +59,7 @@ lock_clust_rec_some_has_impl(
/*=========================*/
const rec_t* rec, /*!< in: user record */
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{
ut_ad(dict_index_is_clust(index));
ut_ad(page_rec_is_user_rec(rec));
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index a4f8aab4e02..280f7840d50 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -119,14 +119,19 @@ bool recv_sys_add_to_parsing_buf(const byte* log_block, lsn_t scanned_lsn);
/** Parse log records from a buffer and optionally store them to a
hash table to wait merging to file pages.
-@param[in] checkpoint_lsn the LSN of the latest checkpoint
-@param[in] store whether to store page operations
-@param[in] apply whether to apply the records
+@param[in] checkpoint_lsn the LSN of the latest checkpoint
+@param[in] store whether to store page operations
+@param[in] available_memory memory to read the redo logs
+@param[in] apply whether to apply the records
@return whether MLOG_CHECKPOINT record was seen the first time,
or corruption was noticed */
-bool recv_parse_log_recs(lsn_t checkpoint_lsn, store_t store, bool apply);
+bool recv_parse_log_recs(
+ lsn_t checkpoint_lsn,
+ store_t* store,
+ ulint available_memory,
+ bool apply);
-/** Moves the parsing buffer data left to the buffer start. */
+/** Moves the parsing buffer data left to the buffer start */
void recv_sys_justify_left_parsing_buf();
/** Report optimized DDL operation (without redo log),
diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h
index fa22b3d3086..18ae845955a 100644
--- a/storage/innobase/include/mem0mem.h
+++ b/storage/innobase/include/mem0mem.h
@@ -291,13 +291,6 @@ mem_heap_printf(
const char* format, /*!< in: format string */
...) MY_ATTRIBUTE ((format (printf, 2, 3)));
-/** Checks that an object is a memory heap (or a block of it)
-@param[in] heap Memory heap to check */
-UNIV_INLINE
-void
-mem_block_validate(
- const mem_heap_t* heap);
-
#ifdef UNIV_DEBUG
/** Validates the contents of a memory heap.
Asserts that the memory heap is consistent
@@ -312,7 +305,6 @@ mem_heap_validate(
/** The info structure stored at the beginning of a heap block */
struct mem_block_info_t {
- ulint magic_n;/* magic number for debugging */
#ifdef UNIV_DEBUG
char file_name[8];/* file name where the mem heap was created */
unsigned line; /*!< line number where the mem heap was created */
@@ -347,9 +339,6 @@ struct mem_block_info_t {
otherwise, this is NULL */
};
-#define MEM_BLOCK_MAGIC_N 764741555
-#define MEM_FREED_BLOCK_MAGIC_N 547711122
-
/* Header size for a memory heap block */
#define MEM_BLOCK_HEADER_SIZE UT_CALC_ALIGN(sizeof(mem_block_info_t),\
UNIV_MEM_ALIGNMENT)
diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic
index 3b4992a1a98..2a88c0f1065 100644
--- a/storage/innobase/include/mem0mem.ic
+++ b/storage/innobase/include/mem0mem.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 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
@@ -144,16 +144,6 @@ mem_block_get_start(mem_block_t* block)
return(block->start);
}
-/** Checks that an object is a memory heap block
-@param[in] block Memory block to check. */
-UNIV_INLINE
-void
-mem_block_validate(
- const mem_block_t* block)
-{
- ut_a(block->magic_n == MEM_BLOCK_MAGIC_N);
-}
-
/** Allocates and zero-fills n bytes of memory from a memory heap.
@param[in] heap memory heap
@param[in] n number of bytes; if the heap is allowed to grow into
@@ -186,8 +176,6 @@ mem_heap_alloc(
byte* buf;
ulint free;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
n += REDZONE_SIZE;
@@ -230,8 +218,6 @@ mem_heap_get_heap_top(
mem_block_t* block;
byte* buf;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
buf = (byte*) block + mem_block_get_free(block);
@@ -322,8 +308,6 @@ mem_heap_get_top(
mem_block_t* block;
byte* buf;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
buf = (byte*) block + mem_block_get_free(block) - MEM_SPACE_NEEDED(n);
@@ -343,8 +327,6 @@ mem_heap_free_top(
{
mem_block_t* block;
- ut_d(mem_block_validate(heap));
-
n += REDZONE_SIZE;
block = UT_LIST_GET_LAST(heap->base);
@@ -420,8 +402,6 @@ mem_heap_free(
mem_block_t* block;
mem_block_t* prev_block;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
if (heap->free_block) {
@@ -448,11 +428,7 @@ mem_heap_get_size(
/*==============*/
mem_heap_t* heap) /*!< in: heap */
{
- ulint size = 0;
-
- ut_d(mem_block_validate(heap));
-
- size = heap->total_size;
+ ulint size = heap->total_size;
if (heap->free_block) {
size += srv_page_size;
diff --git a/storage/innobase/include/mtr0log.h b/storage/innobase/include/mtr0log.h
index eaf2fad9e7f..dc76b40a3db 100644
--- a/storage/innobase/include/mtr0log.h
+++ b/storage/innobase/include/mtr0log.h
@@ -109,14 +109,6 @@ mlog_catenate_string(
const byte* str, /*!< in: string to write */
ulint len); /*!< in: string length */
/********************************************************//**
-Catenates a compressed ulint to mlog. */
-UNIV_INLINE
-void
-mlog_catenate_ulint_compressed(
-/*===========================*/
- mtr_t* mtr, /*!< in: mtr */
- ulint val); /*!< in: value to write */
-/********************************************************//**
Catenates a compressed 64-bit integer to mlog. */
UNIV_INLINE
void
diff --git a/storage/innobase/include/mtr0log.ic b/storage/innobase/include/mtr0log.ic
index b7ba92ff1a5..70bcaf43b9e 100644
--- a/storage/innobase/include/mtr0log.ic
+++ b/storage/innobase/include/mtr0log.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 2019, 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
@@ -118,30 +118,6 @@ mlog_catenate_ulint(
}
/********************************************************//**
-Catenates a compressed ulint to mlog. */
-UNIV_INLINE
-void
-mlog_catenate_ulint_compressed(
-/*===========================*/
- mtr_t* mtr, /*!< in: mtr */
- ulint val) /*!< in: value to write */
-{
- byte* log_ptr;
-
- log_ptr = mlog_open(mtr, 10);
-
- /* If no logging is requested, we may return now */
- if (log_ptr == NULL) {
-
- return;
- }
-
- log_ptr += mach_write_compressed(log_ptr, val);
-
- mlog_close(mtr, log_ptr);
-}
-
-/********************************************************//**
Catenates a compressed 64-bit integer to mlog. */
UNIV_INLINE
void
@@ -187,7 +163,6 @@ mlog_write_initial_log_record_low(
|| type == MLOG_FILE_CREATE2
|| type == MLOG_FILE_RENAME2
|| type == MLOG_INDEX_LOAD
- || type == MLOG_TRUNCATE
|| type == MLOG_FILE_WRITE_CRYPT_DATA
|| mtr->is_named_space(space_id));
diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h
index f21506d0475..5accbcd76d5 100644
--- a/storage/innobase/include/page0cur.h
+++ b/storage/innobase/include/page0cur.h
@@ -29,6 +29,7 @@ Created 10/4/1994 Heikki Tuuri
#include "buf0types.h"
#include "page0page.h"
+#include "rem0types.h"
#include "rem0rec.h"
#include "data0data.h"
#include "mtr0mtr.h"
@@ -151,7 +152,7 @@ page_cur_tuple_insert(
page_cur_t* cursor, /*!< in/out: a page cursor */
const dtuple_t* tuple, /*!< in: pointer to a data tuple */
dict_index_t* index, /*!< in: record descriptor */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
@@ -175,7 +176,7 @@ page_cur_rec_insert(
page_cur_t* cursor, /*!< in/out: a page cursor */
const rec_t* rec, /*!< in: record to insert */
dict_index_t* index, /*!< in: record descriptor */
- ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr); /*!< in: mini-transaction handle, or NULL */
/***********************************************************//**
Inserts a record next to page cursor on an uncompressed page.
@@ -189,7 +190,7 @@ page_cur_insert_rec_low(
which the new record is inserted */
dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */
- ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
@@ -211,7 +212,7 @@ page_cur_insert_rec_zip(
page_cur_t* cursor, /*!< in/out: page cursor */
dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */
- ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
/*************************************************************//**
@@ -237,7 +238,7 @@ page_cur_delete_rec(
/*================*/
page_cur_t* cursor, /*!< in/out: a page cursor */
const dict_index_t* index, /*!< in: record descriptor */
- const ulint* offsets,/*!< in: rec_get_offsets(
+ const offset_t* offsets,/*!< in: rec_get_offsets(
cursor->rec, index) */
mtr_t* mtr); /*!< in: mini-transaction handle */
@@ -385,14 +386,14 @@ page_delete_rec(
page_cur_t* pcur, /*!< in/out: page cursor on record
to delete */
page_zip_des_t* page_zip,/*!< in: compressed page descriptor */
- const ulint* offsets);/*!< in: offsets for record */
+ const offset_t* offsets);/*!< in: offsets for record */
/** Index page cursor */
struct page_cur_t{
const dict_index_t* index;
rec_t* rec; /*!< pointer to a record on page */
- ulint* offsets;
+ offset_t* offsets;
buf_block_t* block; /*!< pointer to the block containing rec */
};
diff --git a/storage/innobase/include/page0cur.ic b/storage/innobase/include/page0cur.ic
index dff829089bb..1ccb7f9a80d 100644
--- a/storage/innobase/include/page0cur.ic
+++ b/storage/innobase/include/page0cur.ic
@@ -259,7 +259,7 @@ page_cur_tuple_insert(
page_cur_t* cursor, /*!< in/out: a page cursor */
const dtuple_t* tuple, /*!< in: pointer to a data tuple */
dict_index_t* index, /*!< in: record descriptor */
- ulint** offsets,/*!< out: offsets on *rec */
+ offset_t** offsets,/*!< out: offsets on *rec */
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
@@ -312,7 +312,7 @@ page_cur_rec_insert(
page_cur_t* cursor, /*!< in/out: a page cursor */
const rec_t* rec, /*!< in: record to insert */
dict_index_t* index, /*!< in: record descriptor */
- ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
{
if (buf_block_get_page_zip(cursor->block)) {
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index e6df074e4a9..0876bc54aaf 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2019, MariaDB Corporation.
+Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
+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 the Free Software
@@ -32,6 +32,7 @@ Created 2/2/1994 Heikki Tuuri
#include "buf0buf.h"
#include "data0data.h"
#include "dict0dict.h"
+#include "rem0types.h"
#include "rem0rec.h"
#endif /* !UNIV_INNOCHECKSUM*/
#include "fsp0fsp.h"
@@ -857,6 +858,22 @@ page_rec_is_last(
MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
+true if distance between the records (measured in number of times we have to
+move to the next record) is at most the specified value
+@param[in] left_rec lefter record
+@param[in] right_rec righter record
+@param[in] val specified value to compare
+@return true if the distance is smaller than the value */
+UNIV_INLINE
+bool
+page_rec_distance_is_at_most(
+/*=========================*/
+ const rec_t* left_rec,
+ const rec_t* right_rec,
+ ulint val)
+ MY_ATTRIBUTE((warn_unused_result));
+
+/************************************************************//**
true if the record is the second last user record on a page.
@return true if the second last user record */
UNIV_INLINE
@@ -963,7 +980,7 @@ page_mem_free(
rec_t* rec, /*!< in: pointer to the (origin of)
record */
const dict_index_t* index, /*!< in: index of rec */
- const ulint* offsets);/*!< in: array returned by
+ const offset_t* offsets);/*!< in: array returned by
rec_get_offsets() */
/** Read the PAGE_DIRECTION field from a byte.
@@ -1223,7 +1240,7 @@ void
page_rec_print(
/*===========*/
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets);/*!< in: record descriptor */
+ const offset_t* offsets);/*!< in: record descriptor */
# ifdef UNIV_BTR_PRINT
/***************************************************************//**
This is used to print the contents of the directory for
@@ -1270,7 +1287,7 @@ ibool
page_rec_validate(
/*==============*/
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets);/*!< in: array returned by rec_get_offsets() */
#ifdef UNIV_DEBUG
/***************************************************************//**
Checks that the first directory slot points to the infimum record and
diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic
index e5368938531..94887a0925a 100644
--- a/storage/innobase/include/page0page.ic
+++ b/storage/innobase/include/page0page.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2019, MariaDB Corporation.
+Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
+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 the Free Software
@@ -359,6 +359,26 @@ page_rec_is_last(
}
/************************************************************//**
+true if distance between the records (measured in number of times we have to
+move to the next record) is at most the specified value */
+UNIV_INLINE
+bool
+page_rec_distance_is_at_most(
+/*=========================*/
+ const rec_t* left_rec,
+ const rec_t* right_rec,
+ ulint val)
+{
+ for (ulint i = 0; i <= val; i++) {
+ if (left_rec == right_rec) {
+ return (true);
+ }
+ left_rec = page_rec_get_next_const(left_rec);
+ }
+ return (false);
+}
+
+/************************************************************//**
true if the record is the second last user record on a page.
@return true if the second last user record */
UNIV_INLINE
@@ -660,6 +680,7 @@ page_rec_get_next_low(
}
ut_ad(page_rec_is_infimum(rec)
+ || (!page_is_leaf(page) && !page_has_prev(page))
|| !(rec_get_info_bits(page + offs, comp)
& REC_INFO_MIN_REC_FLAG));
@@ -1004,7 +1025,7 @@ page_mem_free(
rec_t* rec, /*!< in: pointer to the
(origin of) record */
const dict_index_t* index, /*!< in: index of rec */
- const ulint* offsets) /*!< in: array returned by
+ const offset_t* offsets) /*!< in: array returned by
rec_get_offsets() */
{
rec_t* free;
diff --git a/storage/innobase/include/page0types.h b/storage/innobase/include/page0types.h
index 02d0cf29ec5..4debd639fa4 100644
--- a/storage/innobase/include/page0types.h
+++ b/storage/innobase/include/page0types.h
@@ -28,6 +28,7 @@ Created 2/2/1994 Heikki Tuuri
#include "dict0types.h"
#include "mtr0types.h"
+#include "rem0types.h"
#include <map>
@@ -184,7 +185,7 @@ page_zip_dir_delete(
page_zip_des_t* page_zip,/*!< in/out: compressed page */
byte* rec, /*!< in: deleted record */
dict_index_t* index, /*!< in: index of rec */
- const ulint* offsets,/*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of the free list */
MY_ATTRIBUTE((nonnull(1,2,3,4)));
diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h
index 8672def36e6..899cc1aab22 100644
--- a/storage/innobase/include/page0zip.h
+++ b/storage/innobase/include/page0zip.h
@@ -47,6 +47,7 @@ Created June 2005 by Marko Makela
#endif /* !UNIV_INNOCHECKSUM */
#include "buf0types.h"
+#include "rem0types.h"
#ifndef UNIV_INNOCHECKSUM
#include "dict0types.h"
@@ -287,7 +288,7 @@ page_zip_write_rec(
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record being written */
dict_index_t* index, /*!< in: the index the record belongs to */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint create) /*!< in: nonzero=insert, zero=update */
MY_ATTRIBUTE((nonnull));
@@ -312,7 +313,7 @@ page_zip_write_blob_ptr(
const byte* rec, /*!< in/out: record whose data is being
written */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint n, /*!< in: column index */
mtr_t* mtr); /*!< in: mini-transaction handle,
or NULL if no logging is needed */
@@ -351,7 +352,7 @@ void
page_zip_write_trx_id_and_roll_ptr(
page_zip_des_t* page_zip,
byte* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint trx_id_col,
trx_id_t trx_id,
roll_ptr_t roll_ptr,
@@ -415,7 +416,7 @@ page_zip_dir_delete(
page_zip_des_t* page_zip, /*!< in/out: compressed page */
byte* rec, /*!< in: deleted record */
const dict_index_t* index, /*!< in: index of rec */
- const ulint* offsets, /*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of
the free list */
MY_ATTRIBUTE((nonnull(1,2,3,4)));
diff --git a/storage/innobase/include/pars0grm.h b/storage/innobase/include/pars0grm.h
index 90a7468bc9a..58d424abfdc 100644
--- a/storage/innobase/include/pars0grm.h
+++ b/storage/innobase/include/pars0grm.h
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.4.2. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+ Inc.
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
@@ -30,6 +31,9 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+/* Undocumented macros, especially those whose name start with YY_,
+ are private implementation details. Do not rely on them. */
+
#ifndef YY_YY_PARS0GRM_TAB_H_INCLUDED
# define YY_YY_PARS0GRM_TAB_H_INCLUDED
/* Debug traces. */
@@ -58,91 +62,71 @@ extern int yydebug;
PARS_NE_TOKEN = 268,
PARS_PROCEDURE_TOKEN = 269,
PARS_IN_TOKEN = 270,
- PARS_OUT_TOKEN = 271,
- PARS_BINARY_TOKEN = 272,
- PARS_BLOB_TOKEN = 273,
- PARS_INT_TOKEN = 274,
- PARS_FLOAT_TOKEN = 275,
- PARS_CHAR_TOKEN = 276,
- PARS_IS_TOKEN = 277,
- PARS_BEGIN_TOKEN = 278,
- PARS_END_TOKEN = 279,
- PARS_IF_TOKEN = 280,
- PARS_THEN_TOKEN = 281,
- PARS_ELSE_TOKEN = 282,
- PARS_ELSIF_TOKEN = 283,
- PARS_LOOP_TOKEN = 284,
- PARS_WHILE_TOKEN = 285,
- PARS_RETURN_TOKEN = 286,
- PARS_SELECT_TOKEN = 287,
- PARS_SUM_TOKEN = 288,
- PARS_COUNT_TOKEN = 289,
- PARS_DISTINCT_TOKEN = 290,
- PARS_FROM_TOKEN = 291,
- PARS_WHERE_TOKEN = 292,
- PARS_FOR_TOKEN = 293,
- PARS_DDOT_TOKEN = 294,
- PARS_READ_TOKEN = 295,
- PARS_ORDER_TOKEN = 296,
- PARS_BY_TOKEN = 297,
- PARS_ASC_TOKEN = 298,
- PARS_DESC_TOKEN = 299,
- PARS_INSERT_TOKEN = 300,
- PARS_INTO_TOKEN = 301,
- PARS_VALUES_TOKEN = 302,
- PARS_UPDATE_TOKEN = 303,
- PARS_SET_TOKEN = 304,
- PARS_DELETE_TOKEN = 305,
- PARS_CURRENT_TOKEN = 306,
- PARS_OF_TOKEN = 307,
- PARS_CREATE_TOKEN = 308,
- PARS_TABLE_TOKEN = 309,
- PARS_INDEX_TOKEN = 310,
- PARS_UNIQUE_TOKEN = 311,
- PARS_CLUSTERED_TOKEN = 312,
- PARS_ON_TOKEN = 313,
- PARS_ASSIGN_TOKEN = 314,
- PARS_DECLARE_TOKEN = 315,
- PARS_CURSOR_TOKEN = 316,
- PARS_SQL_TOKEN = 317,
- PARS_OPEN_TOKEN = 318,
- PARS_FETCH_TOKEN = 319,
- PARS_CLOSE_TOKEN = 320,
- PARS_NOTFOUND_TOKEN = 321,
- PARS_TO_CHAR_TOKEN = 322,
- PARS_TO_NUMBER_TOKEN = 323,
- PARS_TO_BINARY_TOKEN = 324,
- PARS_BINARY_TO_NUMBER_TOKEN = 325,
- PARS_SUBSTR_TOKEN = 326,
- PARS_REPLSTR_TOKEN = 327,
- PARS_CONCAT_TOKEN = 328,
- PARS_INSTR_TOKEN = 329,
- PARS_LENGTH_TOKEN = 330,
- PARS_SYSDATE_TOKEN = 331,
- PARS_PRINTF_TOKEN = 332,
- PARS_ASSERT_TOKEN = 333,
- PARS_RND_TOKEN = 334,
- PARS_RND_STR_TOKEN = 335,
- PARS_ROW_PRINTF_TOKEN = 336,
- PARS_COMMIT_TOKEN = 337,
- PARS_ROLLBACK_TOKEN = 338,
- PARS_WORK_TOKEN = 339,
- PARS_UNSIGNED_TOKEN = 340,
- PARS_EXIT_TOKEN = 341,
- PARS_FUNCTION_TOKEN = 342,
- PARS_LOCK_TOKEN = 343,
- PARS_SHARE_TOKEN = 344,
- PARS_MODE_TOKEN = 345,
- PARS_LIKE_TOKEN = 346,
- PARS_LIKE_TOKEN_EXACT = 347,
- PARS_LIKE_TOKEN_PREFIX = 348,
- PARS_LIKE_TOKEN_SUFFIX = 349,
- PARS_LIKE_TOKEN_SUBSTR = 350,
- PARS_TABLE_NAME_TOKEN = 351,
- PARS_COMPACT_TOKEN = 352,
- PARS_BLOCK_SIZE_TOKEN = 353,
- PARS_BIGINT_TOKEN = 354,
- NEG = 355
+ PARS_INT_TOKEN = 271,
+ PARS_CHAR_TOKEN = 272,
+ PARS_IS_TOKEN = 273,
+ PARS_BEGIN_TOKEN = 274,
+ PARS_END_TOKEN = 275,
+ PARS_IF_TOKEN = 276,
+ PARS_THEN_TOKEN = 277,
+ PARS_ELSE_TOKEN = 278,
+ PARS_ELSIF_TOKEN = 279,
+ PARS_LOOP_TOKEN = 280,
+ PARS_WHILE_TOKEN = 281,
+ PARS_RETURN_TOKEN = 282,
+ PARS_SELECT_TOKEN = 283,
+ PARS_COUNT_TOKEN = 284,
+ PARS_FROM_TOKEN = 285,
+ PARS_WHERE_TOKEN = 286,
+ PARS_FOR_TOKEN = 287,
+ PARS_DDOT_TOKEN = 288,
+ PARS_ORDER_TOKEN = 289,
+ PARS_BY_TOKEN = 290,
+ PARS_ASC_TOKEN = 291,
+ PARS_DESC_TOKEN = 292,
+ PARS_INSERT_TOKEN = 293,
+ PARS_INTO_TOKEN = 294,
+ PARS_VALUES_TOKEN = 295,
+ PARS_UPDATE_TOKEN = 296,
+ PARS_SET_TOKEN = 297,
+ PARS_DELETE_TOKEN = 298,
+ PARS_CURRENT_TOKEN = 299,
+ PARS_OF_TOKEN = 300,
+ PARS_CREATE_TOKEN = 301,
+ PARS_TABLE_TOKEN = 302,
+ PARS_INDEX_TOKEN = 303,
+ PARS_UNIQUE_TOKEN = 304,
+ PARS_CLUSTERED_TOKEN = 305,
+ PARS_ON_TOKEN = 306,
+ PARS_ASSIGN_TOKEN = 307,
+ PARS_DECLARE_TOKEN = 308,
+ PARS_CURSOR_TOKEN = 309,
+ PARS_SQL_TOKEN = 310,
+ PARS_OPEN_TOKEN = 311,
+ PARS_FETCH_TOKEN = 312,
+ PARS_CLOSE_TOKEN = 313,
+ PARS_NOTFOUND_TOKEN = 314,
+ PARS_TO_BINARY_TOKEN = 315,
+ PARS_SUBSTR_TOKEN = 316,
+ PARS_CONCAT_TOKEN = 317,
+ PARS_INSTR_TOKEN = 318,
+ PARS_LENGTH_TOKEN = 319,
+ PARS_COMMIT_TOKEN = 320,
+ PARS_ROLLBACK_TOKEN = 321,
+ PARS_WORK_TOKEN = 322,
+ PARS_EXIT_TOKEN = 323,
+ PARS_FUNCTION_TOKEN = 324,
+ PARS_LOCK_TOKEN = 325,
+ PARS_SHARE_TOKEN = 326,
+ PARS_MODE_TOKEN = 327,
+ PARS_LIKE_TOKEN = 328,
+ PARS_LIKE_TOKEN_EXACT = 329,
+ PARS_LIKE_TOKEN_PREFIX = 330,
+ PARS_LIKE_TOKEN_SUFFIX = 331,
+ PARS_LIKE_TOKEN_SUBSTR = 332,
+ PARS_TABLE_NAME_TOKEN = 333,
+ PARS_BIGINT_TOKEN = 334,
+ NEG = 335
};
#endif
diff --git a/storage/innobase/include/pars0pars.h b/storage/innobase/include/pars0pars.h
index 857c5c2742c..73a19dd24d8 100644
--- a/storage/innobase/include/pars0pars.h
+++ b/storage/innobase/include/pars0pars.h
@@ -48,29 +48,15 @@ extern int yydebug;
NOT re-entrant */
extern sym_tab_t* pars_sym_tab_global;
-extern pars_res_word_t pars_to_char_token;
-extern pars_res_word_t pars_to_number_token;
extern pars_res_word_t pars_to_binary_token;
-extern pars_res_word_t pars_binary_to_number_token;
extern pars_res_word_t pars_substr_token;
-extern pars_res_word_t pars_replstr_token;
extern pars_res_word_t pars_concat_token;
extern pars_res_word_t pars_length_token;
extern pars_res_word_t pars_instr_token;
-extern pars_res_word_t pars_sysdate_token;
-extern pars_res_word_t pars_printf_token;
-extern pars_res_word_t pars_assert_token;
-extern pars_res_word_t pars_rnd_token;
-extern pars_res_word_t pars_rnd_str_token;
extern pars_res_word_t pars_count_token;
-extern pars_res_word_t pars_sum_token;
-extern pars_res_word_t pars_distinct_token;
-extern pars_res_word_t pars_binary_token;
-extern pars_res_word_t pars_blob_token;
extern pars_res_word_t pars_int_token;
extern pars_res_word_t pars_bigint_token;
extern pars_res_word_t pars_char_token;
-extern pars_res_word_t pars_float_token;
extern pars_res_word_t pars_update_token;
extern pars_res_word_t pars_asc_token;
extern pars_res_word_t pars_desc_token;
@@ -236,17 +222,6 @@ pars_insert_statement(
que_node_t* values_list, /*!< in: value expression list or NULL */
sel_node_t* select); /*!< in: select condition or NULL */
/*********************************************************************//**
-Parses a procedure parameter declaration.
-@return own: symbol table node of type SYM_VAR */
-sym_node_t*
-pars_parameter_declaration(
-/*=======================*/
- sym_node_t* node, /*!< in: symbol table node allocated for the
- id of the parameter */
- ulint param_type,
- /*!< in: PARS_INPUT or PARS_OUTPUT */
- pars_res_word_t* type); /*!< in: pointer to a type token */
-/*********************************************************************//**
Parses an elsif element.
@return elsif node */
elsif_node_t*
@@ -358,8 +333,6 @@ pars_column_def(
pars_res_word_t* type, /*!< in: data type */
sym_node_t* len, /*!< in: length of column, or
NULL */
- void* is_unsigned, /*!< in: if not NULL, column
- is of type UNSIGNED. */
void* is_not_null); /*!< in: if not NULL, column
is of type NOT NULL. */
/*********************************************************************//**
@@ -370,9 +343,7 @@ pars_create_table(
/*==============*/
sym_node_t* table_sym, /*!< in: table name node in the symbol
table */
- sym_node_t* column_defs, /*!< in: list of column names */
- sym_node_t* compact, /* in: non-NULL if COMPACT table. */
- sym_node_t* block_size); /* in: block size (can be NULL) */
+ sym_node_t* column_defs); /*!< in: list of column names */
/*********************************************************************//**
Parses an index creation operation.
@return index create subgraph */
@@ -394,7 +365,6 @@ pars_procedure_definition(
/*======================*/
sym_node_t* sym_node, /*!< in: procedure id node in the symbol
table */
- sym_node_t* param_list, /*!< in: parameter declaration list */
que_node_t* stat_list); /*!< in: statement list */
/*************************************************************//**
@@ -672,7 +642,6 @@ struct proc_node_t{
que_common_t common; /*!< type: QUE_NODE_PROC */
sym_node_t* proc_id; /*!< procedure name symbol in the symbol
table of this same procedure */
- sym_node_t* param_list; /*!< input and output parameters */
que_node_t* stat_list; /*!< statement list */
sym_tab_t* sym_tab; /*!< symbol table of this procedure */
};
@@ -747,7 +716,7 @@ struct col_assign_node_t{
#define PARS_FUNC_LOGICAL 2 /*!< AND, OR, NOT */
#define PARS_FUNC_CMP 3 /*!< comparison operators */
#define PARS_FUNC_PREDEFINED 4 /*!< TO_NUMBER, SUBSTR, ... */
-#define PARS_FUNC_AGGREGATE 5 /*!< COUNT, DISTINCT, SUM */
+#define PARS_FUNC_AGGREGATE 5 /*!< COUNT */
#define PARS_FUNC_OTHER 6 /*!< these are not real functions,
e.g., := */
/* @} */
diff --git a/storage/innobase/include/rem0cmp.h b/storage/innobase/include/rem0cmp.h
index 9582b0df393..af1b145b0d9 100644
--- a/storage/innobase/include/rem0cmp.h
+++ b/storage/innobase/include/rem0cmp.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 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
@@ -80,7 +80,7 @@ cmp_dfield_dfield(
/** Compare a GIS data tuple to a physical record.
@param[in] dtuple data tuple
-@param[in] rec B-tree record
+@param[in] rec R-tree record
@param[in] offsets rec_get_offsets(rec)
@param[in] mode compare mode
@retval negative if dtuple is less than rec */
@@ -89,7 +89,7 @@ cmp_dtuple_rec_with_gis(
/*====================*/
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
page_cur_mode_t mode)
MY_ATTRIBUTE((nonnull));
@@ -105,7 +105,7 @@ int
cmp_dtuple_rec_with_gis_internal(
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets);
+ const offset_t* offsets);
/** Compare a data tuple to a physical record.
@param[in] dtuple data tuple
@@ -121,7 +121,7 @@ int
cmp_dtuple_rec_with_match_low(
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint n_cmp,
ulint* matched_fields)
MY_ATTRIBUTE((nonnull));
@@ -145,7 +145,7 @@ cmp_dtuple_rec_with_match_bytes(
const dtuple_t* dtuple,
const rec_t* rec,
const dict_index_t* index,
- const ulint* offsets,
+ const offset_t* offsets,
ulint* matched_fields,
ulint* matched_bytes)
MY_ATTRIBUTE((warn_unused_result));
@@ -162,7 +162,7 @@ int
cmp_dtuple_rec(
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets);
+ const offset_t* offsets);
/**************************************************************//**
Checks if a dtuple is a prefix of a record. The last field in dtuple
is allowed to be a prefix of the corresponding field in the record.
@@ -172,7 +172,7 @@ cmp_dtuple_is_prefix_of_rec(
/*========================*/
const dtuple_t* dtuple, /*!< in: data tuple */
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets);/*!< in: array returned by rec_get_offsets() */
/** Compare two physical records that contain the same number of columns,
none of which are stored externally.
@retval positive if rec1 (including non-ordering columns) is greater than rec2
@@ -183,58 +183,40 @@ cmp_rec_rec_simple(
/*===============*/
const rec_t* rec1, /*!< in: physical record */
const rec_t* rec2, /*!< in: physical record */
- const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
- const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
+ const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
+ const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
const dict_index_t* index, /*!< in: data dictionary index */
struct TABLE* table) /*!< in: MySQL table, for reporting
duplicate key value if applicable,
or NULL */
MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
-/** Compare two B-tree records.
-@param[in] rec1 B-tree record
-@param[in] rec2 B-tree record
-@param[in] offsets1 rec_get_offsets(rec1, index)
-@param[in] offsets2 rec_get_offsets(rec2, index)
-@param[in] index B-tree index
-@param[in] nulls_unequal true if this is for index cardinality
-statistics estimation, and innodb_stats_method=nulls_unequal
-or innodb_stats_method=nulls_ignored
-@param[out] matched_fields number of completely matched fields
-within the first field not completely matched
-@return the comparison result
-@retval 0 if rec1 is equal to rec2
-@retval negative if rec1 is less than rec2
-@retval positive if rec2 is greater than rec2 */
-int
-cmp_rec_rec_with_match(
- const rec_t* rec1,
- const rec_t* rec2,
- const ulint* offsets1,
- const ulint* offsets2,
- const dict_index_t* index,
- bool nulls_unequal,
- ulint* matched_fields);
-/** Compare two B-tree records.
+/** Compare two B-tree or R-tree records.
Only the common first fields are compared, and externally stored field
are treated as equal.
-@param[in] rec1 B-tree record
-@param[in] rec2 B-tree record
+@param[in] rec1 record (possibly not on an index page)
+@param[in] rec2 B-tree or R-tree record in an index page
@param[in] offsets1 rec_get_offsets(rec1, index)
@param[in] offsets2 rec_get_offsets(rec2, index)
+@param[in] nulls_unequal true if this is for index cardinality
+ statistics estimation with
+ innodb_stats_method=nulls_unequal
+ or innodb_stats_method=nulls_ignored
@param[out] matched_fields number of completely matched fields
within the first field not completely matched
-@return positive, 0, negative if rec1 is greater, equal, less, than rec2,
-respectively */
-UNIV_INLINE
+@retval 0 if rec1 is equal to rec2
+@retval negative if rec1 is less than rec2
+@retval positive if rec1 is greater than rec2 */
int
cmp_rec_rec(
const rec_t* rec1,
const rec_t* rec2,
- const ulint* offsets1,
- const ulint* offsets2,
+ const offset_t* offsets1,
+ const offset_t* offsets2,
const dict_index_t* index,
- ulint* matched_fields = NULL);
+ bool nulls_unequal = false,
+ ulint* matched_fields = NULL)
+ MY_ATTRIBUTE((nonnull(1,2,3,4,5)));
/** Compare two data fields.
@param[in] dfield1 data field
diff --git a/storage/innobase/include/rem0cmp.ic b/storage/innobase/include/rem0cmp.ic
index 2412d22e8fa..4230543615a 100644
--- a/storage/innobase/include/rem0cmp.ic
+++ b/storage/innobase/include/rem0cmp.ic
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (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 the Free Software
@@ -52,40 +53,6 @@ cmp_dfield_dfield(
dfield_get_len(dfield2)));
}
-/** Compare two B-tree records.
-Only the common first fields are compared, and externally stored field
-are treated as equal.
-@param[in] rec1 B-tree record
-@param[in] rec2 B-tree record
-@param[in] offsets1 rec_get_offsets(rec1, index)
-@param[in] offsets2 rec_get_offsets(rec2, index)
-@param[out] matched_fields number of completely matched fields
- within the first field not completely matched
-@return positive, 0, negative if rec1 is greater, equal, less, than rec2,
-respectively */
-UNIV_INLINE
-int
-cmp_rec_rec(
- const rec_t* rec1,
- const rec_t* rec2,
- const ulint* offsets1,
- const ulint* offsets2,
- const dict_index_t* index,
- ulint* matched_fields)
-{
- ulint match_f;
- int ret;
-
- ret = cmp_rec_rec_with_match(
- rec1, rec2, offsets1, offsets2, index, false, &match_f);
-
- if (matched_fields != NULL) {
- *matched_fields = match_f;
- }
-
- return(ret);
-}
-
/** Compare two data fields.
@param[in] dfield1 data field
@param[in] dfield2 data field
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index 0c49c223e10..4b7812e3bd6 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -90,45 +90,86 @@ The status is stored in the low-order bits. */
/* Length of a B-tree node pointer, in bytes */
#define REC_NODE_PTR_SIZE 4
+#ifndef UNIV_INNOCHECKSUM
/** SQL null flag in a 1-byte offset of ROW_FORMAT=REDUNDANT records */
-#define REC_1BYTE_SQL_NULL_MASK 0x80UL
+static const offset_t REC_1BYTE_SQL_NULL_MASK= 0x80;
/** SQL null flag in a 2-byte offset of ROW_FORMAT=REDUNDANT records */
-#define REC_2BYTE_SQL_NULL_MASK 0x8000UL
+static const offset_t REC_2BYTE_SQL_NULL_MASK= 0x8000;
/** In a 2-byte offset of ROW_FORMAT=REDUNDANT records, the second most
significant bit denotes that the tail of a field is stored off-page. */
-#define REC_2BYTE_EXTERN_MASK 0x4000UL
+static const offset_t REC_2BYTE_EXTERN_MASK= 0x4000;
+
+static const size_t RECORD_OFFSET= 2;
+static const size_t INDEX_OFFSET=
+ RECORD_OFFSET + sizeof(rec_t *) / sizeof(offset_t);
+#endif /* UNIV_INNOCHECKSUM */
-#ifdef UNIV_DEBUG
-/* Length of the rec_get_offsets() header */
-# define REC_OFFS_HEADER_SIZE 4
-#else /* UNIV_DEBUG */
/* Length of the rec_get_offsets() header */
-# define REC_OFFS_HEADER_SIZE 2
+static const size_t REC_OFFS_HEADER_SIZE=
+#ifdef UNIV_DEBUG
+#ifndef UNIV_INNOCHECKSUM
+ sizeof(rec_t *) / sizeof(offset_t) +
+ sizeof(dict_index_t *) / sizeof(offset_t) +
+#endif /* UNIV_INNOCHECKSUM */
#endif /* UNIV_DEBUG */
+ 2;
/* Number of elements that should be initially allocated for the
offsets[] array, first passed to rec_get_offsets() */
-#define REC_OFFS_NORMAL_SIZE OFFS_IN_REC_NORMAL_SIZE
-#define REC_OFFS_SMALL_SIZE 10
+static const size_t REC_OFFS_NORMAL_SIZE= 300;
+static const size_t REC_OFFS_SMALL_SIZE= 18;
+static const size_t REC_OFFS_SEC_INDEX_SIZE=
+ /* PK max key parts */ 16 + /* sec idx max key parts */ 16 +
+ /* child page number for non-leaf pages */ 1;
/** Get the base address of offsets. The extra_size is stored at
this position, and following positions hold the end offsets of
the fields. */
#define rec_offs_base(offsets) (offsets + REC_OFFS_HEADER_SIZE)
+#ifndef UNIV_INNOCHECKSUM
+/* Offset consists of two parts: 2 upper bits is type and all other bits is
+value */
+
+/** Only 4 different values is possible! */
+enum field_type_t
+{
+ /** normal field */
+ STORED_IN_RECORD= 0 << 14,
+ /** this field is stored off-page */
+ STORED_OFFPAGE= 1 << 14,
+ /** just an SQL NULL */
+ SQL_NULL= 2 << 14,
+ /** instantly added field */
+ DEFAULT= 3 << 14,
+};
+
+/** without 2 upper bits */
+static const offset_t DATA_MASK= 0x3fff;
+/** 2 upper bits */
+static const offset_t TYPE_MASK= ~DATA_MASK;
+inline field_type_t get_type(offset_t n)
+{
+ return static_cast<field_type_t>(n & TYPE_MASK);
+}
+inline void set_type(offset_t &n, field_type_t type)
+{
+ n= (n & DATA_MASK) | static_cast<offset_t>(type);
+}
+inline offset_t get_value(offset_t n) { return n & DATA_MASK; }
+inline offset_t combine(offset_t value, field_type_t type)
+{
+ return get_value(value) | static_cast<offset_t>(type);
+}
+
/** Compact flag ORed to the extra size returned by rec_get_offsets() */
-const ulint REC_OFFS_COMPACT = ~(ulint(~0) >> 1);
-/** SQL NULL flag in offsets returned by rec_get_offsets() */
-const ulint REC_OFFS_SQL_NULL = REC_OFFS_COMPACT;
+const offset_t REC_OFFS_COMPACT= ~(offset_t(~0) >> 1);
/** External flag in offsets returned by rec_get_offsets() */
-const ulint REC_OFFS_EXTERNAL = REC_OFFS_COMPACT >> 1;
+const offset_t REC_OFFS_EXTERNAL= REC_OFFS_COMPACT >> 1;
/** Default value flag in offsets returned by rec_get_offsets() */
-const ulint REC_OFFS_DEFAULT = REC_OFFS_COMPACT >> 2;
-/** Mask for offsets returned by rec_get_offsets() */
-const ulint REC_OFFS_MASK = REC_OFFS_DEFAULT - 1;
-
-#ifndef UNIV_INNOCHECKSUM
+const offset_t REC_OFFS_DEFAULT= REC_OFFS_COMPACT >> 2;
+const offset_t REC_OFFS_MASK= REC_OFFS_DEFAULT - 1;
/******************************************************//**
The following function is used to get the pointer of the next chained record
on the same page.
@@ -463,7 +504,7 @@ offsets form. If the field is SQL null, the flag is ORed in the returned
value.
@return offset of the start of the field, SQL null flag ORed */
UNIV_INLINE
-ulint
+uint8_t
rec_1_get_field_end_info(
/*=====================*/
const rec_t* rec, /*!< in: record */
@@ -477,7 +518,7 @@ value.
@return offset of the start of the field, SQL null flag and extern
storage flag ORed */
UNIV_INLINE
-ulint
+uint16_t
rec_2_get_field_end_info(
/*=====================*/
const rec_t* rec, /*!< in: record */
@@ -518,11 +559,11 @@ rec_get_n_extern_new(
(ULINT_UNDEFINED to compute all offsets)
@param[in,out] heap memory heap
@return the new offsets */
-ulint*
+offset_t*
rec_get_offsets_func(
const rec_t* rec,
const dict_index_t* index,
- ulint* offsets,
+ offset_t* offsets,
bool leaf,
ulint n_fields,
#ifdef UNIV_DEBUG
@@ -557,7 +598,7 @@ rec_get_offsets_reverse(
const dict_index_t* index, /*!< in: record descriptor */
ulint node_ptr,/*!< in: nonzero=node pointer,
0=leaf node */
- ulint* offsets)/*!< in/out: array consisting of
+ offset_t* offsets)/*!< in/out: array consisting of
offsets[0] allocated elements */
MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
@@ -570,7 +611,7 @@ bool
rec_offs_validate(
const rec_t* rec,
const dict_index_t* index,
- const ulint* offsets)
+ const offset_t* offsets)
MY_ATTRIBUTE((nonnull(3), warn_unused_result));
/** Update debug data in offsets, in order to tame rec_offs_validate().
@param[in] rec record
@@ -582,7 +623,7 @@ rec_offs_make_valid(
const rec_t* rec,
const dict_index_t* index,
bool leaf,
- ulint* offsets)
+ offset_t* offsets)
MY_ATTRIBUTE((nonnull));
#else
# define rec_offs_make_valid(rec, index, leaf, offsets)
@@ -619,17 +660,16 @@ The following function is used to get an offset to the nth
data field in a record.
@return offset from the origin of rec */
UNIV_INLINE
-ulint
+offset_t
rec_get_nth_field_offs(
/*===================*/
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n, /*!< in: index of the field */
ulint* len) /*!< out: length of the field; UNIV_SQL_NULL
if SQL null */
MY_ATTRIBUTE((nonnull));
#define rec_get_nth_field(rec, offsets, n, len) \
((rec) + rec_get_nth_field_offs(offsets, n, len))
-
/******************************************************//**
Determine if the offsets are for a record containing null BLOB pointers.
@return first field containing a null BLOB pointer, or NULL if none found */
@@ -638,7 +678,7 @@ const byte*
rec_offs_any_null_extern(
/*=====================*/
const rec_t* rec, /*!< in: record */
- const ulint* offsets) /*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets) /*!< in: rec_get_offsets(rec) */
MY_ATTRIBUTE((warn_unused_result));
/** Mark the nth field as externally stored.
@@ -646,7 +686,7 @@ rec_offs_any_null_extern(
@param[in] n nth field */
void
rec_offs_make_nth_extern(
- ulint* offsets,
+ offset_t* offsets,
const ulint n);
/** Determine the number of allocated elements for an array of offsets.
@@ -654,7 +694,7 @@ rec_offs_make_nth_extern(
@return number of elements */
inline
ulint
-rec_offs_get_n_alloc(const ulint* offsets)
+rec_offs_get_n_alloc(const offset_t* offsets)
{
ulint n_alloc;
ut_ad(offsets);
@@ -669,7 +709,7 @@ rec_offs_get_n_alloc(const ulint* offsets)
@return number of fields */
inline
ulint
-rec_offs_n_fields(const ulint* offsets)
+rec_offs_n_fields(const offset_t* offsets)
{
ulint n_fields;
ut_ad(offsets);
@@ -685,19 +725,12 @@ rec_offs_n_fields(const ulint* offsets)
@param[in] offsets rec_get_offsets()
@param[in] n nth field
@param[in] flag flag to extract
-@return the flag of the record field */
-inline
-ulint
-rec_offs_nth_flag(const ulint* offsets, ulint n, ulint flag)
+@return type of the record field */
+inline field_type_t rec_offs_nth_type(const offset_t *offsets, ulint n)
{
- ut_ad(rec_offs_validate(NULL, NULL, offsets));
- ut_ad(n < rec_offs_n_fields(offsets));
- /* The DEFAULT, NULL, EXTERNAL flags are mutually exclusive. */
- ut_ad(ut_is_2pow(rec_offs_base(offsets)[1 + n]
- & (REC_OFFS_DEFAULT
- | REC_OFFS_SQL_NULL
- | REC_OFFS_EXTERNAL)));
- return rec_offs_base(offsets)[1 + n] & flag;
+ ut_ad(rec_offs_validate(NULL, NULL, offsets));
+ ut_ad(n < rec_offs_n_fields(offsets));
+ return get_type(rec_offs_base(offsets)[1 + n]);
}
/** Determine if a record field is missing
@@ -705,11 +738,9 @@ rec_offs_nth_flag(const ulint* offsets, ulint n, ulint flag)
@param[in] offsets rec_get_offsets()
@param[in] n nth field
@return nonzero if default bit is set */
-inline
-ulint
-rec_offs_nth_default(const ulint* offsets, ulint n)
+inline ulint rec_offs_nth_default(const offset_t *offsets, ulint n)
{
- return rec_offs_nth_flag(offsets, n, REC_OFFS_DEFAULT);
+ return rec_offs_nth_type(offsets, n) == DEFAULT;
}
/** Determine if a record field is SQL NULL
@@ -717,11 +748,9 @@ rec_offs_nth_default(const ulint* offsets, ulint n)
@param[in] offsets rec_get_offsets()
@param[in] n nth field
@return nonzero if SQL NULL set */
-inline
-ulint
-rec_offs_nth_sql_null(const ulint* offsets, ulint n)
+inline ulint rec_offs_nth_sql_null(const offset_t *offsets, ulint n)
{
- return rec_offs_nth_flag(offsets, n, REC_OFFS_SQL_NULL);
+ return rec_offs_nth_type(offsets, n) == SQL_NULL;
}
/** Determine if a record field is stored off-page.
@@ -729,54 +758,46 @@ rec_offs_nth_sql_null(const ulint* offsets, ulint n)
@param[in] n nth field
Returns nonzero if the extern bit is set in nth field of rec.
@return nonzero if externally stored */
-inline
-ulint
-rec_offs_nth_extern(const ulint* offsets, ulint n)
+inline ulint rec_offs_nth_extern(const offset_t *offsets, ulint n)
{
- return rec_offs_nth_flag(offsets, n, REC_OFFS_EXTERNAL);
+ return rec_offs_nth_type(offsets, n) == STORED_OFFPAGE;
}
/** Get a global flag of a record.
@param[in] offsets rec_get_offsets()
@param[in] flag flag to extract
@return the flag of the record field */
-inline
-ulint
-rec_offs_any_flag(const ulint* offsets, ulint flag)
+inline ulint rec_offs_any_flag(const offset_t *offsets, ulint flag)
{
- ut_ad(rec_offs_validate(NULL, NULL, offsets));
- return *rec_offs_base(offsets) & flag;
+ ut_ad(rec_offs_validate(NULL, NULL, offsets));
+ return *rec_offs_base(offsets) & flag;
}
/** Determine if the offsets are for a record containing off-page columns.
@param[in] offsets rec_get_offsets()
@return nonzero if any off-page columns exist */
-inline bool rec_offs_any_extern(const ulint* offsets)
+inline bool rec_offs_any_extern(const offset_t *offsets)
{
- return rec_offs_any_flag(offsets, REC_OFFS_EXTERNAL);
+ return rec_offs_any_flag(offsets, REC_OFFS_EXTERNAL);
}
/** Determine if the offsets are for a record that is missing fields.
@param[in] offsets rec_get_offsets()
@return nonzero if any fields need to be replaced with
dict_index_t::instant_field_value() */
-inline
-ulint
-rec_offs_any_default(const ulint* offsets)
+inline ulint rec_offs_any_default(const offset_t *offsets)
{
- return rec_offs_any_flag(offsets, REC_OFFS_DEFAULT);
+ return rec_offs_any_flag(offsets, REC_OFFS_DEFAULT);
}
/** Determine if the offsets are for other than ROW_FORMAT=REDUNDANT.
@param[in] offsets rec_get_offsets()
@return nonzero if ROW_FORMAT is COMPACT,DYNAMIC or COMPRESSED
@retval 0 if ROW_FORMAT=REDUNDANT */
-inline
-ulint
-rec_offs_comp(const ulint* offsets)
+inline ulint rec_offs_comp(const offset_t *offsets)
{
- ut_ad(rec_offs_validate(NULL, NULL, offsets));
- return(*rec_offs_base(offsets) & REC_OFFS_COMPACT);
+ ut_ad(rec_offs_validate(NULL, NULL, offsets));
+ return (*rec_offs_base(offsets) & REC_OFFS_COMPACT);
}
/** Determine if the record is the metadata pseudo-record
@@ -806,7 +827,7 @@ const byte*
rec_get_nth_cfield(
const rec_t* rec,
const dict_index_t* index,
- const ulint* offsets,
+ const offset_t* offsets,
ulint n,
ulint* len)
{
@@ -824,7 +845,7 @@ UNIV_INLINE
ulint
rec_offs_nth_size(
/*==============*/
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */
MY_ATTRIBUTE((warn_unused_result));
@@ -835,7 +856,7 @@ UNIV_INLINE
ulint
rec_offs_n_extern(
/*==============*/
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result));
/***********************************************************//**
This is used to modify the value of an already existing field in a record.
@@ -848,7 +869,7 @@ void
rec_set_nth_field(
/*==============*/
rec_t* rec, /*!< in: record */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n, /*!< in: index number of the field */
const void* data, /*!< in: pointer to the data if not SQL null */
ulint len) /*!< in: length of the data or UNIV_SQL_NULL.
@@ -876,7 +897,7 @@ UNIV_INLINE
void
rec_offs_set_n_alloc(
/*=================*/
- ulint* offsets, /*!< out: array for rec_get_offsets(),
+ offset_t*offsets, /*!< out: array for rec_get_offsets(),
must be allocated */
ulint n_alloc) /*!< in: number of elements */
MY_ATTRIBUTE((nonnull));
@@ -892,7 +913,7 @@ UNIV_INLINE
ulint
rec_offs_data_size(
/*===============*/
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result));
/**********************************************************//**
Returns the total size of record minus data size of record.
@@ -903,7 +924,7 @@ UNIV_INLINE
ulint
rec_offs_extra_size(
/*================*/
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result));
/**********************************************************//**
Returns the total size of a physical record.
@@ -912,7 +933,7 @@ UNIV_INLINE
ulint
rec_offs_size(
/*==========*/
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result));
#ifdef UNIV_DEBUG
/**********************************************************//**
@@ -923,7 +944,7 @@ byte*
rec_get_start(
/*==========*/
const rec_t* rec, /*!< in: pointer to record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result));
/**********************************************************//**
Returns a pointer to the end of the record.
@@ -933,7 +954,7 @@ byte*
rec_get_end(
/*========*/
const rec_t* rec, /*!< in: pointer to record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((warn_unused_result));
#else /* UNIV_DEBUG */
# define rec_get_start(rec, offsets) ((rec) - rec_offs_extra_size(offsets))
@@ -950,7 +971,7 @@ rec_t*
rec_copy(
void* buf,
const rec_t* rec,
- const ulint* offsets);
+ const offset_t* offsets);
/** Determine the size of a data tuple prefix in a temporary file.
@param[in] index clustered or secondary index
@@ -979,7 +1000,7 @@ void
rec_init_offsets_temp(
const rec_t* rec,
const dict_index_t* index,
- ulint* offsets,
+ offset_t* offsets,
ulint n_core,
const dict_col_t::def_t*def_val,
rec_comp_status_t status = REC_STATUS_ORDINARY)
@@ -993,7 +1014,7 @@ void
rec_init_offsets_temp(
const rec_t* rec,
const dict_index_t* index,
- ulint* offsets)
+ offset_t* offsets)
MY_ATTRIBUTE((nonnull));
/** Convert a data tuple prefix to the temporary file format.
@@ -1115,7 +1136,7 @@ ibool
rec_validate(
/*=========*/
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Prints an old-style physical record. */
@@ -1132,7 +1153,7 @@ rec_print_mbr_rec(
/*==========*/
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Prints a physical record. */
@@ -1141,7 +1162,7 @@ rec_print_new(
/*==========*/
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Prints a physical record. */
@@ -1163,7 +1184,7 @@ rec_print(
std::ostream& o,
const rec_t* rec,
ulint info,
- const ulint* offsets);
+ const offset_t* offsets);
/** Wrapper for pretty-printing a record */
struct rec_index_print
@@ -1190,14 +1211,14 @@ operator<<(std::ostream& o, const rec_index_print& r);
struct rec_offsets_print
{
/** Constructor */
- rec_offsets_print(const rec_t* rec, const ulint* offsets) :
+ rec_offsets_print(const rec_t* rec, const offset_t* offsets) :
m_rec(rec), m_offsets(offsets)
{}
/** Record */
const rec_t* m_rec;
/** Offsets to each field */
- const ulint* m_offsets;
+ const offset_t* m_offsets;
};
/** Display a record.
@@ -1214,7 +1235,7 @@ public:
/** Construct a pretty-printed record.
@param rec record with header
@param offsets rec_get_offsets(rec, ...) */
- rec_printer(const rec_t* rec, const ulint* offsets)
+ rec_printer(const rec_t* rec, const offset_t* offsets)
:
std::ostringstream ()
{
@@ -1227,7 +1248,7 @@ public:
@param rec record, possibly lacking header
@param info rec_get_info_bits(rec)
@param offsets rec_get_offsets(rec, ...) */
- rec_printer(const rec_t* rec, ulint info, const ulint* offsets)
+ rec_printer(const rec_t* rec, ulint info, const offset_t* offsets)
:
std::ostringstream ()
{
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index 17dd8aa3d7a..1564bdfdcc0 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
+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
@@ -816,7 +816,7 @@ offsets form. If the field is SQL null, the flag is ORed in the returned
value.
@return offset of the start of the field, SQL null flag ORed */
UNIV_INLINE
-ulint
+uint8_t
rec_1_get_field_end_info(
/*=====================*/
const rec_t* rec, /*!< in: record */
@@ -835,7 +835,7 @@ value.
@return offset of the start of the field, SQL null flag and extern
storage flag ORed */
UNIV_INLINE
-ulint
+uint16_t
rec_2_get_field_end_info(
/*=====================*/
const rec_t* rec, /*!< in: record */
@@ -868,13 +868,13 @@ UNIV_INLINE
void
rec_offs_set_n_alloc(
/*=================*/
- ulint* offsets, /*!< out: array for rec_get_offsets(),
+ offset_t*offsets, /*!< out: array for rec_get_offsets(),
must be allocated */
ulint n_alloc) /*!< in: number of elements */
{
ut_ad(n_alloc > REC_OFFS_HEADER_SIZE);
UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets);
- offsets[0] = n_alloc;
+ offsets[0] = static_cast<offset_t>(n_alloc);
}
/************************************************************//**
@@ -882,36 +882,27 @@ The following function is used to get an offset to the nth
data field in a record.
@return offset from the origin of rec */
UNIV_INLINE
-ulint
+offset_t
rec_get_nth_field_offs(
/*===================*/
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n, /*!< in: index of the field */
ulint* len) /*!< out: length of the field; UNIV_SQL_NULL
if SQL null; UNIV_SQL_DEFAULT is default value */
{
- ulint offs;
- ulint length;
ut_ad(n < rec_offs_n_fields(offsets));
- if (n == 0) {
- offs = 0;
- } else {
- offs = rec_offs_base(offsets)[n] & REC_OFFS_MASK;
- }
-
- length = rec_offs_base(offsets)[1 + n];
+ offset_t offs = n == 0 ? 0 : get_value(rec_offs_base(offsets)[n]);
+ offset_t next_offs = rec_offs_base(offsets)[1 + n];
- if (length & REC_OFFS_SQL_NULL) {
- length = UNIV_SQL_NULL;
- } else if (length & REC_OFFS_DEFAULT) {
- length = UNIV_SQL_DEFAULT;
+ if (get_type(next_offs) == SQL_NULL) {
+ *len = UNIV_SQL_NULL;
+ } else if (get_type(next_offs) == DEFAULT) {
+ *len = UNIV_SQL_DEFAULT;
} else {
- length &= REC_OFFS_MASK;
- length -= offs;
+ *len = get_value(next_offs) - offs;
}
- *len = length;
return(offs);
}
@@ -923,7 +914,7 @@ const byte*
rec_offs_any_null_extern(
/*=====================*/
const rec_t* rec, /*!< in: record */
- const ulint* offsets) /*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets) /*!< in: rec_get_offsets(rec) */
{
ulint i;
ut_ad(rec_offs_validate(rec, NULL, offsets));
@@ -958,16 +949,16 @@ UNIV_INLINE
ulint
rec_offs_nth_size(
/*==============*/
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */
{
ut_ad(rec_offs_validate(NULL, NULL, offsets));
ut_ad(n < rec_offs_n_fields(offsets));
if (!n) {
- return(rec_offs_base(offsets)[1 + n] & REC_OFFS_MASK);
+ return get_value(rec_offs_base(offsets)[1 + n]);
}
- return((rec_offs_base(offsets)[1 + n] - rec_offs_base(offsets)[n])
- & REC_OFFS_MASK);
+ return get_value((rec_offs_base(offsets)[1 + n]))
+ - get_value(rec_offs_base(offsets)[n]);
}
/******************************************************//**
@@ -977,7 +968,7 @@ UNIV_INLINE
ulint
rec_offs_n_extern(
/*==============*/
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ulint n = 0;
@@ -1175,7 +1166,7 @@ void
rec_set_nth_field(
/*==============*/
rec_t* rec, /*!< in: record */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n, /*!< in: index number of the field */
const void* data, /*!< in: pointer to the data
if not SQL null */
@@ -1231,16 +1222,16 @@ UNIV_INLINE
void
rec_offs_set_n_fields(
/*==================*/
- ulint* offsets, /*!< in/out: array returned by
+ offset_t* offsets, /*!< in/out: array returned by
rec_get_offsets() */
- ulint n_fields) /*!< in: number of fields */
+ ulint n_fields) /*!< in: number of fields */
{
ut_ad(offsets);
ut_ad(n_fields > 0);
ut_ad(n_fields <= REC_MAX_N_FIELDS);
ut_ad(n_fields + REC_OFFS_HEADER_SIZE
<= rec_offs_get_n_alloc(offsets));
- offsets[1] = n_fields;
+ offsets[1] = static_cast<offset_t>(n_fields);
}
/**********************************************************//**
@@ -1253,13 +1244,12 @@ UNIV_INLINE
ulint
rec_offs_data_size(
/*===============*/
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ulint size;
ut_ad(rec_offs_validate(NULL, NULL, offsets));
- size = rec_offs_base(offsets)[rec_offs_n_fields(offsets)]
- & REC_OFFS_MASK;
+ size = get_value(rec_offs_base(offsets)[rec_offs_n_fields(offsets)]);
ut_ad(size < srv_page_size);
return(size);
}
@@ -1273,7 +1263,7 @@ UNIV_INLINE
ulint
rec_offs_extra_size(
/*================*/
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ulint size;
ut_ad(rec_offs_validate(NULL, NULL, offsets));
@@ -1289,7 +1279,7 @@ UNIV_INLINE
ulint
rec_offs_size(
/*==========*/
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
return(rec_offs_data_size(offsets) + rec_offs_extra_size(offsets));
}
@@ -1303,7 +1293,7 @@ byte*
rec_get_end(
/*========*/
const rec_t* rec, /*!< in: pointer to record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ut_ad(rec_offs_validate(rec, NULL, offsets));
return(const_cast<rec_t*>(rec + rec_offs_data_size(offsets)));
@@ -1317,7 +1307,7 @@ byte*
rec_get_start(
/*==========*/
const rec_t* rec, /*!< in: pointer to record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ut_ad(rec_offs_validate(rec, NULL, offsets));
return(const_cast<rec_t*>(rec - rec_offs_extra_size(offsets)));
@@ -1334,7 +1324,7 @@ rec_t*
rec_copy(
void* buf,
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
ulint extra_len;
ulint data_len;
@@ -1420,6 +1410,11 @@ rec_get_converted_size(
data_size = dtuple_get_data_size(dtuple, 0);
+ /* If primary key is being updated then the new record inherits
+ externally stored fields from the delete-marked old record.
+ In that case, n_ext may be less value than
+ dtuple_get_n_ext(tuple). */
+ ut_ad(n_ext <= dtuple_get_n_ext(dtuple));
extra_size = rec_get_converted_extra_size(
data_size, dtuple_get_n_fields(dtuple), n_ext);
diff --git a/storage/innobase/include/rem0types.h b/storage/innobase/include/rem0types.h
index 38a5ba66f76..754781d62d1 100644
--- a/storage/innobase/include/rem0types.h
+++ b/storage/innobase/include/rem0types.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2019, 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
@@ -29,6 +30,9 @@ Created 5/30/1994 Heikki Tuuri
/* We define the physical record simply as an array of bytes */
typedef byte rec_t;
+/** This type represents a field offset in a rec_t* */
+typedef unsigned short int offset_t;
+
/* Maximum values for various fields (for non-blob tuples) */
#define REC_MAX_N_FIELDS (1024 - 1)
#define REC_MAX_HEAP_NO (2 * 8192 - 1)
diff --git a/storage/innobase/include/row0ftsort.h b/storage/innobase/include/row0ftsort.h
index b735576fbbb..9e5360625f4 100644
--- a/storage/innobase/include/row0ftsort.h
+++ b/storage/innobase/include/row0ftsort.h
@@ -30,6 +30,7 @@ Created 10/13/2010 Jimmy Yang
#include "data0data.h"
#include "fts0fts.h"
#include "fts0priv.h"
+#include "rem0types.h"
#include "row0merge.h"
#include "btr0bulk.h"
@@ -250,7 +251,7 @@ row_merge_fts_sel_propagate(
int* sel_tree, /*<! in: selection tree */
ulint level, /*<! in: selection tree level */
const mrec_t** mrec, /*<! in: sort record */
- ulint** offsets, /*<! in: record offsets */
+ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index); /*<! in: FTS index */
/********************************************************************//**
Read sorted file containing index data tuples and insert these data
diff --git a/storage/innobase/include/row0log.h b/storage/innobase/include/row0log.h
index d6350705d55..e6f60345703 100644
--- a/storage/innobase/include/row0log.h
+++ b/storage/innobase/include/row0log.h
@@ -136,7 +136,7 @@ row_log_table_delete(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
- const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should
be logged, or NULL to use those in rec */
ATTRIBUTE_COLD __attribute__((nonnull(1,2,3)));
@@ -151,7 +151,7 @@ row_log_table_update(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
- const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
const dtuple_t* old_pk);/*!< in: row_log_table_get_pk()
before the update */
@@ -167,7 +167,7 @@ row_log_table_get_pk(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
- const ulint* offsets,/*!< in: rec_get_offsets(rec,index),
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index),
or NULL */
byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for
row_log_table_delete(), or NULL */
@@ -184,7 +184,7 @@ row_log_table_insert(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
- const ulint* offsets);/*!< in: rec_get_offsets(rec,index) */
+ const offset_t* offsets);/*!< in: rec_get_offsets(rec,index) */
/******************************************************//**
Notes that a BLOB is being freed during online ALTER TABLE. */
void
diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h
index 27bd19252ac..fd9050d0a48 100644
--- a/storage/innobase/include/row0merge.h
+++ b/storage/innobase/include/row0merge.h
@@ -489,7 +489,7 @@ row_merge_read_rec(
const mrec_t** mrec, /*!< out: pointer to merge record,
or NULL on end of list
(non-NULL on I/O error) */
- ulint* offsets,/*!< out: offsets of mrec */
+ offset_t* offsets,/*!< out: offsets of mrec */
row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
ulint space) /*!< in: space id */
MY_ATTRIBUTE((warn_unused_result));
diff --git a/storage/innobase/include/row0row.h b/storage/innobase/include/row0row.h
index afcae89a0ab..d4d979cdad5 100644
--- a/storage/innobase/include/row0row.h
+++ b/storage/innobase/include/row0row.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2017, 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 the Free Software
@@ -44,7 +44,7 @@ ulint
row_get_trx_id_offset(
/*==================*/
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: record offsets */
+ const offset_t* offsets)/*!< in: record offsets */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Reads the trx id field from a clustered index record.
@@ -55,7 +55,7 @@ row_get_rec_trx_id(
/*===============*/
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Reads the roll pointer field from a clustered index record.
@@ -66,7 +66,7 @@ row_get_rec_roll_ptr(
/*=================*/
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/* Flags for row build type. */
@@ -138,7 +138,7 @@ row_build(
this record must be at least
s-latched and the latch held
as long as the row dtuple is used! */
- const ulint* offsets,/*!< in: rec_get_offsets(rec,index)
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index)
or NULL, in which case this function
will invoke rec_get_offsets() */
const dict_table_t* col_table,
@@ -189,7 +189,7 @@ row_build_w_add_vcol(
ulint type,
const dict_index_t* index,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
const dict_table_t* col_table,
const dtuple_t* defaults,
const dict_add_v_col_t* add_v,
@@ -206,9 +206,7 @@ row_rec_to_index_entry_low(
/*=======================*/
const rec_t* rec, /*!< in: record in the index */
const dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
- ulint* n_ext, /*!< out: number of externally
- stored columns */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
MY_ATTRIBUTE((warn_unused_result));
@@ -221,9 +219,7 @@ row_rec_to_index_entry(
/*===================*/
const rec_t* rec, /*!< in: record in the index */
const dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in/out: rec_get_offsets(rec) */
- ulint* n_ext, /*!< out: number of externally
- stored columns */
+ const offset_t* offsets,/*!< in/out: rec_get_offsets(rec) */
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
MY_ATTRIBUTE((warn_unused_result));
@@ -266,7 +262,7 @@ row_build_row_ref_in_tuple(
held as long as the row
reference is used! */
const dict_index_t* index, /*!< in: secondary index */
- ulint* offsets)/*!< in: rec_get_offsets(rec, index)
+ offset_t* offsets)/*!< in: rec_get_offsets(rec, index)
or NULL */
MY_ATTRIBUTE((nonnull(1,2,3)));
/*******************************************************************//**
@@ -284,7 +280,7 @@ row_build_row_ref_fast(
const rec_t* rec, /*!< in: secondary index record;
must be preserved while ref is used, as we do
not copy field values to heap */
- const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets);/*!< in: array returned by rec_get_offsets() */
/***************************************************************//**
Searches the clustered index record for a row, if we have the row
reference.
diff --git a/storage/innobase/include/row0row.ic b/storage/innobase/include/row0row.ic
index 4e3cf58cfc5..14f9f47ba7e 100644
--- a/storage/innobase/include/row0row.ic
+++ b/storage/innobase/include/row0row.ic
@@ -37,7 +37,7 @@ ulint
row_get_trx_id_offset(
/*==================*/
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: record offsets */
+ const offset_t* offsets)/*!< in: record offsets */
{
ulint pos;
ulint offset;
@@ -64,7 +64,7 @@ row_get_rec_trx_id(
/*===============*/
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{
ulint offset;
@@ -89,7 +89,7 @@ row_get_rec_roll_ptr(
/*=================*/
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{
ulint offset;
@@ -148,7 +148,7 @@ row_build_row_ref_fast(
const rec_t* rec, /*!< in: secondary index record;
must be preserved while ref is used, as we do
not copy field values to heap */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
dfield_t* dfield;
const byte* field;
diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h
index 7d716f960c5..51ed7a7f006 100644
--- a/storage/innobase/include/row0upd.h
+++ b/storage/innobase/include/row0upd.h
@@ -28,6 +28,7 @@ Created 12/27/1996 Heikki Tuuri
#define row0upd_h
#include "data0data.h"
+#include "rem0types.h"
#include "row0types.h"
#include "btr0types.h"
#include "trx0types.h"
@@ -123,7 +124,7 @@ row_upd_rec_sys_fields(
page_zip_des_t* page_zip,/*!< in/out: compressed page whose
uncompressed part will be updated, or NULL */
dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const trx_t* trx, /*!< in: transaction */
roll_ptr_t roll_ptr);/*!< in: DB_ROLL_PTR to the undo log */
/*********************************************************************//**
@@ -165,7 +166,7 @@ ibool
row_upd_changes_field_size_or_external(
/*===================================*/
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const upd_t* update);/*!< in: update vector */
/***********************************************************//**
Returns true if row update contains disowned external fields.
@@ -186,7 +187,7 @@ row_upd_rec_in_place(
/*=================*/
rec_t* rec, /*!< in/out: record where replaced */
dict_index_t* index, /*!< in: the index the record belongs to */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
page_zip_des_t* page_zip);/*!< in: compressed page with enough space
available, or NULL */
@@ -201,7 +202,7 @@ row_upd_build_sec_rec_difference_binary(
/*====================================*/
const rec_t* rec, /*!< in: secondary index record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const dtuple_t* entry, /*!< in: entry to insert */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
MY_ATTRIBUTE((warn_unused_result, nonnull));
@@ -227,7 +228,7 @@ row_upd_build_difference_binary(
dict_index_t* index,
const dtuple_t* entry,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
bool no_sys,
trx_t* trx,
mem_heap_t* heap,
@@ -399,7 +400,7 @@ row_upd_rec_sys_fields_in_recovery(
/*===============================*/
rec_t* rec, /*!< in/out: record */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint pos, /*!< in: TRX_ID position in rec */
trx_id_t trx_id, /*!< in: transaction id */
roll_ptr_t roll_ptr);/*!< in: roll ptr of the undo log record */
diff --git a/storage/innobase/include/row0upd.ic b/storage/innobase/include/row0upd.ic
index 0a6c33653a0..c8e72f45491 100644
--- a/storage/innobase/include/row0upd.ic
+++ b/storage/innobase/include/row0upd.ic
@@ -163,7 +163,7 @@ row_upd_rec_sys_fields(
page_zip_des_t* page_zip,/*!< in/out: compressed page whose
uncompressed part will be updated, or NULL */
dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const trx_t* trx, /*!< in: transaction */
roll_ptr_t roll_ptr)/*!< in: DB_ROLL_PTR to the undo log */
{
diff --git a/storage/innobase/include/row0vers.h b/storage/innobase/include/row0vers.h
index 948804beafc..0603f7c894c 100644
--- a/storage/innobase/include/row0vers.h
+++ b/storage/innobase/include/row0vers.h
@@ -52,7 +52,7 @@ row_vers_impl_x_locked(
trx_t* caller_trx,
const rec_t* rec,
dict_index_t* index,
- const ulint* offsets);
+ const offset_t* offsets);
/** Finds out if a version of the record, where the version >= the current
purge view, should have ientry as its secondary index entry. We check
@@ -98,7 +98,7 @@ row_vers_build_for_consistent_read(
mtr_t* mtr, /*!< in: mtr holding the latch on rec; it will
also hold the latch on purge_view */
dict_index_t* index, /*!< in: the clustered index */
- ulint** offsets,/*!< in/out: offsets returned by
+ offset_t** offsets,/*!< in/out: offsets returned by
rec_get_offsets(rec, index) */
ReadView* view, /*!< in: the consistent read view */
mem_heap_t** offset_heap,/*!< in/out: memory heap from which
@@ -126,7 +126,7 @@ row_vers_build_for_semi_consistent_read(
of this records */
mtr_t* mtr, /*!< in: mtr holding the latch on rec */
dict_index_t* index, /*!< in: the clustered index */
- ulint** offsets,/*!< in/out: offsets returned by
+ offset_t** offsets,/*!< in/out: offsets returned by
rec_get_offsets(rec, index) */
mem_heap_t** offset_heap,/*!< in/out: memory heap from which
the offsets are allocated */
diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h
index f169dd8871e..e2c2fbd8204 100644
--- a/storage/innobase/include/trx0rec.h
+++ b/storage/innobase/include/trx0rec.h
@@ -191,7 +191,7 @@ trx_undo_report_row_operation(
const rec_t* rec, /*!< in: case of an update or delete
marking, the record in the clustered
index; NULL if insert */
- const ulint* offsets, /*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the
undo log record */
MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result));
@@ -224,7 +224,7 @@ trx_undo_prev_version_build(
index_rec page and purge_view */
const rec_t* rec, /*!< in: version of a clustered index record */
dict_index_t* index, /*!< in: clustered index */
- ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mem_heap_t* heap, /*!< in: memory heap from which the memory
needed is allocated */
rec_t** old_vers,/*!< out, own: previous version, or NULL if
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index da690a3c65e..8cd4d2018c6 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+Copyright (c) 2015, 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
@@ -342,13 +342,6 @@ bool
trx_is_interrupted(
/*===============*/
const trx_t* trx); /*!< in: transaction */
-/**********************************************************************//**
-Determines if the currently running transaction is in strict mode.
-@return TRUE if strict */
-ibool
-trx_is_strict(
-/*==========*/
- trx_t* trx); /*!< in: transaction */
/*******************************************************************//**
Calculates the "weight" of a transaction. The weight of one transaction
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index 19a03009ad5..ab30024116e 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2019, MariaDB Corporation.
+Copyright (c) 2013, 2020, MariaDB Corporation.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
diff --git a/storage/innobase/include/ut0rnd.h b/storage/innobase/include/ut0rnd.h
index e8604ffa1c3..9af8687bfd0 100644
--- a/storage/innobase/include/ut0rnd.h
+++ b/storage/innobase/include/ut0rnd.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2019, 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
@@ -27,37 +28,49 @@ Created 1/20/1994 Heikki Tuuri
#define ut0rnd_h
#include "ut0byte.h"
+#include <my_sys.h>
#ifndef UNIV_INNOCHECKSUM
-/** The 'character code' for end of field or string (used
-in folding records */
-#define UT_END_OF_FIELD 257
+/** Seed value of ut_rnd_gen() */
+extern int32 ut_rnd_current;
+
+/** @return a pseudo-random 32-bit number */
+inline uint32_t ut_rnd_gen()
+{
+ /* This is a Galois linear-feedback shift register.
+ https://en.wikipedia.org/wiki/Linear-feedback_shift_register#Galois_LFSRs
+ The generating primitive Galois Field polynomial is the Castagnoli
+ polynomial that was made popular by CRC-32C:
+ x^32+x^28+x^27+x^26+x^25+x^23+x^22+x^20+
+ x^19+x^18+x^14+x^13+x^11+x^10+x^9+x^8+x^6+1 */
+ const uint32_t crc32c= 0x1edc6f41;
+
+ uint32_t rnd= my_atomic_load32_explicit(&ut_rnd_current,
+ MY_MEMORY_ORDER_RELAXED);
+
+ if (UNIV_UNLIKELY(rnd == 0))
+ {
+ rnd= static_cast<uint32_t>(my_interval_timer());
+ if (!rnd) rnd= 1;
+ }
+ else
+ {
+ bool lsb= rnd & 1;
+ rnd>>= 1;
+ if (lsb)
+ rnd^= crc32c;
+ }
+
+ my_atomic_store32_explicit(&ut_rnd_current, rnd, MY_MEMORY_ORDER_RELAXED);
+ return rnd;
+}
+
+/** @return a random number between 0 and n-1, inclusive */
+inline ulint ut_rnd_interval(ulint n)
+{
+ return n > 1 ? static_cast<ulint>(ut_rnd_gen() % n) : 0;
+}
-/********************************************************//**
-This is used to set the random number seed. */
-UNIV_INLINE
-void
-ut_rnd_set_seed(
-/*============*/
- ulint seed); /*!< in: seed */
-/********************************************************//**
-The following function generates a series of 'random' ulint integers.
-@return the next 'random' number */
-UNIV_INLINE
-ulint
-ut_rnd_gen_next_ulint(
-/*==================*/
- ulint rnd); /*!< in: the previous random number value */
-/*********************************************************//**
-The following function generates 'random' ulint integers which
-enumerate the value space (let there be N of them) of ulint integers
-in a pseudo-random fashion. Note that the same integer is repeated
-always after N calls to the generator.
-@return the 'random' number */
-UNIV_INLINE
-ulint
-ut_rnd_gen_ulint(void);
-/*==================*/
/*******************************************************//**
The following function generates a hash value for a ulint integer
to a hash table of size table_size, which should be a prime or some
diff --git a/storage/innobase/include/ut0rnd.ic b/storage/innobase/include/ut0rnd.ic
index 2516d20f296..c0105160a42 100644
--- a/storage/innobase/include/ut0rnd.ic
+++ b/storage/innobase/include/ut0rnd.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 2019, 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
@@ -29,74 +29,6 @@ Created 5/30/1994 Heikki Tuuri
#ifndef UNIV_INNOCHECKSUM
-#define UT_RND1 151117737
-#define UT_RND2 119785373
-#define UT_RND3 85689495
-#define UT_RND4 76595339
-#define UT_SUM_RND2 98781234
-#define UT_SUM_RND3 126792457
-#define UT_SUM_RND4 63498502
-#define UT_XOR_RND1 187678878
-#define UT_XOR_RND2 143537923
-
-/** Seed value of ut_rnd_gen_ulint() */
-extern ulint ut_rnd_ulint_counter;
-
-/********************************************************//**
-This is used to set the random number seed. */
-UNIV_INLINE
-void
-ut_rnd_set_seed(
-/*============*/
- ulint seed) /*!< in: seed */
-{
- ut_rnd_ulint_counter = seed;
-}
-
-/********************************************************//**
-The following function generates a series of 'random' ulint integers.
-@return the next 'random' number */
-UNIV_INLINE
-ulint
-ut_rnd_gen_next_ulint(
-/*==================*/
- ulint rnd) /*!< in: the previous random number value */
-{
- ulint n_bits;
-
- n_bits = 8 * sizeof(ulint);
-
- rnd = UT_RND2 * rnd + UT_SUM_RND3;
- rnd = UT_XOR_RND1 ^ rnd;
- rnd = (rnd << 20) + (rnd >> (n_bits - 20));
- rnd = UT_RND3 * rnd + UT_SUM_RND4;
- rnd = UT_XOR_RND2 ^ rnd;
- rnd = (rnd << 20) + (rnd >> (n_bits - 20));
- rnd = UT_RND1 * rnd + UT_SUM_RND2;
-
- return(rnd);
-}
-
-/********************************************************//**
-The following function generates 'random' ulint integers which
-enumerate the value space of ulint integers in a pseudo random
-fashion. Note that the same integer is repeated always after
-2 to power 32 calls to the generator (if ulint is 32-bit).
-@return the 'random' number */
-UNIV_INLINE
-ulint
-ut_rnd_gen_ulint(void)
-/*==================*/
-{
- ulint rnd;
-
- ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
-
- rnd = ut_rnd_gen_next_ulint(ut_rnd_ulint_counter);
-
- return(rnd);
-}
-
/*******************************************************//**
The following function generates a hash value for a ulint integer
to a hash table of size table_size, which should be a prime
diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake
index c3698df4c11..8bfca3a614b 100644
--- a/storage/innobase/innodb.cmake
+++ b/storage/innobase/innodb.cmake
@@ -96,7 +96,8 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion")
IF (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
+ CMAKE_SYSTEM_PROCESSOR MATCHES "i386" AND
+ CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-fno-builtin-memcmp" HAVE_NO_BUILTIN_MEMCMP)
IF (HAVE_NO_BUILTIN_MEMCMP)
@@ -152,11 +153,6 @@ IF(NOT MSVC)
SET_SOURCE_FILES_PROPERTIES(trx/trx0rec.cc PROPERTIES COMPILE_FLAGS -O1)
ENDIF()
- CHECK_FUNCTION_EXISTS(posix_memalign HAVE_POSIX_MEMALIGN)
- IF(HAVE_POSIX_MEMALIGN)
- ADD_DEFINITIONS(-DHAVE_POSIX_MEMALIGN)
- ENDIF()
-
# Only use futexes on Linux if GCC atomics are available
IF(NOT MSVC AND NOT CMAKE_CROSSCOMPILING)
CHECK_C_SOURCE_RUNS(
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 28055676f74..9ff787282c2 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -324,7 +324,7 @@ lock_report_trx_id_insanity(
trx_id_t trx_id, /*!< in: trx id */
const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */
trx_id_t max_trx_id) /*!< in: trx_sys.get_max_trx_id() */
{
ut_ad(rec_offs_validate(rec, index, offsets));
@@ -348,7 +348,7 @@ lock_check_trx_id_sanity(
trx_id_t trx_id, /*!< in: trx id */
const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets) /*!< in: rec_get_offsets(rec, index) */
{
ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(!rec_is_metadata(rec, index));
@@ -374,7 +374,7 @@ lock_clust_rec_cons_read_sees(
const rec_t* rec, /*!< in: user record which should be read or
passed over by a read cursor */
dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ReadView* view) /*!< in: consistent read view */
{
ut_ad(dict_index_is_clust(index));
@@ -1205,7 +1205,7 @@ lock_sec_rec_some_has_impl(
trx_t* caller_trx,/*!<in/out: trx of current thread */
const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: secondary index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{
trx_t* trx;
trx_id_t max_trx_id;
@@ -4470,8 +4470,8 @@ static void lock_rec_print(FILE* file, const lock_t* lock, mtr_t& mtr)
putc('\n', file);
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
mtr.start();
@@ -4819,7 +4819,7 @@ lock_rec_queue_validate(
const buf_block_t* block, /*!< in: buffer block containing rec */
const rec_t* rec, /*!< in: record to look at */
const dict_index_t* index, /*!< in: index, or NULL if not known */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{
const lock_t* lock;
ulint heap_no;
@@ -4986,8 +4986,8 @@ lock_rec_validate_page(
ulint nth_bit = 0;
ulint i;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(!lock_mutex_own());
@@ -5356,8 +5356,8 @@ lock_rec_insert_check_and_lock(
#ifdef UNIV_DEBUG
{
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- const ulint* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ const offset_t* offsets;
rec_offs_init(offsets_);
offsets = rec_get_offsets(next_rec, index, offsets_, true,
@@ -5516,7 +5516,7 @@ lock_rec_convert_impl_to_expl(
const buf_block_t* block,
const rec_t* rec,
dict_index_t* index,
- const ulint* offsets)
+ const offset_t* offsets)
{
trx_t* trx;
@@ -5587,7 +5587,7 @@ lock_clust_rec_modify_check_and_lock(
const rec_t* rec, /*!< in: record which should be
modified */
dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */
{
dberr_t err;
@@ -5679,8 +5679,8 @@ lock_sec_rec_modify_check_and_lock(
#ifdef UNIV_DEBUG
{
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- const ulint* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ const offset_t* offsets;
rec_offs_init(offsets_);
offsets = rec_get_offsets(rec, index, offsets_, true,
@@ -5724,7 +5724,7 @@ lock_sec_rec_read_check_and_lock(
be read or passed over by a
read cursor */
dict_index_t* index, /*!< in: secondary index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
lock_mode mode, /*!< in: mode of the lock which
the read cursor should set on
records: LOCK_S or LOCK_X; the
@@ -5794,7 +5794,7 @@ lock_clust_rec_read_check_and_lock(
be read or passed over by a
read cursor */
dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
lock_mode mode, /*!< in: mode of the lock which
the read cursor should set on
records: LOCK_S or LOCK_X; the
@@ -5872,8 +5872,8 @@ lock_clust_rec_read_check_and_lock_alt(
que_thr_t* thr) /*!< in: query thread */
{
mem_heap_t* tmp_heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
dberr_t err;
rec_offs_init(offsets_);
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index e8a890de406..862c5636c53 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -763,7 +763,6 @@ recv_sys_var_init(void)
recv_previous_parsed_rec_type = MLOG_SINGLE_REC_FLAG;
recv_previous_parsed_rec_offset = 0;
recv_previous_parsed_rec_is_multi = 0;
- recv_n_pool_free_frames = 256;
recv_max_page_lsn = 0;
}
@@ -843,18 +842,14 @@ recv_sys_init()
recv_sys->flush_end = os_event_create(0);
}
- ulint size = buf_pool_get_curr_size();
- /* Set appropriate value of recv_n_pool_free_frames. */
- if (size >= 10 << 20) {
- /* Buffer pool of size greater than 10 MB. */
- recv_n_pool_free_frames = 512;
- }
+ recv_n_pool_free_frames =
+ buf_pool_get_n_pages() / 3;
recv_sys->buf = static_cast<byte*>(
ut_malloc_dontdump(RECV_PARSING_BUF_SIZE));
recv_sys->buf_size = RECV_PARSING_BUF_SIZE;
- recv_sys->addr_hash = hash_create(size / 512);
+ recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 512);
recv_sys->progress_time = time(NULL);
recv_max_page_lsn = 0;
@@ -2719,14 +2714,40 @@ recv_mlog_index_load(ulint space_id, ulint page_no, lsn_t lsn)
}
}
+/** Check whether read redo log memory exceeds the available memory
+of buffer pool. Store last_stored_lsn if it is not in last phase
+@param[in] store whether to store page operations
+@param[in] available_mem Available memory in buffer pool to
+ read redo logs. */
+static bool recv_sys_heap_check(store_t* store, ulint available_mem)
+{
+ if (*store != STORE_NO
+ && mem_heap_get_size(recv_sys->heap) >= available_mem)
+ {
+ if (*store == STORE_YES)
+ recv_sys->last_stored_lsn= recv_sys->recovered_lsn;
+
+ *store= STORE_NO;
+ DBUG_PRINT("ib_log",("Ran out of memory and last "
+ "stored lsn " LSN_PF " last stored offset "
+ ULINTPF "\n",recv_sys->recovered_lsn,
+ recv_sys->recovered_offset));
+ return true;
+ }
+
+ return false;
+}
+
/** Parse log records from a buffer and optionally store them to a
hash table to wait merging to file pages.
-@param[in] checkpoint_lsn the LSN of the latest checkpoint
-@param[in] store whether to store page operations
-@param[in] apply whether to apply the records
+@param[in] checkpoint_lsn the LSN of the latest checkpoint
+@param[in] store whether to store page operations
+@param[in] available_mem memory to read the redo logs
+@param[in] apply whether to apply the records
@return whether MLOG_CHECKPOINT record was seen the first time,
or corruption was noticed */
-bool recv_parse_log_recs(lsn_t checkpoint_lsn, store_t store, bool apply)
+bool recv_parse_log_recs(lsn_t checkpoint_lsn, store_t* store,
+ ulint available_mem, bool apply)
{
byte* ptr;
byte* end_ptr;
@@ -2738,6 +2759,7 @@ bool recv_parse_log_recs(lsn_t checkpoint_lsn, store_t store, bool apply)
ulint space;
ulint page_no;
byte* body;
+ const bool last_phase = (*store == STORE_IF_EXISTS);
ut_ad(log_mutex_own());
ut_ad(mutex_own(&recv_sys->mutex));
@@ -2752,6 +2774,12 @@ loop:
return(false);
}
+ /* Check for memory overflow and ignore the parsing of remaining
+ redo log records if InnoDB ran out of memory */
+ if (recv_sys_heap_check(store, available_mem) && last_phase) {
+ return false;
+ }
+
switch (*ptr) {
case MLOG_CHECKPOINT:
#ifdef UNIV_LOG_LSN_DEBUG
@@ -2852,7 +2880,7 @@ loop:
break;
#endif /* UNIV_LOG_LSN_DEBUG */
default:
- switch (store) {
+ switch (*store) {
case STORE_NO:
break;
case STORE_IF_EXISTS:
@@ -3036,7 +3064,7 @@ corrupted_log:
recv_parse_or_apply_log_rec_body(). */
break;
default:
- switch (store) {
+ switch (*store) {
case STORE_NO:
break;
case STORE_IF_EXISTS:
@@ -3079,7 +3107,6 @@ bool recv_sys_add_to_parsing_buf(const byte* log_block, lsn_t scanned_lsn)
if (!recv_sys->parse_start_lsn) {
/* Cannot start parsing yet because no start point for
it found */
-
return(false);
}
@@ -3100,7 +3127,6 @@ bool recv_sys_add_to_parsing_buf(const byte* log_block, lsn_t scanned_lsn)
}
if (more_len == 0) {
-
return(false);
}
@@ -3135,8 +3161,9 @@ bool recv_sys_add_to_parsing_buf(const byte* log_block, lsn_t scanned_lsn)
/** Moves the parsing buffer data left to the buffer start. */
void recv_sys_justify_left_parsing_buf()
{
- ut_memmove(recv_sys->buf, recv_sys->buf + recv_sys->recovered_offset,
- recv_sys->len - recv_sys->recovered_offset);
+ memmove(recv_sys->buf,
+ recv_sys->buf + recv_sys->recovered_offset,
+ recv_sys->len - recv_sys->recovered_offset);
recv_sys->len -= recv_sys->recovered_offset;
@@ -3146,26 +3173,30 @@ void recv_sys_justify_left_parsing_buf()
/** Scan redo log from a buffer and stores new log data to the parsing buffer.
Parse and hash the log records if new data found.
Apply log records automatically when the hash table becomes full.
+@param[in] available_mem we let the hash table of recs to
+ grow to this size, at the maximum
+@param[in,out] store_to_hash whether the records should be
+ stored to the hash table; this is
+ reset if just debug checking is
+ needed, or when the available_mem
+ runs out
+@param[in] log_block log segment
+@param[in] checkpoint_lsn latest checkpoint LSN
+@param[in] start_lsn buffer start LSN
+@param[in] end_lsn buffer end LSN
+@param[in,out] contiguous_lsn it is known that all groups contain
+ contiguous log data upto this lsn
+@param[out] group_scanned_lsn scanning succeeded upto this lsn
@return true if not able to scan any more in this log group */
-static
-bool
-recv_scan_log_recs(
-/*===============*/
- ulint available_memory,/*!< in: we let the hash table of recs
- to grow to this size, at the maximum */
- store_t* store_to_hash, /*!< in,out: whether the records should be
- stored to the hash table; this is reset
- if just debug checking is needed, or
- when the available_memory runs out */
- const byte* log_block, /*!< in: log segment */
- lsn_t checkpoint_lsn, /*!< in: latest checkpoint LSN */
- lsn_t start_lsn, /*!< in: buffer start LSN */
- lsn_t end_lsn, /*!< in: buffer end LSN */
- lsn_t* contiguous_lsn, /*!< in/out: it is known that all log
- groups contain contiguous log data up
- to this lsn */
- lsn_t* group_scanned_lsn)/*!< out: scanning succeeded up to
- this lsn */
+static bool recv_scan_log_recs(
+ ulint available_mem,
+ store_t* store_to_hash,
+ const byte* log_block,
+ lsn_t checkpoint_lsn,
+ lsn_t start_lsn,
+ lsn_t end_lsn,
+ lsn_t* contiguous_lsn,
+ lsn_t* group_scanned_lsn)
{
lsn_t scanned_lsn = start_lsn;
bool finished = false;
@@ -3173,14 +3204,13 @@ recv_scan_log_recs(
bool more_data = false;
bool apply = recv_sys->mlog_checkpoint_lsn != 0;
ulint recv_parsing_buf_size = RECV_PARSING_BUF_SIZE;
-
+ const bool last_phase = (*store_to_hash == STORE_IF_EXISTS);
ut_ad(start_lsn % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(end_lsn % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(end_lsn >= start_lsn + OS_FILE_LOG_BLOCK_SIZE);
const byte* const log_end = log_block
+ ulint(end_lsn - start_lsn);
-
do {
ut_ad(!finished);
@@ -3291,6 +3321,13 @@ recv_scan_log_recs(
= log_block_get_checkpoint_no(log_block);
}
+ /* During last phase of scanning, there can be redo logs
+ left in recv_sys->buf to parse & store it in recv_sys->heap */
+ if (last_phase
+ && recv_sys->recovered_lsn < recv_sys->scanned_lsn) {
+ more_data = true;
+ }
+
if (data_len < OS_FILE_LOG_BLOCK_SIZE) {
/* Log data for this group ends here */
finished = true;
@@ -3308,7 +3345,8 @@ recv_scan_log_recs(
/* Try to parse more log records */
if (recv_parse_log_recs(checkpoint_lsn,
- *store_to_hash, apply)) {
+ store_to_hash, available_mem,
+ apply)) {
ut_ad(recv_sys->found_corrupt_log
|| recv_sys->found_corrupt_fs
|| recv_sys->mlog_checkpoint_lsn
@@ -3317,22 +3355,18 @@ recv_scan_log_recs(
goto func_exit;
}
- if (*store_to_hash != STORE_NO
- && mem_heap_get_size(recv_sys->heap) > available_memory) {
-
- DBUG_PRINT("ib_log", ("Ran out of memory and last "
- "stored lsn " LSN_PF,
- recv_sys->recovered_lsn));
-
- recv_sys->last_stored_lsn = recv_sys->recovered_lsn;
- *store_to_hash = STORE_NO;
- }
+ recv_sys_heap_check(store_to_hash, available_mem);
if (recv_sys->recovered_offset > recv_parsing_buf_size / 4) {
/* Move parsing buffer data to the buffer start */
-
recv_sys_justify_left_parsing_buf();
}
+
+ /* Need to re-parse the redo log which're stored
+ in recv_sys->buf */
+ if (last_phase && *store_to_hash == STORE_NO) {
+ finished = false;
+ }
}
func_exit:
@@ -3394,6 +3428,8 @@ recv_group_scan_log_recs(
redo log records before we have
finished the redo log scan. */
recv_apply_hashed_log_recs(false);
+ /* Rescan the redo logs from last stored lsn */
+ end_lsn = recv_sys->recovered_lsn;
}
start_lsn = ut_uint64_align_down(end_lsn,
diff --git a/storage/innobase/mem/mem0mem.cc b/storage/innobase/mem/mem0mem.cc
index a298a7c0b2f..15dee37cc1f 100644
--- a/storage/innobase/mem/mem0mem.cc
+++ b/storage/innobase/mem/mem0mem.cc
@@ -210,8 +210,6 @@ mem_heap_validate(
block != NULL;
block = UT_LIST_GET_NEXT(list, block)) {
- mem_block_validate(block);
-
switch (block->type) {
case MEM_HEAP_DYNAMIC:
break;
@@ -266,7 +264,6 @@ mem_heap_create_block_func(
|| (type == MEM_HEAP_BUFFER + MEM_HEAP_BTR_SEARCH));
if (heap != NULL) {
- mem_block_validate(heap);
ut_d(mem_heap_validate(heap));
}
@@ -308,7 +305,6 @@ mem_heap_create_block_func(
block->buf_block = buf_block;
block->free_block = NULL;
- block->magic_n = MEM_BLOCK_MAGIC_N;
ut_d(ut_strlcpy_rev(block->file_name, file_name,
sizeof(block->file_name)));
ut_d(block->line = line);
@@ -356,8 +352,6 @@ mem_heap_add_block(
mem_block_t* new_block;
ulint new_size;
- ut_d(mem_block_validate(heap));
-
block = UT_LIST_GET_LAST(heap->base);
/* We have to allocate a new block. The size is always at least
@@ -410,8 +404,6 @@ mem_heap_block_free(
buf_block = static_cast<buf_block_t*>(block->buf_block);
- mem_block_validate(block);
-
UT_LIST_REMOVE(heap->base, block);
ut_ad(heap->total_size >= block->len);
@@ -419,7 +411,6 @@ mem_heap_block_free(
type = heap->type;
len = block->len;
- block->magic_n = MEM_FREED_BLOCK_MAGIC_N;
if (type == MEM_HEAP_DYNAMIC || len < srv_page_size / 2) {
ut_ad(!buf_block);
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 0f6c56a4a03..9a1276ef364 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -1,8 +1,8 @@
/***********************************************************************
-Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2019, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2019, MariaDB Corporation.
+Copyright (c) 2013, 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted
by Percona Inc.. Those modifications are
@@ -413,7 +413,7 @@ public:
/** Accessor for the AIO context
@param[in] segment Segment for which to get the context
@return the AIO context for the segment */
- io_context* io_ctx(ulint segment)
+ io_context_t io_ctx(ulint segment)
MY_ATTRIBUTE((warn_unused_result))
{
ut_ad(segment < get_n_segments());
@@ -421,11 +421,11 @@ public:
return(m_aio_ctx[segment]);
}
- /** Creates an io_context for native linux AIO.
+ /** Creates an io_context_t for native linux AIO.
@param[in] max_events number of events
@param[out] io_ctx io_ctx to initialize.
@return true on success. */
- static bool linux_create_io_ctx(unsigned max_events, io_context_t* io_ctx)
+ static bool linux_create_io_ctx(unsigned max_events, io_context_t& io_ctx)
MY_ATTRIBUTE((warn_unused_result));
/** Checks if the system supports native linux aio. On some kernel
@@ -622,7 +622,7 @@ private:
/** completion queue for IO. There is one such queue per
segment. Each thread will work on one ctx exclusively. */
- io_context_t* m_aio_ctx;
+ std::vector<io_context_t> m_aio_ctx;
/** The array to collect completed IOs. There is one such
event for each possible pending IO. The size of the array
@@ -1470,6 +1470,12 @@ os_file_get_parent_dir(
return(NULL);
}
+ if (last_slash - path < 0) {
+ /* Sanity check, it prevents gcc from trying to handle this case which
+ * results in warnings for some optimized builds */
+ return (NULL);
+ }
+
/* Non-trivial directory component */
return(mem_strdupl(path, ulint(last_slash - path)));
@@ -1788,10 +1794,14 @@ LinuxAIOHandler::resubmit(Slot* slot)
iocb->data = slot;
+ ut_a(reinterpret_cast<size_t>(iocb->u.c.buf) % OS_FILE_LOG_BLOCK_SIZE
+ == 0);
+
/* Resubmit an I/O request */
int ret = io_submit(m_array->io_ctx(m_segment), 1, &iocb);
+ ut_a(ret != -EINVAL);
- if (ret < -1) {
+ if (ret < 0) {
errno = -ret;
}
@@ -1892,8 +1902,8 @@ LinuxAIOHandler::collect()
ut_ad(m_array != NULL);
ut_ad(m_segment < m_array->get_n_segments());
- /* Which io_context we are going to use. */
- io_context* io_ctx = m_array->io_ctx(m_segment);
+ /* Which io_context_t we are going to use. */
+ io_context_t io_ctx = m_array->io_ctx(m_segment);
/* Starting point of the m_segment we will be working on. */
ulint start_pos = m_segment * m_n_slots;
@@ -1920,6 +1930,8 @@ LinuxAIOHandler::collect()
int ret;
ret = io_getevents(io_ctx, 1, m_n_slots, events, &timeout);
+ ut_a(ret != -EINVAL);
+ ut_ad(ret != -EFAULT);
for (int i = 0; i < ret; ++i) {
@@ -2146,14 +2158,18 @@ AIO::linux_dispatch(Slot* slot)
/* Find out what we are going to work with.
The iocb struct is directly in the slot.
- The io_context is one per segment. */
+ The io_context_t is one per segment. */
ulint io_ctx_index;
struct iocb* iocb = &slot->control;
io_ctx_index = (slot->pos * m_n_segments) / m_slots.size();
- int ret = io_submit(m_aio_ctx[io_ctx_index], 1, &iocb);
+ ut_a(reinterpret_cast<size_t>(iocb->u.c.buf) % OS_FILE_LOG_BLOCK_SIZE
+ == 0);
+
+ int ret = io_submit(io_ctx(io_ctx_index), 1, &iocb);
+ ut_a(ret != -EINVAL);
/* io_submit() returns number of successfully queued requests
or -errno. */
@@ -2165,25 +2181,26 @@ AIO::linux_dispatch(Slot* slot)
return(ret == 1);
}
-/** Creates an io_context for native linux AIO.
+/** Creates an io_context_t for native linux AIO.
@param[in] max_events number of events
@param[out] io_ctx io_ctx to initialize.
@return true on success. */
bool
AIO::linux_create_io_ctx(
unsigned max_events,
- io_context_t* io_ctx)
+ io_context_t& io_ctx)
{
ssize_t n_retries = 0;
for (;;) {
- memset(io_ctx, 0x0, sizeof(*io_ctx));
+ memset(&io_ctx, 0x0, sizeof(io_ctx));
/* Initialize the io_ctx. Tell it how many pending
IO requests this context will handle. */
- int ret = io_setup(max_events, io_ctx);
+ int ret = io_setup(max_events, &io_ctx);
+ ut_a(ret != -EINVAL);
if (ret == 0) {
/* Success. Return now. */
@@ -2262,7 +2279,7 @@ AIO::is_linux_native_aio_supported()
io_context_t io_ctx;
char name[1000];
- if (!linux_create_io_ctx(1, &io_ctx)) {
+ if (!linux_create_io_ctx(1, io_ctx)) {
/* The platform does not support native aio. */
@@ -2278,6 +2295,10 @@ AIO::is_linux_native_aio_supported()
<< "Unable to create temp file to check"
" native AIO support.";
+ int ret = io_destroy(io_ctx);
+ ut_a(ret != -EINVAL);
+ ut_ad(ret != -EFAULT);
+
return(false);
}
} else {
@@ -2307,6 +2328,10 @@ AIO::is_linux_native_aio_supported()
<< " \"" << name << "\" to check native"
<< " AIO read support.";
+ int ret = io_destroy(io_ctx);
+ ut_a(ret != EINVAL);
+ ut_ad(ret != EFAULT);
+
return(false);
}
}
@@ -2335,11 +2360,15 @@ AIO::is_linux_native_aio_supported()
io_prep_pread(p_iocb, fd, ptr, 512, 0);
}
+ ut_a(reinterpret_cast<size_t>(p_iocb->u.c.buf) % OS_FILE_LOG_BLOCK_SIZE
+ == 0);
int err = io_submit(io_ctx, 1, &p_iocb);
+ ut_a(err != -EINVAL);
if (err >= 1) {
/* Now collect the submitted IO request. */
err = io_getevents(io_ctx, 1, 1, &io_event, NULL);
+ ut_a(err != -EINVAL);
}
ut_free(buf);
@@ -2347,7 +2376,13 @@ AIO::is_linux_native_aio_supported()
switch (err) {
case 1:
- return(true);
+ {
+ int ret = io_destroy(io_ctx);
+ ut_a(ret != -EINVAL);
+ ut_ad(ret != -EFAULT);
+
+ return(true);
+ }
case -EINVAL:
case -ENOSYS:
@@ -2367,6 +2402,10 @@ AIO::is_linux_native_aio_supported()
<< "returned error[" << -err << "]";
}
+ int ret = io_destroy(io_ctx);
+ ut_a(ret != -EINVAL);
+ ut_ad(ret != -EFAULT);
+
return(false);
}
@@ -5723,8 +5762,7 @@ AIO::AIO(
m_n_segments(segments),
m_n_reserved()
# ifdef LINUX_NATIVE_AIO
- ,m_aio_ctx(),
- m_events(m_slots.size())
+ ,m_events(m_slots.size())
# endif /* LINUX_NATIVE_AIO */
#ifdef WIN_ASYNC_IO
,m_completion_port(new_completion_port())
@@ -5780,29 +5818,20 @@ AIO::init_slots()
dberr_t
AIO::init_linux_native_aio()
{
- /* Initialize the io_context array. One io_context
- per segment in the array. */
-
- ut_a(m_aio_ctx == NULL);
-
- m_aio_ctx = static_cast<io_context**>(
- ut_zalloc_nokey(m_n_segments * sizeof(*m_aio_ctx)));
- if (m_aio_ctx == NULL) {
- return(DB_OUT_OF_MEMORY);
- }
+ /* Initialize the io_context_t array. One io_context_t
+ per segment in the array. */
+ m_aio_ctx.resize(get_n_segments());
- io_context** ctx = m_aio_ctx;
ulint max_events = slots_per_segment();
- for (ulint i = 0; i < m_n_segments; ++i, ++ctx) {
+ for (std::vector<io_context_t>::iterator it = m_aio_ctx.begin(),
+ end = m_aio_ctx.end();
+ it != end; ++it) {
- if (!linux_create_io_ctx(max_events, ctx)) {
+ if (!linux_create_io_ctx(max_events, *it)) {
/* If something bad happened during aio setup
we disable linux native aio.
- The disadvantage will be a small memory leak
- at shutdown but that's ok compared to a crash
- or a not working server.
This frequently happens when running the test suite
with many threads on a system with low fs.aio-max-nr!
*/
@@ -5814,8 +5843,15 @@ AIO::init_linux_native_aio()
<< "try increasing system "
<< "fs.aio-max-nr to 1048576 or larger or "
<< "setting innodb_use_native_aio = 0 in my.cnf";
- ut_free(m_aio_ctx);
- m_aio_ctx = 0;
+
+ for (std::vector<io_context_t>::iterator it2
+ = m_aio_ctx.begin();
+ it2 != it; ++it2) {
+ int ret = io_destroy(*it2);
+ ut_a(ret != -EINVAL);
+ }
+
+ m_aio_ctx.clear();
srv_use_native_aio = FALSE;
return(DB_SUCCESS);
}
@@ -5891,15 +5927,15 @@ AIO::~AIO()
#if defined(LINUX_NATIVE_AIO)
if (srv_use_native_aio) {
- m_events.clear();
- ut_free(m_aio_ctx);
+ for (ulint i = 0; i < m_aio_ctx.size(); i++) {
+ int ret = io_destroy(m_aio_ctx[i]);
+ ut_a(ret != -EINVAL);
+ }
}
#endif /* LINUX_NATIVE_AIO */
#if defined(WIN_ASYNC_IO)
CloseHandle(m_completion_port);
#endif
-
- m_slots.clear();
}
/** Initializes the asynchronous io system. Creates one array each for ibuf
@@ -6193,6 +6229,10 @@ AIO::reserve_slot(
os_offset_t offset,
ulint len)
{
+ ut_ad(reinterpret_cast<size_t>(buf) % OS_FILE_LOG_BLOCK_SIZE == 0);
+ ut_ad(offset % OS_FILE_LOG_BLOCK_SIZE == 0);
+ ut_ad(len % OS_FILE_LOG_BLOCK_SIZE == 0);
+
#ifdef WIN_ASYNC_IO
ut_a((len & 0xFFFFFFFFUL) == len);
#endif /* WIN_ASYNC_IO */
diff --git a/storage/innobase/os/os0proc.cc b/storage/innobase/os/os0proc.cc
index 70f389436fa..60057880c18 100644
--- a/storage/innobase/os/os0proc.cc
+++ b/storage/innobase/os/os0proc.cc
@@ -157,6 +157,12 @@ os_mem_free_large(
{
ut_a(os_total_large_mem_allocated >= size);
+ // We could have manually poisoned that memory for ASAN.
+ // And we must unpoison it by ourself as specified in documentation
+ // for __asan_poison_memory_region() in sanitizer/asan_interface.h
+ // munmap() doesn't do it for us automatically.
+ UNIV_MEM_ALLOC(ptr, size);
+
#ifdef HAVE_LINUX_LARGE_PAGES
if (my_use_large_pages && opt_large_page_size && !shmdt(ptr)) {
my_atomic_addlint(
diff --git a/storage/innobase/os/os0thread.cc b/storage/innobase/os/os0thread.cc
index f9982bfc9ca..0c97ebccc1b 100644
--- a/storage/innobase/os/os0thread.cc
+++ b/storage/innobase/os/os0thread.cc
@@ -125,11 +125,17 @@ os_thread_create_func(
pthread_attr_t attr;
- pthread_attr_init(&attr);
+ int ret = pthread_attr_init(&attr);
+ if (UNIV_UNLIKELY(ret)) {
+ fprintf(stderr,
+ "InnoDB: Error: pthread_attr_init() returned %d\n",
+ ret);
+ abort();
+ }
my_atomic_addlint(&os_thread_count, 1);
- int ret = pthread_create(&new_thread_id, &attr, func, arg);
+ ret = pthread_create(&new_thread_id, &attr, func, arg);
ut_a(ret == 0);
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
index 204fedf9d29..16f0495527d 100644
--- a/storage/innobase/page/page0cur.cc
+++ b/storage/innobase/page/page0cur.cc
@@ -35,38 +35,6 @@ Created 10/4/1994 Heikki Tuuri
#include <algorithm>
-/*******************************************************************//**
-This is a linear congruential generator PRNG. Returns a pseudo random
-number between 0 and 2^64-1 inclusive. The formula and the constants
-being used are:
-X[n+1] = (a * X[n] + c) mod m
-where:
-X[0] = my_interval_timer()
-a = 1103515245 (3^5 * 5 * 7 * 129749)
-c = 12345 (3 * 5 * 823)
-m = 18446744073709551616 (2^64)
-
-@return number between 0 and 2^64-1 */
-static
-ib_uint64_t
-page_cur_lcg_prng(void)
-/*===================*/
-{
-#define LCG_a 1103515245
-#define LCG_c 12345
- static uint64_t lcg_current;
-
- if (!lcg_current) {
- lcg_current = my_interval_timer();
- }
-
- /* no need to "% 2^64" explicitly because lcg_current is
- 64 bit and this will be done anyway */
- lcg_current = LCG_a * lcg_current + LCG_c;
-
- return(lcg_current);
-}
-
#ifdef BTR_CUR_HASH_ADAPT
# ifdef UNIV_SEARCH_PERF_STAT
static ulint page_cur_short_succ;
@@ -99,8 +67,8 @@ page_cur_try_search_shortcut(
ibool success = FALSE;
const page_t* page = buf_block_get_frame(block);
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(dtuple_check_typed(tuple));
@@ -183,8 +151,8 @@ page_cur_try_search_shortcut_bytes(
ibool success = FALSE;
const page_t* page = buf_block_get_frame(block);
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(dtuple_check_typed(tuple));
@@ -255,7 +223,7 @@ page_cur_rec_field_extends(
/*=======================*/
const dtuple_t* tuple, /*!< in: data tuple */
const rec_t* rec, /*!< in: record */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: compare nth field */
{
const dtype_t* type;
@@ -331,8 +299,8 @@ page_cur_search_with_match(
const page_zip_des_t* page_zip = buf_block_get_page_zip(block);
#endif /* UNIV_ZIP_DEBUG */
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(dtuple_validate(tuple));
@@ -590,8 +558,8 @@ page_cur_search_with_match_bytes(
const page_zip_des_t* page_zip = buf_block_get_page_zip(block);
#endif /* UNIV_ZIP_DEBUG */
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(dtuple_validate(tuple));
@@ -803,8 +771,7 @@ page_cur_open_on_rnd_user_rec(
buf_block_t* block, /*!< in: page */
page_cur_t* cursor) /*!< out: page cursor */
{
- ulint rnd;
- ulint n_recs = page_get_n_recs(buf_block_get_frame(block));
+ const ulint n_recs = page_get_n_recs(block->frame);
page_cur_set_before_first(block, cursor);
@@ -813,11 +780,8 @@ page_cur_open_on_rnd_user_rec(
return;
}
- rnd = (ulint) (page_cur_lcg_prng() % n_recs);
-
- do {
- page_cur_move_to_next(cursor);
- } while (rnd--);
+ cursor->rec = page_rec_get_nth(block->frame,
+ ut_rnd_interval(n_recs) + 1);
}
/** Write a redo log record of inserting a record into an index page.
@@ -857,11 +821,11 @@ page_cur_insert_rec_write_log(
{
mem_heap_t* heap = NULL;
- ulint cur_offs_[REC_OFFS_NORMAL_SIZE];
- ulint ins_offs_[REC_OFFS_NORMAL_SIZE];
+ offset_t cur_offs_[REC_OFFS_NORMAL_SIZE];
+ offset_t ins_offs_[REC_OFFS_NORMAL_SIZE];
- ulint* cur_offs;
- ulint* ins_offs;
+ offset_t* cur_offs;
+ offset_t* ins_offs;
rec_offs_init(cur_offs_);
rec_offs_init(ins_offs_);
@@ -1037,8 +1001,8 @@ page_cur_parse_insert_rec(
ulint info_and_status_bits = 0; /* remove warning */
page_cur_t cursor;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
page = block ? buf_block_get_frame(block) : NULL;
@@ -1255,7 +1219,7 @@ page_cur_insert_rec_low(
which the new record is inserted */
dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */
- ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
{
byte* insert_buf;
@@ -1306,8 +1270,8 @@ page_cur_insert_rec_low(
free_rec = page_header_get_ptr(page, PAGE_FREE);
if (UNIV_LIKELY_NULL(free_rec)) {
/* Try to allocate from the head of the free list. */
- ulint foffsets_[REC_OFFS_NORMAL_SIZE];
- ulint* foffsets = foffsets_;
+ offset_t foffsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* foffsets = foffsets_;
mem_heap_t* heap = NULL;
rec_offs_init(foffsets_);
@@ -1478,7 +1442,7 @@ page_cur_insert_rec_zip(
page_cur_t* cursor, /*!< in/out: page cursor */
dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */
- ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
{
byte* insert_buf;
@@ -1719,8 +1683,8 @@ page_cur_insert_rec_zip(
if (UNIV_LIKELY_NULL(free_rec)) {
/* Try to allocate from the head of the free list. */
lint extra_size_diff;
- ulint foffsets_[REC_OFFS_NORMAL_SIZE];
- ulint* foffsets = foffsets_;
+ offset_t foffsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* foffsets = foffsets_;
mem_heap_t* heap = NULL;
rec_offs_init(foffsets_);
@@ -2042,8 +2006,8 @@ page_copy_rec_list_end_to_created_page(
byte* log_ptr;
ulint log_data_len;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(page_dir_get_n_heap(new_page) == PAGE_HEAP_NO_USER_LOW);
@@ -2266,7 +2230,7 @@ page_cur_parse_delete_rec(
if (block) {
page_t* page = buf_block_get_frame(block);
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_t* rec = page + offset;
rec_offs_init(offsets_);
@@ -2294,7 +2258,7 @@ page_cur_delete_rec(
/*================*/
page_cur_t* cursor, /*!< in/out: a page cursor */
const dict_index_t* index, /*!< in: record descriptor */
- const ulint* offsets,/*!< in: rec_get_offsets(
+ const offset_t* offsets,/*!< in: rec_get_offsets(
cursor->rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle
or NULL */
@@ -2430,18 +2394,17 @@ page_cur_delete_rec(
#ifdef UNIV_COMPILE_TEST_FUNCS
/*******************************************************************//**
-Print the first n numbers, generated by page_cur_lcg_prng() to make sure
+Print the first n numbers, generated by ut_rnd_gen() to make sure
(visually) that it works properly. */
void
-test_page_cur_lcg_prng(
-/*===================*/
+test_ut_rnd_gen(
int n) /*!< in: print first n numbers */
{
int i;
unsigned long long rnd;
for (i = 0; i < n; i++) {
- rnd = page_cur_lcg_prng();
+ rnd = ut_rnd_gen();
printf("%llu\t%%2=%llu %%3=%llu %%5=%llu %%7=%llu %%11=%llu\n",
rnd,
rnd % 2,
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc
index 77bdbf8bf2c..a916effa9b8 100644
--- a/storage/innobase/page/page0page.cc
+++ b/storage/innobase/page/page0page.cc
@@ -36,6 +36,7 @@ Created 2/2/1994 Heikki Tuuri
#include "fut0lst.h"
#include "btr0sea.h"
#include "trx0sys.h"
+#include <algorithm>
/* THE INDEX PAGE
==============
@@ -581,8 +582,8 @@ page_copy_rec_list_end_no_locks(
page_cur_t cur1;
rec_t* cur2;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
page_cur_position(rec, block, &cur1);
@@ -814,8 +815,8 @@ page_copy_rec_list_start(
rtr_rec_move_t* rec_move = NULL;
rec_t* ret
= page_rec_get_prev(page_get_supremum_rec(new_page));
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
/* Here, "ret" may be pointing to a user record or the
@@ -1051,8 +1052,8 @@ page_delete_rec_list_end(
page_zip_des_t* page_zip = buf_block_get_page_zip(block);
page_t* page = page_align(rec);
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(size == ULINT_UNDEFINED || size < srv_page_size);
@@ -1253,8 +1254,8 @@ page_delete_rec_list_start(
mtr_t* mtr) /*!< in: mtr */
{
page_cur_t cur1;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
mem_heap_t* heap = NULL;
rec_offs_init(offsets_);
@@ -1741,7 +1742,7 @@ void
page_rec_print(
/*===========*/
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: record descriptor */
+ const offset_t* offsets)/*!< in: record descriptor */
{
ut_a(!page_rec_is_comp(rec) == !rec_offs_comp(offsets));
rec_print_new(stderr, rec, offsets);
@@ -1816,8 +1817,8 @@ page_print_list(
ulint count;
ulint n_recs;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_a((ibool)!!page_is_comp(page) == dict_table_is_comp(index->table));
@@ -1927,7 +1928,7 @@ ibool
page_rec_validate(
/*==============*/
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ulint n_owned;
ulint heap_no;
@@ -2412,8 +2413,13 @@ bool page_validate(const page_t* page, const dict_index_t* index)
ulint n_slots;
ibool ret = TRUE;
ulint i;
- ulint* offsets = NULL;
- ulint* old_offsets = NULL;
+ offset_t offsets_1[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_2[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_1;
+ offset_t* old_offsets = offsets_2;
+
+ rec_offs_init(offsets_1);
+ rec_offs_init(offsets_2);
#ifdef UNIV_GIS_DEBUG
if (dict_index_is_spatial(index)) {
@@ -2680,11 +2686,7 @@ next_rec:
}
/* set old_offsets to offsets; recycle offsets */
- {
- ulint* offs = old_offsets;
- old_offsets = offsets;
- offsets = offs;
- }
+ std::swap(old_offsets, offsets);
}
if (page_is_comp(page)) {
@@ -2845,7 +2847,7 @@ page_delete_rec(
page_zip/*!< in: compressed page descriptor */
#endif
,
- const ulint* offsets)/*!< in: offsets for record */
+ const offset_t* offsets)/*!< in: offsets for record */
{
bool no_compress_needed;
buf_block_t* block = pcur->block;
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index eb38b16c2d9..645032da3c2 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -2,7 +2,7 @@
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2014, 2019, MariaDB Corporation.
+Copyright (c) 2014, 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
@@ -878,7 +878,7 @@ page_zip_compress_node_ptrs(
mem_heap_t* heap) /*!< in: temporary memory heap */
{
int err = Z_OK;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
do {
const rec_t* rec = *recs++;
@@ -983,7 +983,7 @@ page_zip_compress_clust_ext(
FILE_LOGFILE
z_stream* c_stream, /*!< in/out: compressed page stream */
const rec_t* rec, /*!< in: record */
- const ulint* offsets, /*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
ulint trx_id_col, /*!< in: position of of DB_TRX_ID */
byte* deleted, /*!< in: dense directory entry pointing
to the head of the free list */
@@ -1122,7 +1122,7 @@ page_zip_compress_clust(
mem_heap_t* heap) /*!< in: temporary memory heap */
{
int err = Z_OK;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
/* BTR_EXTERN_FIELD_REF storage */
byte* externs = storage - n_dense
* (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN);
@@ -1985,7 +1985,7 @@ const byte*
page_zip_apply_log_ext(
/*===================*/
rec_t* rec, /*!< in/out: record */
- const ulint* offsets, /*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
ulint trx_id_col, /*!< in: position of of DB_TRX_ID */
const byte* data, /*!< in: modification log */
const byte* end) /*!< in: end of modification log */
@@ -2086,7 +2086,7 @@ page_zip_apply_log(
/*!< in: heap_no and status bits for
the next record to uncompress */
dict_index_t* index, /*!< in: index of the page */
- ulint* offsets)/*!< in/out: work area for
+ offset_t* offsets)/*!< in/out: work area for
rec_get_offsets_reverse() */
{
const byte* const end = data + size;
@@ -2154,7 +2154,7 @@ page_zip_apply_log(
if (val & 1) {
/* Clear the data bytes of the record. */
mem_heap_t* heap = NULL;
- ulint* offs;
+ offset_t* offs;
offs = rec_get_offsets(rec, index, offsets, is_leaf,
ULINT_UNDEFINED, &heap);
memset(rec, 0, rec_offs_data_size(offs));
@@ -2304,7 +2304,7 @@ page_zip_decompress_node_ptrs(
sorted by address */
ulint n_dense, /*!< in: size of recs[] */
dict_index_t* index, /*!< in: the index of the page */
- ulint* offsets, /*!< in/out: temporary offsets */
+ offset_t* offsets, /*!< in/out: temporary offsets */
mem_heap_t* heap) /*!< in: temporary memory heap */
{
ulint heap_status = REC_STATUS_NODE_PTR
@@ -2494,7 +2494,7 @@ page_zip_decompress_sec(
sorted by address */
ulint n_dense, /*!< in: size of recs[] */
dict_index_t* index, /*!< in: the index of the page */
- ulint* offsets) /*!< in/out: temporary offsets */
+ offset_t* offsets) /*!< in/out: temporary offsets */
{
ulint heap_status = REC_STATUS_ORDINARY
| PAGE_HEAP_NO_USER_LOW << REC_HEAP_NO_SHIFT;
@@ -2627,7 +2627,7 @@ page_zip_decompress_clust_ext(
/*==========================*/
z_stream* d_stream, /*!< in/out: compressed page stream */
rec_t* rec, /*!< in/out: record */
- const ulint* offsets, /*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
ulint trx_id_col) /*!< in: position of of DB_TRX_ID */
{
ulint i;
@@ -2742,7 +2742,7 @@ page_zip_decompress_clust(
ulint n_dense, /*!< in: size of recs[] */
dict_index_t* index, /*!< in: the index of the page */
ulint trx_id_col, /*!< index of the trx_id column */
- ulint* offsets, /*!< in/out: temporary offsets */
+ offset_t* offsets, /*!< in/out: temporary offsets */
mem_heap_t* heap) /*!< in: temporary memory heap */
{
int err;
@@ -3046,7 +3046,7 @@ page_zip_decompress_low(
ulint n_dense;/* number of user records on the page */
ulint trx_id_col = ULINT_UNDEFINED;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
ut_ad(page_zip_simple_validate(page_zip));
UNIV_MEM_ASSERT_W(page, srv_page_size);
@@ -3170,10 +3170,10 @@ zlib_error:
ulint n = 1 + 1/* node ptr */ + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
- offsets = static_cast<ulint*>(
+ offsets = static_cast<offset_t*>(
mem_heap_alloc(heap, n * sizeof(ulint)));
- *offsets = n;
+ rec_offs_set_n_alloc(offsets, n);
}
/* Decompress the records in heap_no order. */
@@ -3338,7 +3338,19 @@ page_zip_validate_low(
FIL_PAGE_LSN - FIL_PAGE_PREV)
|| memcmp(page_zip->data + FIL_PAGE_TYPE, page + FIL_PAGE_TYPE, 2)
|| memcmp(page_zip->data + FIL_PAGE_DATA, page + FIL_PAGE_DATA,
- PAGE_DATA - FIL_PAGE_DATA)) {
+ PAGE_ROOT_AUTO_INC)
+ /* The PAGE_ROOT_AUTO_INC can be updated while holding an SX-latch
+ on the clustered index root page (page number 3 in .ibd files).
+ That allows concurrent readers (holding buf_block_t::lock S-latch).
+ Because we do not know what type of a latch our caller is holding,
+ we will ignore the field on clustered index root pages in order
+ to avoid false positives. */
+ || (page_get_page_no(page) != 3/* clustered index root page */
+ && memcmp(&page_zip->data[FIL_PAGE_DATA + PAGE_ROOT_AUTO_INC],
+ &page[FIL_PAGE_DATA + PAGE_ROOT_AUTO_INC], 8))
+ || memcmp(&page_zip->data[FIL_PAGE_DATA + PAGE_HEADER_PRIV_END],
+ &page[FIL_PAGE_DATA + PAGE_HEADER_PRIV_END],
+ PAGE_DATA - FIL_PAGE_DATA - PAGE_HEADER_PRIV_END)) {
page_zip_fail(("page_zip_validate: page header\n"));
page_zip_hexdump(page_zip, sizeof *page_zip);
page_zip_hexdump(page_zip->data, page_zip_get_size(page_zip));
@@ -3398,7 +3410,7 @@ page_zip_validate_low(
committed. Let us tolerate that difference when we
are performing a sloppy validation. */
- ulint* offsets;
+ offset_t* offsets;
mem_heap_t* heap;
const rec_t* rec;
const rec_t* trec;
@@ -3422,11 +3434,12 @@ page_zip_validate_low(
differed. Let us ignore it. */
page_zip_fail(("page_zip_validate:"
" min_rec_flag"
- " (%s%lu,%lu,0x%02lx)\n",
+ " (%s" ULINTPF "," ULINTPF
+ ",0x%02x)\n",
sloppy ? "ignored, " : "",
page_get_space_id(page),
page_get_page_no(page),
- (ulong) page[offset]));
+ page[offset]));
/* We don't check for spatial index, since
the "minimum record" could be deleted when
doing rtr_update_mbr_field.
@@ -3565,7 +3578,7 @@ page_zip_write_rec_ext(
const page_t* page, /*!< in: page containing rec */
const byte* rec, /*!< in: record being written */
dict_index_t* index, /*!< in: record descriptor */
- const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */
ulint create, /*!< in: nonzero=insert, zero=update */
ulint trx_id_col, /*!< in: position of DB_TRX_ID */
ulint heap_no, /*!< in: heap number of rec */
@@ -3684,7 +3697,7 @@ page_zip_write_rec(
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record being written */
dict_index_t* index, /*!< in: the index the record belongs to */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint create) /*!< in: nonzero=insert, zero=update */
{
const page_t* page;
@@ -3934,7 +3947,7 @@ page_zip_write_blob_ptr(
const byte* rec, /*!< in/out: record whose data is being
written */
dict_index_t* index, /*!< in: index of the page */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint n, /*!< in: column index */
mtr_t* mtr) /*!< in: mini-transaction handle,
or NULL if no logging is needed */
@@ -4155,7 +4168,7 @@ void
page_zip_write_trx_id_and_roll_ptr(
page_zip_des_t* page_zip,
byte* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint trx_id_col,
trx_id_t trx_id,
roll_ptr_t roll_ptr,
@@ -4294,7 +4307,7 @@ page_zip_clear_rec(
page_zip_des_t* page_zip, /*!< in/out: compressed page */
byte* rec, /*!< in: record to clear */
const dict_index_t* index, /*!< in: index of rec */
- const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets) /*!< in: rec_get_offsets(rec, index) */
{
ulint heap_no;
page_t* page = page_align(rec);
@@ -4500,7 +4513,7 @@ page_zip_dir_delete(
page_zip_des_t* page_zip, /*!< in/out: compressed page */
byte* rec, /*!< in: deleted record */
const dict_index_t* index, /*!< in: index of rec */
- const ulint* offsets, /*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of
the free list */
{
diff --git a/storage/innobase/pars/lexyy.cc b/storage/innobase/pars/lexyy.cc
index e7f3981e0fe..1e93ec3ed50 100644
--- a/storage/innobase/pars/lexyy.cc
+++ b/storage/innobase/pars/lexyy.cc
@@ -356,8 +356,8 @@ static void yynoreturn yy_fatal_error ( const char* msg );
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 123
-#define YY_END_OF_BUFFER 124
+#define YY_NUM_RULES 102
+#define YY_END_OF_BUFFER 103
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -365,53 +365,42 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static const flex_int16_t yy_accept[404] =
+static const flex_int16_t yy_accept[307] =
{ 0,
- 0, 0, 118, 118, 0, 0, 0, 0, 124, 122,
- 121, 121, 8, 122, 113, 5, 102, 108, 111, 109,
- 106, 110, 122, 112, 1, 122, 107, 105, 103, 104,
- 116, 95, 95, 95, 95, 95, 95, 95, 95, 95,
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
- 114, 115, 118, 119, 6, 7, 9, 10, 121, 4,
- 97, 117, 2, 1, 3, 98, 99, 101, 100, 0,
- 95, 0, 95, 95, 95, 95, 95, 44, 95, 95,
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
- 95, 95, 95, 28, 17, 25, 95, 95, 95, 95,
-
- 95, 95, 54, 62, 95, 14, 95, 95, 95, 95,
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
- 95, 95, 95, 95, 118, 119, 119, 120, 6, 7,
- 9, 10, 2, 0, 96, 13, 45, 95, 95, 95,
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
- 95, 95, 95, 95, 95, 27, 95, 95, 95, 41,
- 95, 95, 95, 95, 21, 95, 95, 95, 95, 95,
- 15, 95, 95, 95, 18, 95, 95, 95, 95, 95,
- 81, 95, 95, 95, 51, 95, 12, 95, 36, 95,
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
-
- 0, 96, 95, 95, 95, 95, 20, 95, 24, 95,
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
- 46, 95, 30, 95, 88, 95, 95, 39, 95, 95,
- 95, 95, 95, 48, 95, 93, 90, 32, 92, 95,
- 11, 65, 95, 95, 95, 42, 95, 95, 95, 95,
- 95, 95, 95, 95, 95, 95, 29, 95, 95, 95,
- 95, 95, 95, 95, 95, 95, 86, 0, 95, 26,
- 95, 95, 95, 67, 95, 95, 95, 95, 37, 95,
- 95, 95, 95, 95, 95, 31, 66, 23, 95, 59,
- 95, 76, 95, 95, 95, 43, 95, 95, 95, 95,
-
- 95, 95, 95, 95, 91, 95, 95, 56, 95, 95,
- 95, 95, 95, 95, 95, 40, 33, 0, 80, 94,
- 19, 95, 95, 84, 95, 75, 55, 95, 64, 95,
- 52, 95, 95, 47, 95, 77, 95, 79, 95, 95,
- 34, 95, 95, 95, 35, 73, 95, 95, 95, 95,
- 60, 95, 50, 49, 95, 95, 95, 57, 53, 63,
- 95, 95, 22, 95, 95, 74, 82, 95, 95, 78,
- 95, 69, 95, 95, 95, 95, 95, 38, 89, 68,
- 95, 85, 95, 95, 95, 87, 95, 95, 61, 16,
- 95, 71, 70, 95, 58, 83, 95, 95, 95, 95,
-
- 95, 72, 0
+ 0, 0, 97, 97, 0, 0, 0, 0, 103, 101,
+ 100, 100, 8, 101, 92, 5, 81, 87, 90, 88,
+ 85, 89, 101, 91, 1, 101, 86, 84, 82, 83,
+ 95, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 93, 94, 97, 98, 6, 7, 9, 10, 100, 4,
+ 76, 96, 2, 1, 3, 77, 78, 80, 79, 0,
+ 74, 0, 74, 74, 74, 74, 36, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 23, 17, 20, 74, 74, 74, 74, 74, 74, 46,
+
+ 52, 74, 14, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 97, 98,
+ 98, 99, 6, 7, 9, 10, 2, 0, 75, 13,
+ 37, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 22, 74, 74, 34, 74,
+ 74, 74, 74, 18, 74, 74, 74, 74, 74, 15,
+ 74, 74, 74, 74, 74, 74, 74, 43, 74, 12,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 0, 75, 74, 74, 19, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 38, 25, 74, 67, 74,
+
+ 32, 74, 74, 74, 74, 40, 74, 72, 69, 27,
+ 71, 74, 11, 55, 74, 74, 74, 74, 74, 74,
+ 74, 74, 24, 74, 74, 74, 74, 74, 74, 66,
+ 0, 21, 74, 57, 74, 74, 74, 31, 74, 74,
+ 74, 74, 74, 26, 56, 74, 49, 74, 62, 74,
+ 74, 35, 74, 74, 74, 74, 70, 74, 48, 74,
+ 74, 74, 74, 33, 28, 0, 73, 74, 64, 61,
+ 47, 74, 54, 74, 44, 74, 39, 63, 74, 74,
+ 29, 74, 30, 60, 74, 50, 42, 41, 74, 45,
+ 53, 74, 74, 74, 74, 74, 74, 68, 58, 74,
+
+ 65, 74, 51, 16, 59, 0
} ;
static const YY_CHAR yy_ec[256] =
@@ -424,12 +413,12 @@ static const YY_CHAR yy_ec[256] =
17, 17, 17, 17, 17, 17, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- 1, 1, 1, 1, 51, 1, 34, 34, 34, 34,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 34,
+ 1, 1, 1, 1, 50, 1, 34, 34, 34, 34,
- 34, 34, 34, 34, 34, 34, 34, 52, 34, 34,
- 34, 34, 53, 34, 54, 34, 34, 34, 34, 34,
- 34, 34, 55, 1, 56, 1, 1, 1, 1, 1,
+ 34, 34, 34, 34, 34, 34, 34, 51, 34, 34,
+ 34, 34, 52, 34, 53, 34, 34, 34, 34, 34,
+ 34, 34, 54, 1, 55, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -446,418 +435,324 @@ static const YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static const YY_CHAR yy_meta[57] =
+static const YY_CHAR yy_meta[56] =
{ 0,
1, 1, 1, 2, 3, 1, 1, 4, 1, 1,
5, 1, 1, 1, 1, 6, 7, 1, 1, 1,
8, 1, 1, 6, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 1, 1
+ 9, 9, 9, 1, 1
} ;
-static const flex_int16_t yy_base[417] =
+static const flex_int16_t yy_base[320] =
{ 0,
- 0, 0, 296, 281, 283, 280, 261, 252, 253, 1285,
- 55, 57, 1285, 0, 1285, 1285, 1285, 1285, 1285, 1285,
- 1285, 1285, 211, 213, 46, 202, 1285, 43, 1285, 199,
- 1285, 46, 50, 56, 52, 66, 64, 51, 81, 92,
- 91, 94, 96, 111, 113, 116, 130, 134, 53, 143,
- 1285, 1285, 0, 106, 0, 206, 0, 205, 141, 0,
- 1285, 1285, 177, 56, 152, 1285, 1285, 1285, 1285, 161,
- 140, 147, 152, 154, 155, 161, 167, 171, 177, 172,
- 184, 174, 188, 189, 191, 194, 203, 212, 217, 219,
- 222, 223, 228, 224, 226, 233, 235, 239, 244, 251,
-
- 256, 260, 261, 262, 265, 271, 266, 281, 277, 287,
- 282, 288, 303, 306, 307, 292, 310, 321, 322, 323,
- 324, 325, 335, 338, 0, 112, 173, 1285, 0, 152,
- 0, 145, 130, 59, 0, 339, 341, 353, 351, 354,
- 365, 367, 355, 372, 376, 383, 379, 386, 388, 385,
- 398, 392, 402, 401, 414, 415, 416, 417, 426, 430,
- 432, 437, 433, 439, 442, 443, 449, 456, 460, 461,
- 463, 470, 472, 473, 479, 483, 485, 489, 492, 495,
- 498, 499, 502, 508, 509, 514, 515, 518, 520, 527,
- 530, 534, 536, 541, 543, 553, 555, 557, 559, 568,
-
- 41, 0, 564, 569, 570, 573, 574, 585, 580, 589,
- 586, 595, 598, 600, 605, 610, 611, 617, 620, 615,
- 622, 627, 626, 631, 641, 642, 646, 647, 648, 651,
- 652, 653, 657, 662, 663, 667, 669, 673, 680, 682,
- 684, 685, 686, 687, 689, 696, 698, 700, 701, 703,
- 699, 710, 714, 716, 729, 732, 731, 733, 735, 734,
- 746, 747, 748, 752, 753, 759, 749, 39, 769, 770,
- 771, 773, 774, 780, 783, 784, 787, 785, 786, 802,
- 800, 803, 816, 817, 818, 819, 820, 823, 833, 835,
- 836, 837, 838, 839, 848, 849, 852, 853, 854, 859,
-
- 863, 870, 868, 872, 875, 884, 885, 887, 889, 890,
- 888, 904, 906, 907, 908, 918, 919, 73, 921, 922,
- 923, 924, 933, 934, 936, 937, 938, 939, 940, 949,
- 952, 955, 953, 965, 969, 970, 971, 972, 974, 975,
- 981, 984, 986, 988, 990, 991, 1000, 1006, 1004, 1009,
- 1016, 1018, 1020, 1021, 1025, 1027, 1032, 1034, 1038, 1039,
- 1041, 1043, 1048, 1050, 1052, 1055, 1059, 1064, 1066, 1068,
- 1071, 1073, 1077, 1084, 1086, 1087, 1091, 1093, 1098, 1100,
- 1102, 1104, 1105, 1111, 1114, 1116, 1117, 1118, 1120, 1127,
- 1129, 1130, 1134, 1139, 1141, 1145, 1146, 1148, 1150, 1151,
-
- 1155, 1157, 1285, 1197, 1206, 1215, 1218, 1221, 1225, 1234,
- 1243, 1252, 1261, 1268, 1272, 1275
+ 0, 0, 262, 259, 249, 244, 239, 234, 236, 960,
+ 54, 56, 960, 0, 960, 960, 960, 960, 960, 960,
+ 960, 960, 217, 220, 45, 186, 960, 42, 960, 184,
+ 960, 45, 49, 55, 51, 65, 80, 50, 69, 94,
+ 90, 92, 104, 60, 114, 116, 131, 134, 135, 149,
+ 960, 960, 0, 61, 0, 194, 0, 197, 133, 0,
+ 960, 960, 163, 53, 143, 960, 960, 960, 960, 147,
+ 125, 123, 138, 151, 152, 153, 155, 166, 169, 173,
+ 170, 171, 176, 180, 193, 182, 200, 204, 206, 209,
+ 210, 211, 213, 224, 225, 226, 235, 240, 242, 245,
+
+ 251, 252, 255, 256, 258, 261, 270, 274, 272, 277,
+ 289, 288, 276, 294, 295, 300, 304, 305, 0, 79,
+ 110, 960, 0, 116, 0, 113, 98, 58, 0, 306,
+ 315, 316, 318, 319, 322, 328, 329, 332, 334, 338,
+ 344, 353, 351, 354, 366, 360, 367, 369, 376, 378,
+ 381, 385, 388, 382, 394, 400, 403, 404, 406, 407,
+ 410, 417, 423, 424, 426, 429, 433, 440, 442, 443,
+ 444, 445, 454, 456, 459, 461, 472, 473, 474, 477,
+ 53, 0, 475, 478, 479, 490, 502, 504, 505, 507,
+ 508, 509, 511, 518, 520, 523, 524, 525, 529, 538,
+
+ 541, 542, 543, 545, 547, 544, 556, 557, 558, 559,
+ 560, 569, 572, 574, 578, 581, 579, 583, 588, 590,
+ 600, 601, 602, 607, 611, 613, 612, 618, 622, 629,
+ 41, 634, 636, 638, 639, 643, 645, 648, 649, 650,
+ 655, 659, 661, 660, 670, 675, 676, 679, 680, 682,
+ 686, 689, 691, 696, 693, 700, 705, 706, 709, 711,
+ 712, 716, 722, 723, 726, 72, 727, 736, 737, 738,
+ 739, 740, 742, 743, 752, 753, 755, 757, 758, 759,
+ 764, 770, 769, 771, 774, 784, 785, 786, 787, 789,
+ 790, 791, 796, 801, 802, 803, 806, 807, 812, 817,
+
+ 816, 823, 826, 828, 832, 960, 872, 881, 890, 893,
+ 896, 900, 909, 918, 927, 936, 943, 947, 950
} ;
-static const flex_int16_t yy_def[417] =
+static const flex_int16_t yy_def[320] =
{ 0,
- 403, 1, 404, 404, 405, 405, 406, 406, 403, 403,
- 403, 403, 403, 407, 403, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 408, 403, 403, 403, 403,
- 403, 409, 409, 409, 409, 409, 34, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 403, 403, 410, 411, 412, 403, 413, 403, 403, 407,
- 403, 403, 403, 403, 408, 403, 403, 403, 403, 414,
- 409, 415, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
-
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 410, 411, 411, 403, 412, 403,
- 413, 403, 403, 403, 416, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
-
- 403, 416, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 403, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
-
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 403, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
- 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
-
- 409, 409, 0, 403, 403, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 403
+ 306, 1, 307, 307, 308, 308, 309, 309, 306, 306,
+ 306, 306, 306, 310, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 311, 306, 306, 306, 306,
+ 306, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 306, 306, 313, 314, 315, 306, 316, 306, 306, 310,
+ 306, 306, 306, 306, 311, 306, 306, 306, 306, 317,
+ 312, 318, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 313, 314,
+ 314, 306, 315, 306, 316, 306, 306, 306, 319, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 306, 319, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 306, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 306, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+
+ 312, 312, 312, 312, 312, 0, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306
} ;
-static const flex_int16_t yy_nxt[1342] =
+static const flex_int16_t yy_nxt[1016] =
{ 0,
10, 11, 12, 13, 10, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 10, 32, 33, 34, 35, 36, 37,
38, 38, 39, 38, 38, 40, 41, 42, 43, 44,
38, 45, 46, 47, 48, 49, 50, 38, 38, 38,
- 38, 38, 38, 38, 51, 52, 59, 59, 59, 59,
- 63, 70, 64, 67, 68, 70, 70, 70, 70, 72,
- 63, 70, 64, 72, 72, 72, 72, 122, 75, 72,
- 84, 70, 76, 73, 85, 77, 135, 79, 74, 72,
- 318, 80, 89, 268, 81, 71, 70, 82, 78, 90,
-
- 83, 86, 91, 87, 72, 92, 70, 70, 93, 70,
- 94, 70, 201, 88, 72, 72, 127, 72, 95, 72,
- 97, 128, 403, 96, 98, 103, 70, 403, 70, 100,
- 99, 70, 101, 104, 72, 105, 72, 106, 102, 72,
- 107, 109, 59, 59, 112, 70, 133, 113, 132, 70,
- 110, 111, 108, 72, 117, 70, 114, 72, 70, 130,
- 115, 118, 70, 72, 116, 134, 72, 70, 119, 70,
- 70, 120, 403, 121, 123, 72, 70, 72, 72, 136,
- 137, 124, 70, 127, 72, 139, 70, 70, 128, 70,
- 72, 140, 70, 133, 72, 72, 138, 72, 141, 70,
-
- 72, 143, 149, 70, 70, 142, 70, 72, 132, 70,
- 144, 72, 72, 130, 72, 151, 145, 72, 70, 69,
- 146, 147, 66, 62, 152, 61, 72, 70, 148, 150,
- 156, 153, 70, 154, 70, 72, 155, 70, 70, 70,
- 72, 70, 72, 70, 157, 72, 72, 72, 70, 72,
- 70, 72, 403, 163, 70, 58, 72, 159, 72, 70,
- 158, 161, 72, 160, 58, 162, 70, 72, 164, 165,
- 168, 70, 166, 167, 72, 70, 70, 70, 170, 72,
- 70, 70, 169, 72, 72, 72, 70, 56, 72, 72,
- 56, 54, 70, 173, 72, 172, 70, 70, 174, 171,
-
- 72, 178, 70, 70, 72, 72, 54, 70, 403, 175,
- 72, 72, 403, 176, 181, 72, 179, 182, 70, 177,
- 180, 70, 70, 184, 403, 70, 72, 186, 183, 72,
- 72, 185, 188, 72, 190, 191, 70, 70, 70, 70,
- 70, 187, 403, 189, 72, 72, 72, 72, 72, 192,
- 70, 196, 403, 70, 70, 194, 70, 403, 72, 403,
- 197, 72, 72, 198, 72, 195, 70, 199, 70, 70,
- 70, 403, 193, 403, 72, 403, 72, 72, 72, 200,
- 70, 203, 70, 204, 403, 403, 205, 70, 72, 206,
- 72, 70, 207, 208, 70, 72, 209, 403, 70, 72,
-
- 70, 70, 72, 70, 403, 214, 72, 70, 72, 72,
- 403, 72, 216, 70, 210, 72, 70, 70, 211, 212,
- 220, 72, 213, 215, 72, 72, 217, 218, 221, 70,
- 70, 70, 70, 219, 403, 403, 403, 72, 72, 72,
- 72, 70, 223, 226, 222, 70, 224, 70, 70, 72,
- 227, 403, 70, 72, 70, 72, 72, 70, 70, 225,
- 72, 230, 72, 229, 70, 72, 72, 231, 228, 403,
- 233, 70, 72, 235, 403, 70, 70, 236, 70, 72,
- 234, 403, 232, 72, 72, 70, 72, 70, 70, 239,
- 237, 403, 240, 72, 70, 72, 72, 403, 70, 238,
-
- 70, 243, 72, 403, 70, 241, 72, 70, 72, 242,
- 70, 245, 72, 70, 70, 72, 246, 70, 72, 403,
- 244, 72, 72, 70, 70, 72, 403, 247, 403, 70,
- 70, 72, 72, 70, 250, 70, 252, 72, 72, 248,
- 403, 72, 70, 72, 403, 70, 403, 403, 249, 70,
- 72, 70, 251, 72, 255, 253, 70, 72, 70, 72,
- 254, 258, 259, 403, 72, 256, 72, 403, 70, 403,
- 70, 257, 70, 260, 70, 262, 72, 263, 72, 70,
- 72, 261, 72, 70, 70, 70, 403, 72, 70, 70,
- 403, 72, 72, 72, 266, 70, 72, 72, 265, 264,
-
- 70, 70, 267, 72, 70, 269, 270, 271, 72, 72,
- 70, 403, 72, 70, 272, 70, 403, 274, 72, 273,
- 70, 72, 277, 72, 278, 70, 70, 276, 72, 275,
- 70, 403, 70, 72, 72, 70, 403, 70, 72, 281,
- 72, 70, 70, 72, 283, 72, 70, 403, 279, 72,
- 72, 403, 403, 280, 72, 282, 70, 70, 284, 285,
- 286, 70, 70, 70, 72, 72, 70, 70, 70, 72,
- 72, 72, 70, 287, 72, 72, 72, 70, 70, 403,
- 72, 403, 70, 403, 70, 72, 72, 293, 70, 288,
- 72, 289, 72, 291, 292, 70, 72, 70, 290, 70,
-
- 70, 70, 70, 72, 70, 72, 294, 72, 72, 72,
- 72, 70, 72, 70, 70, 70, 70, 298, 70, 72,
- 295, 72, 72, 72, 72, 70, 72, 296, 302, 70,
- 297, 70, 403, 72, 403, 403, 304, 72, 303, 72,
- 299, 300, 305, 301, 70, 403, 70, 70, 70, 70,
- 70, 403, 72, 307, 72, 72, 72, 72, 72, 306,
- 308, 70, 70, 70, 70, 309, 310, 70, 70, 72,
- 72, 72, 72, 403, 70, 72, 72, 313, 311, 403,
- 315, 316, 72, 403, 70, 70, 70, 317, 70, 70,
- 312, 314, 72, 72, 72, 70, 72, 72, 70, 70,
-
- 70, 70, 70, 72, 403, 403, 72, 72, 72, 72,
- 72, 323, 319, 325, 320, 70, 403, 70, 70, 403,
- 403, 321, 403, 72, 322, 72, 72, 324, 326, 403,
- 327, 70, 70, 70, 70, 70, 403, 328, 70, 72,
- 72, 72, 72, 72, 329, 331, 72, 403, 70, 403,
- 70, 70, 70, 70, 70, 332, 72, 330, 72, 72,
- 72, 72, 72, 70, 70, 333, 335, 70, 70, 70,
- 336, 72, 72, 403, 70, 72, 72, 72, 70, 334,
- 339, 338, 72, 70, 403, 70, 72, 70, 403, 403,
- 70, 72, 337, 72, 343, 72, 341, 340, 72, 70,
-
- 70, 403, 70, 70, 70, 70, 342, 72, 72, 344,
- 72, 72, 72, 72, 349, 345, 403, 403, 403, 70,
- 403, 70, 70, 70, 350, 346, 348, 72, 347, 72,
- 72, 72, 351, 70, 70, 353, 70, 70, 70, 70,
- 403, 72, 72, 352, 72, 72, 72, 72, 70, 70,
- 354, 70, 70, 70, 70, 70, 72, 72, 403, 72,
- 72, 72, 72, 72, 70, 403, 356, 70, 70, 403,
- 70, 403, 72, 355, 357, 72, 72, 360, 72, 358,
- 70, 361, 359, 403, 70, 70, 70, 70, 72, 70,
- 70, 362, 72, 72, 72, 72, 70, 72, 72, 70,
-
- 403, 70, 403, 70, 72, 70, 70, 72, 364, 72,
- 363, 72, 368, 72, 72, 70, 366, 403, 365, 70,
- 369, 70, 403, 72, 70, 367, 403, 72, 370, 72,
- 371, 70, 72, 70, 373, 70, 70, 403, 403, 72,
- 70, 72, 70, 72, 72, 372, 374, 70, 72, 70,
- 72, 403, 403, 70, 70, 72, 70, 72, 70, 376,
- 377, 72, 72, 70, 72, 70, 72, 70, 375, 403,
- 70, 72, 403, 72, 70, 72, 403, 380, 72, 70,
- 379, 70, 72, 70, 378, 403, 70, 72, 70, 72,
- 403, 72, 70, 381, 72, 403, 72, 403, 382, 70,
-
- 72, 70, 70, 383, 403, 385, 70, 72, 70, 72,
- 72, 386, 384, 70, 72, 70, 72, 70, 389, 70,
- 70, 72, 403, 72, 387, 72, 70, 72, 72, 70,
- 390, 70, 70, 70, 72, 70, 388, 72, 403, 72,
- 72, 72, 70, 72, 70, 70, 395, 403, 391, 70,
- 72, 403, 72, 72, 70, 393, 70, 72, 396, 392,
- 70, 70, 72, 70, 72, 70, 70, 394, 72, 72,
- 70, 72, 70, 72, 72, 400, 397, 403, 72, 401,
- 72, 403, 403, 403, 399, 403, 403, 403, 403, 403,
- 398, 403, 403, 403, 403, 403, 402, 53, 53, 53,
-
- 53, 53, 53, 53, 53, 53, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 60, 403, 60, 65, 65, 65,
- 71, 71, 403, 71, 125, 125, 125, 125, 403, 125,
- 125, 125, 125, 126, 126, 126, 126, 126, 126, 126,
- 126, 126, 129, 129, 129, 403, 129, 129, 129, 129,
- 129, 131, 403, 131, 131, 131, 131, 131, 131, 131,
- 135, 403, 403, 403, 403, 403, 135, 72, 72, 403,
- 72, 202, 403, 202, 9, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
-
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 403
+ 38, 38, 38, 51, 52, 59, 59, 59, 59, 63,
+ 70, 64, 67, 68, 70, 70, 70, 63, 72, 64,
+ 70, 121, 72, 72, 72, 70, 122, 75, 72, 83,
+ 70, 76, 73, 72, 70, 129, 78, 74, 72, 306,
+ 79, 266, 72, 80, 306, 70, 81, 77, 91, 82,
+
+ 84, 104, 85, 72, 231, 70, 92, 70, 87, 70,
+ 181, 93, 86, 72, 127, 72, 126, 72, 88, 70,
+ 121, 89, 94, 124, 90, 122, 95, 72, 97, 70,
+ 98, 70, 96, 100, 59, 59, 99, 72, 70, 72,
+ 70, 101, 105, 102, 107, 103, 70, 108, 72, 70,
+ 70, 128, 106, 70, 72, 111, 109, 72, 72, 116,
+ 110, 72, 112, 306, 70, 130, 70, 70, 70, 113,
+ 70, 114, 72, 115, 72, 72, 72, 131, 72, 127,
+ 117, 70, 132, 133, 70, 70, 70, 118, 70, 72,
+ 134, 70, 72, 72, 72, 70, 72, 70, 140, 72,
+
+ 126, 124, 142, 72, 69, 72, 66, 135, 70, 137,
+ 138, 143, 141, 136, 147, 70, 72, 139, 144, 70,
+ 146, 70, 145, 72, 70, 70, 70, 72, 70, 72,
+ 62, 61, 72, 72, 72, 306, 72, 58, 152, 70,
+ 70, 70, 58, 148, 150, 149, 151, 72, 72, 72,
+ 70, 56, 157, 153, 154, 70, 56, 70, 72, 156,
+ 70, 155, 159, 72, 158, 72, 70, 70, 72, 54,
+ 70, 70, 54, 70, 72, 72, 70, 161, 72, 72,
+ 162, 72, 163, 160, 72, 70, 306, 70, 306, 70,
+ 306, 70, 70, 72, 164, 72, 166, 72, 169, 72,
+
+ 72, 165, 171, 70, 70, 167, 306, 170, 306, 70,
+ 70, 72, 72, 168, 172, 70, 173, 72, 72, 70,
+ 70, 70, 176, 72, 306, 174, 175, 72, 72, 72,
+ 70, 70, 178, 70, 70, 177, 179, 70, 72, 72,
+ 306, 72, 72, 70, 70, 72, 180, 70, 183, 70,
+ 184, 72, 72, 70, 306, 72, 306, 72, 189, 70,
+ 185, 72, 191, 306, 186, 188, 70, 72, 70, 70,
+ 187, 190, 306, 306, 72, 70, 72, 72, 306, 195,
+ 196, 70, 70, 72, 70, 192, 193, 306, 194, 72,
+ 72, 70, 72, 70, 197, 200, 70, 70, 198, 72,
+
+ 70, 72, 306, 70, 72, 72, 306, 202, 72, 70,
+ 199, 72, 306, 203, 201, 70, 204, 72, 70, 70,
+ 206, 70, 70, 72, 207, 70, 72, 72, 208, 72,
+ 72, 205, 70, 72, 211, 306, 212, 209, 70, 70,
+ 72, 70, 306, 210, 70, 213, 72, 72, 70, 72,
+ 216, 215, 72, 306, 214, 70, 72, 70, 70, 70,
+ 70, 219, 306, 72, 218, 72, 72, 72, 72, 70,
+ 217, 70, 306, 306, 70, 306, 70, 72, 306, 72,
+ 222, 224, 72, 220, 72, 226, 221, 70, 70, 70,
+ 70, 223, 70, 70, 70, 72, 72, 72, 72, 225,
+
+ 72, 72, 72, 306, 306, 70, 306, 306, 306, 229,
+ 306, 230, 232, 72, 228, 233, 227, 70, 234, 70,
+ 70, 306, 70, 70, 70, 72, 70, 72, 72, 237,
+ 72, 72, 72, 70, 72, 70, 236, 240, 70, 70,
+ 70, 72, 242, 72, 70, 235, 72, 72, 72, 241,
+ 238, 239, 72, 70, 244, 306, 70, 70, 70, 70,
+ 70, 72, 70, 243, 72, 72, 72, 72, 72, 245,
+ 72, 70, 70, 70, 70, 70, 306, 306, 306, 72,
+ 72, 72, 72, 72, 70, 246, 248, 70, 249, 70,
+ 247, 306, 72, 70, 70, 72, 70, 72, 70, 250,
+
+ 306, 72, 72, 70, 72, 70, 72, 251, 255, 253,
+ 306, 72, 306, 72, 256, 70, 70, 70, 257, 252,
+ 254, 306, 70, 72, 72, 72, 70, 70, 70, 259,
+ 72, 306, 306, 70, 72, 72, 72, 70, 306, 260,
+ 263, 72, 306, 258, 70, 72, 264, 306, 306, 70,
+ 265, 70, 72, 70, 70, 261, 262, 72, 70, 72,
+ 70, 72, 72, 70, 70, 70, 72, 268, 72, 306,
+ 70, 72, 72, 72, 70, 70, 70, 271, 72, 267,
+ 306, 306, 72, 72, 72, 70, 269, 272, 270, 275,
+ 70, 70, 306, 72, 70, 70, 273, 70, 72, 72,
+
+ 274, 70, 72, 72, 70, 72, 70, 276, 70, 72,
+ 306, 70, 72, 278, 72, 70, 72, 282, 280, 72,
+ 70, 70, 277, 72, 70, 306, 70, 70, 72, 72,
+ 279, 70, 72, 281, 72, 72, 306, 70, 70, 72,
+ 286, 70, 70, 283, 287, 72, 72, 284, 285, 72,
+ 72, 70, 70, 70, 70, 70, 306, 70, 70, 72,
+ 72, 72, 72, 72, 288, 72, 72, 70, 70, 306,
+ 70, 291, 70, 70, 70, 72, 72, 289, 72, 70,
+ 72, 72, 72, 290, 70, 70, 70, 72, 306, 70,
+ 306, 292, 72, 72, 72, 293, 295, 72, 296, 70,
+
+ 70, 70, 70, 294, 70, 70, 70, 72, 72, 72,
+ 72, 70, 72, 72, 72, 297, 70, 70, 70, 72,
+ 306, 70, 70, 299, 72, 72, 72, 70, 298, 72,
+ 72, 70, 70, 303, 306, 72, 301, 306, 70, 72,
+ 72, 70, 300, 70, 302, 304, 72, 70, 306, 72,
+ 306, 72, 306, 306, 306, 72, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 305, 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 55, 55, 55, 55, 55, 55, 55, 55, 55,
+ 57, 57, 57, 57, 57, 57, 57, 57, 57, 60,
+
+ 306, 60, 65, 65, 65, 71, 71, 306, 71, 119,
+ 119, 119, 119, 306, 119, 119, 119, 119, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 123, 123, 123,
+ 306, 123, 123, 123, 123, 123, 125, 306, 125, 125,
+ 125, 125, 125, 125, 125, 129, 306, 306, 306, 306,
+ 306, 129, 72, 72, 306, 72, 182, 306, 182, 9,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306
} ;
-static const flex_int16_t yy_chk[1342] =
+static const flex_int16_t yy_chk[1016] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 11, 11, 12, 12,
- 25, 32, 25, 28, 28, 33, 38, 35, 49, 32,
- 64, 34, 64, 33, 38, 35, 49, 49, 33, 34,
- 35, 36, 33, 32, 35, 33, 318, 34, 32, 36,
- 268, 34, 37, 201, 34, 37, 39, 34, 33, 37,
-
- 34, 36, 37, 36, 39, 37, 41, 40, 37, 42,
- 39, 43, 134, 36, 41, 40, 54, 42, 39, 43,
- 40, 54, 126, 39, 40, 43, 44, 126, 45, 41,
- 40, 46, 42, 43, 44, 43, 45, 43, 42, 46,
- 43, 45, 59, 59, 46, 47, 133, 46, 132, 48,
- 45, 45, 44, 47, 47, 71, 46, 48, 50, 130,
- 46, 47, 72, 71, 46, 70, 50, 73, 47, 74,
- 75, 48, 65, 48, 50, 73, 76, 74, 75, 73,
- 74, 50, 77, 127, 76, 75, 78, 80, 127, 82,
- 77, 76, 79, 63, 78, 80, 74, 82, 76, 81,
-
- 79, 79, 82, 83, 84, 77, 85, 81, 58, 86,
- 80, 83, 84, 56, 85, 84, 80, 86, 87, 30,
- 81, 81, 26, 24, 84, 23, 87, 88, 81, 83,
- 87, 84, 89, 85, 90, 88, 86, 91, 92, 94,
- 89, 95, 90, 93, 88, 91, 92, 94, 96, 95,
- 97, 93, 9, 95, 98, 8, 96, 90, 97, 99,
- 89, 92, 98, 91, 7, 93, 100, 99, 95, 95,
- 99, 101, 97, 98, 100, 102, 103, 104, 100, 101,
- 105, 107, 99, 102, 103, 104, 106, 6, 105, 107,
- 5, 4, 109, 105, 106, 102, 108, 111, 106, 101,
-
- 109, 109, 110, 112, 108, 111, 3, 116, 0, 107,
- 110, 112, 0, 108, 110, 116, 109, 111, 113, 108,
- 109, 114, 115, 112, 0, 117, 113, 113, 111, 114,
- 115, 112, 115, 117, 116, 117, 118, 119, 120, 121,
- 122, 114, 0, 115, 118, 119, 120, 121, 122, 118,
- 123, 121, 0, 124, 136, 120, 137, 0, 123, 0,
- 122, 124, 136, 123, 137, 120, 139, 123, 138, 140,
- 143, 0, 119, 0, 139, 0, 138, 140, 143, 124,
- 141, 138, 142, 139, 0, 0, 140, 144, 141, 141,
- 142, 145, 142, 142, 147, 144, 143, 0, 146, 145,
-
- 150, 148, 147, 149, 0, 147, 146, 152, 150, 148,
- 0, 149, 149, 151, 144, 152, 154, 153, 145, 146,
- 152, 151, 146, 148, 154, 153, 150, 150, 153, 155,
- 156, 157, 158, 151, 0, 0, 0, 155, 156, 157,
- 158, 159, 155, 158, 154, 160, 155, 161, 163, 159,
- 159, 0, 162, 160, 164, 161, 163, 165, 166, 157,
- 162, 163, 164, 162, 167, 165, 166, 164, 161, 0,
- 165, 168, 167, 166, 0, 169, 170, 167, 171, 168,
- 165, 0, 164, 169, 170, 172, 171, 173, 174, 170,
- 168, 0, 171, 172, 175, 173, 174, 0, 176, 169,
-
- 177, 174, 175, 0, 178, 172, 176, 179, 177, 173,
- 180, 177, 178, 181, 182, 179, 178, 183, 180, 0,
- 176, 181, 182, 184, 185, 183, 0, 179, 0, 186,
- 187, 184, 185, 188, 182, 189, 184, 186, 187, 180,
- 0, 188, 190, 189, 0, 191, 0, 0, 181, 192,
- 190, 193, 183, 191, 190, 186, 194, 192, 195, 193,
- 188, 193, 193, 0, 194, 191, 195, 0, 196, 0,
- 197, 192, 198, 193, 199, 195, 196, 196, 197, 203,
- 198, 194, 199, 200, 204, 205, 0, 203, 206, 207,
- 0, 200, 204, 205, 199, 209, 206, 207, 198, 197,
-
- 208, 211, 200, 209, 210, 203, 204, 205, 208, 211,
- 212, 0, 210, 213, 206, 214, 0, 210, 212, 208,
- 215, 213, 213, 214, 214, 216, 217, 212, 215, 211,
- 220, 0, 218, 216, 217, 219, 0, 221, 220, 217,
- 218, 223, 222, 219, 219, 221, 224, 0, 215, 223,
- 222, 0, 0, 216, 224, 218, 225, 226, 220, 222,
- 224, 227, 228, 229, 225, 226, 230, 231, 232, 227,
- 228, 229, 233, 226, 230, 231, 232, 234, 235, 0,
- 233, 0, 236, 0, 237, 234, 235, 233, 238, 227,
- 236, 229, 237, 231, 232, 239, 238, 240, 230, 241,
-
- 242, 243, 244, 239, 245, 240, 235, 241, 242, 243,
- 244, 246, 245, 247, 251, 248, 249, 245, 250, 246,
- 240, 247, 251, 248, 249, 252, 250, 243, 250, 253,
- 244, 254, 0, 252, 0, 0, 252, 253, 251, 254,
- 247, 248, 253, 249, 255, 0, 257, 256, 258, 260,
- 259, 0, 255, 255, 257, 256, 258, 260, 259, 254,
- 256, 261, 262, 263, 267, 258, 259, 264, 265, 261,
- 262, 263, 267, 0, 266, 264, 265, 262, 260, 0,
- 264, 265, 266, 0, 269, 270, 271, 266, 272, 273,
- 261, 263, 269, 270, 271, 274, 272, 273, 275, 276,
-
- 278, 279, 277, 274, 0, 0, 275, 276, 278, 279,
- 277, 275, 269, 277, 271, 281, 0, 280, 282, 0,
- 0, 272, 0, 281, 273, 280, 282, 276, 278, 0,
- 280, 283, 284, 285, 286, 287, 0, 281, 288, 283,
- 284, 285, 286, 287, 282, 284, 288, 0, 289, 0,
- 290, 291, 292, 293, 294, 285, 289, 283, 290, 291,
- 292, 293, 294, 295, 296, 289, 293, 297, 298, 299,
- 294, 295, 296, 0, 300, 297, 298, 299, 301, 291,
- 298, 297, 300, 303, 0, 302, 301, 304, 0, 0,
- 305, 303, 295, 302, 302, 304, 300, 299, 305, 306,
-
- 307, 0, 308, 311, 309, 310, 301, 306, 307, 303,
- 308, 311, 309, 310, 310, 304, 0, 0, 0, 312,
- 0, 313, 314, 315, 311, 306, 309, 312, 307, 313,
- 314, 315, 312, 316, 317, 314, 319, 320, 321, 322,
- 0, 316, 317, 313, 319, 320, 321, 322, 323, 324,
- 315, 325, 326, 327, 328, 329, 323, 324, 0, 325,
- 326, 327, 328, 329, 330, 0, 322, 331, 333, 0,
- 332, 0, 330, 321, 323, 331, 333, 330, 332, 325,
- 334, 332, 328, 0, 335, 336, 337, 338, 334, 339,
- 340, 333, 335, 336, 337, 338, 341, 339, 340, 342,
-
- 0, 343, 0, 344, 341, 345, 346, 342, 337, 343,
- 335, 344, 343, 345, 346, 347, 340, 0, 339, 349,
- 344, 348, 0, 347, 350, 342, 0, 349, 347, 348,
- 348, 351, 350, 352, 350, 353, 354, 0, 0, 351,
- 355, 352, 356, 353, 354, 349, 352, 357, 355, 358,
- 356, 0, 0, 359, 360, 357, 361, 358, 362, 356,
- 357, 359, 360, 363, 361, 364, 362, 365, 355, 0,
- 366, 363, 0, 364, 367, 365, 0, 364, 366, 368,
- 362, 369, 367, 370, 361, 0, 371, 368, 372, 369,
- 0, 370, 373, 365, 371, 0, 372, 0, 368, 374,
-
- 373, 375, 376, 369, 0, 373, 377, 374, 378, 375,
- 376, 374, 371, 379, 377, 380, 378, 381, 377, 382,
- 383, 379, 0, 380, 375, 381, 384, 382, 383, 385,
- 381, 386, 387, 388, 384, 389, 376, 385, 0, 386,
- 387, 388, 390, 389, 391, 392, 388, 0, 383, 393,
- 390, 0, 391, 392, 394, 385, 395, 393, 391, 384,
- 396, 397, 394, 398, 395, 399, 400, 387, 396, 397,
- 401, 398, 402, 399, 400, 399, 394, 0, 401, 400,
- 402, 0, 0, 0, 398, 0, 0, 0, 0, 0,
- 397, 0, 0, 0, 0, 0, 401, 404, 404, 404,
-
- 404, 404, 404, 404, 404, 404, 405, 405, 405, 405,
- 405, 405, 405, 405, 405, 406, 406, 406, 406, 406,
- 406, 406, 406, 406, 407, 0, 407, 408, 408, 408,
- 409, 409, 0, 409, 410, 410, 410, 410, 0, 410,
- 410, 410, 410, 411, 411, 411, 411, 411, 411, 411,
- 411, 411, 412, 412, 412, 0, 412, 412, 412, 412,
- 412, 413, 0, 413, 413, 413, 413, 413, 413, 413,
- 414, 0, 0, 0, 0, 0, 414, 415, 415, 0,
- 415, 416, 0, 416, 403, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
-
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 403
+ 1, 1, 1, 1, 1, 11, 11, 12, 12, 25,
+ 32, 25, 28, 28, 33, 38, 35, 64, 32, 64,
+ 34, 54, 33, 38, 35, 44, 54, 33, 34, 35,
+ 36, 33, 32, 44, 39, 266, 34, 32, 36, 120,
+ 34, 231, 39, 34, 120, 37, 34, 33, 39, 34,
+
+ 36, 44, 36, 37, 181, 41, 39, 42, 37, 40,
+ 128, 39, 36, 41, 127, 42, 126, 40, 37, 43,
+ 121, 37, 40, 124, 37, 121, 40, 43, 41, 45,
+ 42, 46, 40, 43, 59, 59, 42, 45, 72, 46,
+ 71, 43, 45, 43, 46, 43, 47, 46, 71, 48,
+ 49, 70, 45, 73, 47, 47, 46, 48, 49, 49,
+ 46, 73, 47, 65, 50, 73, 74, 75, 76, 47,
+ 77, 48, 50, 48, 74, 75, 76, 74, 77, 63,
+ 50, 78, 75, 76, 79, 81, 82, 50, 80, 78,
+ 78, 83, 79, 81, 82, 84, 80, 86, 81, 83,
+
+ 58, 56, 83, 84, 30, 86, 26, 79, 85, 80,
+ 80, 83, 82, 79, 86, 87, 85, 80, 83, 88,
+ 85, 89, 84, 87, 90, 91, 92, 88, 93, 89,
+ 24, 23, 90, 91, 92, 9, 93, 8, 92, 94,
+ 95, 96, 7, 87, 89, 88, 90, 94, 95, 96,
+ 97, 6, 96, 92, 92, 98, 5, 99, 97, 95,
+ 100, 94, 97, 98, 96, 99, 101, 102, 100, 4,
+ 103, 104, 3, 105, 101, 102, 106, 99, 103, 104,
+ 102, 105, 103, 98, 106, 107, 0, 109, 0, 108,
+ 0, 113, 110, 107, 104, 109, 106, 108, 108, 113,
+
+ 110, 105, 110, 112, 111, 107, 0, 109, 0, 114,
+ 115, 112, 111, 107, 111, 116, 112, 114, 115, 117,
+ 118, 130, 115, 116, 0, 113, 114, 117, 118, 130,
+ 131, 132, 117, 133, 134, 116, 117, 135, 131, 132,
+ 0, 133, 134, 136, 137, 135, 118, 138, 132, 139,
+ 133, 136, 137, 140, 0, 138, 0, 139, 138, 141,
+ 134, 140, 140, 0, 135, 137, 143, 141, 142, 144,
+ 136, 139, 0, 0, 143, 146, 142, 144, 0, 143,
+ 144, 145, 147, 146, 148, 141, 141, 0, 142, 145,
+ 147, 149, 148, 150, 145, 148, 151, 154, 145, 149,
+
+ 152, 150, 0, 153, 151, 154, 0, 151, 152, 155,
+ 147, 153, 0, 152, 150, 156, 153, 155, 157, 158,
+ 154, 159, 160, 156, 155, 161, 157, 158, 156, 159,
+ 160, 153, 162, 161, 159, 0, 160, 157, 163, 164,
+ 162, 165, 0, 158, 166, 161, 163, 164, 167, 165,
+ 164, 163, 166, 0, 162, 168, 167, 169, 170, 171,
+ 172, 167, 0, 168, 166, 169, 170, 171, 172, 173,
+ 165, 174, 0, 0, 175, 0, 176, 173, 0, 174,
+ 172, 174, 175, 169, 176, 176, 171, 177, 178, 179,
+ 183, 173, 180, 184, 185, 177, 178, 179, 183, 175,
+
+ 180, 184, 185, 0, 0, 186, 0, 0, 0, 179,
+ 0, 180, 183, 186, 178, 184, 177, 187, 186, 188,
+ 189, 0, 190, 191, 192, 187, 193, 188, 189, 189,
+ 190, 191, 192, 194, 193, 195, 188, 192, 196, 197,
+ 198, 194, 194, 195, 199, 187, 196, 197, 198, 193,
+ 190, 191, 199, 200, 198, 0, 201, 202, 203, 206,
+ 204, 200, 205, 195, 201, 202, 203, 206, 204, 200,
+ 205, 207, 208, 209, 210, 211, 0, 0, 0, 207,
+ 208, 209, 210, 211, 212, 202, 204, 213, 205, 214,
+ 203, 0, 212, 215, 217, 213, 216, 214, 218, 207,
+
+ 0, 215, 217, 219, 216, 220, 218, 212, 218, 216,
+ 0, 219, 0, 220, 219, 221, 222, 223, 220, 215,
+ 217, 0, 224, 221, 222, 223, 225, 227, 226, 222,
+ 224, 0, 0, 228, 225, 227, 226, 229, 0, 224,
+ 227, 228, 0, 221, 230, 229, 228, 0, 0, 232,
+ 229, 233, 230, 234, 235, 225, 226, 232, 236, 233,
+ 237, 234, 235, 238, 239, 240, 236, 235, 237, 0,
+ 241, 238, 239, 240, 242, 244, 243, 239, 241, 233,
+ 0, 0, 242, 244, 243, 245, 236, 240, 237, 243,
+ 246, 247, 0, 245, 248, 249, 241, 250, 246, 247,
+
+ 242, 251, 248, 249, 252, 250, 253, 246, 255, 251,
+ 0, 254, 252, 250, 253, 256, 255, 255, 253, 254,
+ 257, 258, 248, 256, 259, 0, 260, 261, 257, 258,
+ 251, 262, 259, 254, 260, 261, 0, 263, 264, 262,
+ 261, 265, 267, 256, 262, 263, 264, 258, 260, 265,
+ 267, 268, 269, 270, 271, 272, 0, 273, 274, 268,
+ 269, 270, 271, 272, 263, 273, 274, 275, 276, 0,
+ 277, 274, 278, 279, 280, 275, 276, 268, 277, 281,
+ 278, 279, 280, 272, 283, 282, 284, 281, 0, 285,
+ 0, 276, 283, 282, 284, 279, 282, 285, 285, 286,
+
+ 287, 288, 289, 280, 290, 291, 292, 286, 287, 288,
+ 289, 293, 290, 291, 292, 289, 294, 295, 296, 293,
+ 0, 297, 298, 293, 294, 295, 296, 299, 292, 297,
+ 298, 301, 300, 297, 0, 299, 295, 0, 302, 301,
+ 300, 303, 294, 304, 296, 300, 302, 305, 0, 303,
+ 0, 304, 0, 0, 0, 305, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 302, 307, 307, 307, 307, 307, 307, 307, 307,
+ 307, 308, 308, 308, 308, 308, 308, 308, 308, 308,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 310,
+
+ 0, 310, 311, 311, 311, 312, 312, 0, 312, 313,
+ 313, 313, 313, 0, 313, 313, 313, 313, 314, 314,
+ 314, 314, 314, 314, 314, 314, 314, 315, 315, 315,
+ 0, 315, 315, 315, 315, 315, 316, 0, 316, 316,
+ 316, 316, 316, 316, 316, 317, 0, 0, 0, 0,
+ 0, 317, 318, 318, 0, 318, 319, 0, 319, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306
} ;
static yy_state_type yy_last_accepting_state;
@@ -961,9 +856,9 @@ string_append(
stringbuf_len += len;
}
-#line 964 "lexyy.cc"
+#line 859 "lexyy.cc"
-#line 966 "lexyy.cc"
+#line 861 "lexyy.cc"
#define INITIAL 0
#define comment 1
@@ -1184,7 +1079,7 @@ YY_DECL
#line 112 "pars0lex.l"
-#line 1187 "lexyy.cc"
+#line 1082 "lexyy.cc"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -1211,13 +1106,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 404 )
+ if ( yy_current_state >= 307 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
- while ( yy_current_state != 403 );
+ while ( yy_current_state != 306 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
@@ -1436,554 +1331,407 @@ case 18:
YY_RULE_SETUP
#line 252 "pars0lex.l"
{
- return(PARS_OUT_TOKEN);
+ return(PARS_INT_TOKEN);
}
YY_BREAK
case 19:
YY_RULE_SETUP
#line 256 "pars0lex.l"
{
- return(PARS_BINARY_TOKEN);
+ return(PARS_CHAR_TOKEN);
}
YY_BREAK
case 20:
YY_RULE_SETUP
#line 260 "pars0lex.l"
{
- return(PARS_BLOB_TOKEN);
+ return(PARS_IS_TOKEN);
}
YY_BREAK
case 21:
YY_RULE_SETUP
#line 264 "pars0lex.l"
{
- return(PARS_INT_TOKEN);
+ return(PARS_BEGIN_TOKEN);
}
YY_BREAK
case 22:
YY_RULE_SETUP
#line 268 "pars0lex.l"
{
- return(PARS_INT_TOKEN);
+ return(PARS_END_TOKEN);
}
YY_BREAK
case 23:
YY_RULE_SETUP
#line 272 "pars0lex.l"
{
- return(PARS_FLOAT_TOKEN);
+ return(PARS_IF_TOKEN);
}
YY_BREAK
case 24:
YY_RULE_SETUP
#line 276 "pars0lex.l"
{
- return(PARS_CHAR_TOKEN);
+ return(PARS_THEN_TOKEN);
}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 280 "pars0lex.l"
{
- return(PARS_IS_TOKEN);
+ return(PARS_ELSE_TOKEN);
}
YY_BREAK
case 26:
YY_RULE_SETUP
#line 284 "pars0lex.l"
{
- return(PARS_BEGIN_TOKEN);
+ return(PARS_ELSIF_TOKEN);
}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 288 "pars0lex.l"
{
- return(PARS_END_TOKEN);
+ return(PARS_LOOP_TOKEN);
}
YY_BREAK
case 28:
YY_RULE_SETUP
#line 292 "pars0lex.l"
{
- return(PARS_IF_TOKEN);
+ return(PARS_WHILE_TOKEN);
}
YY_BREAK
case 29:
YY_RULE_SETUP
#line 296 "pars0lex.l"
{
- return(PARS_THEN_TOKEN);
+ return(PARS_RETURN_TOKEN);
}
YY_BREAK
case 30:
YY_RULE_SETUP
#line 300 "pars0lex.l"
{
- return(PARS_ELSE_TOKEN);
+ return(PARS_SELECT_TOKEN);
}
YY_BREAK
case 31:
YY_RULE_SETUP
#line 304 "pars0lex.l"
{
- return(PARS_ELSIF_TOKEN);
+ return(PARS_COUNT_TOKEN);
}
YY_BREAK
case 32:
YY_RULE_SETUP
#line 308 "pars0lex.l"
{
- return(PARS_LOOP_TOKEN);
+ return(PARS_FROM_TOKEN);
}
YY_BREAK
case 33:
YY_RULE_SETUP
#line 312 "pars0lex.l"
{
- return(PARS_WHILE_TOKEN);
+ return(PARS_WHERE_TOKEN);
}
YY_BREAK
case 34:
YY_RULE_SETUP
#line 316 "pars0lex.l"
{
- return(PARS_RETURN_TOKEN);
+ return(PARS_FOR_TOKEN);
}
YY_BREAK
case 35:
YY_RULE_SETUP
#line 320 "pars0lex.l"
{
- return(PARS_SELECT_TOKEN);
+ return(PARS_ORDER_TOKEN);
}
YY_BREAK
case 36:
YY_RULE_SETUP
#line 324 "pars0lex.l"
{
- return(PARS_SUM_TOKEN);
+ return(PARS_BY_TOKEN);
}
YY_BREAK
case 37:
YY_RULE_SETUP
#line 328 "pars0lex.l"
{
- return(PARS_COUNT_TOKEN);
+ return(PARS_ASC_TOKEN);
}
YY_BREAK
case 38:
YY_RULE_SETUP
#line 332 "pars0lex.l"
{
- return(PARS_DISTINCT_TOKEN);
+ return(PARS_DESC_TOKEN);
}
YY_BREAK
case 39:
YY_RULE_SETUP
#line 336 "pars0lex.l"
{
- return(PARS_FROM_TOKEN);
+ return(PARS_INSERT_TOKEN);
}
YY_BREAK
case 40:
YY_RULE_SETUP
#line 340 "pars0lex.l"
{
- return(PARS_WHERE_TOKEN);
+ return(PARS_INTO_TOKEN);
}
YY_BREAK
case 41:
YY_RULE_SETUP
#line 344 "pars0lex.l"
{
- return(PARS_FOR_TOKEN);
+ return(PARS_VALUES_TOKEN);
}
YY_BREAK
case 42:
YY_RULE_SETUP
#line 348 "pars0lex.l"
{
- return(PARS_READ_TOKEN);
+ return(PARS_UPDATE_TOKEN);
}
YY_BREAK
case 43:
YY_RULE_SETUP
#line 352 "pars0lex.l"
{
- return(PARS_ORDER_TOKEN);
+ return(PARS_SET_TOKEN);
}
YY_BREAK
case 44:
YY_RULE_SETUP
#line 356 "pars0lex.l"
{
- return(PARS_BY_TOKEN);
+ return(PARS_DELETE_TOKEN);
}
YY_BREAK
case 45:
YY_RULE_SETUP
#line 360 "pars0lex.l"
{
- return(PARS_ASC_TOKEN);
+ return(PARS_CURRENT_TOKEN);
}
YY_BREAK
case 46:
YY_RULE_SETUP
#line 364 "pars0lex.l"
{
- return(PARS_DESC_TOKEN);
+ return(PARS_OF_TOKEN);
}
YY_BREAK
case 47:
YY_RULE_SETUP
#line 368 "pars0lex.l"
{
- return(PARS_INSERT_TOKEN);
+ return(PARS_CREATE_TOKEN);
}
YY_BREAK
case 48:
YY_RULE_SETUP
#line 372 "pars0lex.l"
{
- return(PARS_INTO_TOKEN);
+ return(PARS_TABLE_TOKEN);
}
YY_BREAK
case 49:
YY_RULE_SETUP
#line 376 "pars0lex.l"
{
- return(PARS_VALUES_TOKEN);
+ return(PARS_INDEX_TOKEN);
}
YY_BREAK
case 50:
YY_RULE_SETUP
#line 380 "pars0lex.l"
{
- return(PARS_UPDATE_TOKEN);
+ return(PARS_UNIQUE_TOKEN);
}
YY_BREAK
case 51:
YY_RULE_SETUP
#line 384 "pars0lex.l"
{
- return(PARS_SET_TOKEN);
+ return(PARS_CLUSTERED_TOKEN);
}
YY_BREAK
case 52:
YY_RULE_SETUP
#line 388 "pars0lex.l"
{
- return(PARS_DELETE_TOKEN);
+ return(PARS_ON_TOKEN);
}
YY_BREAK
case 53:
YY_RULE_SETUP
#line 392 "pars0lex.l"
{
- return(PARS_CURRENT_TOKEN);
+ return(PARS_DECLARE_TOKEN);
}
YY_BREAK
case 54:
YY_RULE_SETUP
#line 396 "pars0lex.l"
{
- return(PARS_OF_TOKEN);
+ return(PARS_CURSOR_TOKEN);
}
YY_BREAK
case 55:
YY_RULE_SETUP
#line 400 "pars0lex.l"
{
- return(PARS_CREATE_TOKEN);
+ return(PARS_OPEN_TOKEN);
}
YY_BREAK
case 56:
YY_RULE_SETUP
#line 404 "pars0lex.l"
{
- return(PARS_TABLE_TOKEN);
+ return(PARS_FETCH_TOKEN);
}
YY_BREAK
case 57:
YY_RULE_SETUP
#line 408 "pars0lex.l"
{
- return(PARS_COMPACT_TOKEN);
+ return(PARS_CLOSE_TOKEN);
}
YY_BREAK
case 58:
YY_RULE_SETUP
#line 412 "pars0lex.l"
{
- return(PARS_BLOCK_SIZE_TOKEN);
+ return(PARS_NOTFOUND_TOKEN);
}
YY_BREAK
case 59:
YY_RULE_SETUP
#line 416 "pars0lex.l"
{
- return(PARS_INDEX_TOKEN);
+ return(PARS_TO_BINARY_TOKEN);
}
YY_BREAK
case 60:
YY_RULE_SETUP
#line 420 "pars0lex.l"
{
- return(PARS_UNIQUE_TOKEN);
+ return(PARS_SUBSTR_TOKEN);
}
YY_BREAK
case 61:
YY_RULE_SETUP
#line 424 "pars0lex.l"
{
- return(PARS_CLUSTERED_TOKEN);
+ return(PARS_CONCAT_TOKEN);
}
YY_BREAK
case 62:
YY_RULE_SETUP
#line 428 "pars0lex.l"
{
- return(PARS_ON_TOKEN);
+ return(PARS_INSTR_TOKEN);
}
YY_BREAK
case 63:
YY_RULE_SETUP
#line 432 "pars0lex.l"
{
- return(PARS_DECLARE_TOKEN);
+ return(PARS_LENGTH_TOKEN);
}
YY_BREAK
case 64:
YY_RULE_SETUP
#line 436 "pars0lex.l"
{
- return(PARS_CURSOR_TOKEN);
+ return(PARS_COMMIT_TOKEN);
}
YY_BREAK
case 65:
YY_RULE_SETUP
#line 440 "pars0lex.l"
{
- return(PARS_OPEN_TOKEN);
+ return(PARS_ROLLBACK_TOKEN);
}
YY_BREAK
case 66:
YY_RULE_SETUP
#line 444 "pars0lex.l"
{
- return(PARS_FETCH_TOKEN);
+ return(PARS_WORK_TOKEN);
}
YY_BREAK
case 67:
YY_RULE_SETUP
#line 448 "pars0lex.l"
{
- return(PARS_CLOSE_TOKEN);
+ return(PARS_EXIT_TOKEN);
}
YY_BREAK
case 68:
YY_RULE_SETUP
#line 452 "pars0lex.l"
{
- return(PARS_NOTFOUND_TOKEN);
+ return(PARS_FUNCTION_TOKEN);
}
YY_BREAK
case 69:
YY_RULE_SETUP
#line 456 "pars0lex.l"
{
- return(PARS_TO_CHAR_TOKEN);
+ return(PARS_LOCK_TOKEN);
}
YY_BREAK
case 70:
YY_RULE_SETUP
#line 460 "pars0lex.l"
{
- return(PARS_TO_NUMBER_TOKEN);
+ return(PARS_SHARE_TOKEN);
}
YY_BREAK
case 71:
YY_RULE_SETUP
#line 464 "pars0lex.l"
{
- return(PARS_TO_BINARY_TOKEN);
+ return(PARS_MODE_TOKEN);
}
YY_BREAK
case 72:
YY_RULE_SETUP
#line 468 "pars0lex.l"
{
- return(PARS_BINARY_TO_NUMBER_TOKEN);
+ return(PARS_LIKE_TOKEN);
}
YY_BREAK
case 73:
YY_RULE_SETUP
#line 472 "pars0lex.l"
{
- return(PARS_SUBSTR_TOKEN);
+ return(PARS_BIGINT_TOKEN);
}
YY_BREAK
case 74:
YY_RULE_SETUP
#line 476 "pars0lex.l"
{
- return(PARS_REPLSTR_TOKEN);
-}
- YY_BREAK
-case 75:
-YY_RULE_SETUP
-#line 480 "pars0lex.l"
-{
- return(PARS_CONCAT_TOKEN);
-}
- YY_BREAK
-case 76:
-YY_RULE_SETUP
-#line 484 "pars0lex.l"
-{
- return(PARS_INSTR_TOKEN);
-}
- YY_BREAK
-case 77:
-YY_RULE_SETUP
-#line 488 "pars0lex.l"
-{
- return(PARS_LENGTH_TOKEN);
-}
- YY_BREAK
-case 78:
-YY_RULE_SETUP
-#line 492 "pars0lex.l"
-{
- return(PARS_SYSDATE_TOKEN);
-}
- YY_BREAK
-case 79:
-YY_RULE_SETUP
-#line 496 "pars0lex.l"
-{
- return(PARS_PRINTF_TOKEN);
-}
- YY_BREAK
-case 80:
-YY_RULE_SETUP
-#line 500 "pars0lex.l"
-{
- return(PARS_ASSERT_TOKEN);
-}
- YY_BREAK
-case 81:
-YY_RULE_SETUP
-#line 504 "pars0lex.l"
-{
- return(PARS_RND_TOKEN);
-}
- YY_BREAK
-case 82:
-YY_RULE_SETUP
-#line 508 "pars0lex.l"
-{
- return(PARS_RND_STR_TOKEN);
-}
- YY_BREAK
-case 83:
-YY_RULE_SETUP
-#line 512 "pars0lex.l"
-{
- return(PARS_ROW_PRINTF_TOKEN);
-}
- YY_BREAK
-case 84:
-YY_RULE_SETUP
-#line 516 "pars0lex.l"
-{
- return(PARS_COMMIT_TOKEN);
-}
- YY_BREAK
-case 85:
-YY_RULE_SETUP
-#line 520 "pars0lex.l"
-{
- return(PARS_ROLLBACK_TOKEN);
-}
- YY_BREAK
-case 86:
-YY_RULE_SETUP
-#line 524 "pars0lex.l"
-{
- return(PARS_WORK_TOKEN);
-}
- YY_BREAK
-case 87:
-YY_RULE_SETUP
-#line 528 "pars0lex.l"
-{
- return(PARS_UNSIGNED_TOKEN);
-}
- YY_BREAK
-case 88:
-YY_RULE_SETUP
-#line 532 "pars0lex.l"
-{
- return(PARS_EXIT_TOKEN);
-}
- YY_BREAK
-case 89:
-YY_RULE_SETUP
-#line 536 "pars0lex.l"
-{
- return(PARS_FUNCTION_TOKEN);
-}
- YY_BREAK
-case 90:
-YY_RULE_SETUP
-#line 540 "pars0lex.l"
-{
- return(PARS_LOCK_TOKEN);
-}
- YY_BREAK
-case 91:
-YY_RULE_SETUP
-#line 544 "pars0lex.l"
-{
- return(PARS_SHARE_TOKEN);
-}
- YY_BREAK
-case 92:
-YY_RULE_SETUP
-#line 548 "pars0lex.l"
-{
- return(PARS_MODE_TOKEN);
-}
- YY_BREAK
-case 93:
-YY_RULE_SETUP
-#line 552 "pars0lex.l"
-{
- return(PARS_LIKE_TOKEN);
-}
- YY_BREAK
-case 94:
-YY_RULE_SETUP
-#line 556 "pars0lex.l"
-{
- return(PARS_BIGINT_TOKEN);
-}
- YY_BREAK
-case 95:
-YY_RULE_SETUP
-#line 560 "pars0lex.l"
-{
yylval = sym_tab_add_id(pars_sym_tab_global,
(byte*) yytext,
ut_strlen(yytext));
return(PARS_ID_TOKEN);
}
YY_BREAK
-case 96:
+case 75:
YY_RULE_SETUP
-#line 567 "pars0lex.l"
+#line 483 "pars0lex.l"
{
yylval = sym_tab_add_id(pars_sym_tab_global,
(byte*) yytext,
@@ -1991,192 +1739,192 @@ YY_RULE_SETUP
return(PARS_TABLE_NAME_TOKEN);
}
YY_BREAK
-case 97:
+case 76:
YY_RULE_SETUP
-#line 574 "pars0lex.l"
+#line 490 "pars0lex.l"
{
return(PARS_DDOT_TOKEN);
}
YY_BREAK
-case 98:
+case 77:
YY_RULE_SETUP
-#line 578 "pars0lex.l"
+#line 494 "pars0lex.l"
{
return(PARS_ASSIGN_TOKEN);
}
YY_BREAK
-case 99:
+case 78:
YY_RULE_SETUP
-#line 582 "pars0lex.l"
+#line 498 "pars0lex.l"
{
return(PARS_LE_TOKEN);
}
YY_BREAK
-case 100:
+case 79:
YY_RULE_SETUP
-#line 586 "pars0lex.l"
+#line 502 "pars0lex.l"
{
return(PARS_GE_TOKEN);
}
YY_BREAK
-case 101:
+case 80:
YY_RULE_SETUP
-#line 590 "pars0lex.l"
+#line 506 "pars0lex.l"
{
return(PARS_NE_TOKEN);
}
YY_BREAK
-case 102:
+case 81:
YY_RULE_SETUP
-#line 594 "pars0lex.l"
+#line 510 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 103:
+case 82:
YY_RULE_SETUP
-#line 599 "pars0lex.l"
+#line 515 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 104:
+case 83:
YY_RULE_SETUP
-#line 604 "pars0lex.l"
+#line 520 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 105:
+case 84:
YY_RULE_SETUP
-#line 609 "pars0lex.l"
+#line 525 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 106:
+case 85:
YY_RULE_SETUP
-#line 614 "pars0lex.l"
+#line 530 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 107:
+case 86:
YY_RULE_SETUP
-#line 619 "pars0lex.l"
+#line 535 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 108:
+case 87:
YY_RULE_SETUP
-#line 624 "pars0lex.l"
+#line 540 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 109:
+case 88:
YY_RULE_SETUP
-#line 629 "pars0lex.l"
+#line 545 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 110:
+case 89:
YY_RULE_SETUP
-#line 634 "pars0lex.l"
+#line 550 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 111:
+case 90:
YY_RULE_SETUP
-#line 639 "pars0lex.l"
+#line 555 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 112:
+case 91:
YY_RULE_SETUP
-#line 644 "pars0lex.l"
+#line 560 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 113:
+case 92:
YY_RULE_SETUP
-#line 649 "pars0lex.l"
+#line 565 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 114:
+case 93:
YY_RULE_SETUP
-#line 654 "pars0lex.l"
+#line 570 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 115:
+case 94:
YY_RULE_SETUP
-#line 659 "pars0lex.l"
+#line 575 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 116:
+case 95:
YY_RULE_SETUP
-#line 664 "pars0lex.l"
+#line 580 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
-case 117:
+case 96:
YY_RULE_SETUP
-#line 669 "pars0lex.l"
+#line 585 "pars0lex.l"
BEGIN(comment); /* eat up comment */
YY_BREAK
-case 118:
-/* rule 118 can match eol */
+case 97:
+/* rule 97 can match eol */
YY_RULE_SETUP
-#line 671 "pars0lex.l"
+#line 587 "pars0lex.l"
YY_BREAK
-case 119:
-/* rule 119 can match eol */
+case 98:
+/* rule 98 can match eol */
YY_RULE_SETUP
-#line 672 "pars0lex.l"
+#line 588 "pars0lex.l"
YY_BREAK
-case 120:
+case 99:
YY_RULE_SETUP
-#line 673 "pars0lex.l"
+#line 589 "pars0lex.l"
BEGIN(INITIAL);
YY_BREAK
-case 121:
-/* rule 121 can match eol */
+case 100:
+/* rule 100 can match eol */
YY_RULE_SETUP
-#line 675 "pars0lex.l"
+#line 591 "pars0lex.l"
/* eat up whitespace */
YY_BREAK
-case 122:
+case 101:
YY_RULE_SETUP
-#line 678 "pars0lex.l"
+#line 594 "pars0lex.l"
{
fprintf(stderr,"Unrecognized character: %02x\n",
*yytext);
@@ -2186,12 +1934,12 @@ YY_RULE_SETUP
return(0);
}
YY_BREAK
-case 123:
+case 102:
YY_RULE_SETUP
-#line 687 "pars0lex.l"
+#line 603 "pars0lex.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 2194 "lexyy.cc"
+#line 1942 "lexyy.cc"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(comment):
case YY_STATE_EOF(quoted):
@@ -2492,7 +2240,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 404 )
+ if ( yy_current_state >= 307 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -2520,11 +2268,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 404 )
+ if ( yy_current_state >= 307 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- yy_is_jam = (yy_current_state == 403);
+ yy_is_jam = (yy_current_state == 306);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -3077,7 +2825,7 @@ static void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 687 "pars0lex.l"
+#line 603 "pars0lex.l"
/**********************************************************************
diff --git a/storage/innobase/pars/pars0grm.cc b/storage/innobase/pars/pars0grm.cc
index a0a09771106..7e10a783310 100644
--- a/storage/innobase/pars/pars0grm.cc
+++ b/storage/innobase/pars/pars0grm.cc
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.4.2. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+ Inc.
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
@@ -40,11 +41,14 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
+/* Undocumented macros, especially those whose name start with YY_,
+ are private implementation details. Do not rely on them. */
+
/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.4"
+#define YYBISON_VERSION "3.4.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -61,8 +65,8 @@
-/* Copy the first part of user declarations. */
-#line 29 "pars0grm.y" /* yacc.c:339 */
+/* First part of user prologue. */
+#line 29 "pars0grm.y"
/* The value of the semantic attribute is a pointer to a query tree node
que_node_t */
@@ -81,13 +85,17 @@ que_node_t */
int
yylex(void);
-#line 85 "pars0grm.cc" /* yacc.c:339 */
+#line 89 "pars0grm.cc"
# ifndef YY_NULLPTR
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# if defined __cplusplus
+# if 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
# else
-# define YY_NULLPTR 0
+# define YY_NULLPTR ((void*)0)
# endif
# endif
@@ -99,8 +107,8 @@ yylex(void);
# define YYERROR_VERBOSE 0
#endif
-/* In a future release of Bison, this section will be replaced
- by #include "pars0grm.tab.h". */
+/* Use api.header.include to #include this header
+ instead of duplicating it here. */
#ifndef YY_YY_PARS0GRM_TAB_H_INCLUDED
# define YY_YY_PARS0GRM_TAB_H_INCLUDED
/* Debug traces. */
@@ -129,91 +137,71 @@ extern int yydebug;
PARS_NE_TOKEN = 268,
PARS_PROCEDURE_TOKEN = 269,
PARS_IN_TOKEN = 270,
- PARS_OUT_TOKEN = 271,
- PARS_BINARY_TOKEN = 272,
- PARS_BLOB_TOKEN = 273,
- PARS_INT_TOKEN = 274,
- PARS_FLOAT_TOKEN = 275,
- PARS_CHAR_TOKEN = 276,
- PARS_IS_TOKEN = 277,
- PARS_BEGIN_TOKEN = 278,
- PARS_END_TOKEN = 279,
- PARS_IF_TOKEN = 280,
- PARS_THEN_TOKEN = 281,
- PARS_ELSE_TOKEN = 282,
- PARS_ELSIF_TOKEN = 283,
- PARS_LOOP_TOKEN = 284,
- PARS_WHILE_TOKEN = 285,
- PARS_RETURN_TOKEN = 286,
- PARS_SELECT_TOKEN = 287,
- PARS_SUM_TOKEN = 288,
- PARS_COUNT_TOKEN = 289,
- PARS_DISTINCT_TOKEN = 290,
- PARS_FROM_TOKEN = 291,
- PARS_WHERE_TOKEN = 292,
- PARS_FOR_TOKEN = 293,
- PARS_DDOT_TOKEN = 294,
- PARS_READ_TOKEN = 295,
- PARS_ORDER_TOKEN = 296,
- PARS_BY_TOKEN = 297,
- PARS_ASC_TOKEN = 298,
- PARS_DESC_TOKEN = 299,
- PARS_INSERT_TOKEN = 300,
- PARS_INTO_TOKEN = 301,
- PARS_VALUES_TOKEN = 302,
- PARS_UPDATE_TOKEN = 303,
- PARS_SET_TOKEN = 304,
- PARS_DELETE_TOKEN = 305,
- PARS_CURRENT_TOKEN = 306,
- PARS_OF_TOKEN = 307,
- PARS_CREATE_TOKEN = 308,
- PARS_TABLE_TOKEN = 309,
- PARS_INDEX_TOKEN = 310,
- PARS_UNIQUE_TOKEN = 311,
- PARS_CLUSTERED_TOKEN = 312,
- PARS_ON_TOKEN = 313,
- PARS_ASSIGN_TOKEN = 314,
- PARS_DECLARE_TOKEN = 315,
- PARS_CURSOR_TOKEN = 316,
- PARS_SQL_TOKEN = 317,
- PARS_OPEN_TOKEN = 318,
- PARS_FETCH_TOKEN = 319,
- PARS_CLOSE_TOKEN = 320,
- PARS_NOTFOUND_TOKEN = 321,
- PARS_TO_CHAR_TOKEN = 322,
- PARS_TO_NUMBER_TOKEN = 323,
- PARS_TO_BINARY_TOKEN = 324,
- PARS_BINARY_TO_NUMBER_TOKEN = 325,
- PARS_SUBSTR_TOKEN = 326,
- PARS_REPLSTR_TOKEN = 327,
- PARS_CONCAT_TOKEN = 328,
- PARS_INSTR_TOKEN = 329,
- PARS_LENGTH_TOKEN = 330,
- PARS_SYSDATE_TOKEN = 331,
- PARS_PRINTF_TOKEN = 332,
- PARS_ASSERT_TOKEN = 333,
- PARS_RND_TOKEN = 334,
- PARS_RND_STR_TOKEN = 335,
- PARS_ROW_PRINTF_TOKEN = 336,
- PARS_COMMIT_TOKEN = 337,
- PARS_ROLLBACK_TOKEN = 338,
- PARS_WORK_TOKEN = 339,
- PARS_UNSIGNED_TOKEN = 340,
- PARS_EXIT_TOKEN = 341,
- PARS_FUNCTION_TOKEN = 342,
- PARS_LOCK_TOKEN = 343,
- PARS_SHARE_TOKEN = 344,
- PARS_MODE_TOKEN = 345,
- PARS_LIKE_TOKEN = 346,
- PARS_LIKE_TOKEN_EXACT = 347,
- PARS_LIKE_TOKEN_PREFIX = 348,
- PARS_LIKE_TOKEN_SUFFIX = 349,
- PARS_LIKE_TOKEN_SUBSTR = 350,
- PARS_TABLE_NAME_TOKEN = 351,
- PARS_COMPACT_TOKEN = 352,
- PARS_BLOCK_SIZE_TOKEN = 353,
- PARS_BIGINT_TOKEN = 354,
- NEG = 355
+ PARS_INT_TOKEN = 271,
+ PARS_CHAR_TOKEN = 272,
+ PARS_IS_TOKEN = 273,
+ PARS_BEGIN_TOKEN = 274,
+ PARS_END_TOKEN = 275,
+ PARS_IF_TOKEN = 276,
+ PARS_THEN_TOKEN = 277,
+ PARS_ELSE_TOKEN = 278,
+ PARS_ELSIF_TOKEN = 279,
+ PARS_LOOP_TOKEN = 280,
+ PARS_WHILE_TOKEN = 281,
+ PARS_RETURN_TOKEN = 282,
+ PARS_SELECT_TOKEN = 283,
+ PARS_COUNT_TOKEN = 284,
+ PARS_FROM_TOKEN = 285,
+ PARS_WHERE_TOKEN = 286,
+ PARS_FOR_TOKEN = 287,
+ PARS_DDOT_TOKEN = 288,
+ PARS_ORDER_TOKEN = 289,
+ PARS_BY_TOKEN = 290,
+ PARS_ASC_TOKEN = 291,
+ PARS_DESC_TOKEN = 292,
+ PARS_INSERT_TOKEN = 293,
+ PARS_INTO_TOKEN = 294,
+ PARS_VALUES_TOKEN = 295,
+ PARS_UPDATE_TOKEN = 296,
+ PARS_SET_TOKEN = 297,
+ PARS_DELETE_TOKEN = 298,
+ PARS_CURRENT_TOKEN = 299,
+ PARS_OF_TOKEN = 300,
+ PARS_CREATE_TOKEN = 301,
+ PARS_TABLE_TOKEN = 302,
+ PARS_INDEX_TOKEN = 303,
+ PARS_UNIQUE_TOKEN = 304,
+ PARS_CLUSTERED_TOKEN = 305,
+ PARS_ON_TOKEN = 306,
+ PARS_ASSIGN_TOKEN = 307,
+ PARS_DECLARE_TOKEN = 308,
+ PARS_CURSOR_TOKEN = 309,
+ PARS_SQL_TOKEN = 310,
+ PARS_OPEN_TOKEN = 311,
+ PARS_FETCH_TOKEN = 312,
+ PARS_CLOSE_TOKEN = 313,
+ PARS_NOTFOUND_TOKEN = 314,
+ PARS_TO_BINARY_TOKEN = 315,
+ PARS_SUBSTR_TOKEN = 316,
+ PARS_CONCAT_TOKEN = 317,
+ PARS_INSTR_TOKEN = 318,
+ PARS_LENGTH_TOKEN = 319,
+ PARS_COMMIT_TOKEN = 320,
+ PARS_ROLLBACK_TOKEN = 321,
+ PARS_WORK_TOKEN = 322,
+ PARS_EXIT_TOKEN = 323,
+ PARS_FUNCTION_TOKEN = 324,
+ PARS_LOCK_TOKEN = 325,
+ PARS_SHARE_TOKEN = 326,
+ PARS_MODE_TOKEN = 327,
+ PARS_LIKE_TOKEN = 328,
+ PARS_LIKE_TOKEN_EXACT = 329,
+ PARS_LIKE_TOKEN_PREFIX = 330,
+ PARS_LIKE_TOKEN_SUFFIX = 331,
+ PARS_LIKE_TOKEN_SUBSTR = 332,
+ PARS_TABLE_NAME_TOKEN = 333,
+ PARS_BIGINT_TOKEN = 334,
+ NEG = 335
};
#endif
@@ -231,9 +219,7 @@ int yyparse (void);
#endif /* !YY_YY_PARS0GRM_TAB_H_INCLUDED */
-/* Copy the second part of user declarations. */
-#line 237 "pars0grm.cc" /* yacc.c:358 */
#ifdef short
# undef short
@@ -254,13 +240,13 @@ typedef signed char yytype_int8;
#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
-typedef unsigned short int yytype_uint16;
+typedef unsigned short yytype_uint16;
#endif
#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
-typedef short int yytype_int16;
+typedef short yytype_int16;
#endif
#ifndef YYSIZE_T
@@ -272,7 +258,7 @@ typedef short int yytype_int16;
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned int
+# define YYSIZE_T unsigned
# endif
#endif
@@ -308,15 +294,6 @@ typedef short int yytype_int16;
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
#endif
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
-# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
-# endif
-#endif
-
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
@@ -324,7 +301,7 @@ typedef short int yytype_int16;
# define YYUSE(E) /* empty */
#endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
@@ -344,6 +321,8 @@ typedef short int yytype_int16;
#endif
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -475,42 +454,42 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 5
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 780
+#define YYLAST 603
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 116
+#define YYNTOKENS 96
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 72
+#define YYNNTS 64
/* YYNRULES -- Number of rules. */
-#define YYNRULES 178
+#define YYNRULES 150
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 345
+#define YYNSTATES 300
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 355
+#define YYMAXUTOK 335
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+ ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
+ as returned by yylex. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 108, 2, 2,
- 110, 111, 105, 104, 113, 103, 2, 106, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 109,
- 101, 100, 102, 112, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 88, 2, 2,
+ 90, 91, 85, 84, 93, 83, 2, 86, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 89,
+ 81, 80, 82, 92, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 114, 2, 115, 2, 2, 2, 2,
+ 2, 2, 2, 94, 2, 95, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -531,33 +510,29 @@ static const yytype_uint8 yytranslate[] =
45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 107
+ 75, 76, 77, 78, 79, 87
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 160, 160, 163, 164, 165, 166, 167, 168, 169,
- 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
- 180, 181, 182, 183, 184, 188, 189, 194, 195, 197,
- 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
- 208, 209, 211, 212, 213, 214, 215, 216, 217, 218,
- 219, 221, 226, 227, 228, 229, 231, 232, 233, 234,
- 235, 236, 237, 240, 242, 243, 247, 253, 258, 259,
- 260, 264, 268, 269, 274, 275, 276, 281, 282, 283,
- 287, 288, 293, 299, 306, 307, 308, 313, 315, 318,
- 322, 323, 327, 328, 333, 334, 339, 340, 341, 345,
- 346, 353, 368, 373, 376, 384, 390, 391, 396, 402,
- 411, 419, 427, 434, 442, 450, 456, 463, 469, 470,
- 475, 476, 478, 482, 489, 495, 505, 509, 513, 520,
- 527, 531, 539, 548, 549, 554, 555, 560, 561, 567,
- 568, 574, 575, 580, 581, 586, 597, 598, 603, 604,
- 608, 609, 613, 627, 628, 632, 637, 642, 643, 644,
- 645, 646, 650, 655, 663, 664, 665, 670, 676, 678,
- 679, 683, 691, 697, 698, 701, 703, 704, 708
+ 0, 140, 140, 143, 144, 145, 146, 147, 148, 149,
+ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
+ 160, 161, 162, 166, 167, 172, 173, 175, 176, 177,
+ 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
+ 189, 190, 191, 192, 193, 194, 195, 196, 197, 199,
+ 204, 205, 206, 207, 208, 211, 213, 214, 218, 224,
+ 228, 229, 234, 235, 236, 241, 242, 243, 247, 248,
+ 256, 257, 258, 263, 265, 268, 272, 273, 277, 278,
+ 283, 284, 289, 290, 291, 295, 296, 303, 318, 323,
+ 326, 334, 340, 341, 346, 352, 361, 369, 377, 384,
+ 392, 400, 407, 413, 414, 419, 420, 422, 426, 433,
+ 439, 449, 453, 457, 464, 471, 475, 483, 492, 493,
+ 498, 499, 504, 505, 511, 519, 520, 525, 526, 530,
+ 531, 535, 549, 550, 554, 559, 564, 565, 566, 570,
+ 576, 578, 579, 583, 591, 597, 598, 601, 603, 604,
+ 608
};
#endif
@@ -570,39 +545,30 @@ static const char *const yytname[] =
"PARS_STR_LIT", "PARS_NULL_LIT", "PARS_ID_TOKEN", "PARS_AND_TOKEN",
"PARS_OR_TOKEN", "PARS_NOT_TOKEN", "PARS_GE_TOKEN", "PARS_LE_TOKEN",
"PARS_NE_TOKEN", "PARS_PROCEDURE_TOKEN", "PARS_IN_TOKEN",
- "PARS_OUT_TOKEN", "PARS_BINARY_TOKEN", "PARS_BLOB_TOKEN",
- "PARS_INT_TOKEN", "PARS_FLOAT_TOKEN", "PARS_CHAR_TOKEN", "PARS_IS_TOKEN",
- "PARS_BEGIN_TOKEN", "PARS_END_TOKEN", "PARS_IF_TOKEN", "PARS_THEN_TOKEN",
- "PARS_ELSE_TOKEN", "PARS_ELSIF_TOKEN", "PARS_LOOP_TOKEN",
- "PARS_WHILE_TOKEN", "PARS_RETURN_TOKEN", "PARS_SELECT_TOKEN",
- "PARS_SUM_TOKEN", "PARS_COUNT_TOKEN", "PARS_DISTINCT_TOKEN",
+ "PARS_INT_TOKEN", "PARS_CHAR_TOKEN", "PARS_IS_TOKEN", "PARS_BEGIN_TOKEN",
+ "PARS_END_TOKEN", "PARS_IF_TOKEN", "PARS_THEN_TOKEN", "PARS_ELSE_TOKEN",
+ "PARS_ELSIF_TOKEN", "PARS_LOOP_TOKEN", "PARS_WHILE_TOKEN",
+ "PARS_RETURN_TOKEN", "PARS_SELECT_TOKEN", "PARS_COUNT_TOKEN",
"PARS_FROM_TOKEN", "PARS_WHERE_TOKEN", "PARS_FOR_TOKEN",
- "PARS_DDOT_TOKEN", "PARS_READ_TOKEN", "PARS_ORDER_TOKEN",
- "PARS_BY_TOKEN", "PARS_ASC_TOKEN", "PARS_DESC_TOKEN",
- "PARS_INSERT_TOKEN", "PARS_INTO_TOKEN", "PARS_VALUES_TOKEN",
- "PARS_UPDATE_TOKEN", "PARS_SET_TOKEN", "PARS_DELETE_TOKEN",
- "PARS_CURRENT_TOKEN", "PARS_OF_TOKEN", "PARS_CREATE_TOKEN",
- "PARS_TABLE_TOKEN", "PARS_INDEX_TOKEN", "PARS_UNIQUE_TOKEN",
- "PARS_CLUSTERED_TOKEN", "PARS_ON_TOKEN", "PARS_ASSIGN_TOKEN",
- "PARS_DECLARE_TOKEN", "PARS_CURSOR_TOKEN", "PARS_SQL_TOKEN",
- "PARS_OPEN_TOKEN", "PARS_FETCH_TOKEN", "PARS_CLOSE_TOKEN",
- "PARS_NOTFOUND_TOKEN", "PARS_TO_CHAR_TOKEN", "PARS_TO_NUMBER_TOKEN",
- "PARS_TO_BINARY_TOKEN", "PARS_BINARY_TO_NUMBER_TOKEN",
- "PARS_SUBSTR_TOKEN", "PARS_REPLSTR_TOKEN", "PARS_CONCAT_TOKEN",
- "PARS_INSTR_TOKEN", "PARS_LENGTH_TOKEN", "PARS_SYSDATE_TOKEN",
- "PARS_PRINTF_TOKEN", "PARS_ASSERT_TOKEN", "PARS_RND_TOKEN",
- "PARS_RND_STR_TOKEN", "PARS_ROW_PRINTF_TOKEN", "PARS_COMMIT_TOKEN",
- "PARS_ROLLBACK_TOKEN", "PARS_WORK_TOKEN", "PARS_UNSIGNED_TOKEN",
- "PARS_EXIT_TOKEN", "PARS_FUNCTION_TOKEN", "PARS_LOCK_TOKEN",
- "PARS_SHARE_TOKEN", "PARS_MODE_TOKEN", "PARS_LIKE_TOKEN",
- "PARS_LIKE_TOKEN_EXACT", "PARS_LIKE_TOKEN_PREFIX",
+ "PARS_DDOT_TOKEN", "PARS_ORDER_TOKEN", "PARS_BY_TOKEN", "PARS_ASC_TOKEN",
+ "PARS_DESC_TOKEN", "PARS_INSERT_TOKEN", "PARS_INTO_TOKEN",
+ "PARS_VALUES_TOKEN", "PARS_UPDATE_TOKEN", "PARS_SET_TOKEN",
+ "PARS_DELETE_TOKEN", "PARS_CURRENT_TOKEN", "PARS_OF_TOKEN",
+ "PARS_CREATE_TOKEN", "PARS_TABLE_TOKEN", "PARS_INDEX_TOKEN",
+ "PARS_UNIQUE_TOKEN", "PARS_CLUSTERED_TOKEN", "PARS_ON_TOKEN",
+ "PARS_ASSIGN_TOKEN", "PARS_DECLARE_TOKEN", "PARS_CURSOR_TOKEN",
+ "PARS_SQL_TOKEN", "PARS_OPEN_TOKEN", "PARS_FETCH_TOKEN",
+ "PARS_CLOSE_TOKEN", "PARS_NOTFOUND_TOKEN", "PARS_TO_BINARY_TOKEN",
+ "PARS_SUBSTR_TOKEN", "PARS_CONCAT_TOKEN", "PARS_INSTR_TOKEN",
+ "PARS_LENGTH_TOKEN", "PARS_COMMIT_TOKEN", "PARS_ROLLBACK_TOKEN",
+ "PARS_WORK_TOKEN", "PARS_EXIT_TOKEN", "PARS_FUNCTION_TOKEN",
+ "PARS_LOCK_TOKEN", "PARS_SHARE_TOKEN", "PARS_MODE_TOKEN",
+ "PARS_LIKE_TOKEN", "PARS_LIKE_TOKEN_EXACT", "PARS_LIKE_TOKEN_PREFIX",
"PARS_LIKE_TOKEN_SUFFIX", "PARS_LIKE_TOKEN_SUBSTR",
- "PARS_TABLE_NAME_TOKEN", "PARS_COMPACT_TOKEN", "PARS_BLOCK_SIZE_TOKEN",
- "PARS_BIGINT_TOKEN", "'='", "'<'", "'>'", "'-'", "'+'", "'*'", "'/'",
- "NEG", "'%'", "';'", "'('", "')'", "'?'", "','", "'{'", "'}'", "$accept",
- "top_statement", "statement", "statement_list", "exp", "function_name",
- "question_mark_list", "stored_procedure_call",
- "predefined_procedure_call", "predefined_procedure_name",
+ "PARS_TABLE_NAME_TOKEN", "PARS_BIGINT_TOKEN", "'='", "'<'", "'>'", "'-'",
+ "'+'", "'*'", "'/'", "NEG", "'%'", "';'", "'('", "')'", "'?'", "','",
+ "'{'", "'}'", "$accept", "top_statement", "statement", "statement_list",
+ "exp", "function_name", "question_mark_list", "stored_procedure_call",
"user_function_call", "table_list", "variable_list", "exp_list",
"select_item", "select_item_list", "select_list", "search_condition",
"for_update_clause", "lock_shared_clause", "order_direction",
@@ -611,16 +577,14 @@ static const char *const yytname[] =
"cursor_positioned", "update_statement_start",
"update_statement_searched", "update_statement_positioned",
"delete_statement_start", "delete_statement_searched",
- "delete_statement_positioned", "row_printf_statement",
- "assignment_statement", "elsif_element", "elsif_list", "else_part",
- "if_statement", "while_statement", "for_statement", "exit_statement",
- "return_statement", "open_cursor_statement", "close_cursor_statement",
- "fetch_statement", "column_def", "column_def_list", "opt_column_len",
- "opt_unsigned", "opt_not_null", "compact", "block_size", "create_table",
- "column_list", "unique_def", "clustered_def", "create_index",
- "table_name", "commit_statement", "rollback_statement", "type_name",
- "parameter_declaration", "parameter_declaration_list",
- "variable_declaration", "variable_declaration_list",
+ "delete_statement_positioned", "assignment_statement", "elsif_element",
+ "elsif_list", "else_part", "if_statement", "while_statement",
+ "for_statement", "exit_statement", "return_statement",
+ "open_cursor_statement", "close_cursor_statement", "fetch_statement",
+ "column_def", "column_def_list", "opt_column_len", "opt_not_null",
+ "create_table", "column_list", "unique_def", "clustered_def",
+ "create_index", "table_name", "commit_statement", "rollback_statement",
+ "type_name", "variable_declaration", "variable_declaration_list",
"cursor_declaration", "function_declaration", "declaration",
"declaration_list", "procedure_definition", YY_NULLPTR
};
@@ -639,17 +603,15 @@ static const yytype_uint16 yytoknum[] =
305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
- 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
- 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
- 61, 60, 62, 45, 43, 42, 47, 355, 37, 59,
+ 61, 60, 62, 45, 43, 42, 47, 335, 37, 59,
40, 41, 63, 44, 123, 125
};
# endif
-#define YYPACT_NINF -176
+#define YYPACT_NINF -129
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-176)))
+ (!!((Yystate) == (-129)))
#define YYTABLE_NINF -1
@@ -660,41 +622,36 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- 20, 21, 41, -64, -59, -176, -176, 48, 54, -176,
- -74, 12, 12, 45, 48, -176, -176, -176, -176, -176,
- -176, -176, 69, -176, 12, -176, 8, -32, -43, -176,
- -176, -176, -176, -13, -176, 72, 81, 445, -176, 75,
- -11, 42, 530, 530, -176, 16, 99, 67, -3, 78,
- -14, 108, 109, 110, -176, -176, -176, 86, 36, 44,
- -176, 122, -176, 216, -176, 22, 23, 25, 6, 26,
- 93, 27, 33, 93, 46, 51, 53, 56, 61, 63,
- 64, 66, 68, 70, 71, 76, 79, 89, 94, 95,
- 86, -176, 530, -176, -176, -176, -176, 43, 530, 49,
- -176, -176, -176, -176, -176, -176, -176, -176, -176, -176,
- -176, 530, 530, 570, 77, 603, 80, 96, -176, 674,
- -176, -38, 118, 161, -3, -176, -176, 129, -3, -3,
- -176, 148, -176, 163, -176, -176, -176, -176, 97, -176,
- -176, -176, 530, -176, 100, -176, -176, 481, -176, -176,
- -176, -176, -176, -176, -176, -176, -176, -176, -176, -176,
- -176, -176, -176, -176, -176, -176, -176, -176, -176, -176,
- 102, 674, 149, 220, 155, 14, 91, 530, 530, 530,
- 530, 530, 445, 219, 530, 530, 530, 530, 530, 530,
- 530, 530, 445, 530, -24, 218, 267, -3, 530, -176,
- 221, -176, 117, -176, 179, 228, 124, 674, -65, 530,
- 185, 674, -176, -176, -176, -176, 220, 220, 19, 19,
- 674, 136, -176, 19, 19, 19, 3, 3, 14, 14,
- -57, 326, 554, 231, 128, -176, 130, -176, -1, -176,
- 610, 142, -176, 131, 238, 242, 141, -176, 130, -176,
- -52, -176, 530, -51, 246, 445, 530, -176, 227, 233,
- -176, 229, -176, 151, -176, 252, 530, -3, 225, 530,
- 530, 221, 12, -176, -48, 207, 156, 153, 164, 674,
- -176, -176, 445, 626, -176, 250, -176, -176, -176, -176,
- 230, 194, 655, 674, -176, 173, 187, 238, -3, -176,
- -176, -176, 445, -176, -176, 270, 245, 445, 284, 204,
- -176, 192, -176, 181, 445, 203, 253, -176, 386, 193,
- -176, 286, 205, -176, 296, 217, 299, 279, -176, 303,
- -176, 307, -176, -47, -176, 30, -176, -176, -176, -176,
- 305, -176, -176, -176, -176
+ 5, 34, 46, -28, -41, -129, -129, -12, 45, 57,
+ 23, -129, 9, -129, -129, -129, 20, -9, -129, -129,
+ -129, -129, 2, -129, 83, 87, 278, -129, 93, 28,
+ 71, 427, 427, -129, 335, 105, 85, -1, 104, -27,
+ 129, 132, 133, 76, 77, -129, 141, -129, 149, -129,
+ 61, 19, 62, 118, 65, 66, 118, 68, 69, 70,
+ 72, 73, 74, 75, 78, 79, 82, 84, 89, 90,
+ 91, 94, 138, -129, 427, -129, -129, -129, -129, 86,
+ 427, 96, -129, -129, -129, -129, -129, 427, 427, 438,
+ 92, 454, 95, -129, 1, -129, -24, 130, 157, -1,
+ -129, -129, 144, -1, -1, -129, 139, -129, 154, -129,
+ -129, -129, 98, -129, -129, -129, 108, -129, -129, 345,
+ -129, -129, -129, -129, -129, -129, -129, -129, -129, -129,
+ -129, -129, -129, -129, -129, -129, -129, -129, -129, -129,
+ -129, 112, 1, 135, 285, 143, -8, 15, 427, 427,
+ 427, 427, 427, 278, 203, 427, 427, 427, 427, 427,
+ 427, 427, 427, 278, 124, 204, 381, -1, 427, -129,
+ 209, -129, 120, -129, 173, 215, 131, 427, 180, 1,
+ -129, -129, -129, -129, 285, 285, 30, 30, 1, 10,
+ -129, 30, 30, 30, 60, 60, -8, -8, 1, -39,
+ 192, 137, -129, 136, -129, -13, -129, 472, 146, -129,
+ 147, 225, 227, 151, -129, 136, -129, -21, 0, 229,
+ 278, 427, -129, 213, 219, -129, 427, 220, -129, 237,
+ 427, -1, 214, 427, 427, 209, 23, -129, 14, 196,
+ 160, 158, 162, -129, -129, 278, 486, -129, 231, 1,
+ -129, -129, -129, 218, 194, 517, 1, -129, 175, -129,
+ 225, -1, -129, -129, -129, 278, -129, -129, 251, 234,
+ 278, 266, 260, -129, 181, 278, 201, 239, -129, 235,
+ 184, 271, -129, 272, 208, 275, 258, -129, -129, -129,
+ 17, -129, -7, -129, -129, 277, -129, -129, -129, -129
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -702,67 +659,60 @@ static const yytype_int16 yypact[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 0, 0, 0, 0, 0, 1, 2, 164, 0, 165,
- 0, 0, 0, 0, 0, 160, 161, 157, 159, 158,
- 162, 163, 168, 166, 0, 169, 175, 0, 0, 170,
- 173, 174, 176, 0, 167, 0, 0, 0, 177, 0,
- 0, 0, 0, 0, 127, 84, 0, 0, 0, 0,
- 148, 0, 0, 0, 68, 69, 70, 0, 0, 0,
- 126, 0, 25, 0, 3, 0, 0, 0, 0, 0,
- 90, 0, 0, 90, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 2, 0, 0, 140,
+ 0, 141, 147, 136, 138, 137, 0, 0, 142, 145,
+ 146, 148, 0, 139, 0, 0, 0, 149, 0, 0,
+ 0, 0, 0, 112, 70, 0, 0, 0, 0, 127,
+ 0, 0, 0, 0, 0, 111, 0, 23, 0, 3,
+ 0, 0, 0, 76, 0, 0, 76, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 172, 0, 29, 30, 31, 32, 27, 0, 33,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 0, 0, 0, 0, 0, 0, 0, 87, 80,
- 85, 89, 0, 0, 0, 153, 154, 0, 0, 0,
- 149, 150, 128, 0, 129, 115, 155, 156, 0, 178,
- 26, 4, 77, 11, 0, 104, 12, 0, 110, 111,
- 16, 17, 113, 114, 14, 15, 13, 10, 8, 5,
- 6, 7, 9, 18, 20, 19, 23, 24, 21, 22,
- 0, 116, 0, 49, 0, 38, 0, 0, 0, 0,
+ 0, 0, 0, 144, 0, 27, 28, 29, 30, 25,
+ 0, 31, 50, 51, 52, 53, 54, 0, 0, 0,
+ 0, 0, 0, 73, 68, 71, 75, 0, 0, 0,
+ 132, 133, 0, 0, 0, 128, 129, 113, 0, 114,
+ 134, 135, 0, 150, 24, 10, 0, 90, 11, 0,
+ 96, 97, 14, 15, 99, 100, 12, 13, 9, 7,
+ 4, 5, 6, 8, 16, 18, 17, 21, 22, 19,
+ 20, 0, 101, 0, 47, 0, 36, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 77, 0, 0, 0, 74, 0, 0, 0, 102,
- 0, 112, 0, 151, 0, 74, 63, 78, 0, 77,
- 0, 91, 171, 50, 51, 39, 47, 48, 44, 45,
- 46, 120, 41, 40, 42, 43, 35, 34, 36, 37,
- 0, 0, 0, 0, 0, 75, 88, 86, 90, 72,
- 0, 0, 106, 109, 0, 0, 75, 131, 130, 64,
- 0, 67, 0, 0, 0, 0, 0, 118, 122, 0,
- 28, 0, 83, 0, 81, 0, 0, 0, 92, 0,
- 0, 0, 0, 133, 0, 0, 0, 0, 0, 79,
- 103, 108, 121, 0, 119, 0, 124, 82, 76, 73,
- 0, 94, 0, 105, 107, 135, 141, 0, 0, 71,
- 66, 65, 0, 123, 93, 0, 99, 0, 0, 137,
- 142, 143, 134, 0, 117, 0, 0, 101, 0, 0,
- 138, 139, 0, 145, 0, 0, 0, 0, 136, 0,
- 132, 0, 146, 0, 95, 96, 125, 140, 144, 152,
- 0, 97, 98, 100, 147
+ 0, 0, 65, 0, 0, 62, 0, 0, 0, 88,
+ 0, 98, 0, 130, 0, 62, 55, 65, 0, 77,
+ 143, 48, 49, 37, 45, 46, 42, 43, 44, 105,
+ 39, 38, 40, 41, 33, 32, 34, 35, 66, 0,
+ 0, 0, 63, 74, 72, 76, 60, 0, 0, 92,
+ 95, 0, 0, 63, 116, 115, 56, 0, 0, 0,
+ 0, 0, 103, 107, 0, 26, 0, 0, 69, 0,
+ 0, 0, 78, 0, 0, 0, 0, 118, 0, 0,
+ 0, 0, 0, 89, 94, 106, 0, 104, 0, 67,
+ 109, 64, 61, 0, 80, 0, 91, 93, 120, 124,
+ 0, 0, 59, 58, 57, 0, 108, 79, 0, 85,
+ 0, 0, 122, 119, 0, 102, 0, 0, 87, 0,
+ 0, 0, 117, 0, 0, 0, 0, 121, 123, 125,
+ 0, 81, 82, 110, 131, 0, 83, 84, 86, 126
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -176, -176, -62, -175, -40, -176, -176, -176, -176, -176,
- -176, -176, 111, -166, 119, -176, -176, -67, -176, -176,
- -176, -176, -33, -176, -176, 47, -176, 240, -176, -176,
- -176, -176, -176, -176, -176, -176, 59, -176, -176, -176,
- -176, -176, -176, -176, -176, -176, -176, 17, -176, -176,
- -176, -176, -176, -176, -176, -176, -176, -176, -176, -115,
- -176, -176, -12, 313, -176, 293, -176, -176, -176, 295,
- -176, -176
+ -129, -129, -48, -128, -30, -129, -129, -129, -129, -129,
+ 113, 110, 123, -129, -129, -52, -129, -129, -129, -129,
+ -40, -129, -129, 55, -129, 238, -129, -129, -129, -129,
+ -129, -129, -129, 88, -129, -129, -129, -129, -129, -129,
+ -129, -129, -129, -129, 35, -129, -129, -129, -129, -129,
+ -129, -129, -129, -96, -129, -129, 81, 290, -129, -129,
+ -129, 286, -129, -129
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 2, 62, 63, 207, 114, 250, 64, 65, 66,
- 247, 238, 236, 208, 120, 121, 122, 148, 291, 306,
- 343, 317, 67, 68, 69, 242, 243, 149, 70, 71,
- 72, 73, 74, 75, 76, 77, 257, 258, 259, 78,
- 79, 80, 81, 82, 83, 84, 85, 273, 274, 309,
- 321, 330, 311, 323, 86, 333, 131, 204, 87, 127,
- 88, 89, 20, 9, 10, 25, 26, 30, 31, 32,
- 33, 3
+ -1, 2, 47, 48, 94, 90, 217, 49, 214, 205,
+ 203, 199, 95, 96, 97, 120, 254, 269, 298, 278,
+ 50, 51, 52, 209, 210, 121, 53, 54, 55, 56,
+ 57, 58, 59, 222, 223, 224, 60, 61, 62, 63,
+ 64, 65, 66, 67, 237, 238, 272, 282, 68, 290,
+ 106, 174, 69, 102, 70, 71, 16, 11, 12, 19,
+ 20, 21, 22, 3
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -770,232 +720,189 @@ static const yytype_int16 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint16 yytable[] =
{
- 21, 140, 113, 115, 125, 119, 152, 221, 195, 199,
- 37, 233, 27, 201, 202, 24, 181, 231, 35, 93,
- 94, 95, 96, 97, 135, 230, 98, 181, 4, 15,
- 16, 17, 181, 18, 1, 145, 266, 13, 45, 14,
- 129, 5, 130, 253, 36, 6, 251, 28, 252, 116,
- 117, 7, 171, 144, 260, 8, 252, 170, 173, 277,
- 280, 278, 252, 296, 339, 297, 340, 22, 28, 11,
- 12, 175, 176, 341, 342, 196, 24, 34, 99, 39,
- 282, 234, 239, 100, 101, 102, 103, 104, 40, 105,
- 106, 107, 108, 126, 183, 109, 110, 90, 91, 177,
- 178, 92, 179, 180, 181, 183, 123, 211, 189, 190,
- 183, 19, 267, 124, 128, 132, 133, 134, 45, 111,
- 136, 118, 187, 188, 189, 190, 112, 314, 137, 138,
- 147, 141, 318, 142, 143, 146, 150, 216, 217, 218,
- 219, 220, 151, 41, 223, 224, 225, 226, 227, 228,
- 229, 172, 289, 232, 197, 154, 119, 174, 240, 140,
- 155, 42, 156, 255, 256, 157, 43, 44, 45, 140,
- 158, 268, 159, 160, 46, 161, 198, 162, 200, 163,
- 164, 47, 183, 313, 48, 165, 49, 191, 166, 50,
- 193, 184, 185, 186, 187, 188, 189, 190, 167, 51,
- 52, 53, 215, 168, 169, 203, 194, 206, 54, 205,
- 209, 212, 279, 55, 56, 213, 283, 57, 58, 59,
- 140, 214, 60, 41, 222, 235, 211, 244, 241, 292,
- 293, 179, 180, 181, 245, 246, 249, 254, 263, 264,
- 139, 42, 270, 265, 271, 272, 43, 44, 45, 275,
- 61, 276, 140, 281, 46, 256, 140, 285, 286, 288,
- 295, 47, 287, 290, 48, 298, 49, 299, 300, 50,
- 93, 94, 95, 96, 97, 303, 301, 98, 304, 51,
- 52, 53, 305, 308, 310, 315, 316, 319, 54, 320,
- 322, 324, 325, 55, 56, 326, 329, 57, 58, 59,
- 116, 117, 60, 332, 328, 331, 335, 334, 336, 337,
- 338, 183, 344, 153, 312, 237, 248, 284, 294, 29,
- 184, 185, 186, 187, 188, 189, 190, 23, 38, 99,
- 61, 0, 0, 41, 100, 101, 102, 103, 104, 0,
- 105, 106, 107, 108, 0, 0, 109, 110, 0, 0,
- 261, 42, 0, 0, 0, 0, 43, 44, 45, 0,
- 0, 0, 0, 0, 46, 0, 0, 0, 0, 0,
- 111, 47, 0, 0, 48, 0, 49, 112, 0, 50,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 51,
- 52, 53, 0, 41, 0, 0, 0, 0, 54, 0,
- 0, 0, 0, 55, 56, 0, 0, 57, 58, 59,
- 327, 42, 60, 0, 0, 0, 43, 44, 45, 0,
- 0, 0, 0, 0, 46, 0, 0, 0, 0, 0,
- 0, 47, 0, 0, 48, 0, 49, 0, 0, 50,
- 61, 0, 0, 0, 0, 0, 0, 0, 0, 51,
- 52, 53, 41, 0, 0, 0, 0, 0, 54, 0,
- 0, 0, 0, 55, 56, 0, 0, 57, 58, 59,
- 42, 0, 60, 0, 0, 43, 44, 45, 0, 0,
- 0, 0, 0, 46, 93, 94, 95, 96, 97, 0,
- 47, 98, 0, 48, 0, 49, 0, 0, 50, 0,
- 61, 0, 0, 0, 0, 0, 0, 0, 51, 52,
- 53, 0, 0, 0, 0, 0, 0, 54, 0, 0,
- 0, 0, 55, 56, 0, 0, 57, 58, 59, 0,
- 0, 60, 210, 93, 94, 95, 96, 97, 0, 0,
- 98, 0, 0, 99, 0, 0, 0, 0, 100, 101,
- 102, 103, 104, 0, 105, 106, 107, 108, 0, 61,
- 109, 110, 177, 178, 0, 179, 180, 181, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 177, 178,
- 0, 179, 180, 181, 111, 0, 0, 0, 0, 0,
- 0, 112, 99, 0, 0, 0, 182, 100, 101, 102,
- 103, 104, 0, 105, 106, 107, 108, 0, 0, 109,
- 110, 177, 178, 0, 179, 180, 181, 0, 177, 178,
- 0, 179, 180, 181, 0, 0, 0, 0, 0, 0,
- 0, 0, 192, 111, 177, 178, 0, 179, 180, 181,
- 112, 0, 0, 0, 0, 183, 0, 0, 0, 269,
- 0, 0, 302, 0, 184, 185, 186, 187, 188, 189,
- 190, 183, 0, 177, 178, 262, 179, 180, 181, 0,
- 184, 185, 186, 187, 188, 189, 190, 0, 0, 0,
- 0, 0, 177, 178, 307, 179, 180, 181, 0, 0,
- 0, 0, 0, 0, 183, 0, 0, 0, 0, 0,
- 0, 183, 0, 184, 185, 186, 187, 188, 189, 190,
- 184, 185, 186, 187, 188, 189, 190, 183, 0, 0,
- 0, 0, 0, 0, 0, 0, 184, 185, 186, 187,
- 188, 189, 190, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 183, 0, 0, 0,
- 0, 0, 0, 0, 0, 184, 185, 186, 187, 188,
- 189, 190, 0, 0, 0, 183, 0, 0, 0, 0,
- 0, 0, 0, 0, 184, 185, 186, 187, 188, 189,
- 190
+ 114, 89, 91, 169, 124, 152, 100, 171, 172, 148,
+ 149, 117, 150, 151, 152, 165, 10, 30, 230, 1,
+ 104, 26, 105, 148, 149, 189, 150, 151, 152, 296,
+ 297, 31, 141, 220, 221, 200, 32, 33, 34, 13,
+ 14, 4, 35, 152, 142, 24, 5, 34, 36, 7,
+ 144, 37, 225, 38, 226, 17, 39, 146, 147, 116,
+ 25, 6, 17, 9, 10, 154, 40, 41, 42, 166,
+ 241, 206, 242, 152, 154, 43, 44, 101, 45, 8,
+ 231, 155, 156, 157, 158, 159, 160, 161, 154, 179,
+ 28, 243, 245, 226, 29, 155, 156, 157, 158, 159,
+ 160, 161, 15, 154, 46, 259, 183, 260, 294, 23,
+ 295, 72, 98, 158, 159, 160, 161, 73, 184, 185,
+ 186, 187, 188, 74, 99, 191, 192, 193, 194, 195,
+ 196, 197, 198, 154, 103, 252, 107, 275, 207, 108,
+ 109, 114, 279, 110, 111, 160, 161, 198, 112, 119,
+ 115, 118, 114, 232, 122, 123, 30, 126, 127, 128,
+ 167, 129, 130, 131, 132, 274, 34, 133, 134, 113,
+ 31, 135, 168, 136, 143, 32, 33, 34, 137, 138,
+ 139, 35, 162, 140, 145, 164, 170, 36, 176, 173,
+ 37, 246, 38, 175, 181, 39, 249, 114, 177, 30,
+ 179, 180, 182, 255, 256, 40, 41, 42, 190, 201,
+ 211, 202, 227, 31, 43, 44, 208, 45, 32, 33,
+ 34, 212, 213, 216, 35, 219, 234, 114, 228, 229,
+ 36, 114, 236, 37, 239, 38, 244, 221, 39, 248,
+ 235, 240, 30, 46, 251, 250, 253, 261, 40, 41,
+ 42, 262, 266, 263, 264, 286, 31, 43, 44, 267,
+ 45, 32, 33, 34, 268, 271, 276, 35, 277, 280,
+ 281, 283, 284, 36, 285, 287, 37, 288, 38, 289,
+ 291, 39, 292, 293, 299, 30, 46, 218, 215, 204,
+ 257, 40, 41, 42, 125, 273, 150, 151, 152, 31,
+ 43, 44, 18, 45, 32, 33, 34, 0, 27, 0,
+ 35, 247, 0, 0, 0, 0, 36, 258, 0, 37,
+ 0, 38, 0, 0, 39, 0, 0, 0, 0, 46,
+ 0, 0, 0, 0, 40, 41, 42, 0, 75, 76,
+ 77, 78, 79, 43, 44, 80, 45, 0, 75, 76,
+ 77, 78, 79, 0, 0, 80, 0, 0, 154, 0,
+ 0, 0, 0, 0, 92, 155, 156, 157, 158, 159,
+ 160, 161, 46, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 75, 76, 77, 78, 79, 178,
+ 81, 80, 0, 0, 0, 82, 83, 84, 85, 86,
+ 81, 0, 0, 0, 0, 82, 83, 84, 85, 86,
+ 92, 0, 0, 0, 0, 0, 0, 0, 87, 0,
+ 93, 0, 0, 0, 0, 88, 0, 0, 87, 0,
+ 75, 76, 77, 78, 79, 88, 81, 80, 0, 0,
+ 0, 82, 83, 84, 85, 86, 148, 149, 0, 150,
+ 151, 152, 0, 0, 0, 0, 0, 0, 0, 0,
+ 153, 0, 148, 149, 87, 150, 151, 152, 0, 0,
+ 0, 88, 0, 0, 0, 0, 0, 0, 0, 163,
+ 148, 149, 81, 150, 151, 152, 0, 82, 83, 84,
+ 85, 86, 0, 0, 148, 149, 0, 150, 151, 152,
+ 0, 0, 0, 0, 0, 233, 0, 0, 265, 0,
+ 87, 154, 0, 0, 0, 0, 0, 88, 155, 156,
+ 157, 158, 159, 160, 161, 148, 149, 154, 150, 151,
+ 152, 0, 0, 0, 155, 156, 157, 158, 159, 160,
+ 161, 0, 270, 0, 0, 154, 0, 0, 0, 0,
+ 0, 0, 155, 156, 157, 158, 159, 160, 161, 154,
+ 0, 0, 0, 0, 0, 0, 155, 156, 157, 158,
+ 159, 160, 161, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 154, 0, 0, 0, 0, 0, 0, 155, 156, 157,
+ 158, 159, 160, 161
};
static const yytype_int16 yycheck[] =
{
- 12, 63, 42, 43, 7, 45, 73, 182, 46, 124,
- 23, 35, 24, 128, 129, 7, 13, 192, 61, 3,
- 4, 5, 6, 7, 57, 191, 10, 13, 7, 17,
- 18, 19, 13, 21, 14, 68, 37, 111, 32, 113,
- 54, 0, 56, 209, 87, 109, 111, 60, 113, 33,
- 34, 110, 92, 47, 111, 7, 113, 90, 98, 111,
- 111, 113, 113, 111, 111, 113, 113, 22, 60, 15,
- 16, 111, 112, 43, 44, 113, 7, 109, 62, 7,
- 255, 105, 197, 67, 68, 69, 70, 71, 7, 73,
- 74, 75, 76, 96, 91, 79, 80, 22, 109, 8,
- 9, 59, 11, 12, 13, 91, 7, 147, 105, 106,
- 91, 99, 113, 46, 36, 7, 7, 7, 32, 103,
- 84, 105, 103, 104, 105, 106, 110, 302, 84, 7,
- 37, 109, 307, 110, 109, 109, 109, 177, 178, 179,
- 180, 181, 109, 7, 184, 185, 186, 187, 188, 189,
- 190, 108, 267, 193, 36, 109, 196, 108, 198, 221,
- 109, 25, 109, 27, 28, 109, 30, 31, 32, 231,
- 109, 238, 109, 109, 38, 109, 15, 109, 49, 109,
- 109, 45, 91, 298, 48, 109, 50, 110, 109, 53,
- 110, 100, 101, 102, 103, 104, 105, 106, 109, 63,
- 64, 65, 111, 109, 109, 57, 110, 110, 72, 46,
- 110, 109, 252, 77, 78, 66, 256, 81, 82, 83,
- 282, 66, 86, 7, 5, 7, 266, 110, 7, 269,
- 270, 11, 12, 13, 55, 7, 112, 52, 7, 111,
- 24, 25, 100, 113, 113, 7, 30, 31, 32, 7,
- 114, 110, 314, 7, 38, 28, 318, 24, 29, 7,
- 272, 45, 111, 38, 48, 58, 50, 111, 115, 53,
- 3, 4, 5, 6, 7, 25, 112, 10, 48, 63,
- 64, 65, 88, 110, 97, 15, 41, 3, 72, 85,
- 98, 110, 89, 77, 78, 42, 10, 81, 82, 83,
- 33, 34, 86, 7, 111, 100, 7, 90, 29, 6,
- 3, 91, 7, 73, 297, 196, 205, 258, 271, 26,
- 100, 101, 102, 103, 104, 105, 106, 14, 33, 62,
- 114, -1, -1, 7, 67, 68, 69, 70, 71, -1,
- 73, 74, 75, 76, -1, -1, 79, 80, -1, -1,
- 24, 25, -1, -1, -1, -1, 30, 31, 32, -1,
- -1, -1, -1, -1, 38, -1, -1, -1, -1, -1,
- 103, 45, -1, -1, 48, -1, 50, 110, -1, 53,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 63,
- 64, 65, -1, 7, -1, -1, -1, -1, 72, -1,
- -1, -1, -1, 77, 78, -1, -1, 81, 82, 83,
- 24, 25, 86, -1, -1, -1, 30, 31, 32, -1,
- -1, -1, -1, -1, 38, -1, -1, -1, -1, -1,
- -1, 45, -1, -1, 48, -1, 50, -1, -1, 53,
- 114, -1, -1, -1, -1, -1, -1, -1, -1, 63,
- 64, 65, 7, -1, -1, -1, -1, -1, 72, -1,
- -1, -1, -1, 77, 78, -1, -1, 81, 82, 83,
- 25, -1, 86, -1, -1, 30, 31, 32, -1, -1,
- -1, -1, -1, 38, 3, 4, 5, 6, 7, -1,
- 45, 10, -1, 48, -1, 50, -1, -1, 53, -1,
- 114, -1, -1, -1, -1, -1, -1, -1, 63, 64,
- 65, -1, -1, -1, -1, -1, -1, 72, -1, -1,
- -1, -1, 77, 78, -1, -1, 81, 82, 83, -1,
- -1, 86, 51, 3, 4, 5, 6, 7, -1, -1,
- 10, -1, -1, 62, -1, -1, -1, -1, 67, 68,
- 69, 70, 71, -1, 73, 74, 75, 76, -1, 114,
- 79, 80, 8, 9, -1, 11, 12, 13, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 8, 9,
- -1, 11, 12, 13, 103, -1, -1, -1, -1, -1,
- -1, 110, 62, -1, -1, -1, 26, 67, 68, 69,
- 70, 71, -1, 73, 74, 75, 76, -1, -1, 79,
- 80, 8, 9, -1, 11, 12, 13, -1, 8, 9,
- -1, 11, 12, 13, -1, -1, -1, -1, -1, -1,
- -1, -1, 29, 103, 8, 9, -1, 11, 12, 13,
- 110, -1, -1, -1, -1, 91, -1, -1, -1, 39,
- -1, -1, 26, -1, 100, 101, 102, 103, 104, 105,
- 106, 91, -1, 8, 9, 111, 11, 12, 13, -1,
- 100, 101, 102, 103, 104, 105, 106, -1, -1, -1,
- -1, -1, 8, 9, 29, 11, 12, 13, -1, -1,
- -1, -1, -1, -1, 91, -1, -1, -1, -1, -1,
- -1, 91, -1, 100, 101, 102, 103, 104, 105, 106,
- 100, 101, 102, 103, 104, 105, 106, 91, -1, -1,
- -1, -1, -1, -1, -1, -1, 100, 101, 102, 103,
- 104, 105, 106, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 91, -1, -1, -1,
- -1, -1, -1, -1, -1, 100, 101, 102, 103, 104,
- 105, 106, -1, -1, -1, 91, -1, -1, -1, -1,
- -1, -1, -1, -1, 100, 101, 102, 103, 104, 105,
- 106
+ 48, 31, 32, 99, 56, 13, 7, 103, 104, 8,
+ 9, 51, 11, 12, 13, 39, 7, 7, 31, 14,
+ 47, 19, 49, 8, 9, 153, 11, 12, 13, 36,
+ 37, 21, 72, 23, 24, 163, 26, 27, 28, 16,
+ 17, 7, 32, 13, 74, 54, 0, 28, 38, 90,
+ 80, 41, 91, 43, 93, 53, 46, 87, 88, 40,
+ 69, 89, 53, 18, 7, 73, 56, 57, 58, 93,
+ 91, 167, 93, 13, 73, 65, 66, 78, 68, 91,
+ 93, 80, 81, 82, 83, 84, 85, 86, 73, 119,
+ 7, 91, 220, 93, 7, 80, 81, 82, 83, 84,
+ 85, 86, 79, 73, 94, 91, 91, 93, 91, 89,
+ 93, 18, 7, 83, 84, 85, 86, 89, 148, 149,
+ 150, 151, 152, 52, 39, 155, 156, 157, 158, 159,
+ 160, 161, 162, 73, 30, 231, 7, 265, 168, 7,
+ 7, 189, 270, 67, 67, 85, 86, 177, 7, 31,
+ 89, 89, 200, 205, 89, 89, 7, 89, 89, 89,
+ 30, 89, 89, 89, 89, 261, 28, 89, 89, 20,
+ 21, 89, 15, 89, 88, 26, 27, 28, 89, 89,
+ 89, 32, 90, 89, 88, 90, 42, 38, 90, 50,
+ 41, 221, 43, 39, 59, 46, 226, 245, 90, 7,
+ 230, 89, 59, 233, 234, 56, 57, 58, 5, 85,
+ 90, 7, 20, 21, 65, 66, 7, 68, 26, 27,
+ 28, 48, 7, 92, 32, 45, 80, 275, 91, 93,
+ 38, 279, 7, 41, 7, 43, 7, 24, 46, 20,
+ 93, 90, 7, 94, 7, 25, 32, 51, 56, 57,
+ 58, 91, 21, 95, 92, 20, 21, 65, 66, 41,
+ 68, 26, 27, 28, 70, 90, 15, 32, 34, 3,
+ 10, 90, 71, 38, 35, 91, 41, 6, 43, 7,
+ 72, 46, 7, 25, 7, 7, 94, 177, 175, 166,
+ 235, 56, 57, 58, 56, 260, 11, 12, 13, 21,
+ 65, 66, 12, 68, 26, 27, 28, -1, 22, -1,
+ 32, 223, -1, -1, -1, -1, 38, 236, -1, 41,
+ -1, 43, -1, -1, 46, -1, -1, -1, -1, 94,
+ -1, -1, -1, -1, 56, 57, 58, -1, 3, 4,
+ 5, 6, 7, 65, 66, 10, 68, -1, 3, 4,
+ 5, 6, 7, -1, -1, 10, -1, -1, 73, -1,
+ -1, -1, -1, -1, 29, 80, 81, 82, 83, 84,
+ 85, 86, 94, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 3, 4, 5, 6, 7, 44,
+ 55, 10, -1, -1, -1, 60, 61, 62, 63, 64,
+ 55, -1, -1, -1, -1, 60, 61, 62, 63, 64,
+ 29, -1, -1, -1, -1, -1, -1, -1, 83, -1,
+ 85, -1, -1, -1, -1, 90, -1, -1, 83, -1,
+ 3, 4, 5, 6, 7, 90, 55, 10, -1, -1,
+ -1, 60, 61, 62, 63, 64, 8, 9, -1, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, 8, 9, 83, 11, 12, 13, -1, -1,
+ -1, 90, -1, -1, -1, -1, -1, -1, -1, 25,
+ 8, 9, 55, 11, 12, 13, -1, 60, 61, 62,
+ 63, 64, -1, -1, 8, 9, -1, 11, 12, 13,
+ -1, -1, -1, -1, -1, 33, -1, -1, 22, -1,
+ 83, 73, -1, -1, -1, -1, -1, 90, 80, 81,
+ 82, 83, 84, 85, 86, 8, 9, 73, 11, 12,
+ 13, -1, -1, -1, 80, 81, 82, 83, 84, 85,
+ 86, -1, 25, -1, -1, 73, -1, -1, -1, -1,
+ -1, -1, 80, 81, 82, 83, 84, 85, 86, 73,
+ -1, -1, -1, -1, -1, -1, 80, 81, 82, 83,
+ 84, 85, 86, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 73, -1, -1, -1, -1, -1, -1, 80, 81, 82,
+ 83, 84, 85, 86
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 14, 117, 187, 7, 0, 109, 110, 7, 179,
- 180, 15, 16, 111, 113, 17, 18, 19, 21, 99,
- 178, 178, 22, 179, 7, 181, 182, 178, 60, 181,
- 183, 184, 185, 186, 109, 61, 87, 23, 185, 7,
- 7, 7, 25, 30, 31, 32, 38, 45, 48, 50,
- 53, 63, 64, 65, 72, 77, 78, 81, 82, 83,
- 86, 114, 118, 119, 123, 124, 125, 138, 139, 140,
- 144, 145, 146, 147, 148, 149, 150, 151, 155, 156,
- 157, 158, 159, 160, 161, 162, 170, 174, 176, 177,
- 22, 109, 59, 3, 4, 5, 6, 7, 10, 62,
- 67, 68, 69, 70, 71, 73, 74, 75, 76, 79,
- 80, 103, 110, 120, 121, 120, 33, 34, 105, 120,
- 130, 131, 132, 7, 46, 7, 96, 175, 36, 54,
- 56, 172, 7, 7, 7, 138, 84, 84, 7, 24,
- 118, 109, 110, 109, 47, 138, 109, 37, 133, 143,
- 109, 109, 133, 143, 109, 109, 109, 109, 109, 109,
- 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
- 138, 120, 108, 120, 108, 120, 120, 8, 9, 11,
- 12, 13, 26, 91, 100, 101, 102, 103, 104, 105,
- 106, 110, 29, 110, 110, 46, 113, 36, 15, 175,
- 49, 175, 175, 57, 173, 46, 110, 120, 129, 110,
- 51, 120, 109, 66, 66, 111, 120, 120, 120, 120,
- 120, 119, 5, 120, 120, 120, 120, 120, 120, 120,
- 129, 119, 120, 35, 105, 7, 128, 130, 127, 175,
- 120, 7, 141, 142, 110, 55, 7, 126, 128, 112,
- 122, 111, 113, 129, 52, 27, 28, 152, 153, 154,
- 111, 24, 111, 7, 111, 113, 37, 113, 133, 39,
- 100, 113, 7, 163, 164, 7, 110, 111, 113, 120,
- 111, 7, 119, 120, 152, 24, 29, 111, 7, 175,
- 38, 134, 120, 120, 141, 178, 111, 113, 58, 111,
- 115, 112, 26, 25, 48, 88, 135, 29, 110, 165,
- 97, 168, 163, 175, 119, 15, 41, 137, 119, 3,
- 85, 166, 98, 169, 110, 89, 42, 24, 111, 10,
- 167, 100, 7, 171, 90, 7, 29, 6, 3, 111,
- 113, 43, 44, 136, 7
+ 0, 14, 97, 159, 7, 0, 89, 90, 91, 18,
+ 7, 153, 154, 16, 17, 79, 152, 53, 153, 155,
+ 156, 157, 158, 89, 54, 69, 19, 157, 7, 7,
+ 7, 21, 26, 27, 28, 32, 38, 41, 43, 46,
+ 56, 57, 58, 65, 66, 68, 94, 98, 99, 103,
+ 116, 117, 118, 122, 123, 124, 125, 126, 127, 128,
+ 132, 133, 134, 135, 136, 137, 138, 139, 144, 148,
+ 150, 151, 18, 89, 52, 3, 4, 5, 6, 7,
+ 10, 55, 60, 61, 62, 63, 64, 83, 90, 100,
+ 101, 100, 29, 85, 100, 108, 109, 110, 7, 39,
+ 7, 78, 149, 30, 47, 49, 146, 7, 7, 7,
+ 67, 67, 7, 20, 98, 89, 40, 116, 89, 31,
+ 111, 121, 89, 89, 111, 121, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 116, 100, 88, 100, 88, 100, 100, 8, 9,
+ 11, 12, 13, 22, 73, 80, 81, 82, 83, 84,
+ 85, 86, 90, 25, 90, 39, 93, 30, 15, 149,
+ 42, 149, 149, 50, 147, 39, 90, 90, 44, 100,
+ 89, 59, 59, 91, 100, 100, 100, 100, 100, 99,
+ 5, 100, 100, 100, 100, 100, 100, 100, 100, 107,
+ 99, 85, 7, 106, 108, 105, 149, 100, 7, 119,
+ 120, 90, 48, 7, 104, 106, 92, 102, 107, 45,
+ 23, 24, 129, 130, 131, 91, 93, 20, 91, 93,
+ 31, 93, 111, 33, 80, 93, 7, 140, 141, 7,
+ 90, 91, 93, 91, 7, 99, 100, 129, 20, 100,
+ 25, 7, 149, 32, 112, 100, 100, 119, 152, 91,
+ 93, 51, 91, 95, 92, 22, 21, 41, 70, 113,
+ 25, 90, 142, 140, 149, 99, 15, 34, 115, 99,
+ 3, 10, 143, 90, 71, 35, 20, 91, 6, 7,
+ 145, 72, 7, 25, 91, 93, 36, 37, 114, 7
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 116, 117, 118, 118, 118, 118, 118, 118, 118,
- 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
- 118, 118, 118, 118, 118, 119, 119, 120, 120, 120,
- 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
- 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
- 120, 120, 121, 121, 121, 121, 121, 121, 121, 121,
- 121, 121, 121, 122, 122, 122, 123, 124, 125, 125,
- 125, 126, 127, 127, 128, 128, 128, 129, 129, 129,
- 130, 130, 130, 130, 131, 131, 131, 132, 132, 132,
- 133, 133, 134, 134, 135, 135, 136, 136, 136, 137,
- 137, 138, 139, 140, 140, 141, 142, 142, 143, 144,
- 145, 146, 147, 148, 149, 150, 151, 152, 153, 153,
- 154, 154, 154, 155, 156, 157, 158, 159, 160, 161,
- 162, 162, 163, 164, 164, 165, 165, 166, 166, 167,
- 167, 168, 168, 169, 169, 170, 171, 171, 172, 172,
- 173, 173, 174, 175, 175, 176, 177, 178, 178, 178,
- 178, 178, 179, 179, 180, 180, 180, 181, 182, 182,
- 182, 183, 184, 185, 185, 186, 186, 186, 187
+ 0, 96, 97, 98, 98, 98, 98, 98, 98, 98,
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
+ 98, 98, 98, 99, 99, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+ 101, 101, 101, 101, 101, 102, 102, 102, 103, 104,
+ 105, 105, 106, 106, 106, 107, 107, 107, 108, 108,
+ 109, 109, 109, 110, 110, 110, 111, 111, 112, 112,
+ 113, 113, 114, 114, 114, 115, 115, 116, 117, 118,
+ 118, 119, 120, 120, 121, 122, 123, 124, 125, 126,
+ 127, 128, 129, 130, 130, 131, 131, 131, 132, 133,
+ 134, 135, 136, 137, 138, 139, 139, 140, 141, 141,
+ 142, 142, 143, 143, 144, 145, 145, 146, 146, 147,
+ 147, 148, 149, 149, 150, 151, 152, 152, 152, 153,
+ 154, 154, 154, 155, 156, 157, 157, 158, 158, 158,
+ 159
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
@@ -1003,22 +910,20 @@ static const yytype_uint8 yyr2[] =
{
0, 2, 2, 1, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 2, 1, 4, 1,
- 1, 1, 1, 1, 3, 3, 3, 3, 2, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
- 3, 3, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 1, 3, 6, 4, 1, 1,
- 1, 3, 1, 3, 0, 1, 3, 0, 1, 3,
- 1, 4, 5, 4, 0, 1, 3, 1, 3, 1,
- 0, 2, 0, 2, 0, 4, 0, 1, 1, 0,
- 4, 8, 3, 5, 2, 3, 1, 3, 4, 4,
- 2, 2, 3, 2, 2, 2, 3, 4, 1, 2,
- 0, 2, 1, 7, 6, 10, 1, 1, 2, 2,
- 4, 4, 5, 1, 3, 0, 3, 0, 1, 0,
- 2, 0, 1, 0, 3, 8, 1, 3, 0, 1,
- 0, 1, 10, 1, 1, 2, 2, 1, 1, 1,
- 1, 1, 3, 3, 0, 1, 3, 3, 0, 1,
- 2, 6, 4, 1, 1, 0, 1, 2, 11
+ 2, 2, 2, 1, 2, 1, 4, 1, 1, 1,
+ 1, 1, 3, 3, 3, 3, 2, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 2, 3, 3,
+ 1, 1, 1, 1, 1, 0, 1, 3, 6, 3,
+ 1, 3, 0, 1, 3, 0, 1, 3, 1, 4,
+ 0, 1, 3, 1, 3, 1, 0, 2, 0, 2,
+ 0, 4, 0, 1, 1, 0, 4, 8, 3, 5,
+ 2, 3, 1, 3, 4, 4, 2, 2, 3, 2,
+ 2, 3, 4, 1, 2, 0, 2, 1, 7, 6,
+ 10, 1, 1, 2, 2, 4, 4, 4, 1, 3,
+ 0, 3, 0, 2, 6, 1, 3, 0, 1, 0,
+ 1, 10, 1, 1, 2, 2, 1, 1, 1, 3,
+ 0, 1, 2, 6, 4, 1, 1, 0, 1, 2,
+ 10
};
@@ -1034,22 +939,22 @@ static const yytype_uint8 yyr2[] =
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
/* Error token number */
#define YYTERROR 1
@@ -1089,37 +994,39 @@ do { \
} while (0)
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT. |
-`----------------------------------------*/
+/*-----------------------------------.
+| Print this symbol's value on YYO. |
+`-----------------------------------*/
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
{
- FILE *yyo = yyoutput;
- YYUSE (yyo);
+ FILE *yyoutput = yyo;
+ YYUSE (yyoutput);
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+ YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
# endif
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO. |
+`---------------------------*/
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
{
- YYFPRINTF (yyoutput, "%s %s (",
+ YYFPRINTF (yyo, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
- YYFPRINTF (yyoutput, ")");
+ yy_symbol_value_print (yyo, yytype, yyvaluep);
+ YYFPRINTF (yyo, ")");
}
/*------------------------------------------------------------------.
@@ -1153,7 +1060,7 @@ do { \
static void
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
{
- unsigned long int yylno = yyrline[yyrule];
+ unsigned long yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
@@ -1164,7 +1071,7 @@ yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
yystos[yyssp[yyi + 1 - yynrhs]],
- &(yyvsp[(yyi + 1) - (yynrhs)])
+ &yyvsp[(yyi + 1) - (yynrhs)]
);
YYFPRINTF (stderr, "\n");
}
@@ -1268,7 +1175,10 @@ yytnamerr (char *yyres, const char *yystr)
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
- /* Fall through. */
+ else
+ goto append;
+
+ append:
default:
if (yyres)
yyres[yyn] = *yyp;
@@ -1286,7 +1196,7 @@ yytnamerr (char *yyres, const char *yystr)
if (! yyres)
return yystrlen (yystr);
- return yystpcpy (yyres, yystr) - yyres;
+ return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
}
# endif
@@ -1364,10 +1274,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yyarg[yycount++] = yytname[yyx];
{
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
}
}
@@ -1379,6 +1289,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
case N: \
yyformat = S; \
break
+ default: /* Avoid compiler warnings. */
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
@@ -1390,9 +1301,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
{
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
if (*yymsg_alloc < yysize)
@@ -1518,23 +1430,33 @@ yyparse (void)
yychar = YYEMPTY; /* Cause a token to be read. */
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
- *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yynewstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ *yyssp = (yytype_int16) yystate;
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
-#ifdef yyoverflow
+# if defined yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
@@ -1550,14 +1472,10 @@ yyparse (void)
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
-
yyss = yyss1;
yyvs = yyvs1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
@@ -1573,35 +1491,33 @@ yyparse (void)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-# undef YYSTACK_RELOCATE
+# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ (unsigned long) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
-
/* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */
@@ -1659,7 +1575,6 @@ yybackup:
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
-
goto yynewstate;
@@ -1674,7 +1589,7 @@ yydefault:
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
@@ -1694,953 +1609,779 @@ yyreduce:
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 25:
-#line 188 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); }
-#line 1701 "pars0grm.cc" /* yacc.c:1646 */
+ case 23:
+#line 166 "pars0grm.y"
+ { yyval = que_node_list_add_last(NULL, yyvsp[0]); }
+#line 1616 "pars0grm.cc"
+ break;
+
+ case 24:
+#line 168 "pars0grm.y"
+ { yyval = que_node_list_add_last(yyvsp[-1], yyvsp[0]); }
+#line 1622 "pars0grm.cc"
+ break;
+
+ case 25:
+#line 172 "pars0grm.y"
+ { yyval = yyvsp[0];}
+#line 1628 "pars0grm.cc"
break;
case 26:
-#line 190 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-1]), (yyvsp[0])); }
-#line 1707 "pars0grm.cc" /* yacc.c:1646 */
+#line 174 "pars0grm.y"
+ { yyval = pars_func(yyvsp[-3], yyvsp[-1]); }
+#line 1634 "pars0grm.cc"
break;
case 27:
-#line 194 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]);}
-#line 1713 "pars0grm.cc" /* yacc.c:1646 */
+#line 175 "pars0grm.y"
+ { yyval = yyvsp[0];}
+#line 1640 "pars0grm.cc"
break;
case 28:
-#line 196 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_func((yyvsp[-3]), (yyvsp[-1])); }
-#line 1719 "pars0grm.cc" /* yacc.c:1646 */
+#line 176 "pars0grm.y"
+ { yyval = yyvsp[0];}
+#line 1646 "pars0grm.cc"
break;
case 29:
-#line 197 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]);}
-#line 1725 "pars0grm.cc" /* yacc.c:1646 */
+#line 177 "pars0grm.y"
+ { yyval = yyvsp[0];}
+#line 1652 "pars0grm.cc"
break;
case 30:
-#line 198 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]);}
-#line 1731 "pars0grm.cc" /* yacc.c:1646 */
+#line 178 "pars0grm.y"
+ { yyval = yyvsp[0];}
+#line 1658 "pars0grm.cc"
break;
case 31:
-#line 199 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]);}
-#line 1737 "pars0grm.cc" /* yacc.c:1646 */
+#line 179 "pars0grm.y"
+ { yyval = yyvsp[0];}
+#line 1664 "pars0grm.cc"
break;
case 32:
-#line 200 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]);}
-#line 1743 "pars0grm.cc" /* yacc.c:1646 */
+#line 180 "pars0grm.y"
+ { yyval = pars_op('+', yyvsp[-2], yyvsp[0]); }
+#line 1670 "pars0grm.cc"
break;
case 33:
-#line 201 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]);}
-#line 1749 "pars0grm.cc" /* yacc.c:1646 */
+#line 181 "pars0grm.y"
+ { yyval = pars_op('-', yyvsp[-2], yyvsp[0]); }
+#line 1676 "pars0grm.cc"
break;
case 34:
-#line 202 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op('+', (yyvsp[-2]), (yyvsp[0])); }
-#line 1755 "pars0grm.cc" /* yacc.c:1646 */
+#line 182 "pars0grm.y"
+ { yyval = pars_op('*', yyvsp[-2], yyvsp[0]); }
+#line 1682 "pars0grm.cc"
break;
case 35:
-#line 203 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op('-', (yyvsp[-2]), (yyvsp[0])); }
-#line 1761 "pars0grm.cc" /* yacc.c:1646 */
+#line 183 "pars0grm.y"
+ { yyval = pars_op('/', yyvsp[-2], yyvsp[0]); }
+#line 1688 "pars0grm.cc"
break;
case 36:
-#line 204 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op('*', (yyvsp[-2]), (yyvsp[0])); }
-#line 1767 "pars0grm.cc" /* yacc.c:1646 */
+#line 184 "pars0grm.y"
+ { yyval = pars_op('-', yyvsp[0], NULL); }
+#line 1694 "pars0grm.cc"
break;
case 37:
-#line 205 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op('/', (yyvsp[-2]), (yyvsp[0])); }
-#line 1773 "pars0grm.cc" /* yacc.c:1646 */
+#line 185 "pars0grm.y"
+ { yyval = yyvsp[-1]; }
+#line 1700 "pars0grm.cc"
break;
case 38:
-#line 206 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op('-', (yyvsp[0]), NULL); }
-#line 1779 "pars0grm.cc" /* yacc.c:1646 */
+#line 186 "pars0grm.y"
+ { yyval = pars_op('=', yyvsp[-2], yyvsp[0]); }
+#line 1706 "pars0grm.cc"
break;
case 39:
-#line 207 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[-1]); }
-#line 1785 "pars0grm.cc" /* yacc.c:1646 */
+#line 188 "pars0grm.y"
+ { yyval = pars_op(PARS_LIKE_TOKEN, yyvsp[-2], yyvsp[0]); }
+#line 1712 "pars0grm.cc"
break;
case 40:
-#line 208 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op('=', (yyvsp[-2]), (yyvsp[0])); }
-#line 1791 "pars0grm.cc" /* yacc.c:1646 */
+#line 189 "pars0grm.y"
+ { yyval = pars_op('<', yyvsp[-2], yyvsp[0]); }
+#line 1718 "pars0grm.cc"
break;
case 41:
-#line 210 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op(PARS_LIKE_TOKEN, (yyvsp[-2]), (yyvsp[0])); }
-#line 1797 "pars0grm.cc" /* yacc.c:1646 */
+#line 190 "pars0grm.y"
+ { yyval = pars_op('>', yyvsp[-2], yyvsp[0]); }
+#line 1724 "pars0grm.cc"
break;
case 42:
-#line 211 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op('<', (yyvsp[-2]), (yyvsp[0])); }
-#line 1803 "pars0grm.cc" /* yacc.c:1646 */
+#line 191 "pars0grm.y"
+ { yyval = pars_op(PARS_GE_TOKEN, yyvsp[-2], yyvsp[0]); }
+#line 1730 "pars0grm.cc"
break;
case 43:
-#line 212 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op('>', (yyvsp[-2]), (yyvsp[0])); }
-#line 1809 "pars0grm.cc" /* yacc.c:1646 */
+#line 192 "pars0grm.y"
+ { yyval = pars_op(PARS_LE_TOKEN, yyvsp[-2], yyvsp[0]); }
+#line 1736 "pars0grm.cc"
break;
case 44:
-#line 213 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op(PARS_GE_TOKEN, (yyvsp[-2]), (yyvsp[0])); }
-#line 1815 "pars0grm.cc" /* yacc.c:1646 */
+#line 193 "pars0grm.y"
+ { yyval = pars_op(PARS_NE_TOKEN, yyvsp[-2], yyvsp[0]); }
+#line 1742 "pars0grm.cc"
break;
case 45:
-#line 214 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op(PARS_LE_TOKEN, (yyvsp[-2]), (yyvsp[0])); }
-#line 1821 "pars0grm.cc" /* yacc.c:1646 */
+#line 194 "pars0grm.y"
+ { yyval = pars_op(PARS_AND_TOKEN, yyvsp[-2], yyvsp[0]); }
+#line 1748 "pars0grm.cc"
break;
case 46:
-#line 215 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op(PARS_NE_TOKEN, (yyvsp[-2]), (yyvsp[0])); }
-#line 1827 "pars0grm.cc" /* yacc.c:1646 */
+#line 195 "pars0grm.y"
+ { yyval = pars_op(PARS_OR_TOKEN, yyvsp[-2], yyvsp[0]); }
+#line 1754 "pars0grm.cc"
break;
case 47:
-#line 216 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op(PARS_AND_TOKEN, (yyvsp[-2]), (yyvsp[0])); }
-#line 1833 "pars0grm.cc" /* yacc.c:1646 */
+#line 196 "pars0grm.y"
+ { yyval = pars_op(PARS_NOT_TOKEN, yyvsp[0], NULL); }
+#line 1760 "pars0grm.cc"
break;
case 48:
-#line 217 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op(PARS_OR_TOKEN, (yyvsp[-2]), (yyvsp[0])); }
-#line 1839 "pars0grm.cc" /* yacc.c:1646 */
+#line 198 "pars0grm.y"
+ { yyval = pars_op(PARS_NOTFOUND_TOKEN, yyvsp[-2], NULL); }
+#line 1766 "pars0grm.cc"
break;
case 49:
-#line 218 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op(PARS_NOT_TOKEN, (yyvsp[0]), NULL); }
-#line 1845 "pars0grm.cc" /* yacc.c:1646 */
+#line 200 "pars0grm.y"
+ { yyval = pars_op(PARS_NOTFOUND_TOKEN, yyvsp[-2], NULL); }
+#line 1772 "pars0grm.cc"
break;
case 50:
-#line 220 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[-2]), NULL); }
-#line 1851 "pars0grm.cc" /* yacc.c:1646 */
+#line 204 "pars0grm.y"
+ { yyval = &pars_to_binary_token; }
+#line 1778 "pars0grm.cc"
break;
case 51:
-#line 222 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[-2]), NULL); }
-#line 1857 "pars0grm.cc" /* yacc.c:1646 */
+#line 205 "pars0grm.y"
+ { yyval = &pars_substr_token; }
+#line 1784 "pars0grm.cc"
break;
case 52:
-#line 226 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_to_char_token; }
-#line 1863 "pars0grm.cc" /* yacc.c:1646 */
+#line 206 "pars0grm.y"
+ { yyval = &pars_concat_token; }
+#line 1790 "pars0grm.cc"
break;
case 53:
-#line 227 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_to_number_token; }
-#line 1869 "pars0grm.cc" /* yacc.c:1646 */
+#line 207 "pars0grm.y"
+ { yyval = &pars_instr_token; }
+#line 1796 "pars0grm.cc"
break;
case 54:
-#line 228 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_to_binary_token; }
-#line 1875 "pars0grm.cc" /* yacc.c:1646 */
+#line 208 "pars0grm.y"
+ { yyval = &pars_length_token; }
+#line 1802 "pars0grm.cc"
break;
- case 55:
-#line 230 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_binary_to_number_token; }
-#line 1881 "pars0grm.cc" /* yacc.c:1646 */
+ case 58:
+#line 219 "pars0grm.y"
+ { yyval = pars_stored_procedure_call(
+ static_cast<sym_node_t*>(yyvsp[-4])); }
+#line 1809 "pars0grm.cc"
break;
- case 56:
-#line 231 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_substr_token; }
-#line 1887 "pars0grm.cc" /* yacc.c:1646 */
+ case 59:
+#line 224 "pars0grm.y"
+ { yyval = yyvsp[-2]; }
+#line 1815 "pars0grm.cc"
break;
- case 57:
-#line 232 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_concat_token; }
-#line 1893 "pars0grm.cc" /* yacc.c:1646 */
+ case 60:
+#line 228 "pars0grm.y"
+ { yyval = que_node_list_add_last(NULL, yyvsp[0]); }
+#line 1821 "pars0grm.cc"
break;
- case 58:
-#line 233 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_instr_token; }
-#line 1899 "pars0grm.cc" /* yacc.c:1646 */
+ case 61:
+#line 230 "pars0grm.y"
+ { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); }
+#line 1827 "pars0grm.cc"
break;
- case 59:
-#line 234 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_length_token; }
-#line 1905 "pars0grm.cc" /* yacc.c:1646 */
+ case 62:
+#line 234 "pars0grm.y"
+ { yyval = NULL; }
+#line 1833 "pars0grm.cc"
break;
- case 60:
-#line 235 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_sysdate_token; }
-#line 1911 "pars0grm.cc" /* yacc.c:1646 */
+ case 63:
+#line 235 "pars0grm.y"
+ { yyval = que_node_list_add_last(NULL, yyvsp[0]); }
+#line 1839 "pars0grm.cc"
break;
- case 61:
-#line 236 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_rnd_token; }
-#line 1917 "pars0grm.cc" /* yacc.c:1646 */
+ case 64:
+#line 237 "pars0grm.y"
+ { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); }
+#line 1845 "pars0grm.cc"
break;
- case 62:
-#line 237 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_rnd_str_token; }
-#line 1923 "pars0grm.cc" /* yacc.c:1646 */
+ case 65:
+#line 241 "pars0grm.y"
+ { yyval = NULL; }
+#line 1851 "pars0grm.cc"
break;
case 66:
-#line 248 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_stored_procedure_call(
- static_cast<sym_node_t*>((yyvsp[-4]))); }
-#line 1930 "pars0grm.cc" /* yacc.c:1646 */
+#line 242 "pars0grm.y"
+ { yyval = que_node_list_add_last(NULL, yyvsp[0]);}
+#line 1857 "pars0grm.cc"
break;
case 67:
-#line 254 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_procedure_call((yyvsp[-3]), (yyvsp[-1])); }
-#line 1936 "pars0grm.cc" /* yacc.c:1646 */
+#line 243 "pars0grm.y"
+ { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); }
+#line 1863 "pars0grm.cc"
break;
case 68:
-#line 258 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_replstr_token; }
-#line 1942 "pars0grm.cc" /* yacc.c:1646 */
+#line 247 "pars0grm.y"
+ { yyval = yyvsp[0]; }
+#line 1869 "pars0grm.cc"
break;
case 69:
-#line 259 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_printf_token; }
-#line 1948 "pars0grm.cc" /* yacc.c:1646 */
+#line 249 "pars0grm.y"
+ { yyval = pars_func(&pars_count_token,
+ que_node_list_add_last(NULL,
+ sym_tab_add_int_lit(
+ pars_sym_tab_global, 1))); }
+#line 1878 "pars0grm.cc"
break;
case 70:
-#line 260 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_assert_token; }
-#line 1954 "pars0grm.cc" /* yacc.c:1646 */
+#line 256 "pars0grm.y"
+ { yyval = NULL; }
+#line 1884 "pars0grm.cc"
break;
case 71:
-#line 264 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[-2]); }
-#line 1960 "pars0grm.cc" /* yacc.c:1646 */
+#line 257 "pars0grm.y"
+ { yyval = que_node_list_add_last(NULL, yyvsp[0]); }
+#line 1890 "pars0grm.cc"
break;
case 72:
-#line 268 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); }
-#line 1966 "pars0grm.cc" /* yacc.c:1646 */
+#line 259 "pars0grm.y"
+ { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); }
+#line 1896 "pars0grm.cc"
break;
case 73:
-#line 270 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); }
-#line 1972 "pars0grm.cc" /* yacc.c:1646 */
+#line 263 "pars0grm.y"
+ { yyval = pars_select_list(&pars_star_denoter,
+ NULL); }
+#line 1903 "pars0grm.cc"
break;
case 74:
-#line 274 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 1978 "pars0grm.cc" /* yacc.c:1646 */
+#line 266 "pars0grm.y"
+ { yyval = pars_select_list(
+ yyvsp[-2], static_cast<sym_node_t*>(yyvsp[0])); }
+#line 1910 "pars0grm.cc"
break;
case 75:
-#line 275 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); }
-#line 1984 "pars0grm.cc" /* yacc.c:1646 */
+#line 268 "pars0grm.y"
+ { yyval = pars_select_list(yyvsp[0], NULL); }
+#line 1916 "pars0grm.cc"
break;
case 76:
-#line 277 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); }
-#line 1990 "pars0grm.cc" /* yacc.c:1646 */
+#line 272 "pars0grm.y"
+ { yyval = NULL; }
+#line 1922 "pars0grm.cc"
break;
case 77:
-#line 281 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 1996 "pars0grm.cc" /* yacc.c:1646 */
+#line 273 "pars0grm.y"
+ { yyval = yyvsp[0]; }
+#line 1928 "pars0grm.cc"
break;
case 78:
-#line 282 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0]));}
-#line 2002 "pars0grm.cc" /* yacc.c:1646 */
+#line 277 "pars0grm.y"
+ { yyval = NULL; }
+#line 1934 "pars0grm.cc"
break;
case 79:
-#line 283 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); }
-#line 2008 "pars0grm.cc" /* yacc.c:1646 */
+#line 279 "pars0grm.y"
+ { yyval = &pars_update_token; }
+#line 1940 "pars0grm.cc"
break;
case 80:
-#line 287 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2014 "pars0grm.cc" /* yacc.c:1646 */
+#line 283 "pars0grm.y"
+ { yyval = NULL; }
+#line 1946 "pars0grm.cc"
break;
case 81:
-#line 289 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_func(&pars_count_token,
- que_node_list_add_last(NULL,
- sym_tab_add_int_lit(
- pars_sym_tab_global, 1))); }
-#line 2023 "pars0grm.cc" /* yacc.c:1646 */
+#line 285 "pars0grm.y"
+ { yyval = &pars_share_token; }
+#line 1952 "pars0grm.cc"
break;
case 82:
-#line 294 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_func(&pars_count_token,
- que_node_list_add_last(NULL,
- pars_func(&pars_distinct_token,
- que_node_list_add_last(
- NULL, (yyvsp[-1]))))); }
-#line 2033 "pars0grm.cc" /* yacc.c:1646 */
+#line 289 "pars0grm.y"
+ { yyval = &pars_asc_token; }
+#line 1958 "pars0grm.cc"
break;
case 83:
-#line 300 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_func(&pars_sum_token,
- que_node_list_add_last(NULL,
- (yyvsp[-1]))); }
-#line 2041 "pars0grm.cc" /* yacc.c:1646 */
+#line 290 "pars0grm.y"
+ { yyval = &pars_asc_token; }
+#line 1964 "pars0grm.cc"
break;
case 84:
-#line 306 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2047 "pars0grm.cc" /* yacc.c:1646 */
+#line 291 "pars0grm.y"
+ { yyval = &pars_desc_token; }
+#line 1970 "pars0grm.cc"
break;
case 85:
-#line 307 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); }
-#line 2053 "pars0grm.cc" /* yacc.c:1646 */
+#line 295 "pars0grm.y"
+ { yyval = NULL; }
+#line 1976 "pars0grm.cc"
break;
case 86:
-#line 309 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); }
-#line 2059 "pars0grm.cc" /* yacc.c:1646 */
+#line 297 "pars0grm.y"
+ { yyval = pars_order_by(
+ static_cast<sym_node_t*>(yyvsp[-1]),
+ static_cast<pars_res_word_t*>(yyvsp[0])); }
+#line 1984 "pars0grm.cc"
break;
case 87:
-#line 313 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_select_list(&pars_star_denoter,
- NULL); }
-#line 2066 "pars0grm.cc" /* yacc.c:1646 */
+#line 308 "pars0grm.y"
+ { yyval = pars_select_statement(
+ static_cast<sel_node_t*>(yyvsp[-6]),
+ static_cast<sym_node_t*>(yyvsp[-4]),
+ static_cast<que_node_t*>(yyvsp[-3]),
+ static_cast<pars_res_word_t*>(yyvsp[-2]),
+ static_cast<pars_res_word_t*>(yyvsp[-1]),
+ static_cast<order_node_t*>(yyvsp[0])); }
+#line 1996 "pars0grm.cc"
break;
case 88:
-#line 316 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_select_list(
- (yyvsp[-2]), static_cast<sym_node_t*>((yyvsp[0]))); }
-#line 2073 "pars0grm.cc" /* yacc.c:1646 */
+#line 319 "pars0grm.y"
+ { yyval = yyvsp[0]; }
+#line 2002 "pars0grm.cc"
break;
case 89:
-#line 318 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_select_list((yyvsp[0]), NULL); }
-#line 2079 "pars0grm.cc" /* yacc.c:1646 */
+#line 324 "pars0grm.y"
+ { yyval = pars_insert_statement(
+ static_cast<sym_node_t*>(yyvsp[-4]), yyvsp[-1], NULL); }
+#line 2009 "pars0grm.cc"
break;
case 90:
-#line 322 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2085 "pars0grm.cc" /* yacc.c:1646 */
+#line 327 "pars0grm.y"
+ { yyval = pars_insert_statement(
+ static_cast<sym_node_t*>(yyvsp[-1]),
+ NULL,
+ static_cast<sel_node_t*>(yyvsp[0])); }
+#line 2018 "pars0grm.cc"
break;
case 91:
-#line 323 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2091 "pars0grm.cc" /* yacc.c:1646 */
+#line 334 "pars0grm.y"
+ { yyval = pars_column_assignment(
+ static_cast<sym_node_t*>(yyvsp[-2]),
+ static_cast<que_node_t*>(yyvsp[0])); }
+#line 2026 "pars0grm.cc"
break;
case 92:
-#line 327 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2097 "pars0grm.cc" /* yacc.c:1646 */
+#line 340 "pars0grm.y"
+ { yyval = que_node_list_add_last(NULL, yyvsp[0]); }
+#line 2032 "pars0grm.cc"
break;
case 93:
-#line 329 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_update_token; }
-#line 2103 "pars0grm.cc" /* yacc.c:1646 */
+#line 342 "pars0grm.y"
+ { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); }
+#line 2038 "pars0grm.cc"
break;
case 94:
-#line 333 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2109 "pars0grm.cc" /* yacc.c:1646 */
+#line 348 "pars0grm.y"
+ { yyval = yyvsp[0]; }
+#line 2044 "pars0grm.cc"
break;
case 95:
-#line 335 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_share_token; }
-#line 2115 "pars0grm.cc" /* yacc.c:1646 */
+#line 354 "pars0grm.y"
+ { yyval = pars_update_statement_start(
+ FALSE,
+ static_cast<sym_node_t*>(yyvsp[-2]),
+ static_cast<col_assign_node_t*>(yyvsp[0])); }
+#line 2053 "pars0grm.cc"
break;
case 96:
-#line 339 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_asc_token; }
-#line 2121 "pars0grm.cc" /* yacc.c:1646 */
+#line 362 "pars0grm.y"
+ { yyval = pars_update_statement(
+ static_cast<upd_node_t*>(yyvsp[-1]),
+ NULL,
+ static_cast<que_node_t*>(yyvsp[0])); }
+#line 2062 "pars0grm.cc"
break;
case 97:
-#line 340 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_asc_token; }
-#line 2127 "pars0grm.cc" /* yacc.c:1646 */
+#line 370 "pars0grm.y"
+ { yyval = pars_update_statement(
+ static_cast<upd_node_t*>(yyvsp[-1]),
+ static_cast<sym_node_t*>(yyvsp[0]),
+ NULL); }
+#line 2071 "pars0grm.cc"
break;
case 98:
-#line 341 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_desc_token; }
-#line 2133 "pars0grm.cc" /* yacc.c:1646 */
+#line 378 "pars0grm.y"
+ { yyval = pars_update_statement_start(
+ TRUE,
+ static_cast<sym_node_t*>(yyvsp[0]), NULL); }
+#line 2079 "pars0grm.cc"
break;
case 99:
-#line 345 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2139 "pars0grm.cc" /* yacc.c:1646 */
+#line 385 "pars0grm.y"
+ { yyval = pars_update_statement(
+ static_cast<upd_node_t*>(yyvsp[-1]),
+ NULL,
+ static_cast<que_node_t*>(yyvsp[0])); }
+#line 2088 "pars0grm.cc"
break;
case 100:
-#line 347 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_order_by(
- static_cast<sym_node_t*>((yyvsp[-1])),
- static_cast<pars_res_word_t*>((yyvsp[0]))); }
-#line 2147 "pars0grm.cc" /* yacc.c:1646 */
+#line 393 "pars0grm.y"
+ { yyval = pars_update_statement(
+ static_cast<upd_node_t*>(yyvsp[-1]),
+ static_cast<sym_node_t*>(yyvsp[0]),
+ NULL); }
+#line 2097 "pars0grm.cc"
break;
case 101:
-#line 358 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_select_statement(
- static_cast<sel_node_t*>((yyvsp[-6])),
- static_cast<sym_node_t*>((yyvsp[-4])),
- static_cast<que_node_t*>((yyvsp[-3])),
- static_cast<pars_res_word_t*>((yyvsp[-2])),
- static_cast<pars_res_word_t*>((yyvsp[-1])),
- static_cast<order_node_t*>((yyvsp[0]))); }
-#line 2159 "pars0grm.cc" /* yacc.c:1646 */
+#line 401 "pars0grm.y"
+ { yyval = pars_assignment_statement(
+ static_cast<sym_node_t*>(yyvsp[-2]),
+ static_cast<que_node_t*>(yyvsp[0])); }
+#line 2105 "pars0grm.cc"
break;
case 102:
-#line 369 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2165 "pars0grm.cc" /* yacc.c:1646 */
+#line 409 "pars0grm.y"
+ { yyval = pars_elsif_element(yyvsp[-2], yyvsp[0]); }
+#line 2111 "pars0grm.cc"
break;
case 103:
-#line 374 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_insert_statement(
- static_cast<sym_node_t*>((yyvsp[-4])), (yyvsp[-1]), NULL); }
-#line 2172 "pars0grm.cc" /* yacc.c:1646 */
+#line 413 "pars0grm.y"
+ { yyval = que_node_list_add_last(NULL, yyvsp[0]); }
+#line 2117 "pars0grm.cc"
break;
case 104:
-#line 377 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_insert_statement(
- static_cast<sym_node_t*>((yyvsp[-1])),
- NULL,
- static_cast<sel_node_t*>((yyvsp[0]))); }
-#line 2181 "pars0grm.cc" /* yacc.c:1646 */
+#line 415 "pars0grm.y"
+ { yyval = que_node_list_add_last(yyvsp[-1], yyvsp[0]); }
+#line 2123 "pars0grm.cc"
break;
case 105:
-#line 384 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_column_assignment(
- static_cast<sym_node_t*>((yyvsp[-2])),
- static_cast<que_node_t*>((yyvsp[0]))); }
-#line 2189 "pars0grm.cc" /* yacc.c:1646 */
+#line 419 "pars0grm.y"
+ { yyval = NULL; }
+#line 2129 "pars0grm.cc"
break;
case 106:
-#line 390 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); }
-#line 2195 "pars0grm.cc" /* yacc.c:1646 */
+#line 421 "pars0grm.y"
+ { yyval = yyvsp[0]; }
+#line 2135 "pars0grm.cc"
break;
case 107:
-#line 392 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); }
-#line 2201 "pars0grm.cc" /* yacc.c:1646 */
+#line 422 "pars0grm.y"
+ { yyval = yyvsp[0]; }
+#line 2141 "pars0grm.cc"
break;
case 108:
-#line 398 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2207 "pars0grm.cc" /* yacc.c:1646 */
+#line 429 "pars0grm.y"
+ { yyval = pars_if_statement(yyvsp[-5], yyvsp[-3], yyvsp[-2]); }
+#line 2147 "pars0grm.cc"
break;
case 109:
-#line 404 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_update_statement_start(
- FALSE,
- static_cast<sym_node_t*>((yyvsp[-2])),
- static_cast<col_assign_node_t*>((yyvsp[0]))); }
-#line 2216 "pars0grm.cc" /* yacc.c:1646 */
+#line 435 "pars0grm.y"
+ { yyval = pars_while_statement(yyvsp[-4], yyvsp[-2]); }
+#line 2153 "pars0grm.cc"
break;
case 110:
-#line 412 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_update_statement(
- static_cast<upd_node_t*>((yyvsp[-1])),
- NULL,
- static_cast<que_node_t*>((yyvsp[0]))); }
-#line 2225 "pars0grm.cc" /* yacc.c:1646 */
+#line 443 "pars0grm.y"
+ { yyval = pars_for_statement(
+ static_cast<sym_node_t*>(yyvsp[-8]),
+ yyvsp[-6], yyvsp[-4], yyvsp[-2]); }
+#line 2161 "pars0grm.cc"
break;
case 111:
-#line 420 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_update_statement(
- static_cast<upd_node_t*>((yyvsp[-1])),
- static_cast<sym_node_t*>((yyvsp[0])),
- NULL); }
-#line 2234 "pars0grm.cc" /* yacc.c:1646 */
+#line 449 "pars0grm.y"
+ { yyval = pars_exit_statement(); }
+#line 2167 "pars0grm.cc"
break;
case 112:
-#line 428 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_update_statement_start(
- TRUE,
- static_cast<sym_node_t*>((yyvsp[0])), NULL); }
-#line 2242 "pars0grm.cc" /* yacc.c:1646 */
+#line 453 "pars0grm.y"
+ { yyval = pars_return_statement(); }
+#line 2173 "pars0grm.cc"
break;
case 113:
-#line 435 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_update_statement(
- static_cast<upd_node_t*>((yyvsp[-1])),
- NULL,
- static_cast<que_node_t*>((yyvsp[0]))); }
-#line 2251 "pars0grm.cc" /* yacc.c:1646 */
+#line 458 "pars0grm.y"
+ { yyval = pars_open_statement(
+ ROW_SEL_OPEN_CURSOR,
+ static_cast<sym_node_t*>(yyvsp[0])); }
+#line 2181 "pars0grm.cc"
break;
case 114:
-#line 443 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_update_statement(
- static_cast<upd_node_t*>((yyvsp[-1])),
- static_cast<sym_node_t*>((yyvsp[0])),
- NULL); }
-#line 2260 "pars0grm.cc" /* yacc.c:1646 */
+#line 465 "pars0grm.y"
+ { yyval = pars_open_statement(
+ ROW_SEL_CLOSE_CURSOR,
+ static_cast<sym_node_t*>(yyvsp[0])); }
+#line 2189 "pars0grm.cc"
break;
case 115:
-#line 451 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_row_printf_statement(
- static_cast<sel_node_t*>((yyvsp[0]))); }
-#line 2267 "pars0grm.cc" /* yacc.c:1646 */
+#line 472 "pars0grm.y"
+ { yyval = pars_fetch_statement(
+ static_cast<sym_node_t*>(yyvsp[-2]),
+ static_cast<sym_node_t*>(yyvsp[0]), NULL); }
+#line 2197 "pars0grm.cc"
break;
case 116:
-#line 457 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_assignment_statement(
- static_cast<sym_node_t*>((yyvsp[-2])),
- static_cast<que_node_t*>((yyvsp[0]))); }
-#line 2275 "pars0grm.cc" /* yacc.c:1646 */
+#line 476 "pars0grm.y"
+ { yyval = pars_fetch_statement(
+ static_cast<sym_node_t*>(yyvsp[-2]),
+ NULL,
+ static_cast<sym_node_t*>(yyvsp[0])); }
+#line 2206 "pars0grm.cc"
break;
case 117:
-#line 465 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_elsif_element((yyvsp[-2]), (yyvsp[0])); }
-#line 2281 "pars0grm.cc" /* yacc.c:1646 */
+#line 484 "pars0grm.y"
+ { yyval = pars_column_def(
+ static_cast<sym_node_t*>(yyvsp[-3]),
+ static_cast<pars_res_word_t*>(yyvsp[-2]),
+ static_cast<sym_node_t*>(yyvsp[-1]),
+ yyvsp[0]); }
+#line 2216 "pars0grm.cc"
break;
case 118:
-#line 469 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); }
-#line 2287 "pars0grm.cc" /* yacc.c:1646 */
+#line 492 "pars0grm.y"
+ { yyval = que_node_list_add_last(NULL, yyvsp[0]); }
+#line 2222 "pars0grm.cc"
break;
case 119:
-#line 471 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-1]), (yyvsp[0])); }
-#line 2293 "pars0grm.cc" /* yacc.c:1646 */
+#line 494 "pars0grm.y"
+ { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); }
+#line 2228 "pars0grm.cc"
break;
case 120:
-#line 475 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2299 "pars0grm.cc" /* yacc.c:1646 */
+#line 498 "pars0grm.y"
+ { yyval = NULL; }
+#line 2234 "pars0grm.cc"
break;
case 121:
-#line 477 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2305 "pars0grm.cc" /* yacc.c:1646 */
+#line 500 "pars0grm.y"
+ { yyval = yyvsp[-1]; }
+#line 2240 "pars0grm.cc"
break;
case 122:
-#line 478 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2311 "pars0grm.cc" /* yacc.c:1646 */
+#line 504 "pars0grm.y"
+ { yyval = NULL; }
+#line 2246 "pars0grm.cc"
break;
case 123:
-#line 485 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_if_statement((yyvsp[-5]), (yyvsp[-3]), (yyvsp[-2])); }
-#line 2317 "pars0grm.cc" /* yacc.c:1646 */
+#line 506 "pars0grm.y"
+ { yyval = &pars_int_token;
+ /* pass any non-NULL pointer */ }
+#line 2253 "pars0grm.cc"
break;
case 124:
-#line 491 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_while_statement((yyvsp[-4]), (yyvsp[-2])); }
-#line 2323 "pars0grm.cc" /* yacc.c:1646 */
+#line 513 "pars0grm.y"
+ { yyval = pars_create_table(
+ static_cast<sym_node_t*>(yyvsp[-3]),
+ static_cast<sym_node_t*>(yyvsp[-1])); }
+#line 2261 "pars0grm.cc"
break;
case 125:
-#line 499 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_for_statement(
- static_cast<sym_node_t*>((yyvsp[-8])),
- (yyvsp[-6]), (yyvsp[-4]), (yyvsp[-2])); }
-#line 2331 "pars0grm.cc" /* yacc.c:1646 */
+#line 519 "pars0grm.y"
+ { yyval = que_node_list_add_last(NULL, yyvsp[0]); }
+#line 2267 "pars0grm.cc"
break;
case 126:
-#line 505 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_exit_statement(); }
-#line 2337 "pars0grm.cc" /* yacc.c:1646 */
+#line 521 "pars0grm.y"
+ { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); }
+#line 2273 "pars0grm.cc"
break;
case 127:
-#line 509 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_return_statement(); }
-#line 2343 "pars0grm.cc" /* yacc.c:1646 */
+#line 525 "pars0grm.y"
+ { yyval = NULL; }
+#line 2279 "pars0grm.cc"
break;
case 128:
-#line 514 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_open_statement(
- ROW_SEL_OPEN_CURSOR,
- static_cast<sym_node_t*>((yyvsp[0]))); }
-#line 2351 "pars0grm.cc" /* yacc.c:1646 */
+#line 526 "pars0grm.y"
+ { yyval = &pars_unique_token; }
+#line 2285 "pars0grm.cc"
break;
case 129:
-#line 521 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_open_statement(
- ROW_SEL_CLOSE_CURSOR,
- static_cast<sym_node_t*>((yyvsp[0]))); }
-#line 2359 "pars0grm.cc" /* yacc.c:1646 */
+#line 530 "pars0grm.y"
+ { yyval = NULL; }
+#line 2291 "pars0grm.cc"
break;
case 130:
-#line 528 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_fetch_statement(
- static_cast<sym_node_t*>((yyvsp[-2])),
- static_cast<sym_node_t*>((yyvsp[0])), NULL); }
-#line 2367 "pars0grm.cc" /* yacc.c:1646 */
+#line 531 "pars0grm.y"
+ { yyval = &pars_clustered_token; }
+#line 2297 "pars0grm.cc"
break;
case 131:
-#line 532 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_fetch_statement(
- static_cast<sym_node_t*>((yyvsp[-2])),
- NULL,
- static_cast<sym_node_t*>((yyvsp[0]))); }
-#line 2376 "pars0grm.cc" /* yacc.c:1646 */
+#line 540 "pars0grm.y"
+ { yyval = pars_create_index(
+ static_cast<pars_res_word_t*>(yyvsp[-8]),
+ static_cast<pars_res_word_t*>(yyvsp[-7]),
+ static_cast<sym_node_t*>(yyvsp[-5]),
+ static_cast<sym_node_t*>(yyvsp[-3]),
+ static_cast<sym_node_t*>(yyvsp[-1])); }
+#line 2308 "pars0grm.cc"
break;
case 132:
-#line 540 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_column_def(
- static_cast<sym_node_t*>((yyvsp[-4])),
- static_cast<pars_res_word_t*>((yyvsp[-3])),
- static_cast<sym_node_t*>((yyvsp[-2])),
- (yyvsp[-1]), (yyvsp[0])); }
-#line 2386 "pars0grm.cc" /* yacc.c:1646 */
+#line 549 "pars0grm.y"
+ { yyval = yyvsp[0]; }
+#line 2314 "pars0grm.cc"
break;
case 133:
-#line 548 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); }
-#line 2392 "pars0grm.cc" /* yacc.c:1646 */
+#line 550 "pars0grm.y"
+ { yyval = yyvsp[0]; }
+#line 2320 "pars0grm.cc"
break;
case 134:
-#line 550 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); }
-#line 2398 "pars0grm.cc" /* yacc.c:1646 */
+#line 555 "pars0grm.y"
+ { yyval = pars_commit_statement(); }
+#line 2326 "pars0grm.cc"
break;
case 135:
-#line 554 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2404 "pars0grm.cc" /* yacc.c:1646 */
+#line 560 "pars0grm.y"
+ { yyval = pars_rollback_statement(); }
+#line 2332 "pars0grm.cc"
break;
case 136:
-#line 556 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[-1]); }
-#line 2410 "pars0grm.cc" /* yacc.c:1646 */
+#line 564 "pars0grm.y"
+ { yyval = &pars_int_token; }
+#line 2338 "pars0grm.cc"
break;
case 137:
-#line 560 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2416 "pars0grm.cc" /* yacc.c:1646 */
+#line 565 "pars0grm.y"
+ { yyval = &pars_bigint_token; }
+#line 2344 "pars0grm.cc"
break;
case 138:
-#line 562 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_int_token;
- /* pass any non-NULL pointer */ }
-#line 2423 "pars0grm.cc" /* yacc.c:1646 */
+#line 566 "pars0grm.y"
+ { yyval = &pars_char_token; }
+#line 2350 "pars0grm.cc"
break;
case 139:
-#line 567 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2429 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 140:
-#line 569 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_int_token;
- /* pass any non-NULL pointer */ }
-#line 2436 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 141:
-#line 574 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2442 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 142:
-#line 575 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_int_token;
- /* pass any non-NULL pointer */ }
-#line 2449 "pars0grm.cc" /* yacc.c:1646 */
+#line 571 "pars0grm.y"
+ { yyval = pars_variable_declaration(
+ static_cast<sym_node_t*>(yyvsp[-2]),
+ static_cast<pars_res_word_t*>(yyvsp[-1])); }
+#line 2358 "pars0grm.cc"
break;
case 143:
-#line 580 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2455 "pars0grm.cc" /* yacc.c:1646 */
+#line 585 "pars0grm.y"
+ { yyval = pars_cursor_declaration(
+ static_cast<sym_node_t*>(yyvsp[-3]),
+ static_cast<sel_node_t*>(yyvsp[-1])); }
+#line 2366 "pars0grm.cc"
break;
case 144:
-#line 582 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2461 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 145:
-#line 589 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_create_table(
- static_cast<sym_node_t*>((yyvsp[-5])),
- static_cast<sym_node_t*>((yyvsp[-3])),
- static_cast<sym_node_t*>((yyvsp[-1])),
- static_cast<sym_node_t*>((yyvsp[0]))); }
-#line 2471 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 146:
-#line 597 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); }
-#line 2477 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 147:
-#line 599 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); }
-#line 2483 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 148:
-#line 603 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2489 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 149:
-#line 604 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_unique_token; }
-#line 2495 "pars0grm.cc" /* yacc.c:1646 */
+#line 592 "pars0grm.y"
+ { yyval = pars_function_declaration(
+ static_cast<sym_node_t*>(yyvsp[-1])); }
+#line 2373 "pars0grm.cc"
break;
case 150:
-#line 608 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2501 "pars0grm.cc" /* yacc.c:1646 */
+#line 614 "pars0grm.y"
+ { yyval = pars_procedure_definition(
+ static_cast<sym_node_t*>(yyvsp[-8]), yyvsp[-1]); }
+#line 2380 "pars0grm.cc"
break;
- case 151:
-#line 609 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_clustered_token; }
-#line 2507 "pars0grm.cc" /* yacc.c:1646 */
- break;
- case 152:
-#line 618 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_create_index(
- static_cast<pars_res_word_t*>((yyvsp[-8])),
- static_cast<pars_res_word_t*>((yyvsp[-7])),
- static_cast<sym_node_t*>((yyvsp[-5])),
- static_cast<sym_node_t*>((yyvsp[-3])),
- static_cast<sym_node_t*>((yyvsp[-1]))); }
-#line 2518 "pars0grm.cc" /* yacc.c:1646 */
- break;
+#line 2384 "pars0grm.cc"
- case 153:
-#line 627 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2524 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 154:
-#line 628 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2530 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 155:
-#line 633 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_commit_statement(); }
-#line 2536 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 156:
-#line 638 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_rollback_statement(); }
-#line 2542 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 157:
-#line 642 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_int_token; }
-#line 2548 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 158:
-#line 643 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_bigint_token; }
-#line 2554 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 159:
-#line 644 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_char_token; }
-#line 2560 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 160:
-#line 645 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_binary_token; }
-#line 2566 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 161:
-#line 646 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = &pars_blob_token; }
-#line 2572 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 162:
-#line 651 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_parameter_declaration(
- static_cast<sym_node_t*>((yyvsp[-2])),
- PARS_INPUT,
- static_cast<pars_res_word_t*>((yyvsp[0]))); }
-#line 2581 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 163:
-#line 656 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_parameter_declaration(
- static_cast<sym_node_t*>((yyvsp[-2])),
- PARS_OUTPUT,
- static_cast<pars_res_word_t*>((yyvsp[0]))); }
-#line 2590 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 164:
-#line 663 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = NULL; }
-#line 2596 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 165:
-#line 664 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); }
-#line 2602 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 166:
-#line 666 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); }
-#line 2608 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 167:
-#line 671 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_variable_declaration(
- static_cast<sym_node_t*>((yyvsp[-2])),
- static_cast<pars_res_word_t*>((yyvsp[-1]))); }
-#line 2616 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 171:
-#line 685 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_cursor_declaration(
- static_cast<sym_node_t*>((yyvsp[-3])),
- static_cast<sel_node_t*>((yyvsp[-1]))); }
-#line 2624 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 172:
-#line 692 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_function_declaration(
- static_cast<sym_node_t*>((yyvsp[-1]))); }
-#line 2631 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
- case 178:
-#line 714 "pars0grm.y" /* yacc.c:1646 */
- { (yyval) = pars_procedure_definition(
- static_cast<sym_node_t*>((yyvsp[-9])),
- static_cast<sym_node_t*>((yyvsp[-7])),
- (yyvsp[-1])); }
-#line 2640 "pars0grm.cc" /* yacc.c:1646 */
- break;
-
-
-#line 2644 "pars0grm.cc" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -2665,14 +2406,13 @@ yyreduce:
/* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ {
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
+ const int yyi = yypgoto[yylhs] + *yyssp;
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+ ? yytable[yyi]
+ : yydefgoto[yylhs]);
+ }
goto yynewstate;
@@ -2755,12 +2495,10 @@ yyerrlab:
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
+ /* Pacify compilers when the user code never invokes YYERROR and the
+ label yyerrorlab therefore never appears in user code. */
+ if (0)
+ YYERROR;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
@@ -2822,6 +2560,7 @@ yyacceptlab:
yyresult = 0;
goto yyreturn;
+
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
@@ -2829,6 +2568,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
+
#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
@@ -2839,6 +2579,10 @@ yyexhaustedlab:
/* Fall through. */
#endif
+
+/*-----------------------------------------------------.
+| yyreturn -- parsing is finished, return the result. |
+`-----------------------------------------------------*/
yyreturn:
if (yychar != YYEMPTY)
{
@@ -2868,5 +2612,5 @@ yyreturn:
#endif
return yyresult;
}
-#line 720 "pars0grm.y" /* yacc.c:1906 */
+#line 618 "pars0grm.y"
diff --git a/storage/innobase/pars/pars0grm.y b/storage/innobase/pars/pars0grm.y
index 27638e06a66..625ed41bbd4 100644
--- a/storage/innobase/pars/pars0grm.y
+++ b/storage/innobase/pars/pars0grm.y
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 2019, 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
@@ -58,11 +58,7 @@ yylex(void);
%token PARS_NE_TOKEN
%token PARS_PROCEDURE_TOKEN
%token PARS_IN_TOKEN
-%token PARS_OUT_TOKEN
-%token PARS_BINARY_TOKEN
-%token PARS_BLOB_TOKEN
%token PARS_INT_TOKEN
-%token PARS_FLOAT_TOKEN
%token PARS_CHAR_TOKEN
%token PARS_IS_TOKEN
%token PARS_BEGIN_TOKEN
@@ -75,14 +71,11 @@ yylex(void);
%token PARS_WHILE_TOKEN
%token PARS_RETURN_TOKEN
%token PARS_SELECT_TOKEN
-%token PARS_SUM_TOKEN
%token PARS_COUNT_TOKEN
-%token PARS_DISTINCT_TOKEN
%token PARS_FROM_TOKEN
%token PARS_WHERE_TOKEN
%token PARS_FOR_TOKEN
%token PARS_DDOT_TOKEN
-%token PARS_READ_TOKEN
%token PARS_ORDER_TOKEN
%token PARS_BY_TOKEN
%token PARS_ASC_TOKEN
@@ -109,25 +102,14 @@ yylex(void);
%token PARS_FETCH_TOKEN
%token PARS_CLOSE_TOKEN
%token PARS_NOTFOUND_TOKEN
-%token PARS_TO_CHAR_TOKEN
-%token PARS_TO_NUMBER_TOKEN
%token PARS_TO_BINARY_TOKEN
-%token PARS_BINARY_TO_NUMBER_TOKEN
%token PARS_SUBSTR_TOKEN
-%token PARS_REPLSTR_TOKEN
%token PARS_CONCAT_TOKEN
%token PARS_INSTR_TOKEN
%token PARS_LENGTH_TOKEN
-%token PARS_SYSDATE_TOKEN
-%token PARS_PRINTF_TOKEN
-%token PARS_ASSERT_TOKEN
-%token PARS_RND_TOKEN
-%token PARS_RND_STR_TOKEN
-%token PARS_ROW_PRINTF_TOKEN
%token PARS_COMMIT_TOKEN
%token PARS_ROLLBACK_TOKEN
%token PARS_WORK_TOKEN
-%token PARS_UNSIGNED_TOKEN
%token PARS_EXIT_TOKEN
%token PARS_FUNCTION_TOKEN
%token PARS_LOCK_TOKEN
@@ -139,8 +121,6 @@ yylex(void);
%token PARS_LIKE_TOKEN_SUFFIX
%token PARS_LIKE_TOKEN_SUBSTR
%token PARS_TABLE_NAME_TOKEN
-%token PARS_COMPACT_TOKEN
-%token PARS_BLOCK_SIZE_TOKEN
%token PARS_BIGINT_TOKEN
%left PARS_AND_TOKEN PARS_OR_TOKEN
@@ -161,7 +141,6 @@ top_statement:
statement:
stored_procedure_call
- | predefined_procedure_call ';'
| while_statement ';'
| for_statement ';'
| exit_statement ';'
@@ -170,7 +149,6 @@ statement:
| assignment_statement ';'
| select_statement ';'
| insert_statement ';'
- | row_printf_statement ';'
| delete_statement_searched ';'
| delete_statement_positioned ';'
| update_statement_searched ';'
@@ -223,18 +201,11 @@ exp:
;
function_name:
- PARS_TO_CHAR_TOKEN { $$ = &pars_to_char_token; }
- | PARS_TO_NUMBER_TOKEN { $$ = &pars_to_number_token; }
- | PARS_TO_BINARY_TOKEN { $$ = &pars_to_binary_token; }
- | PARS_BINARY_TO_NUMBER_TOKEN
- { $$ = &pars_binary_to_number_token; }
+ PARS_TO_BINARY_TOKEN { $$ = &pars_to_binary_token; }
| PARS_SUBSTR_TOKEN { $$ = &pars_substr_token; }
| PARS_CONCAT_TOKEN { $$ = &pars_concat_token; }
| PARS_INSTR_TOKEN { $$ = &pars_instr_token; }
| PARS_LENGTH_TOKEN { $$ = &pars_length_token; }
- | PARS_SYSDATE_TOKEN { $$ = &pars_sysdate_token; }
- | PARS_RND_TOKEN { $$ = &pars_rnd_token; }
- | PARS_RND_STR_TOKEN { $$ = &pars_rnd_str_token; }
;
question_mark_list:
@@ -249,17 +220,6 @@ stored_procedure_call:
static_cast<sym_node_t*>($2)); }
;
-predefined_procedure_call:
- predefined_procedure_name '(' exp_list ')'
- { $$ = pars_procedure_call($1, $3); }
-;
-
-predefined_procedure_name:
- PARS_REPLSTR_TOKEN { $$ = &pars_replstr_token; }
- | PARS_PRINTF_TOKEN { $$ = &pars_printf_token; }
- | PARS_ASSERT_TOKEN { $$ = &pars_assert_token; }
-;
-
user_function_call:
PARS_ID_TOKEN '(' ')' { $$ = $1; }
;
@@ -287,19 +247,9 @@ select_item:
exp { $$ = $1; }
| PARS_COUNT_TOKEN '(' '*' ')'
{ $$ = pars_func(&pars_count_token,
- que_node_list_add_last(NULL,
+ que_node_list_add_last(NULL,
sym_tab_add_int_lit(
pars_sym_tab_global, 1))); }
- | PARS_COUNT_TOKEN '(' PARS_DISTINCT_TOKEN PARS_ID_TOKEN ')'
- { $$ = pars_func(&pars_count_token,
- que_node_list_add_last(NULL,
- pars_func(&pars_distinct_token,
- que_node_list_add_last(
- NULL, $4)))); }
- | PARS_SUM_TOKEN '(' exp ')'
- { $$ = pars_func(&pars_sum_token,
- que_node_list_add_last(NULL,
- $3)); }
;
select_item_list:
@@ -446,12 +396,6 @@ delete_statement_positioned:
NULL); }
;
-row_printf_statement:
- PARS_ROW_PRINTF_TOKEN select_statement
- { $$ = pars_row_printf_statement(
- static_cast<sel_node_t*>($2)); }
-;
-
assignment_statement:
PARS_ID_TOKEN PARS_ASSIGN_TOKEN exp
{ $$ = pars_assignment_statement(
@@ -536,12 +480,12 @@ fetch_statement:
;
column_def:
- PARS_ID_TOKEN type_name opt_column_len opt_unsigned opt_not_null
+ PARS_ID_TOKEN type_name opt_column_len opt_not_null
{ $$ = pars_column_def(
static_cast<sym_node_t*>($1),
static_cast<pars_res_word_t*>($2),
static_cast<sym_node_t*>($3),
- $4, $5); }
+ $4); }
;
column_def_list:
@@ -556,13 +500,6 @@ opt_column_len:
{ $$ = $2; }
;
-opt_unsigned:
- /* Nothing */ { $$ = NULL; }
- | PARS_UNSIGNED_TOKEN
- { $$ = &pars_int_token;
- /* pass any non-NULL pointer */ }
-;
-
opt_not_null:
/* Nothing */ { $$ = NULL; }
| PARS_NOT_TOKEN PARS_NULL_LIT
@@ -570,27 +507,12 @@ opt_not_null:
/* pass any non-NULL pointer */ }
;
-compact:
- /* Nothing */ { $$ = NULL; }
- | PARS_COMPACT_TOKEN { $$ = &pars_int_token;
- /* pass any non-NULL pointer */ }
-;
-
-block_size:
- /* Nothing */ { $$ = NULL; }
- | PARS_BLOCK_SIZE_TOKEN '=' PARS_INT_LIT
- { $$ = $3; }
-;
-
create_table:
PARS_CREATE_TOKEN PARS_TABLE_TOKEN
table_name '(' column_def_list ')'
- compact block_size
{ $$ = pars_create_table(
static_cast<sym_node_t*>($3),
- static_cast<sym_node_t*>($5),
- static_cast<sym_node_t*>($7),
- static_cast<sym_node_t*>($8)); }
+ static_cast<sym_node_t*>($5)); }
;
column_list:
@@ -642,28 +564,6 @@ type_name:
PARS_INT_TOKEN { $$ = &pars_int_token; }
| PARS_BIGINT_TOKEN { $$ = &pars_bigint_token; }
| PARS_CHAR_TOKEN { $$ = &pars_char_token; }
- | PARS_BINARY_TOKEN { $$ = &pars_binary_token; }
- | PARS_BLOB_TOKEN { $$ = &pars_blob_token; }
-;
-
-parameter_declaration:
- PARS_ID_TOKEN PARS_IN_TOKEN type_name
- { $$ = pars_parameter_declaration(
- static_cast<sym_node_t*>($1),
- PARS_INPUT,
- static_cast<pars_res_word_t*>($3)); }
- | PARS_ID_TOKEN PARS_OUT_TOKEN type_name
- { $$ = pars_parameter_declaration(
- static_cast<sym_node_t*>($1),
- PARS_OUTPUT,
- static_cast<pars_res_word_t*>($3)); }
-;
-
-parameter_declaration_list:
- /* Nothing */ { $$ = NULL; }
- | parameter_declaration { $$ = que_node_list_add_last(NULL, $1); }
- | parameter_declaration_list ',' parameter_declaration
- { $$ = que_node_list_add_last($1, $3); }
;
variable_declaration:
@@ -705,16 +605,14 @@ declaration_list:
;
procedure_definition:
- PARS_PROCEDURE_TOKEN PARS_ID_TOKEN '(' parameter_declaration_list ')'
+ PARS_PROCEDURE_TOKEN PARS_ID_TOKEN '(' ')'
PARS_IS_TOKEN
variable_declaration_list
declaration_list
PARS_BEGIN_TOKEN
statement_list
PARS_END_TOKEN { $$ = pars_procedure_definition(
- static_cast<sym_node_t*>($2),
- static_cast<sym_node_t*>($4),
- $10); }
+ static_cast<sym_node_t*>($2), $9); }
;
%%
diff --git a/storage/innobase/pars/pars0lex.l b/storage/innobase/pars/pars0lex.l
index 2d0e56f400d..8b2df6b7940 100644
--- a/storage/innobase/pars/pars0lex.l
+++ b/storage/innobase/pars/pars0lex.l
@@ -249,30 +249,10 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_IN_TOKEN);
}
-"OUT" {
- return(PARS_OUT_TOKEN);
-}
-
-"BINARY" {
- return(PARS_BINARY_TOKEN);
-}
-
-"BLOB" {
- return(PARS_BLOB_TOKEN);
-}
-
"INT" {
return(PARS_INT_TOKEN);
}
-"INTEGER" {
- return(PARS_INT_TOKEN);
-}
-
-"FLOAT" {
- return(PARS_FLOAT_TOKEN);
-}
-
"CHAR" {
return(PARS_CHAR_TOKEN);
}
@@ -321,18 +301,10 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_SELECT_TOKEN);
}
-"SUM" {
- return(PARS_SUM_TOKEN);
-}
-
"COUNT" {
return(PARS_COUNT_TOKEN);
}
-"DISTINCT" {
- return(PARS_DISTINCT_TOKEN);
-}
-
"FROM" {
return(PARS_FROM_TOKEN);
}
@@ -345,10 +317,6 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_FOR_TOKEN);
}
-"READ" {
- return(PARS_READ_TOKEN);
-}
-
"ORDER" {
return(PARS_ORDER_TOKEN);
}
@@ -405,14 +373,6 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_TABLE_TOKEN);
}
-"COMPACT" {
- return(PARS_COMPACT_TOKEN);
-}
-
-"BLOCK_SIZE" {
- return(PARS_BLOCK_SIZE_TOKEN);
-}
-
"INDEX" {
return(PARS_INDEX_TOKEN);
}
@@ -453,30 +413,14 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_NOTFOUND_TOKEN);
}
-"TO_CHAR" {
- return(PARS_TO_CHAR_TOKEN);
-}
-
-"TO_NUMBER" {
- return(PARS_TO_NUMBER_TOKEN);
-}
-
"TO_BINARY" {
return(PARS_TO_BINARY_TOKEN);
}
-"BINARY_TO_NUMBER" {
- return(PARS_BINARY_TO_NUMBER_TOKEN);
-}
-
"SUBSTR" {
return(PARS_SUBSTR_TOKEN);
}
-"REPLSTR" {
- return(PARS_REPLSTR_TOKEN);
-}
-
"CONCAT" {
return(PARS_CONCAT_TOKEN);
}
@@ -489,30 +433,6 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_LENGTH_TOKEN);
}
-"SYSDATE" {
- return(PARS_SYSDATE_TOKEN);
-}
-
-"PRINTF" {
- return(PARS_PRINTF_TOKEN);
-}
-
-"ASSERT" {
- return(PARS_ASSERT_TOKEN);
-}
-
-"RND" {
- return(PARS_RND_TOKEN);
-}
-
-"RND_STR" {
- return(PARS_RND_STR_TOKEN);
-}
-
-"ROW_PRINTF" {
- return(PARS_ROW_PRINTF_TOKEN);
-}
-
"COMMIT" {
return(PARS_COMMIT_TOKEN);
}
@@ -525,10 +445,6 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_WORK_TOKEN);
}
-"UNSIGNED" {
- return(PARS_UNSIGNED_TOKEN);
-}
-
"EXIT" {
return(PARS_EXIT_TOKEN);
}
diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc
index b57753caa16..43f089e3bf7 100644
--- a/storage/innobase/pars/pars0pars.cc
+++ b/storage/innobase/pars/pars0pars.cc
@@ -50,29 +50,15 @@ sym_tab_t* pars_sym_tab_global;
/* Global variables used to denote certain reserved words, used in
constructing the parsing tree */
-pars_res_word_t pars_to_char_token = {PARS_TO_CHAR_TOKEN};
-pars_res_word_t pars_to_number_token = {PARS_TO_NUMBER_TOKEN};
pars_res_word_t pars_to_binary_token = {PARS_TO_BINARY_TOKEN};
-pars_res_word_t pars_binary_to_number_token = {PARS_BINARY_TO_NUMBER_TOKEN};
pars_res_word_t pars_substr_token = {PARS_SUBSTR_TOKEN};
-pars_res_word_t pars_replstr_token = {PARS_REPLSTR_TOKEN};
pars_res_word_t pars_concat_token = {PARS_CONCAT_TOKEN};
pars_res_word_t pars_instr_token = {PARS_INSTR_TOKEN};
pars_res_word_t pars_length_token = {PARS_LENGTH_TOKEN};
-pars_res_word_t pars_sysdate_token = {PARS_SYSDATE_TOKEN};
-pars_res_word_t pars_printf_token = {PARS_PRINTF_TOKEN};
-pars_res_word_t pars_assert_token = {PARS_ASSERT_TOKEN};
-pars_res_word_t pars_rnd_token = {PARS_RND_TOKEN};
-pars_res_word_t pars_rnd_str_token = {PARS_RND_STR_TOKEN};
pars_res_word_t pars_count_token = {PARS_COUNT_TOKEN};
-pars_res_word_t pars_sum_token = {PARS_SUM_TOKEN};
-pars_res_word_t pars_distinct_token = {PARS_DISTINCT_TOKEN};
-pars_res_word_t pars_binary_token = {PARS_BINARY_TOKEN};
-pars_res_word_t pars_blob_token = {PARS_BLOB_TOKEN};
pars_res_word_t pars_int_token = {PARS_INT_TOKEN};
pars_res_word_t pars_bigint_token = {PARS_BIGINT_TOKEN};
pars_res_word_t pars_char_token = {PARS_CHAR_TOKEN};
-pars_res_word_t pars_float_token = {PARS_FLOAT_TOKEN};
pars_res_word_t pars_update_token = {PARS_UPDATE_TOKEN};
pars_res_word_t pars_asc_token = {PARS_ASC_TOKEN};
pars_res_word_t pars_desc_token = {PARS_DESC_TOKEN};
@@ -195,24 +181,15 @@ pars_func_get_class(
case PARS_AND_TOKEN: case PARS_OR_TOKEN: case PARS_NOT_TOKEN:
return(PARS_FUNC_LOGICAL);
- case PARS_COUNT_TOKEN: case PARS_SUM_TOKEN:
+ case PARS_COUNT_TOKEN:
return(PARS_FUNC_AGGREGATE);
- case PARS_TO_CHAR_TOKEN:
- case PARS_TO_NUMBER_TOKEN:
case PARS_TO_BINARY_TOKEN:
- case PARS_BINARY_TO_NUMBER_TOKEN:
case PARS_SUBSTR_TOKEN:
case PARS_CONCAT_TOKEN:
case PARS_LENGTH_TOKEN:
case PARS_INSTR_TOKEN:
- case PARS_SYSDATE_TOKEN:
case PARS_NOTFOUND_TOKEN:
- case PARS_PRINTF_TOKEN:
- case PARS_ASSERT_TOKEN:
- case PARS_RND_TOKEN:
- case PARS_RND_STR_TOKEN:
- case PARS_REPLSTR_TOKEN:
return(PARS_FUNC_PREDEFINED);
default:
@@ -499,7 +476,6 @@ pars_resolve_func_data_type(
arg = node->args;
switch (node->func) {
- case PARS_SUM_TOKEN:
case '+': case '-': case '*': case '/':
/* Inherit the data type from the first argument (which must
not be the SQL null literal whose type is DATA_ERROR) */
@@ -516,13 +492,6 @@ pars_resolve_func_data_type(
dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
break;
- case PARS_TO_CHAR_TOKEN:
- case PARS_RND_STR_TOKEN:
- ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT);
- dtype_set(que_node_get_data_type(node), DATA_VARCHAR,
- DATA_ENGLISH, 0);
- break;
-
case PARS_TO_BINARY_TOKEN:
if (dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT) {
dtype_set(que_node_get_data_type(node), DATA_VARCHAR,
@@ -533,19 +502,12 @@ pars_resolve_func_data_type(
}
break;
- case PARS_TO_NUMBER_TOKEN:
- case PARS_BINARY_TO_NUMBER_TOKEN:
case PARS_LENGTH_TOKEN:
case PARS_INSTR_TOKEN:
ut_a(pars_is_string_type(que_node_get_data_type(arg)->mtype));
dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
break;
- case PARS_SYSDATE_TOKEN:
- ut_a(arg == NULL);
- dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
- break;
-
case PARS_SUBSTR_TOKEN:
case PARS_CONCAT_TOKEN:
ut_a(pars_is_string_type(que_node_get_data_type(arg)->mtype));
@@ -566,11 +528,6 @@ pars_resolve_func_data_type(
dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
break;
- case PARS_RND_TOKEN:
- ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT);
- dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4);
- break;
-
case PARS_LIKE_TOKEN_EXACT:
case PARS_LIKE_TOKEN_PREFIX:
case PARS_LIKE_TOKEN_SUFFIX:
@@ -1355,9 +1312,7 @@ pars_set_dfield_type(
pars_res_word_t* type, /*!< in: pointer to a type
token */
ulint len, /*!< in: length, or 0 */
- ibool is_unsigned, /*!< in: if TRUE, column is
- UNSIGNED. */
- ibool is_not_null) /*!< in: if TRUE, column is
+ bool is_not_null) /*!< in: whether the column is
NOT NULL. */
{
ulint flags = 0;
@@ -1366,10 +1321,6 @@ pars_set_dfield_type(
flags |= DATA_NOT_NULL;
}
- if (is_unsigned) {
- flags |= DATA_UNSIGNED;
- }
-
if (type == &pars_bigint_token) {
ut_a(len == 0);
@@ -1384,16 +1335,6 @@ pars_set_dfield_type(
dtype_set(dfield_get_type(dfield), DATA_VARCHAR,
DATA_ENGLISH | flags, len);
- } else if (type == &pars_binary_token) {
- ut_a(len != 0);
-
- dtype_set(dfield_get_type(dfield), DATA_FIXBINARY,
- DATA_BINARY_TYPE | flags, len);
- } else if (type == &pars_blob_token) {
- ut_a(len == 0);
-
- dtype_set(dfield_get_type(dfield), DATA_BLOB,
- DATA_BINARY_TYPE | flags, 0);
} else {
ut_error;
}
@@ -1414,28 +1355,7 @@ pars_variable_declaration(
node->param_type = PARS_NOT_PARAM;
- pars_set_dfield_type(que_node_get_val(node), type, 0, FALSE, FALSE);
-
- return(node);
-}
-
-/*********************************************************************//**
-Parses a procedure parameter declaration.
-@return own: symbol table node of type SYM_VAR */
-sym_node_t*
-pars_parameter_declaration(
-/*=======================*/
- sym_node_t* node, /*!< in: symbol table node allocated for the
- id of the parameter */
- ulint param_type,
- /*!< in: PARS_INPUT or PARS_OUTPUT */
- pars_res_word_t* type) /*!< in: pointer to a type token */
-{
- ut_a((param_type == PARS_INPUT) || (param_type == PARS_OUTPUT));
-
- pars_variable_declaration(node, type);
-
- node->param_type = param_type;
+ pars_set_dfield_type(que_node_get_val(node), type, 0, false);
return(node);
}
@@ -1821,8 +1741,6 @@ pars_column_def(
pars_res_word_t* type, /*!< in: data type */
sym_node_t* len, /*!< in: length of column, or
NULL */
- void* is_unsigned, /*!< in: if not NULL, column
- is of type UNSIGNED. */
void* is_not_null) /*!< in: if not NULL, column
is of type NOT NULL. */
{
@@ -1835,7 +1753,7 @@ pars_column_def(
}
pars_set_dfield_type(que_node_get_val(sym_node), type, len2,
- is_unsigned != NULL, is_not_null != NULL);
+ is_not_null != NULL);
return(sym_node);
}
@@ -1848,9 +1766,7 @@ pars_create_table(
/*==============*/
sym_node_t* table_sym, /*!< in: table name node in the symbol
table */
- sym_node_t* column_defs, /*!< in: list of column names */
- sym_node_t* compact, /* in: non-NULL if COMPACT table. */
- sym_node_t* block_size) /* in: block size (can be NULL) */
+ sym_node_t* column_defs) /*!< in: list of column names */
{
dict_table_t* table;
sym_node_t* column;
@@ -1858,57 +1774,11 @@ pars_create_table(
const dtype_t* dtype;
ulint n_cols;
ulint flags = 0;
- ulint flags2 = 0;
-
- if (compact != NULL) {
-
- /* System tables currently only use the REDUNDANT row
- format therefore the check for srv_file_per_table should be
- safe for now. */
-
- flags |= DICT_TF_COMPACT;
-
- /* FIXME: Ideally this should be part of the SQL syntax
- or use some other mechanism. We want to reduce dependency
- on global variables. There is an inherent race here but
- that has always existed around this variable. */
- if (srv_file_per_table) {
- flags2 |= DICT_TF2_USE_FILE_PER_TABLE;
- }
- }
-
- if (block_size != NULL) {
- ulint size;
- dfield_t* dfield;
+ ulint flags2 = DICT_TF2_FTS_AUX_HEX_NAME;
- dfield = que_node_get_val(block_size);
-
- ut_a(dfield_get_len(dfield) == 4);
- size = mach_read_from_4(static_cast<byte*>(
- dfield_get_data(dfield)));
-
-
- switch (size) {
- case 0:
- break;
-
- case 1: case 2: case 4: case 8: case 16:
- flags |= DICT_TF_COMPACT;
- /* FTS-FIXME: needs the zip changes */
- /* flags |= size << DICT_TF_COMPRESSED_SHIFT; */
- break;
-
- default:
- ut_error;
- }
- }
-
- /* Set the flags2 when create table or alter tables */
- flags2 |= DICT_TF2_FTS_AUX_HEX_NAME;
DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name",
flags2 &= ~DICT_TF2_FTS_AUX_HEX_NAME;);
-
n_cols = que_node_list_get_len(column_defs);
table = dict_mem_table_create(
@@ -2005,7 +1875,6 @@ pars_procedure_definition(
/*======================*/
sym_node_t* sym_node, /*!< in: procedure id node in the symbol
table */
- sym_node_t* param_list, /*!< in: parameter declaration list */
que_node_t* stat_list) /*!< in: statement list */
{
proc_node_t* node;
@@ -2030,7 +1899,6 @@ pars_procedure_definition(
sym_node->resolved = TRUE;
node->proc_id = sym_node;
- node->param_list = param_list;
node->stat_list = stat_list;
pars_set_parent_in_list(stat_list, node);
diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc
index 2abcbb425c0..b093a8b5952 100644
--- a/storage/innobase/rem/rem0cmp.cc
+++ b/storage/innobase/rem/rem0cmp.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
-Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (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 the Free Software
@@ -534,7 +535,7 @@ cmp_data(
/** Compare a GIS data tuple to a physical record.
@param[in] dtuple data tuple
-@param[in] rec B-tree record
+@param[in] rec R-tree record
@param[in] offsets rec_get_offsets(rec)
@param[in] mode compare mode
@retval negative if dtuple is less than rec */
@@ -546,7 +547,7 @@ cmp_dtuple_rec_with_gis(
dtuple in some of the common fields, or which
has an equal number or more fields than
dtuple */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
page_cur_mode_t mode) /*!< in: compare mode */
{
const dfield_t* dtuple_field; /* current field in logical record */
@@ -579,7 +580,7 @@ int
cmp_dtuple_rec_with_gis_internal(
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
const dfield_t* dtuple_field; /* current field in logical record */
ulint dtuple_f_len; /* the length of the current field
@@ -650,7 +651,7 @@ int
cmp_dtuple_rec_with_match_low(
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint n_cmp,
ulint* matched_fields)
{
@@ -784,7 +785,7 @@ cmp_dtuple_rec_with_match_bytes(
const dtuple_t* dtuple,
const rec_t* rec,
const dict_index_t* index,
- const ulint* offsets,
+ const offset_t* offsets,
ulint* matched_fields,
ulint* matched_bytes)
{
@@ -952,7 +953,7 @@ int
cmp_dtuple_rec(
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
ulint matched_fields = 0;
@@ -970,7 +971,7 @@ cmp_dtuple_is_prefix_of_rec(
/*========================*/
const dtuple_t* dtuple, /*!< in: data tuple */
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ulint n_fields;
ulint matched_fields = 0;
@@ -998,8 +999,8 @@ cmp_rec_rec_simple_field(
/*=====================*/
const rec_t* rec1, /*!< in: physical record */
const rec_t* rec2, /*!< in: physical record */
- const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
- const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
+ const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
+ const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
const dict_index_t* index, /*!< in: data dictionary index */
ulint n) /*!< in: field to compare */
{
@@ -1029,8 +1030,8 @@ cmp_rec_rec_simple(
/*===============*/
const rec_t* rec1, /*!< in: physical record */
const rec_t* rec2, /*!< in: physical record */
- const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
- const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
+ const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
+ const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
const dict_index_t* index, /*!< in: data dictionary index */
struct TABLE* table) /*!< in: MySQL table, for reporting
duplicate key value if applicable,
@@ -1096,42 +1097,40 @@ cmp_rec_rec_simple(
return(0);
}
-/** Compare two B-tree records.
-@param[in] rec1 B-tree record
-@param[in] rec2 B-tree record
-@param[in] offsets1 rec_get_offsets(rec1, index)
-@param[in] offsets2 rec_get_offsets(rec2, index)
-@param[in] index B-tree index
-@param[in] nulls_unequal true if this is for index cardinality
-statistics estimation, and innodb_stats_method=nulls_unequal
-or innodb_stats_method=nulls_ignored
-@param[out] matched_fields number of completely matched fields
-within the first field not completely matched
-@return the comparison result
+/** Compare two B-tree or R-tree records.
+Only the common first fields are compared, and externally stored field
+are treated as equal.
+@param[in] rec1 record (possibly not on an index page)
+@param[in] rec2 B-tree or R-tree record in an index page
+@param[in] offsets1 rec_get_offsets(rec1, index)
+@param[in] offsets2 rec_get_offsets(rec2, index)
+@param[in] nulls_unequal true if this is for index cardinality
+ statistics estimation with
+ innodb_stats_method=nulls_unequal
+ or innodb_stats_method=nulls_ignored
+@param[out] matched_fields number of completely matched fields
+ within the first field not completely matched
@retval 0 if rec1 is equal to rec2
@retval negative if rec1 is less than rec2
-@retval positive if rec2 is greater than rec2 */
+@retval positive if rec1 is greater than rec2 */
int
-cmp_rec_rec_with_match(
+cmp_rec_rec(
const rec_t* rec1,
const rec_t* rec2,
- const ulint* offsets1,
- const ulint* offsets2,
+ const offset_t* offsets1,
+ const offset_t* offsets2,
const dict_index_t* index,
bool nulls_unequal,
ulint* matched_fields)
{
- ulint rec1_n_fields; /* the number of fields in rec */
ulint rec1_f_len; /* length of current field in rec */
const byte* rec1_b_ptr; /* pointer to the current byte
in rec field */
- ulint rec2_n_fields; /* the number of fields in rec */
ulint rec2_f_len; /* length of current field in rec */
const byte* rec2_b_ptr; /* pointer to the current byte
in rec field */
ulint cur_field = 0; /* current field number */
int ret = 0; /* return value */
- ulint comp;
ut_ad(rec1 != NULL);
ut_ad(rec2 != NULL);
@@ -1139,10 +1138,12 @@ cmp_rec_rec_with_match(
ut_ad(rec_offs_validate(rec1, index, offsets1));
ut_ad(rec_offs_validate(rec2, index, offsets2));
ut_ad(rec_offs_comp(offsets1) == rec_offs_comp(offsets2));
+ ut_ad(fil_page_index_page_check(page_align(rec2)));
+ ut_ad(!!dict_index_is_spatial(index)
+ == (fil_page_get_type(page_align(rec2)) == FIL_PAGE_RTREE));
- comp = rec_offs_comp(offsets1);
- rec1_n_fields = rec_offs_n_fields(offsets1);
- rec2_n_fields = rec_offs_n_fields(offsets2);
+ ulint comp = rec_offs_comp(offsets1);
+ ulint n_fields;
/* Test if rec is the predefined minimum record */
if (UNIV_UNLIKELY(rec_get_info_bits(rec1, comp)
@@ -1158,37 +1159,41 @@ cmp_rec_rec_with_match(
goto order_resolved;
}
- /* Match fields in a loop */
+ /* For non-leaf spatial index records, the
+ dict_index_get_n_unique_in_tree() does include the child page
+ number, because spatial index node pointers only contain
+ the MBR (minimum bounding rectangle) and the child page number.
- for (; cur_field < rec1_n_fields && cur_field < rec2_n_fields;
- cur_field++) {
+ For B-tree node pointers, the key alone (secondary index
+ columns and PRIMARY KEY columns) must be unique, and there is
+ no need to compare the child page number. */
+ n_fields = std::min(rec_offs_n_fields(offsets1),
+ rec_offs_n_fields(offsets2));
+ n_fields = std::min(n_fields, dict_index_get_n_unique_in_tree(index));
+ for (; cur_field < n_fields; cur_field++) {
ulint mtype;
ulint prtype;
- /* If this is node-ptr records then avoid comparing node-ptr
- field. Only key field needs to be compared. */
- if (cur_field == dict_index_get_n_unique_in_tree(index)) {
- break;
- }
-
- if (dict_index_is_ibuf(index)) {
+ if (UNIV_UNLIKELY(dict_index_is_ibuf(index))) {
/* This is for the insert buffer B-tree. */
mtype = DATA_BINARY;
prtype = 0;
} else {
- const dict_col_t* col;
-
- col = dict_index_get_nth_col(index, cur_field);
-
+ const dict_col_t* col = dict_index_get_nth_col(
+ index, cur_field);
mtype = col->mtype;
prtype = col->prtype;
- /* If the index is spatial index, we mark the
- prtype of the first field as MBR field. */
- if (cur_field == 0 && dict_index_is_spatial(index)) {
+ if (UNIV_LIKELY(!dict_index_is_spatial(index))) {
+ } else if (cur_field == 0) {
ut_ad(DATA_GEOMETRY_MTYPE(mtype));
prtype |= DATA_GIS_MBR;
+ } else if (!page_rec_is_leaf(rec2)) {
+ /* Compare the child page number. */
+ ut_ad(cur_field == 1);
+ mtype = DATA_SYS_CHILD;
+ prtype = 0;
}
}
@@ -1226,8 +1231,10 @@ cmp_rec_rec_with_match(
to the common fields */
ut_ad(ret == 0);
order_resolved:
- *matched_fields = cur_field;
- return(ret);
+ if (matched_fields) {
+ *matched_fields = cur_field;
+ }
+ return ret;
}
#ifdef UNIV_COMPILE_TEST_FUNCS
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index 7956c0fb62e..458457c52d5 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -277,13 +277,13 @@ void
rec_init_offsets_comp_ordinary(
const rec_t* rec,
const dict_index_t* index,
- ulint* offsets,
+ offset_t* offsets,
ulint n_core,
const dict_col_t::def_t*def_val,
rec_leaf_format format)
{
- ulint offs = 0;
- ulint any = 0;
+ offset_t offs = 0;
+ offset_t any = 0;
const byte* nulls = rec;
const byte* lens = NULL;
ulint n_fields = n_core;
@@ -337,8 +337,8 @@ ordinary:
/* We cannot invoke rec_offs_make_valid() if format==REC_LEAF_TEMP.
Similarly, rec_offs_validate() will fail in that case, because
it invokes rec_get_status(). */
- offsets[2] = (ulint) rec;
- offsets[3] = (ulint) index;
+ memcpy(&offsets[RECORD_OFFSET], &rec, sizeof(rec));
+ memcpy(&offsets[INDEX_OFFSET], &index, sizeof(index));
#endif /* UNIV_DEBUG */
/* read the lengths of fields 0..n_fields */
@@ -348,17 +348,17 @@ ordinary:
= dict_index_get_nth_field(index, i);
const dict_col_t* col
= dict_field_get_col(field);
- ulint len;
+ offset_t len;
/* set default value flag */
if (i < n_fields) {
} else if (def_val) {
const dict_col_t::def_t& d = def_val[i - n_core];
if (!d.data) {
- len = offs | REC_OFFS_SQL_NULL;
+ len = combine(offs, SQL_NULL);
ut_ad(d.len == UNIV_SQL_NULL);
} else {
- len = offs | REC_OFFS_DEFAULT;
+ len = combine(offs, DEFAULT);
any |= REC_OFFS_DEFAULT;
}
@@ -366,10 +366,10 @@ ordinary:
} else {
ulint dlen;
if (!index->instant_field_value(i, &dlen)) {
- len = offs | REC_OFFS_SQL_NULL;
+ len = combine(offs, SQL_NULL);
ut_ad(dlen == UNIV_SQL_NULL);
} else {
- len = offs | REC_OFFS_DEFAULT;
+ len = combine(offs, DEFAULT);
any |= REC_OFFS_DEFAULT;
}
@@ -391,7 +391,7 @@ ordinary:
We do not advance offs, and we set
the length to zero and enable the
SQL NULL flag in offsets[]. */
- len = offs | REC_OFFS_SQL_NULL;
+ len = combine(offs, SQL_NULL);
goto resolved;
}
null_mask <<= 1;
@@ -414,11 +414,11 @@ ordinary:
len <<= 8;
len |= *lens--;
- offs += len & 0x3fff;
+ offs += get_value(len);
if (UNIV_UNLIKELY(len & 0x4000)) {
ut_ad(dict_index_is_clust(index));
any |= REC_OFFS_EXTERNAL;
- len = offs | REC_OFFS_EXTERNAL;
+ len = combine(offs, STORED_OFFPAGE);
} else {
len = offs;
}
@@ -435,7 +435,7 @@ resolved:
} while (++i < rec_offs_n_fields(offsets));
*rec_offs_base(offsets)
- = ulint(rec - (lens + 1)) | REC_OFFS_COMPACT | any;
+ = static_cast<offset_t>(rec - (lens + 1)) | REC_OFFS_COMPACT | any;
}
#ifdef UNIV_DEBUG
@@ -449,7 +449,7 @@ rec_offs_make_valid(
const rec_t* rec,
const dict_index_t* index,
bool leaf,
- ulint* offsets)
+ offset_t* offsets)
{
ut_ad(rec_offs_n_fields(offsets)
<= (leaf
@@ -469,10 +469,10 @@ rec_offs_make_valid(
|| n >= rec_offs_n_fields(offsets));
for (; n < rec_offs_n_fields(offsets); n++) {
ut_ad(leaf);
- ut_ad(rec_offs_base(offsets)[1 + n] & REC_OFFS_DEFAULT);
+ ut_ad(get_type(rec_offs_base(offsets)[1 + n]) == DEFAULT);
}
- offsets[2] = ulint(rec);
- offsets[3] = ulint(index);
+ memcpy(&offsets[RECORD_OFFSET], &rec, sizeof(rec));
+ memcpy(&offsets[INDEX_OFFSET], &index, sizeof(index));
}
/** Validate offsets returned by rec_get_offsets().
@@ -484,14 +484,14 @@ bool
rec_offs_validate(
const rec_t* rec,
const dict_index_t* index,
- const ulint* offsets)
+ const offset_t* offsets)
{
ulint i = rec_offs_n_fields(offsets);
ulint last = ULINT_MAX;
ulint comp = *rec_offs_base(offsets) & REC_OFFS_COMPACT;
if (rec) {
- ut_ad(ulint(rec) == offsets[2]);
+ ut_ad(!memcmp(&rec, &offsets[RECORD_OFFSET], sizeof(rec)));
if (!comp) {
const bool is_user_rec = rec_get_heap_no_old(rec)
>= PAGE_HEAP_NO_USER_LOW;
@@ -503,14 +503,14 @@ rec_offs_validate(
|| (n + (index->id == DICT_INDEXES_ID))
>= index->n_core_fields);
for (; n < i; n++) {
- ut_ad(rec_offs_base(offsets)[1 + n]
- & REC_OFFS_DEFAULT);
+ ut_ad(get_type(rec_offs_base(offsets)[1 + n])
+ == DEFAULT);
}
}
}
if (index) {
ulint max_n_fields;
- ut_ad(ulint(index) == offsets[3]);
+ ut_ad(!memcmp(&index, &offsets[INDEX_OFFSET], sizeof(index)));
max_n_fields = ut_max(
dict_index_get_n_fields(index),
dict_index_get_n_unique_in_tree(index) + 1);
@@ -536,7 +536,7 @@ rec_offs_validate(
ut_a(!index->n_def || i <= max_n_fields);
}
while (i--) {
- ulint curr = rec_offs_base(offsets)[1 + i] & REC_OFFS_MASK;
+ ulint curr = get_value(rec_offs_base(offsets)[1 + i]);
ut_a(curr <= last);
last = curr;
}
@@ -553,10 +553,9 @@ to the extra size (if REC_OFFS_COMPACT is set, the record is in the
new format; if REC_OFFS_EXTERNAL is set, the record contains externally
stored columns), and rec_offs_base(offsets)[1..n_fields] will be set to
offsets past the end of fields 0..n_fields, or to the beginning of
-fields 1..n_fields+1. When the high-order bit of the offset at [i+1]
-is set (REC_OFFS_SQL_NULL), the field i is NULL. When the second
-high-order bit of the offset at [i+1] is set (REC_OFFS_EXTERNAL), the
-field i is being stored externally.
+fields 1..n_fields+1. When the type of the offset at [i+1]
+is (SQL_NULL), the field i is NULL. When the type of the offset at [i+1]
+is (STORED_OFFPAGE), the field i is stored externally.
@param[in] rec record
@param[in] index the index that the record belongs in
@param[in] leaf whether the record resides in a leaf page
@@ -567,14 +566,14 @@ rec_init_offsets(
const rec_t* rec,
const dict_index_t* index,
bool leaf,
- ulint* offsets)
+ offset_t* offsets)
{
ulint i = 0;
- ulint offs;
+ offset_t offs;
ut_ad(index->n_core_null_bytes <= UT_BITS_IN_BYTES(index->n_nullable));
- ut_d(offsets[2] = ulint(rec));
- ut_d(offsets[3] = ulint(index));
+ ut_d(memcpy(&offsets[RECORD_OFFSET], &rec, sizeof(rec)));
+ ut_d(memcpy(&offsets[INDEX_OFFSET], &index, sizeof(index)));
if (dict_table_is_comp(index->table)) {
const byte* nulls;
@@ -632,7 +631,7 @@ rec_init_offsets(
/* read the lengths of fields 0..n */
do {
- ulint len;
+ offset_t len;
if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
len = offs += REC_NODE_PTR_SIZE;
goto resolved;
@@ -654,7 +653,7 @@ rec_init_offsets(
We do not advance offs, and we set
the length to zero and enable the
SQL NULL flag in offsets[]. */
- len = offs | REC_OFFS_SQL_NULL;
+ len = combine(offs, SQL_NULL);
goto resolved;
}
null_mask <<= 1;
@@ -686,7 +685,7 @@ rec_init_offsets(
stored columns. Thus
the "e" flag must be 0. */
ut_a(!(len & 0x4000));
- offs += len & 0x3fff;
+ offs += get_value(len);
len = offs;
goto resolved;
@@ -702,39 +701,40 @@ resolved:
} while (++i < rec_offs_n_fields(offsets));
*rec_offs_base(offsets)
- = ulint(rec - (lens + 1)) | REC_OFFS_COMPACT;
+ = static_cast<offset_t>(rec - (lens + 1))
+ | REC_OFFS_COMPACT;
} else {
/* Old-style record: determine extra size and end offsets */
offs = REC_N_OLD_EXTRA_BYTES;
const ulint n_fields = rec_get_n_fields_old(rec);
const ulint n = std::min(n_fields, rec_offs_n_fields(offsets));
- ulint any;
+ offset_t any;
if (rec_get_1byte_offs_flag(rec)) {
- offs += n_fields;
+ offs += static_cast<offset_t>(n_fields);
any = offs;
/* Determine offsets to fields */
do {
offs = rec_1_get_field_end_info(rec, i);
if (offs & REC_1BYTE_SQL_NULL_MASK) {
offs &= ~REC_1BYTE_SQL_NULL_MASK;
- offs |= REC_OFFS_SQL_NULL;
+ set_type(offs, SQL_NULL);
}
rec_offs_base(offsets)[1 + i] = offs;
} while (++i < n);
} else {
- offs += 2 * n_fields;
+ offs += 2 * static_cast<offset_t>(n_fields);
any = offs;
/* Determine offsets to fields */
do {
offs = rec_2_get_field_end_info(rec, i);
if (offs & REC_2BYTE_SQL_NULL_MASK) {
offs &= ~REC_2BYTE_SQL_NULL_MASK;
- offs |= REC_OFFS_SQL_NULL;
+ set_type(offs, SQL_NULL);
}
if (offs & REC_2BYTE_EXTERN_MASK) {
offs &= ~REC_2BYTE_EXTERN_MASK;
- offs |= REC_OFFS_EXTERNAL;
+ set_type(offs, STORED_OFFPAGE);
any |= REC_OFFS_EXTERNAL;
}
rec_offs_base(offsets)[1 + i] = offs;
@@ -746,8 +746,8 @@ resolved:
|| i + (index->id == DICT_INDEXES_ID)
== rec_offs_n_fields(offsets));
- offs = (rec_offs_base(offsets)[i] & REC_OFFS_MASK)
- | REC_OFFS_DEFAULT;
+ ut_ad(i != 0);
+ offs = combine(rec_offs_base(offsets)[i], DEFAULT);
do {
rec_offs_base(offsets)[1 + i] = offs;
@@ -770,11 +770,11 @@ resolved:
(ULINT_UNDEFINED to compute all offsets)
@param[in,out] heap memory heap
@return the new offsets */
-ulint*
+offset_t*
rec_get_offsets_func(
const rec_t* rec,
const dict_index_t* index,
- ulint* offsets,
+ offset_t* offsets,
bool leaf,
ulint n_fields,
#ifdef UNIV_DEBUG
@@ -856,11 +856,11 @@ rec_get_offsets_func(
if (UNIV_UNLIKELY(!offsets)
|| UNIV_UNLIKELY(rec_offs_get_n_alloc(offsets) < size)) {
if (UNIV_UNLIKELY(!*heap)) {
- *heap = mem_heap_create_at(size * sizeof(ulint),
+ *heap = mem_heap_create_at(size * sizeof(*offsets),
file, line);
}
- offsets = static_cast<ulint*>(
- mem_heap_alloc(*heap, size * sizeof(ulint)));
+ offsets = static_cast<offset_t*>(
+ mem_heap_alloc(*heap, size * sizeof(*offsets)));
rec_offs_set_n_alloc(offsets, size);
}
@@ -883,13 +883,13 @@ rec_get_offsets_reverse(
const dict_index_t* index, /*!< in: record descriptor */
ulint node_ptr,/*!< in: nonzero=node pointer,
0=leaf node */
- ulint* offsets)/*!< in/out: array consisting of
+ offset_t* offsets)/*!< in/out: array consisting of
offsets[0] allocated elements */
{
ulint n;
ulint i;
- ulint offs;
- ulint any_ext;
+ offset_t offs;
+ offset_t any_ext = 0;
const byte* nulls;
const byte* lens;
dict_field_t* field;
@@ -915,11 +915,10 @@ rec_get_offsets_reverse(
lens = nulls + UT_BITS_IN_BYTES(index->n_nullable);
i = offs = 0;
null_mask = 1;
- any_ext = 0;
/* read the lengths of fields 0..n */
do {
- ulint len;
+ offset_t len;
if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
len = offs += REC_NODE_PTR_SIZE;
goto resolved;
@@ -940,7 +939,7 @@ rec_get_offsets_reverse(
We do not advance offs, and we set
the length to zero and enable the
SQL NULL flag in offsets[]. */
- len = offs | REC_OFFS_SQL_NULL;
+ len = combine(offs, SQL_NULL);
goto resolved;
}
null_mask <<= 1;
@@ -964,10 +963,11 @@ rec_get_offsets_reverse(
len <<= 8;
len |= *lens++;
- offs += len & 0x3fff;
+ offs += get_value(len);
if (UNIV_UNLIKELY(len & 0x4000)) {
any_ext = REC_OFFS_EXTERNAL;
- len = offs | REC_OFFS_EXTERNAL;
+ len = combine(offs,
+ STORED_OFFPAGE);
} else {
len = offs;
}
@@ -978,15 +978,16 @@ rec_get_offsets_reverse(
len = offs += len;
} else {
- len = offs += field->fixed_len;
+ len = offs += static_cast<offset_t>(field->fixed_len);
}
resolved:
rec_offs_base(offsets)[i + 1] = len;
} while (++i < rec_offs_n_fields(offsets));
ut_ad(lens >= extra);
- *rec_offs_base(offsets) = (ulint(lens - extra) + REC_N_NEW_EXTRA_BYTES)
- | REC_OFFS_COMPACT | any_ext;
+ *rec_offs_base(offsets)
+ = static_cast<offset_t>(lens - extra + REC_N_NEW_EXTRA_BYTES)
+ | REC_OFFS_COMPACT | any_ext;
}
/************************************************************//**
@@ -1681,7 +1682,7 @@ void
rec_init_offsets_temp(
const rec_t* rec,
const dict_index_t* index,
- ulint* offsets,
+ offset_t* offsets,
ulint n_core,
const dict_col_t::def_t*def_val,
rec_comp_status_t status)
@@ -1707,7 +1708,7 @@ void
rec_init_offsets_temp(
const rec_t* rec,
const dict_index_t* index,
- ulint* offsets)
+ offset_t* offsets)
{
ut_ad(!index->is_instant());
rec_init_offsets_comp_ordinary(rec, index, offsets,
@@ -1750,8 +1751,8 @@ rec_copy_prefix_to_dtuple(
ulint n_fields,
mem_heap_t* heap)
{
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(is_leaf || n_fields
@@ -2047,7 +2048,7 @@ ibool
rec_validate(
/*=========*/
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ulint len;
ulint n_fields;
@@ -2156,7 +2157,7 @@ rec_print_comp(
/*===========*/
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ulint i;
@@ -2282,7 +2283,7 @@ rec_print_mbr_rec(
/*==============*/
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ut_ad(rec_offs_validate(rec, NULL, offsets));
ut_ad(!rec_offs_any_default(offsets));
@@ -2350,7 +2351,7 @@ rec_print_new(
/*==========*/
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets)/*!< in: array returned by rec_get_offsets() */
{
ut_ad(rec_offs_validate(rec, NULL, offsets));
@@ -2390,7 +2391,7 @@ rec_print(
return;
} else {
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
rec_print_new(file, rec,
@@ -2413,7 +2414,7 @@ rec_print(
std::ostream& o,
const rec_t* rec,
ulint info,
- const ulint* offsets)
+ const offset_t* offsets)
{
const ulint comp = rec_offs_comp(offsets);
const ulint n = rec_offs_n_fields(offsets);
@@ -2470,7 +2471,7 @@ std::ostream&
operator<<(std::ostream& o, const rec_index_print& r)
{
mem_heap_t* heap = NULL;
- ulint* offsets = rec_get_offsets(
+ offset_t* offsets = rec_get_offsets(
r.m_rec, r.m_index, NULL, page_rec_is_leaf(r.m_rec),
ULINT_UNDEFINED, &heap);
rec_print(o, r.m_rec,
@@ -2508,9 +2509,9 @@ rec_get_trx_id(
const byte* trx_id;
ulint len;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
+ offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
rec_offs_init(offsets_);
- ulint* offsets = offsets_;
+ offset_t* offsets = offsets_;
ut_ad(trx_id_col <= MAX_REF_PARTS);
ut_ad(dict_index_is_clust(index));
@@ -2537,11 +2538,11 @@ rec_get_trx_id(
@param[in] n nth field */
void
rec_offs_make_nth_extern(
- ulint* offsets,
+ offset_t* offsets,
const ulint n)
{
ut_ad(!rec_offs_nth_sql_null(offsets, n));
- rec_offs_base(offsets)[1 + n] |= REC_OFFS_EXTERNAL;
+ set_type(rec_offs_base(offsets)[1 + n], STORED_OFFPAGE);
}
#ifdef WITH_WSREP
# include "ha_prototypes.h"
@@ -2561,8 +2562,8 @@ wsrep_rec_get_foreign_key(
ulint i;
uint key_parts;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- const ulint* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ const offset_t* offsets;
ut_ad(index_for);
ut_ad(index_ref);
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index f40d6772536..d439d7563d9 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+Copyright (c) 2015, 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
@@ -1372,7 +1372,7 @@ row_fts_sel_tree_propagate(
ulint propogated, /*<! in: tree node propagated */
int* sel_tree, /*<! in: selection tree */
const mrec_t** mrec, /*<! in: sort record */
- ulint** offsets, /*<! in: record offsets */
+ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index) /*<! in/out: FTS index */
{
ulint parent;
@@ -1422,7 +1422,7 @@ row_fts_sel_tree_update(
ulint propagated, /*<! in: node to propagate up */
ulint height, /*<! in: tree height */
const mrec_t** mrec, /*<! in: sort record */
- ulint** offsets, /*<! in: record offsets */
+ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index) /*<! in: index dictionary */
{
ulint i;
@@ -1444,7 +1444,7 @@ row_fts_build_sel_tree_level(
int* sel_tree, /*<! in/out: selection tree */
ulint level, /*<! in: selection tree level */
const mrec_t** mrec, /*<! in: sort record */
- ulint** offsets, /*<! in: record offsets */
+ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index) /*<! in: index dictionary */
{
ulint start;
@@ -1504,7 +1504,7 @@ row_fts_build_sel_tree(
/*===================*/
int* sel_tree, /*<! in/out: selection tree */
const mrec_t** mrec, /*<! in: sort record */
- ulint** offsets, /*<! in: record offsets */
+ offset_t** offsets, /*<! in: record offsets */
dict_index_t* index) /*<! in: index dictionary */
{
ulint treelevel = 1;
@@ -1554,7 +1554,7 @@ row_fts_merge_insert(
mem_heap_t* heap;
dberr_t error = DB_SUCCESS;
ulint* foffs;
- ulint** offsets;
+ offset_t** offsets;
fts_tokenizer_word_t new_word;
ib_vector_t* positions;
doc_id_t last_doc_id;
@@ -1593,7 +1593,7 @@ row_fts_merge_insert(
heap, sizeof (*b) * fts_sort_pll_degree);
foffs = (ulint*) mem_heap_alloc(
heap, sizeof(*foffs) * fts_sort_pll_degree);
- offsets = (ulint**) mem_heap_alloc(
+ offsets = (offset_t**) mem_heap_alloc(
heap, sizeof(*offsets) * fts_sort_pll_degree);
buf = (mrec_buf_t**) mem_heap_alloc(
heap, sizeof(*buf) * fts_sort_pll_degree);
@@ -1617,10 +1617,10 @@ row_fts_merge_insert(
num = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
- offsets[i] = static_cast<ulint*>(mem_heap_zalloc(
+ offsets[i] = static_cast<offset_t*>(mem_heap_zalloc(
heap, num * sizeof *offsets[i]));
- offsets[i][0] = num;
- offsets[i][1] = dict_index_get_n_fields(index);
+ rec_offs_set_n_alloc(offsets[i], num);
+ rec_offs_set_n_fields(offsets[i], dict_index_get_n_fields(index));
block[i] = psort_info[i].merge_block[id];
crypt_block[i] = psort_info[i].crypt_block[id];
b[i] = psort_info[i].merge_block[id];
@@ -1722,7 +1722,6 @@ row_fts_merge_insert(
corresponding FTS index auxiliary tables */
for (;;) {
dtuple_t* dtuple;
- ulint n_ext;
int min_rec = 0;
if (fts_sort_pll_degree <= 2) {
@@ -1765,7 +1764,7 @@ row_fts_merge_insert(
}
dtuple = row_rec_to_index_entry_low(
- mrec[min_rec], index, offsets[min_rec], &n_ext,
+ mrec[min_rec], index, offsets[min_rec],
tuple_heap);
row_fts_insert_tuple(
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 2fc28364b74..268d196036a 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+Copyright (c) 2015, 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
@@ -264,7 +264,7 @@ public:
bool remove(
const dict_index_t* index,
page_zip_des_t* page_zip,
- ulint* offsets) UNIV_NOTHROW
+ offset_t* offsets) UNIV_NOTHROW
{
/* We can't end up with an empty page unless it is root. */
if (page_get_n_recs(m_cur.block->frame) <= 1) {
@@ -846,7 +846,7 @@ private:
@return DB_SUCCESS or error code */
dberr_t adjust_cluster_index_blob_column(
rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint i) UNIV_NOTHROW;
/** Adjusts the BLOB reference in the clustered index row for all
@@ -856,7 +856,7 @@ private:
@return DB_SUCCESS or error code */
dberr_t adjust_cluster_index_blob_columns(
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW;
+ const offset_t* offsets) UNIV_NOTHROW;
/** In the clustered index, adjist the BLOB pointers as needed.
Also update the BLOB reference, write the new space id.
@@ -865,7 +865,7 @@ private:
@return DB_SUCCESS or error code */
dberr_t adjust_cluster_index_blob_ref(
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW;
+ const offset_t* offsets) UNIV_NOTHROW;
/** Purge delete-marked records, only if it is possible to do
so without re-organising the B+tree.
@@ -878,7 +878,7 @@ private:
@return DB_SUCCESS or error code. */
dberr_t adjust_cluster_record(
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW;
+ const offset_t* offsets) UNIV_NOTHROW;
/** Find an index with the matching id.
@return row_index_t* instance or 0 */
@@ -912,10 +912,10 @@ private:
RecIterator m_rec_iter;
/** Record offset */
- ulint m_offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t m_offsets_[REC_OFFS_NORMAL_SIZE];
/** Pointer to m_offsets_ */
- ulint* m_offsets;
+ offset_t* m_offsets;
/** Memory heap for the record offsets */
mem_heap_t* m_heap;
@@ -1152,60 +1152,82 @@ row_import::match_table_columns(
if (cfg_col->prtype != col->prtype) {
ib_errf(thd,
- IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Column %s precise type mismatch.",
- col_name);
+ IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Column %s precise type mismatch,"
+ " it's 0X%X in the table and 0X%X"
+ " in the tablespace meta file",
+ col_name, col->prtype, cfg_col->prtype);
err = DB_ERROR;
}
if (cfg_col->mtype != col->mtype) {
ib_errf(thd,
- IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Column %s main type mismatch.",
- col_name);
+ IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Column %s main type mismatch,"
+ " it's 0X%X in the table and 0X%X"
+ " in the tablespace meta file",
+ col_name, col->mtype, cfg_col->mtype);
err = DB_ERROR;
}
if (cfg_col->len != col->len) {
ib_errf(thd,
- IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Column %s length mismatch.",
- col_name);
+ IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Column %s length mismatch,"
+ " it's %u in the table and %u"
+ " in the tablespace meta file",
+ col_name, col->len, cfg_col->len);
err = DB_ERROR;
}
if (cfg_col->mbminlen != col->mbminlen
|| cfg_col->mbmaxlen != col->mbmaxlen) {
ib_errf(thd,
- IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Column %s multi-byte len mismatch.",
- col_name);
+ IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Column %s multi-byte len mismatch,"
+ " it's %u-%u in the table and %u-%u"
+ " in the tablespace meta file",
+ col_name, col->mbminlen, col->mbmaxlen,
+ cfg_col->mbminlen, cfg_col->mbmaxlen);
err = DB_ERROR;
}
if (cfg_col->ind != col->ind) {
+ ib_errf(thd,
+ IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Column %s position mismatch,"
+ " it's %u in the table and %u"
+ " in the tablespace meta file",
+ col_name, col->ind, cfg_col->ind);
err = DB_ERROR;
}
if (cfg_col->ord_part != col->ord_part) {
ib_errf(thd,
- IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Column %s ordering mismatch.",
- col_name);
+ IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Column %s ordering mismatch,"
+ " it's %u in the table and %u"
+ " in the tablespace meta file",
+ col_name, col->ord_part,
+ cfg_col->ord_part);
err = DB_ERROR;
}
if (cfg_col->max_prefix != col->max_prefix) {
ib_errf(thd,
- IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Column %s max prefix mismatch.",
- col_name);
+ IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Column %s max prefix mismatch"
+ " it's %u in the table and %u"
+ " in the tablespace meta file",
+ col_name, col->max_prefix,
+ cfg_col->max_prefix);
err = DB_ERROR;
}
}
@@ -1504,13 +1526,70 @@ IndexPurge::next() UNIV_NOTHROW
mtr_set_log_mode(&m_mtr, MTR_LOG_NO_REDO);
btr_pcur_restore_position(BTR_MODIFY_LEAF, &m_pcur, &m_mtr);
+ /* The following is based on btr_pcur_move_to_next_user_rec(). */
+ m_pcur.old_stored = false;
+ ut_ad(m_pcur.latch_mode == BTR_MODIFY_LEAF);
+ do {
+ if (btr_pcur_is_after_last_on_page(&m_pcur)) {
+ if (btr_pcur_is_after_last_in_tree(&m_pcur)) {
+ return DB_END_OF_INDEX;
+ }
- if (!btr_pcur_move_to_next_user_rec(&m_pcur, &m_mtr)) {
+ buf_block_t* block = btr_pcur_get_block(&m_pcur);
+ uint32_t next_page = btr_page_get_next(block->frame);
- return(DB_END_OF_INDEX);
- }
+ /* MDEV-13542 FIXME: Make these checks part of
+ btr_pcur_move_to_next_page(), and introduce a
+ return status that will be checked in all callers! */
+ switch (next_page) {
+ default:
+ if (next_page != block->page.id.page_no()) {
+ break;
+ }
+ /* MDEV-20931 FIXME: Check that
+ next_page is within the tablespace
+ bounds! Also check that it is not a
+ change buffer bitmap page. */
+ /* fall through */
+ case 0:
+ case 1:
+ case FIL_NULL:
+ return DB_CORRUPTION;
+ }
- return(DB_SUCCESS);
+ dict_index_t* index = m_pcur.btr_cur.index;
+ buf_block_t* next_block = btr_block_get(
+ page_id_t(block->page.id.space(), next_page),
+ block->page.size, BTR_MODIFY_LEAF, index,
+ &m_mtr);
+
+ if (UNIV_UNLIKELY(!next_block
+ || !fil_page_index_page_check(
+ next_block->frame)
+ || !!dict_index_is_spatial(index)
+ != (fil_page_get_type(
+ next_block->frame)
+ == FIL_PAGE_RTREE)
+ || page_is_comp(next_block->frame)
+ != page_is_comp(block->frame)
+ || btr_page_get_prev(
+ next_block->frame)
+ != block->page.id.page_no())) {
+ return DB_CORRUPTION;
+ }
+
+ btr_leaf_page_release(block, BTR_MODIFY_LEAF, &m_mtr);
+
+ page_cur_set_before_first(next_block,
+ &m_pcur.btr_cur.page_cur);
+
+ ut_d(page_check_dir(next_block->frame));
+ } else {
+ btr_pcur_move_to_next_on_page(&m_pcur);
+ }
+ } while (!btr_pcur_is_on_user_rec(&m_pcur));
+
+ return DB_SUCCESS;
}
/**
@@ -1563,7 +1642,7 @@ inline
dberr_t
PageConverter::adjust_cluster_index_blob_column(
rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint i) UNIV_NOTHROW
{
ulint len;
@@ -1607,7 +1686,7 @@ inline
dberr_t
PageConverter::adjust_cluster_index_blob_columns(
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW
+ const offset_t* offsets) UNIV_NOTHROW
{
ut_ad(rec_offs_any_extern(offsets));
@@ -1640,7 +1719,7 @@ inline
dberr_t
PageConverter::adjust_cluster_index_blob_ref(
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW
+ const offset_t* offsets) UNIV_NOTHROW
{
if (rec_offs_any_extern(offsets)) {
dberr_t err;
@@ -1683,7 +1762,7 @@ inline
dberr_t
PageConverter::adjust_cluster_record(
rec_t* rec,
- const ulint* offsets) UNIV_NOTHROW
+ const offset_t* offsets) UNIV_NOTHROW
{
dberr_t err;
@@ -2281,8 +2360,8 @@ row_import_set_sys_max_row_id(
ulint len;
const byte* field;
mem_heap_t* heap = NULL;
- ulint offsets_[1 + REC_OFFS_HEADER_SIZE];
- ulint* offsets;
+ offset_t offsets_[1 + REC_OFFS_HEADER_SIZE];
+ offset_t* offsets;
rec_offs_init(offsets_);
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 0fb994b547a..c494ae519ca 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -223,7 +223,7 @@ row_ins_sec_index_entry_by_modify(
depending on whether mtr holds just a leaf
latch or also a tree latch */
btr_cur_t* cursor, /*!< in: B-tree cursor */
- ulint** offsets,/*!< in/out: offsets on cursor->page_cur.rec */
+ offset_t** offsets,/*!< in/out: offsets on cursor->page_cur.rec */
mem_heap_t* offsets_heap,
/*!< in/out: memory heap that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */
@@ -318,7 +318,7 @@ row_ins_clust_index_entry_by_modify(
ulint mode, /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE,
depending on whether mtr holds just a leaf
latch or also a tree latch */
- ulint** offsets,/*!< out: offsets on cursor->page_cur.rec */
+ offset_t** offsets,/*!< out: offsets on cursor->page_cur.rec */
mem_heap_t** offsets_heap,
/*!< in/out: pointer to memory heap that can
be emptied, or NULL */
@@ -940,9 +940,9 @@ row_ins_foreign_fill_virtual(
{
THD* thd = current_thd;
row_ext_t* ext;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
- const ulint* offsets =
+ const offset_t* offsets =
rec_get_offsets(rec, index, offsets_, true,
ULINT_UNDEFINED, &cascade->heap);
mem_heap_t* v_heap = NULL;
@@ -1492,7 +1492,7 @@ row_ins_set_shared_rec_lock(
const buf_block_t* block, /*!< in: buffer block of rec */
const rec_t* rec, /*!< in: record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */
{
dberr_t err;
@@ -1523,7 +1523,7 @@ row_ins_set_exclusive_rec_lock(
const buf_block_t* block, /*!< in: buffer block of rec */
const rec_t* rec, /*!< in: record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */
{
dberr_t err;
@@ -1570,8 +1570,8 @@ row_ins_check_foreign_constraint(
mtr_t mtr;
trx_t* trx = thr_get_trx(thr);
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
bool skip_gap_lock;
@@ -2074,7 +2074,7 @@ row_ins_dupl_error_with_rec(
the record! */
const dtuple_t* entry, /*!< in: entry to insert */
dict_index_t* index, /*!< in: index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec, index) */
{
ulint matched_fields;
ulint n_unique;
@@ -2133,9 +2133,11 @@ row_ins_scan_sec_index_for_duplicate(
btr_pcur_t pcur;
dberr_t err = DB_SUCCESS;
ulint allow_duplicates;
- ulint* offsets = NULL;
+ offset_t offsets_[REC_OFFS_SEC_INDEX_SIZE];
+ offset_t* offsets = offsets_;
DBUG_ENTER("row_ins_scan_sec_index_for_duplicate");
+ rec_offs_init(offsets_);
ut_ad(s_latch == rw_lock_own_flagged(
&index->lock, RW_LOCK_FLAG_S | RW_LOCK_FLAG_SX));
@@ -2265,7 +2267,7 @@ row_ins_duplicate_online(
ulint n_uniq, /*!< in: offset of DB_TRX_ID */
const dtuple_t* entry, /*!< in: entry that is being inserted */
const rec_t* rec, /*!< in: clustered index record */
- ulint* offsets)/*!< in/out: rec_get_offsets(rec) */
+ offset_t* offsets)/*!< in/out: rec_get_offsets(rec) */
{
ulint fields = 0;
@@ -2304,7 +2306,7 @@ row_ins_duplicate_error_in_clust_online(
ulint n_uniq, /*!< in: offset of DB_TRX_ID */
const dtuple_t* entry, /*!< in: entry that is being inserted */
const btr_cur_t*cursor, /*!< in: cursor on insert position */
- ulint** offsets,/*!< in/out: rec_get_offsets(rec) */
+ offset_t** offsets,/*!< in/out: rec_get_offsets(rec) */
mem_heap_t** heap) /*!< in/out: heap for offsets */
{
dberr_t err = DB_SUCCESS;
@@ -2353,8 +2355,8 @@ row_ins_duplicate_error_in_clust(
ulint n_unique;
trx_t* trx = thr_get_trx(thr);
mem_heap_t*heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(dict_index_is_clust(cursor->index));
@@ -2527,7 +2529,7 @@ dberr_t
row_ins_index_entry_big_rec(
const dtuple_t* entry,
const big_rec_t* big_rec,
- ulint* offsets,
+ offset_t* offsets,
mem_heap_t** heap,
dict_index_t* index,
const void* thd __attribute__((unused)))
@@ -2602,8 +2604,8 @@ row_ins_clust_index_entry_low(
mtr_t mtr;
ib_uint64_t auto_inc = 0;
mem_heap_t* offsets_heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
DBUG_ENTER("row_ins_clust_index_entry_low");
@@ -2917,8 +2919,8 @@ row_ins_sec_index_entry_low(
dberr_t err = DB_SUCCESS;
ulint n_unique;
mtr_t mtr;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
rtr_info_t rtr_info;
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index e2f6450e38d..f6d0657ad5a 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2018, 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
@@ -643,7 +643,7 @@ row_log_table_delete(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
- const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should
be logged, or NULL to use those in rec */
{
@@ -934,7 +934,7 @@ row_log_table_low(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
- const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
bool insert, /*!< in: true if insert, false if update */
const dtuple_t* old_pk) /*!< in: old PRIMARY KEY value (if !insert
and a PRIMARY KEY is being created) */
@@ -1103,7 +1103,7 @@ row_log_table_update(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
- const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
const dtuple_t* old_pk) /*!< in: row_log_table_get_pk()
before the update */
{
@@ -1153,7 +1153,7 @@ row_log_table_get_pk_col(
dfield_t* dfield,
mem_heap_t* heap,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint i,
const page_size_t& page_size,
ulint max_len,
@@ -1223,7 +1223,7 @@ row_log_table_get_pk(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
- const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index) */
byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for
row_log_table_delete(), or NULL */
mem_heap_t** heap) /*!< in/out: memory heap where allocated */
@@ -1430,7 +1430,7 @@ row_log_table_insert(
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
- const ulint* offsets)/*!< in: rec_get_offsets(rec,index) */
+ const offset_t* offsets)/*!< in: rec_get_offsets(rec,index) */
{
row_log_table_low(rec, index, offsets, true, NULL);
}
@@ -1521,7 +1521,7 @@ row_log_table_apply_convert_mrec(
/*=============================*/
const mrec_t* mrec, /*!< in: merge record */
dict_index_t* index, /*!< in: index of mrec */
- const ulint* offsets, /*!< in: offsets of mrec */
+ const offset_t* offsets, /*!< in: offsets of mrec */
row_log_t* log, /*!< in: rebuild context */
mem_heap_t* heap, /*!< in/out: memory heap */
dberr_t* error) /*!< out: DB_SUCCESS or
@@ -1767,7 +1767,7 @@ row_log_table_apply_insert(
/*=======================*/
que_thr_t* thr, /*!< in: query graph */
const mrec_t* mrec, /*!< in: record to insert */
- const ulint* offsets, /*!< in: offsets of mrec */
+ const offset_t* offsets, /*!< in: offsets of mrec */
mem_heap_t* offsets_heap, /*!< in/out: memory heap
that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */
@@ -1819,7 +1819,7 @@ row_log_table_apply_delete_low(
/*===========================*/
btr_pcur_t* pcur, /*!< in/out: B-tree cursor,
will be trashed */
- const ulint* offsets, /*!< in: offsets on pcur */
+ const offset_t* offsets, /*!< in: offsets on pcur */
mem_heap_t* heap, /*!< in/out: memory heap */
mtr_t* mtr) /*!< in/out: mini-transaction,
will be committed */
@@ -1912,7 +1912,7 @@ row_log_table_apply_delete(
DB_TRX_ID in the new
clustered index */
const mrec_t* mrec, /*!< in: merge record */
- const ulint* moffsets, /*!< in: offsets of mrec */
+ const offset_t* moffsets, /*!< in: offsets of mrec */
mem_heap_t* offsets_heap, /*!< in/out: memory heap
that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */
@@ -1923,7 +1923,7 @@ row_log_table_apply_delete(
dtuple_t* old_pk;
mtr_t mtr;
btr_pcur_t pcur;
- ulint* offsets;
+ offset_t* offsets;
ut_ad(rec_offs_n_fields(moffsets)
== dict_index_get_n_unique(index) + 2);
@@ -2035,7 +2035,7 @@ row_log_table_apply_update(
DB_TRX_ID in the new
clustered index */
const mrec_t* mrec, /*!< in: new value */
- const ulint* offsets, /*!< in: offsets of mrec */
+ const offset_t* offsets, /*!< in: offsets of mrec */
mem_heap_t* offsets_heap, /*!< in/out: memory heap
that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */
@@ -2173,7 +2173,7 @@ func_exit_committed:
}
/* Prepare to update (or delete) the record. */
- ulint* cur_offsets = rec_get_offsets(
+ offset_t* cur_offsets = rec_get_offsets(
btr_pcur_get_rec(&pcur), index, NULL, true,
ULINT_UNDEFINED, &offsets_heap);
@@ -2411,7 +2411,7 @@ row_log_table_apply_op(
mem_heap_t* heap, /*!< in/out: memory heap */
const mrec_t* mrec, /*!< in: merge record */
const mrec_t* mrec_end, /*!< in: end of buffer */
- ulint* offsets) /*!< in/out: work area
+ offset_t* offsets) /*!< in/out: work area
for parsing mrec */
{
row_log_t* log = dup->index->online_log;
@@ -2745,7 +2745,7 @@ row_log_table_apply_ops(
const mrec_t* next_mrec_end;
mem_heap_t* heap;
mem_heap_t* offsets_heap;
- ulint* offsets;
+ offset_t* offsets;
bool has_index_lock;
dict_index_t* index = const_cast<dict_index_t*>(
dup->index);
@@ -2772,9 +2772,9 @@ row_log_table_apply_ops(
UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end);
- offsets = static_cast<ulint*>(ut_malloc_nokey(i * sizeof *offsets));
- offsets[0] = i;
- offsets[1] = dict_index_get_n_fields(index);
+ offsets = static_cast<offset_t*>(ut_malloc_nokey(i * sizeof *offsets));
+ rec_offs_set_n_alloc(offsets, i);
+ rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
heap = mem_heap_create(srv_page_size);
offsets_heap = mem_heap_create(srv_page_size);
@@ -3318,7 +3318,7 @@ row_log_apply_op_low(
{
mtr_t mtr;
btr_cur_t cursor;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
ut_ad(!dict_index_is_clust(index));
@@ -3552,14 +3552,13 @@ row_log_apply_op(
in exclusive mode */
const mrec_t* mrec, /*!< in: merge record */
const mrec_t* mrec_end, /*!< in: end of buffer */
- ulint* offsets) /*!< in/out: work area for
+ offset_t* offsets) /*!< in/out: work area for
rec_init_offsets_temp() */
{
enum row_op op;
ulint extra_size;
ulint data_size;
- ulint n_ext;
dtuple_t* entry;
trx_id_t trx_id;
@@ -3637,10 +3636,10 @@ corrupted:
}
entry = row_rec_to_index_entry_low(
- mrec - data_size, index, offsets, &n_ext, heap);
+ mrec - data_size, index, offsets, heap);
/* Online index creation is only implemented for secondary
indexes, which never contain off-page columns. */
- ut_ad(n_ext == 0);
+ ut_ad(dtuple_get_n_ext(entry) == 0);
row_log_apply_op_low(index, dup, error, offsets_heap,
has_index_lock, op, trx_id, entry);
@@ -3671,7 +3670,7 @@ row_log_apply_ops(
const mrec_t* next_mrec_end;
mem_heap_t* offsets_heap;
mem_heap_t* heap;
- ulint* offsets;
+ offset_t* offsets;
bool has_index_lock;
const ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
@@ -3682,9 +3681,9 @@ row_log_apply_ops(
ut_ad(index->online_log);
UNIV_MEM_INVALID(&mrec_end, sizeof mrec_end);
- offsets = static_cast<ulint*>(ut_malloc_nokey(i * sizeof *offsets));
- offsets[0] = i;
- offsets[1] = dict_index_get_n_fields(index);
+ offsets = static_cast<offset_t*>(ut_malloc_nokey(i * sizeof *offsets));
+ rec_offs_set_n_alloc(offsets, i);
+ rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
offsets_heap = mem_heap_create(srv_page_size);
heap = mem_heap_create(srv_page_size);
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index e488560b97f..68166705a3b 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2019, MariaDB Corporation.
+Copyright (c) 2014, 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
@@ -120,7 +120,7 @@ public:
btr_cur_t ins_cur;
mtr_t mtr;
rtr_info_t rtr_info;
- ulint* ins_offsets = NULL;
+ offset_t* ins_offsets = NULL;
dberr_t error = DB_SUCCESS;
dtuple_t* dtuple;
ulint count = 0;
@@ -1046,8 +1046,8 @@ row_merge_heap_create(
/*==================*/
const dict_index_t* index, /*!< in: record descriptor */
mrec_buf_t** buf, /*!< out: 3 buffers */
- ulint** offsets1, /*!< out: offsets */
- ulint** offsets2) /*!< out: offsets */
+ offset_t** offsets1, /*!< out: offsets */
+ offset_t** offsets2) /*!< out: offsets */
{
ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
@@ -1056,13 +1056,15 @@ row_merge_heap_create(
*buf = static_cast<mrec_buf_t*>(
mem_heap_alloc(heap, 3 * sizeof **buf));
- *offsets1 = static_cast<ulint*>(
+ *offsets1 = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof **offsets1));
- *offsets2 = static_cast<ulint*>(
+ *offsets2 = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof **offsets2));
- (*offsets1)[0] = (*offsets2)[0] = i;
- (*offsets1)[1] = (*offsets2)[1] = dict_index_get_n_fields(index);
+ rec_offs_set_n_alloc(*offsets1, i);
+ rec_offs_set_n_alloc(*offsets2, i);
+ rec_offs_set_n_fields(*offsets1, dict_index_get_n_fields(index));
+ rec_offs_set_n_fields(*offsets2, dict_index_get_n_fields(index));
return(heap);
}
@@ -1178,7 +1180,7 @@ row_merge_read_rec(
const mrec_t** mrec, /*!< out: pointer to merge record,
or NULL on end of list
(non-NULL on I/O error) */
- ulint* offsets,/*!< out: offsets of mrec */
+ offset_t* offsets,/*!< out: offsets of mrec */
row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
ulint space) /*!< in: space id */
{
@@ -1189,7 +1191,7 @@ row_merge_read_rec(
ut_ad(b >= &block[0]);
ut_ad(b < &block[srv_sort_buf_size]);
- ut_ad(*offsets == 1 + REC_OFFS_HEADER_SIZE
+ ut_ad(rec_offs_get_n_alloc(offsets) == 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index));
DBUG_ENTER("row_merge_read_rec");
@@ -1296,12 +1298,7 @@ err_exit:
memcpy(*buf, b, avail_size);
*mrec = *buf + extra_size;
- /* We cannot invoke rec_offs_make_valid() here, because there
- are no REC_N_NEW_EXTRA_BYTES between extra_size and data_size.
- Similarly, rec_offs_validate() would fail, because it invokes
- rec_get_status(). */
- ut_d(offsets[2] = (ulint) *mrec);
- ut_d(offsets[3] = (ulint) index);
+ rec_init_offsets_temp(*mrec, index, offsets);
if (!row_merge_read(fd, ++(*foffs), block,
crypt_block,
@@ -1340,7 +1337,7 @@ row_merge_write_rec_low(
ulint foffs, /*!< in: file offset */
#endif /* !DBUG_OFF */
const mrec_t* mrec, /*!< in: record to write */
- const ulint* offsets)/*!< in: offsets of mrec */
+ const offset_t* offsets)/*!< in: offsets of mrec */
#ifdef DBUG_OFF
# define row_merge_write_rec_low(b, e, size, fd, foffs, mrec, offsets) \
row_merge_write_rec_low(b, e, mrec, offsets)
@@ -1382,7 +1379,7 @@ row_merge_write_rec(
const pfs_os_file_t& fd, /*!< in: file descriptor */
ulint* foffs, /*!< in/out: file offset */
const mrec_t* mrec, /*!< in: record to write */
- const ulint* offsets,/*!< in: offsets of mrec */
+ const offset_t* offsets,/*!< in: offsets of mrec */
row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
ulint space) /*!< in: space id */
{
@@ -1929,7 +1926,7 @@ row_merge_read_clustered_index(
const rec_t* rec;
trx_id_t rec_trx_id;
- ulint* offsets;
+ offset_t* offsets;
dtuple_t* row;
row_ext_t* ext;
page_cur_t* cur = btr_pcur_get_page_cur(&pcur);
@@ -2963,8 +2960,8 @@ row_merge_blocks(
const mrec_t* mrec0; /*!< merge rec, points to block[0] or buf[0] */
const mrec_t* mrec1; /*!< merge rec, points to
block[srv_sort_buf_size] or buf[1] */
- ulint* offsets0;/* offsets of mrec0 */
- ulint* offsets1;/* offsets of mrec1 */
+ offset_t* offsets0;/* offsets of mrec0 */
+ offset_t* offsets1;/* offsets of mrec1 */
DBUG_ENTER("row_merge_blocks");
DBUG_LOG("ib_merge_sort",
@@ -3081,8 +3078,8 @@ row_merge_blocks_copy(
const byte* b0; /*!< pointer to block[0] */
byte* b2; /*!< pointer to block[2 * srv_sort_buf_size] */
const mrec_t* mrec0; /*!< merge rec, points to block[0] */
- ulint* offsets0;/* offsets of mrec0 */
- ulint* offsets1;/* dummy offsets */
+ offset_t* offsets0;/* offsets of mrec0 */
+ offset_t* offsets1;/* dummy offsets */
DBUG_ENTER("row_merge_blocks_copy");
DBUG_LOG("ib_merge_sort",
@@ -3421,7 +3418,7 @@ static
void
row_merge_copy_blobs(
const mrec_t* mrec,
- const ulint* offsets,
+ const offset_t* offsets,
const page_size_t& page_size,
dtuple_t* tuple,
mem_heap_t* heap)
@@ -3530,7 +3527,7 @@ row_merge_insert_index_tuples(
mem_heap_t* tuple_heap;
dberr_t error = DB_SUCCESS;
ulint foffs = 0;
- ulint* offsets;
+ offset_t* offsets;
mrec_buf_t* buf;
ulint n_rows = 0;
dtuple_t* dtuple;
@@ -3538,7 +3535,6 @@ row_merge_insert_index_tuples(
double curr_progress = 0;
dict_index_t* old_index = NULL;
const mrec_t* mrec = NULL;
- ulint n_ext = 0;
mtr_t mtr;
@@ -3558,10 +3554,10 @@ row_merge_insert_index_tuples(
ulint i = 1 + REC_OFFS_HEADER_SIZE
+ dict_index_get_n_fields(index);
heap = mem_heap_create(sizeof *buf + i * sizeof *offsets);
- offsets = static_cast<ulint*>(
+ offsets = static_cast<offset_t*>(
mem_heap_alloc(heap, i * sizeof *offsets));
- offsets[0] = i;
- offsets[1] = dict_index_get_n_fields(index);
+ rec_offs_set_n_alloc(offsets, i);
+ rec_offs_set_n_fields(offsets, dict_index_get_n_fields(index));
}
if (row_buf != NULL) {
@@ -3604,8 +3600,6 @@ row_merge_insert_index_tuples(
row buffer to data tuple record */
row_merge_mtuple_to_dtuple(
index, dtuple, &row_buf->tuples[n_rows]);
-
- n_ext = dtuple_get_n_ext(dtuple);
n_rows++;
/* BLOB pointers must be copied from dtuple */
mrec = NULL;
@@ -3624,7 +3618,7 @@ row_merge_insert_index_tuples(
}
dtuple = row_rec_to_index_entry_low(
- mrec, index, offsets, &n_ext, tuple_heap);
+ mrec, index, offsets, tuple_heap);
}
old_index = dict_table_get_first_index(old_table);
@@ -3637,10 +3631,7 @@ row_merge_insert_index_tuples(
}
}
- if (!n_ext) {
- /* There are no externally stored columns. */
- } else {
- ut_ad(dict_index_is_clust(index));
+ if (dict_index_is_clust(index) && dtuple_get_n_ext(dtuple)) {
/* Off-page columns can be fetched safely
when concurrent modifications to the table
are disabled. (Purge can process delete-marked
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index fbd37216ed4..6bdc8ce4904 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+Copyright (c) 2015, 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
@@ -2063,8 +2063,8 @@ row_unlock_for_mysql(
+ index->trx_id_offset);
} else {
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
offsets = rec_get_offsets(rec, index, offsets, true,
@@ -3142,6 +3142,16 @@ row_discard_tablespace_for_mysql(
} else {
ut_ad(!table->n_foreign_key_checks_running);
+ bool fts_exist = (dict_table_has_fts_index(table)
+ || DICT_TF2_FLAG_IS_SET(
+ table, DICT_TF2_FTS_HAS_DOC_ID));
+
+ if (fts_exist) {
+ row_mysql_unlock_data_dictionary(trx);
+ fts_optimize_remove_table(table);
+ row_mysql_lock_data_dictionary(trx);
+ }
+
/* Do foreign key constraint checks. */
err = row_discard_tablespace_foreign_key_checks(trx, table);
@@ -3149,6 +3159,10 @@ row_discard_tablespace_for_mysql(
if (err == DB_SUCCESS) {
err = row_discard_tablespace(trx, table);
}
+
+ if (fts_exist && err != DB_SUCCESS) {
+ fts_optimize_add_table(table);
+ }
}
return(row_discard_tablespace_end(trx, table, err));
@@ -3842,6 +3856,11 @@ funct_exit_all_freed:
trx_commit_for_mysql(trx);
}
+ /* Add the table to fts queue if drop table fails */
+ if (err != DB_SUCCESS && table->fts) {
+ fts_optimize_add_table(table);
+ }
+
row_mysql_unlock_data_dictionary(trx);
}
@@ -4681,9 +4700,8 @@ row_scan_index_for_mysql(
ulint i;
ulint cnt;
mem_heap_t* heap = NULL;
- ulint n_ext;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets;
rec_offs_init(offsets_);
*n_rows = 0;
@@ -4816,14 +4834,14 @@ not_ok:
tmp_heap = mem_heap_create(size);
- offsets = static_cast<ulint*>(
+ offsets = static_cast<offset_t*>(
mem_heap_dup(tmp_heap, offsets, size));
}
mem_heap_empty(heap);
prev_entry = row_rec_to_index_entry(
- rec, index, offsets, &n_ext, heap);
+ rec, index, offsets, heap);
if (UNIV_LIKELY_NULL(tmp_heap)) {
mem_heap_free(tmp_heap);
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index b71f8491787..bca6d802a53 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -108,8 +108,8 @@ row_purge_remove_clust_if_poss_low(
mtr_t mtr;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint* offsets;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_S)
@@ -801,9 +801,9 @@ static void row_purge_reset_trx_id(purge_node_t* node, mtr_t* mtr)
mem_heap_t* heap = NULL;
/* Reserve enough offsets for the PRIMARY KEY and 2 columns
so that we can access DB_TRX_ID, DB_ROLL_PTR. */
- ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
+ offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
rec_offs_init(offsets_);
- ulint* offsets = rec_get_offsets(
+ offset_t* offsets = rec_get_offsets(
rec, index, offsets_, true, trx_id_pos + 2, &heap);
ut_ad(heap == NULL);
@@ -1381,7 +1381,7 @@ purge_node_t::validate_pcur()
dict_index_t* clust_index = pcur.btr_cur.index;
- ulint* offsets = rec_get_offsets(
+ offset_t* offsets = rec_get_offsets(
pcur.old_rec, clust_index, NULL, true,
pcur.old_n_fields, &heap);
diff --git a/storage/innobase/row/row0row.cc b/storage/innobase/row/row0row.cc
index a2eb6ea6cf4..c19aa42b48e 100644
--- a/storage/innobase/row/row0row.cc
+++ b/storage/innobase/row/row0row.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, 2019, MariaDB Corporation.
+Copyright (c) 2018, 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
@@ -393,7 +393,7 @@ row_build_low(
ulint type,
const dict_index_t* index,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
const dict_table_t* col_table,
const dtuple_t* defaults,
const dict_add_v_col_t* add_v,
@@ -409,7 +409,7 @@ row_build_low(
byte* buf;
ulint j;
mem_heap_t* tmp_heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
ut_ad(index != NULL);
@@ -457,7 +457,7 @@ row_build_low(
}
/* Avoid a debug assertion in rec_offs_validate(). */
- rec_offs_make_valid(copy, index, true, const_cast<ulint*>(offsets));
+ rec_offs_make_valid(copy, index, true, const_cast<offset_t*>(offsets));
if (!col_table) {
ut_ad(!col_map);
@@ -551,7 +551,7 @@ row_build_low(
}
}
- rec_offs_make_valid(rec, index, true, const_cast<ulint*>(offsets));
+ rec_offs_make_valid(rec, index, true, const_cast<offset_t*>(offsets));
ut_ad(dtuple_check_typed(row));
@@ -604,7 +604,7 @@ row_build(
this record must be at least
s-latched and the latch held
as long as the row dtuple is used! */
- const ulint* offsets,/*!< in: rec_get_offsets(rec,index)
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec,index)
or NULL, in which case this function
will invoke rec_get_offsets() */
const dict_table_t* col_table,
@@ -657,7 +657,7 @@ row_build_w_add_vcol(
ulint type,
const dict_index_t* index,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
const dict_table_t* col_table,
const dtuple_t* defaults,
const dict_add_v_col_t* add_v,
@@ -684,8 +684,7 @@ dtuple_t*
row_rec_to_index_entry_impl(
const rec_t* rec,
const dict_index_t* index,
- const ulint* offsets,
- ulint* n_ext,
+ const offset_t* offsets,
mem_heap_t* heap)
{
dtuple_t* entry;
@@ -703,8 +702,6 @@ row_rec_to_index_entry_impl(
/* Because this function may be invoked by row0merge.cc
on a record whose header is in different format, the check
rec_offs_validate(rec, index, offsets) must be avoided here. */
- ut_ad(n_ext);
- *n_ext = 0;
rec_len = rec_offs_n_fields(offsets);
@@ -731,7 +728,6 @@ row_rec_to_index_entry_impl(
if (rec_offs_nth_extern(offsets, i)) {
dfield_set_ext(dfield);
- (*n_ext)++;
}
}
@@ -743,18 +739,15 @@ row_rec_to_index_entry_impl(
@param[in] rec index record
@param[in] index index
@param[in] offsets rec_get_offsets(rec, index)
-@param[out] n_ext number of externally stored columns
@param[in,out] heap memory heap for allocations */
dtuple_t*
row_rec_to_index_entry_low(
const rec_t* rec,
const dict_index_t* index,
- const ulint* offsets,
- ulint* n_ext,
+ const offset_t* offsets,
mem_heap_t* heap)
{
- return row_rec_to_index_entry_impl<false>(
- rec, index, offsets, n_ext, heap);
+ return row_rec_to_index_entry_impl<false>(rec, index, offsets, heap);
}
/*******************************************************************//**
@@ -766,9 +759,7 @@ row_rec_to_index_entry(
/*===================*/
const rec_t* rec, /*!< in: record in the index */
const dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec) */
- ulint* n_ext, /*!< out: number of externally
- stored columns */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec) */
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
{
@@ -788,11 +779,11 @@ row_rec_to_index_entry(
copy_rec = rec_copy(buf, rec, offsets);
rec_offs_make_valid(copy_rec, index, true,
- const_cast<ulint*>(offsets));
+ const_cast<offset_t*>(offsets));
entry = row_rec_to_index_entry_impl<true>(
- copy_rec, index, offsets, n_ext, heap);
+ copy_rec, index, offsets, heap);
rec_offs_make_valid(rec, index, true,
- const_cast<ulint*>(offsets));
+ const_cast<offset_t*>(offsets));
dtuple_set_info_bits(entry,
rec_get_info_bits(rec, rec_offs_comp(offsets)));
@@ -834,8 +825,8 @@ row_build_row_ref(
ulint clust_col_prefix_len;
ulint i;
mem_heap_t* tmp_heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(index != NULL);
@@ -930,7 +921,7 @@ row_build_row_ref_in_tuple(
held as long as the row
reference is used! */
const dict_index_t* index, /*!< in: secondary index */
- ulint* offsets)/*!< in: rec_get_offsets(rec, index)
+ offset_t* offsets)/*!< in: rec_get_offsets(rec, index)
or NULL */
{
const dict_index_t* clust_index;
@@ -942,7 +933,7 @@ row_build_row_ref_in_tuple(
ulint clust_col_prefix_len;
ulint i;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
ut_ad(!dict_index_is_clust(index));
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index f3a17302864..c2b23caa513 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -171,10 +171,10 @@ row_sel_sec_rec_is_for_clust_rec(
ulint n;
ulint i;
mem_heap_t* heap = NULL;
- ulint clust_offsets_[REC_OFFS_NORMAL_SIZE];
- ulint sec_offsets_[REC_OFFS_SMALL_SIZE];
- ulint* clust_offs = clust_offsets_;
- ulint* sec_offs = sec_offsets_;
+ offset_t clust_offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t sec_offsets_[REC_OFFS_SMALL_SIZE];
+ offset_t* clust_offs = clust_offsets_;
+ offset_t* sec_offs = sec_offsets_;
ibool is_equal = TRUE;
VCOL_STORAGE* vcol_storage= 0;
byte* record;
@@ -493,7 +493,7 @@ row_sel_fetch_columns(
dict_index_t* index, /*!< in: record index */
const rec_t* rec, /*!< in: record in a clustered or non-clustered
index; must be protected by a page latch */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
sym_node_t* column) /*!< in: first column in a column list, or
NULL */
{
@@ -759,7 +759,7 @@ row_sel_build_prev_vers(
ReadView* read_view, /*!< in: read view */
dict_index_t* index, /*!< in: plan node for table */
rec_t* rec, /*!< in: record in a clustered index */
- ulint** offsets, /*!< in/out: offsets returned by
+ offset_t** offsets, /*!< in/out: offsets returned by
rec_get_offsets(rec, plan->index) */
mem_heap_t** offset_heap, /*!< in/out: memory heap from which
the offsets are allocated */
@@ -794,7 +794,7 @@ row_sel_build_committed_vers_for_mysql(
dict_index_t* clust_index, /*!< in: clustered index */
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
const rec_t* rec, /*!< in: record in a clustered index */
- ulint** offsets, /*!< in/out: offsets returned by
+ offset_t** offsets, /*!< in/out: offsets returned by
rec_get_offsets(rec, clust_index) */
mem_heap_t** offset_heap, /*!< in/out: memory heap from which
the offsets are allocated */
@@ -908,8 +908,8 @@ row_sel_get_clust_rec(
rec_t* old_vers;
dberr_t err;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
*out_rec = NULL;
@@ -1068,7 +1068,7 @@ sel_set_rtr_rec_lock(
btr_pcur_t* pcur, /*!< in: cursor */
const rec_t* first_rec,/*!< in: record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint mode, /*!< in: lock mode */
ulint type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or
LOC_REC_NOT_GAP */
@@ -1080,8 +1080,8 @@ sel_set_rtr_rec_lock(
dberr_t err = DB_SUCCESS;
trx_t* trx = thr_get_trx(thr);
buf_block_t* cur_block = btr_pcur_get_block(pcur);
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* my_offsets = const_cast<ulint*>(offsets);
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* my_offsets = const_cast<offset_t*>(offsets);
rec_t* rec = const_cast<rec_t*>(first_rec);
rtr_rec_vector* match_rec;
rtr_rec_vector::iterator end;
@@ -1234,7 +1234,7 @@ sel_set_rec_lock(
btr_pcur_t* pcur, /*!< in: cursor */
const rec_t* rec, /*!< in: record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint mode, /*!< in: lock mode */
ulint type, /*!< in: LOCK_ORDINARY, LOCK_GAP, or
LOC_REC_NOT_GAP */
@@ -1509,8 +1509,8 @@ exhausted:
a previous version of the record */
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
offsets = rec_get_offsets(rec, index, offsets, true,
ULINT_UNDEFINED, &heap);
@@ -1593,8 +1593,8 @@ row_sel(
to the next non-clustered record */
dberr_t err;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(thr->run_node == node);
@@ -2701,7 +2701,7 @@ row_sel_store_row_id_to_prebuilt(
row_prebuilt_t* prebuilt, /*!< in/out: prebuilt */
const rec_t* index_rec, /*!< in: record */
const dict_index_t* index, /*!< in: index of the record */
- const ulint* offsets) /*!< in: rec_get_offsets
+ const offset_t* offsets) /*!< in: rec_get_offsets
(index_rec, index) */
{
const byte* data;
@@ -2927,7 +2927,7 @@ row_sel_store_mysql_field(
row_prebuilt_t* prebuilt,
const rec_t* rec,
const dict_index_t* index,
- const ulint* offsets,
+ const offset_t* offsets,
ulint field_no,
const mysql_row_templ_t*templ)
{
@@ -3083,7 +3083,7 @@ static bool row_sel_store_mysql_rec(
const dtuple_t* vrow,
bool rec_clust,
const dict_index_t* index,
- const ulint* offsets)
+ const offset_t* offsets)
{
DBUG_ENTER("row_sel_store_mysql_rec");
@@ -3214,7 +3214,7 @@ row_sel_build_prev_vers_for_mysql(
dict_index_t* clust_index, /*!< in: clustered index */
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
const rec_t* rec, /*!< in: record in a clustered index */
- ulint** offsets, /*!< in/out: offsets returned by
+ offset_t** offsets, /*!< in/out: offsets returned by
rec_get_offsets(rec, clust_index) */
mem_heap_t** offset_heap, /*!< in/out: memory heap from which
the offsets are allocated */
@@ -3252,7 +3252,7 @@ public:
dberr_t operator()(row_prebuilt_t *prebuilt, dict_index_t *sec_index,
const rec_t *rec, que_thr_t *thr, const rec_t **out_rec,
- ulint **offsets, mem_heap_t **offset_heap,
+ offset_t **offsets, mem_heap_t **offset_heap,
dtuple_t **vrow, mtr_t *mtr);
};
@@ -3275,7 +3275,7 @@ Row_sel_get_clust_rec_for_mysql::operator()(
it, NULL if the old version did not exist
in the read view, i.e., it was a fresh
inserted version */
- ulint** offsets,/*!< in: offsets returned by
+ offset_t** offsets,/*!< in: offsets returned by
rec_get_offsets(rec, sec_index);
out: offsets returned by
rec_get_offsets(out_rec, clust_index) */
@@ -3856,7 +3856,7 @@ row_sel_try_search_shortcut_for_mysql(
/*==================================*/
const rec_t** out_rec,/*!< out: record if found */
row_prebuilt_t* prebuilt,/*!< in: prebuilt struct */
- ulint** offsets,/*!< in/out: for rec_get_offsets(*out_rec) */
+ offset_t** offsets,/*!< in/out: for rec_get_offsets(*out_rec) */
mem_heap_t** heap, /*!< in/out: heap for rec_get_offsets() */
mtr_t* mtr) /*!< in: started mtr */
{
@@ -3930,7 +3930,7 @@ row_search_idx_cond_check(
row_prebuilt_t* prebuilt, /*!< in/out: prebuilt struct
for the table handle */
const rec_t* rec, /*!< in: InnoDB record */
- const ulint* offsets) /*!< in: rec_get_offsets() */
+ const offset_t* offsets) /*!< in: rec_get_offsets() */
{
ICP_RESULT result;
ulint i;
@@ -4018,8 +4018,8 @@ row_sel_fill_vrow(
dtuple_t** vrow,
mem_heap_t* heap)
{
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(!(*vrow));
@@ -4073,7 +4073,7 @@ rec_field_len_in_chars(
const dict_col_t* col,
const ulint field_no,
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
const ulint cset = dtype_get_charset_coll(col->prtype);
const CHARSET_INFO* cs = all_charsets[cset];
@@ -4100,7 +4100,7 @@ static
bool row_search_with_covering_prefix(
row_prebuilt_t* prebuilt,
const rec_t* rec,
- const ulint* offsets)
+ const offset_t* offsets)
{
const dict_index_t* index = prebuilt->index;
ut_ad(!dict_index_is_clust(index));
@@ -4230,8 +4230,8 @@ row_search_mvcc(
ibool same_user_rec;
mtr_t mtr;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
ibool table_lock_waited = FALSE;
byte* next_buf = 0;
bool spatial_search = false;
@@ -4272,7 +4272,7 @@ row_search_mvcc(
|| prebuilt->m_read_virtual_key);
/* Reset the new record lock info if srv_locks_unsafe_for_binlog
- is set or session is using a READ COMMITED isolation level. Then
+ is set or session is using a READ COMMITTED isolation level. Then
we are able to remove the record locks set here on an individual
row. */
prebuilt->new_rec_locks = 0;
@@ -4979,7 +4979,7 @@ wrong_offs:
existence with LOCK_REC_NOT_GAP. */
/* If innodb_locks_unsafe_for_binlog option is used
- or this session is using a READ COMMITED isolation
+ or this session is using a READ COMMITTED isolation
level we lock only the record, i.e., next-key locking is
not used. */
@@ -5931,8 +5931,8 @@ row_search_autoinc_read_column(
const byte* data;
ib_uint64_t value;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(page_rec_is_leaf(rec));
diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc
index 46b70b48f17..1c24e7bd177 100644
--- a/storage/innobase/row/row0uins.cc
+++ b/storage/innobase/row/row0uins.cc
@@ -115,7 +115,7 @@ row_undo_ins_remove_clust_rec(
if (online && dict_index_is_online_ddl(index)) {
const rec_t* rec = btr_cur_get_rec(btr_cur);
mem_heap_t* heap = NULL;
- const ulint* offsets = rec_get_offsets(
+ const offset_t* offsets = rec_get_offsets(
rec, index, NULL, true, ULINT_UNDEFINED, &heap);
row_log_table_delete(rec, index, offsets, NULL);
mem_heap_free(heap);
diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc
index 0172d47b8e2..11de19ba62c 100644
--- a/storage/innobase/row/row0umod.cc
+++ b/storage/innobase/row/row0umod.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 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
@@ -76,7 +76,7 @@ dberr_t
row_undo_mod_clust_low(
/*===================*/
undo_node_t* node, /*!< in: row undo node */
- ulint** offsets,/*!< out: rec_get_offsets() on the record */
+ offset_t** offsets,/*!< out: rec_get_offsets() on the record */
mem_heap_t** offsets_heap,
/*!< in/out: memory heap that can be emptied */
mem_heap_t* heap, /*!< in/out: memory heap */
@@ -159,11 +159,11 @@ static ulint row_trx_id_offset(const rec_t* rec, const dict_index_t* index)
if (!trx_id_offset) {
/* Reserve enough offsets for the PRIMARY KEY and 2 columns
so that we can access DB_TRX_ID, DB_ROLL_PTR. */
- ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
+ offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
rec_offs_init(offsets_);
mem_heap_t* heap = NULL;
const ulint trx_id_pos = index->n_uniq ? index->n_uniq : 1;
- ulint* offsets = rec_get_offsets(rec, index, offsets_, true,
+ offset_t* offsets = rec_get_offsets(rec, index, offsets_, true,
trx_id_pos + 1, &heap);
ut_ad(!heap);
ulint len;
@@ -186,6 +186,7 @@ static bool row_undo_mod_must_purge(undo_node_t* node, mtr_t* mtr)
btr_cur_t* btr_cur = btr_pcur_get_btr_cur(&node->pcur);
ut_ad(btr_cur->index->is_primary());
+ DEBUG_SYNC_C("rollback_purge_clust");
mtr->s_lock(&purge_sys.latch, __FILE__, __LINE__);
@@ -243,7 +244,7 @@ row_undo_mod_clust(
mem_heap_t* heap = mem_heap_create(1024);
mem_heap_t* offsets_heap = NULL;
- ulint* offsets = NULL;
+ offset_t* offsets = NULL;
const dtuple_t* rebuilt_old_pk;
byte sys[DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN];
@@ -319,6 +320,7 @@ row_undo_mod_clust(
== node->new_trx_id);
btr_pcur_commit_specify_mtr(pcur, &mtr);
+ DEBUG_SYNC_C("rollback_undo_pk");
if (err != DB_SUCCESS) {
goto func_exit;
@@ -403,7 +405,7 @@ row_undo_mod_clust(
ut_ad(index->n_uniq <= MAX_REF_PARTS);
/* Reserve enough offsets for the PRIMARY KEY and 2 columns
so that we can access DB_TRX_ID, DB_ROLL_PTR. */
- ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
+ offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
rec_offs_init(offsets_);
offsets = rec_get_offsets(
rec, index, offsets_, true, trx_id_pos + 2, &heap);
@@ -696,7 +698,7 @@ try_again:
switch (search_result) {
mem_heap_t* heap;
mem_heap_t* offsets_heap;
- ulint* offsets;
+ offset_t* offsets;
case ROW_BUFFERED:
case ROW_NOT_DELETED_REF:
/* These are invalid outcomes, because the mode passed
diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc
index 2c67c2c3442..a8d09b71dc2 100644
--- a/storage/innobase/row/row0undo.cc
+++ b/storage/innobase/row/row0undo.cc
@@ -168,8 +168,8 @@ row_undo_search_clust_to_pcur(
row_ext_t** ext;
const rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(!node->table->skip_alter_undo);
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 06cd1e93166..aff8ae125b5 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+Copyright (c) 2015, 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
@@ -214,7 +214,7 @@ row_upd_check_references_constraints(
cursor position is lost in this function! */
dict_table_t* table, /*!< in: table in question */
dict_index_t* index, /*!< in: index of the cursor */
- ulint* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in: mtr */
{
@@ -223,7 +223,6 @@ row_upd_check_references_constraints(
dtuple_t* entry;
trx_t* trx;
const rec_t* rec;
- ulint n_ext;
dberr_t err;
ibool got_s_lock = FALSE;
@@ -240,7 +239,7 @@ row_upd_check_references_constraints(
heap = mem_heap_create(500);
- entry = row_rec_to_index_entry(rec, index, offsets, &n_ext, heap);
+ entry = row_rec_to_index_entry(rec, index, offsets, heap);
mtr_commit(mtr);
@@ -332,7 +331,7 @@ wsrep_row_upd_check_foreign_constraints(
cursor position is lost in this function! */
dict_table_t* table, /*!< in: table in question */
dict_index_t* index, /*!< in: index of the cursor */
- ulint* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in: mtr */
{
@@ -341,7 +340,6 @@ wsrep_row_upd_check_foreign_constraints(
dtuple_t* entry;
trx_t* trx;
const rec_t* rec;
- ulint n_ext;
dberr_t err;
ibool got_s_lock = FALSE;
ibool opened = FALSE;
@@ -359,8 +357,7 @@ wsrep_row_upd_check_foreign_constraints(
heap = mem_heap_create(500);
- entry = row_rec_to_index_entry(rec, index, offsets,
- &n_ext, heap);
+ entry = row_rec_to_index_entry(rec, index, offsets, heap);
mtr_commit(mtr);
@@ -473,7 +470,7 @@ row_upd_rec_sys_fields_in_recovery(
/*===============================*/
rec_t* rec, /*!< in/out: record */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
ulint pos, /*!< in: TRX_ID position in rec */
trx_id_t trx_id, /*!< in: transaction id */
roll_ptr_t roll_ptr)/*!< in: roll ptr of the undo log record */
@@ -537,7 +534,7 @@ ibool
row_upd_changes_field_size_or_external(
/*===================================*/
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const upd_t* update) /*!< in: update vector */
{
const upd_field_t* upd_field;
@@ -662,7 +659,7 @@ row_upd_rec_in_place(
/*=================*/
rec_t* rec, /*!< in/out: record where replaced */
dict_index_t* index, /*!< in: the index the record belongs to */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
page_zip_des_t* page_zip)/*!< in: compressed page with enough space
available, or NULL */
@@ -961,7 +958,7 @@ row_upd_build_sec_rec_difference_binary(
/*====================================*/
const rec_t* rec, /*!< in: secondary index record */
dict_index_t* index, /*!< in: index */
- const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec, index) */
const dtuple_t* entry, /*!< in: entry to insert */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
{
@@ -1042,7 +1039,7 @@ row_upd_build_difference_binary(
dict_index_t* index,
const dtuple_t* entry,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
bool no_sys,
trx_t* trx,
mem_heap_t* heap,
@@ -1053,7 +1050,7 @@ row_upd_build_difference_binary(
upd_t* update;
ulint n_diff;
ulint trx_id_pos;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
const ulint n_v_fld = dtuple_get_n_v_fields(entry);
rec_offs_init(offsets_);
@@ -2072,7 +2069,7 @@ void
row_upd_copy_columns(
/*=================*/
rec_t* rec, /*!< in: record in a clustered index */
- const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets,/*!< in: array returned by rec_get_offsets() */
const dict_index_t* index, /*!< in: index of rec */
sym_node_t* column) /*!< in: first column in a column list, or
NULL */
@@ -2224,8 +2221,8 @@ row_upd_store_row(
rec_t* rec;
mem_heap_t* heap = NULL;
row_ext_t** ext;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- const ulint* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ const offset_t* offsets;
rec_offs_init(offsets_);
ut_ad(node->pcur->latch_mode != BTR_NO_LATCHES);
@@ -2464,7 +2461,7 @@ row_upd_sec_index_entry(
&& wsrep_must_process_fk(node, trx)
&& !wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
- ulint* offsets = rec_get_offsets(
+ offset_t* offsets = rec_get_offsets(
rec, index, NULL, true,
ULINT_UNDEFINED, &heap);
@@ -2509,7 +2506,7 @@ row_upd_sec_index_entry(
if (referenced) {
- ulint* offsets;
+ offset_t* offsets;
offsets = rec_get_offsets(
rec, index, NULL, true, ULINT_UNDEFINED,
@@ -2591,7 +2588,7 @@ row_upd_clust_rec_by_insert_inherit_func(
/*=====================================*/
const rec_t* rec, /*!< in: old record, or NULL */
#ifdef UNIV_DEBUG
- const ulint* offsets,/*!< in: rec_get_offsets(rec), or NULL */
+ const offset_t* offsets,/*!< in: rec_get_offsets(rec), or NULL */
#endif /* UNIV_DEBUG */
dtuple_t* entry, /*!< in/out: updated entry to be
inserted into the clustered index */
@@ -2692,10 +2689,13 @@ row_upd_clust_rec_by_insert(
dtuple_t* entry;
dberr_t err;
rec_t* rec;
- ulint* offsets = NULL;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets = offsets_;
ut_ad(dict_index_is_clust(index));
+ rec_offs_init(offsets_);
+
trx = thr_get_trx(thr);
table = node->table;
pcur = node->pcur;
@@ -2724,7 +2724,7 @@ row_upd_clust_rec_by_insert(
we update the primary key. Delete-mark the old record
in the clustered index and prepare to insert a new entry. */
rec = btr_cur_get_rec(btr_cur);
- offsets = rec_get_offsets(rec, index, NULL, true,
+ offsets = rec_get_offsets(rec, index, offsets, true,
ULINT_UNDEFINED, &heap);
ut_ad(page_rec_is_user_rec(rec));
@@ -2809,9 +2809,9 @@ check_fk:
mtr_commit(mtr);
- err = row_ins_clust_index_entry(
- index, entry, thr,
- node->upd_ext ? node->upd_ext->n_ext : 0);
+ err = row_ins_clust_index_entry(index, entry, thr, node->upd_ext
+ ? node->upd_ext->n_ext
+ : dtuple_get_n_ext(entry));
node->state = UPD_NODE_INSERT_CLUSTERED;
mem_heap_free(heap);
@@ -2831,7 +2831,7 @@ row_upd_clust_rec(
ulint flags, /*!< in: undo logging and locking flags */
upd_node_t* node, /*!< in: row update node */
dict_index_t* index, /*!< in: clustered index */
- ulint* offsets,/*!< in: rec_get_offsets() on node->pcur */
+ offset_t* offsets,/*!< in: rec_get_offsets() on node->pcur */
mem_heap_t** offsets_heap,
/*!< in/out: memory heap, can be emptied */
que_thr_t* thr, /*!< in: query thread */
@@ -2962,7 +2962,7 @@ row_upd_del_mark_clust_rec(
/*=======================*/
upd_node_t* node, /*!< in: row update node */
dict_index_t* index, /*!< in: clustered index */
- ulint* offsets,/*!< in/out: rec_get_offsets() for the
+ offset_t* offsets,/*!< in/out: rec_get_offsets() for the
record under the cursor */
que_thr_t* thr, /*!< in: query thread */
ibool referenced,
@@ -3057,8 +3057,8 @@ row_upd_clust_step(
mtr_t mtr;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets;
+ offset_t offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets;
ibool referenced;
ulint flags;
trx_t* trx = thr_get_trx(thr);
diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index b662ce92f28..5935b0a11ca 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 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
@@ -87,17 +87,20 @@ row_vers_impl_x_locked_low(
dict_index_t* clust_index,
const rec_t* rec,
dict_index_t* index,
- const ulint* offsets,
+ const offset_t* offsets,
mtr_t* mtr)
{
trx_id_t trx_id;
rec_t* prev_version = NULL;
- ulint* clust_offsets;
+ offset_t clust_offsets_[REC_OFFS_NORMAL_SIZE];
+ offset_t* clust_offsets = clust_offsets_;
mem_heap_t* heap;
dtuple_t* ientry = NULL;
mem_heap_t* v_heap = NULL;
dtuple_t* cur_vrow = NULL;
+ rec_offs_init(clust_offsets_);
+
DBUG_ENTER("row_vers_impl_x_locked_low");
ut_ad(rec_offs_validate(rec, index, offsets));
@@ -112,8 +115,8 @@ row_vers_impl_x_locked_low(
heap = mem_heap_create(1024);
- clust_offsets = rec_get_offsets(
- clust_rec, clust_index, NULL, true, ULINT_UNDEFINED, &heap);
+ 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);
if (trx_id == 0) {
@@ -150,15 +153,13 @@ row_vers_impl_x_locked_low(
const ulint rec_del = rec_get_deleted_flag(rec, comp);
if (dict_index_has_virtual(index)) {
- ulint n_ext;
ulint est_size = DTUPLE_EST_ALLOC(index->n_fields);
/* Allocate the dtuple for virtual columns extracted from undo
log with its own heap, so to avoid it being freed as we
iterating in the version loop below. */
v_heap = mem_heap_create(est_size);
- ientry = row_rec_to_index_entry(
- rec, index, offsets, &n_ext, v_heap);
+ ientry = row_rec_to_index_entry(rec, index, offsets, v_heap);
}
/* We look up if some earlier version, which was modified by
@@ -203,7 +204,7 @@ row_vers_impl_x_locked_low(
ut_ad(committed || prev_version
|| !rec_get_deleted_flag(version, comp));
- /* Free version and clust_offsets. */
+ /* Free version. */
mem_heap_free(old_heap);
if (committed) {
@@ -238,7 +239,7 @@ not_locked:
}
clust_offsets = rec_get_offsets(
- prev_version, clust_index, NULL, true,
+ prev_version, clust_index, clust_offsets, true,
ULINT_UNDEFINED, &heap);
vers_del = rec_get_deleted_flag(prev_version, comp);
@@ -387,7 +388,7 @@ row_vers_impl_x_locked(
trx_t* caller_trx,
const rec_t* rec,
dict_index_t* index,
- const ulint* offsets)
+ const offset_t* offsets)
{
mtr_t mtr;
trx_t* trx;
@@ -519,7 +520,7 @@ row_vers_build_cur_vrow_low(
bool in_purge,
const rec_t* rec,
dict_index_t* clust_index,
- ulint* clust_offsets,
+ offset_t* clust_offsets,
dict_index_t* index,
roll_ptr_t roll_ptr,
trx_id_t trx_id,
@@ -635,7 +636,7 @@ row_vers_vc_matches_cluster(
const rec_t* rec,
const dtuple_t* icentry,
dict_index_t* clust_index,
- ulint* clust_offsets,
+ offset_t* clust_offsets,
dict_index_t* index,
const dtuple_t* ientry,
roll_ptr_t roll_ptr,
@@ -810,7 +811,7 @@ row_vers_build_cur_vrow(
bool in_purge,
const rec_t* rec,
dict_index_t* clust_index,
- ulint** clust_offsets,
+ offset_t** clust_offsets,
dict_index_t* index,
roll_ptr_t roll_ptr,
trx_id_t trx_id,
@@ -894,7 +895,7 @@ row_vers_old_has_index_entry(
const rec_t* version;
rec_t* prev_version;
dict_index_t* clust_index;
- ulint* clust_offsets;
+ offset_t* clust_offsets;
mem_heap_t* heap;
mem_heap_t* heap2;
dtuple_t* row;
@@ -1151,7 +1152,7 @@ row_vers_build_for_consistent_read(
of this records */
mtr_t* mtr, /*!< in: mtr holding the latch on rec */
dict_index_t* index, /*!< in: the clustered index */
- ulint** offsets,/*!< in/out: offsets returned by
+ offset_t** offsets,/*!< in/out: offsets returned by
rec_get_offsets(rec, index) */
ReadView* view, /*!< in: the consistent read view */
mem_heap_t** offset_heap,/*!< in/out: memory heap from which
@@ -1267,7 +1268,7 @@ row_vers_build_for_semi_consistent_read(
of this records */
mtr_t* mtr, /*!< in: mtr holding the latch on rec */
dict_index_t* index, /*!< in: the clustered index */
- ulint** offsets,/*!< in/out: offsets returned by
+ offset_t** offsets,/*!< in/out: offsets returned by
rec_get_offsets(rec, index) */
mem_heap_t** offset_heap,/*!< in/out: memory heap from which
the offsets are allocated */
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index b56ffe99624..0404335574a 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -423,7 +423,7 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_DEFAULT_START, MONITOR_FLUSH_AVG_TIME},
{"buffer_flush_adaptive_avg_pass", "buffer",
- "Numner of adaptive flushes passed during the recent Avg period.",
+ "Number of adaptive flushes passed during the recent Avg period.",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_FLUSH_ADAPTIVE_AVG_PASS},
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 556329e138e..6e7b3e5939f 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -3,7 +3,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2019, MariaDB Corporation.
+Copyright (c) 2013, 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -487,7 +487,9 @@ current_time % 60 == 0 and no tasks will be performed when
current_time % 5 != 0. */
# define SRV_MASTER_CHECKPOINT_INTERVAL (7)
-# define SRV_MASTER_PURGE_INTERVAL (10)
+#ifdef MEM_PERIODIC_CHECK
+# define SRV_MASTER_MEM_VALIDATE_INTERVAL (13)
+#endif /* MEM_PERIODIC_CHECK */
# define SRV_MASTER_DICT_LRU_INTERVAL (47)
/** Simulate compression failures. */
diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc
index 15c0a952cb0..b4bfde46b8f 100644
--- a/storage/innobase/sync/sync0debug.cc
+++ b/storage/innobase/sync/sync0debug.cc
@@ -1562,7 +1562,7 @@ struct CreateTracker {
~CreateTracker()
UNIV_NOTHROW
{
- ut_d(m_files.empty());
+ ut_ad(m_files.empty());
m_mutex.destroy();
}
diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc
index a39fb5d2e95..c45c4f6a182 100644
--- a/storage/innobase/trx/trx0i_s.cc
+++ b/storage/innobase/trx/trx0i_s.cc
@@ -599,7 +599,7 @@ put_nth_field(
ulint n, /*!< in: number of field */
const dict_index_t* index, /*!< in: index */
const rec_t* rec, /*!< in: record */
- const ulint* offsets)/*!< in: record offsets, returned
+ const offset_t* offsets)/*!< in: record offsets, returned
by rec_get_offsets() */
{
const byte* data;
@@ -680,8 +680,8 @@ fill_lock_data(
const dict_index_t* index;
ulint n_fields;
mem_heap_t* heap;
- ulint offsets_onstack[REC_OFFS_NORMAL_SIZE];
- ulint* offsets;
+ offset_t offsets_onstack[REC_OFFS_NORMAL_SIZE];
+ offset_t* offsets;
char buf[TRX_I_S_LOCK_DATA_MAX_LEN];
ulint buf_used;
ulint i;
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index 901dd90c005..ab17dd03a43 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 1996, 2019, Oracle and/or its affiliates. All Rights Reserved.
+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
@@ -868,7 +868,7 @@ trx_undo_page_report_modify(
delete marking is done */
const rec_t* rec, /*!< in: clustered index record which
has NOT yet been modified */
- const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec, index) */
const upd_t* update, /*!< in: update vector which tells the
columns to be updated; in the case of
a delete, this should be set to NULL */
@@ -1967,7 +1967,7 @@ trx_undo_report_row_operation(
const rec_t* rec, /*!< in: case of an update or delete
marking, the record in the clustered
index; NULL if insert */
- const ulint* offsets, /*!< in: rec_get_offsets(rec) */
+ const offset_t* offsets, /*!< in: rec_get_offsets(rec) */
roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the
undo log record */
{
@@ -2225,7 +2225,7 @@ trx_undo_prev_version_build(
index_rec page and purge_view */
const rec_t* rec, /*!< in: version of a clustered index record */
dict_index_t* index, /*!< in: clustered index */
- ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
+ offset_t* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mem_heap_t* heap, /*!< in: memory heap from which the memory
needed is allocated */
rec_t** old_vers,/*!< out, own: previous version, or NULL if
@@ -2335,8 +2335,6 @@ trx_undo_prev_version_build(
ut_a(ptr);
if (row_upd_changes_field_size_or_external(index, offsets, update)) {
- ulint n_ext;
-
/* We should confirm the existence of disowned external data,
if the previous version record is delete marked. If the trx_id
of the previous record is seen by purge view, we should treat
@@ -2377,14 +2375,15 @@ trx_undo_prev_version_build(
those fields that update updates to become externally stored
fields. Store the info: */
- entry = row_rec_to_index_entry(
- rec, index, offsets, &n_ext, heap);
- n_ext += btr_push_update_extern_fields(entry, update, heap);
+ entry = row_rec_to_index_entry(rec, index, offsets, heap);
/* The page containing the clustered index record
corresponding to entry is latched in mtr. Thus the
following call is safe. */
row_upd_index_replace_new_col_vals(entry, index, update, heap);
+ /* Get number of externally stored columns in updated record */
+ const ulint n_ext = dtuple_get_n_ext(entry);
+
buf = static_cast<byte*>(mem_heap_alloc(
heap, rec_get_converted_size(index, entry, n_ext)));
@@ -2407,8 +2406,10 @@ trx_undo_prev_version_build(
}
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+ offset_t offsets_dbg[REC_OFFS_NORMAL_SIZE];
+ rec_offs_init(offsets_dbg);
ut_a(!rec_offs_any_null_extern(
- *old_vers, rec_get_offsets(*old_vers, index, NULL, true,
+ *old_vers, rec_get_offsets(*old_vers, index, offsets_dbg, true,
ULINT_UNDEFINED, &heap)));
#endif // defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc
index 7a0accf889f..2c061965e34 100644
--- a/storage/innobase/trx/trx0undo.cc
+++ b/storage/innobase/trx/trx0undo.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2018, MariaDB Corporation.
+Copyright (c) 2014, 2019, 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
@@ -1607,7 +1607,7 @@ trx_undo_commit_cleanup(trx_undo_t* undo, bool is_temp)
/* Delete first the undo log segment in the file */
mutex_exit(&rseg->mutex);
- trx_undo_seg_free(undo, true);
+ trx_undo_seg_free(undo, is_temp);
mutex_enter(&rseg->mutex);
ut_ad(rseg->curr_size > undo->size);
diff --git a/storage/innobase/ut/ut0rnd.cc b/storage/innobase/ut/ut0rnd.cc
index 3c1e51536a1..8265121ef2e 100644
--- a/storage/innobase/ut/ut0rnd.cc
+++ b/storage/innobase/ut/ut0rnd.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2019, 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
@@ -25,6 +26,9 @@ Created 5/11/1994 Heikki Tuuri
#include "ut0rnd.h"
+/** Seed value of ut_rnd_gen() */
+int32 ut_rnd_current;
+
/** These random numbers are used in ut_find_prime */
/*@{*/
#define UT_RANDOM_1 1.0412321
@@ -32,9 +36,6 @@ Created 5/11/1994 Heikki Tuuri
#define UT_RANDOM_3 1.0132677
/*@}*/
-/** Seed value of ut_rnd_gen_ulint(). */
-ulint ut_rnd_ulint_counter = 65654363;
-
/***********************************************************//**
Looks for a prime number slightly greater than the given argument.
The prime is chosen so that it is not near any power of 2.
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 71456666fbe..1745e1fa653 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -1157,7 +1157,7 @@ int ha_maria::open(const char *name, int mode, uint test_if_locked)
/*
For static size rows, tell MariaDB that we will access all bytes
- in the record when writing it. This signals MariaDB to initalize
+ in the record when writing it. This signals MariaDB to initialize
the full row to ensure we don't get any errors from valgrind and
that all bytes in the row is properly reset.
*/
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index eadac5b04eb..101c33b7802 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -6183,7 +6183,7 @@ end:
}
- /* write suffix to data file if neaded */
+/* Write suffix to data file if needed */
int maria_write_data_suffix(MARIA_SORT_INFO *sort_info, my_bool fix_datafile)
{
diff --git a/storage/maria/ma_close.c b/storage/maria/ma_close.c
index 44f65230c5d..2716f3b5c42 100644
--- a/storage/maria/ma_close.c
+++ b/storage/maria/ma_close.c
@@ -37,7 +37,7 @@ int maria_close(register MARIA_HA *info)
/* Check that we have unlocked key delete-links properly */
DBUG_ASSERT(info->key_del_used == 0);
- /* Check that file is not part of any uncommited transactions */
+ /* Check that file is not part of any uncommitted transactions */
DBUG_ASSERT(info->trn == 0 || info->trn == &dummy_transaction_object);
if (share->reopen == 1)
diff --git a/storage/maria/ma_page.c b/storage/maria/ma_page.c
index 41278597b0c..2c628184b28 100644
--- a/storage/maria/ma_page.c
+++ b/storage/maria/ma_page.c
@@ -112,7 +112,7 @@ my_bool _ma_fetch_keypage(MARIA_PAGE *page, MARIA_HA *info,
if (lock != PAGECACHE_LOCK_LEFT_UNLOCKED)
{
- DBUG_ASSERT(lock == PAGECACHE_LOCK_WRITE || PAGECACHE_LOCK_READ);
+ DBUG_ASSERT(lock == PAGECACHE_LOCK_WRITE || lock == PAGECACHE_LOCK_READ);
page_link.unlock= (lock == PAGECACHE_LOCK_WRITE ?
PAGECACHE_LOCK_WRITE_UNLOCK :
PAGECACHE_LOCK_READ_UNLOCK);
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c
index 9ae982a6bd7..3e9d002ea43 100644
--- a/storage/maria/maria_pack.c
+++ b/storage/maria/maria_pack.c
@@ -782,27 +782,29 @@ static HUFF_COUNTS *init_huff_count(MARIA_HA *info,my_off_t records)
for (i=0 ; i < info->s->base.fields ; i++)
{
enum en_fieldtype type;
- count[i].field_length=info->s->columndef[i].length;
- type= count[i].field_type= (enum en_fieldtype) info->s->columndef[i].type;
+ uint col_nr = info->s->columndef[i].column_nr;
+ count[col_nr].field_length=info->s->columndef[i].length;
+ type= count[col_nr].field_type=
+ (enum en_fieldtype) info->s->columndef[i].type;
if (type == FIELD_INTERVALL ||
type == FIELD_CONSTANT ||
type == FIELD_ZERO)
type = FIELD_NORMAL;
- if (count[i].field_length <= 8 &&
+ if (count[col_nr].field_length <= 8 &&
(type == FIELD_NORMAL ||
type == FIELD_SKIP_ZERO))
- count[i].max_zero_fill= count[i].field_length;
+ count[col_nr].max_zero_fill= count[col_nr].field_length;
/*
For every column initialize a tree, which is used to detect distinct
column values. 'int_tree' works together with 'tree_buff' and
'tree_pos'. It's keys are implemented by pointers into 'tree_buff'.
This is accomplished by '-1' as the element size.
*/
- init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL,
+ init_tree(&count[col_nr].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL,
NULL, MYF(0));
if (records && type != FIELD_BLOB && type != FIELD_VARCHAR)
- count[i].tree_pos=count[i].tree_buff =
- my_malloc(count[i].field_length > 1 ? tree_buff_length : 2,
+ count[col_nr].tree_pos=count[col_nr].tree_buff =
+ my_malloc(count[col_nr].field_length > 1 ? tree_buff_length : 2,
MYF(MY_WME));
}
}
diff --git a/storage/maria/trnman.c b/storage/maria/trnman.c
index 744ca86412e..85a87e928b9 100644
--- a/storage/maria/trnman.c
+++ b/storage/maria/trnman.c
@@ -307,7 +307,7 @@ TRN *trnman_new_trn(WT_THD *wt)
if (!(trn= tmp.trn))
{
/*
- trn should be completely initalized at create time to allow
+ trn should be completely initialized at create time to allow
one to keep a known state on it.
(Like redo_lns, which is assumed to be 0 at start of row handling
and reset to zero before end of row handling)
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 9b4dff68683..fd2e8fd9425 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -859,7 +859,7 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
/*
For static size rows, tell MariaDB that we will access all bytes
- in the record when writing it. This signals MariaDB to initalize
+ in the record when writing it. This signals MariaDB to initialize
the full row to ensure we don't get any errors from valgrind and
that all bytes in the row is properly reset.
*/
diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt
index 7db67700fac..e1839bc5b00 100644
--- a/storage/perfschema/CMakeLists.txt
+++ b/storage/perfschema/CMakeLists.txt
@@ -1,13 +1,20 @@
-# Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
#
# 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.
+# it under the terms of the GNU General Public License, version 2.0,
+# as published by the Free Software Foundation.
+#
+# This program is also distributed with certain software (including
+# but not limited to OpenSSL) that is licensed under separate terms,
+# as designated in a particular file or component or in included license
+# documentation. The authors of MySQL hereby grant you an additional
+# permission to link the program and your derivative works with the
+# separately licensed software that they have included with MySQL.
#
# 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.
+# GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/cursor_by_account.cc b/storage/perfschema/cursor_by_account.cc
index 2e75b8d51bd..f26318c42fc 100644
--- a/storage/perfschema/cursor_by_account.cc
+++ b/storage/perfschema/cursor_by_account.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/cursor_by_account.h b/storage/perfschema/cursor_by_account.h
index 150615b9c54..c14a563b712 100644
--- a/storage/perfschema/cursor_by_account.h
+++ b/storage/perfschema/cursor_by_account.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/cursor_by_host.cc b/storage/perfschema/cursor_by_host.cc
index d16f8b24b8e..c3397234e2e 100644
--- a/storage/perfschema/cursor_by_host.cc
+++ b/storage/perfschema/cursor_by_host.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/cursor_by_host.h b/storage/perfschema/cursor_by_host.h
index db33bbad808..ac68acf3945 100644
--- a/storage/perfschema/cursor_by_host.h
+++ b/storage/perfschema/cursor_by_host.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/cursor_by_thread.cc b/storage/perfschema/cursor_by_thread.cc
index 2fa9202fcf0..afdc9010b1f 100644
--- a/storage/perfschema/cursor_by_thread.cc
+++ b/storage/perfschema/cursor_by_thread.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/cursor_by_thread.h b/storage/perfschema/cursor_by_thread.h
index 5a77edf325f..db130088920 100644
--- a/storage/perfschema/cursor_by_thread.h
+++ b/storage/perfschema/cursor_by_thread.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/cursor_by_thread_connect_attr.cc b/storage/perfschema/cursor_by_thread_connect_attr.cc
index 2d5399cdac1..90a200b809a 100644
--- a/storage/perfschema/cursor_by_thread_connect_attr.cc
+++ b/storage/perfschema/cursor_by_thread_connect_attr.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/cursor_by_thread_connect_attr.h b/storage/perfschema/cursor_by_thread_connect_attr.h
index b5059918f7f..69d1b5ec0c0 100644
--- a/storage/perfschema/cursor_by_thread_connect_attr.h
+++ b/storage/perfschema/cursor_by_thread_connect_attr.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/cursor_by_user.cc b/storage/perfschema/cursor_by_user.cc
index 37ecbf17fee..273d186b01c 100644
--- a/storage/perfschema/cursor_by_user.cc
+++ b/storage/perfschema/cursor_by_user.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/cursor_by_user.h b/storage/perfschema/cursor_by_user.h
index d6e997766b6..06554ebb228 100644
--- a/storage/perfschema/cursor_by_user.h
+++ b/storage/perfschema/cursor_by_user.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/gen_pfs_lex_token.cc b/storage/perfschema/gen_pfs_lex_token.cc
index dcf25c79706..5a51a8aeb2f 100644
--- a/storage/perfschema/gen_pfs_lex_token.cc
+++ b/storage/perfschema/gen_pfs_lex_token.cc
@@ -2,13 +2,20 @@
Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index cb5805db5da..0754bb5a7e7 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index 4aad6a3beef..dd57ff31088 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index 165ac3f9812..2f1081b3836 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs.h b/storage/perfschema/pfs.h
index 230aea6d4b8..3649143f8fa 100644
--- a/storage/perfschema/pfs.h
+++ b/storage/perfschema/pfs.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_account.cc b/storage/perfschema/pfs_account.cc
index 5ac16b7636e..be2153e84ae 100644
--- a/storage/perfschema/pfs_account.cc
+++ b/storage/perfschema/pfs_account.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_account.h b/storage/perfschema/pfs_account.h
index 544abf913ae..cd7b1520df5 100644
--- a/storage/perfschema/pfs_account.h
+++ b/storage/perfschema/pfs_account.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_atomic.h b/storage/perfschema/pfs_atomic.h
index def9339d06d..00d1197970b 100644
--- a/storage/perfschema/pfs_atomic.h
+++ b/storage/perfschema/pfs_atomic.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_autosize.cc b/storage/perfschema/pfs_autosize.cc
index c8cc78198e9..e15a85fe2d6 100644
--- a/storage/perfschema/pfs_autosize.cc
+++ b/storage/perfschema/pfs_autosize.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_column_types.h b/storage/perfschema/pfs_column_types.h
index ef657b38707..09fce551402 100644
--- a/storage/perfschema/pfs_column_types.h
+++ b/storage/perfschema/pfs_column_types.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_column_values.cc b/storage/perfschema/pfs_column_values.cc
index fc2889a560d..043c8fd2f38 100644
--- a/storage/perfschema/pfs_column_values.cc
+++ b/storage/perfschema/pfs_column_values.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_column_values.h b/storage/perfschema/pfs_column_values.h
index a5e651ddd3d..44f23527881 100644
--- a/storage/perfschema/pfs_column_values.h
+++ b/storage/perfschema/pfs_column_values.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_con_slice.cc b/storage/perfschema/pfs_con_slice.cc
index bce4918ae9e..9f9deb0919c 100644
--- a/storage/perfschema/pfs_con_slice.cc
+++ b/storage/perfschema/pfs_con_slice.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_con_slice.h b/storage/perfschema/pfs_con_slice.h
index f83764339c3..ed17de5f2b0 100644
--- a/storage/perfschema/pfs_con_slice.h
+++ b/storage/perfschema/pfs_con_slice.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_defaults.cc b/storage/perfschema/pfs_defaults.cc
index 4171786ea68..8c56ceba682 100644
--- a/storage/perfschema/pfs_defaults.cc
+++ b/storage/perfschema/pfs_defaults.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_defaults.h b/storage/perfschema/pfs_defaults.h
index d95c4914e9d..7751b55b83b 100644
--- a/storage/perfschema/pfs_defaults.h
+++ b/storage/perfschema/pfs_defaults.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc
index 7b175762477..0ddb4c90eb3 100644
--- a/storage/perfschema/pfs_digest.cc
+++ b/storage/perfschema/pfs_digest.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_digest.h b/storage/perfschema/pfs_digest.h
index 06f8fc31de2..c11852a1510 100644
--- a/storage/perfschema/pfs_digest.h
+++ b/storage/perfschema/pfs_digest.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index b133988e908..08ad7d31c88 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h
index b29a9c54754..52ad203db24 100644
--- a/storage/perfschema/pfs_engine_table.h
+++ b/storage/perfschema/pfs_engine_table.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_events.h b/storage/perfschema/pfs_events.h
index 09c3935816f..ca2fd8582ad 100644
--- a/storage/perfschema/pfs_events.h
+++ b/storage/perfschema/pfs_events.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_events_stages.cc b/storage/perfschema/pfs_events_stages.cc
index 673d2cb95f5..a68b0729e96 100644
--- a/storage/perfschema/pfs_events_stages.cc
+++ b/storage/perfschema/pfs_events_stages.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_events_stages.h b/storage/perfschema/pfs_events_stages.h
index ea879bcd211..f61a7c3c077 100644
--- a/storage/perfschema/pfs_events_stages.h
+++ b/storage/perfschema/pfs_events_stages.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_events_statements.cc b/storage/perfschema/pfs_events_statements.cc
index 66a98e3f7d8..1942787665a 100644
--- a/storage/perfschema/pfs_events_statements.cc
+++ b/storage/perfschema/pfs_events_statements.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_events_statements.h b/storage/perfschema/pfs_events_statements.h
index a56423d3863..e47e2e79280 100644
--- a/storage/perfschema/pfs_events_statements.h
+++ b/storage/perfschema/pfs_events_statements.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc
index f99a1f31bd9..c3961461f34 100644
--- a/storage/perfschema/pfs_events_waits.cc
+++ b/storage/perfschema/pfs_events_waits.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_events_waits.h b/storage/perfschema/pfs_events_waits.h
index 25784fd52ba..702f7e3ce07 100644
--- a/storage/perfschema/pfs_events_waits.h
+++ b/storage/perfschema/pfs_events_waits.h
@@ -2,13 +2,20 @@
Copyright (c) 2017, 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 Foundation; version 2 of the License.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc
index 4f8928e7e84..e1b5e3400ca 100644
--- a/storage/perfschema/pfs_global.cc
+++ b/storage/perfschema/pfs_global.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h
index 81cab38b000..58db39e607d 100644
--- a/storage/perfschema/pfs_global.h
+++ b/storage/perfschema/pfs_global.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc
index 2d24a5f4b97..d6461ef3851 100644
--- a/storage/perfschema/pfs_host.cc
+++ b/storage/perfschema/pfs_host.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_host.h b/storage/perfschema/pfs_host.h
index 4e6b24bf6c6..d52207d3571 100644
--- a/storage/perfschema/pfs_host.h
+++ b/storage/perfschema/pfs_host.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index f90c6475f22..ca9e0385021 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h
index 007ef3d6435..81bc52d1d75 100644
--- a/storage/perfschema/pfs_instr.h
+++ b/storage/perfschema/pfs_instr.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc
index bde0836a250..d44644eee9d 100644
--- a/storage/perfschema/pfs_instr_class.cc
+++ b/storage/perfschema/pfs_instr_class.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h
index 038814b07e2..9d256fac78a 100644
--- a/storage/perfschema/pfs_instr_class.h
+++ b/storage/perfschema/pfs_instr_class.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h
index 4011cba2070..b74131c79e1 100644
--- a/storage/perfschema/pfs_lock.h
+++ b/storage/perfschema/pfs_lock.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc
index f39c80bbb71..f3f22bbcf4f 100644
--- a/storage/perfschema/pfs_server.cc
+++ b/storage/perfschema/pfs_server.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h
index 0def07b49a5..3457a91d376 100644
--- a/storage/perfschema/pfs_server.h
+++ b/storage/perfschema/pfs_server.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_setup_actor.cc b/storage/perfschema/pfs_setup_actor.cc
index 42c32b12411..c4cec6c9ff8 100644
--- a/storage/perfschema/pfs_setup_actor.cc
+++ b/storage/perfschema/pfs_setup_actor.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_setup_actor.h b/storage/perfschema/pfs_setup_actor.h
index 92a1617c304..613d5454a9c 100644
--- a/storage/perfschema/pfs_setup_actor.h
+++ b/storage/perfschema/pfs_setup_actor.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc
index 128091a398b..f33030e927f 100644
--- a/storage/perfschema/pfs_setup_object.cc
+++ b/storage/perfschema/pfs_setup_object.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_setup_object.h b/storage/perfschema/pfs_setup_object.h
index 0d343f552b2..ee40742941c 100644
--- a/storage/perfschema/pfs_setup_object.h
+++ b/storage/perfschema/pfs_setup_object.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_stat.h b/storage/perfschema/pfs_stat.h
index 9e4da7957f6..8a049e3013b 100644
--- a/storage/perfschema/pfs_stat.h
+++ b/storage/perfschema/pfs_stat.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc
index 5e2c27c217b..8533dffcb27 100644
--- a/storage/perfschema/pfs_timer.cc
+++ b/storage/perfschema/pfs_timer.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h
index a4f55c20994..222a7f00fae 100644
--- a/storage/perfschema/pfs_timer.h
+++ b/storage/perfschema/pfs_timer.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
@@ -100,7 +107,7 @@ extern enum_timer_name stage_timer;
extern enum_timer_name statement_timer;
/**
Timer information data.
- Characteristics about each suported timer.
+ Characteristics about each supported timer.
*/
extern MYSQL_PLUGIN_IMPORT MY_TIMER_INFO sys_timer_info;
diff --git a/storage/perfschema/pfs_user.cc b/storage/perfschema/pfs_user.cc
index d923d4158a5..14b86e1478e 100644
--- a/storage/perfschema/pfs_user.cc
+++ b/storage/perfschema/pfs_user.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_user.h b/storage/perfschema/pfs_user.h
index f2b1c4409c7..3d0457eae59 100644
--- a/storage/perfschema/pfs_user.h
+++ b/storage/perfschema/pfs_user.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/pfs_visitor.cc b/storage/perfschema/pfs_visitor.cc
index 3df7ef91bb3..097965fde17 100644
--- a/storage/perfschema/pfs_visitor.cc
+++ b/storage/perfschema/pfs_visitor.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/pfs_visitor.h b/storage/perfschema/pfs_visitor.h
index c3ada2f4e0b..120b5928045 100644
--- a/storage/perfschema/pfs_visitor.h
+++ b/storage/perfschema/pfs_visitor.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_accounts.cc b/storage/perfschema/table_accounts.cc
index 007fcb25550..708f8269a69 100644
--- a/storage/perfschema/table_accounts.cc
+++ b/storage/perfschema/table_accounts.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_accounts.h b/storage/perfschema/table_accounts.h
index f72eb39ed39..dfc2cc322e0 100644
--- a/storage/perfschema/table_accounts.h
+++ b/storage/perfschema/table_accounts.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_all_instr.cc b/storage/perfschema/table_all_instr.cc
index 05ec9f09c11..d48028b1539 100644
--- a/storage/perfschema/table_all_instr.cc
+++ b/storage/perfschema/table_all_instr.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_all_instr.h b/storage/perfschema/table_all_instr.h
index 7c9d5d9b0d6..072221ba86e 100644
--- a/storage/perfschema/table_all_instr.h
+++ b/storage/perfschema/table_all_instr.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.cc b/storage/perfschema/table_esgs_by_account_by_event_name.cc
index 3bc76f899ad..22e4e0040f1 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.h b/storage/perfschema/table_esgs_by_account_by_event_name.h
index 5afd68cd7d9..ee855d42818 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.cc b/storage/perfschema/table_esgs_by_host_by_event_name.cc
index bbef6a8d16d..86cc2eb1b86 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.h b/storage/perfschema/table_esgs_by_host_by_event_name.h
index afc6d529428..6042e6396af 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.cc b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
index 57ef634acad..dfda9702abb 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.h b/storage/perfschema/table_esgs_by_thread_by_event_name.h
index 7db8d1be408..6ff677a95e2 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.cc b/storage/perfschema/table_esgs_by_user_by_event_name.cc
index f8e8518bde3..af73c1fc5fd 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.h b/storage/perfschema/table_esgs_by_user_by_event_name.h
index 8f48747c8c8..bc545c2438a 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esgs_global_by_event_name.cc b/storage/perfschema/table_esgs_global_by_event_name.cc
index 83a4dbf43fd..6c5f0866671 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.cc
+++ b/storage/perfschema/table_esgs_global_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esgs_global_by_event_name.h b/storage/perfschema/table_esgs_global_by_event_name.h
index 2b0ac8b6218..b8884355676 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.h
+++ b/storage/perfschema/table_esgs_global_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.cc b/storage/perfschema/table_esms_by_account_by_event_name.cc
index d8f04d7af23..7afdabcbbfe 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_account_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.h b/storage/perfschema/table_esms_by_account_by_event_name.h
index ff212291760..64f2053cff6 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.h
+++ b/storage/perfschema/table_esms_by_account_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc
index ae648378b2a..5295c29dc40 100644
--- a/storage/perfschema/table_esms_by_digest.cc
+++ b/storage/perfschema/table_esms_by_digest.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h
index 682dc70ab10..903b86110f6 100644
--- a/storage/perfschema/table_esms_by_digest.h
+++ b/storage/perfschema/table_esms_by_digest.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.cc b/storage/perfschema/table_esms_by_host_by_event_name.cc
index 7233b340bd2..42629ab6c09 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_host_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.h b/storage/perfschema/table_esms_by_host_by_event_name.h
index def5e19ecdc..a6985b48149 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.h
+++ b/storage/perfschema/table_esms_by_host_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.cc b/storage/perfschema/table_esms_by_thread_by_event_name.cc
index f62d974aa76..0a7cf46986c 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.h b/storage/perfschema/table_esms_by_thread_by_event_name.h
index 7c50307c483..72645d03389 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.cc b/storage/perfschema/table_esms_by_user_by_event_name.cc
index 66afe288f12..f8708ac9a14 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_user_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.h b/storage/perfschema/table_esms_by_user_by_event_name.h
index 65284122043..d1d1e5df85d 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.h
+++ b/storage/perfschema/table_esms_by_user_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc
index 96957bf028e..7d9584752b0 100644
--- a/storage/perfschema/table_esms_global_by_event_name.cc
+++ b/storage/perfschema/table_esms_global_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_esms_global_by_event_name.h b/storage/perfschema/table_esms_global_by_event_name.h
index 7453d635848..b90c14c0c0f 100644
--- a/storage/perfschema/table_esms_global_by_event_name.h
+++ b/storage/perfschema/table_esms_global_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_events_stages.cc b/storage/perfschema/table_events_stages.cc
index d92de88abe7..95e7f187d24 100644
--- a/storage/perfschema/table_events_stages.cc
+++ b/storage/perfschema/table_events_stages.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_events_stages.h b/storage/perfschema/table_events_stages.h
index cbc0f9a42bb..ae8760cd953 100644
--- a/storage/perfschema/table_events_stages.h
+++ b/storage/perfschema/table_events_stages.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc
index bb32e997792..16fc58d626d 100644
--- a/storage/perfschema/table_events_statements.cc
+++ b/storage/perfschema/table_events_statements.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h
index 6f8bc1621d0..cec28628f3e 100644
--- a/storage/perfschema/table_events_statements.h
+++ b/storage/perfschema/table_events_statements.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc
index f845752cc68..6cfc754f8c2 100644
--- a/storage/perfschema/table_events_waits.cc
+++ b/storage/perfschema/table_events_waits.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h
index 3e09fa487ad..90c1d341e5d 100644
--- a/storage/perfschema/table_events_waits.h
+++ b/storage/perfschema/table_events_waits.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc
index 2f5c83d57d3..03477f6d542 100644
--- a/storage/perfschema/table_events_waits_summary.cc
+++ b/storage/perfschema/table_events_waits_summary.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h
index a4f063bb66a..53f1bed7987 100644
--- a/storage/perfschema/table_events_waits_summary.h
+++ b/storage/perfschema/table_events_waits_summary.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.cc b/storage/perfschema/table_ews_by_account_by_event_name.cc
index 0b86a4ac1dc..fa6258ec9ac 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_account_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.h b/storage/perfschema/table_ews_by_account_by_event_name.h
index b46008e2675..7cde09183e3 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.h
+++ b/storage/perfschema/table_ews_by_account_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.cc b/storage/perfschema/table_ews_by_host_by_event_name.cc
index e82c734431c..e3ef7ca3720 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_host_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.h b/storage/perfschema/table_ews_by_host_by_event_name.h
index c631da36ec5..8ce44a96617 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.h
+++ b/storage/perfschema/table_ews_by_host_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.cc b/storage/perfschema/table_ews_by_thread_by_event_name.cc
index 7b3e220e973..33f9765310b 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.h b/storage/perfschema/table_ews_by_thread_by_event_name.h
index cf94e7a81a2..b67664bfced 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.h
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.cc b/storage/perfschema/table_ews_by_user_by_event_name.cc
index 577a9ef6676..cb99f749a9c 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_user_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.h b/storage/perfschema/table_ews_by_user_by_event_name.h
index e987cf1bcec..f4f29534be4 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.h
+++ b/storage/perfschema/table_ews_by_user_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index 9a5ba4f2375..7420c6351fd 100644
--- a/storage/perfschema/table_ews_global_by_event_name.cc
+++ b/storage/perfschema/table_ews_global_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h
index 57e3459e373..8157d274112 100644
--- a/storage/perfschema/table_ews_global_by_event_name.h
+++ b/storage/perfschema/table_ews_global_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc
index 7914664e2e0..b323df83ad2 100644
--- a/storage/perfschema/table_file_instances.cc
+++ b/storage/perfschema/table_file_instances.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h
index e07017911de..5b44e63028e 100644
--- a/storage/perfschema/table_file_instances.h
+++ b/storage/perfschema/table_file_instances.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_file_summary_by_event_name.cc b/storage/perfschema/table_file_summary_by_event_name.cc
index e98bc528995..459b2bf99a6 100644
--- a/storage/perfschema/table_file_summary_by_event_name.cc
+++ b/storage/perfschema/table_file_summary_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_file_summary_by_event_name.h b/storage/perfschema/table_file_summary_by_event_name.h
index 7a13fcdc4d9..b8cb293cb07 100644
--- a/storage/perfschema/table_file_summary_by_event_name.h
+++ b/storage/perfschema/table_file_summary_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_file_summary_by_instance.cc b/storage/perfschema/table_file_summary_by_instance.cc
index b80811d0a5b..3a30984405c 100644
--- a/storage/perfschema/table_file_summary_by_instance.cc
+++ b/storage/perfschema/table_file_summary_by_instance.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_file_summary_by_instance.h b/storage/perfschema/table_file_summary_by_instance.h
index 872698f8e58..0e7ce6958b2 100644
--- a/storage/perfschema/table_file_summary_by_instance.h
+++ b/storage/perfschema/table_file_summary_by_instance.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011 Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_helper.cc b/storage/perfschema/table_helper.cc
index 0dbeeb259c1..d6bdd894483 100644
--- a/storage/perfschema/table_helper.cc
+++ b/storage/perfschema/table_helper.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_helper.h b/storage/perfschema/table_helper.h
index b57abe9c4e6..62f94826754 100644
--- a/storage/perfschema/table_helper.h
+++ b/storage/perfschema/table_helper.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc
index 02f027e3aab..501894df9b1 100644
--- a/storage/perfschema/table_host_cache.cc
+++ b/storage/perfschema/table_host_cache.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h
index 47abb42444e..8add0b5049c 100644
--- a/storage/perfschema/table_host_cache.h
+++ b/storage/perfschema/table_host_cache.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_hosts.cc b/storage/perfschema/table_hosts.cc
index 2c5377db4ac..8bc5310817c 100644
--- a/storage/perfschema/table_hosts.cc
+++ b/storage/perfschema/table_hosts.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_hosts.h b/storage/perfschema/table_hosts.h
index 60b70ae803e..422b6449b25 100644
--- a/storage/perfschema/table_hosts.h
+++ b/storage/perfschema/table_hosts.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc
index cd2ace50c85..b549b0c22e7 100644
--- a/storage/perfschema/table_os_global_by_type.cc
+++ b/storage/perfschema/table_os_global_by_type.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h
index a434961b65b..2b9293ece06 100644
--- a/storage/perfschema/table_os_global_by_type.h
+++ b/storage/perfschema/table_os_global_by_type.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc
index 8d31c017832..a77f005ab62 100644
--- a/storage/perfschema/table_performance_timers.cc
+++ b/storage/perfschema/table_performance_timers.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h
index e1dc93fcbe4..93210ac9882 100644
--- a/storage/perfschema/table_performance_timers.h
+++ b/storage/perfschema/table_performance_timers.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_session_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc
index 5d3d511d717..fcb4f001ba7 100644
--- a/storage/perfschema/table_session_account_connect_attrs.cc
+++ b/storage/perfschema/table_session_account_connect_attrs.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_session_account_connect_attrs.h b/storage/perfschema/table_session_account_connect_attrs.h
index d56d571fb79..483001fcb91 100644
--- a/storage/perfschema/table_session_account_connect_attrs.h
+++ b/storage/perfschema/table_session_account_connect_attrs.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc
index 74b953b034e..0ef233ffd9e 100644
--- a/storage/perfschema/table_session_connect.cc
+++ b/storage/perfschema/table_session_connect.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h
index 91d24ab7075..ee1019fe7f2 100644
--- a/storage/perfschema/table_session_connect.h
+++ b/storage/perfschema/table_session_connect.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_session_connect_attrs.cc b/storage/perfschema/table_session_connect_attrs.cc
index 0ccb255cd0d..cb7b64a7fdf 100644
--- a/storage/perfschema/table_session_connect_attrs.cc
+++ b/storage/perfschema/table_session_connect_attrs.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_session_connect_attrs.h b/storage/perfschema/table_session_connect_attrs.h
index de18085d8ac..927c3a92af2 100644
--- a/storage/perfschema/table_session_connect_attrs.h
+++ b/storage/perfschema/table_session_connect_attrs.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index b5058f8cd85..71c384d0555 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h
index aa403b4909d..748c57850b0 100644
--- a/storage/perfschema/table_setup_actors.h
+++ b/storage/perfschema/table_setup_actors.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index 1846e7949e6..7355efae45b 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h
index 959efc3bfd8..90da55920c6 100644
--- a/storage/perfschema/table_setup_consumers.h
+++ b/storage/perfschema/table_setup_consumers.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index d6daa7b15d9..490226c7c83 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h
index 0255b4b33f7..cd3715cfe55 100644
--- a/storage/perfschema/table_setup_instruments.h
+++ b/storage/perfschema/table_setup_instruments.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index e15c55b41ae..af6481ae98c 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h
index 8e883126298..560346c577f 100644
--- a/storage/perfschema/table_setup_objects.h
+++ b/storage/perfschema/table_setup_objects.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index 75de0393501..a2d34828f08 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h
index 8c4da92296a..d591f3e0b67 100644
--- a/storage/perfschema/table_setup_timers.h
+++ b/storage/perfschema/table_setup_timers.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_socket_instances.cc b/storage/perfschema/table_socket_instances.cc
index 419e19349f4..920531136d5 100644
--- a/storage/perfschema/table_socket_instances.cc
+++ b/storage/perfschema/table_socket_instances.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_socket_instances.h b/storage/perfschema/table_socket_instances.h
index b5e5edb36ed..41b5ee3fd21 100644
--- a/storage/perfschema/table_socket_instances.h
+++ b/storage/perfschema/table_socket_instances.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_socket_summary_by_event_name.cc b/storage/perfschema/table_socket_summary_by_event_name.cc
index 2da45c0d2cd..c813d45b732 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.cc
+++ b/storage/perfschema/table_socket_summary_by_event_name.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_socket_summary_by_event_name.h b/storage/perfschema/table_socket_summary_by_event_name.h
index 9bdeb3104b4..4f679d89b09 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.h
+++ b/storage/perfschema/table_socket_summary_by_event_name.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_socket_summary_by_instance.cc b/storage/perfschema/table_socket_summary_by_instance.cc
index 693f65e4843..a4b1477aa90 100644
--- a/storage/perfschema/table_socket_summary_by_instance.cc
+++ b/storage/perfschema/table_socket_summary_by_instance.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_socket_summary_by_instance.h b/storage/perfschema/table_socket_summary_by_instance.h
index deb8ffab554..a9eab8d18b6 100644
--- a/storage/perfschema/table_socket_summary_by_instance.h
+++ b/storage/perfschema/table_socket_summary_by_instance.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc
index 6e48468e6c3..f0c7800d24a 100644
--- a/storage/perfschema/table_sync_instances.cc
+++ b/storage/perfschema/table_sync_instances.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h
index c6a2ed8adaa..6f7e1bf5523 100644
--- a/storage/perfschema/table_sync_instances.h
+++ b/storage/perfschema/table_sync_instances.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index 744ff763be1..b396db1a814 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h
index 96ae0925002..841b8102bca 100644
--- a/storage/perfschema/table_threads.h
+++ b/storage/perfschema/table_threads.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_tiws_by_index_usage.cc b/storage/perfschema/table_tiws_by_index_usage.cc
index 5d24fcc689b..b49e9280469 100644
--- a/storage/perfschema/table_tiws_by_index_usage.cc
+++ b/storage/perfschema/table_tiws_by_index_usage.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_tiws_by_index_usage.h b/storage/perfschema/table_tiws_by_index_usage.h
index f6d935365b2..a284bc7f0bc 100644
--- a/storage/perfschema/table_tiws_by_index_usage.h
+++ b/storage/perfschema/table_tiws_by_index_usage.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc
index 78535fd6512..db00fd2409e 100644
--- a/storage/perfschema/table_tiws_by_table.cc
+++ b/storage/perfschema/table_tiws_by_table.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h
index 9a86d39196c..7427ca797fa 100644
--- a/storage/perfschema/table_tiws_by_table.h
+++ b/storage/perfschema/table_tiws_by_table.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc
index 5299e7f6a56..d802127d10d 100644
--- a/storage/perfschema/table_tlws_by_table.cc
+++ b/storage/perfschema/table_tlws_by_table.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h
index 757adc3f5f5..b5872a07762 100644
--- a/storage/perfschema/table_tlws_by_table.h
+++ b/storage/perfschema/table_tlws_by_table.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/table_users.cc b/storage/perfschema/table_users.cc
index 6d6bfc5bfaf..883ebd36633 100644
--- a/storage/perfschema/table_users.cc
+++ b/storage/perfschema/table_users.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/table_users.h b/storage/perfschema/table_users.h
index 1b24dfb9039..912f0f43714 100644
--- a/storage/perfschema/table_users.h
+++ b/storage/perfschema/table_users.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt
index b449640b374..7b8c906a4e6 100644
--- a/storage/perfschema/unittest/CMakeLists.txt
+++ b/storage/perfschema/unittest/CMakeLists.txt
@@ -1,13 +1,20 @@
-# Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
#
# 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.
+# it under the terms of the GNU General Public License, version 2.0,
+# as published by the Free Software Foundation.
+#
+# This program is also distributed with certain software (including
+# but not limited to OpenSSL) that is licensed under separate terms,
+# as designated in a particular file or component or in included license
+# documentation. The authors of MySQL hereby grant you an additional
+# permission to link the program and your derivative works with the
+# separately licensed software that they have included with MySQL.
#
# 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.
+# GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/conf.txt b/storage/perfschema/unittest/conf.txt
index 8a14b9ed14b..f84ba3317b1 100644
--- a/storage/perfschema/unittest/conf.txt
+++ b/storage/perfschema/unittest/conf.txt
@@ -1,13 +1,20 @@
# Copyright (c) 2009, 2010, Oracle and/or its affiliates.
#
# 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.
+# it under the terms of the GNU General Public License, version 2.0,
+# as published by the Free Software Foundation.
+#
+# This program is also distributed with certain software (including
+# but not limited to OpenSSL) that is licensed under separate terms,
+# as designated in a particular file or component or in included license
+# documentation. The authors of MySQL hereby grant you an additional
+# permission to link the program and your derivative works with the
+# separately licensed software that they have included with MySQL.
#
# 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.
+# GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc
index 75ded9c3679..f5f38367691 100644
--- a/storage/perfschema/unittest/pfs-t.cc
+++ b/storage/perfschema/unittest/pfs-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_account-oom-t.cc b/storage/perfschema/unittest/pfs_account-oom-t.cc
index 71c089ab0f5..1ca66445e0c 100644
--- a/storage/perfschema/unittest/pfs_account-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_account-oom-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_connect_attr-t.cc b/storage/perfschema/unittest/pfs_connect_attr-t.cc
index 3dd62ca5662..7ebfb0c8294 100644
--- a/storage/perfschema/unittest/pfs_connect_attr-t.cc
+++ b/storage/perfschema/unittest/pfs_connect_attr-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_host-oom-t.cc b/storage/perfschema/unittest/pfs_host-oom-t.cc
index e2eba7e6aff..14af1af0352 100644
--- a/storage/perfschema/unittest/pfs_host-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_host-oom-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc
index a18902dc3db..231fd1e100b 100644
--- a/storage/perfschema/unittest/pfs_instr-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc
index 47a91d9bb9a..c9f4bac1171 100644
--- a/storage/perfschema/unittest/pfs_instr-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
index bdb2648c2f3..7eb21a33bd7 100644
--- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc
index 0d8ec38525d..f1e246dc387 100644
--- a/storage/perfschema/unittest/pfs_instr_class-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_misc-t.cc b/storage/perfschema/unittest/pfs_misc-t.cc
index c308cf4b82d..7d274c0820d 100644
--- a/storage/perfschema/unittest/pfs_misc-t.cc
+++ b/storage/perfschema/unittest/pfs_misc-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc
index 3c4b864d742..db1600faf9f 100644
--- a/storage/perfschema/unittest/pfs_server_stubs.cc
+++ b/storage/perfschema/unittest/pfs_server_stubs.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc
index 9ef111f531c..139454b8649 100644
--- a/storage/perfschema/unittest/pfs_timer-t.cc
+++ b/storage/perfschema/unittest/pfs_timer-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/pfs_user-oom-t.cc b/storage/perfschema/unittest/pfs_user-oom-t.cc
index 6e81df8d5e2..ca451f3e457 100644
--- a/storage/perfschema/unittest/pfs_user-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_user-oom-t.cc
@@ -1,13 +1,20 @@
/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/stub_pfs_defaults.h b/storage/perfschema/unittest/stub_pfs_defaults.h
index 6b4ee3f0e15..951508733e2 100644
--- a/storage/perfschema/unittest/stub_pfs_defaults.h
+++ b/storage/perfschema/unittest/stub_pfs_defaults.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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
diff --git a/storage/perfschema/unittest/stub_pfs_global.h b/storage/perfschema/unittest/stub_pfs_global.h
index a665ed39704..8a1f9216ba2 100644
--- a/storage/perfschema/unittest/stub_pfs_global.h
+++ b/storage/perfschema/unittest/stub_pfs_global.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/perfschema/unittest/stub_print_error.h b/storage/perfschema/unittest/stub_print_error.h
index 476a6c0e901..2cd2ad5b03c 100644
--- a/storage/perfschema/unittest/stub_print_error.h
+++ b/storage/perfschema/unittest/stub_print_error.h
@@ -1,13 +1,20 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
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.
+ GNU General Public License, version 2.0, 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,
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 9551ad7f343..3a707d8c02b 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -257,7 +257,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/myrocks_hotbackup.py
INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/myrocks_hotbackup COMPONENT rocksdb-engine)
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- SET_TARGET_PROPERTIES(rocksdb_tools sst_dump mysql_ldb PROPERTIES COMPILE_FLAGS -frtti)
+ SET_TARGET_PROPERTIES(rocksdb_tools sst_dump mysql_ldb PROPERTIES COMPILE_FLAGS "-frtti -Wno-error")
ENDIF()
IF(MSVC)
# RocksDB, the storage engine, overdoes "const" by adding
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index ba50e94c983..2fbc938ae00 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -471,5 +471,5 @@ list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/build_version.cc)
ADD_CONVENIENCE_LIBRARY(rocksdblib ${SOURCES})
target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp -frtti")
+ set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp -frtti -Wno-error")
endif()
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result
index 8d5b6270318..61f005c1758 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result
@@ -79,7 +79,7 @@ buffer_LRU_batch_flush_avg_time_thread buffer 0 NULL NULL NULL 0 NULL NULL NULL
buffer_flush_adaptive_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for adaptive flushing recently.
buffer_LRU_batch_flush_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for LRU batch flushing recently.
buffer_flush_avg_time buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Avg time (ms) spent for flushing recently.
-buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Numner of adaptive flushes passed during the recent Avg period.
+buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of adaptive flushes passed during the recent Avg period.
buffer_LRU_batch_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of LRU batch flushes passed during the recent Avg period.
buffer_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of flushes passed during the recent Avg period.
buffer_LRU_get_free_loops buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Total loops in LRU get free.
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/lock_rows_not_exist.test b/storage/rocksdb/mysql-test/rocksdb/t/lock_rows_not_exist.test
index d8a6bde45c8..a51a516aaaa 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/lock_rows_not_exist.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/lock_rows_not_exist.test
@@ -57,7 +57,7 @@ DELETE FROM t WHERE id1=1 AND id2=1 AND id3=0;
--disable_parsing
#
# The following is commented out because RocksDB's Transaction API doesn't
-# "support" READ COMMITED, in particular, it doesn't release row locks
+# "support" READ COMMITTED, in particular, it doesn't release row locks
# after each statement. (MyRocks is able to request a new snapshot for
# every statement, but this won't free the locks. TODO: Is the behavior
# that is tested below really needed?)
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index 812b362e737..4092cfcb514 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -3351,7 +3351,7 @@ int ha_sphinx::delete_table ( const char * )
// Renames a table from one name to another from alter table call.
//
// If you do not implement this, the default rename_table() is called from
-// handler.cc and it will delete all files with the file extentions returned
+// handler.cc and it will delete all files with the file extensions returned
// by bas_ext().
//
// Called from sql_table.cc by mysql_rename_table().
diff --git a/storage/spider/mysql-test/spider/r/pushdown_not_like.result b/storage/spider/mysql-test/spider/r/pushdown_not_like.result
new file mode 100644
index 00000000000..0e007b094de
--- /dev/null
+++ b/storage/spider/mysql-test/spider/r/pushdown_not_like.result
@@ -0,0 +1,63 @@
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+child3_1
+child3_2
+child3_3
+
+drop and create databases
+connection master_1;
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+connection child2_1;
+DROP DATABASE IF EXISTS auto_test_remote;
+CREATE DATABASE auto_test_remote;
+USE auto_test_remote;
+
+create table select test
+connection master_1;
+DROP TABLE IF EXISTS ta_l;
+CREATE TABLE ta_l (
+a INT,
+b CHAR(1),
+c DATETIME,
+PRIMARY KEY(a)
+) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+INSERT INTO ta_l (a, b, c) VALUES
+(1, 'a', '2018-11-01 10:21:39'),
+(2, 'b', '2015-06-30 23:59:59'),
+(3, 'c', '2013-11-01 01:01:01');
+
+spider not like bug fix test
+connection master_1;
+select * from ta_l where b not like 'a%';
+a b c
+2 b 2015-06-30 23:59:59
+3 c 2013-11-01 01:01:01
+connection child2_1;
+SELECT argument FROM mysql.general_log WHERE argument LIKE '%select%';
+argument
+select t0.`a` `a`,t0.`b` `b`,t0.`c` `c` from `auto_test_remote`.`ta_r` t0 where (t0.`b` not like 'a%')
+SELECT argument FROM mysql.general_log WHERE argument LIKE '%select%'
+
+deinit
+connection master_1;
+DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
+DROP DATABASE IF EXISTS auto_test_remote;
+SET GLOBAL log_output = @old_log_output;
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+child3_1
+child3_2
+child3_3
+
+end of test
diff --git a/storage/spider/mysql-test/spider/t/pushdown_not_like.test b/storage/spider/mysql-test/spider/t/pushdown_not_like.test
new file mode 100644
index 00000000000..95e4fa6eea8
--- /dev/null
+++ b/storage/spider/mysql-test/spider/t/pushdown_not_like.test
@@ -0,0 +1,138 @@
+--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--enable_result_log
+--enable_query_log
+
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+}
+--enable_warnings
+
+
+--echo
+--echo create table select test
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_TABLES;
+ echo CHILD2_1_CREATE_TABLES;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_TABLES;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_TABLES;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ SET @old_log_output = @@global.log_output;
+ TRUNCATE TABLE mysql.general_log;
+ set global log_output = 'TABLE';
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+--connection master_1
+--disable_warnings
+DROP TABLE IF EXISTS ta_l;
+--enable_warnings
+--disable_query_log
+echo CREATE TABLE ta_l (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
+eval CREATE TABLE ta_l (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
+--enable_query_log
+INSERT INTO ta_l (a, b, c) VALUES
+ (1, 'a', '2018-11-01 10:21:39'),
+ (2, 'b', '2015-06-30 23:59:59'),
+ (3, 'c', '2013-11-01 01:01:01');
+
+--echo
+--echo spider not like bug fix test
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+--connection master_1
+select * from ta_l where b not like 'a%';
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%select%';
+ }
+}
+
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ SET GLOBAL log_output = @old_log_output;
+}
+
+
+--disable_query_log
+--disable_result_log
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/spd_db_include.h b/storage/spider/spd_db_include.h
index e7fe0cebee7..d51770c1a77 100644
--- a/storage/spider/spd_db_include.h
+++ b/storage/spider/spd_db_include.h
@@ -161,6 +161,8 @@ typedef st_spider_result SPIDER_RESULT;
#define SPIDER_SQL_IN_LEN (sizeof(SPIDER_SQL_IN_STR) - 1)
#define SPIDER_SQL_NOT_IN_STR "not in("
#define SPIDER_SQL_NOT_IN_LEN (sizeof(SPIDER_SQL_NOT_IN_STR) - 1)
+#define SPIDER_SQL_NOT_LIKE_STR "not like"
+#define SPIDER_SQL_NOT_LIKE_LEN (sizeof(SPIDER_SQL_NOT_LIKE_STR) - 1)
#define SPIDER_SQL_AS_CHAR_STR " as char"
#define SPIDER_SQL_AS_CHAR_LEN (sizeof(SPIDER_SQL_AS_CHAR_STR) - 1)
#define SPIDER_SQL_CAST_STR "cast("
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index 1b62b4a9bd5..0329509c748 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -4789,13 +4789,27 @@ int spider_db_mbase_util::open_item_func(
case Item_func::LE_FUNC:
case Item_func::GE_FUNC:
case Item_func::GT_FUNC:
- case Item_func::LIKE_FUNC:
if (str)
{
func_name = (char*) item_func->func_name();
func_name_length = strlen(func_name);
}
break;
+ case Item_func::LIKE_FUNC:
+ if (str)
+ {
+ if (((Item_func_like *)item_func)->negated)
+ {
+ func_name = SPIDER_SQL_NOT_LIKE_STR;
+ func_name_length = SPIDER_SQL_NOT_LIKE_LEN;
+ }
+ else
+ {
+ func_name = (char*)item_func->func_name();
+ func_name_length = strlen(func_name);
+ }
+ }
+ break;
default:
THD *thd = spider->trx->thd;
SPIDER_SHARE *share = spider->share;
diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt
index f22f7c1d6b5..088a24f827b 100644
--- a/storage/tokudb/CMakeLists.txt
+++ b/storage/tokudb/CMakeLists.txt
@@ -168,3 +168,5 @@ TARGET_LINK_LIBRARIES(tokudb tokufractaltree_static tokuportability_static
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -fuse-linker-plugin")
SET(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO} -flto -fuse-linker-plugin")
+
+ADD_SUBDIRECTORY(man)
diff --git a/storage/tokudb/PerconaFT/DartConfig.cmake b/storage/tokudb/PerconaFT/DartConfig.cmake
deleted file mode 100644
index 9ad189869c6..00000000000
--- a/storage/tokudb/PerconaFT/DartConfig.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-if(BUILD_TESTING)
- if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
- # Valgrind on OSX 10.8 generally works but outputs some warning junk
- # that is hard to parse out, so we'll just let it run alone
- set(MEMORYCHECK_COMMAND "${TokuDB_SOURCE_DIR}/scripts/tokuvalgrind")
- endif ()
- set(MEMORYCHECK_COMMAND_OPTIONS "--gen-suppressions=no --soname-synonyms=somalloc=*tokuportability* --quiet --num-callers=20 --leak-check=full --show-reachable=yes --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,grep,*/grep,date,*/date,test,*/tokudb_dump,*/tdb-recover --trace-children-skip-by-arg=--only_create,--test,--no-shutdown,novalgrind" CACHE INTERNAL "options for valgrind")
- set(MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_CURRENT_BINARY_DIR}/valgrind.suppressions" CACHE INTERNAL "suppressions file for valgrind")
- set(UPDATE_COMMAND "svn")
-endif()
diff --git a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc
index 5467bef43b4..034d5442742 100644
--- a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc
+++ b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc
@@ -225,6 +225,9 @@ uint32_t toku_get_checkpoint_period_unlocked (CACHETABLE ct) {
}
void toku_set_cleaner_period (CACHETABLE ct, uint32_t new_period) {
+ if(force_recovery) {
+ return;
+ }
ct->cl.set_period(new_period);
}
@@ -3026,9 +3029,12 @@ int toku_cleaner_thread (void *cleaner_v) {
//
ENSURE_POD(cleaner);
+extern uint force_recovery;
+
int cleaner::init(uint32_t _cleaner_iterations, pair_list* _pl, CACHETABLE _ct) {
// default is no cleaner, for now
m_cleaner_cron_init = false;
+ if (force_recovery) return 0;
int r = toku_minicron_setup(&m_cleaner_cron, 0, toku_cleaner_thread, this);
if (r == 0) {
m_cleaner_cron_init = true;
diff --git a/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc b/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc
index 6b6ff1e323f..439e0688e89 100644
--- a/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc
+++ b/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc
@@ -73,7 +73,7 @@ cachetable_put_empty_node_with_dep_nodes(
enum cachetable_dirty dependent_dirty_bits[num_dependent_nodes];
for (uint32_t i = 0; i < num_dependent_nodes; i++) {
dependent_pairs[i] = dependent_nodes[i]->ct_pair;
- dependent_dirty_bits[i] = (enum cachetable_dirty) dependent_nodes[i]->dirty;
+ dependent_dirty_bits[i] = (enum cachetable_dirty) dependent_nodes[i]->dirty();
}
toku_cachetable_put_with_dep_pairs(
@@ -253,7 +253,7 @@ toku_pin_ftnode_for_query(
// written out, it would have to be dirtied. That
// requires a write lock, and a write lock requires you to
// resolve checkpointing.
- if (!node->dirty) {
+ if (!node->dirty()) {
toku_ft_bn_update_max_msn(node, max_msn_in_path, bfe->child_to_read);
}
}
@@ -280,7 +280,7 @@ toku_pin_ftnode_with_dep_nodes(
enum cachetable_dirty dependent_dirty_bits[num_dependent_nodes];
for (uint32_t i = 0; i < num_dependent_nodes; i++) {
dependent_pairs[i] = dependent_nodes[i]->ct_pair;
- dependent_dirty_bits[i] = (enum cachetable_dirty) dependent_nodes[i]->dirty;
+ dependent_dirty_bits[i] = (enum cachetable_dirty) dependent_nodes[i]->dirty();
}
int r = toku_cachetable_get_and_pin_with_dep_pairs(
@@ -333,7 +333,7 @@ cleanup:
void toku_unpin_ftnode(FT ft, FTNODE node) {
int r = toku_cachetable_unpin(ft->cf,
node->ct_pair,
- static_cast<enum cachetable_dirty>(node->dirty),
+ static_cast<enum cachetable_dirty>(node->dirty()),
make_ftnode_pair_attr(node));
invariant_zero(r);
}
@@ -344,7 +344,7 @@ toku_unpin_ftnode_read_only(FT ft, FTNODE node)
int r = toku_cachetable_unpin(
ft->cf,
node->ct_pair,
- (enum cachetable_dirty) node->dirty,
+ (enum cachetable_dirty) node->dirty(),
make_invalid_pair_attr()
);
assert(r==0);
diff --git a/storage/tokudb/PerconaFT/ft/ft-flusher.cc b/storage/tokudb/PerconaFT/ft/ft-flusher.cc
index 3fd59f388ce..bbb2a170cb9 100644
--- a/storage/tokudb/PerconaFT/ft/ft-flusher.cc
+++ b/storage/tokudb/PerconaFT/ft/ft-flusher.cc
@@ -139,7 +139,7 @@ maybe_destroy_child_blbs(FTNODE node, FTNODE child, FT ft)
// up to date.
if (child->n_children > 1 &&
child->height == 0 &&
- !child->dirty) {
+ !child->dirty()) {
for (int i = 0; i < child->n_children; ++i) {
if (BP_STATE(child, i) == PT_AVAIL &&
node->max_msn_applied_to_node_on_disk.msn < BLB_MAX_MSN_APPLIED(child, i).msn)
@@ -480,7 +480,7 @@ handle_split_of_child(
}
)
- node->dirty = 1;
+ node->set_dirty();
XREALLOC_N(node->n_children+1, node->bp);
// Slide the children over.
@@ -662,8 +662,8 @@ static void ftnode_finalize_split(FTNODE node, FTNODE B, MSN max_msn_applied_to_
// The new node in the split inherits the oldest known reference xid
B->oldest_referenced_xid_known = node->oldest_referenced_xid_known;
- node->dirty = 1;
- B->dirty = 1;
+ node->set_dirty();
+ B->set_dirty();
}
void
@@ -1003,8 +1003,8 @@ flush_this_child(
paranoid_invariant(child->blocknum.b!=0);
// VERIFY_NODE does not work off client thread as of now
//VERIFY_NODE(t, child);
- node->dirty = 1;
- child->dirty = 1;
+ node->set_dirty();
+ child->set_dirty();
BP_WORKDONE(node, childnum) = 0; // this buffer is drained, no work has been done by its contents
NONLEAF_CHILDINFO bnc = BNC(node, childnum);
@@ -1034,8 +1034,8 @@ merge_leaf_nodes(FTNODE a, FTNODE b)
// TODO(leif): this is no longer the way in_memory_stats is
// maintained. verify that it's ok to move this just before the unpin
// and then do that.
- a->dirty = 1;
- b->dirty = 1;
+ a->set_dirty();
+ b->set_dirty();
bn_data* a_last_bd = BLB_DATA(a, a->n_children-1);
// this bool states if the last basement node in a has any items or not
@@ -1167,8 +1167,8 @@ maybe_merge_pinned_nonleaf_nodes(
a->n_children = new_n_children;
b->n_children = 0;
- a->dirty = 1;
- b->dirty = 1;
+ a->set_dirty();
+ b->set_dirty();
*did_merge = true;
*did_rebalance = false;
@@ -1211,7 +1211,7 @@ maybe_merge_pinned_nodes(
toku_ftnode_assert_fully_in_memory(parent);
toku_ftnode_assert_fully_in_memory(a);
toku_ftnode_assert_fully_in_memory(b);
- parent->dirty = 1; // just to make sure
+ parent->set_dirty(); // just to make sure
{
MSN msna = a->max_msn_applied_to_node_on_disk;
MSN msnb = b->max_msn_applied_to_node_on_disk;
@@ -1335,8 +1335,8 @@ ft_merge_child(
}
paranoid_invariant(BP_BLOCKNUM(node, childnuma).b == childa->blocknum.b);
- childa->dirty = 1; // just to make sure
- childb->dirty = 1; // just to make sure
+ childa->set_dirty(); // just to make sure
+ childb->set_dirty(); // just to make sure
} else {
// flow will be inaccurate for a while, oh well. the children
// are leaves in this case so it's not a huge deal (we're
@@ -1345,7 +1345,7 @@ ft_merge_child(
// If we didn't merge the nodes, then we need the correct pivot.
invariant_notnull(splitk.data);
node->pivotkeys.replace_at(&splitk, childnuma);
- node->dirty = 1;
+ node->set_dirty();
}
toku_destroy_dbt(&splitk);
}
@@ -1369,7 +1369,7 @@ ft_merge_child(
call_flusher_thread_callback(ft_flush_aflter_merge);
// unlock the parent
- paranoid_invariant(node->dirty);
+ paranoid_invariant(node->dirty());
toku_unpin_ftnode(ft, node);
}
else {
@@ -1377,7 +1377,7 @@ ft_merge_child(
call_flusher_thread_callback(ft_flush_aflter_rebalance);
// unlock the parent
- paranoid_invariant(node->dirty);
+ paranoid_invariant(node->dirty());
toku_unpin_ftnode(ft, node);
toku_unpin_ftnode(ft, childb);
}
@@ -1439,9 +1439,9 @@ void toku_ft_flush_some_child(FT ft, FTNODE parent, struct flusher_advice *fa)
// only do the following work if there is a flush to perform
if (toku_bnc_n_entries(BNC(parent, childnum)) > 0 || parent->height == 1) {
- if (!parent->dirty) {
+ if (!parent->dirty()) {
dirtied++;
- parent->dirty = 1;
+ parent->set_dirty();
}
// detach buffer
BP_WORKDONE(parent, childnum) = 0; // this buffer is drained, no work has been done by its contents
@@ -1486,9 +1486,9 @@ void toku_ft_flush_some_child(FT ft, FTNODE parent, struct flusher_advice *fa)
// in the buffer to flush, and as a result, flushing is not necessary
// and bnc is NULL
if (bnc != NULL) {
- if (!child->dirty) {
+ if (!child->dirty()) {
dirtied++;
- child->dirty = 1;
+ child->set_dirty();
}
// do the actual flush
toku_bnc_flush_to_child(
@@ -1787,7 +1787,7 @@ static void flush_node_fun(void *fe_v)
// read them back in, or just do the regular partial fetch. If we
// don't, that means fe->node is a parent, so we need to do this anyway.
bring_node_fully_into_memory(fe->node,fe->ft);
- fe->node->dirty = 1;
+ fe->node->set_dirty();
struct flusher_advice fa;
struct flush_status_update_extra fste;
@@ -1893,7 +1893,7 @@ void toku_ft_flush_node_on_background_thread(FT ft, FTNODE parent)
//
// can detach buffer and unpin root here
//
- parent->dirty = 1;
+ parent->set_dirty();
BP_WORKDONE(parent, childnum) = 0; // this buffer is drained, no work has been done by its contents
NONLEAF_CHILDINFO bnc = BNC(parent, childnum);
NONLEAF_CHILDINFO new_bnc = toku_create_empty_nl();
diff --git a/storage/tokudb/PerconaFT/ft/ft-internal.h b/storage/tokudb/PerconaFT/ft/ft-internal.h
index eec591d1744..130d3c302aa 100644
--- a/storage/tokudb/PerconaFT/ft/ft-internal.h
+++ b/storage/tokudb/PerconaFT/ft/ft-internal.h
@@ -76,11 +76,30 @@ enum ft_type {
FT_CHECKPOINT_INPROGRESS
};
+extern "C" {
+extern uint force_recovery;
+}
+
+extern int writing_rollback;
+
// The ft_header is not managed by the cachetable. Instead, it hangs off the cachefile as userdata.
struct ft_header {
enum ft_type type;
- int dirty;
+ int dirty_;
+
+ void set_dirty() {
+ if(force_recovery) assert(writing_rollback);
+ dirty_ = 1;
+ }
+
+ void clear_dirty() {
+ dirty_ = 0;
+ }
+
+ bool dirty() {
+ return dirty_;
+ }
// Free-running counter incremented once per checkpoint (toggling LSB).
// LSB indicates which header location is used on disk so this
diff --git a/storage/tokudb/PerconaFT/ft/ft-ops.cc b/storage/tokudb/PerconaFT/ft/ft-ops.cc
index df0d88a9580..d752f13c9c3 100644
--- a/storage/tokudb/PerconaFT/ft/ft-ops.cc
+++ b/storage/tokudb/PerconaFT/ft/ft-ops.cc
@@ -656,7 +656,7 @@ void toku_ftnode_clone_callback(void *value_data,
node->layout_version_read_from_disk;
cloned_node->build_id = node->build_id;
cloned_node->height = node->height;
- cloned_node->dirty = node->dirty;
+ cloned_node->dirty_ = node->dirty_;
cloned_node->fullhash = node->fullhash;
cloned_node->n_children = node->n_children;
@@ -672,8 +672,8 @@ void toku_ftnode_clone_callback(void *value_data,
toku_ftnode_clone_partitions(node, cloned_node);
// clear dirty bit
- node->dirty = 0;
- cloned_node->dirty = 0;
+ node->clear_dirty();
+ cloned_node->clear_dirty();
node->layout_version_read_from_disk = FT_LAYOUT_VERSION;
// set new pair attr if necessary
if (node->height == 0) {
@@ -742,7 +742,7 @@ void toku_ftnode_flush_callback(CACHEFILE UU(cachefile),
// persisted, we need undo the logical row count adjustments as
// they may occur again in the future if/when the node is
// re-read from disk for another query or change.
- if (!ftnode->dirty && !write_me) {
+ if (!ftnode->dirty() && !write_me) {
int64_t lrc_delta = 0;
for (int i = 0; i < ftnode->n_children; i++) {
if (BP_STATE(ftnode, i) == PT_AVAIL) {
@@ -847,8 +847,8 @@ int toku_ftnode_fetch_callback(CACHEFILE UU(cachefile),
if (r == 0) {
*sizep = make_ftnode_pair_attr(*node);
(*node)->ct_pair = p;
- *dirtyp = (*node)->dirty; // deserialize could mark the node as dirty
- // (presumably for upgrade)
+ *dirtyp = (*node)->dirty(); // deserialize could mark the node as dirty
+ // (presumably for upgrade)
}
return r;
}
@@ -870,7 +870,7 @@ void toku_ftnode_pe_est_callback(
paranoid_invariant(ftnode_pv != NULL);
long bytes_to_free = 0;
FTNODE node = static_cast<FTNODE>(ftnode_pv);
- if (node->dirty || node->height == 0 ||
+ if (node->dirty() || node->height == 0 ||
node->layout_version_read_from_disk < FT_FIRST_LAYOUT_VERSION_WITH_BASEMENT_NODES) {
*bytes_freed_estimate = 0;
*cost = PE_CHEAP;
@@ -947,7 +947,7 @@ int toku_ftnode_pe_callback(void *ftnode_pv,
void *pointers_to_free[node->n_children * 2];
// Don't partially evict dirty nodes
- if (node->dirty) {
+ if (node->dirty()) {
goto exit;
}
// Don't partially evict nodes whose partitions can't be read back
@@ -1400,7 +1400,7 @@ ft_init_new_root(FT ft, FTNODE oldroot, FTNODE *newrootp)
MSN msna = oldroot->max_msn_applied_to_node_on_disk;
newroot->max_msn_applied_to_node_on_disk = msna;
BP_STATE(newroot,0) = PT_AVAIL;
- newroot->dirty = 1;
+ newroot->set_dirty();
// Set the first child to have the new blocknum,
// and then swap newroot with oldroot. The new root
@@ -1488,7 +1488,7 @@ static void inject_message_in_locked_node(
// mark the node as dirty.
// enforcing invariant here.
//
- paranoid_invariant(node->dirty != 0);
+ paranoid_invariant(node->dirty() != 0);
// update some status variables
if (node->height != 0) {
@@ -1848,7 +1848,7 @@ static void push_something_in_subtree(
}
}
- if (next_loc != NEITHER_EXTREME || child->dirty || toku_bnc_should_promote(ft, bnc)) {
+ if (next_loc != NEITHER_EXTREME || child->dirty() || toku_bnc_should_promote(ft, bnc)) {
push_something_in_subtree(ft, child, -1, msg, flow_deltas, gc_info, depth + 1, next_loc, false);
toku_sync_fetch_and_add(&bnc->flow[0], flow_deltas[0]);
// The recursive call unpinned the child, but
@@ -2803,9 +2803,9 @@ static int ft_create_file(FT_HANDLE UU(ft_handle), const char *fname, int *fdp)
}
// open a file for use by the ft. if the file does not exist, error
-static int ft_open_file(const char *fname, int *fdp) {
+static int ft_open_file(const char *fname, int *fdp, bool rw) {
int fd;
- fd = ft_open_maybe_direct(fname, O_RDWR | O_BINARY, file_mode);
+ fd = ft_open_maybe_direct(fname, (rw ? O_RDWR : O_RDONLY) | O_BINARY, file_mode);
if (fd==-1) {
return get_error_errno();
}
@@ -2956,7 +2956,7 @@ toku_ft_handle_inherit_options(FT_HANDLE t, FT ft) {
// The checkpointed version (checkpoint_lsn) of the dictionary must be no later than max_acceptable_lsn .
// Requires: The multi-operation client lock must be held to prevent a checkpoint from occuring.
static int
-ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only_create, CACHETABLE cachetable, TOKUTXN txn, FILENUM use_filenum, DICTIONARY_ID use_dictionary_id, LSN max_acceptable_lsn) {
+ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only_create, CACHETABLE cachetable, TOKUTXN txn, FILENUM use_filenum, DICTIONARY_ID use_dictionary_id, LSN max_acceptable_lsn, bool open_rw = true) {
int r;
bool txn_created = false;
char *fname_in_cwd = NULL;
@@ -2978,7 +2978,7 @@ ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only
fname_in_cwd = toku_cachetable_get_fname_in_cwd(cachetable, fname_in_env);
{
int fd = -1;
- r = ft_open_file(fname_in_cwd, &fd);
+ r = ft_open_file(fname_in_cwd, &fd, open_rw);
if (reserved_filenum.fileid == FILENUM_NONE.fileid) {
reserved_filenum = toku_cachetable_reserve_filenum(cachetable);
}
@@ -3124,15 +3124,15 @@ toku_ft_handle_open_recovery(FT_HANDLE t, const char *fname_in_env, int is_creat
// Open an ft in normal use. The FILENUM and dict_id are assigned by the ft_handle_open() function.
// Requires: The multi-operation client lock must be held to prevent a checkpoint from occuring.
int
-toku_ft_handle_open(FT_HANDLE t, const char *fname_in_env, int is_create, int only_create, CACHETABLE cachetable, TOKUTXN txn) {
+toku_ft_handle_open(FT_HANDLE t, const char *fname_in_env, int is_create, int only_create, CACHETABLE cachetable, TOKUTXN txn, bool open_rw) {
int r;
- r = ft_handle_open(t, fname_in_env, is_create, only_create, cachetable, txn, FILENUM_NONE, DICTIONARY_ID_NONE, MAX_LSN);
+ r = ft_handle_open(t, fname_in_env, is_create, only_create, cachetable, txn, FILENUM_NONE, DICTIONARY_ID_NONE, MAX_LSN, open_rw);
return r;
}
// clone an ft handle. the cloned handle has a new dict_id but refers to the same fractal tree
int
-toku_ft_handle_clone(FT_HANDLE *cloned_ft_handle, FT_HANDLE ft_handle, TOKUTXN txn) {
+toku_ft_handle_clone(FT_HANDLE *cloned_ft_handle, FT_HANDLE ft_handle, TOKUTXN txn, bool open_rw) {
FT_HANDLE result_ft_handle;
toku_ft_handle_create(&result_ft_handle);
@@ -3147,7 +3147,7 @@ toku_ft_handle_clone(FT_HANDLE *cloned_ft_handle, FT_HANDLE ft_handle, TOKUTXN t
CACHEFILE cf = ft_handle->ft->cf;
CACHETABLE ct = toku_cachefile_get_cachetable(cf);
const char *fname_in_env = toku_cachefile_fname_in_env(cf);
- int r = toku_ft_handle_open(result_ft_handle, fname_in_env, false, false, ct, txn);
+ int r = toku_ft_handle_open(result_ft_handle, fname_in_env, false, false, ct, txn, open_rw);
if (r != 0) {
toku_ft_handle_close(result_ft_handle);
result_ft_handle = NULL;
@@ -3548,7 +3548,7 @@ unlock_ftnode_fun (void *v) {
int r = toku_cachetable_unpin_ct_prelocked_no_flush(
ft_handle->ft->cf,
node->ct_pair,
- (enum cachetable_dirty) node->dirty,
+ (enum cachetable_dirty) node->dirty(),
x->msgs_applied ? make_ftnode_pair_attr(node) : make_invalid_pair_attr()
);
assert_zero(r);
@@ -4970,6 +4970,14 @@ static void toku_pfs_keys_destroy(void) {
}
int toku_ft_layer_init(void) {
+ static bool ft_layer_init_started = false;
+
+ if(ft_layer_init_started) {
+ return 0;
+ }
+
+ ft_layer_init_started = true;
+
int r = 0;
// Portability must be initialized first
@@ -5000,6 +5008,14 @@ exit:
}
void toku_ft_layer_destroy(void) {
+ static bool ft_layer_destroy_started = false;
+
+ if(ft_layer_destroy_started) {
+ return;
+ }
+
+ ft_layer_destroy_started = true;
+
toku_mutex_destroy(&ft_open_close_lock);
toku_ft_serialize_layer_destroy();
toku_checkpoint_destroy();
diff --git a/storage/tokudb/PerconaFT/ft/ft-ops.h b/storage/tokudb/PerconaFT/ft/ft-ops.h
index df8ffe287df..7b6d0634c37 100644
--- a/storage/tokudb/PerconaFT/ft/ft-ops.h
+++ b/storage/tokudb/PerconaFT/ft/ft-ops.h
@@ -125,12 +125,12 @@ typedef int (*ft_update_func)(DB *db, const DBT *key, const DBT *old_val, const
void toku_ft_set_update(FT_HANDLE ft_h, ft_update_func update_fun);
int toku_ft_handle_open(FT_HANDLE, const char *fname_in_env,
- int is_create, int only_create, CACHETABLE ct, TOKUTXN txn) __attribute__ ((warn_unused_result));
+ int is_create, int only_create, CACHETABLE ct, TOKUTXN txn, bool open_rw=true) __attribute__ ((warn_unused_result));
int toku_ft_handle_open_recovery(FT_HANDLE, const char *fname_in_env, int is_create, int only_create, CACHETABLE ct, TOKUTXN txn,
FILENUM use_filenum, LSN max_acceptable_lsn) __attribute__ ((warn_unused_result));
// clone an ft handle. the cloned handle has a new dict_id but refers to the same fractal tree
-int toku_ft_handle_clone(FT_HANDLE *cloned_ft_handle, FT_HANDLE ft_handle, TOKUTXN txn);
+int toku_ft_handle_clone(FT_HANDLE *cloned_ft_handle, FT_HANDLE ft_handle, TOKUTXN txn, bool open_rw=true);
// close an ft handle during normal operation. the underlying ft may or may not close,
// depending if there are still references. an lsn for this close will come from the logger.
diff --git a/storage/tokudb/PerconaFT/ft/ft-recount-rows.cc b/storage/tokudb/PerconaFT/ft/ft-recount-rows.cc
index e31d80772d5..3b5501b66d3 100644
--- a/storage/tokudb/PerconaFT/ft/ft-recount-rows.cc
+++ b/storage/tokudb/PerconaFT/ft/ft-recount-rows.cc
@@ -98,7 +98,7 @@ int toku_ft_recount_rows(FT_HANDLE ft,
if (rre._cancelled == false) {
// update ft count
toku_unsafe_set(&ft->ft->in_memory_logical_rows, rre._keys);
- ft->ft->h->dirty = 1;
+ ft->ft->h->set_dirty();
ret = 0;
}
diff --git a/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc b/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc
index a82d8a80718..ad1dda01760 100644
--- a/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc
+++ b/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc
@@ -259,7 +259,7 @@ int toku_testsetup_insert_to_nonleaf (FT_HANDLE ft_handle, BLOCKNUM blocknum, en
// is directly queueing something in a FIFO instead of
// using ft APIs.
node->max_msn_applied_to_node_on_disk = msn;
- node->dirty = 1;
+ node->set_dirty();
// Also hack max_msn_in_ft
ft_handle->ft->h->max_msn_in_ft = msn;
diff --git a/storage/tokudb/PerconaFT/ft/ft-verify.cc b/storage/tokudb/PerconaFT/ft/ft-verify.cc
index 7e3a64f441e..4f6e07e61f2 100644
--- a/storage/tokudb/PerconaFT/ft/ft-verify.cc
+++ b/storage/tokudb/PerconaFT/ft/ft-verify.cc
@@ -512,7 +512,7 @@ toku_verify_ft_with_progress (FT_HANDLE ft_handle, int (*progress_callback)(void
if (r == 0) {
toku_ft_lock(ft_handle->ft);
ft_handle->ft->h->time_of_last_verification = time(NULL);
- ft_handle->ft->h->dirty = 1;
+ ft_handle->ft->h->set_dirty();
toku_ft_unlock(ft_handle->ft);
}
return r;
diff --git a/storage/tokudb/PerconaFT/ft/ft.cc b/storage/tokudb/PerconaFT/ft/ft.cc
index c7c2ea33c9e..1106abfbfb4 100644
--- a/storage/tokudb/PerconaFT/ft/ft.cc
+++ b/storage/tokudb/PerconaFT/ft/ft.cc
@@ -61,7 +61,7 @@ void toku_reset_root_xid_that_created(FT ft, TXNID new_root_xid_that_created) {
// (see cooperative use of dirty bit in ft_begin_checkpoint())
toku_ft_lock(ft);
ft->h->root_xid_that_created = new_root_xid_that_created;
- ft->h->dirty = 1;
+ ft->h->set_dirty();
toku_ft_unlock(ft);
}
@@ -147,7 +147,7 @@ static void ft_begin_checkpoint (LSN checkpoint_lsn, void *header_v) {
assert(ft->h->type == FT_CURRENT);
assert(ft->checkpoint_header == NULL);
ft_copy_for_checkpoint_unlocked(ft, checkpoint_lsn);
- ft->h->dirty = 0; // this is only place this bit is cleared (in currentheader)
+ ft->h->clear_dirty(); // this is only place this bit is cleared (in currentheader)
ft->blocktable.note_start_checkpoint_unlocked();
toku_ft_unlock (ft);
}
@@ -186,7 +186,7 @@ static void ft_checkpoint (CACHEFILE cf, int fd, void *header_v) {
FT_HEADER ch = ft->checkpoint_header;
assert(ch);
assert(ch->type == FT_CHECKPOINT_INPROGRESS);
- if (ch->dirty) { // this is only place this bit is tested (in checkpoint_header)
+ if (ch->dirty()) { // this is only place this bit is tested (in checkpoint_header)
TOKULOGGER logger = toku_cachefile_logger(cf);
if (logger) {
toku_logger_fsync_if_lsn_not_fsynced(logger, ch->checkpoint_lsn);
@@ -201,7 +201,7 @@ static void ft_checkpoint (CACHEFILE cf, int fd, void *header_v) {
// write translation and header to disk (or at least to OS internal buffer)
toku_serialize_ft_to(fd, ch, &ft->blocktable, ft->cf);
- ch->dirty = 0; // this is only place this bit is cleared (in checkpoint_header)
+ ch->clear_dirty(); // this is only place this bit is cleared (in checkpoint_header)
// fsync the cachefile
toku_cachefile_fsync(cf);
@@ -255,7 +255,7 @@ static void ft_close(CACHEFILE cachefile, int fd, void *header_v, bool oplsn_val
toku_log_fclose(
logger,
&lsn,
- ft->h->dirty,
+ ft->h->dirty(),
bs,
toku_cachefile_filenum(cachefile)); // flush the log on
// close (if new header
@@ -266,7 +266,7 @@ static void ft_close(CACHEFILE cachefile, int fd, void *header_v, bool oplsn_val
}
}
}
- if (ft->h->dirty) { // this is the only place this bit is tested (in currentheader)
+ if (ft->h->dirty()) { // this is the only place this bit is tested (in currentheader)
bool do_checkpoint = true;
if (logger && logger->rollback_cachefile == cachefile) {
do_checkpoint = false;
@@ -275,7 +275,7 @@ static void ft_close(CACHEFILE cachefile, int fd, void *header_v, bool oplsn_val
ft_begin_checkpoint(lsn, header_v);
ft_checkpoint(cachefile, fd, ft);
ft_end_checkpoint(cachefile, fd, header_v);
- assert(!ft->h->dirty); // dirty bit should be cleared by begin_checkpoint and never set again (because we're closing the dictionary)
+ assert(!ft->h->dirty()); // dirty bit should be cleared by begin_checkpoint and never set again (because we're closing the dictionary)
}
}
}
@@ -371,7 +371,7 @@ ft_header_create(FT_OPTIONS options, BLOCKNUM root_blocknum, TXNID root_xid_that
uint64_t now = (uint64_t) time(NULL);
struct ft_header h = {
.type = FT_CURRENT,
- .dirty = 0,
+ .dirty_ = 0,
.checkpoint_count = 0,
.checkpoint_lsn = ZERO_LSN,
.layout_version = FT_LAYOUT_VERSION,
@@ -522,7 +522,7 @@ toku_ft_note_hot_begin(FT_HANDLE ft_handle) {
toku_ft_lock(ft);
ft->h->time_of_last_optimize_begin = now;
ft->h->count_of_optimize_in_progress++;
- ft->h->dirty = 1;
+ ft->h->set_dirty();
toku_ft_unlock(ft);
}
@@ -546,7 +546,7 @@ toku_ft_note_hot_complete(FT_HANDLE ft_handle, bool success, MSN msn_at_start_of
if (ft->h->count_of_optimize_in_progress == ft->h->count_of_optimize_in_progress_read_from_disk)
ft->h->count_of_optimize_in_progress = 0;
}
- ft->h->dirty = 1;
+ ft->h->set_dirty();
toku_ft_unlock(ft);
}
@@ -959,7 +959,7 @@ void toku_ft_remove_reference(
void toku_ft_set_nodesize(FT ft, unsigned int nodesize) {
toku_ft_lock(ft);
ft->h->nodesize = nodesize;
- ft->h->dirty = 1;
+ ft->h->set_dirty();
toku_ft_unlock(ft);
}
@@ -972,7 +972,7 @@ void toku_ft_get_nodesize(FT ft, unsigned int *nodesize) {
void toku_ft_set_basementnodesize(FT ft, unsigned int basementnodesize) {
toku_ft_lock(ft);
ft->h->basementnodesize = basementnodesize;
- ft->h->dirty = 1;
+ ft->h->set_dirty();
toku_ft_unlock(ft);
}
@@ -985,7 +985,7 @@ void toku_ft_get_basementnodesize(FT ft, unsigned int *basementnodesize) {
void toku_ft_set_compression_method(FT ft, enum toku_compression_method method) {
toku_ft_lock(ft);
ft->h->compression_method = method;
- ft->h->dirty = 1;
+ ft->h->set_dirty();
toku_ft_unlock(ft);
}
@@ -998,7 +998,7 @@ void toku_ft_get_compression_method(FT ft, enum toku_compression_method *methodp
void toku_ft_set_fanout(FT ft, unsigned int fanout) {
toku_ft_lock(ft);
ft->h->fanout = fanout;
- ft->h->dirty = 1;
+ ft->h->set_dirty();
toku_ft_unlock(ft);
}
diff --git a/storage/tokudb/PerconaFT/ft/ft.h b/storage/tokudb/PerconaFT/ft/ft.h
index ff0b63b2b12..5c6caead978 100644
--- a/storage/tokudb/PerconaFT/ft/ft.h
+++ b/storage/tokudb/PerconaFT/ft/ft.h
@@ -184,11 +184,11 @@ void tokuft_update_product_name_strings(void);
extern char toku_product_name[TOKU_MAX_PRODUCT_NAME_LENGTH];
struct toku_product_name_strings_struct {
- char db_version[sizeof(toku_product_name) + sizeof("1.2.3 build ") + 256];
- char environmentdictionary[sizeof(toku_product_name) + sizeof(".environment")];
- char fileopsdirectory[sizeof(toku_product_name) + sizeof(".directory")];
- char single_process_lock[sizeof(toku_product_name) + sizeof("___lock_dont_delete_me")];
- char rollback_cachefile[sizeof(toku_product_name) + sizeof(".rollback")];
+ char db_version[sizeof(toku_product_name) + sizeof("1.2.3 build ") + 256 + 1];
+ char environmentdictionary[sizeof(toku_product_name) + sizeof(".environment") + 1];
+ char fileopsdirectory[sizeof(toku_product_name) + sizeof(".directory") + 1];
+ char single_process_lock[sizeof(toku_product_name) + sizeof("___lock_dont_delete_me") + 1];
+ char rollback_cachefile[sizeof(toku_product_name) + sizeof(".rollback") + 1];
};
extern struct toku_product_name_strings_struct toku_product_name_strings;
diff --git a/storage/tokudb/PerconaFT/ft/loader/loader.cc b/storage/tokudb/PerconaFT/ft/loader/loader.cc
index 5f57b473bc5..3ff237f05c7 100644
--- a/storage/tokudb/PerconaFT/ft/loader/loader.cc
+++ b/storage/tokudb/PerconaFT/ft/loader/loader.cc
@@ -1350,7 +1350,7 @@ int merge_row_arrays_base (struct row dest[/*an+bn*/], struct row a[/*an*/], int
* Arguments:
* dest write the rows here
* a,b the rows being merged
- * an,bn the lenth of a and b respectively.
+ * an,bn the length of a and b respectively.
* dest_db We need the dest_db to run the comparison function.
* compare We need the compare function for the dest_db.
*/
@@ -1449,7 +1449,7 @@ static int merge_row_arrays (struct row dest[/*an+bn*/], struct row a[/*an*/], i
* Arguments:
* dest write the rows here
* a,b the rows being merged
- * an,bn the lenth of a and b respectively.
+ * an,bn the length of a and b respectively.
* dest_db We need the dest_db to run the comparison function.
* compare We need the compare function for the dest_db.
*/
diff --git a/storage/tokudb/PerconaFT/ft/logger/logger.cc b/storage/tokudb/PerconaFT/ft/logger/logger.cc
index 9516f46df28..d66a1deecf9 100644
--- a/storage/tokudb/PerconaFT/ft/logger/logger.cc
+++ b/storage/tokudb/PerconaFT/ft/logger/logger.cc
@@ -50,6 +50,8 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
#include "util/status.h"
+int writing_rollback = 0;
+
static const int log_format_version = TOKU_LOG_VERSION;
toku_instr_key *result_output_condition_lock_mutex_key;
@@ -232,6 +234,7 @@ void toku_logger_initialize_rollback_cache(TOKULOGGER logger, FT ft) {
}
int toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, bool create) {
+ writing_rollback++;
assert(logger->is_open);
assert(!logger->rollback_cachefile);
@@ -251,6 +254,7 @@ int toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, bool cre
} else {
toku_ft_handle_close(ft_handle);
}
+ writing_rollback--;
return r;
}
@@ -268,20 +272,20 @@ void toku_logger_close_rollback_check_empty(TOKULOGGER logger, bool clean_shutdo
FT CAST_FROM_VOIDP(ft, toku_cachefile_get_userdata(cf));
if (clean_shutdown) {
//Verify it is safe to close it.
- assert(!ft->h->dirty); //Must not be dirty.
+ assert(!ft->h->dirty()); //Must not be dirty.
ft->blocktable.free_unused_blocknums(ft->h->root_blocknum);
// Must have no data blocks (rollback logs or otherwise).
ft->blocktable.verify_no_data_blocks_except_root(ft->h->root_blocknum);
- assert(!ft->h->dirty);
+ assert(!ft->h->dirty());
} else {
- ft->h->dirty = 0;
+ ft->h->clear_dirty();
}
ft_to_close = toku_ft_get_only_existing_ft_handle(ft);
if (clean_shutdown) {
bool is_empty;
is_empty = toku_ft_is_empty_fast(ft_to_close);
assert(is_empty);
- assert(!ft->h->dirty); // it should not have been dirtied by the toku_ft_is_empty test.
+ assert(!ft->h->dirty()); // it should not have been dirtied by the toku_ft_is_empty test.
}
}
diff --git a/storage/tokudb/PerconaFT/ft/node.cc b/storage/tokudb/PerconaFT/ft/node.cc
index 8db2f895033..88f46c7812b 100644
--- a/storage/tokudb/PerconaFT/ft/node.cc
+++ b/storage/tokudb/PerconaFT/ft/node.cc
@@ -78,7 +78,7 @@ void toku_initialize_empty_ftnode(FTNODE n, BLOCKNUM blocknum, int height, int n
}
}
}
- n->dirty = 1; // special case exception, it's okay to mark as dirty because the basements are empty
+ n->set_dirty(); // special case exception, it's okay to mark as dirty because the basements are empty
toku_ft_status_note_ftnode(height, true);
}
@@ -154,7 +154,7 @@ void toku_ftnode_clone_partitions(FTNODE node, FTNODE cloned_node) {
void toku_evict_bn_from_memory(FTNODE node, int childnum, FT ft) {
// free the basement node
- assert(!node->dirty);
+ assert(!node->dirty());
BASEMENTNODE bn = BLB(node, childnum);
toku_ft_decrease_stats(&ft->in_memory_stats, bn->stat64_delta);
toku_ft_adjust_logical_row_count(ft, -BLB_LRD(node, childnum));
@@ -596,7 +596,7 @@ toku_apply_ancestors_messages_to_node (
oldest_referenced_xid_for_simple_gc,
node->oldest_referenced_xid_known,
true);
- if (!node->dirty && child_to_read >= 0) {
+ if (!node->dirty() && child_to_read >= 0) {
paranoid_invariant(BP_STATE(node, child_to_read) == PT_AVAIL);
apply_ancestors_messages_to_bn(
t,
@@ -713,7 +713,7 @@ bool toku_ft_leaf_needs_ancestors_messages(
paranoid_invariant(node->height == 0);
bool needs_ancestors_messages = false;
// child_to_read may be -1 in test cases
- if (!node->dirty && child_to_read >= 0) {
+ if (!node->dirty() && child_to_read >= 0) {
paranoid_invariant(BP_STATE(node, child_to_read) == PT_AVAIL);
needs_ancestors_messages = bn_needs_ancestors_messages(
ft,
@@ -746,7 +746,7 @@ cleanup:
void toku_ft_bn_update_max_msn(FTNODE node, MSN max_msn_applied, int child_to_read) {
invariant(node->height == 0);
- if (!node->dirty && child_to_read >= 0) {
+ if (!node->dirty() && child_to_read >= 0) {
paranoid_invariant(BP_STATE(node, child_to_read) == PT_AVAIL);
BASEMENTNODE bn = BLB(node, child_to_read);
if (max_msn_applied.msn > bn->max_msn_applied.msn) {
@@ -833,7 +833,7 @@ struct rebalance_array_info {
void toku_ftnode_leaf_rebalance(FTNODE node, unsigned int basementnodesize) {
assert(node->height == 0);
- assert(node->dirty);
+ assert(node->dirty());
uint32_t num_orig_basements = node->n_children;
// Count number of leaf entries in this leaf (num_le).
@@ -1142,7 +1142,7 @@ void toku_ft_nonleaf_append_child(FTNODE node, FTNODE child, const DBT *pivotkey
invariant(childnum > 0);
node->pivotkeys.insert_at(pivotkey, childnum - 1);
}
- node->dirty = 1;
+ node->set_dirty();
}
void
@@ -1745,7 +1745,7 @@ static void ft_append_msg_to_child_buffer(const toku::comparator &cmp, FTNODE no
int childnum, const ft_msg &msg, bool is_fresh) {
paranoid_invariant(BP_STATE(node,childnum) == PT_AVAIL);
bnc_insert_msg(BNC(node, childnum), msg, is_fresh, cmp);
- node->dirty = 1;
+ node->set_dirty();
}
// This is only exported for tests.
@@ -2090,7 +2090,7 @@ void toku_ft_leaf_apply_msg(
// be reapplied later), we mark the node as dirty and
// take the opportunity to update node->max_msn_applied_to_node_on_disk.
//
- node->dirty = 1;
+ node->set_dirty();
//
// we cannot blindly update node->max_msn_applied_to_node_on_disk,
diff --git a/storage/tokudb/PerconaFT/ft/node.h b/storage/tokudb/PerconaFT/ft/node.h
index 05c8a44ebed..61093f3ed8d 100644
--- a/storage/tokudb/PerconaFT/ft/node.h
+++ b/storage/tokudb/PerconaFT/ft/node.h
@@ -155,6 +155,12 @@ private:
size_t _total_size;
};
+extern int writing_rollback;
+
+extern "C" {
+extern uint force_recovery;
+}
+
// TODO: class me up
struct ftnode {
// max_msn_applied that will be written to disk
@@ -173,9 +179,22 @@ struct ftnode {
uint32_t build_id;
// height is always >= 0. 0 for leaf, >0 for nonleaf.
int height;
- int dirty;
+ int dirty_;
uint32_t fullhash;
+ void set_dirty() {
+ if(force_recovery) assert(writing_rollback);
+ dirty_ = 1;
+ }
+
+ void clear_dirty() {
+ dirty_ = 0;
+ }
+
+ bool dirty() {
+ return dirty_;
+ }
+
// for internal nodes, if n_children==fanout+1 then the tree needs to be
// rebalanced. for leaf nodes, represents number of basement nodes
int n_children;
diff --git a/storage/tokudb/PerconaFT/ft/serialize/block_table.cc b/storage/tokudb/PerconaFT/ft/serialize/block_table.cc
index 811f86c30a7..e3606c11294 100644
--- a/storage/tokudb/PerconaFT/ft/serialize/block_table.cc
+++ b/storage/tokudb/PerconaFT/ft/serialize/block_table.cc
@@ -196,9 +196,9 @@ static void ft_set_dirty(FT ft, bool for_checkpoint) {
invariant(ft->h->type == FT_CURRENT);
if (for_checkpoint) {
invariant(ft->checkpoint_header->type == FT_CHECKPOINT_INPROGRESS);
- ft->checkpoint_header->dirty = 1;
+ ft->checkpoint_header->set_dirty();
} else {
- ft->h->dirty = 1;
+ ft->h->set_dirty();
}
}
diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft-node-deserialize.cc b/storage/tokudb/PerconaFT/ft/serialize/ft-node-deserialize.cc
index 02a9dfd085c..de58fb42a8b 100644
--- a/storage/tokudb/PerconaFT/ft/serialize/ft-node-deserialize.cc
+++ b/storage/tokudb/PerconaFT/ft/serialize/ft-node-deserialize.cc
@@ -60,7 +60,7 @@ initialize_ftnode(FTNODE node, BLOCKNUM blocknum)
{
node->fullhash = 0xDEADBEEF; // <CER> Is this 'spoof' ok?
node->blocknum = blocknum;
- node->dirty = 0;
+ node->clear_dirty();
node->bp = NULL;
// <CER> Can we use this initialization as a correctness assert in
// a later function?
diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc b/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc
index 0d6573972d7..0813855bf55 100644
--- a/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc
+++ b/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc
@@ -340,7 +340,7 @@ int deserialize_ft_versioned(int fd, struct rbuf *rb, FT *ftp, uint32_t version)
{
struct ft_header h = {
.type = FT_CURRENT,
- .dirty = 0,
+ .dirty_ = 0,
.checkpoint_count = checkpoint_count,
.checkpoint_lsn = checkpoint_lsn,
.layout_version = FT_LAYOUT_VERSION,
diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc b/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc
index f3b31eb31be..e6648b76bf0 100644
--- a/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc
+++ b/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc
@@ -827,7 +827,7 @@ int toku_serialize_ftnode_to(int fd,
node, n_uncompressed_bytes, n_to_write, io_time, for_checkpoint);
toku_free(compressed_buf);
- node->dirty = 0; // See #1957. Must set the node to be clean after
+ node->clear_dirty(); // See #1957. Must set the node to be clean after
// serializing it so that it doesn't get written again on
// the next checkpoint or eviction.
if (node->height == 0) {
@@ -1544,7 +1544,7 @@ static FTNODE alloc_ftnode_for_deserialize(uint32_t fullhash, BLOCKNUM blocknum)
FTNODE XMALLOC(node);
node->fullhash = fullhash;
node->blocknum = blocknum;
- node->dirty = 0;
+ node->clear_dirty();
node->oldest_referenced_xid_known = TXNID_NONE;
node->bp = nullptr;
node->ct_pair = nullptr;
@@ -1951,7 +1951,7 @@ static int deserialize_and_upgrade_internal_node(FTNODE node,
// Assign the highest msn from our upgrade message buffers
node->max_msn_applied_to_node_on_disk = highest_msn;
// Since we assigned MSNs to this node's messages, we need to dirty it.
- node->dirty = 1;
+ node->set_dirty();
// Must compute the checksum now (rather than at the end, while we
// still have the pointer to the buffer).
@@ -2908,9 +2908,9 @@ int toku_serialize_rollback_log_to(int fd,
toku_free(compressed_buf);
if (!is_serialized) {
toku_static_serialized_rollback_log_destroy(&serialized_local);
- log->dirty = 0; // See #1957. Must set the node to be clean after
- // serializing it so that it doesn't get written again
- // on the next checkpoint or eviction.
+ log->dirty = false; // See #1957. Must set the node to be clean after
+ // serializing it so that it doesn't get written again
+ // on the next checkpoint or eviction.
}
return 0;
}
diff --git a/storage/tokudb/PerconaFT/ft/txn/rollback.cc b/storage/tokudb/PerconaFT/ft/txn/rollback.cc
index 0c793842f3c..105f980dc0d 100644
--- a/storage/tokudb/PerconaFT/ft/txn/rollback.cc
+++ b/storage/tokudb/PerconaFT/ft/txn/rollback.cc
@@ -43,6 +43,8 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
#include "ft/logger/log-internal.h"
#include "ft/txn/rollback-ct-callbacks.h"
+extern int writing_rollback;
+
static void rollback_unpin_remove_callback(CACHEKEY* cachekey, bool for_checkpoint, void* extra) {
FT CAST_FROM_VOIDP(ft, extra);
ft->blocktable.free_blocknum(cachekey, ft, for_checkpoint);
@@ -155,6 +157,7 @@ static void rollback_log_create (
ROLLBACK_LOG_NODE *result
)
{
+ writing_rollback++;
ROLLBACK_LOG_NODE XMALLOC(log);
rollback_empty_log_init(log);
@@ -169,6 +172,7 @@ static void rollback_log_create (
get_write_callbacks_for_rollback_log(ft),
toku_rollback_node_save_ct_pair);
txn->roll_info.current_rollback = log->blocknum;
+ writing_rollback --;
}
void toku_rollback_log_unpin(TOKUTXN txn, ROLLBACK_LOG_NODE log) {
diff --git a/storage/tokudb/PerconaFT/ft/txn/txn.cc b/storage/tokudb/PerconaFT/ft/txn/txn.cc
index 7327cbd9d24..7152833d88d 100644
--- a/storage/tokudb/PerconaFT/ft/txn/txn.cc
+++ b/storage/tokudb/PerconaFT/ft/txn/txn.cc
@@ -723,7 +723,11 @@ time_t toku_txn_get_start_time(struct tokutxn *txn) {
return txn->start_time;
}
+extern uint force_recovery;
int toku_txn_reads_txnid(TXNID txnid, TOKUTXN txn, bool is_provisional UU()) {
+ if(force_recovery) {
+ return TOKUDB_ACCEPT;
+ }
int r = 0;
TXNID oldest_live_in_snapshot = toku_get_oldest_in_live_root_txn_list(txn);
if (oldest_live_in_snapshot == TXNID_NONE && txnid < txn->snapshot_txnid64) {
diff --git a/storage/tokudb/PerconaFT/portability/toku_instr_mysql.cc b/storage/tokudb/PerconaFT/portability/toku_instr_mysql.cc
index 786a6ef0546..0f287429542 100644
--- a/storage/tokudb/PerconaFT/portability/toku_instr_mysql.cc
+++ b/storage/tokudb/PerconaFT/portability/toku_instr_mysql.cc
@@ -359,7 +359,16 @@ void toku_instr_rwlock_wrlock_wait_end(
void toku_instr_rwlock_unlock(toku_pthread_rwlock_t &rwlock) {
if (rwlock.psi_rwlock)
+
+// Due to change introduced in e4148f2a22922687f7652c4e3d21a22da07c9e78
+// PSI rwlock version and interface changed
+// PSI_CURRENT_RWLOCK_VERSION is not defined in MySQL 5.6 and is defined
+// as 1 in 5.7 and < 8.0.17
+#if defined(PSI_CURRENT_RWLOCK_VERSION) && (PSI_CURRENT_RWLOCK_VERSION == 2)
+ PSI_RWLOCK_CALL(unlock_rwlock)(rwlock.psi_rwlock, PSI_RWLOCK_UNLOCK);
+#else
PSI_RWLOCK_CALL(unlock_rwlock)(rwlock.psi_rwlock);
+#endif
}
#endif // TOKU_MYSQL_WITH_PFS
diff --git a/storage/tokudb/PerconaFT/scripts/tokuvalgrind b/storage/tokudb/PerconaFT/scripts/tokuvalgrind
deleted file mode 120000
index 74517aa2975..00000000000
--- a/storage/tokudb/PerconaFT/scripts/tokuvalgrind
+++ /dev/null
@@ -1 +0,0 @@
-tokugrind \ No newline at end of file
diff --git a/storage/tokudb/PerconaFT/src/ydb.cc b/storage/tokudb/PerconaFT/src/ydb.cc
index 58d39c50c23..b041928b679 100644
--- a/storage/tokudb/PerconaFT/src/ydb.cc
+++ b/storage/tokudb/PerconaFT/src/ydb.cc
@@ -40,6 +40,9 @@ extern const char *toku_patent_string;
const char *toku_copyright_string = "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.";
#include <my_global.h>
+
+extern int writing_rollback;
+
#include <db.h>
#include <errno.h>
#include <string.h>
@@ -88,6 +91,10 @@ const char *toku_copyright_string = "Copyright (c) 2006, 2015, Percona and/or it
int toku_close_trace_file (void) { return 0; }
#endif
+extern "C" {
+ uint force_recovery = 0;
+}
+
// Set when env is panicked, never cleared.
static int env_is_panicked = 0;
@@ -224,6 +231,9 @@ env_fs_redzone(DB_ENV *env, uint64_t total) {
// Check the available space in the file systems used by tokuft and erect barriers when available space gets low.
static int
env_fs_poller(void *arg) {
+ if(force_recovery == 6) {
+ return 0;
+ }
DB_ENV *env = (DB_ENV *) arg;
int r;
@@ -308,6 +318,9 @@ env_fs_init(DB_ENV *env) {
// Initialize the minicron that polls file system space
static int
env_fs_init_minicron(DB_ENV *env) {
+ if(force_recovery == 6) {
+ return 0;
+ }
int r = toku_minicron_setup(&env->i->fs_poller, env->i->fs_poll_time*1000, env_fs_poller, env);
if (r == 0)
env->i->fs_poller_is_init = true;
@@ -710,7 +723,7 @@ static int validate_env(DB_ENV *env,
}
// Test for fileops directory
- if (r == 0) {
+ if (r == 0 && force_recovery != 6) {
path = toku_construct_full_name(
2, env->i->dir, toku_product_name_strings.fileopsdirectory);
assert(path);
@@ -753,7 +766,7 @@ static int validate_env(DB_ENV *env,
}
// Test for recovery log
- if ((r == 0) && (env->i->open_flags & DB_INIT_LOG)) {
+ if ((r == 0) && (env->i->open_flags & DB_INIT_LOG) && force_recovery != 6) {
// if using transactions, test for existence of log
r = ydb_recover_log_exists(env); // return 0 or ENOENT
if (expect_newenv && (r != ENOENT))
@@ -814,6 +827,27 @@ unlock_single_process(DB_ENV *env) {
// (The set of necessary files is defined in the function validate_env() above.)
static int
env_open(DB_ENV * env, const char *home, uint32_t flags, int mode) {
+
+ if(force_recovery == 6) {
+ {
+ const int len = strlen(toku_product_name_strings.rollback_cachefile);
+ toku_product_name_strings.rollback_cachefile[len] = '2';
+ toku_product_name_strings.rollback_cachefile[len+1] = 0;
+ }
+
+ {
+ const int len = strlen(toku_product_name_strings.single_process_lock);
+ toku_product_name_strings.single_process_lock[len] = '2';
+ toku_product_name_strings.single_process_lock[len+1] = 0;
+ }
+
+ {
+ const int len = strlen(toku_product_name_strings.environmentdictionary);
+ toku_product_name_strings.environmentdictionary[len] = '2';
+ toku_product_name_strings.environmentdictionary[len+1] = 0;
+ }
+ }
+
HANDLE_PANICKED_ENV(env);
int r;
bool newenv; // true iff creating a new environment
@@ -904,7 +938,7 @@ env_open(DB_ENV * env, const char *home, uint32_t flags, int mode) {
bool need_rollback_cachefile;
need_rollback_cachefile = false;
- if (flags & (DB_INIT_TXN | DB_INIT_LOG)) {
+ if (flags & (DB_INIT_TXN | DB_INIT_LOG) && force_recovery != 6) {
need_rollback_cachefile = true;
}
@@ -917,7 +951,7 @@ env_open(DB_ENV * env, const char *home, uint32_t flags, int mode) {
r = ydb_maybe_upgrade_env(env, &last_lsn_of_clean_shutdown_read_from_log, &upgrade_in_progress);
if (r!=0) goto cleanup;
- if (upgrade_in_progress) {
+ if (upgrade_in_progress || force_recovery == 6) {
// Delete old rollback file. There was a clean shutdown, so it has nothing useful,
// and there is no value in upgrading it. It is simpler to just create a new one.
char* rollback_filename = toku_construct_full_name(2, env->i->dir, toku_product_name_strings.rollback_cachefile);
@@ -935,9 +969,13 @@ env_open(DB_ENV * env, const char *home, uint32_t flags, int mode) {
unused_flags &= ~DB_INIT_TXN & ~DB_INIT_LOG;
+ if(force_recovery == 6) {
+ flags |= DB_INIT_LOG | DB_INIT_TXN;
+ }
+
// do recovery only if there exists a log and recovery is requested
// otherwise, a log is created when the logger is opened later
- if (!newenv) {
+ if (!newenv && force_recovery == 0) {
if (flags & DB_INIT_LOG) {
// the log does exist
if (flags & DB_RECOVER) {
@@ -1006,7 +1044,7 @@ env_open(DB_ENV * env, const char *home, uint32_t flags, int mode) {
assert (using_txns);
toku_logger_set_cachetable(env->i->logger, env->i->cachetable);
if (!toku_logger_rollback_is_open(env->i->logger)) {
- bool create_new_rollback_file = newenv | upgrade_in_progress;
+ bool create_new_rollback_file = newenv | upgrade_in_progress | (force_recovery == 6);
r = toku_logger_open_rollback(env->i->logger, env->i->cachetable, create_new_rollback_file);
if (r != 0) {
r = toku_ydb_do_error(env, r, "Cant open rollback\n");
@@ -1025,6 +1063,7 @@ env_open(DB_ENV * env, const char *home, uint32_t flags, int mode) {
assert_zero(r);
r = toku_db_use_builtin_key_cmp(env->i->persistent_environment);
assert_zero(r);
+ writing_rollback++;
r = toku_db_open_iname(env->i->persistent_environment, txn, toku_product_name_strings.environmentdictionary, DB_CREATE, mode);
if (r != 0) {
r = toku_ydb_do_error(env, r, "Cant open persistent env\n");
@@ -1057,6 +1096,7 @@ env_open(DB_ENV * env, const char *home, uint32_t flags, int mode) {
assert_zero(r);
}
capture_persistent_env_contents(env, txn);
+ writing_rollback--;
}
{
r = toku_db_create(&env->i->directory, env, 0);
@@ -1075,8 +1115,10 @@ env_open(DB_ENV * env, const char *home, uint32_t flags, int mode) {
txn = NULL;
}
cp = toku_cachetable_get_checkpointer(env->i->cachetable);
- r = toku_checkpoint(cp, env->i->logger, NULL, NULL, NULL, NULL, STARTUP_CHECKPOINT);
- assert_zero(r);
+ if (!force_recovery) {
+ r = toku_checkpoint(cp, env->i->logger, NULL, NULL, NULL, NULL, STARTUP_CHECKPOINT);
+ }
+ writing_rollback--;
env_fs_poller(env); // get the file system state at startup
r = env_fs_init_minicron(env);
if (r != 0) {
diff --git a/storage/tokudb/PerconaFT/src/ydb_db.cc b/storage/tokudb/PerconaFT/src/ydb_db.cc
index 6b4452325f4..8b2b162abd2 100644
--- a/storage/tokudb/PerconaFT/src/ydb_db.cc
+++ b/storage/tokudb/PerconaFT/src/ydb_db.cc
@@ -324,6 +324,7 @@ toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYP
// DB_THREAD is implicitly supported and DB_BLACKHOLE is supported at the ft-layer
unused_flags &= ~DB_THREAD;
unused_flags &= ~DB_BLACKHOLE;
+ unused_flags &= ~DB_RDONLY;
// check for unknown or conflicting flags
if (unused_flags) return EINVAL; // unknown flags
@@ -405,7 +406,7 @@ int toku_db_lt_on_create_callback(toku::locktree *lt, void *extra) {
FT_HANDLE ft_handle = info->ft_handle;
FT_HANDLE cloned_ft_handle;
- r = toku_ft_handle_clone(&cloned_ft_handle, ft_handle, ttxn);
+ r = toku_ft_handle_clone(&cloned_ft_handle, ft_handle, ttxn, info->open_rw);
if (r == 0) {
assert(lt->get_userdata() == NULL);
lt->set_userdata(cloned_ft_handle);
@@ -466,6 +467,7 @@ int toku_db_open_iname(DB * db, DB_TXN * txn, const char *iname_in_env, uint32_t
flags&=~DB_READ_COMMITTED;
flags&=~DB_SERIALIZABLE;
flags&=~DB_IS_HOT_INDEX;
+ flags&=~DB_RDONLY;
// unknown or conflicting flags are bad
int unknown_flags = flags & ~DB_THREAD;
unknown_flags &= ~DB_BLACKHOLE;
@@ -480,11 +482,12 @@ int toku_db_open_iname(DB * db, DB_TXN * txn, const char *iname_in_env, uint32_t
db->i->open_flags = flags;
db->i->open_mode = mode;
+ bool open_rw = mode & (S_IWUSR | S_IWOTH | S_IWGRP);
FT_HANDLE ft_handle = db->i->ft_handle;
int r = toku_ft_handle_open(ft_handle, iname_in_env,
is_db_create, is_db_excl,
db->dbenv->i->cachetable,
- txn ? db_txn_struct_i(txn)->tokutxn : nullptr);
+ txn ? db_txn_struct_i(txn)->tokutxn : nullptr, open_rw);
if (r != 0) {
goto out;
}
@@ -506,6 +509,7 @@ int toku_db_open_iname(DB * db, DB_TXN * txn, const char *iname_in_env, uint32_t
struct lt_on_create_callback_extra on_create_extra = {
.txn = txn,
.ft_handle = db->i->ft_handle,
+ open_rw
};
db->i->lt = db->dbenv->i->ltm.get_lt(db->i->dict_id,
toku_ft_get_comparator(db->i->ft_handle),
diff --git a/storage/tokudb/PerconaFT/src/ydb_db.h b/storage/tokudb/PerconaFT/src/ydb_db.h
index ab8fcd2a401..c260e9d0fbe 100644
--- a/storage/tokudb/PerconaFT/src/ydb_db.h
+++ b/storage/tokudb/PerconaFT/src/ydb_db.h
@@ -67,6 +67,7 @@ void ydb_db_layer_get_status(YDB_DB_LAYER_STATUS statp);
struct lt_on_create_callback_extra {
DB_TXN *txn;
FT_HANDLE ft_handle;
+ bool open_rw;
};
int toku_db_lt_on_create_callback(toku::locktree *lt, void *extra);
void toku_db_lt_on_destroy_callback(toku::locktree *lt);
diff --git a/storage/tokudb/PerconaFT/tools/tokuftdump.cc b/storage/tokudb/PerconaFT/tools/tokuftdump.cc
index 2838ae5182e..44edb15162a 100644
--- a/storage/tokudb/PerconaFT/tools/tokuftdump.cc
+++ b/storage/tokudb/PerconaFT/tools/tokuftdump.cc
@@ -181,7 +181,7 @@ static void dump_header(FT ft) {
printf(" time_of_creation= %" PRIu64 " %s\n", ft->h->time_of_creation, timestr);
format_time(ft->h->time_of_last_modification, timestr);
printf(" time_of_last_modification=%" PRIu64 " %s\n", ft->h->time_of_last_modification, timestr);
- printf(" dirty=%d\n", ft->h->dirty);
+ printf(" dirty=%d\n", ft->h->dirty());
printf(" checkpoint_count=%" PRId64 "\n", ft->h->checkpoint_count);
printf(" checkpoint_lsn=%" PRId64 "\n", ft->h->checkpoint_lsn.lsn);
printf(" nodesize=%u\n", ft->h->nodesize);
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index 535b2189cad..4a101f7e589 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -1333,7 +1333,7 @@ int ha_tokudb::open_main_dictionary(
NULL,
DB_BTREE,
open_flags,
- 0);
+ S_IWUSR);
if (error) {
goto exit;
}
@@ -1396,7 +1396,7 @@ int ha_tokudb::open_secondary_dictionary(
}
- error = (*ptr)->open(*ptr, txn, newname, NULL, DB_BTREE, open_flags, 0);
+ error = (*ptr)->open(*ptr, txn, newname, NULL, DB_BTREE, open_flags, S_IWUSR);
if (error) {
my_errno = error;
goto cleanup;
diff --git a/storage/tokudb/man/CMakeLists.txt b/storage/tokudb/man/CMakeLists.txt
new file mode 100644
index 00000000000..192d8117119
--- /dev/null
+++ b/storage/tokudb/man/CMakeLists.txt
@@ -0,0 +1,2 @@
+SET(MAN1_TOKUDB tokuftdump.1 tokuft_logprint.1)
+INSTALL(FILES ${MAN1_TOKUDB} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT tokudb-engine)
diff --git a/man/tokuft_logprint.1 b/storage/tokudb/man/tokuft_logprint.1
index 0a9ff539b73..0a9ff539b73 100644
--- a/man/tokuft_logprint.1
+++ b/storage/tokudb/man/tokuft_logprint.1
diff --git a/man/tokuftdump.1 b/storage/tokudb/man/tokuftdump.1
index 024b16ba631..024b16ba631 100644
--- a/man/tokuftdump.1
+++ b/storage/tokudb/man/tokuftdump.1
diff --git a/storage/tokudb/mysql-test/tokudb/t/type_bit.test b/storage/tokudb/mysql-test/tokudb/t/type_bit.test
index 445f69e8972..034585169f5 100644
--- a/storage/tokudb/mysql-test/tokudb/t/type_bit.test
+++ b/storage/tokudb/mysql-test/tokudb/t/type_bit.test
@@ -268,7 +268,7 @@ select hex(a), b from t1;
drop table t1;
#
-# type was not properly initalized, which caused key_copy to fail
+# type was not properly initialized, which caused key_copy to fail
#
create table t1(bit_field bit(2), int_field int, key a(bit_field));
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result
index 03ef0ed2c09..2e31fc57dd4 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result
@@ -10,8 +10,8 @@ current_user()
test1@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test1@localhost
-GRANT USAGE ON *.* TO 'test1'@'localhost'
-GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
+GRANT USAGE ON *.* TO `test1`@`localhost`
+GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO `test1`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
@@ -22,8 +22,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
a b
@@ -80,8 +80,8 @@ current_user()
test2@localhost
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
-GRANT USAGE ON *.* TO 'test2'@'localhost'
-GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO 'test2'@'localhost'
+GRANT USAGE ON *.* TO `test2`@`localhost`
+GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `test`.* TO `test2`@`localhost`
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test2'@'localhost' for table 'tp'
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
diff --git a/storage/tokudb/tokudb_status.h b/storage/tokudb/tokudb_status.h
index 5cca54e52c9..07772bdc92a 100644
--- a/storage/tokudb/tokudb_status.h
+++ b/storage/tokudb/tokudb_status.h
@@ -201,7 +201,7 @@ int create(
name,
NULL,
DB_BTREE, DB_CREATE | DB_EXCL,
- 0);
+ S_IWUSR);
}
if (error == 0) {
*status_db_ptr = status_db;
@@ -230,7 +230,7 @@ int open(
NULL,
DB_BTREE,
DB_THREAD,
- 0);
+ S_IWUSR);
}
if (error == 0) {
uint32_t pagesize = 0;
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 91232a1e31f..17cb51ff8cb 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1598,7 +1598,8 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
int shift= 0, digits= 0, negative, addon;
/* Skip leading spaces and tabs */
- for ( ; str < end && (*str == ' ' || *str == '\t') ; str++);
+ for ( ; str < end && my_isspace(&my_charset_latin1, *str) ; )
+ str++;
if (str >= end)
goto ret_edom;
diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c
index 2311b4e5079..183829d7074 100644
--- a/strings/my_strtoll10.c
+++ b/strings/my_strtoll10.c
@@ -98,18 +98,25 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error)
if (endptr)
{
end= *endptr;
- while (s != end && (*s == ' ' || *s == '\t'))
+ /* Skip leading spaces */
+ for ( ; s < end && my_isspace(&my_charset_latin1, *s) ; )
s++;
+
if (s == end)
goto no_conv;
}
else
{
endptr= &dummy; /* Easier end test */
- while (*s == ' ' || *s == '\t')
- s++;
- if (!*s)
- goto no_conv;
+ /* Skip leading spaces */
+ for ( ; ; s++)
+ {
+ if (!*s)
+ goto no_conv;
+ if (!my_isspace(&my_charset_latin1, *s))
+ break;
+ }
+
/* This number must be big to guard against a lot of pre-zeros */
end= s+65535; /* Can't be longer than this */
}
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index 9be3ed65095..7ceccfbbf12 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -91,7 +91,7 @@ IF(UNIX)
ENDIF()
CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY)
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_SHAREDIR}/pkgconfig COMPONENT Development)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_LIBDIR}/pkgconfig COMPONENT Development)
INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
@@ -114,21 +114,6 @@ IF(UNIX)
${CMAKE_CURRENT_BINARY_DIR}/mariadb.service
DESTINATION ${inst_location}/systemd COMPONENT SupportFiles)
- IF(INSTALL_SYSTEMD_SYSUSERSDIR)
- CONFIGURE_FILE(sysusers.conf.in
- ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf @ONLY)
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf
- DESTINATION ${INSTALL_SYSTEMD_SYSUSERSDIR} COMPONENT Server)
- ENDIF()
-
- IF(INSTALL_SYSTEMD_TMPFILESDIR)
- get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY)
- CONFIGURE_FILE(tmpfiles.conf.in
- ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf @ONLY)
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf
- DESTINATION ${INSTALL_SYSTEMD_TMPFILESDIR} COMPONENT Server)
- ENDIF()
-
# @ in directory name broken between CMake version 2.8.12.2 and 3.3
# http://public.kitware.com/Bug/view.php?id=14782
IF(NOT CMAKE_VERSION VERSION_LESS 3.3.0 OR NOT RPM)
@@ -155,6 +140,26 @@ IF(UNIX)
ENDIF()
ENDIF()
+ # Allow installing sysusers and tmpusers without requiring SYSTEMD on the
+ # system. This is useful for distributions running other init systems to
+ # parse these files and create appropriate users & tmpfiles.
+ IF((HAVE_SYSTEMD OR INSTALL_SYSTEMD_SYSUSERS) AND INSTALL_SYSTEMD_SYSUSERSDIR)
+ CONFIGURE_FILE(sysusers.conf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf @ONLY)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf
+ DESTINATION ${INSTALL_SYSTEMD_SYSUSERSDIR}
+ RENAME mariadb.conf COMPONENT Server)
+ ENDIF()
+
+ IF((HAVE_SYSTEMD OR INSTALL_SYSTEMD_TMPUSERS) AND INSTALL_SYSTEMD_TMPFILESDIR)
+ get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY)
+ CONFIGURE_FILE(tmpfiles.conf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf @ONLY)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf
+ DESTINATION ${INSTALL_SYSTEMD_TMPFILESDIR}
+ RENAME mariadb.conf COMPONENT Server)
+ ENDIF()
+
IF (INSTALL_SYSCONFDIR)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql-log-rotate DESTINATION ${INSTALL_SYSCONFDIR}/logrotate.d
RENAME mysql COMPONENT SupportFiles)
diff --git a/support-files/mariadb.pc.in b/support-files/mariadb.pc.in
index bc84a5c5c4c..7d321f28491 100644
--- a/support-files/mariadb.pc.in
+++ b/support-files/mariadb.pc.in
@@ -20,4 +20,4 @@ Description: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@
URL: @CPACK_PACKAGE_URL@
Version: @VERSION@
Libs: -L${libdir} @LIBS_FOR_CLIENTS@
-Cflags: -I${includedir} -I${includedir}/.. @CFLAGS_FOR_CLIENTS@
+Cflags: -I${includedir} @CFLAGS_FOR_CLIENTS@
diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
index 1b1c9a5d592..5a8f346c31f 100644
--- a/support-files/mariadb.service.in
+++ b/support-files/mariadb.service.in
@@ -126,13 +126,20 @@ UMask=007
# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
PrivateTmp=false
+# Set an explicit Start and Stop timeout of 900 seconds (15 minutes!)
+# this is the same value as used in SysV init scripts in the past
+# Galera might need a longer timeout, check the KB if you want to change this:
+# https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout
+TimeoutStartSec=900
+TimeoutStopSec=900
+
##
## Options previously available to be set via [mysqld_safe]
## that now needs to be set by systemd config files as mysqld_safe
## isn't executed.
##
-# Number of files limit. previously [mysqld_safe] open-file-limit
+# Number of files limit. previously [mysqld_safe] open-files-limit
LimitNOFILE=16364
# Maximium core size. previously [mysqld_safe] core-file-size
diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
index 185157a510d..2ecf417fcf4 100644
--- a/support-files/mariadb@.service.in
+++ b/support-files/mariadb@.service.in
@@ -151,13 +151,20 @@ UMask=007
# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
PrivateTmp=false
+# Set an explicit Start and Stop timeout of 900 seconds (15 minutes!)
+# this is the same value as used in SysV init scripts in the past
+# if you need a longer timeout, check the KB:
+# https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout
+TimeoutStartSec=900
+TimeoutStopSec=900
+
##
## Options previously available to be set via [mysqld_safe]
## that now needs to be set by systemd config files as mysqld_safe
## isn't executed.
##
-# Number of files limit. previously [mysqld_safe] open-file-limit
+# Number of files limit. previously [mysqld_safe] open-files-limit
LimitNOFILE=16364
# Maximium core size. previously [mysqld_safe] core-file-size
diff --git a/wsrep/wsrep_api.h b/wsrep/wsrep_api.h
index 9d1280b6bc9..e362e71f829 100644
--- a/wsrep/wsrep_api.h
+++ b/wsrep/wsrep_api.h
@@ -990,7 +990,7 @@ struct wsrep {
void (*stats_free) (wsrep_t* wsrep, struct wsrep_stats_var* var_array);
/*!
- * @brief Reset some stats variables to inital value, provider-dependent.
+ * @brief Reset some stats variables to initial value, provider-dependent.
*
* @param wsrep provider handle.
*/
diff --git a/zlib/zlib.h b/zlib/zlib.h
index 08f491999c4..d3b929b9cca 100644
--- a/zlib/zlib.h
+++ b/zlib/zlib.h
@@ -1440,7 +1440,7 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
provided, but could be inferred from the result of gztell(). This behavior
is the same as the behavior of fread() implementations in common libraries,
but it prevents the direct use of gzfread() to read a concurrently written
- file, reseting and retrying on end-of-file, when size is not 1.
+ file, resetting and retrying on end-of-file, when size is not 1.
*/
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,