[Commits] 37deed3: Merge branch '10.4' into bb-10.4-mdev16188
revision-id: 37deed3f37561f264f65e162146bbc2ad35fb1a2 (mariadb-10.3.6-98-g37deed3) parent(s): 658128af43b4d7c6db445164f8ed25ed4d1e3109 5b996782be6b752ce50a0ecaa222b0688aa9e75d author: Igor Babaev committer: Igor Babaev timestamp: 2019-02-03 18:41:18 -0800 message: Merge branch '10.4' into bb-10.4-mdev16188 .gitignore | 3 + .gitmodules | 4 + .travis.compiler.sh | 13 +- .travis.yml | 65 +- BUILD/SETUP.sh | 5 +- CMakeLists.txt | 6 +- CONTRIBUTING.md | 47 + Docs/INSTALL-BINARY | 24 +- Docs/README-wsrep | 50 +- Docs/glibc-2.2.5.patch | 137 -- Docs/linuxthreads.txt | 19 - Docs/sp-imp-spec.txt | 1100 --------- KNOWN_BUGS.txt | 38 +- README.md | 30 +- VERSION | 4 +- appveyor.yml | 4 +- client/CMakeLists.txt | 2 +- client/mysql.cc | 10 +- client/mysql_upgrade.c | 10 +- client/mysqladmin.cc | 2 +- client/mysqlbinlog.cc | 16 +- client/mysqldump.c | 12 +- client/mysqlimport.c | 5 +- client/mysqlshow.c | 4 +- client/mysqlslap.c | 2 +- client/mysqltest.cc | 50 +- cmake/configure.pl | 15 + cmake/cpack_rpm.cmake | 4 +- cmake/make_dist.cmake.in | 8 + cmake/mariadb_connector_c.cmake | 5 +- cmake/os/WindowsCache.cmake | 1 + cmake/submodules.cmake | 6 +- cmake/wsrep.cmake | 15 +- cmake/zlib.cmake | 5 - config.h.cmake | 1 + configure.cmake | 1 + debian/additions/debian-start | 2 +- debian/additions/debian-start.inc.sh | 2 +- debian/autobake-deb.sh | 8 +- debian/control | 6 +- debian/mariadb-server-10.4.install | 5 +- debian/mariadb-server-10.4.postinst | 60 +- debian/rules | 5 - extra/innochecksum.cc | 40 +- extra/mariabackup/CMakeLists.txt | 29 +- extra/mariabackup/backup_copy.cc | 136 +- extra/mariabackup/backup_mysql.cc | 217 +- extra/mariabackup/changed_page_bitmap.cc | 26 +- extra/mariabackup/common.h | 71 +- extra/mariabackup/datasink.c | 141 -- extra/mariabackup/datasink.cc | 138 ++ extra/mariabackup/ds_archive.c | 281 --- extra/mariabackup/ds_archive.cc | 281 +++ extra/mariabackup/ds_buffer.c | 189 -- extra/mariabackup/ds_buffer.cc | 189 ++ extra/mariabackup/ds_compress.c | 463 ---- extra/mariabackup/ds_compress.cc | 463 ++++ extra/mariabackup/ds_local.cc | 1 - extra/mariabackup/ds_stdout.c | 122 - extra/mariabackup/ds_stdout.cc | 122 + extra/mariabackup/ds_tmpfile.c | 234 -- extra/mariabackup/ds_tmpfile.cc | 230 ++ extra/mariabackup/ds_xbstream.c | 223 -- extra/mariabackup/ds_xbstream.cc | 223 ++ extra/mariabackup/encryption_plugin.cc | 9 +- extra/mariabackup/fil_cur.cc | 229 +- extra/mariabackup/innobackupex.cc | 2 +- extra/mariabackup/write_filt.cc | 11 +- extra/mariabackup/wsrep.cc | 7 +- extra/mariabackup/xbstream.c | 564 ----- extra/mariabackup/xbstream.cc | 563 +++++ extra/mariabackup/xbstream.h | 2 +- extra/mariabackup/xbstream_read.c | 228 -- extra/mariabackup/xbstream_read.cc | 228 ++ extra/mariabackup/xbstream_write.c | 294 --- extra/mariabackup/xbstream_write.cc | 294 +++ extra/mariabackup/xtrabackup.cc | 717 +++--- extra/mariabackup/xtrabackup.h | 16 +- extra/perror.c | 6 +- extra/resolve_stack_dump.c | 2 +- extra/yassl/src/ssl.cpp | 16 +- include/aria_backup.h | 34 + include/json_lib.h | 17 +- include/lf.h | 2 + include/my_counter.h | 49 + include/my_global.h | 2 +- include/my_pthread.h | 14 +- include/my_time.h | 55 +- include/mysql/plugin.h | 2 +- include/mysql/plugin_audit.h.pp | 45 + include/mysql/plugin_auth.h.pp | 45 + include/mysql/plugin_encryption.h.pp | 45 + include/mysql/plugin_ftparser.h.pp | 45 + include/mysql/plugin_password_validation.h.pp | 45 + include/mysql/service_json.h | 117 + include/mysql/service_wsrep.h | 305 ++- include/mysql/services.h | 1 + include/mysql_com.h | 1 + include/service_versions.h | 1 + include/thr_lock.h | 6 +- include/thread_pool_priv.h | 3 - include/wsrep.h | 27 +- libmariadb | 2 +- libmysqld/CMakeLists.txt | 2 +- libmysqld/examples/CMakeLists.txt | 2 +- libmysqld/lib_sql.cc | 9 +- libmysqld/libmysql.c | 7 +- libservices/CMakeLists.txt | 1 + libservices/json_service.c | 19 + man/CMakeLists.txt | 1 - man/wsrep_sst_xtrabackup-v2.1 | 16 - man/wsrep_sst_xtrabackup.1 | 16 - mysql-test/include/add_anonymous_users.inc | 2 +- mysql-test/include/check-testcase.test | 51 + mysql-test/include/check_ftwrl_incompatible.inc | 6 +- mysql-test/include/default_mysqld.cnf | 1 + mysql-test/include/galera_cluster.inc | 6 + mysql-test/include/galera_have_debug_sync.inc | 9 + mysql-test/include/galera_wait_sync_point.inc | 11 + .../include/have_aria_used_for_temp_tables.inc | 4 + mysql-test/include/have_auth_named_pipe.inc | 13 + mysql-test/include/have_openssl.inc | 7 +- mysql-test/include/have_wsrep_enabled.inc | 1 - .../include/innodb_encrypt_tables.combinations | 14 + mysql-test/include/innodb_encrypt_tables.inc | 4 + mysql-test/include/kill_galera.inc | 20 + mysql-test/include/mtr_check.sql | 2 +- mysql-test/include/switch_to_mysql_global_priv.inc | 6 + mysql-test/include/switch_to_mysql_user.inc | 56 + mysql-test/include/system_db_struct.inc | 1 + mysql-test/include/wait_until_connected_again.inc | 19 +- mysql-test/include/wsrep_wait_disconnect.inc | 20 + mysql-test/lib/generate-ssl-certs.sh | 37 +- mysql-test/lib/mtr_cases.pm | 1 + mysql-test/main/1st.result | 1 + mysql-test/main/alter_table.result | 28 +- mysql-test/main/alter_table.test | 19 + mysql-test/main/alter_table_errors.result | 19 + mysql-test/main/alter_table_errors.test | 11 + mysql-test/main/alter_user.result | 19 +- mysql-test/main/alter_user.test | 4 +- mysql-test/main/analyze.result | 7 + mysql-test/main/auth_rpl.result | 2 +- mysql-test/main/backup_aria.result | 158 ++ mysql-test/main/backup_aria.test | 157 ++ mysql-test/main/backup_interaction.result | 520 ++++ mysql-test/main/backup_interaction.test | 503 ++++ mysql-test/main/backup_lock.result | 219 ++ mysql-test/main/backup_lock.test | 284 +++ mysql-test/main/backup_lock_debug.result | 28 + mysql-test/main/backup_lock_debug.test | 40 + mysql-test/main/backup_locks.result | 46 + mysql-test/main/backup_locks.test | 50 + mysql-test/main/backup_priv.result | 40 + mysql-test/main/backup_priv.test | 52 + mysql-test/main/backup_stages.result | 335 +++ mysql-test/main/backup_stages.test | 385 +++ mysql-test/main/backup_syntax.result | 163 ++ mysql-test/main/backup_syntax.test | 181 ++ mysql-test/main/bigint.result | 11 + mysql-test/main/bigint.test | 9 + mysql-test/main/check.result | 10 + mysql-test/main/check.test | 12 + mysql-test/main/column_compression_parts.result | 1 + mysql-test/main/column_compression_parts.test | 2 +- mysql-test/main/connect.result | 19 +- mysql-test/main/connect.test | 29 +- mysql-test/main/create-big.result | 12 +- mysql-test/main/create-big.test | 12 +- mysql-test/main/create.result | 101 +- mysql-test/main/create.test | 91 +- mysql-test/main/create_drop_binlog.result | 4 - mysql-test/main/create_or_replace.result | 51 +- mysql-test/main/create_or_replace.test | 22 +- mysql-test/main/create_user.result | 16 +- mysql-test/main/create_utf8.result | 89 + mysql-test/main/create_utf8.test | 80 + mysql-test/main/cte_recursive.result | 86 + mysql-test/main/cte_recursive.test | 73 + mysql-test/main/ctype_big5.result | 128 +- mysql-test/main/ctype_cp932_binlog_stm.result | 128 +- mysql-test/main/ctype_eucjpms.result | 128 +- mysql-test/main/ctype_euckr.result | 140 +- mysql-test/main/ctype_gb2312.result | 128 +- mysql-test/main/ctype_gbk.result | 454 ++-- mysql-test/main/ctype_latin1.result | 8 +- mysql-test/main/ctype_many.result | 4 +- mysql-test/main/ctype_recoding.result | 4 +- mysql-test/main/ctype_sjis.result | 128 +- mysql-test/main/ctype_uca.result | 40 +- mysql-test/main/ctype_uca_innodb.result | 28 +- mysql-test/main/ctype_ucs.result | 14 +- mysql-test/main/ctype_ucs.test | 15 + mysql-test/main/ctype_ujis.result | 128 +- mysql-test/main/ctype_ujis_ucs2.result | 150 +- mysql-test/main/ctype_upgrade.result | 6 +- mysql-test/main/ctype_utf16.result | 4 +- mysql-test/main/ctype_utf16le.result | 4 +- mysql-test/main/ctype_utf32.result | 18 +- mysql-test/main/ctype_utf8.result | 86 +- mysql-test/main/ctype_utf8mb4.result | 52 +- mysql-test/main/ctype_utf8mb4_heap.result | 14 +- mysql-test/main/ctype_utf8mb4_innodb.result | 16 +- mysql-test/main/ctype_utf8mb4_myisam.result | 16 +- mysql-test/main/custom_aggregate_functions.result | 2 +- mysql-test/main/delayed.result | 4 +- mysql-test/main/delete_use_source.result | 9 +- mysql-test/main/deprecated_features.result | 2 +- mysql-test/main/derived_cond_pushdown.result | 251 +- mysql-test/main/derived_cond_pushdown.test | 27 + mysql-test/main/derived_split_innodb.result | 1 + mysql-test/main/derived_view.result | 8 +- mysql-test/main/disabled.def | 7 +- mysql-test/main/distinct.result | 24 +- mysql-test/main/distinct.test | 18 + mysql-test/main/empty_user_table.result | 11 +- mysql-test/main/empty_user_table.test | 22 +- mysql-test/main/events_bugs.result | 2 +- mysql-test/main/explain_json.result | 1 + mysql-test/main/explain_non_select.result | 2 +- mysql-test/main/failed_auth_3909.result | 25 +- mysql-test/main/failed_auth_3909.test | 18 +- mysql-test/main/failed_auth_unixsocket.result | 4 +- mysql-test/main/failed_auth_unixsocket.test | 4 +- mysql-test/main/flush.result | 21 +- mysql-test/main/flush.test | 48 +- mysql-test/main/flush_block_commit.test | 2 +- .../main/flush_block_commit_notembedded.test | 2 +- mysql-test/main/flush_read_lock.result | 58 +- mysql-test/main/flush_read_lock.test | 115 +- mysql-test/main/flush_read_lock_kill.test | 2 +- mysql-test/main/flush_ssl.result | 26 + mysql-test/main/flush_ssl.test | 61 + mysql-test/main/fulltext.result | 8 +- mysql-test/main/func_default.result | 10 +- mysql-test/main/func_default.test | 5 + mysql-test/main/func_extract.result | 592 +++++ mysql-test/main/func_extract.test | 257 ++ mysql-test/main/func_group_innodb.result | 26 +- mysql-test/main/func_group_innodb.test | 19 + mysql-test/main/func_hybrid_type.result | 18 + mysql-test/main/func_hybrid_type.test | 16 + mysql-test/main/func_json.result | 20 + mysql-test/main/func_json.test | 18 + mysql-test/main/func_math.result | 40 + mysql-test/main/func_math.test | 33 + mysql-test/main/func_set.result | 4 +- mysql-test/main/func_str.result | 12 + mysql-test/main/func_str.test | 16 + mysql-test/main/func_time.result | 77 +- mysql-test/main/func_time.test | 40 +- mysql-test/main/func_time_round.result | 1374 +++++++++++ mysql-test/main/func_time_round.test | 461 ++++ mysql-test/main/gis-rtree.result | 1 + mysql-test/main/gis.result | 2 +- mysql-test/main/gis2.result | 4 +- mysql-test/main/grant.result | 42 +- mysql-test/main/grant.test | 43 +- mysql-test/main/grant2.result | 65 +- mysql-test/main/grant2.test | 25 +- mysql-test/main/grant3.result | 24 +- mysql-test/main/grant4.result | 18 +- mysql-test/main/grant5.result | 35 +- mysql-test/main/grant5.test | 19 +- mysql-test/main/grant_4332.result | 6 +- mysql-test/main/grant_4332.test | 8 +- mysql-test/main/group_by.result | 22 +- mysql-test/main/group_by.test | 13 + mysql-test/main/group_by_innodb.result | 1 + mysql-test/main/group_min_max.result | 116 +- mysql-test/main/group_min_max_innodb.result | 1 + mysql-test/main/handlersocket.result | 2 +- mysql-test/main/having.result | 1 + mysql-test/main/huge_frm-6224.result | 5 + mysql-test/main/huge_frm-6224.test | 11 +- mysql-test/main/index_merge_innodb.result | 6 +- mysql-test/main/index_merge_innodb.test | 1 + mysql-test/main/index_merge_myisam.result | 4 + mysql-test/main/information_schema.result | 21 +- mysql-test/main/information_schema.test | 13 +- .../main/information_schema_all_engines.result | 2 +- mysql-test/main/init_file_set_password-7656.result | 6 +- mysql-test/main/innodb_ext_key.result | 7 +- mysql-test/main/innodb_ext_key.test | 1 + mysql-test/main/innodb_icp.result | 8 +- mysql-test/main/innodb_mysql_sync.result | 4 +- mysql-test/main/innodb_mysql_sync.test | 2 +- mysql-test/main/insert.result | 32 +- mysql-test/main/invisible_field.result | 4 +- mysql-test/main/invisible_field_debug.result | 2 + mysql-test/main/invisible_field_debug.test | 2 + mysql-test/main/join.result | 10 +- mysql-test/main/join.test | 2 +- mysql-test/main/join_cache.result | 208 +- mysql-test/main/join_cache.test | 4 +- mysql-test/main/join_outer.result | 7 +- mysql-test/main/join_outer_innodb.result | 12 +- mysql-test/main/join_outer_jcl6.result | 7 +- mysql-test/main/kill.result | 2 +- mysql-test/main/kill.test | 8 +- mysql-test/main/limit_rows_examined.result | 11 +- mysql-test/main/loaddata.result | 6 +- mysql-test/main/lock.result | 3 +- mysql-test/main/lock.test | 2 +- mysql-test/main/lock_multi.result | 17 +- mysql-test/main/lock_multi.test | 68 +- mysql-test/main/lock_sync.result | 2 +- mysql-test/main/lock_sync.test | 4 +- mysql-test/main/log_tables_upgrade.result | 3 +- mysql-test/main/lowercase_fs_off.result | 3 +- mysql-test/main/max_password_errors.result | 45 + mysql-test/main/max_password_errors.test | 64 + mysql-test/main/mdev-504.result | 3 +- mysql-test/main/mdev-504.test | 4 +- mysql-test/main/mdev13607.result | 3 + mysql-test/main/mdl.result | 74 +- mysql-test/main/mdl.test | 64 +- mysql-test/main/mdl_sync.result | 63 +- mysql-test/main/mdl_sync.test | 95 +- mysql-test/main/merge.result | 5 + mysql-test/main/mix2_myisam.result | 1 + mysql-test/main/multi_update.result | 4 +- mysql-test/main/myisam.result | 8 +- .../main/myisam_explain_non_select_all.result | 238 +- mysql-test/main/myisam_icp.result | 2 +- mysql-test/main/mysql_install_db_win.result | 13 + mysql-test/main/mysql_install_db_win.test | 24 + mysql-test/main/mysql_upgrade-6984.result | 7 +- mysql-test/main/mysql_upgrade-6984.test | 4 +- mysql-test/main/mysql_upgrade.result | 35 +- mysql-test/main/mysql_upgrade.test | 5 +- mysql-test/main/mysql_upgrade_no_innodb.result | 2 +- mysql-test/main/mysql_upgrade_noengine.result | 12 + mysql-test/main/mysql_upgrade_noengine.test | 16 + mysql-test/main/mysql_upgrade_ssl.result | 3 +- mysql-test/main/mysql_upgrade_view.result | 13 +- mysql-test/main/mysqlbinlog_row_compressed.result | 16 +- mysql-test/main/mysqlbinlog_row_minimal.result | 16 +- mysql-test/main/mysqlcheck.result | 10 +- mysql-test/main/mysqld--help.result | 29 +- mysql-test/main/mysqld_option_err.test | 2 + mysql-test/main/mysqldump.result | 6 +- mysql-test/main/mysqldump.test | 2 +- .../main/no_password_column-mdev-11170.result | 169 -- mysql-test/main/no_password_column-mdev-11170.test | 95 - mysql-test/main/not_embedded_server.result | 4 +- mysql-test/main/not_embedded_server.test | 2 +- mysql-test/main/null_key.result | 3 + mysql-test/main/old-mode.result | 41 + mysql-test/main/old-mode.test | 29 + mysql-test/main/openssl_1.result | 72 +- mysql-test/main/openssl_1.test | 91 +- mysql-test/main/order_by.result | 37 + mysql-test/main/order_by.test | 37 + mysql-test/main/outfile_loaddata.result | 4 +- mysql-test/main/parser.result | 65 + mysql-test/main/parser.test | 74 + mysql-test/main/partition.result | 104 + mysql-test/main/partition.test | 62 + mysql-test/main/partition_alter.test | 2 - mysql-test/main/partition_binlog.result | 1 + mysql-test/main/partition_explicit_prune.result | 6 + mysql-test/main/partition_innodb.result | 64 + mysql-test/main/partition_innodb.test | 66 + mysql-test/main/perror-win.result | 4 +- mysql-test/main/perror.result | 8 +- mysql-test/main/plugin.result | 6 +- mysql-test/main/plugin_auth.result | 3 + mysql-test/main/plugin_auth.test | 8 +- mysql-test/main/plugin_auth_qa.result | 90 +- mysql-test/main/plugin_auth_qa_1.result | 44 +- mysql-test/main/plugin_auth_qa_1.test | 14 +- mysql-test/main/plugin_auth_qa_2.result | 26 +- mysql-test/main/processlist.result | 2 +- mysql-test/main/ps.result | 50 +- mysql-test/main/ps_ddl.result | 8 +- mysql-test/main/ps_ddl.test | 2 +- mysql-test/main/ps_error.result | 73 + mysql-test/main/ps_error.test | 66 + mysql-test/main/range.result | 87 +- mysql-test/main/range_innodb.result | 43 + mysql-test/main/range_innodb.test | 42 + mysql-test/main/range_mrr_icp.result | 121 +- mysql-test/main/range_vs_index_merge.result | 136 +- mysql-test/main/range_vs_index_merge.test | 17 + mysql-test/main/range_vs_index_merge_innodb.result | 36 + mysql-test/main/read_only.result | 16 +- mysql-test/main/read_only.test | 23 +- mysql-test/main/row.result | 2 +- mysql-test/main/select.result | 3 + mysql-test/main/select_jcl6.result | 3 + mysql-test/main/select_pkeycache.result | 3 + mysql-test/main/select_safe.result | 9 +- mysql-test/main/selectivity_innodb.result | 1 - mysql-test/main/session_tracker_last_gtid.result | 6 - mysql-test/main/set_password.result | 28 +- mysql-test/main/set_password.test | 2 + mysql-test/main/show_check.result | 6 +- .../main/show_grants_with_plugin-7985.result | 197 -- mysql-test/main/show_grants_with_plugin-7985.test | 160 -- mysql-test/main/sp-code.result | 12 +- mysql-test/main/sp-cursor.result | 26 +- mysql-test/main/sp-cursor.test | 21 + mysql-test/main/sp-error.result | 2 +- mysql-test/main/sp-for-loop.result | 2 +- mysql-test/main/sp-for-loop.test | 2 +- mysql-test/main/sp-security.result | 24 +- mysql-test/main/sp-security.test | 9 +- mysql-test/main/sp-vars.result | 8 +- mysql-test/main/sp.result | 60 +- mysql-test/main/sp.test | 36 +- mysql-test/main/sp_notembedded.result | 2 - mysql-test/main/sp_notembedded.test | 8 +- mysql-test/main/sql_mode.result | 8 +- mysql-test/main/sql_mode.test | 4 +- mysql-test/main/ssl-crl-revoked-crl.result | 1 - mysql-test/main/ssl.result | 9 +- mysql-test/main/ssl.test | 5 - mysql-test/main/ssl_cert_verify.result | 5 - mysql-test/main/ssl_cert_verify.test | 43 - mysql-test/main/ssl_cipher-master.opt | 1 - mysql-test/main/ssl_cipher.result | 63 +- mysql-test/main/ssl_cipher.test | 110 +- mysql-test/main/ssl_crl-master.opt | 4 - mysql-test/main/ssl_crl.combinations | 5 + mysql-test/main/ssl_crl.result | 24 +- mysql-test/main/ssl_crl.test | 15 +- mysql-test/main/ssl_crl_clients-master.opt | 4 - mysql-test/main/ssl_crl_clients-valid.result | 24 - mysql-test/main/ssl_crl_clients.result | 6 + mysql-test/main/ssl_crl_clients.test | 31 +- mysql-test/main/ssl_crl_clients_valid-master.opt | 4 - mysql-test/main/ssl_crl_clients_valid.result | 16 - mysql-test/main/ssl_crl_clients_valid.test | 23 - mysql-test/main/ssl_crl_clrpath-master.opt | 4 - mysql-test/main/ssl_crl_clrpath.result | 23 - mysql-test/main/ssl_crl_clrpath.test | 16 - mysql-test/main/stat_tables.result | 113 +- mysql-test/main/stat_tables.test | 59 + mysql-test/main/stat_tables_disabled.result | 4 +- mysql-test/main/stat_tables_innodb.result | 113 +- mysql-test/main/stat_tables_rbr.result | 4 +- mysql-test/main/stat_tables_rbr.test | 5 +- mysql-test/main/statistics.result | 10 - mysql-test/main/status.result | 8 +- mysql-test/main/str_to_datetime_457.result | 5 +- mysql-test/main/strict.result | 184 +- mysql-test/main/subselect.result | 16 +- mysql-test/main/subselect_exists2in.result | 7 +- mysql-test/main/subselect_exists2in_costmat.result | 2 +- mysql-test/main/subselect_extra.result | 4 + mysql-test/main/subselect_extra_no_semijoin.result | 4 + mysql-test/main/subselect_innodb.result | 1 + mysql-test/main/subselect_mat.result | 6 +- mysql-test/main/subselect_mat_cost.result | 22 +- mysql-test/main/subselect_mat_cost_bugs.result | 1 + mysql-test/main/subselect_no_exists_to_in.result | 14 +- mysql-test/main/subselect_no_mat.result | 12 +- mysql-test/main/subselect_no_opts.result | 6 +- mysql-test/main/subselect_no_scache.result | 16 +- mysql-test/main/subselect_no_semijoin.result | 4 +- mysql-test/main/subselect_sj.result | 2 + mysql-test/main/subselect_sj2_mat.result | 36 +- mysql-test/main/subselect_sj2_mat.test | 4 + mysql-test/main/subselect_sj_jcl6.result | 2 + mysql-test/main/subselect_sj_mat.result | 22 +- mysql-test/main/system_mysql_db.result | 66 +- mysql-test/main/system_mysql_db_507.result | 169 ++ mysql-test/main/system_mysql_db_507.test | 94 + mysql-test/main/system_mysql_db_fix40123.result | 13 +- mysql-test/main/system_mysql_db_fix40123.test | 2 +- mysql-test/main/system_mysql_db_fix50030.result | 13 +- mysql-test/main/system_mysql_db_fix50030.test | 2 +- mysql-test/main/system_mysql_db_fix50117.result | 13 +- mysql-test/main/system_mysql_db_fix50117.test | 2 +- mysql-test/main/temp_table_frm.result | 6 + mysql-test/main/temp_table_frm.test | 9 +- mysql-test/main/temporal_literal.result | 12 +- mysql-test/main/timezone2.result | 202 ++ mysql-test/main/timezone2.test | 179 ++ mysql-test/main/trigger.result | 4 +- mysql-test/main/trigger_notembedded.test | 2 +- mysql-test/main/truncate_coverage.result | 2 +- mysql-test/main/truncate_coverage.test | 4 +- mysql-test/main/type_date.result | 22 +- mysql-test/main/type_date_round.result | 174 ++ mysql-test/main/type_date_round.test | 113 + mysql-test/main/type_datetime.result | 8 +- mysql-test/main/type_datetime_round.result | 205 ++ mysql-test/main/type_datetime_round.test | 147 ++ mysql-test/main/type_decimal.result | 4 +- mysql-test/main/type_float.result | 2 +- mysql-test/main/type_interval.result | 83 + mysql-test/main/type_interval.test | 54 + mysql-test/main/type_newdecimal.result | 2 +- mysql-test/main/type_newdecimal.test | 1 + mysql-test/main/type_num.result | 168 +- mysql-test/main/type_time.result | 40 +- mysql-test/main/type_time.test | 21 + mysql-test/main/type_time_round.result | 260 ++ mysql-test/main/type_time_round.test | 184 ++ mysql-test/main/type_timestamp.result | 135 +- mysql-test/main/type_timestamp.test | 136 + mysql-test/main/type_timestamp_round.result | 191 ++ mysql-test/main/type_timestamp_round.test | 160 ++ mysql-test/main/udf.result | 119 + mysql-test/main/udf.test | 79 + mysql-test/main/union.result | 40 +- mysql-test/main/union.test | 35 + mysql-test/main/update.result | 4 +- mysql-test/main/update_use_source.result | 1 + mysql-test/main/userstat.result | 4 +- mysql-test/main/view.result | 9 +- mysql-test/main/view_grant.result | 8 - mysql-test/main/view_grant.test | 16 - mysql-test/main/warnings.result | 68 +- mysql-test/main/win.result | 132 +- mysql-test/main/win.test | 127 +- mysql-test/main/win_big-mdev-11697.result | 2 + mysql-test/mysql-test-run.pl | 167 +- mysql-test/std_data/ca-cert-verify.pem | 20 - mysql-test/std_data/cacert.pem | 110 +- mysql-test/std_data/cakey.pem | 52 +- mysql-test/std_data/client-cert.crl | 12 + mysql-test/std_data/client-cert.pem | 102 +- mysql-test/std_data/client-key.pem | 38 +- mysql-test/std_data/crl-ca-cert.pem | 63 - mysql-test/std_data/crl-client-cert.pem | 62 - mysql-test/std_data/crl-client-key.pem | 15 - mysql-test/std_data/crl-client-revoked.crl | 10 - mysql-test/std_data/crl-server-cert.pem | 62 - mysql-test/std_data/crl-server-key.pem | 15 - mysql-test/std_data/crldir/ed1f42db.r0 | 12 + mysql-test/std_data/crldir/fc725416.r0 | 10 - mysql-test/std_data/galera-cert.pem | 26 - mysql-test/std_data/galera-key.pem | 28 - mysql-test/std_data/galera-upgrade-ca-cert.pem | 40 - mysql-test/std_data/galera-upgrade-server-cert.pem | 20 - mysql-test/std_data/galera-upgrade-server-key.pem | 28 - mysql-test/std_data/mdev17909#P#p20181029.MYD | Bin mysql-test/std_data/mdev17909#P#p20181029.MYI | Bin 0 -> 1024 bytes mysql-test/std_data/mdev17909#P#p20181128.MYD | Bin mysql-test/std_data/mdev17909#P#p20181128.MYI | Bin 0 -> 1024 bytes mysql-test/std_data/mdev17909.frm | Bin 0 -> 3284 bytes mysql-test/std_data/mdev17909.par | Bin 0 -> 48 bytes .../mysql-5.7.11-stm-temporal-round-binlog.000001 | Bin 0 -> 514 bytes .../mysql-8.0.13-stm-temporal-round-binlog.000001 | Bin 0 -> 892 bytes mysql-test/std_data/server-cert-verify-fail.pem | 19 - mysql-test/std_data/server-cert-verify-pass.pem | 19 - mysql-test/std_data/server-cert.crl | 12 + mysql-test/std_data/server-cert.pem | 100 +- mysql-test/std_data/server-key-verify-fail.pem | 27 - mysql-test/std_data/server-key-verify-pass.pem | 27 - mysql-test/std_data/server-key.pem | 38 +- mysql-test/std_data/server-new-cert.pem | 81 + mysql-test/std_data/server-new-key.pem | 27 + mysql-test/std_data/server8k-cert.pem | 246 +- mysql-test/std_data/server8k-key.pem | 194 +- mysql-test/std_data/serversan-cert.pem | 92 +- mysql-test/std_data/serversan-key.pem | 40 +- mysql-test/suite.pm | 5 +- mysql-test/suite/archive/disabled.def | 13 + mysql-test/suite/archive/flush.result | 18 + mysql-test/suite/archive/flush.test | 25 + mysql-test/suite/archive/rnd_pos.result | 56 + mysql-test/suite/archive/rnd_pos.test | 27 + mysql-test/suite/binlog/include/binlog.test | 8 +- mysql-test/suite/binlog/r/binlog_row_binlog.result | 18 +- mysql-test/suite/binlog/r/binlog_stm_binlog.result | 16 +- mysql-test/suite/binlog/t/binlog_stm_binlog.test | 4 - .../suite/binlog_encryption/rpl_parallel.result | 1 + mysql-test/suite/compat/oracle/r/parser.result | 110 + mysql-test/suite/compat/oracle/r/sp-code.result | 42 +- .../suite/compat/oracle/r/sp-cursor-rowtype.result | 25 + mysql-test/suite/compat/oracle/r/sp-cursor.result | 30 +- .../suite/compat/oracle/r/sp-package-mdl.result | 4 +- mysql-test/suite/compat/oracle/r/sp-package.result | 48 + mysql-test/suite/compat/oracle/r/sp.result | 60 +- mysql-test/suite/compat/oracle/r/versioning.result | 8 + mysql-test/suite/compat/oracle/t/parser.test | 154 ++ mysql-test/suite/compat/oracle/t/sp-code.test | 2 +- .../suite/compat/oracle/t/sp-cursor-rowtype.test | 23 + mysql-test/suite/compat/oracle/t/sp-cursor.test | 35 + mysql-test/suite/compat/oracle/t/sp-package.test | 57 + mysql-test/suite/compat/oracle/t/sp.test | 45 +- mysql-test/suite/compat/oracle/t/versioning.test | 10 + mysql-test/suite/csv/flush.result | 25 + mysql-test/suite/csv/flush.test | 30 + mysql-test/suite/encryption/disabled.def | 1 + .../encryption/r/innodb-bad-key-change.result | 1 + .../encryption/r/innodb-checksum-algorithm.result | 225 -- .../encryption/r/innodb-encryption-alter.result | 28 +- .../encryption/r/innodb-encryption-disable.result | 1 + .../suite/encryption/r/innodb-force-corrupt.result | 3 +- .../suite/encryption/r/innodb-missing-key.result | 1 + .../suite/encryption/t/innodb-bad-key-change.test | 1 + .../encryption/t/innodb-checksum-algorithm.test | 9 +- .../encryption/t/innodb-encryption-alter.test | 38 +- .../encryption/t/innodb-encryption-disable.test | 1 + .../suite/encryption/t/innodb-force-corrupt.test | 9 +- .../suite/encryption/t/innodb-missing-key.test | 1 + .../suite/engines/funcs/r/an_calendar.result | 4 + mysql-test/suite/engines/funcs/r/an_number.result | 14 + mysql-test/suite/engines/funcs/r/an_string.result | 10 + .../funcs/r/in_number_boundary_error.result | 12 +- .../r/in_number_decimal_boundary_error.result | 8 +- .../engines/funcs/r/tc_partition_analyze.result | 1 + .../suite/engines/iuds/r/insert_decimal.result | 12 +- .../suite/engines/iuds/r/insert_number.result | 304 ++- mysql-test/suite/engines/iuds/r/insert_year.result | 16 +- .../suite/engines/iuds/r/update_decimal.result | 4 +- .../engines/iuds/r/update_delete_number.result | 17 + mysql-test/suite/funcs_1/r/innodb_func_view.result | 72 +- .../suite/funcs_1/r/is_check_constraint.result | 121 + .../suite/funcs_1/r/is_check_constraints.result | 36 + .../suite/funcs_1/r/is_columns_innodb.result | 4 +- mysql-test/suite/funcs_1/r/is_columns_mysql.result | 197 +- .../funcs_1/r/is_columns_mysql_embedded.result | 197 +- .../suite/funcs_1/r/is_key_column_usage.result | 4 +- .../funcs_1/r/is_key_column_usage_embedded.result | 4 +- .../suite/funcs_1/r/is_routines_embedded.result | 6 +- mysql-test/suite/funcs_1/r/is_statistics.result | 4 +- .../suite/funcs_1/r/is_statistics_mysql.result | 4 +- .../funcs_1/r/is_statistics_mysql_embedded.result | 8 +- .../suite/funcs_1/r/is_table_constraints.result | 3 +- .../funcs_1/r/is_table_constraints_mysql.result | 3 +- .../r/is_table_constraints_mysql_embedded.result | 6 +- mysql-test/suite/funcs_1/r/is_tables_mysql.result | 39 +- .../funcs_1/r/is_tables_mysql_embedded.result | 78 +- .../suite/funcs_1/r/is_user_privileges.result | 1839 ++------------ mysql-test/suite/funcs_1/r/is_views.result | 1 + .../suite/funcs_1/r/is_views_embedded.result | 1 + mysql-test/suite/funcs_1/r/memory_func_view.result | 72 +- mysql-test/suite/funcs_1/r/myisam_func_view.result | 72 +- mysql-test/suite/funcs_1/r/storedproc.result | 6 +- .../suite/funcs_1/t/is_check_constraint.test | 92 + mysql-test/suite/funcs_1/t/is_user_privileges.test | 11 +- mysql-test/suite/galera/disabled.def | 28 +- mysql-test/suite/galera/galera_2nodes.cnf | 26 +- .../suite/galera/galera_2nodes_as_master.cnf | 18 +- mysql-test/suite/galera/galera_2nodes_as_slave.cnf | 51 +- mysql-test/suite/galera/galera_3nodes_as_slave.cnf | 62 +- mysql-test/suite/galera/galera_4nodes.cnf | 30 +- .../suite/galera/include/galera_base_port.inc | 8 + .../galera/include/galera_concurrent_test.inc | 90 + .../suite/galera/include/galera_dump_sr_table.inc | 28 + .../galera/include/galera_have_debug_sync.inc | 9 - .../suite/galera/include/galera_load_provider.inc | 68 + mysql-test/suite/galera/include/galera_resume.inc | 9 - .../suite/galera/include/galera_sst_restore.inc | 2 +- .../galera/include/galera_st_disconnect_slave.inc | 8 + .../galera/include/galera_unload_provider.inc | 8 + .../galera/include/have_filekeymanagement.inc | 3 + .../suite/galera/include/have_xtrabackup.inc | 4 - mysql-test/suite/galera/r/GAL-382.result | 2 + mysql-test/suite/galera/r/GAL-401.result | 2 + mysql-test/suite/galera/r/GAL-480.result | 2 + mysql-test/suite/galera/r/GCF-1081.result | 47 + mysql-test/suite/galera/r/GCF-939.result | 13 + mysql-test/suite/galera/r/MDEV-15443.result | 2 + mysql-test/suite/galera/r/MW-252.result | 2 + mysql-test/suite/galera/r/MW-258.result | 2 + mysql-test/suite/galera/r/MW-259.result | 2 + mysql-test/suite/galera/r/MW-284.result | 4 + mysql-test/suite/galera/r/MW-285.result | 2 + mysql-test/suite/galera/r/MW-286.result | 21 +- mysql-test/suite/galera/r/MW-292.result | 27 +- mysql-test/suite/galera/r/MW-309.result | 2 + mysql-test/suite/galera/r/MW-313.result | 2 + mysql-test/suite/galera/r/MW-328A.result | 25 +- mysql-test/suite/galera/r/MW-328B.result | 2 + mysql-test/suite/galera/r/MW-328C.result | 2 + mysql-test/suite/galera/r/MW-328D.result | 2 + mysql-test/suite/galera/r/MW-328E.result | 2 + mysql-test/suite/galera/r/MW-329.result | 9 +- mysql-test/suite/galera/r/MW-336.result | 2 + mysql-test/suite/galera/r/MW-357.result | 2 + mysql-test/suite/galera/r/MW-360.result | 41 + mysql-test/suite/galera/r/MW-369.result | 149 +- mysql-test/suite/galera/r/MW-388.result | 6 +- mysql-test/suite/galera/r/MW-402.result | 76 +- mysql-test/suite/galera/r/MW-416.result | 5 +- mysql-test/suite/galera/r/MW-86-wait1.result | 17 +- mysql-test/suite/galera/r/MW-86-wait8.result | 16 +- mysql-test/suite/galera/r/MW-86.result | 78 + mysql-test/suite/galera/r/basic.result | 2 + mysql-test/suite/galera/r/binlog_checksum.result | 2 + mysql-test/suite/galera/r/create.result | 2 + .../suite/galera/r/enforce_storage_engine.result | 2 + .../suite/galera/r/enforce_storage_engine2.result | 2 + mysql-test/suite/galera/r/ev51914.result | 2 + mysql-test/suite/galera/r/fk.result | 2 + mysql-test/suite/galera/r/galera#414.result | 2 + mysql-test/suite/galera/r/galera#500.result | 8 + mysql-test/suite/galera/r/galera#505.result | 2 + .../r/galera_FK_duplicate_client_insert.result | 382 +++ mysql-test/suite/galera/r/galera_admin.result | 4 + .../galera/r/galera_alter_engine_innodb.result | 2 + .../galera/r/galera_alter_engine_myisam.result | 2 + .../suite/galera/r/galera_alter_table_force.result | 2 + .../galera/r/galera_applier_ftwrl_table.result | 2 + .../r/galera_applier_ftwrl_table_alter.result | 2 + mysql-test/suite/galera/r/galera_as_master.result | 4 + .../suite/galera/r/galera_as_master_gtid.result | 44 +- .../suite/galera/r/galera_as_master_large.result | 2 + mysql-test/suite/galera/r/galera_as_slave.result | 12 +- .../suite/galera/r/galera_as_slave_autoinc.result | 12 +- .../suite/galera/r/galera_as_slave_gtid.result | 12 +- .../r/galera_as_slave_gtid_replicate_do_db.result | 159 ++ .../galera_as_slave_gtid_replicate_do_db_cc.result | 315 +++ .../suite/galera/r/galera_as_slave_nonprim.result | 16 + .../galera/r/galera_autoinc_sst_mariabackup.result | 51 + .../galera/r/galera_autoinc_sst_xtrabackup.result | 47 - mysql-test/suite/galera/r/galera_bf_abort.result | 4 +- .../r/galera_bf_abort_flush_for_export.result | 2 + .../galera/r/galera_bf_abort_for_update.result | 6 +- .../suite/galera/r/galera_bf_abort_ftwrl.result | 2 + .../suite/galera/r/galera_bf_abort_get_lock.result | 4 +- .../galera/r/galera_bf_abort_group_commit.result | 685 ++++++ .../galera/r/galera_bf_abort_lock_table.result | 2 + .../suite/galera/r/galera_bf_abort_shutdown.result | 12 + .../suite/galera/r/galera_bf_abort_sleep.result | 4 +- .../r/galera_bf_background_statistics.result | 4 +- .../suite/galera/r/galera_bf_lock_wait.result | 2 + .../suite/galera/r/galera_binlog_cache_size.result | 2 + .../suite/galera/r/galera_binlog_checksum.result | 2 + .../r/galera_binlog_event_max_size_max.result | 2 + .../r/galera_binlog_event_max_size_min.result | 2 + .../suite/galera/r/galera_binlog_row_image.result | 2 + .../suite/galera/r/galera_commit_empty.result | 15 + .../suite/galera/r/galera_concurrent_ctas.result | 2 + .../suite/galera/r/galera_create_function.result | 2 + .../suite/galera/r/galera_create_procedure.result | 2 + .../galera/r/galera_create_table_as_select.result | 103 + .../suite/galera/r/galera_create_table_like.result | 2 + .../suite/galera/r/galera_create_trigger.result | 2 + .../suite/galera/r/galera_ddl_multiline.result | 2 + mysql-test/suite/galera/r/galera_defaults.result | 13 +- .../suite/galera/r/galera_delete_limit.result | 2 + .../suite/galera/r/galera_desync_overlapped.result | 2 + .../suite/galera/r/galera_drop_database.result | 8 + mysql-test/suite/galera/r/galera_drop_multi.result | 2 + .../suite/galera/r/galera_encrypt_tmp_files.result | 2 + mysql-test/suite/galera/r/galera_enum.result | 4 +- mysql-test/suite/galera/r/galera_events.result | 2 + .../suite/galera/r/galera_fk_cascade_delete.result | 2 + .../suite/galera/r/galera_fk_cascade_update.result | 2 + .../suite/galera/r/galera_fk_conflict.result | 4 +- .../suite/galera/r/galera_fk_mismatch.result | 2 + .../suite/galera/r/galera_fk_multicolumn.result | 2 + .../suite/galera/r/galera_fk_multitable.result | 2 + mysql-test/suite/galera/r/galera_fk_no_pk.result | 2 + .../galera/r/galera_fk_selfreferential.result | 2 + mysql-test/suite/galera/r/galera_fk_setnull.result | 2 + .../suite/galera/r/galera_flush_local.result | 6 + .../galera/r/galera_forced_binlog_format.result | 20 +- mysql-test/suite/galera/r/galera_ftwrl.result | 2 + .../suite/galera/r/galera_ftwrl_drain.result | 4 +- mysql-test/suite/galera/r/galera_fulltext.result | 2 + .../suite/galera/r/galera_gcache_recover.result | 9 + .../r/galera_gcache_recover_full_gcache.result | 11 +- .../suite/galera/r/galera_gcs_fc_limit.result | 2 + .../suite/galera/r/galera_gcs_fragment.result | 15 +- .../galera/r/galera_gcs_max_packet_size.result | 2 + mysql-test/suite/galera/r/galera_gra_log.result | 2 + mysql-test/suite/galera/r/galera_gtid.result | 2 + mysql-test/suite/galera/r/galera_gtid_slave.result | 26 +- .../galera/r/galera_gtid_slave_sst_rsync.result | 107 +- .../suite/galera/r/galera_insert_ignore.result | 2 + .../suite/galera/r/galera_insert_multi.result | 4 +- .../r/galera_ist_innodb_flush_logs,debug.rdiff | 103 - .../r/galera_ist_innodb_flush_logs,release.rdiff | 114 + .../galera/r/galera_ist_innodb_flush_logs.result | 118 + .../galera/r/galera_ist_mariabackup,debug.rdiff | 114 + .../suite/galera/r/galera_ist_mariabackup.result | 292 +++ ...a_ist_mariabackup_innodb_flush_logs,debug.rdiff | 114 + ...galera_ist_mariabackup_innodb_flush_logs.result | 98 + .../galera/r/galera_ist_mysqldump,debug.rdiff | 19 +- .../suite/galera/r/galera_ist_mysqldump.result | 3 + .../suite/galera/r/galera_ist_progress.result | 9 - .../suite/galera/r/galera_ist_recv_bind.result | 2 + .../galera/r/galera_ist_restart_joiner.result | 3 +- mysql-test/suite/galera/r/galera_ist_rsync.result | 5 + .../galera/r/galera_ist_xtrabackup-v2,debug.rdiff | 103 - .../suite/galera/r/galera_ist_xtrabackup-v2.result | 261 -- mysql-test/suite/galera/r/galera_kill_ddl.result | 2 + .../suite/galera/r/galera_kill_largechanges.result | 2 + .../suite/galera/r/galera_kill_smallchanges.result | 2 + mysql-test/suite/galera/r/galera_lock_table.result | 2 + mysql-test/suite/galera/r/galera_log_bin.result | 4 + .../suite/galera/r/galera_log_output_csv.result | 2 + .../suite/galera/r/galera_many_columns.result | 4 +- .../suite/galera/r/galera_many_indexes.result | 6 +- mysql-test/suite/galera/r/galera_many_rows.result | 6 +- .../suite/galera/r/galera_many_tables_nopk.result | 4 +- .../suite/galera/r/galera_many_tables_pk.result | 4 +- mysql-test/suite/galera/r/galera_mdev_10812.result | 2 + mysql-test/suite/galera/r/galera_mdev_13787.result | 2 + mysql-test/suite/galera/r/galera_mdev_15611.result | 2 + mysql-test/suite/galera/r/galera_mdl_race.result | 4 +- .../suite/galera/r/galera_multi_database.result | 2 + .../suite/galera/r/galera_myisam_autocommit.result | 2 + .../galera/r/galera_myisam_transactions.result | 2 + mysql-test/suite/galera/r/galera_nopk_bit.result | 4 +- mysql-test/suite/galera/r/galera_nopk_blob.result | 4 +- .../galera/r/galera_nopk_large_varchar.result | 4 +- .../suite/galera/r/galera_nopk_unicode.result | 4 +- .../r/galera_parallel_apply_lock_table.result | 8 +- .../r/galera_parallel_autoinc_largetrx.result | 20 +- .../r/galera_parallel_autoinc_manytrx.result | 4 +- .../suite/galera/r/galera_parallel_simple.result | 2 + .../suite/galera/r/galera_pc_recovery.result | 37 + .../suite/galera/r/galera_pk_bigint_signed.result | 4 +- .../galera/r/galera_pk_bigint_unsigned.result | 4 +- .../galera/r/galera_prepared_statement.result | 4 +- .../suite/galera/r/galera_query_cache.result | 2 + .../galera/r/galera_query_cache_sync_wait.result | 2 + mysql-test/suite/galera/r/galera_read_only.result | 2 + .../galera/r/galera_repl_key_format_flat16.result | 2 + .../suite/galera/r/galera_repl_max_ws_size.result | 4 +- .../suite/galera/r/galera_restart_nochanges.result | 2 + .../r/galera_restart_on_unknown_option.result | 2 + mysql-test/suite/galera/r/galera_roles.result | 2 + mysql-test/suite/galera/r/galera_rsu_add_pk.result | 2 + .../suite/galera/r/galera_rsu_drop_pk.result | 2 + mysql-test/suite/galera/r/galera_rsu_error.result | 2 + mysql-test/suite/galera/r/galera_rsu_simple.result | 2 + .../suite/galera/r/galera_rsu_wsrep_desync.result | 2 + mysql-test/suite/galera/r/galera_sbr.result | 2 + mysql-test/suite/galera/r/galera_sbr_binlog.result | 2 + .../galera/r/galera_schema_dirty_reads.result | 2 + .../suite/galera/r/galera_serializable.result | 8 +- mysql-test/suite/galera/r/galera_server.result | 2 + .../suite/galera/r/galera_sql_log_bin_zero.result | 2 + mysql-test/suite/galera/r/galera_ssl.result | 2 + .../suite/galera/r/galera_ssl_compression.result | 2 + .../galera/r/galera_sst_mariabackup,debug.rdiff | 4 +- .../suite/galera/r/galera_sst_mariabackup.result | 2 + .../r/galera_sst_mariabackup_data_dir,debug.rdiff | 116 + .../r/galera_sst_mariabackup_data_dir.result | 292 +++ .../galera_sst_mariabackup_encrypt_with_key.result | 5 + .../r/galera_sst_mariabackup_table_options.result | 999 ++++++++ .../galera/r/galera_sst_mysqldump,debug.rdiff | 22 +- .../galera/r/galera_sst_mysqldump,release.rdiff | 18 + .../suite/galera/r/galera_sst_mysqldump.result | 1 + .../r/galera_sst_mysqldump_with_key,debug.rdiff | 106 + .../galera/r/galera_sst_mysqldump_with_key.result | 97 - mysql-test/suite/galera/r/galera_sst_rsync.result | 2 + .../suite/galera/r/galera_sst_rsync2,debug.rdiff | 12 +- .../galera/r/galera_sst_rsync_data_dir.result | 2 + .../galera/r/galera_sst_xtrabackup-v2,debug.rdiff | 116 - .../r/galera_sst_xtrabackup-v2-options.result | 3 - .../suite/galera/r/galera_sst_xtrabackup-v2.result | 290 --- .../r/galera_sst_xtrabackup-v2_data_dir.result | 262 -- ...alera_sst_xtrabackup-v2_encrypt_with_key.result | 3 - .../suite/galera/r/galera_status_cluster.result | 2 + .../galera/r/galera_status_local_index.result | 2 + .../galera/r/galera_status_local_state.result | 2 + .../suite/galera/r/galera_suspend_slave.result | 2 + .../suite/galera/r/galera_sync_wait_show.result | 2 + .../r/galera_toi_alter_auto_increment.result | 2 + .../suite/galera/r/galera_toi_ddl_error.result | 5 + .../suite/galera/r/galera_toi_ddl_fk_insert.result | 2 + .../suite/galera/r/galera_toi_ddl_fk_update.result | 2 + .../suite/galera/r/galera_toi_ddl_locking.result | 33 +- .../galera/r/galera_toi_ddl_nonconflicting.result | 2 + .../galera/r/galera_toi_ddl_sequential.result | 2 + .../suite/galera/r/galera_toi_drop_database.result | 6 +- mysql-test/suite/galera/r/galera_toi_ftwrl.result | 2 + .../galera/r/galera_toi_lock_exclusive.result | 4 +- .../suite/galera/r/galera_toi_lock_shared.result | 2 + .../suite/galera/r/galera_toi_truncate.result | 4 +- .../galera/r/galera_transaction_read_only.result | 2 + .../galera/r/galera_transaction_replay.result | 96 +- mysql-test/suite/galera/r/galera_truncate.result | 2 + .../galera/r/galera_truncate_temporary.result | 2 + .../galera/r/galera_unicode_identifiers.result | 2 + mysql-test/suite/galera/r/galera_unicode_pk.result | 6 +- .../suite/galera/r/galera_update_limit.result | 2 + .../suite/galera/r/galera_v1_row_events.result | 2 + .../suite/galera/r/galera_var_OSU_method.result | 2 + .../suite/galera/r/galera_var_OSU_method2.result | 2 + .../r/galera_var_auto_inc_control_off.result | 4 +- .../galera/r/galera_var_auto_inc_control_on.result | 2 + .../galera/r/galera_var_certify_nonPK_off.result | 2 + .../galera/r/galera_var_cluster_address.result | 8 +- .../suite/galera/r/galera_var_desync_on.result | 2 + .../suite/galera/r/galera_var_dirty_reads.result | 5 +- .../suite/galera/r/galera_var_fkchecks.result | 2 + .../galera/r/galera_var_gtid_domain_id.result | 2 + .../galera/r/galera_var_ignore_apply_errors.result | 186 ++ .../r/galera_var_innodb_disallow_writes.result | 2 + .../galera/r/galera_var_load_data_splitting.result | 2 + .../suite/galera/r/galera_var_log_bin.result | 2 + .../suite/galera/r/galera_var_max_ws_rows.result | 2 + .../suite/galera/r/galera_var_max_ws_size.result | 4 +- .../r/galera_var_mysql_replication_bundle.result | 2 + .../suite/galera/r/galera_var_node_address.result | 2 + .../galera/r/galera_var_reject_queries.result | 3 +- .../r/galera_var_replicate_myisam_off.result | 2 + .../galera/r/galera_var_replicate_myisam_on.result | 2 + .../galera/r/galera_var_retry_autocommit.result | 28 +- .../suite/galera/r/galera_var_slave_threads.result | 60 +- .../suite/galera/r/galera_var_sst_auth.result | 2 + .../suite/galera/r/galera_var_sync_wait.result | 2 + .../suite/galera/r/galera_var_wsrep_on_off.result | 2 + mysql-test/suite/galera/r/galera_wan.result | 2 + .../suite/galera/r/galera_wan_restart_ist.result | 2 + .../suite/galera/r/galera_wan_restart_sst.result | 2 + .../galera/r/galera_wsrep_desync_wsrep_on.result | 2 + .../galera/r/galera_wsrep_log_conficts.result | 4 +- .../suite/galera/r/galera_wsrep_new_cluster.result | 2 + .../r/galera_wsrep_provider_options_syntax.result | 2 + .../r/galera_wsrep_provider_unset_set.result | 2 + .../galera/r/galera_zero_length_column.result | 2 + mysql-test/suite/galera/r/grant.result | 4 +- mysql-test/suite/galera/r/lp1276424.result | 2 + mysql-test/suite/galera/r/lp1347768.result | 2 + mysql-test/suite/galera/r/lp1376747-2.result | 2 + mysql-test/suite/galera/r/lp1376747-3.result | 2 + mysql-test/suite/galera/r/lp1376747-4.result | 2 + mysql-test/suite/galera/r/lp1376747.result | 2 + mysql-test/suite/galera/r/lp1438990.result | 2 + mysql-test/suite/galera/r/lp959512.result | 2 + mysql-test/suite/galera/r/mdev_10518.result | 2 + mysql-test/suite/galera/r/mdev_9290.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#110.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#198.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#201.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#216.result | 11 + mysql-test/suite/galera/r/mysql-wsrep#237.result | 4 +- mysql-test/suite/galera/r/mysql-wsrep#247.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#31.result | 2 + mysql-test/suite/galera/r/mysql-wsrep#33.result | 6 + mysql-test/suite/galera/r/mysql-wsrep#332.result | 42 +- mysql-test/suite/galera/r/mysql-wsrep#90.result | 2 + mysql-test/suite/galera/r/partition.result | 24 +- mysql-test/suite/galera/r/pxc-421.result | 2 + mysql-test/suite/galera/r/query_cache.result | 2 + mysql-test/suite/galera/r/rename.result | 2 + mysql-test/suite/galera/r/rpl_row_annotate.result | 8 +- mysql-test/suite/galera/r/sql_log_bin.result | 2 + mysql-test/suite/galera/r/unique_key.result | 2 + mysql-test/suite/galera/r/versioning_trx_id.result | 2 + mysql-test/suite/galera/r/view.result | 2 + .../galera/r/wsrep_trx_fragment_size_sr.result | 15 + mysql-test/suite/galera/suite.pm | 12 +- mysql-test/suite/galera/t/GAL-419.test | 4 +- mysql-test/suite/galera/t/GCF-1081.test | 72 + mysql-test/suite/galera/t/GCF-939.test | 31 + mysql-test/suite/galera/t/MW-284.test | 2 + mysql-test/suite/galera/t/MW-286.test | 50 +- mysql-test/suite/galera/t/MW-292.test | 50 +- mysql-test/suite/galera/t/MW-328A.test | 40 +- mysql-test/suite/galera/t/MW-329.test | 28 +- mysql-test/suite/galera/t/MW-336.test | 9 +- mysql-test/suite/galera/t/MW-360-master.opt | 2 + mysql-test/suite/galera/t/MW-360.test | 100 + mysql-test/suite/galera/t/MW-369.inc | 7 +- mysql-test/suite/galera/t/MW-369.test | 100 +- mysql-test/suite/galera/t/MW-388.test | 5 +- mysql-test/suite/galera/t/MW-402.test | 56 +- mysql-test/suite/galera/t/MW-416.test | 8 +- mysql-test/suite/galera/t/MW-86-wait1.test | 13 +- mysql-test/suite/galera/t/MW-86-wait8.test | 11 +- mysql-test/suite/galera/t/galera#500.test | 6 + .../t/galera_FK_duplicate_client_insert.test | 161 ++ .../t/galera_applier_ftwrl_table_alter-master.opt | 2 +- mysql-test/suite/galera/t/galera_as_master.test | 2 + .../suite/galera/t/galera_as_master_gtid.cnf | 2 - .../suite/galera/t/galera_as_master_gtid.test | 24 +- .../t/galera_as_master_gtid_change_master.cnf | 2 - .../t/galera_as_master_gtid_change_master.test | 2 + mysql-test/suite/galera/t/galera_as_slave.test | 17 +- .../suite/galera/t/galera_as_slave_autoinc.test | 18 +- .../suite/galera/t/galera_as_slave_gtid.test | 21 +- .../t/galera_as_slave_gtid_replicate_do_db.cnf | 17 + .../t/galera_as_slave_gtid_replicate_do_db.test | 150 ++ .../t/galera_as_slave_gtid_replicate_do_db_cc.test | 176 ++ .../suite/galera/t/galera_as_slave_nonprim.test | 26 +- .../suite/galera/t/galera_as_slave_preordered.test | 19 +- .../t/galera_as_slave_replication_bundle.test | 13 +- .../galera/t/galera_autoinc_sst_mariabackup.cnf | 11 + .../galera/t/galera_autoinc_sst_mariabackup.test | 105 + .../galera/t/galera_autoinc_sst_xtrabackup.cnf | 12 - .../galera/t/galera_autoinc_sst_xtrabackup.test | 96 - .../galera/t/galera_bf_abort_group_commit.cnf | 15 + .../galera/t/galera_bf_abort_group_commit.test | 77 + .../suite/galera/t/galera_bf_abort_shutdown.test | 33 + mysql-test/suite/galera/t/galera_commit_empty.test | 35 + .../galera/t/galera_create_table_as_select.test | 145 ++ mysql-test/suite/galera/t/galera_defaults.test | 25 +- .../suite/galera/t/galera_drop_database.test | 26 +- .../galera/t/galera_forced_binlog_format.test | 5 +- mysql-test/suite/galera/t/galera_ftwrl_drain.test | 4 +- .../t/galera_gcache_recover_full_gcache.test | 12 +- mysql-test/suite/galera/t/galera_gcs_fragment.test | 4 +- mysql-test/suite/galera/t/galera_gtid-master.opt | 2 +- mysql-test/suite/galera/t/galera_gtid_slave.test | 33 +- .../galera/t/galera_gtid_slave_sst_rsync.test | 110 +- .../galera/t/galera_ist_innodb_flush_logs.cnf | 3 +- .../galera/t/galera_ist_innodb_flush_logs.test | 1 + .../suite/galera/t/galera_ist_mariabackup.cnf | 12 + .../suite/galera/t/galera_ist_mariabackup.test | 16 + .../t/galera_ist_mariabackup_innodb_flush_logs.cnf | 14 + .../galera_ist_mariabackup_innodb_flush_logs.test | 13 + mysql-test/suite/galera/t/galera_ist_progress.test | 4 +- .../suite/galera/t/galera_ist_restart_joiner.test | 4 +- .../suite/galera/t/galera_ist_xtrabackup-v2.cnf | 12 - .../suite/galera/t/galera_ist_xtrabackup-v2.test | 15 - mysql-test/suite/galera/t/galera_kill_applier.test | 1 - mysql-test/suite/galera/t/galera_log_bin.test | 2 + mysql-test/suite/galera/t/galera_many_rows.cnf | 10 + mysql-test/suite/galera/t/galera_many_rows.test | 7 + mysql-test/suite/galera/t/galera_migrate.cnf | 2 + .../galera/t/galera_parallel_apply_lock_table.test | 6 +- .../galera/t/galera_parallel_autoinc_largetrx.test | 11 +- .../galera/t/galera_parallel_autoinc_manytrx.test | 2 +- .../suite/galera/t/galera_parallel_simple.test | 2 +- mysql-test/suite/galera/t/galera_pc_recovery.test | 102 + mysql-test/suite/galera/t/galera_split_brain.test | 6 +- mysql-test/suite/galera/t/galera_ssl.cnf | 4 +- .../suite/galera/t/galera_ssl_compression.cnf | 4 +- mysql-test/suite/galera/t/galera_ssl_upgrade.cnf | 4 +- mysql-test/suite/galera/t/galera_ssl_upgrade.test | 6 +- .../galera/t/galera_sst_mariabackup_data_dir.cnf | 17 + .../galera/t/galera_sst_mariabackup_data_dir.test | 23 + .../t/galera_sst_mariabackup_encrypt_with_key.cnf | 12 + .../t/galera_sst_mariabackup_encrypt_with_key.test | 14 + .../t/galera_sst_mariabackup_table_options.cnf | 16 + .../t/galera_sst_mariabackup_table_options.test | 229 ++ mysql-test/suite/galera/t/galera_sst_mysqldump.cnf | 4 +- .../suite/galera/t/galera_sst_mysqldump.test | 2 - .../galera/t/galera_sst_mysqldump_with_key.cnf | 4 + .../galera/t/galera_sst_xtrabackup-v2-options.cnf | 25 - .../galera/t/galera_sst_xtrabackup-v2-options.test | 13 - .../suite/galera/t/galera_sst_xtrabackup-v2.cnf | 15 - .../suite/galera/t/galera_sst_xtrabackup-v2.test | 20 - .../galera/t/galera_sst_xtrabackup-v2_data_dir.cnf | 16 - .../t/galera_sst_xtrabackup-v2_data_dir.test | 23 - .../galera_sst_xtrabackup-v2_encrypt_with_key.cnf | 12 - .../galera_sst_xtrabackup-v2_encrypt_with_key.test | 14 - .../suite/galera/t/galera_toi_ddl_error.test | 5 + .../suite/galera/t/galera_toi_ddl_locking.test | 54 +- .../suite/galera/t/galera_transaction_replay.test | 201 +- .../suite/galera/t/galera_var_cluster_address.test | 11 +- .../suite/galera/t/galera_var_dirty_reads.test | 12 +- .../galera/t/galera_var_ignore_apply_errors.test | 235 ++ mysql-test/suite/galera/t/galera_var_log_bin.cnf | 5 + .../suite/galera/t/galera_var_reject_queries.test | 7 +- .../galera/t/galera_var_retry_autocommit.test | 24 +- .../suite/galera/t/galera_var_slave_threads.cnf | 7 + .../suite/galera/t/galera_var_slave_threads.test | 139 +- .../galera/t/galera_vote_drop_temporary-master.opt | 1 + .../suite/galera/t/galera_wsrep_new_cluster.test | 1 - .../suite/galera/t/mysql-wsrep#198-master.opt | 1 + mysql-test/suite/galera/t/mysql-wsrep#237.test | 4 +- mysql-test/suite/galera/t/mysql-wsrep#332.test | 2 +- mysql-test/suite/galera/t/partition.test | 30 +- mysql-test/suite/galera/t/rpl_row_annotate.test | 5 +- .../suite/galera/t/wsrep_trx_fragment_size_sr.test | 22 + mysql-test/suite/galera_3nodes/disabled.def | 1 - mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf | 34 +- mysql-test/suite/galera_3nodes/galera_3nodes.cnf | 20 +- .../suite/galera_3nodes/include/galera_resume.inc | 9 + .../suite/galera_3nodes/include/galera_suspend.inc | 2 +- .../suite/galera_3nodes/include/have_ipv6.inc | 15 - .../galera_3nodes/include/have_mariabackup.inc | 4 + mysql-test/suite/galera_3nodes/r/GAL-501.result | 6 + .../r/galera_certification_ccc.result | 2 + .../r/galera_certification_double_failure.result | 5 +- .../r/galera_evs_suspect_timeout.result | 8 + .../suite/galera_3nodes/r/galera_garbd.result | 14 + .../r/galera_innobackupex_backup.result | 11 - .../galera_3nodes/r/galera_ipv6_mariabackup.result | 24 + .../galera_3nodes/r/galera_ipv6_mysqldump.result | 24 +- .../suite/galera_3nodes/r/galera_ipv6_rsync.result | 5 + .../r/galera_ipv6_xtrabackup-v2.result | 18 - .../r/galera_ist_gcache_rollover.result | 2 + .../r/galera_parallel_apply_3nodes.result | 4 +- .../galera_3nodes/r/galera_pc_bootstrap.result | 13 + .../suite/galera_3nodes/r/galera_pc_weight.result | 24 + .../r/galera_safe_to_bootstrap.result | 23 + .../galera_3nodes/r/galera_var_dirty_reads2.result | 7 + .../galera_3nodes/r/galera_wsrep_schema.result | 82 + mysql-test/suite/galera_3nodes/suite.pm | 48 +- mysql-test/suite/galera_3nodes/t/GAL-501.opt | 1 + mysql-test/suite/galera_3nodes/t/GAL-501.test | 8 +- .../t/galera_certification_double_failure.test | 2 + .../t/galera_evs_suspect_timeout.test | 6 +- mysql-test/suite/galera_3nodes/t/galera_garbd.test | 22 +- .../galera_3nodes/t/galera_innobackupex_backup.cnf | 4 + .../t/galera_innobackupex_backup.test | 58 - .../galera_3nodes/t/galera_ipv6_mariabackup.cnf | 34 + .../galera_3nodes/t/galera_ipv6_mariabackup.opt | 1 + .../galera_3nodes/t/galera_ipv6_mariabackup.test | 68 + .../galera_3nodes/t/galera_ipv6_mysqldump.cnf | 10 +- .../galera_3nodes/t/galera_ipv6_mysqldump.opt | 1 + .../galera_3nodes/t/galera_ipv6_mysqldump.test | 48 +- .../suite/galera_3nodes/t/galera_ipv6_rsync.cnf | 10 +- .../suite/galera_3nodes/t/galera_ipv6_rsync.opt | 1 + .../suite/galera_3nodes/t/galera_ipv6_rsync.test | 2 +- .../galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf | 26 - .../galera_3nodes/t/galera_ipv6_xtrabackup-v2.test | 62 - .../t/galera_ist_gcache_rollover.test | 2 +- .../t/galera_parallel_apply_3nodes.test | 2 +- .../suite/galera_3nodes/t/galera_pc_weight.cnf | 8 +- .../suite/galera_3nodes/t/galera_pc_weight.test | 9 +- .../galera_3nodes/t/galera_safe_to_bootstrap.test | 26 +- .../t/galera_slave_options_ignore.test | 1 + .../galera_3nodes/t/galera_var_dirty_reads2.test | 3 +- .../suite/galera_3nodes/t/galera_wsrep_schema.test | 83 + mysql-test/suite/galera_3nodes_sr/disabled.def | 7 + .../suite/galera_3nodes_sr/galera_3nodes.cnf | 1 + mysql-test/suite/galera_3nodes_sr/my.cnf | 1 + mysql-test/suite/galera_3nodes_sr/r/GCF-336.result | 26 + mysql-test/suite/galera_3nodes_sr/r/GCF-582.result | 23 + mysql-test/suite/galera_3nodes_sr/r/GCF-606.result | 38 + mysql-test/suite/galera_3nodes_sr/r/GCF-609.result | 20 + .../suite/galera_3nodes_sr/r/GCF-810A.result | 256 ++ .../suite/galera_3nodes_sr/r/GCF-810B.result | 100 + .../suite/galera_3nodes_sr/r/GCF-810C.result | 177 ++ mysql-test/suite/galera_3nodes_sr/r/GCF-817.result | 54 + mysql-test/suite/galera_3nodes_sr/r/GCF-832.result | 26 + .../r/galera_sr_isolate_master.result | 80 + .../galera_3nodes_sr/r/galera_sr_join_slave.result | 39 + .../r/galera_sr_kill_master.result | 33 + .../r/galera_sr_kill_slave_after_apply.result | 53 + ...alera_sr_kill_slave_after_apply_rollback.result | 58 + ...lera_sr_kill_slave_after_apply_rollback2.result | 31 + .../r/galera_sr_kill_slave_before_apply.result | 44 + .../r/galera_sr_threeway_split.result | 117 + mysql-test/suite/galera_3nodes_sr/t/GCF-336.test | 47 + mysql-test/suite/galera_3nodes_sr/t/GCF-582.test | 39 + mysql-test/suite/galera_3nodes_sr/t/GCF-606.test | 80 + mysql-test/suite/galera_3nodes_sr/t/GCF-609.test | 30 + mysql-test/suite/galera_3nodes_sr/t/GCF-810A.test | 137 ++ mysql-test/suite/galera_3nodes_sr/t/GCF-810B.test | 49 + mysql-test/suite/galera_3nodes_sr/t/GCF-810C.test | 70 + mysql-test/suite/galera_3nodes_sr/t/GCF-817.test | 109 + mysql-test/suite/galera_3nodes_sr/t/GCF-832.test | 43 + .../t/galera_sr_isolate_master.test | 127 + .../galera_3nodes_sr/t/galera_sr_join_slave.test | 59 + .../galera_3nodes_sr/t/galera_sr_kill_master.test | 58 + .../t/galera_sr_kill_slave_after_apply.test | 81 + .../galera_sr_kill_slave_after_apply_rollback.test | 80 + ...galera_sr_kill_slave_after_apply_rollback2.test | 56 + .../t/galera_sr_kill_slave_before_apply.test | 73 + .../t/galera_sr_threeway_split.cnf | 5 + .../t/galera_sr_threeway_split.test | 177 ++ mysql-test/suite/galera_sr/disabled.def | 3 + mysql-test/suite/galera_sr/galera_2nodes.cnf | 1 + mysql-test/suite/galera_sr/my.cnf | 1 + mysql-test/suite/galera_sr/r/GCF-1008.result | 70 + mysql-test/suite/galera_sr/r/GCF-1018.result | 24 + mysql-test/suite/galera_sr/r/GCF-1018B.result | 12 + mysql-test/suite/galera_sr/r/GCF-1043A.result | 21 + mysql-test/suite/galera_sr/r/GCF-1043B.result | 21 + mysql-test/suite/galera_sr/r/GCF-1051.result | 46 + mysql-test/suite/galera_sr/r/GCF-1060.result | 21 + mysql-test/suite/galera_sr/r/GCF-437.result | 12 + mysql-test/suite/galera_sr/r/GCF-561.result | 50 + mysql-test/suite/galera_sr/r/GCF-571.result | 67 + mysql-test/suite/galera_sr/r/GCF-572.result | 37 + mysql-test/suite/galera_sr/r/GCF-574.result | 11 + mysql-test/suite/galera_sr/r/GCF-580.result | 13 + mysql-test/suite/galera_sr/r/GCF-585.result | 28 + mysql-test/suite/galera_sr/r/GCF-597.result | 21 + mysql-test/suite/galera_sr/r/GCF-620.result | 18 + mysql-test/suite/galera_sr/r/GCF-623.result | 29 + mysql-test/suite/galera_sr/r/GCF-627.result | 26 + mysql-test/suite/galera_sr/r/GCF-845.result | 21 + mysql-test/suite/galera_sr/r/GCF-851.result | 30 + mysql-test/suite/galera_sr/r/GCF-867.result | 4 + mysql-test/suite/galera_sr/r/GCF-889.result | 25 + mysql-test/suite/galera_sr/r/GCF-900.result | 21 + .../suite/galera_sr/r/galera-features#56.result | 32 + .../suite/galera_sr/r/galera_sr_bf_abort.result | 555 +++++ mysql-test/suite/galera_sr/r/galera_sr_blob.result | 23 + .../suite/galera_sr/r/galera_sr_cc_master.result | 65 + .../suite/galera_sr/r/galera_sr_cc_slave.result | 59 + .../suite/galera_sr/r/galera_sr_concurrent.result | 36 + .../suite/galera_sr/r/galera_sr_conflict.result | 21 + .../r/galera_sr_conflict_on_commit.result | 31 + .../r/galera_sr_conflict_on_commit2.result | 28 + .../galera_sr_conflict_with_rollback_master.result | 29 + .../suite/galera_sr/r/galera_sr_ddl_master.result | 48 + .../suite/galera_sr/r/galera_sr_ddl_schema.result | 23 + .../suite/galera_sr/r/galera_sr_ddl_slave.result | 50 + .../galera_sr/r/galera_sr_ddl_unrelated.result | 42 + .../galera_sr/r/galera_sr_dupkey_error.result | 46 + .../suite/galera_sr/r/galera_sr_fk_conflict.result | 39 + mysql-test/suite/galera_sr/r/galera_sr_gtid.result | 57 + .../galera_sr/r/galera_sr_insert_select.result | 18 + .../r/galera_sr_kill_all_nobootstrap.result | 29 + .../r/galera_sr_kill_all_norecovery.result | 30 + .../r/galera_sr_kill_all_pcrecovery.result | 30 + .../galera_sr/r/galera_sr_kill_connection.result | 32 + .../suite/galera_sr/r/galera_sr_kill_query.result | 31 + .../suite/galera_sr/r/galera_sr_kill_slave.result | 53 + .../galera_sr/r/galera_sr_large_fragment.result | 33 + .../suite/galera_sr/r/galera_sr_load_data.result | 13 + .../r/galera_sr_load_data_splitting.result | 9 + .../suite/galera_sr/r/galera_sr_log_bin.result | 124 + .../galera_sr/r/galera_sr_many_fragments.result | 33 + .../suite/galera_sr/r/galera_sr_myisam.result | 16 + .../galera_sr/r/galera_sr_mysqldump_sst.result | 58 + .../galera_sr/r/galera_sr_parallel_apply.result | 37 + .../suite/galera_sr/r/galera_sr_rollback.result | 42 + .../galera_sr/r/galera_sr_rollback_retry.result | 33 + .../r/galera_sr_rollback_savepoint.result | 42 + .../r/galera_sr_rollback_statement.result | 22 + mysql-test/suite/galera_sr/r/galera_sr_sbr.result | 16 + .../galera_sr/r/galera_sr_shutdown_master.result | 31 + .../galera_sr/r/galera_sr_shutdown_slave.result | 43 + .../galera_sr/r/galera_sr_small_gcache.result | 15 + .../galera_sr/r/galera_sr_table_contents.result | 198 ++ .../r/galera_sr_transaction_replay.result | 121 + .../galera_sr/r/galera_sr_unit_statements.result | 54 + .../galera_sr/r/galera_sr_v1_row_events.result | 20 + .../suite/galera_sr/r/galera_sr_ws_size.result | 36 + .../suite/galera_sr/r/galera_sr_ws_size2.result | 34 + .../r/galera_var_ignore_apply_errors_sr.result | 29 + .../suite/galera_sr/r/mysql-wsrep#215.result | 137 ++ .../galera_sr/r/mysql-wsrep-features#136.result | 65 + .../galera_sr/r/mysql-wsrep-features#138.result | 24 + .../galera_sr/r/mysql-wsrep-features#14.result | 12 + .../galera_sr/r/mysql-wsrep-features#148.result | 42 + .../galera_sr/r/mysql-wsrep-features#15.result | 11 + .../galera_sr/r/mysql-wsrep-features#165.result | 752 ++++++ .../galera_sr/r/mysql-wsrep-features#22.result | 35 + .../galera_sr/r/mysql-wsrep-features#27.result | 23 + .../galera_sr/r/mysql-wsrep-features#29.result | 14 + .../galera_sr/r/mysql-wsrep-features#32.result | 27 + .../galera_sr/r/mysql-wsrep-features#35.result | 41 + .../galera_sr/r/mysql-wsrep-features#8.result | 39 + .../galera_sr/r/mysql-wsrep-features#9.result | 20 + .../galera_sr/r/mysql-wsrep-features#93.result | 18 + .../galera_sr/r/mysql-wsrep-features#96.result | 33 + mysql-test/suite/galera_sr/t/GCF-1008.inc | 36 + mysql-test/suite/galera_sr/t/GCF-1008.test | 18 + mysql-test/suite/galera_sr/t/GCF-1018.test | 38 + mysql-test/suite/galera_sr/t/GCF-1018B.test | 40 + mysql-test/suite/galera_sr/t/GCF-1043A.test | 13 + mysql-test/suite/galera_sr/t/GCF-1043B.test | 13 + mysql-test/suite/galera_sr/t/GCF-1051.test | 51 + mysql-test/suite/galera_sr/t/GCF-1060.test | 9 + mysql-test/suite/galera_sr/t/GCF-437.test | 21 + mysql-test/suite/galera_sr/t/GCF-561.test | 65 + mysql-test/suite/galera_sr/t/GCF-571.test | 54 + mysql-test/suite/galera_sr/t/GCF-572.test | 54 + mysql-test/suite/galera_sr/t/GCF-574.test | 27 + mysql-test/suite/galera_sr/t/GCF-580.test | 27 + mysql-test/suite/galera_sr/t/GCF-585.test | 44 + mysql-test/suite/galera_sr/t/GCF-597.test | 29 + mysql-test/suite/galera_sr/t/GCF-620.test | 22 + mysql-test/suite/galera_sr/t/GCF-623.test | 31 + mysql-test/suite/galera_sr/t/GCF-627.test | 30 + mysql-test/suite/galera_sr/t/GCF-845.test | 30 + mysql-test/suite/galera_sr/t/GCF-851.test | 24 + mysql-test/suite/galera_sr/t/GCF-867.test | 42 + mysql-test/suite/galera_sr/t/GCF-889.test | 29 + mysql-test/suite/galera_sr/t/GCF-900.test | 28 + .../suite/galera_sr/t/galera-features#56.test | 55 + .../suite/galera_sr/t/galera_sr_bf_abort.inc | 145 ++ .../suite/galera_sr/t/galera_sr_bf_abort.test | 50 + mysql-test/suite/galera_sr/t/galera_sr_blob.test | 38 + .../suite/galera_sr/t/galera_sr_cc_master.test | 98 + .../suite/galera_sr/t/galera_sr_cc_slave.test | 97 + .../suite/galera_sr/t/galera_sr_concurrent.test | 45 + .../suite/galera_sr/t/galera_sr_conflict.test | 45 + .../galera_sr/t/galera_sr_conflict_on_commit.test | 45 + .../galera_sr/t/galera_sr_conflict_on_commit2.test | 46 + .../t/galera_sr_conflict_with_rollback_master.test | 44 + .../suite/galera_sr/t/galera_sr_ddl_master.test | 63 + .../suite/galera_sr/t/galera_sr_ddl_schema.test | 43 + .../suite/galera_sr/t/galera_sr_ddl_slave.test | 65 + .../suite/galera_sr/t/galera_sr_ddl_unrelated.test | 53 + .../suite/galera_sr/t/galera_sr_dupkey_error.test | 59 + .../suite/galera_sr/t/galera_sr_fk_conflict.test | 62 + .../suite/galera_sr/t/galera_sr_gtid-master.opt | 1 + mysql-test/suite/galera_sr/t/galera_sr_gtid.test | 46 + .../suite/galera_sr/t/galera_sr_insert_select.test | 33 + .../t/galera_sr_kill_all_nobootstrap.test | 52 + .../galera_sr/t/galera_sr_kill_all_norecovery.cnf | 4 + .../galera_sr/t/galera_sr_kill_all_norecovery.test | 53 + .../galera_sr/t/galera_sr_kill_all_pcrecovery.test | 54 + .../galera_sr/t/galera_sr_kill_connection.test | 59 + .../suite/galera_sr/t/galera_sr_kill_query.test | 48 + .../suite/galera_sr/t/galera_sr_kill_slave.cnf | 4 + .../suite/galera_sr/t/galera_sr_kill_slave.test | 80 + .../t/galera_sr_large_fragment-master.opt | 1 + .../galera_sr/t/galera_sr_large_fragment.test | 58 + .../suite/galera_sr/t/galera_sr_load_data.test | 39 + .../galera_sr/t/galera_sr_load_data_splitting.test | 50 + .../suite/galera_sr/t/galera_sr_log_bin-master.opt | 1 + .../suite/galera_sr/t/galera_sr_log_bin.test | 70 + .../galera_sr/t/galera_sr_many_fragments.test | 53 + mysql-test/suite/galera_sr/t/galera_sr_myisam.test | 29 + .../suite/galera_sr/t/galera_sr_mysqldump_sst.cnf | 11 + .../suite/galera_sr/t/galera_sr_mysqldump_sst.test | 79 + .../galera_sr/t/galera_sr_parallel_apply.test | 59 + .../suite/galera_sr/t/galera_sr_rollback.test | 76 + .../galera_sr/t/galera_sr_rollback_retry.test | 55 + .../galera_sr/t/galera_sr_rollback_savepoint.test | 51 + .../galera_sr/t/galera_sr_rollback_statement.test | 61 + mysql-test/suite/galera_sr/t/galera_sr_sbr.test | 31 + .../galera_sr/t/galera_sr_shutdown_master.test | 53 + .../galera_sr/t/galera_sr_shutdown_slave.test | 63 + .../suite/galera_sr/t/galera_sr_small_gcache.cnf | 6 + .../suite/galera_sr/t/galera_sr_small_gcache.test | 21 + .../galera_sr/t/galera_sr_table_contents.test | 49 + .../galera_sr/t/galera_sr_transaction_replay.test | 260 ++ .../galera_sr/t/galera_sr_unit_statements.test | 54 + .../galera_sr/t/galera_sr_v1_row_events-master.opt | 1 + .../suite/galera_sr/t/galera_sr_v1_row_events.test | 27 + .../suite/galera_sr/t/galera_sr_ws_size.test | 70 + .../suite/galera_sr/t/galera_sr_ws_size2.test | 62 + .../t/galera_var_ignore_apply_errors_sr.test | 38 + mysql-test/suite/galera_sr/t/mysql-wsrep#215.test | 175 ++ .../t/mysql-wsrep-features#136-master.opt | 1 + .../galera_sr/t/mysql-wsrep-features#136.test | 41 + .../galera_sr/t/mysql-wsrep-features#138.test | 25 + .../suite/galera_sr/t/mysql-wsrep-features#14.test | 21 + .../galera_sr/t/mysql-wsrep-features#148.test | 60 + .../suite/galera_sr/t/mysql-wsrep-features#15.test | 17 + .../suite/galera_sr/t/mysql-wsrep-features#165.inc | 104 + .../galera_sr/t/mysql-wsrep-features#165.test | 41 + .../suite/galera_sr/t/mysql-wsrep-features#22.test | 47 + .../suite/galera_sr/t/mysql-wsrep-features#27.test | 29 + .../suite/galera_sr/t/mysql-wsrep-features#29.test | 23 + .../galera_sr/t/mysql-wsrep-features#32-master.opt | 1 + .../suite/galera_sr/t/mysql-wsrep-features#32.test | 44 + .../suite/galera_sr/t/mysql-wsrep-features#35.test | 48 + .../suite/galera_sr/t/mysql-wsrep-features#8.test | 63 + .../suite/galera_sr/t/mysql-wsrep-features#9.test | 44 + .../suite/galera_sr/t/mysql-wsrep-features#93.test | 29 + .../suite/galera_sr/t/mysql-wsrep-features#96.test | 45 + mysql-test/suite/gcol/r/gcol_bugfixes.result | 2 + mysql-test/suite/gcol/r/gcol_keys_innodb.result | 8 +- mysql-test/suite/gcol/r/gcol_keys_myisam.result | 6 + mysql-test/suite/gcol/r/gcol_select_innodb.result | 7 + mysql-test/suite/gcol/r/gcol_select_myisam.result | 11 + mysql-test/suite/gcol/r/gcol_view_innodb.result | 1 + mysql-test/suite/gcol/r/gcol_view_myisam.result | 1 + .../suite/gcol/r/innodb_virtual_fk_restart.result | 9 + .../suite/gcol/r/innodb_virtual_index.result | 22 +- .../suite/gcol/t/innodb_virtual_fk_restart.test | 9 + mysql-test/suite/gcol/t/innodb_virtual_index.test | 19 + mysql-test/suite/handler/aria.result | 4 +- mysql-test/suite/handler/heap.result | 5 +- mysql-test/suite/handler/innodb.result | 4 +- mysql-test/suite/handler/interface.result | 6 +- mysql-test/suite/handler/interface.test | 6 +- mysql-test/suite/handler/myisam.result | 4 +- mysql-test/suite/innodb/include/alter_instant.inc | 33 - mysql-test/suite/innodb/include/crc32.pl | 33 + .../suite/innodb/r/alter_candidate_key.result | 114 + .../suite/innodb/r/alter_inplace_perfschema.result | 9 +- mysql-test/suite/innodb/r/analyze_table.result | 1 + mysql-test/suite/innodb/r/data_types.result | 23 +- .../r/default_row_format_create,redundant.rdiff | 11 + .../innodb/r/default_row_format_create.result | 22 +- mysql-test/suite/innodb/r/innochecksum.result | 5 - .../suite/innodb/r/innodb-alter-debug.result | 23 + .../suite/innodb/r/innodb-alter-table.result | 1 + mysql-test/suite/innodb/r/innodb-alter.result | 35 +- .../suite/innodb/r/innodb-index-online.result | 7 +- mysql-test/suite/innodb/r/innodb-index.result | 48 + .../suite/innodb/r/innodb-online-alter-gis.result | 2 +- .../suite/innodb/r/innodb-table-online.result | 12 +- .../suite/innodb/r/innodb-update-insert.result | 4 +- .../suite/innodb/r/innodb-virtual-columns.result | 13 + .../suite/innodb/r/innodb-wl5522-debug.result | 6 - mysql-test/suite/innodb/r/innodb.result | 3 +- mysql-test/suite/innodb/r/innodb_28867993.result | 9 + .../suite/innodb/r/innodb_bug14676111.result | 6 + mysql-test/suite/innodb/r/innodb_bug30423.result | 11 + mysql-test/suite/innodb/r/innodb_bug53046.result | 1 + mysql-test/suite/innodb/r/innodb_bug57252.result | 1 + .../innodb/r/innodb_max_recordsize_32k.result | 6 + .../innodb/r/innodb_max_recordsize_64k.result | 6 + mysql-test/suite/innodb/r/innodb_mysql.result | 15 +- .../innodb/r/innodb_skip_innodb_is_tables.result | 1 - mysql-test/suite/innodb/r/innodb_stats.result | 10 + .../suite/innodb/r/innodb_stats_drop_locked.result | 1 + .../suite/innodb/r/innodb_stats_fetch.result | 4 + .../innodb/r/innodb_stats_fetch_corrupted.result | 4 + .../innodb/r/innodb_stats_fetch_nonexistent.result | 4 + .../suite/innodb/r/innodb_stats_persistent.result | 3 +- .../innodb/r/innodb_stats_persistent_debug.result | 1 + .../suite/innodb/r/innodb_zip_innochecksum.result | 91 - .../suite/innodb/r/innodb_zip_innochecksum2.result | 160 -- .../suite/innodb/r/innodb_zip_innochecksum3.result | 227 -- mysql-test/suite/innodb/r/instant_alter.result | 635 ++++- .../suite/innodb/r/instant_alter_bugs.result | 130 + .../suite/innodb/r/instant_alter_crash.result | 30 +- .../suite/innodb/r/instant_alter_debug.result | 40 + .../suite/innodb/r/instant_alter_null.result | 56 + .../innodb/r/instant_alter_purge,release.rdiff | 18 + .../suite/innodb/r/instant_alter_purge.result | 46 + mysql-test/suite/innodb/r/instant_drop.result | 27 +- .../suite/innodb/r/instant_varchar_enlarge.result | 9 + mysql-test/suite/innodb/r/monitor.result | 1 - mysql-test/suite/innodb/r/purge_secondary.result | 1 + mysql-test/suite/innodb/r/table_flags.result | 5 + mysql-test/suite/innodb/r/truncate.result | 33 + .../suite/innodb/r/undo_truncate_recover.result | 1 - mysql-test/suite/innodb/t/alter_candidate_key.test | 72 + .../suite/innodb/t/alter_inplace_perfschema.test | 8 +- mysql-test/suite/innodb/t/data_types.test | 22 +- .../suite/innodb/t/default_row_format_create.test | 20 +- mysql-test/suite/innodb/t/innochecksum.test | 32 - mysql-test/suite/innodb/t/innodb-alter-debug.test | 32 + mysql-test/suite/innodb/t/innodb-alter.test | 18 +- mysql-test/suite/innodb/t/innodb-index.test | 55 +- mysql-test/suite/innodb/t/innodb-table-online.test | 4 - .../suite/innodb/t/innodb-virtual-columns.test | 11 + mysql-test/suite/innodb/t/innodb-wl5522-debug.test | 14 - mysql-test/suite/innodb/t/innodb_28867993.test | 12 + .../suite/innodb/t/innodb_zip_innochecksum.opt | 2 - .../suite/innodb/t/innodb_zip_innochecksum.test | 239 -- .../suite/innodb/t/innodb_zip_innochecksum2.opt | 3 - .../suite/innodb/t/innodb_zip_innochecksum2.test | 118 - .../suite/innodb/t/innodb_zip_innochecksum3.opt | 1 - .../suite/innodb/t/innodb_zip_innochecksum3.test | 406 --- mysql-test/suite/innodb/t/instant_alter.test | 236 ++ mysql-test/suite/innodb/t/instant_alter_bugs.test | 138 ++ mysql-test/suite/innodb/t/instant_alter_crash.test | 10 +- mysql-test/suite/innodb/t/instant_alter_debug.test | 40 + mysql-test/suite/innodb/t/instant_alter_null.test | 57 + mysql-test/suite/innodb/t/instant_alter_purge.test | 75 + mysql-test/suite/innodb/t/instant_drop.test | 14 +- .../suite/innodb/t/instant_varchar_enlarge.test | 8 + mysql-test/suite/innodb/t/log_file_name_debug.test | 4 +- .../suite/innodb/t/purge_thread_shutdown.test | 4 +- mysql-test/suite/innodb/t/recovery_shutdown.test | 6 + mysql-test/suite/innodb/t/table_flags.test | 6 + mysql-test/suite/innodb/t/truncate.test | 35 + .../suite/innodb/t/undo_truncate_recover.test | 4 - mysql-test/suite/innodb_fts/r/create.result | 20 +- .../suite/innodb_fts/r/innodb-fts-ddl.result | 11 +- .../suite/innodb_fts/r/innodb-fts-fic.result | 2 + .../suite/innodb_fts/r/innodb-fts-stopword.result | 4 + .../suite/innodb_fts/r/innodb_fts_misc_1.result | 4 + mysql-test/suite/innodb_fts/t/create.test | 16 + mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test | 10 + mysql-test/suite/innodb_gis/r/1.result | 4 +- .../suite/innodb_gis/r/alter_spatial_index.result | 9 +- .../suite/innodb_gis/r/create_spatial_index.result | 3 + mysql-test/suite/innodb_gis/r/gis.result | 4 +- .../suite/innodb_gis/r/innodb_gis_rtree.result | 1 + mysql-test/suite/innodb_gis/r/rt_precise.result | 1 + mysql-test/suite/innodb_gis/r/rtree.result | 2 + .../suite/innodb_gis/r/rtree_estimate.result | 1 + mysql-test/suite/innodb_zip/r/innodb-zip.result | 4 + .../suite/innodb_zip/r/wl5522_debug_zip.result | 6 - mysql-test/suite/innodb_zip/t/innochecksum.test | 4 + .../suite/innodb_zip/t/wl5522_debug_zip.test | 14 - .../large_tests/r/rpl_slave_net_timeout.result | 4 + mysql-test/suite/maria/icp.result | 2 +- mysql-test/suite/maria/maria-autozerofill.result | 1 + .../suite/maria/maria-gis-rtree-dynamic.result | 1 + .../suite/maria/maria-gis-rtree-trans.result | 1 + mysql-test/suite/maria/maria-gis-rtree.result | 1 + mysql-test/suite/maria/maria.result | 9 +- mysql-test/suite/maria/maria3.result | 2 + mysql-test/suite/maria/system_tables.result | 1 + mysql-test/suite/maria/system_tables.test | 4 +- mysql-test/suite/mariabackup/backup_grants.result | 5 + mysql-test/suite/mariabackup/backup_grants.test | 30 + .../mariabackup/drop_table_during_backup.result | 5 + .../mariabackup/drop_table_during_backup.test | 9 + .../mariabackup/encrypted_page_compressed.opt | 6 + .../mariabackup/encrypted_page_compressed.result | 7 + .../mariabackup/encrypted_page_compressed.test | 48 + .../mariabackup/encrypted_page_corruption.opt | 6 + .../mariabackup/encrypted_page_corruption.result | 8 + .../mariabackup/encrypted_page_corruption.test | 70 + mysql-test/suite/mariabackup/huge_lsn.opt | 4 + mysql-test/suite/mariabackup/partition_partial.opt | 1 + .../suite/mariabackup/partition_partial.result | 31 + .../suite/mariabackup/partition_partial.test | 44 + .../suite/mariabackup/rename_during_backup.result | 9 + .../suite/mariabackup/rename_during_backup.test | 7 + .../mariabackup/unencrypted_page_compressed.result | 11 + .../mariabackup/unencrypted_page_compressed.test | 50 + .../suite/mariabackup/xb_aws_key_management.result | 5 - .../parts/r/partition_alter1_1_2_innodb.result | 56 + .../parts/r/partition_alter1_1_2_myisam.result | 16 + .../suite/parts/r/partition_alter1_1_innodb.result | 32 + .../suite/parts/r/partition_alter1_1_myisam.result | 16 + .../suite/parts/r/partition_alter1_2_innodb.result | 80 + .../suite/parts/r/partition_alter1_2_myisam.result | 32 + .../parts/r/partition_alter2_1_1_innodb.result | 40 + .../parts/r/partition_alter2_1_2_innodb.result | 40 + .../suite/parts/r/partition_alter2_1_maria.result | 48 + .../suite/parts/r/partition_alter2_1_myisam.result | 48 + .../parts/r/partition_alter2_2_1_innodb.result | 40 + .../parts/r/partition_alter2_2_2_innodb.result | 40 + .../suite/parts/r/partition_alter2_2_maria.result | 48 + .../suite/parts/r/partition_alter2_2_myisam.result | 48 + .../suite/parts/r/partition_alter4_innodb.result | 216 ++ .../suite/parts/r/partition_alter4_myisam.result | 216 ++ .../suite/parts/r/partition_basic_innodb.result | 64 + .../suite/parts/r/partition_basic_myisam.result | 32 + .../parts/r/partition_basic_symlink_myisam.result | 39 + .../suite/parts/r/partition_engine_innodb.result | 11 + .../suite/parts/r/partition_engine_myisam.result | 11 + .../suite/parts/r/partition_mgm_lc0_innodb.result | 1 + .../suite/parts/r/partition_mgm_lc0_memory.result | 1 + .../suite/parts/r/partition_mgm_lc0_myisam.result | 1 + .../suite/parts/r/partition_mgm_lc1_innodb.result | 1 + .../suite/parts/r/partition_mgm_lc1_memory.result | 1 + .../suite/parts/r/partition_mgm_lc1_myisam.result | 1 + .../suite/parts/r/partition_mgm_lc2_innodb.result | 1 + .../suite/parts/r/partition_mgm_lc2_memory.result | 1 + .../suite/parts/r/partition_mgm_lc2_myisam.result | 1 + .../suite/parts/r/partition_repair_myisam.result | 3 +- .../perfschema/r/dml_setup_instruments.result | 4 +- .../suite/perfschema/r/event_aggregate.result | 412 ++-- .../suite/perfschema/r/event_aggregate_no_a.result | 344 +-- .../perfschema/r/event_aggregate_no_a_no_h.result | 268 +- .../perfschema/r/event_aggregate_no_a_no_u.result | 272 +- .../r/event_aggregate_no_a_no_u_no_h.result | 196 +- .../suite/perfschema/r/event_aggregate_no_h.result | 336 +-- .../suite/perfschema/r/event_aggregate_no_u.result | 340 +-- .../perfschema/r/event_aggregate_no_u_no_h.result | 264 +- .../r/hostcache_ipv4_nameinfo_again_allow.result | 4 +- .../r/hostcache_ipv6_nameinfo_again_allow.result | 4 +- .../suite/perfschema/r/privilege_table_io.result | 12 +- .../perfschema/r/setup_instruments_defaults.result | 1 - .../suite/perfschema/r/socket_connect.result | 13 - .../suite/perfschema/r/stage_mdl_global.result | 2 +- mysql-test/suite/perfschema/t/socket_connect.test | 9 +- .../suite/perfschema/t/stage_mdl_global.test | 4 +- mysql-test/suite/plugins/r/audit_null.result | 6 + mysql-test/suite/plugins/r/auth_ed25519.result | 2 +- .../suite/plugins/r/cracklib_password_check.result | 2 +- .../suite/plugins/r/feedback_plugin_load.result | 2 +- .../suite/plugins/r/feedback_plugin_send.result | 2 +- .../r/max_password_errors_auth_named_pipe.result | 12 + .../r/max_password_errors_auth_socket.result | 12 + mysql-test/suite/plugins/r/server_audit.result | 22 +- mysql-test/suite/plugins/r/show_all_plugins.result | 4 +- .../suite/plugins/r/simple_password_check.result | 4 +- mysql-test/suite/plugins/r/sql_error_log.result | 4 +- .../plugins/r/thread_pool_server_audit.result | 22 +- .../suite/plugins/t/feedback_plugin_load.test | 4 +- .../t/max_password_errors_auth_named_pipe.opt | 1 + .../t/max_password_errors_auth_named_pipe.test | 22 + .../plugins/t/max_password_errors_auth_socket.opt | 1 + .../plugins/t/max_password_errors_auth_socket.test | 23 + .../suite/plugins/t/simple_password_check.test | 2 +- mysql-test/suite/roles/create_and_drop_role.result | 6 +- .../create_and_drop_role_invalid_user_table.result | 1 - .../create_and_drop_role_invalid_user_table.test | 7 +- .../roles/default_create_user_not_role.result | 2 +- mysql-test/suite/roles/flush_roles-17898.result | 9 + mysql-test/suite/roles/flush_roles-17898.test | 12 + mysql-test/suite/roles/grant_revoke_current.result | 3 +- mysql-test/suite/roles/grant_revoke_current.test | 5 +- .../suite/roles/grant_role_auto_create_user.result | 2 +- .../roles/i_s_applicable_roles_is_default.result | 1 + .../roles/i_s_applicable_roles_is_default.test | 2 +- mysql-test/suite/roles/none_public.result | 12 +- mysql-test/suite/roles/none_public.test | 6 +- .../suite/roles/prepare_stmt_with_role.result | 6 +- mysql-test/suite/roles/rename_user.result | 2 +- .../suite/roles/role_case_sensitive-10744.result | 2 +- .../suite/roles/set_default_role_clear.result | 8 +- mysql-test/suite/roles/set_default_role_for.result | 13 +- mysql-test/suite/roles/set_default_role_for.test | 3 - .../suite/roles/set_default_role_invalid.result | 6 +- .../roles/set_default_role_new_connection.result | 10 +- .../suite/roles/set_default_role_ps-6960.result | 3 +- .../suite/roles/set_default_role_ps-6960.test | 7 +- .../suite/roles/set_role-database-recursive.result | 2 +- .../suite/roles/set_role-database-simple.result | 2 +- mysql-test/suite/roles/set_role-recursive.result | 2 +- .../suite/roles/set_role-routine-simple.result | 2 +- mysql-test/suite/roles/set_role-simple.result | 2 +- .../suite/roles/set_role-table-column-priv.result | 2 +- .../suite/roles/set_role-table-simple.result | 2 +- mysql-test/suite/roles/show_grants.result | 2 +- .../suite/roles/show_grants_replicated.result | 2 +- mysql-test/suite/rpl/disabled.def | 1 + mysql-test/suite/rpl/include/rpl_EE_err.test | 2 +- mysql-test/suite/rpl/include/rpl_row_001.test | 96 - mysql-test/suite/rpl/include/rpl_row_annotate.test | 2 +- .../suite/rpl/include/rpl_row_delayed_ins.test | 2 +- mysql-test/suite/rpl/r/rpl_EE_err.result | 2 +- mysql-test/suite/rpl/r/rpl_bug31076.result | 2 +- mysql-test/suite/rpl/r/rpl_create_drop_user.result | 22 +- .../suite/rpl/r/rpl_create_if_not_exists.result | 2 - mysql-test/suite/rpl/r/rpl_ddl.result | 12 +- mysql-test/suite/rpl/r/rpl_do_grant.result | 24 +- .../suite/rpl/r/rpl_extra_col_master_innodb.result | 2 +- .../suite/rpl/r/rpl_extra_col_master_myisam.result | 2 +- mysql-test/suite/rpl/r/rpl_grant.result | 8 +- mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result | 40 +- mysql-test/suite/rpl/r/rpl_gtid_stop_start.result | 8 +- mysql-test/suite/rpl/r/rpl_idempotency.result | 17 + mysql-test/suite/rpl/r/rpl_ignore_revoke.result | 10 +- mysql-test/suite/rpl/r/rpl_ignore_table.result | 9 +- mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result | 45 +- .../rpl/r/rpl_mixed_implicit_commit_binlog.result | 1 + .../rpl/r/rpl_mysql57_stm_temporal_round.result | 22 + .../rpl/r/rpl_mysql80_stm_temporal_round.result | 23 + mysql-test/suite/rpl/r/rpl_parallel.result | 1 + .../suite/rpl/r/rpl_parallel_optimistic.result | 16 +- mysql-test/suite/rpl/r/rpl_rewrt_db.result | 6 +- mysql-test/suite/rpl/r/rpl_row_001.result | 42 +- mysql-test/suite/rpl/r/rpl_row_annotate_do.result | 2 +- .../suite/rpl/r/rpl_row_annotate_dont.result | 2 +- .../suite/rpl/r/rpl_row_big_table_id,32bit.rdiff | 31 + mysql-test/suite/rpl/r/rpl_row_big_table_id.result | 46 + mysql-test/suite/rpl/r/rpl_row_delayed_ins.result | 2 +- .../rpl/r/rpl_row_implicit_commit_binlog.result | 1 + mysql-test/suite/rpl/r/rpl_stm_000001.result | 33 +- .../rpl/r/rpl_stm_implicit_commit_binlog.result | 1 + mysql-test/suite/rpl/r/rpl_temporal_round.result | 50 + .../suite/rpl/r/rpl_tmp_table_and_DDL.result | 22 +- mysql-test/suite/rpl/r/rpl_user.result | 11 + mysql-test/suite/rpl/t/rpl_do_grant.test | 30 +- mysql-test/suite/rpl/t/rpl_gtid_crash.test | 2 + mysql-test/suite/rpl/t/rpl_gtid_mdev4484.test | 68 +- mysql-test/suite/rpl/t/rpl_idempotency.test | 21 + mysql-test/suite/rpl/t/rpl_ignore_table.test | 4 +- .../rpl/t/rpl_mysql57_stm_temporal_round.test | 58 + .../rpl/t/rpl_mysql80_stm_temporal_round.test | 62 + .../suite/rpl/t/rpl_parallel_optimistic.test | 42 +- mysql-test/suite/rpl/t/rpl_row_001.test | 48 +- mysql-test/suite/rpl/t/rpl_row_big_table_id.test | 57 + mysql-test/suite/rpl/t/rpl_stm_000001.test | 21 +- mysql-test/suite/rpl/t/rpl_temporal_round.test | 35 + mysql-test/suite/rpl/t/rpl_user.test | 11 + mysql-test/suite/storage_engine/type_bool.result | 4 +- .../suite/sys_vars/r/max_seeks_for_key_func.result | 1 + .../sys_vars/r/myisam_stats_method_func.result | 6 +- ...ptimizer_use_condition_selectivity_basic.result | 20 +- mysql-test/suite/sys_vars/r/sql_mode_basic.result | 10 +- .../sys_vars/r/sysvars_server_embedded.result | 44 +- .../sys_vars/r/sysvars_server_notembedded.result | 58 +- mysql-test/suite/sys_vars/r/sysvars_wsrep.result | 58 +- .../sys_vars/r/table_definition_cache_basic.result | 16 +- .../suite/sys_vars/r/use_stat_tables_basic.result | 10 +- .../sys_vars/r/wsrep_provider_options_basic.result | 15 +- .../suite/sys_vars/r/wsrep_sst_method_basic.result | 4 + .../t/aria_used_for_temp_tables_basic.test | 1 + mysql-test/suite/sys_vars/t/sql_mode_basic.test | 8 +- mysql-test/suite/sys_vars/t/sysvars_aria.test | 1 + .../sys_vars/t/table_definition_cache_basic.test | 6 +- .../suite/sys_vars/t/tmp_disk_table_size_func.test | 2 + .../sys_vars/t/wsrep_provider_options_basic.test | 16 +- .../suite/sys_vars/t/wsrep_sst_method_basic.test | 5 + mysql-test/suite/vcol/r/update.result | 4 +- mysql-test/suite/vcol/r/update_binlog.result | 8 +- mysql-test/suite/vcol/r/upgrade.result | 16 + mysql-test/suite/vcol/r/vcol_keys_myisam.result | 1 + mysql-test/suite/vcol/r/vcol_misc.result | 28 +- mysql-test/suite/vcol/t/update.test | 4 +- mysql-test/suite/vcol/t/upgrade.test | 15 + mysql-test/suite/vcol/t/vcol_misc.test | 27 +- mysql-test/suite/versioning/r/alter.result | 2 +- mysql-test/suite/versioning/r/cte.result | 2 +- mysql-test/suite/versioning/r/foreign.result | 9 + mysql-test/suite/versioning/r/online.result | 28 + mysql-test/suite/versioning/r/sysvars.result | 15 +- mysql-test/suite/versioning/t/alter.test | 2 +- mysql-test/suite/versioning/t/foreign.test | 14 + mysql-test/suite/versioning/t/online.test | 44 + mysql-test/suite/versioning/t/sysvars.test | 10 + mysql-test/suite/wsrep/disabled.def | 3 +- mysql-test/suite/wsrep/my.cnf | 4 +- mysql-test/suite/wsrep/r/variables.result | 3 - .../suite/wsrep/r/wsrep-recover,binlogon.rdiff | 28 + mysql-test/suite/wsrep/r/wsrep-recover.result | 66 + mysql-test/suite/wsrep/suite.pm | 4 +- mysql-test/suite/wsrep/t/binlog_format.cnf | 8 + mysql-test/suite/wsrep/t/binlog_format.opt | 1 - mysql-test/suite/wsrep/t/binlog_format.test | 1 + mysql-test/suite/wsrep/t/mdev_10186.cnf | 6 + mysql-test/suite/wsrep/t/mdev_10186.opt | 1 - mysql-test/suite/wsrep/t/mdev_10186.test | 1 + mysql-test/suite/wsrep/t/mdev_6832.cnf | 7 + mysql-test/suite/wsrep/t/mdev_6832.opt | 1 - mysql-test/suite/wsrep/t/mdev_6832.test | 1 + mysql-test/suite/wsrep/t/mdev_7798.cnf | 7 + mysql-test/suite/wsrep/t/mdev_7798.opt | 1 - mysql-test/suite/wsrep/t/mdev_7798.test | 1 + mysql-test/suite/wsrep/t/pool_of_threads.cnf | 8 + mysql-test/suite/wsrep/t/pool_of_threads.opt | 1 - mysql-test/suite/wsrep/t/variables.test | 6 +- mysql-test/suite/wsrep/t/wsrep-recover-step.inc | 41 + mysql-test/suite/wsrep/t/wsrep-recover.cnf | 9 + .../suite/wsrep/t/wsrep-recover.combinations | 4 + mysql-test/suite/wsrep/t/wsrep-recover.test | 204 ++ mysys/mf_iocache.c | 12 +- mysys/safemalloc.c | 4 +- mysys/thr_alarm.c | 6 +- plugin/feedback/sender_thread.cc | 11 +- plugin/handler_socket/handlersocket/database.cpp | 6 +- plugin/metadata_lock_info/metadata_lock_info.cc | 29 +- .../metadata_lock_info/r/global_read_lock.result | 3 +- plugin/query_response_time/query_response_time.cc | 39 +- plugin/wsrep_info/mysql-test/wsrep_info/my.cnf | 7 +- .../mysql-test/wsrep_info/r/plugin.result | 10 +- plugin/wsrep_info/mysql-test/wsrep_info/suite.pm | 4 +- plugin/wsrep_info/plugin.cc | 87 +- scripts/CMakeLists.txt | 6 +- scripts/galera_new_cluster.sh | 2 +- scripts/mysql_install_db.sh | 7 + scripts/mysql_secure_installation.sh | 6 +- scripts/mysql_system_tables.sql | 63 +- scripts/mysql_system_tables_data.sql | 26 +- scripts/mysql_system_tables_fix.sql | 76 +- scripts/mysql_test_db.sql | 4 +- scripts/mysqld_safe.sh | 11 +- scripts/mytop.sh | 19 +- scripts/wsrep_sst_common.sh | 6 +- scripts/wsrep_sst_mariabackup.sh | 155 +- scripts/wsrep_sst_mysqldump.sh | 5 +- scripts/wsrep_sst_rsync.sh | 27 +- scripts/wsrep_sst_xtrabackup-v2.sh | 1260 ---------- scripts/wsrep_sst_xtrabackup.sh | 692 ------ sql-common/my_time.c | 515 ++-- sql/CMakeLists.txt | 25 +- sql/backup.cc | 385 +++ sql/backup.h | 34 + sql/compat56.cc | 21 +- sql/compat56.h | 9 + sql/event_data_objects.cc | 34 +- sql/event_parse_data.cc | 14 +- sql/event_scheduler.cc | 24 +- sql/field.cc | 454 ++-- sql/field.h | 86 +- sql/field_conv.cc | 33 +- sql/filesort.cc | 115 +- sql/filesort.h | 3 + sql/gen_lex_token.cc | 8 +- sql/ha_partition.cc | 9 +- sql/ha_partition.h | 4 - sql/ha_sequence.cc | 2 +- sql/handle_connections_win.cc | 4 +- sql/handler.cc | 386 ++- sql/handler.h | 49 +- sql/init.h | 1 - sql/innodb_priv.h | 4 +- sql/item.cc | 217 +- sql/item.h | 300 ++- sql/item_cmpfunc.cc | 228 +- sql/item_cmpfunc.h | 46 +- sql/item_create.cc | 101 + sql/item_func.cc | 68 +- sql/item_func.h | 26 +- sql/item_inetfunc.cc | 544 ++-- sql/item_inetfunc.h | 60 +- sql/item_jsonfunc.cc | 9 +- sql/item_strfunc.cc | 107 +- sql/item_strfunc.h | 51 + sql/item_subselect.cc | 26 +- sql/item_subselect.h | 1 + sql/item_sum.cc | 28 + sql/item_sum.h | 15 +- sql/item_timefunc.cc | 190 +- sql/item_timefunc.h | 54 +- sql/item_vers.cc | 4 +- sql/lex.h | 41 +- sql/lock.cc | 183 +- sql/log.cc | 130 +- sql/log.h | 17 +- sql/log_event.cc | 152 +- sql/log_event.h | 53 +- sql/mdl.cc | 626 +++-- sql/mdl.h | 123 +- sql/my_decimal.cc | 4 +- sql/my_decimal.h | 3 +- sql/mysql_install_db.cc | 14 +- sql/mysql_upgrade_service.cc | 189 +- sql/mysqld.cc | 1252 ++++------ sql/mysqld.h | 28 +- sql/opt_range.cc | 14 +- sql/partition_info.cc | 21 +- sql/partition_info.h | 1 + sql/protocol.cc | 22 +- sql/rpl_gtid.cc | 413 ++-- sql/rpl_gtid.h | 12 +- sql/rpl_mi.cc | 4 +- sql/rpl_mi.h | 6 +- sql/rpl_parallel.cc | 4 +- sql/rpl_record.cc | 3 +- sql/rpl_rli.cc | 87 +- sql/rpl_rli.h | 11 - sql/semisync_master_ack_receiver.cc | 61 +- sql/semisync_master_ack_receiver.h | 147 +- sql/service_wsrep.cc | 255 ++ sql/share/errmsg-utf8.txt | 16 +- sql/slave.cc | 197 +- sql/slave.h | 1 + sql/sp.cc | 7 +- sql/sp.h | 3 +- sql/sp_head.cc | 58 +- sql/sp_pcontext.cc | 13 + sql/sp_pcontext.h | 8 +- sql/sp_rcontext.cc | 27 - sql/sql_acl.cc | 2338 ++++++++++-------- sql/sql_admin.cc | 2 +- sql/sql_alter.cc | 2 + sql/sql_array.h | 10 +- sql/sql_base.cc | 661 +++-- sql/sql_base.h | 23 +- sql/sql_basic_types.h | 265 +- sql/sql_cache.cc | 4 +- sql/sql_class.cc | 259 +- sql/sql_class.h | 423 +++- sql/sql_cmd.h | 1 + sql/sql_connect.cc | 32 +- sql/sql_const.h | 12 +- sql/sql_cursor.cc | 5 + sql/sql_db.cc | 11 +- sql/sql_db.h | 3 +- sql/sql_delete.cc | 4 +- sql/sql_handler.cc | 14 +- sql/sql_handler.h | 1 + sql/sql_insert.cc | 183 +- sql/sql_lex.cc | 167 +- sql/sql_lex.h | 31 +- sql/sql_load.cc | 11 +- sql/sql_parse.cc | 935 +++---- sql/sql_parse.h | 3 +- sql/sql_partition.cc | 2 + sql/sql_plugin.cc | 30 +- sql/sql_plugin_services.ic | 59 +- sql/sql_prepare.cc | 60 +- sql/sql_reload.cc | 59 +- sql/sql_repl.cc | 123 +- sql/sql_select.cc | 121 +- sql/sql_show.cc | 531 ++-- sql/sql_signal.cc | 10 +- sql/sql_sort.h | 1 - sql/sql_statistics.cc | 98 +- sql/sql_statistics.h | 28 + sql/sql_string.cc | 176 +- sql/sql_string.h | 1036 +++++--- sql/sql_table.cc | 197 +- sql/sql_time.cc | 74 +- sql/sql_time.h | 22 +- sql/sql_trigger.cc | 9 +- sql/sql_trigger.h | 3 + sql/sql_truncate.cc | 2 + sql/sql_type.cc | 716 +++++- sql/sql_type.h | 1145 ++++++++- sql/sql_type_int.h | 44 + sql/sql_udf.cc | 3 + sql/sql_udf.h | 15 + sql/sql_union.cc | 7 +- sql/sql_update.cc | 2 +- sql/sql_yacc.yy | 686 ++++-- sql/sql_yacc_ora.yy | 664 +++-- sql/structs.h | 41 +- sql/sys_vars.cc | 84 +- sql/sys_vars.ic | 7 +- sql/table.cc | 29 +- sql/table.h | 58 +- sql/table_cache.cc | 32 +- sql/table_cache.h | 2 +- sql/temporary_tables.cc | 50 +- sql/threadpool_common.cc | 2 +- sql/threadpool_generic.cc | 52 +- sql/transaction.cc | 56 +- sql/udf_example.c | 139 ++ sql/udf_example.def | 7 + sql/unireg.h | 2 +- sql/upgrade_conf_file.cc | 177 ++ sql/vers_string.h | 6 + sql/vers_utils.h | 39 - sql/wsrep_applier.cc | 320 +-- sql/wsrep_applier.h | 67 +- sql/wsrep_binlog.cc | 341 +-- sql/wsrep_binlog.h | 35 +- sql/wsrep_check_opts.cc | 4 +- sql/wsrep_client_service.cc | 307 +++ sql/wsrep_client_service.h | 63 + sql/wsrep_client_state.h | 47 + sql/wsrep_condition_variable.h | 54 + sql/wsrep_dummy.cc | 112 +- sql/wsrep_high_priority_service.cc | 649 +++++ sql/wsrep_high_priority_service.h | 118 + sql/wsrep_hton.cc | 658 ----- sql/wsrep_mutex.h | 50 + sql/wsrep_mysqld.cc | 2600 ++++++++++---------- sql/wsrep_mysqld.h | 394 ++- sql/wsrep_notify.cc | 77 +- sql/wsrep_plugin.cc | 53 + sql/wsrep_priv.h | 24 +- sql/wsrep_schema.cc | 1360 ++++++++++ sql/wsrep_schema.h | 161 ++ sql/wsrep_server_service.cc | 318 +++ sql/wsrep_server_service.h | 81 + sql/wsrep_server_state.cc | 82 + sql/wsrep_server_state.h | 66 + sql/wsrep_sst.cc | 621 ++--- sql/wsrep_sst.h | 33 +- sql/wsrep_storage_service.cc | 238 ++ sql/wsrep_storage_service.h | 48 + sql/wsrep_thd.cc | 787 ++---- sql/wsrep_thd.h | 216 +- sql/wsrep_trans_observer.h | 423 ++++ sql/wsrep_types.h | 29 + sql/wsrep_utils.cc | 104 +- sql/wsrep_utils.h | 79 +- sql/wsrep_var.cc | 324 ++- sql/wsrep_var.h | 11 +- sql/wsrep_xid.cc | 118 +- sql/wsrep_xid.h | 14 +- storage/archive/azio.c | 5 +- storage/archive/ha_archive.cc | 14 + storage/archive/ha_archive.h | 3 +- storage/blackhole/ha_blackhole.h | 2 +- storage/connect/global.h | 6 +- storage/connect/ha_connect.cc | 4 +- storage/connect/jsonudf.cpp | 12 +- storage/connect/mysql-test/connect/r/dir.result | 2 +- storage/connect/mysql-test/connect/r/jdbc.result | 13 + .../mysql-test/connect/r/jdbc_oracle.result | 18 +- .../mysql-test/connect/r/jdbc_postgresql.result | 8 + storage/connect/mysql-test/connect/r/xml2.result | 2 +- storage/connect/plugutil.cpp | 28 +- storage/connect/reldef.cpp | 11 +- storage/connect/tabfmt.h | 2 +- storage/connect/tabjson.cpp | 10 +- storage/connect/tabjson.h | 6 +- storage/connect/tabodbc.cpp | 317 +-- storage/connect/tabxml.cpp | 13 +- storage/connect/tabxml.h | 5 +- storage/connect/user_connect.cc | 4 +- storage/csv/ha_tina.cc | 28 +- storage/csv/ha_tina.h | 2 +- storage/federated/ha_federated.h | 1 + storage/federatedx/TODO | 30 - storage/federatedx/ha_federatedx.h | 2 +- storage/heap/ha_heap.h | 2 +- storage/innobase/CMakeLists.txt | 6 +- storage/innobase/btr/btr0btr.cc | 142 +- storage/innobase/btr/btr0bulk.cc | 9 +- storage/innobase/btr/btr0cur.cc | 231 +- storage/innobase/btr/btr0defragment.cc | 25 +- storage/innobase/btr/btr0pcur.cc | 32 +- storage/innobase/btr/btr0scrub.cc | 8 +- storage/innobase/btr/btr0sea.cc | 8 +- storage/innobase/buf/buf0buf.cc | 470 ++-- storage/innobase/buf/buf0checksum.cc | 55 +- storage/innobase/buf/buf0dblwr.cc | 42 +- storage/innobase/buf/buf0dump.cc | 6 +- storage/innobase/buf/buf0flu.cc | 163 +- storage/innobase/buf/buf0lru.cc | 3 +- storage/innobase/buf/buf0rea.cc | 2 +- storage/innobase/data/data0data.cc | 7 +- storage/innobase/data/data0type.cc | 2 - storage/innobase/dict/dict0boot.cc | 44 +- storage/innobase/dict/dict0crea.cc | 28 +- storage/innobase/dict/dict0defrag_bg.cc | 5 +- storage/innobase/dict/dict0dict.cc | 224 +- storage/innobase/dict/dict0load.cc | 5 +- storage/innobase/dict/dict0mem.cc | 73 +- storage/innobase/dict/dict0stats.cc | 8 +- storage/innobase/dict/dict0stats_bg.cc | 1 - storage/innobase/fil/fil0crypt.cc | 185 +- storage/innobase/fil/fil0fil.cc | 525 ++-- storage/innobase/fil/fil0pagecompress.cc | 9 +- storage/innobase/fsp/fsp0file.cc | 5 - storage/innobase/fsp/fsp0fsp.cc | 5 +- storage/innobase/fsp/fsp0space.cc | 16 +- storage/innobase/fsp/fsp0sysspace.cc | 20 +- storage/innobase/fts/fts0ast.cc | 2 - storage/innobase/fts/fts0fts.cc | 107 +- storage/innobase/fts/fts0opt.cc | 2 - storage/innobase/fts/fts0que.cc | 3 - storage/innobase/gis/gis0rtree.cc | 14 +- storage/innobase/gis/gis0sea.cc | 15 +- storage/innobase/ha/ha0ha.cc | 20 +- storage/innobase/ha/ha0storage.cc | 1 - storage/innobase/handler/ha_innodb.cc | 993 ++++---- storage/innobase/handler/ha_innodb.h | 51 +- storage/innobase/handler/handler0alter.cc | 665 +++-- storage/innobase/handler/i_s.cc | 5 +- storage/innobase/ibuf/ibuf0ibuf.cc | 51 +- storage/innobase/include/btr0btr.h | 30 +- storage/innobase/include/btr0bulk.h | 7 +- storage/innobase/include/btr0cur.h | 3 +- storage/innobase/include/btr0defragment.h | 6 +- storage/innobase/include/btr0pcur.h | 5 - storage/innobase/include/btr0scrub.h | 6 - storage/innobase/include/btr0sea.h | 5 - storage/innobase/include/btr0types.h | 5 +- storage/innobase/include/buf0buddy.h | 6 - storage/innobase/include/buf0buddy.ic | 10 - storage/innobase/include/buf0buf.h | 94 +- storage/innobase/include/buf0buf.ic | 63 +- storage/innobase/include/buf0checksum.h | 19 +- storage/innobase/include/buf0dblwr.h | 1 - storage/innobase/include/buf0flu.h | 13 - storage/innobase/include/buf0flu.ic | 79 +- storage/innobase/include/buf0lru.h | 1 - storage/innobase/include/buf0rea.h | 2 - storage/innobase/include/data0data.h | 2 - storage/innobase/include/dict0boot.h | 17 +- storage/innobase/include/dict0crea.h | 11 - storage/innobase/include/dict0defrag_bg.h | 5 +- storage/innobase/include/dict0dict.h | 185 +- storage/innobase/include/dict0dict.ic | 154 +- storage/innobase/include/dict0load.h | 2 - storage/innobase/include/dict0mem.h | 215 +- storage/innobase/include/dict0priv.h | 14 - storage/innobase/include/dict0priv.ic | 35 - storage/innobase/include/dict0stats.h | 2 - storage/innobase/include/dict0stats.ic | 1 - storage/innobase/include/dict0stats_bg.h | 2 - storage/innobase/include/dyn0buf.h | 3 +- storage/innobase/include/eval0eval.h | 1 - storage/innobase/include/eval0proc.h | 1 - storage/innobase/include/fil0crypt.h | 13 +- storage/innobase/include/fil0fil.h | 130 +- storage/innobase/include/fsp0file.h | 5 +- storage/innobase/include/fsp0fsp.h | 12 +- storage/innobase/include/fsp0space.h | 2 - storage/innobase/include/fsp0sysspace.h | 1 - storage/innobase/include/fsp0types.h | 6 +- storage/innobase/include/fts0ast.h | 1 - storage/innobase/include/fts0fts.h | 18 +- storage/innobase/include/fts0plugin.h | 2 +- storage/innobase/include/fts0priv.h | 1 - storage/innobase/include/fts0types.h | 1 - storage/innobase/include/fts0types.ic | 29 +- storage/innobase/include/fut0fut.h | 3 - storage/innobase/include/fut0lst.h | 11 +- storage/innobase/include/fut0lst.ic | 2 +- storage/innobase/include/gis0rtree.h | 18 - storage/innobase/include/gis0type.h | 11 +- storage/innobase/include/ha0ha.h | 2 - storage/innobase/include/ha0storage.ic | 2 - storage/innobase/include/hash0hash.h | 1 - storage/innobase/include/ib0mutex.h | 127 +- storage/innobase/include/ibuf0ibuf.h | 2 - storage/innobase/include/ibuf0ibuf.ic | 7 +- storage/innobase/include/lock0iter.h | 1 - storage/innobase/include/lock0lock.h | 2 - storage/innobase/include/lock0prdt.h | 1 - storage/innobase/include/lock0priv.h | 1 - storage/innobase/include/lock0types.h | 1 + storage/innobase/include/log0log.h | 9 - storage/innobase/include/log0recv.h | 2 - storage/innobase/include/mach0data.h | 4 +- storage/innobase/include/mem0mem.h | 102 - storage/innobase/include/mem0mem.ic | 2 - storage/innobase/include/mtr0log.h | 1 - storage/innobase/include/mtr0mtr.h | 1 - storage/innobase/include/mtr0mtr.ic | 2 +- storage/innobase/include/os0file.ic | 2 - storage/innobase/include/os0proc.h | 2 +- storage/innobase/include/os0thread.h | 2 +- storage/innobase/include/page0cur.h | 3 - storage/innobase/include/page0cur.ic | 5 - storage/innobase/include/page0page.h | 33 +- storage/innobase/include/page0page.ic | 13 - storage/innobase/include/page0size.h | 1 - storage/innobase/include/page0types.h | 2 - storage/innobase/include/page0zip.h | 30 +- storage/innobase/include/page0zip.ic | 10 - storage/innobase/include/pars0opt.h | 2 - storage/innobase/include/pars0pars.h | 1 - storage/innobase/include/pars0sym.h | 2 - storage/innobase/include/que0que.h | 2 - storage/innobase/include/que0types.h | 1 - storage/innobase/include/read0types.h | 37 +- storage/innobase/include/rem0cmp.h | 6 +- storage/innobase/include/rem0cmp.ic | 1 + storage/innobase/include/rem0rec.h | 1 - storage/innobase/include/rem0rec.ic | 1 + storage/innobase/include/row0ext.h | 3 +- storage/innobase/include/row0ftsort.h | 5 - storage/innobase/include/row0import.h | 1 - storage/innobase/include/row0ins.h | 2 - storage/innobase/include/row0log.h | 6 +- storage/innobase/include/row0merge.h | 5 +- storage/innobase/include/row0mysql.h | 56 +- storage/innobase/include/row0purge.h | 5 +- storage/innobase/include/row0quiesce.h | 1 - storage/innobase/include/row0row.h | 7 +- storage/innobase/include/row0row.ic | 8 +- storage/innobase/include/row0sel.h | 2 - storage/innobase/include/row0uins.h | 2 - storage/innobase/include/row0umod.h | 2 - storage/innobase/include/row0undo.h | 19 +- storage/innobase/include/row0upd.h | 34 +- storage/innobase/include/row0upd.ic | 8 +- storage/innobase/include/row0vers.h | 2 - storage/innobase/include/srv0mon.h | 1 - storage/innobase/include/srv0srv.h | 20 +- storage/innobase/include/srv0start.h | 1 - storage/innobase/include/sync0arr.h | 1 - storage/innobase/include/sync0debug.h | 1 - storage/innobase/include/sync0policy.h | 524 ++-- storage/innobase/include/sync0policy.ic | 101 - storage/innobase/include/sync0rw.h | 7 +- storage/innobase/include/sync0rw.ic | 87 +- storage/innobase/include/sync0sync.h | 1 - storage/innobase/include/sync0types.h | 74 - storage/innobase/include/trx0i_s.h | 1 - storage/innobase/include/trx0purge.h | 42 +- storage/innobase/include/trx0rec.h | 3 - storage/innobase/include/trx0roll.h | 12 - storage/innobase/include/trx0sys.h | 63 +- storage/innobase/include/trx0trx.h | 27 +- storage/innobase/include/trx0types.h | 2 - storage/innobase/include/trx0undo.h | 39 +- storage/innobase/include/trx0undo.ic | 31 - storage/innobase/include/univ.i | 16 +- storage/innobase/include/ut0counter.h | 12 +- storage/innobase/include/ut0crc32.h | 6 +- storage/innobase/include/ut0dbg.h | 2 - storage/innobase/include/ut0mem.h | 1 - storage/innobase/include/ut0mutex.h | 6 - storage/innobase/include/ut0new.h | 4 +- storage/innobase/include/ut0rbt.h | 1 - storage/innobase/include/ut0rnd.h | 5 +- storage/innobase/include/ut0sort.h | 2 - storage/innobase/include/ut0stage.h | 2 - storage/innobase/include/ut0ut.h | 13 +- storage/innobase/include/ut0vec.h | 1 - storage/innobase/include/ut0vec.ic | 2 - storage/innobase/innodb.cmake | 2 + storage/innobase/lock/lock0iter.cc | 1 - storage/innobase/lock/lock0lock.cc | 161 +- storage/innobase/lock/lock0prdt.cc | 9 - storage/innobase/lock/lock0wait.cc | 6 +- storage/innobase/log/log0log.cc | 18 +- storage/innobase/log/log0recv.cc | 33 +- storage/innobase/mem/mem0mem.cc | 2 - storage/innobase/mtr/mtr0mtr.cc | 6 +- storage/innobase/os/os0event.cc | 23 +- storage/innobase/os/os0file.cc | 36 +- storage/innobase/os/os0proc.cc | 31 +- storage/innobase/os/os0thread.cc | 17 +- storage/innobase/page/page0cur.cc | 14 +- storage/innobase/page/page0page.cc | 42 +- storage/innobase/page/page0zip.cc | 231 +- storage/innobase/pars/pars0opt.cc | 1 - storage/innobase/pars/pars0pars.cc | 3 - storage/innobase/que/que0que.cc | 5 - storage/innobase/read/read0read.cc | 10 +- storage/innobase/rem/rem0cmp.cc | 33 +- storage/innobase/rem/rem0rec.cc | 20 +- storage/innobase/row/row0ftsort.cc | 42 +- storage/innobase/row/row0import.cc | 75 +- storage/innobase/row/row0ins.cc | 94 +- storage/innobase/row/row0log.cc | 25 +- storage/innobase/row/row0merge.cc | 86 +- storage/innobase/row/row0mysql.cc | 170 +- storage/innobase/row/row0purge.cc | 33 +- storage/innobase/row/row0quiesce.cc | 11 +- storage/innobase/row/row0row.cc | 6 +- storage/innobase/row/row0sel.cc | 105 +- storage/innobase/row/row0uins.cc | 209 +- storage/innobase/row/row0umod.cc | 76 +- storage/innobase/row/row0undo.cc | 189 +- storage/innobase/row/row0upd.cc | 110 +- storage/innobase/row/row0vers.cc | 2 - storage/innobase/srv/srv0conc.cc | 38 +- storage/innobase/srv/srv0mon.cc | 9 +- storage/innobase/srv/srv0srv.cc | 79 +- storage/innobase/srv/srv0start.cc | 146 +- storage/innobase/sync/sync0arr.cc | 40 +- storage/innobase/sync/sync0debug.cc | 3 - storage/innobase/sync/sync0rw.cc | 89 +- storage/innobase/sync/sync0sync.cc | 1 - storage/innobase/trx/trx0i_s.cc | 14 +- storage/innobase/trx/trx0purge.cc | 42 +- storage/innobase/trx/trx0rec.cc | 101 +- storage/innobase/trx/trx0roll.cc | 190 +- storage/innobase/trx/trx0rseg.cc | 74 +- storage/innobase/trx/trx0sys.cc | 9 +- storage/innobase/trx/trx0trx.cc | 27 +- storage/innobase/trx/trx0undo.cc | 56 +- storage/innobase/ut/ut0crc32.cc | 81 +- storage/innobase/ut/ut0dbg.cc | 5 +- storage/innobase/ut/ut0new.cc | 2 - storage/innobase/ut/ut0rbt.cc | 3 - storage/maria/CMakeLists.txt | 7 +- storage/maria/ha_maria.cc | 29 +- storage/maria/ma_backup.c | 281 +++ storage/maria/ma_check.c | 6 + storage/maria/ma_control_file.c | 120 + storage/maria/ma_control_file.h | 1 + storage/maria/ma_extra.c | 5 + storage/maria/ma_init.c | 2 + storage/maria/ma_locking.c | 6 +- storage/maria/ma_loghandler.c | 26 +- storage/maria/ma_loghandler.h | 3 + storage/maria/ma_pagecrc.c | 10 +- storage/maria/ma_recovery.c | 8 +- storage/maria/maria_def.h | 4 + storage/maria/maria_read_log.c | 24 +- storage/maria/test_ma_backup.c | 449 ++++ storage/maria/unittest/ma_test_recovery.pl | 23 +- storage/mroonga/ha_mroonga.cpp | 22 +- storage/mroonga/lib/mrn_condition_converter.cpp | 11 +- ...etime_64bit_strict_sql_mode_out_of_range.result | 2 +- storage/myisam/TODO | 7 - storage/myisam/mi_check.c | 4 + storage/myisam/mi_extra.c | 5 + storage/myisam/mi_locking.c | 6 +- storage/myisam/myisamdef.h | 1 + storage/perfschema/unittest/pfs_server_stubs.cc | 2 - storage/rocksdb/CMakeLists.txt | 4 +- storage/rocksdb/ha_rocksdb.cc | 1 - storage/rocksdb/myrocks_hotbackup | 686 ------ storage/rocksdb/myrocks_hotbackup.py | 685 ++++++ .../mysql-test/rocksdb/r/add_index_inplace.result | 12 + .../mysql-test/rocksdb/r/analyze_table.result | 6 + .../rocksdb/mysql-test/rocksdb/r/bulk_load.result | 3 + .../mysql-test/rocksdb/r/bulk_load_errors.result | 2 +- .../mysql-test/rocksdb/r/bulk_load_rev_cf.result | 3 + .../rocksdb/r/bulk_load_rev_cf_and_data.result | 3 + .../mysql-test/rocksdb/r/bulk_load_rev_data.result | 3 + .../mysql-test/rocksdb/r/bulk_load_unsorted.result | 3 + .../rocksdb/r/bulk_load_unsorted_rev.result | 3 + .../mysql-test/rocksdb/r/cardinality.result | 1 + .../mysql-test/rocksdb/r/col_opt_not_null.result | 4 +- .../mysql-test/rocksdb/r/col_opt_null.result | 4 +- .../mysql-test/rocksdb/r/drop_index_inplace.result | 2 + .../rocksdb/r/index_merge_rocksdb.result | 1 + storage/rocksdb/mysql-test/rocksdb/r/misc.result | 4 +- .../rocksdb/mysql-test/rocksdb/r/partition.result | 1 + .../mysql-test/rocksdb/r/records_in_range.result | 2 +- .../rocksdb/mysql-test/rocksdb/r/rocksdb.result | 14 +- .../rocksdb/r/rocksdb_cf_per_partition.result | 2 + .../mysql-test/rocksdb/r/rocksdb_range2.result | 3 +- .../rocksdb/mysql-test/rocksdb/r/statistics.result | 3 + .../rocksdb/mysql-test/rocksdb/r/type_bool.result | 4 +- .../mysql-test/rocksdb/r/type_decimal.result | 2 + .../mysql-test/rocksdb/r/type_varchar.result | 5 + storage/rocksdb/mysql-test/rocksdb/r/xa.result | 32 + storage/rocksdb/mysql-test/rocksdb/t/disabled.def | 1 + storage/rocksdb/mysql-test/rocksdb/t/xa-master.opt | 1 + storage/rocksdb/mysql-test/rocksdb/t/xa.test | 38 + .../mysql-test/rocksdb_rpl/r/mdev12179.result | 18 + .../mysql-test/rocksdb_rpl/t/mdev12179.test | 85 + storage/spider/ha_spider.cc | 199 +- storage/spider/ha_spider.h | 92 +- storage/spider/hs_client/hs_compat.h | 2 +- storage/spider/hs_client/hstcpcli.cpp | 25 +- storage/spider/hs_client/hstcpcli.hpp | 3 + .../checksum_table_with_quick_mode_3_deinit.inc | 15 + .../checksum_table_with_quick_mode_3_init.inc | 31 + .../spider/include/direct_join_using_deinit.inc | 9 + .../spider/include/direct_join_using_init.inc | 13 + .../spider/include/direct_left_join_deinit.inc | 9 + .../spider/include/direct_left_join_init.inc | 13 + .../include/direct_left_join_nullable_deinit.inc | 9 + .../include/direct_left_join_nullable_init.inc | 13 + .../direct_left_right_join_nullable_deinit.inc | 9 + .../direct_left_right_join_nullable_init.inc | 13 + ...direct_left_right_left_join_nullable_deinit.inc | 9 + .../direct_left_right_left_join_nullable_init.inc | 13 + .../spider/include/direct_right_join_deinit.inc | 9 + .../spider/include/direct_right_join_init.inc | 13 + .../include/direct_right_join_nullable_deinit.inc | 9 + .../include/direct_right_join_nullable_init.inc | 13 + .../direct_right_left_join_nullable_deinit.inc | 9 + .../direct_right_left_join_nullable_init.inc | 13 + ...irect_right_left_right_join_nullable_deinit.inc | 9 + .../direct_right_left_right_join_nullable_init.inc | 13 + .../spider/include/quick_mode_0_deinit.inc | 21 + .../spider/include/quick_mode_0_init.inc | 55 + .../spider/include/quick_mode_1_deinit.inc | 21 + .../spider/include/quick_mode_1_init.inc | 55 + .../spider/include/quick_mode_2_deinit.inc | 21 + .../spider/include/quick_mode_2_init.inc | 55 + .../spider/include/quick_mode_3_deinit.inc | 21 + .../spider/include/quick_mode_3_init.inc | 55 + .../spider/include/slave_trx_isolation_deinit.inc | 17 + .../spider/include/slave_trx_isolation_init.inc | 39 + .../r/checksum_table_with_quick_mode_3.result | 104 + .../mysql-test/spider/r/direct_join_using.result | 108 + .../mysql-test/spider/r/direct_left_join.result | 108 + .../spider/r/direct_left_join_nullable.result | 113 + .../r/direct_left_right_join_nullable.result | 113 + .../r/direct_left_right_left_join_nullable.result | 112 + .../mysql-test/spider/r/direct_right_join.result | 108 + .../spider/r/direct_right_join_nullable.result | 113 + .../r/direct_right_left_join_nullable.result | 112 + .../r/direct_right_left_right_join_nullable.result | 113 + .../spider/mysql-test/spider/r/quick_mode_0.result | 515 ++++ .../spider/mysql-test/spider/r/quick_mode_1.result | 515 ++++ .../spider/mysql-test/spider/r/quick_mode_2.result | 515 ++++ .../spider/mysql-test/spider/r/quick_mode_3.result | 515 ++++ .../mysql-test/spider/r/slave_trx_isolation.result | 110 + .../spider/t/checksum_table_with_quick_mode_3.test | 134 + .../mysql-test/spider/t/direct_join_using.test | 197 ++ .../mysql-test/spider/t/direct_left_join.test | 197 ++ .../spider/t/direct_left_join_nullable.test | 212 ++ .../spider/t/direct_left_right_join_nullable.test | 212 ++ .../t/direct_left_right_left_join_nullable.test | 212 ++ .../mysql-test/spider/t/direct_right_join.test | 197 ++ .../spider/t/direct_right_join_nullable.test | 212 ++ .../spider/t/direct_right_left_join_nullable.test | 212 ++ .../t/direct_right_left_right_join_nullable.test | 212 ++ .../spider/mysql-test/spider/t/quick_mode_0.test | 309 +++ .../spider/mysql-test/spider/t/quick_mode_1.test | 309 +++ .../spider/mysql-test/spider/t/quick_mode_2.test | 309 +++ .../spider/mysql-test/spider/t/quick_mode_3.test | 309 +++ .../mysql-test/spider/t/slave_trx_isolation.test | 166 ++ storage/spider/scripts/install_spider.sql | 93 +- storage/spider/spd_conn.cc | 10 +- storage/spider/spd_conn.h | 4 +- storage/spider/spd_copy_tables.cc | 45 +- storage/spider/spd_db_conn.cc | 547 ++-- storage/spider/spd_db_conn.h | 27 +- storage/spider/spd_db_handlersocket.cc | 125 +- storage/spider/spd_db_handlersocket.h | 9 +- storage/spider/spd_db_include.h | 12 +- storage/spider/spd_db_mysql.cc | 939 +++++-- storage/spider/spd_db_mysql.h | 45 +- storage/spider/spd_db_oracle.cc | 301 ++- storage/spider/spd_db_oracle.h | 11 +- storage/spider/spd_direct_sql.cc | 79 +- storage/spider/spd_environ.h | 15 +- storage/spider/spd_group_by_handler.cc | 67 +- storage/spider/spd_i_s.cc | 4 +- storage/spider/spd_include.h | 86 +- storage/spider/spd_param.cc | 81 +- storage/spider/spd_param.h | 10 +- storage/spider/spd_ping_table.cc | 2 +- storage/spider/spd_sys_table.cc | 169 +- storage/spider/spd_sys_table.h | 33 +- storage/spider/spd_table.cc | 59 +- storage/spider/spd_trx.cc | 38 +- storage/tokudb/CMakeLists.txt | 47 +- .../rpl/r/rpl_extra_col_master_tokudb.result | 2 +- .../mysql-test/rpl/r/rpl_tokudb_mixed_dml.result | 45 +- storage/tokudb/mysql-test/tokudb/disabled.def | 4 +- .../mysql-test/tokudb/r/card_add_drop.result | 2 + .../mysql-test/tokudb/r/card_add_index.result | 3 + .../mysql-test/tokudb/r/card_drop_index.result | 1 + .../mysql-test/tokudb/r/card_drop_index_2.result | 1 + .../tokudb/mysql-test/tokudb/r/card_drop_pk.result | 1 + .../tokudb/mysql-test/tokudb/r/card_no_keys.result | 1 + storage/tokudb/mysql-test/tokudb/r/card_pk.result | 1 + .../tokudb/mysql-test/tokudb/r/card_pk_2.result | 1 + .../tokudb/mysql-test/tokudb/r/card_pk_sk.result | 2 + .../mysql-test/tokudb/r/card_scale_percent.result | 1 + storage/tokudb/mysql-test/tokudb/r/card_sk.result | 1 + .../tokudb/mysql-test/tokudb/r/card_sk_2.result | 1 + .../mysql-test/tokudb/r/card_unique_sk.result | 1 + .../tokudb/mysql-test/tokudb/r/type_date.result | 6 +- .../mysql-test/tokudb/r/type_datetime.result | 4 +- .../tokudb/mysql-test/tokudb/r/type_decimal.result | 4 +- .../tokudb/mysql-test/tokudb/r/type_float.result | 2 +- .../mysql-test/tokudb/r/type_newdecimal.result | 2 +- .../mysql-test/tokudb/t/change_column_bin.py | 0 .../tokudb/t/change_column_bin_rename.py | 0 .../mysql-test/tokudb/t/change_column_char.py | 0 .../tokudb/t/change_column_char_binary.py | 0 .../tokudb/t/change_column_char_charbinary.py | 0 .../tokudb/t/change_column_char_rename.py | 0 .../mysql-test/tokudb/t/change_column_int.py | 0 .../mysql-test/tokudb/t/change_column_int_key.py | 0 .../tokudb/t/change_column_int_not_supported.py | 0 .../tokudb/t/change_column_int_rename.py | 0 .../tokudb_bugs/r/db756_card_part_hash.result | 1 + .../tokudb_bugs/r/db756_card_part_hash_1.result | 1 + .../r/db756_card_part_hash_1_pick.result | 1 + .../tokudb_bugs/r/db756_card_part_hash_2.result | 1 + .../r/db756_card_part_hash_2_pick.result | 1 + .../tokudb_bugs/r/db757_part_alter_analyze.result | 6 +- .../r/partition_alter1_1_2_tokudb.result | 56 + .../r/partition_alter1_1_tokudb.result | 32 + .../r/partition_alter1_2_tokudb.result | 80 + .../r/partition_alter2_1_1_tokudb.result | 40 + .../r/partition_alter2_1_2_tokudb.result | 40 + .../r/partition_alter2_2_1_tokudb.result | 40 + .../r/partition_alter2_2_2_tokudb.result | 40 + .../tokudb_parts/r/partition_alter4_tokudb.result | 216 ++ .../tokudb_parts/r/partition_basic_tokudb.result | 64 + .../tokudb_parts/r/partition_debug_tokudb.result | 262 ++ .../tokudb_parts/r/partition_engine_tokudb.result | 11 + .../tokudb_parts/r/partition_mgm_lc0_tokudb.result | 1 + .../r/partition_mgm_lc10_tokudb.result | 1 + .../tokudb_parts/r/partition_mgm_lc1_tokudb.result | 1 + .../mysql-test/tokudb_rpl/r/mdev12179.result | 18 + .../tokudb/mysql-test/tokudb_rpl/t/mdev12179.test | 85 + storage/tokudb/tokudb_sysvars.cc | 4 +- strings/json_lib.c | 252 +- support-files/compiler_warnings.supp | 1 - support-files/policy/apparmor/usr.sbin.mysqld | 3 +- support-files/policy/selinux/mariadb-server.fc | 2 +- support-files/policy/selinux/mariadb-server.te | 4 +- tests/mysql_client_test.c | 62 +- unittest/mysys/lf-t.c | 5 - unittest/mysys/my_atomic-t.c | 17 +- unittest/mysys/thr_template.c | 31 +- unittest/mysys/waiting_threads-t.c | 4 +- unittest/sql/mf_iocache-t.cc | 2 +- unittest/strings/CMakeLists.txt | 2 +- unittest/strings/json-t.c | 82 + vio/docs/TODO | 3 - win/upgrade_wizard/upgradeDlg.cpp | 27 +- wsrep-lib | 1 + wsrep/CMakeLists.txt | 26 - wsrep/wsrep_api.h | 1117 --------- wsrep/wsrep_dummy.c | 413 ---- wsrep/wsrep_gtid.c | 74 - wsrep/wsrep_loader.c | 226 -- wsrep/wsrep_uuid.c | 83 - 2416 files changed, 89421 insertions(+), 41458 deletions(-) diff --cc mysql-test/main/derived_cond_pushdown.result index c73fb80,36a44ce..473415a --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@@ -14981,11 -15076,11 +15076,11 @@@ from t1 joi on t1.a=t.a where t1.b <= 5; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL idx_b NULL NULL NULL 12 75.00 Using where +1 PRIMARY t1 ALL idx_b NULL NULL NULL 12 83.33 Using where - 1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 9 100.00 - 2 DERIVED t2 ALL idx_a NULL NULL NULL 90 100.00 Using temporary; Using filesort + 1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 2 100.00 + 2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00 Warnings: - Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`s` AS `s`,`t`.`m` AS `m` from `test`.`t1` join (/* select#2 */ select `test`.`t2`.`a` AS `a`,sum(`test`.`t2`.`b`) AS `s`,min(`test`.`t2`.`b`) AS `m` from `test`.`t2` group by `test`.`t2`.`a`) `t` where `t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <= 5 + Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`s` AS `s`,`t`.`m` AS `m` from `test`.`t1` join (/* select#2 */ select `test`.`t2`.`a` AS `a`,sum(`test`.`t2`.`b`) AS `s`,min(`test`.`t2`.`b`) AS `m` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` where `t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <= 5 explain format=json select t1.a,t.s,t.m from t1 join (select a, sum(t2.b) as s, min(t2.b) as m from t2 group by t2.a) t diff --cc mysql-test/main/func_group_innodb.result index 5be46ed,141d7cc..a4c9b57 --- a/mysql-test/main/func_group_innodb.result +++ b/mysql-test/main/func_group_innodb.result @@@ -251,9 -244,30 +251,33 @@@ MIN(c 0 EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; id select_type table type possible_keys key key_len ref rows Extra - 1 SIMPLE t1 range NULL b 263 NULL 3 Using index for group-by + 1 SIMPLE t1 range NULL b 263 NULL 2 Using index for group-by DROP TABLE t1; + # + # MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) field + # + CREATE TABLE t1 (v1 varchar(1020), v2 varchar(2), v3 varchar(2), + KEY k1 (v3,v2,v1)) ENGINE=InnoDB CHARACTER SET=utf8 ROW_FORMAT=DYNAMIC; + INSERT INTO t1 VALUES ('king', 'qu','qu'), ('bad','go','go'); + explain + SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu'; + id select_type table type possible_keys key key_len ref rows Extra + 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away + SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu'; + MIN(t1.v1) + king + drop table t1; + CREATE TABLE t1 (v1 varchar(1024) CHARACTER SET utf8, KEY v1 (v1)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; + INSERT INTO t1 VALUES ('king'), ('bad'); + explain + SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x; + id select_type table type possible_keys key key_len ref rows Extra + 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row + SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x; + MIN(x.v1) + NULL + drop table t1; End of 5.5 tests +set global innodb_stats_persistent= @innodb_stats_persistent_save; +set global innodb_stats_persistent_sample_pages= +@innodb_stats_persistent_sample_pages_save; diff --cc mysql-test/main/func_group_innodb.test index 0aa657b,c4914b9..6141b4d --- a/mysql-test/main/func_group_innodb.test +++ b/mysql-test/main/func_group_innodb.test @@@ -201,8 -192,23 +201,27 @@@ EXPLAIN SELECT MIN(c) FROM t1 GROUP BY DROP TABLE t1; + --echo # + --echo # MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) field + --echo # + + CREATE TABLE t1 (v1 varchar(1020), v2 varchar(2), v3 varchar(2), + KEY k1 (v3,v2,v1)) ENGINE=InnoDB CHARACTER SET=utf8 ROW_FORMAT=DYNAMIC; + INSERT INTO t1 VALUES ('king', 'qu','qu'), ('bad','go','go'); + explain + SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu'; + SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu'; + drop table t1; + + CREATE TABLE t1 (v1 varchar(1024) CHARACTER SET utf8, KEY v1 (v1)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; + INSERT INTO t1 VALUES ('king'), ('bad'); + explain + SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x; + SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x; + drop table t1; + --echo End of 5.5 tests + +set global innodb_stats_persistent= @innodb_stats_persistent_save; +set global innodb_stats_persistent_sample_pages= + @innodb_stats_persistent_sample_pages_save; diff --cc mysql-test/main/group_min_max.result index 4667c4b,a8e0762..7a49dbd --- a/mysql-test/main/group_min_max.result +++ b/mysql-test/main/group_min_max.result @@@ -2075,19 -2078,19 +2078,19 @@@ id select_type table type possible_key explain extended select a1,a2,min(b),max(b) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2; id select_type table type possible_keys key key_len ref rows filtered Extra - 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 77 85.71 Using where; Using index -1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 76 100.00 Using where; Using index ++1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 77 100.00 Using where; Using index Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2` explain extended select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra - 1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 51.56 Using where; Using temporary; Using filesort -1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 39.58 Using where; Using temporary; Using filesort ++1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 40.10 Using where; Using temporary; Using filesort Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,min(`test`.`t1`.`c`) AS `min(c)`,max(`test`.`t1`.`c`) AS `max(c)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain extended select a1,a2,b,c from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c; id select_type table type possible_keys key key_len ref rows filtered Extra - 1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 51.56 Using where; Using temporary; Using filesort -1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 39.58 Using where; Using temporary; Using filesort ++1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 40.10 Using where; Using temporary; Using filesort Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`,`test`.`t1`.`c` explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1; @@@ -2095,7 -2098,7 +2098,7 @@@ id select_type table type possible_key 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra - 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 77 85.71 Using where; Using index -1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 76 100.00 Using where; Using index ++1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 77 100.00 Using where; Using index Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1; @@@ -2281,15 -2284,9 +2284,16 @@@ INSERT INTO t1 (a) VALUE (''), ('CENTRAL'), ('EASTERN'), ('GREATER LONDON'), ('NORTH CENTRAL'), ('NORTH EAST'), ('NORTH WEST'), ('SCOTLAND'), ('SOUTH EAST'), ('SOUTH WEST'), ('WESTERN'); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK EXPLAIN SELECT DISTINCT a,a FROM t1 ORDER BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL a 66 NULL 6 Using index for group-by +1 SIMPLE t1 range NULL a 66 NULL 12 Using index for group-by SELECT DISTINCT a,a FROM t1 ORDER BY a; a a @@@ -2348,15 -2345,10 +2352,16 @@@ id2 id3 id5 id4 id3 id6 id5 id 1 1 1 1 1 1 1 1 DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (a int, b int, KEY (a,b), KEY b (b)); -INSERT INTO t1 VALUES (1,1),(1,2),(1,0),(1,3); +INSERT INTO t1 VALUES +(1,1),(1,2),(1,0),(1,3), +(1,-1),(1,-2),(1,-3),(1,-4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a,b a 10 NULL 1 Using where; Using index for group-by +1 SIMPLE t1 range a,b a 10 NULL 2 Using where; Using index for group-by SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a; MAX(b) a 1 1 @@@ -2375,12 -2367,9 +2380,13 @@@ DROP TABLE t1,t2 CREATE TABLE t1 (a INT, b INT, INDEX (a,b)); INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK EXPLAIN SELECT max(b), a FROM t1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra - 1 SIMPLE t1 range NULL a 5 NULL 4 Using index for group-by -1 SIMPLE t1 range NULL a 5 NULL 8 Using index for group-by ++1 SIMPLE t1 index NULL a 10 NULL 15 Using index FLUSH STATUS; SELECT max(b), a FROM t1 GROUP BY a; max(b) a @@@ -2390,18 -2379,18 +2396,18 @@@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value --Handler_read_key 8 --Handler_read_next 0 ++Handler_read_key 0 ++Handler_read_next 15 Handler_read_retry 0 EXPLAIN SELECT max(b), a FROM t1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra - 1 SIMPLE t1 range NULL a 5 NULL 4 Using index for group-by -1 SIMPLE t1 range NULL a 5 NULL 8 Using index for group-by ++1 SIMPLE t1 index NULL a 10 NULL 15 Using index FLUSH STATUS; CREATE TABLE t2 SELECT max(b), a FROM t1 GROUP BY a; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value --Handler_read_key 8 --Handler_read_next 0 ++Handler_read_key 0 ++Handler_read_next 15 Handler_read_retry 0 FLUSH STATUS; SELECT * FROM (SELECT max(b), a FROM t1 GROUP BY a) b; @@@ -2412,8 -2401,8 +2418,8 @@@ max(b) 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value --Handler_read_key 8 --Handler_read_next 0 ++Handler_read_key 0 ++Handler_read_next 15 Handler_read_retry 0 FLUSH STATUS; (SELECT max(b), a FROM t1 GROUP BY a) UNION @@@ -2425,20 -2414,20 +2431,20 @@@ max(b) 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value --Handler_read_key 16 --Handler_read_next 0 ++Handler_read_key 0 ++Handler_read_next 30 Handler_read_retry 0 EXPLAIN (SELECT max(b), a FROM t1 GROUP BY a) UNION (SELECT max(b), a FROM t1 GROUP BY a); id select_type table type possible_keys key key_len ref rows Extra - 1 PRIMARY t1 range NULL a 5 NULL 4 Using index for group-by - 2 UNION t1 range NULL a 5 NULL 4 Using index for group-by -1 PRIMARY t1 range NULL a 5 NULL 8 Using index for group-by -2 UNION t1 range NULL a 5 NULL 8 Using index for group-by ++1 PRIMARY t1 index NULL a 10 NULL 15 Using index ++2 UNION t1 index NULL a 10 NULL 15 Using index NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL EXPLAIN SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x FROM t1 AS t1_outer; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_outer index NULL a 10 NULL 15 Using index - 2 SUBQUERY t1 range NULL a 5 NULL 4 Using index for group-by -2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by ++2 SUBQUERY t1 index NULL a 10 NULL 15 Using index EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE EXISTS (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra @@@ -2448,38 -2437,38 +2454,38 @@@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WH (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE - 2 SUBQUERY t1 range NULL a 5 NULL 4 Using index for group-by -2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by ++2 SUBQUERY t1 index NULL a 10 NULL 15 Using index EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra - 1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 4 - 1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 4 Using index - 2 MATERIALIZED t1 range NULL a 5 NULL 4 Using index for group-by -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8 -1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 Using index -2 MATERIALIZED t1 range NULL a 5 NULL 8 Using index for group-by ++1 PRIMARY t1_outer index a a 10 NULL 15 Using where; Using index ++1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1_outer.a 1 ++2 MATERIALIZED t1 index NULL a 10 NULL 15 Using index EXPLAIN SELECT 1 FROM t1 AS t1_outer GROUP BY a HAVING a > (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra - 1 PRIMARY t1_outer range NULL a 5 NULL 4 Using index for group-by - 2 SUBQUERY t1 range NULL a 5 NULL 4 Using index for group-by -1 PRIMARY t1_outer range NULL a 5 NULL 8 Using index for group-by -2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by ++1 PRIMARY t1_outer index NULL a 10 NULL 15 Using index ++2 SUBQUERY t1 index NULL a 10 NULL 15 Using index EXPLAIN SELECT 1 FROM t1 AS t1_outer1 JOIN t1 AS t1_outer2 ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) AND t1_outer1.b = t1_outer2.b; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index 1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer (flat, BNL join) - 2 SUBQUERY t1 range NULL a 5 NULL 4 Using index for group-by -2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by ++2 SUBQUERY t1 index NULL a 10 NULL 15 Using index EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using index 2 SUBQUERY t1_outer index NULL a 10 NULL 15 Using index - 3 SUBQUERY t1 range NULL a 5 NULL 4 Using index for group-by -3 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by ++3 SUBQUERY t1 index NULL a 10 NULL 15 Using index CREATE TABLE t3 LIKE t1; FLUSH STATUS; INSERT INTO t3 SELECT a,MAX(b) FROM t1 GROUP BY a; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value - Handler_read_key 8 -Handler_read_key 13 --Handler_read_next 0 ++Handler_read_key 5 ++Handler_read_next 15 Handler_read_retry 0 DELETE FROM t3; FLUSH STATUS; @@@ -2487,15 -2476,15 +2493,15 @@@ INSERT INTO t3 SELECT 1, (SELECT MAX(b FROM t1 LIMIT 1; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value --Handler_read_key 8 --Handler_read_next 0 ++Handler_read_key 0 ++Handler_read_next 15 Handler_read_retry 0 FLUSH STATUS; DELETE FROM t3 WHERE (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) > 10000; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value --Handler_read_key 8 --Handler_read_next 0 ++Handler_read_key 0 ++Handler_read_next 15 Handler_read_retry 0 FLUSH STATUS; DELETE FROM t3 WHERE (SELECT (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) x @@@ -2503,20 -2492,17 +2509,21 @@@ FROM t1) > 10000 ERROR 21000: Subquery returns more than 1 row SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value --Handler_read_key 8 --Handler_read_next 1 ++Handler_read_key 0 ++Handler_read_next 16 Handler_read_retry 0 DROP TABLE t1,t2,t3; CREATE TABLE t1 (a int, INDEX idx(a)); INSERT INTO t1 VALUES (4), (2), (1), (2), (4), (2), (1), (4), (4), (2), (1), (2), (2), (4), (1), (4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK EXPLAIN SELECT DISTINCT(a) FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL idx 5 NULL 9 Using index for group-by +1 SIMPLE t1 range NULL idx 5 NULL 4 Using index for group-by SELECT DISTINCT(a) FROM t1; a 1 @@@ -2532,12 -2518,9 +2539,13 @@@ 4 DROP TABLE t1; CREATE TABLE t1 (a INT, b INT); -INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3); +INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3), (1,4), (1,5); INSERT INTO t1 SELECT a + 1, b FROM t1; INSERT INTO t1 SELECT a + 2, b FROM t1; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK EXPLAIN SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC; id select_type table type possible_keys key key_len ref rows Extra @@@ -2664,12 -2647,9 +2672,13 @@@ INSERT INTO t1 VALUES (1, 1, 1, 1), (1 INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT a,b,c+1,d FROM t1; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK EXPLAIN SELECT DISTINCT c FROM t1 WHERE d=4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL foo 10 NULL 9 Using where; Using index for group-by +1 SIMPLE t1 range NULL foo 10 NULL 3 Using where; Using index for group-by SELECT DISTINCT c FROM t1 WHERE d=4; c 1 @@@ -2683,9 -2663,6 +2692,10 @@@ CREATE TABLE t (a INT, b INT, INDEX (a, INSERT INTO t VALUES (2,0), (2,0), (2,1), (2,1); INSERT INTO t SELECT * FROM t; INSERT INTO t SELECT * FROM t; +ANALYZE TABLE t; +Table Op Msg_type Msg_text ++test.t analyze status Engine-independent statistics collected +test.t analyze status OK # test MIN #should use range with index for group by EXPLAIN @@@ -2712,7 -2689,7 +2722,7 @@@ INSERT INTO t SELECT a, 2 FROM t EXPLAIN SELECT a, MAX(b) FROM t WHERE b > 0 AND b < 2 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra - 1 SIMPLE t range NULL a 10 NULL 3 Using where; Using index for group-by -1 SIMPLE t range NULL a 10 NULL 9 Using where; Using index for group-by ++1 SIMPLE t range NULL a 10 NULL 2 Using where; Using index for group-by #should return 1 row SELECT a, MAX(b) FROM t WHERE b > 0 AND b < 2 GROUP BY a; a MAX(b) @@@ -3321,10 -3299,6 +3332,12 @@@ INSERT INTO t1 VALUES (0,99),(9,99),(4, INSERT INTO t1 VALUES (0,99),(9,99),(4,0),(7,0),(99,0),(7,0),(8,0),(99,0),(1,0); CREATE TABLE t2 (c int) ; INSERT INTO t2 VALUES (0),(1); +ANALYZE TABLE t1,t2; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK ++test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK EXPLAIN SELECT MIN(a), b FROM t1 WHERE a > 0 GROUP BY b; id select_type table type possible_keys key key_len ref rows Extra @@@ -3360,28 -3334,16 +3373,30 @@@ End of 5.3 test # CREATE TABLE t1 (a INT, b INT, c INT, KEY (a,b)); INSERT INTO t1 VALUES (1,1,1), (1,2,1), (1,3,1), (1,4,1); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT a, b + 4, 1 FROM t1; +INSERT INTO t1 SELECT a, b + 8, 1 FROM t1; INSERT INTO t1 SELECT a + 1, b, 1 FROM t1; CREATE TABLE t2 (a INT, b INT, c INT, d INT, e INT, f INT, KEY (a,b,c)); -INSERT INTO t2 VALUES (1,1,1,1,1,1), (1,2,1,1,1,1), (1,3,1,1,1,1), -(1,4,1,1,1,1); +INSERT INTO t2 VALUES +(1,1,1,1,1,1), (1,2,1,1,1,1), (1,3,1,1,1,1), (1,4,1,1,1,1); +INSERT INTO t2 SELECT * FROM t2; +INSERT INTO t2 SELECT * FROM t2; +INSERT INTO t2 SELECT * FROM t2; +INSERT INTO t2 SELECT * FROM t2; INSERT INTO t2 SELECT a, b + 4, c,d,e,f FROM t2; INSERT INTO t2 SELECT a + 1, b, c,d,e,f FROM t2; +ANALYZE TABLE t1,t2; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK ++test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK EXPLAIN SELECT COUNT(DISTINCT a) FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by +1 SIMPLE t1 range NULL a 5 NULL 3 Using index for group-by SELECT COUNT(DISTINCT a) FROM t1; COUNT(DISTINCT a) 2 @@@ -3731,12 -3687,8 +3747,13 @@@ b drop table faulty; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3); +INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT a + 1, b FROM t1; INSERT INTO t1 SELECT a + 2, b FROM t1; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK CREATE INDEX break_it ON t1 (a, b); EXPLAIN SELECT distinct a, b FROM t1 where a = '3' ORDER BY b; @@@ -3792,28 -3744,24 +3809,29 @@@ DROP TABLE t1 CREATE TABLE t1 (a INT, b INT,c INT DEFAULT 0, INDEX (a,b)); INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6); +INSERT INTO t1 SELECT * FROM t1; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity; set @save_use_stat_tables= @@use_stat_tables; set @@optimizer_use_condition_selectivity=4; set @@use_stat_tables=PREFERABLY; explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra - 1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 4 100.00 - 1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 8 100.00 Using index - 2 MATERIALIZED t1 range NULL a 5 NULL 4 100.00 Using index for group-by -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8 100.00 -1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 100.00 Using index -2 MATERIALIZED t1 range NULL a 5 NULL 8 100.00 Using index for group-by ++1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5 100.00 ++1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 7 100.00 Using index ++2 MATERIALIZED t1 range NULL a 5 NULL 5 100.00 Using index for group-by Warnings: Note 1003 /* select#1 */ select `test`.`t1_outer`.`a` AS `a` from <materialize> (/* select#2 */ select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where `test`.`t1_outer`.`a` = `<subquery2>`.`max(b)` set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set @@use_stat_tables=@save_use_stat_tables; explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra - 1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 4 100.00 - 1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 8 100.00 Using index - 2 MATERIALIZED t1 range NULL a 5 NULL 4 100.00 Using index for group-by -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8 100.00 -1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 100.00 Using index -2 MATERIALIZED t1 range NULL a 5 NULL 8 100.00 Using index for group-by ++1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5 100.00 ++1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 7 100.00 Using index ++2 MATERIALIZED t1 range NULL a 5 NULL 5 100.00 Using index for group-by Warnings: Note 1003 /* select#1 */ select `test`.`t1_outer`.`a` AS `a` from <materialize> (/* select#2 */ select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where `test`.`t1_outer`.`a` = `<subquery2>`.`max(b)` drop table t1; @@@ -3843,18 -3791,15 +3861,19 @@@ INSERT INTO t1 VALUES (4,'2001-01-01') INSERT INTO t1 VALUES (4,'2001-01-02'); INSERT INTO t1 VALUES (4,'2001-01-03'); INSERT INTO t1 VALUES (4,'2001-01-04'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>='2001-01-04' GROUP BY id; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL id 8 NULL 9 Using where; Using index for group-by +1 SIMPLE t1 range NULL id 8 NULL 5 Using where; Using index for group-by EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104.0 GROUP BY id; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL id 8 NULL 9 Using where; Using index for group-by +1 SIMPLE t1 range NULL id 8 NULL 5 Using where; Using index for group-by EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL id 8 NULL 9 Using where; Using index for group-by +1 SIMPLE t1 range NULL id 8 NULL 5 Using where; Using index for group-by SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>='2001-01-04' GROUP BY id; id MIN(a) MAX(a) 1 2001-01-04 2001-01-04 @@@ -3895,11 -3840,6 +3914,12 @@@ INSERT INTO t1 VALUES (4,'2001-01-01') INSERT INTO t1 VALUES (4,'2001-01-02'); INSERT INTO t1 VALUES (4,'2001-01-03'); INSERT INTO t1 VALUES (4,' 2001-01-04'); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN ' 2001-01-04' AND '2001-01-05' GROUP BY id; id MIN(a) MAX(a) 1 2001-01-04 2001-01-03 diff --cc mysql-test/main/index_merge_myisam.result index 8e83bdf,0438d0e..77d6ae2 --- a/mysql-test/main/index_merge_myisam.result +++ b/mysql-test/main/index_merge_myisam.result @@@ -19,15 -18,16 +19,16 @@@ alter table t0 add key8 int not null, a update t0 set key2=key1,key3=key1,key4=key1,key5=key1,key6=key1,key7=key1,key8=1024-key1; analyze table t0; Table Op Msg_type Msg_text + test.t0 analyze status Engine-independent statistics collected test.t0 analyze status OK -explain select * from t0 where key1 < 3 or key1 > 1020; +explain select * from t0 where key1 < 3 or key1 > 920 and key1 < 924; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 range i1 i1 4 NULL 78 Using index condition; Using where +1 SIMPLE t0 range i1 i1 4 NULL 5 Using index condition; Using where explain -select * from t0 where key1 < 3 or key2 > 1020; +select * from t0 where key1 < 3 or key2 > 920 and key2 < 924; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 index_merge i1,i2 i1,i2 4,4 NULL 45 Using sort_union(i1,i2); Using where -select * from t0 where key1 < 3 or key2 > 1020; +1 SIMPLE t0 index_merge i1,i2 i1,i2 4,4 NULL 5 Using sort_union(i1,i2); Using where +select * from t0 where key1 < 3 or key2 > 920 and key2 < 924; key1 key2 key3 key4 key5 key6 key7 key8 1 1 1 1 1 1 1 1023 2 2 2 2 2 2 2 1022 diff --cc mysql-test/main/innodb_icp.result index c65e4d1,00ca6b1..07d3179 --- a/mysql-test/main/innodb_icp.result +++ b/mysql-test/main/innodb_icp.result @@@ -595,10 -590,6 +595,12 @@@ i1 INTEGER NOT NULL PRIMARY KEY (pk) ); INSERT INTO t2 VALUES (4,1); +ANALYZE TABLE t1,t2; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK ++test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK EXPLAIN SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 WHERE t2.pk <> t1.d1 AND t2.pk = 4; @@@ -804,10 -795,6 +806,12 @@@ INSERT INTO t2 (g,h) VALUE (0,'p'),(0,'f'),(0,'p'),(7,'d'),(7,'f'),(5,'j'), (3,'e'),(1,'u'),(4,'v'),(9,'u'),(6,'i'),(1,'x'), (7,'f'),(5,'j'),(3,'e'),(1,'u'),(4,'v'),(9,'u'); +ANALYZE TABLE t1,t2; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK ++test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK SET @save_optimize_switch=@@optimizer_switch; SET optimizer_switch='materialization=on'; EXPLAIN @@@ -817,7 -804,7 +821,7 @@@ AND (EXISTS (SELECT * FROM t1, t2 WHER OR a = 0 AND h < 'z' ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t ALL PRIMARY,c NULL NULL NULL 64 Using where --1 PRIMARY t2 ref g g 5 test.t.c 9 Using where ++1 PRIMARY t2 ref g g 5 test.t.c 18 Using where 2 DEPENDENT SUBQUERY t1 index PRIMARY d 3 NULL 64 Using where; Using index 2 DEPENDENT SUBQUERY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where SELECT COUNT(*) FROM t1 AS t, t2 diff --cc mysql-test/main/myisam_explain_non_select_all.result index 939d6c4,d238b0d..bfc8370 --- a/mysql-test/main/myisam_explain_non_select_all.result +++ b/mysql-test/main/myisam_explain_non_select_all.result @@@ -701,9 -740,10 +740,10 @@@ FLUSH STATUS FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 100.00 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE # Status of EXPLAIN EXTENDED query Variable_name Value + Handler_read_key 3 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE t1.a > 0 ORDER BY t1.a; @@@ -721,8 -763,9 +763,9 @@@ Handler_read_key Handler_read_rnd_next 1 # Status of testing query execution: Variable_name Value -Handler_read_key 4 ++Handler_read_key 3 -INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t1 VALUES (1), (2), (3), (-1), (-2), (-3); # # query: DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a # select: SELECT * FROM t1 WHERE t1.a > 0 ORDER BY t1.a diff --cc mysql-test/main/mysqld--help.result index 68ed55c,d621c5c..528ee68 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@@ -1548,8 -1562,8 +1565,8 @@@ old-style-user-limits FALS optimizer-prune-level 1 optimizer-search-depth 62 optimizer-selectivity-sampling-limit 100 -optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on +optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on - optimizer-use-condition-selectivity 1 + optimizer-use-condition-selectivity 4 performance-schema FALSE performance-schema-accounts-size -1 performance-schema-consumer-events-stages-current FALSE diff --cc mysql-test/main/partition_innodb.result index 46353c6,e91d376..ed79bbb --- a/mysql-test/main/partition_innodb.result +++ b/mysql-test/main/partition_innodb.result @@@ -29,11 -24,9 +29,12 @@@ INSERT INTO t1 VALUES (0, 'Mod Zero'), (20, '0'), (21, '1'), (22, '2'), (23, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'); INSERT INTO t1 SELECT a + 30, b FROM t1 WHERE a >= 0; +INSERT INTO t1 SELECT a + 60, b FROM t1 WHERE a >= 0; +INSERT INTO t1 SELECT a + 120, b FROM t1 WHERE a >= 0; +INSERT INTO t1 SELECT a + 240, b FROM t1 WHERE a >= 0; ANALYZE TABLE t1; Table Op Msg_type Msg_text + test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK EXPLAIN SELECT b FROM t1 WHERE b between 'L' and 'N' AND a > -100; id select_type table type possible_keys key key_len ref rows Extra @@@ -935,6 -955,37 +965,40 @@@ test_jfg test_jfg1 test_jfg test_jfg12#P#p1000 test_jfg test_jfg12#P#pmax DROP DATABASE test_jfg; +set global innodb_stats_persistent= @innodb_stats_persistent_save; +set global innodb_stats_persistent_sample_pages= +@innodb_stats_persistent_sample_pages_save; + create table t1 (a int) engine=innodb; + create table t2 ( + b int, + c int, + d bit not null default 0, + v bit as (d) virtual, + key (b,v) + ) engine=innodb partition by hash (b); + insert into t1 values (1),(2); + insert into t2 (b,c,d) values (1,1,0),(2,2,0); + explain select t1.* from t1 join t2 on (v = a); + id select_type table type possible_keys key key_len ref rows Extra + 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 + 1 SIMPLE t2 index NULL b 7 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) + select t1.* from t1 join t2 on (v = a); + a + drop table t1, t2; + # + # End of 10.2 tests + # + # + # MDEV-16241 Assertion `inited==RND' failed in handler::ha_rnd_end() + # + CREATE TABLE t1 (pk INT PRIMARY KEY, x INT, y INT, z INT, KEY (x), KEY (y, z)) + WITH SYSTEM VERSIONING + PARTITION BY SYSTEM_TIME (PARTITION p1 HISTORY, PARTITION pn CURRENT); + INSERT INTO t1 VALUES (1, 7, 8, 9), (2, NULL, NULL, NULL), (3, NULL, NULL, NULL); + SELECT COUNT(*) FROM t1 WHERE x IS NULL AND y IS NULL AND z IS NULL; + COUNT(*) + 2 + DROP TABLE t1; + # + # End of 10.3 tests + # diff --cc mysql-test/main/partition_innodb.test index a8bbb7c,57d644d..e09a2b4 --- a/mysql-test/main/partition_innodb.test +++ b/mysql-test/main/partition_innodb.test @@@ -1028,6 -1048,37 +1060,40 @@@ database_name = 'test_jfg' DROP DATABASE test_jfg; +set global innodb_stats_persistent= @innodb_stats_persistent_save; +set global innodb_stats_persistent_sample_pages= + @innodb_stats_persistent_sample_pages_save; + # + # MDEV-17755 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' failed in Field_bit::val_int upon SELECT with JOIN, partitions, indexed virtual column + # + create table t1 (a int) engine=innodb; + create table t2 ( + b int, + c int, + d bit not null default 0, + v bit as (d) virtual, + key (b,v) + ) engine=innodb partition by hash (b); + insert into t1 values (1),(2); + insert into t2 (b,c,d) values (1,1,0),(2,2,0); + explain select t1.* from t1 join t2 on (v = a); + select t1.* from t1 join t2 on (v = a); + drop table t1, t2; + + --echo # + --echo # End of 10.2 tests + --echo # + + --echo # + --echo # MDEV-16241 Assertion `inited==RND' failed in handler::ha_rnd_end() + --echo # + CREATE TABLE t1 (pk INT PRIMARY KEY, x INT, y INT, z INT, KEY (x), KEY (y, z)) + WITH SYSTEM VERSIONING + PARTITION BY SYSTEM_TIME (PARTITION p1 HISTORY, PARTITION pn CURRENT); + INSERT INTO t1 VALUES (1, 7, 8, 9), (2, NULL, NULL, NULL), (3, NULL, NULL, NULL); + SELECT COUNT(*) FROM t1 WHERE x IS NULL AND y IS NULL AND z IS NULL; + DROP TABLE t1; + + --echo # + --echo # End of 10.3 tests + --echo # diff --cc mysql-test/main/range.result index 83237a9,2c2f7be..8bef87d --- a/mysql-test/main/range.result +++ b/mysql-test/main/range.result @@@ -2529,7 -2477,7 +2533,7 @@@ EXPLAI "key_length": "5", "used_key_parts": ["d"], "rows": 3, - "filtered": 100, - "filtered": 55, ++ "filtered": 60, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))" }, @@@ -2585,8 -2533,8 +2589,8 @@@ insert into t2 value explain select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1; id select_type table type possible_keys key key_len ref rows Extra - 1 SIMPLE t1 range idx idx 5 NULL 6 Using index condition - 1 SIMPLE t2 ref|filter idx1,idx2 idx1|idx2 5|5 test.t1.a 12 (14%) Using where; Using filter -1 SIMPLE t2 range idx1,idx2 idx1 5 NULL 8 Using index condition; Using where ++1 SIMPLE t2 range|filter idx1,idx2 idx1|idx2 5|5 NULL 8 (14%) Using index condition; Using where; Using filter + 1 SIMPLE t1 ref idx idx 5 test.t2.d 8 explain format=json select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1; EXPLAIN @@@ -2611,18 -2548,21 +2604,29 @@@ "key": "idx1", "key_length": "5", "used_key_parts": ["d"], - "ref": ["test.t1.a"], + "rowid_filter": { + "range": { + "key": "idx2", + "used_key_parts": ["e"] + }, + "rows": 15, + "selectivity_pct": 14.423 + }, - "rows": 12, - "filtered": 100, - "attached_condition": "(t1.a,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" + "rows": 8, - "filtered": 12.5, ++ "filtered": 14.423, + "index_condition": "t2.d is not null", + "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" + }, + "table": { + "table_name": "t1", + "access_type": "ref", + "possible_keys": ["idx"], + "key": "idx", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t2.d"], + "rows": 8, + "filtered": 100 } } } @@@ -2702,21 -2642,12 +2706,21 @@@ EXPLAI "table_name": "t2", "access_type": "range", "possible_keys": ["idx1", "idx2"], - "key": "idx2", + "key": "idx1", "key_length": "5", - "used_key_parts": ["e"], - "rows": 6, + "used_key_parts": ["d"], + "rowid_filter": { + "range": { + "key": "idx2", + "used_key_parts": ["e"] + }, + "rows": 7, + "selectivity_pct": 6.7308 + }, + "rows": 7, - "filtered": 100, + "filtered": 6.7308, - "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1 and t2.d is not null" + "index_condition": "t2.d is not null", + "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" }, "table": { "table_name": "t1", diff --cc mysql-test/main/range_mrr_icp.result index a4a64dd,97f35bf..5d55a82 --- a/mysql-test/main/range_mrr_icp.result +++ b/mysql-test/main/range_mrr_icp.result @@@ -2535,7 -2482,7 +2539,7 @@@ EXPLAI "key_length": "5", "used_key_parts": ["d"], "rows": 3, - "filtered": 100, - "filtered": 55, ++ "filtered": 60, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))", "mrr_type": "Rowid-ordered scan" @@@ -2601,15 -2548,16 +2605,16 @@@ EXPLAI "query_block": { "select_id": 1, "table": { - "table_name": "t1", + "table_name": "t2", "access_type": "range", - "possible_keys": ["idx"], - "key": "idx", + "possible_keys": ["idx1", "idx2"], + "key": "idx1", "key_length": "5", - "used_key_parts": ["a"], - "rows": 6, - "filtered": 100, - "index_condition": "t1.a is not null", + "used_key_parts": ["d"], + "rows": 8, - "filtered": 12.5, ++ "filtered": 14.423, + "index_condition": "t2.d is not null", + "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1", "mrr_type": "Rowid-ordered scan" }, "table": { @@@ -2702,13 -2649,12 +2706,13 @@@ EXPLAI "table_name": "t2", "access_type": "range", "possible_keys": ["idx1", "idx2"], - "key": "idx2", + "key": "idx1", "key_length": "5", - "used_key_parts": ["e"], - "rows": 6, + "used_key_parts": ["d"], + "rows": 7, - "filtered": 100, + "filtered": 6.7308, - "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1 and t2.d is not null", + "index_condition": "t2.d is not null", + "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1", "mrr_type": "Rowid-ordered scan" }, "table": { diff --cc mysql-test/main/range_vs_index_merge.result index d332156,b8900af..82d2358 --- a/mysql-test/main/range_vs_index_merge.result +++ b/mysql-test/main/range_vs_index_merge.result @@@ -1079,7 -1079,7 +1079,7 @@@ EXPLAIN SELECT Name, Country, Populatio (Name='Samara' AND Country='RUS') OR (Name='Seattle' AND Country='USA'); id select_type table type possible_keys key key_len ref rows Extra - 1 SIMPLE City index_merge Country,CountryPopulation,CountryName,CityName CountryName,CityName 38,35 NULL 28 Using sort_union(CountryName,CityName); Using where -1 SIMPLE City index_merge Country,CountryPopulation,CountryName,CityName CityName,CountryName 35,38 NULL 27 Using sort_union(CityName,CountryName); Using where ++1 SIMPLE City range Country,CountryPopulation,CountryName,CityName CityName 35 NULL 27 Using index condition; Using where SELECT Name, Country, Population FROM City WHERE (Name='Manila' AND Country='PHL') OR (Name='Addis Abeba' AND Country='ETH') OR @@@ -1110,32 -1110,32 +1110,32 @@@ (Name='Seattle' AND Country='USA'); Name Country Population Addis Abeba ETH 2495000 --Manila PHL 1581082 --Jakarta IDN 9604900 --Delhi IND 7206704 ++Ankara TUR 3038159 Bangalore IND 2660088 --Teheran IRN 6758845 --Roma ITA 2643581 --Venezia ITA 277305 --Tokyo JPN 7980230 --Toronto CAN 688275 --Vancouver CAN 514008 --Peking CHN 7472000 --Seoul KOR 9981619 ++Basel CHE 166700 ++Caracas VEN 1975294 ++Dakar SEN 785071 ++Delhi IND 7206704 ++Dresden DEU 476668 ++Jakarta IDN 9604900 Kaunas LTU 412639 --Rabat MAR 623457 --Tijuana MEX 1212232 Lagos NGA 1518000 ++Lugansk UKR 469000 ++Manila PHL 1581082 Paris FRA 2125246 --Dresden DEU 476668 --Dakar SEN 785071 --Basel CHE 166700 ++Peking CHN 7472000 Praha CZE 1181126 --Ankara TUR 3038159 --Lugansk UKR 469000 --Caracas VEN 1975294 ++Rabat MAR 623457 ++Roma ITA 2643581 Samara RUS 1156100 Seattle USA 563374 ++Seoul KOR 9981619 ++Teheran IRN 6758845 ++Tijuana MEX 1212232 ++Tokyo JPN 7980230 ++Toronto CAN 688275 ++Vancouver CAN 514008 ++Venezia ITA 277305 set optimizer_switch='index_merge=off'; EXPLAIN SELECT Name, Country, Population FROM City WHERE (Name='Manila' AND Country='PHL') OR @@@ -1166,7 -1166,7 +1166,7 @@@ (Name='Samara' AND Country='RUS') OR (Name='Seattle' AND Country='USA'); id select_type table type possible_keys key key_len ref rows Extra - 1 SIMPLE City range Country,CountryPopulation,CountryName,CityName CountryName 38 NULL 28 Using index condition; Using where -1 SIMPLE City range Country,CountryPopulation,CountryName,CityName CountryName 38 NULL 27 Using index condition; Using where ++1 SIMPLE City range Country,CountryPopulation,CountryName,CityName CityName 35 NULL 27 Using index condition; Using where SELECT Name, Country, Population FROM City WHERE (Name='Manila' AND Country='PHL') OR (Name='Addis Abeba' AND Country='ETH') OR @@@ -1196,33 -1196,33 +1196,33 @@@ (Name='Samara' AND Country='RUS') OR (Name='Seattle' AND Country='USA'); Name Country Population --Toronto CAN 688275 --Vancouver CAN 514008 --Basel CHE 166700 --Peking CHN 7472000 --Praha CZE 1181126 --Dresden DEU 476668 Addis Abeba ETH 2495000 --Paris FRA 2125246 --Jakarta IDN 9604900 ++Ankara TUR 3038159 Bangalore IND 2660088 ++Basel CHE 166700 ++Caracas VEN 1975294 ++Dakar SEN 785071 Delhi IND 7206704 --Teheran IRN 6758845 --Roma ITA 2643581 --Venezia ITA 277305 --Tokyo JPN 7980230 --Seoul KOR 9981619 ++Dresden DEU 476668 ++Jakarta IDN 9604900 Kaunas LTU 412639 --Rabat MAR 623457 --Tijuana MEX 1212232 Lagos NGA 1518000 ++Lugansk UKR 469000 Manila PHL 1581082 ++Paris FRA 2125246 ++Peking CHN 7472000 ++Praha CZE 1181126 ++Rabat MAR 623457 ++Roma ITA 2643581 Samara RUS 1156100 --Dakar SEN 785071 --Ankara TUR 3038159 --Lugansk UKR 469000 Seattle USA 563374 --Caracas VEN 1975294 ++Seoul KOR 9981619 ++Teheran IRN 6758845 ++Tijuana MEX 1212232 ++Tokyo JPN 7980230 ++Toronto CAN 688275 ++Vancouver CAN 514008 ++Venezia ITA 277305 set optimizer_switch=@save_optimizer_switch; # # Bug mdev-585: range vs index-merge with ORDER BY ... LIMIT n @@@ -1713,9 -1749,6 +1749,10 @@@ PRIMARY KEY(b), INDEX idx1(d), INDEX id INSERT INTO t1 VALUES (0,58,7,7),(0,63,2,0),(0,64,186,8),(0,65,1,-2), (0,71,190,-3), (0,72,321,-7),(0,73,0,3),(0,74,5,25),(0,75,5,3); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK SET SESSION optimizer_switch='index_merge_sort_union=off'; EXPLAIN SELECT * FROM t1 @@@ -1793,9 -1826,6 +1830,10 @@@ INSERT INTO t1 VALUE (7,'Pennsylvania','Harrisburg'), (8,'Virginia','Richmond') ; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK EXPLAIN SELECT * FROM t1 FORCE KEY (state,capital) WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 @@@ -1862,23 -1892,23 +1900,23 @@@ Country='NOR' AND Name IN ('Oslo', 'Ber Country='ITA' AND Name IN ('Napoli', 'Venezia'); ID Name Country Population 175 Antwerpen BEL 446525 --176 Gent BEL 224180 ++2808 Bergen NOR 230948 3068 Berlin DEU 3386667 3087 Bonn DEU 301048 ++2918 Braga PRT 90535 ++176 Gent BEL 224180 3242 Lahti FIN 96921 --2974 Paris FRA 2125246 ++3580 Moscow RUS 8389200 1466 Napoli ITA 1002619 --1474 Venezia ITA 277305 --2808 Bergen NOR 230948 2807 Oslo NOR 508726 --2928 Warszawa POL 1615369 --2931 Wroclaw POL 636765 --2918 Braga PRT 90535 ++2974 Paris FRA 2125246 2915 Porto PRT 273060 --3580 Moscow RUS 8389200 3581 St Petersburg RUS 4694000 3048 Stockholm SWE 750348 3051 Uppsala SWE 189569 ++1474 Venezia ITA 277305 ++2928 Warszawa POL 1615369 ++2931 Wroclaw POL 636765 explain select * from City where Country='FIN' AND Name IN ('Lahti','Imatra') OR @@@ -1892,6 -1922,6 +1930,6 @@@ Country='POL' AND Name IN ('Warszawa', Country='NOR' AND Name IN ('Oslo', 'Bergen') OR Country='ITA' AND Name IN ('Napoli', 'Venezia'); id select_type table type possible_keys key key_len ref rows Extra --1 SIMPLE City range CountryName,Name CountryName 38 NULL 20 Using index condition; Using where ++1 SIMPLE City range CountryName,Name Name 35 NULL 20 Using index condition; Using where DROP DATABASE world; set session optimizer_switch='index_merge_sort_intersection=default'; diff --cc mysql-test/main/stat_tables_innodb.result index 69c07b0,c8b18f0..feb7a4c --- a/mysql-test/main/stat_tables_innodb.result +++ b/mysql-test/main/stat_tables_innodb.result @@@ -72,11 -67,11 +72,11 @@@ and r_name = 'AMERICA' and o_orderdate group by n_name order by revenue desc; id select_type table type possible_keys key key_len ref rows Extra - 1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_custkey i_o_orderdate 4 NULL 213 Using where; Using temporary; Using filesort - 1 SIMPLE customer eq_ref PRIMARY,i_c_nationkey PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where - 1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.customer.c_nationkey 1 - 1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.customer.c_nationkey 1 Using index - 1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) + 1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using temporary; Using filesort + 1 SIMPLE nation ref PRIMARY,i_n_regionkey i_n_regionkey 5 dbt3_s001.region.r_regionkey 5 + 1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 Using index + 1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 SIMPLE orders ref PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey 5 dbt3_s001.customer.c_custkey 15 Using where ++1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using filter 1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region @@@ -203,11 -198,11 +203,11 @@@ and r_name = 'AMERICA' and o_orderdate group by n_name order by revenue desc; id select_type table type possible_keys key key_len ref rows Extra - 1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_custkey i_o_orderdate 4 NULL 213 Using where; Using temporary; Using filesort - 1 SIMPLE customer eq_ref PRIMARY,i_c_nationkey PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where - 1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.customer.c_nationkey 1 - 1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.customer.c_nationkey 1 Using index - 1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) + 1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using temporary; Using filesort + 1 SIMPLE nation ref PRIMARY,i_n_regionkey i_n_regionkey 5 dbt3_s001.region.r_regionkey 5 + 1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 Using index + 1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 SIMPLE orders ref PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey 5 dbt3_s001.customer.c_custkey 15 Using where ++1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using filter 1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region @@@ -638,8 -652,61 +657,64 @@@ MAX(pk NULL DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; + # + # MDEV-17255: New optimizer defaults and ANALYZE TABLE + # + create table t1 (a int, b int); + insert into t1(a,b) values (1,2),(1,3),(1,4),(1,5),(2,6),(2,7),(3,8),(3,9),(3,9),(4,10); + set use_stat_tables= preferably_for_queries; + # + # with use_stat_tables= PREFERABLY_FOR_QUERIES + # analyze table t1 will not collect statistics + # + analyze table t1; + Table Op Msg_type Msg_text + test.t1 analyze status OK + select * from mysql.column_stats; + db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram + analyze + select * from t1 where a = 1 and b=3; + id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra + 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 10.00 Using where + # + # with use_stat_tables= PREFERABLY_FOR_QUERIES + # analyze table t1 will collect statistics if we use PERSISTENT + # for columns, indexes or everything + # + analyze table t1 persistent for columns (a) indexes (); + Table Op Msg_type Msg_text + test.t1 analyze status Engine-independent statistics collected + test.t1 analyze status OK + select * from mysql.column_stats; + db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram + test t1 a 1 4 0.0000 4.0000 2.5000 0 NULL NULL + # filtered shows that we used the data from stat tables + analyze + select * from t1 where a = 1 and b=3; + id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra + 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 25.00 10.00 Using where + # + # with use_stat_tables= PREFERABLY + # analyze table t1 will collect statistics + # + set use_stat_tables=PREFERABLY; + analyze table t1; + Table Op Msg_type Msg_text + test.t1 analyze status Engine-independent statistics collected + test.t1 analyze status OK + select * from mysql.column_stats; + db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram + test t1 a 1 4 0.0000 4.0000 2.5000 0 NULL NULL + test t1 b 2 10 0.0000 4.0000 1.1111 0 NULL NULL + # filtered shows that we used the data from stat tables + analyze + select * from t1 where a=1 and b=3; + id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra + 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 2.78 10.00 Using where + drop table t1; + set use_stat_tables=@save_use_stat_tables; +set global innodb_stats_persistent= @innodb_stats_persistent_save; +set global innodb_stats_persistent_sample_pages= +@innodb_stats_persistent_sample_pages_save; set optimizer_switch=@save_optimizer_switch_for_stat_tables_test; SET SESSION STORAGE_ENGINE=DEFAULT; diff --cc mysql-test/main/subselect_sj2_mat.result index 65dfddc,78df076..c05db8d --- a/mysql-test/main/subselect_sj2_mat.result +++ b/mysql-test/main/subselect_sj2_mat.result @@@ -74,11 -69,6 +74,14 @@@ primary key(pk1, pk2, pk3 ) engine=innodb; insert into t3 select a,a, a,a,a from t0; insert into t3 select a,a, a+100,a+100,a+100 from t0; +analyze table t1,t2,t3; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK ++test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK ++test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK explain select * from t3 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL b NULL NULL NULL 20 @@@ -933,10 -924,6 +936,12 @@@ INSERT INTO t2 VALUE (6,'u',6),(7,'m',7),(8,'k',8),(9,'o',9),(10,'w',1), (11,'m',2),(12,'q',3),(13,'m',4),(14,'d',5), (15,'g',6),(16,'x',7),(17,'f',8); +analyze table t1,t2; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK ++test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK explain SELECT * FROM t1 WHERE b IN ( SELECT d FROM t2, t1 @@@ -968,9 -955,6 +973,10 @@@ INSERT INTO t1 VALUE ('y','y'),('t','t'),('d','d'),('s','s'),('r','r'), ('m','m'),('b','b'),('x','x'),('g','g'),('p','p'), ('q','q'),('w','w'),('d','d'),('e','e'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; # This query returned 6 rows instead of 19 SELECT * FROM v1 @@@ -1004,9 -988,6 +1010,10 @@@ y CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(1) NOT NULL, KEY(a)) ENGINE=InnoDB; INSERT INTO t2 SELECT * FROM t1; INSERT INTO t2 SELECT * FROM t1; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text ++test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK EXPLAIN SELECT * FROM t2 WHERE (a, a) IN (SELECT alias2.b, alias2.a FROM t1 AS alias1, t1 AS alias2 @@@ -1253,11 -1234,6 +1260,14 @@@ INSERT IGNORE INTO t2 (t2id, t1idref) S INSERT IGNORE INTO t1 VALUES (200001, 'a'); INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001); INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3); +ANALYZE TABLE t1,t2,t3; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK ++test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK ++test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK set @tmp7474= @@optimizer_search_depth; SET SESSION optimizer_search_depth = 1; SELECT SQL_NO_CACHE @@@ -1873,14 -1841,6 +1883,19 @@@ CREATE TABLE t5 (id_product int) ENGINE INSERT INTO `t5` VALUES (652),(668),(669),(670),(671),(673),(674),(675),(676), (677),(679),(680),(681),(682),(683),(684),(685),(686); +ANALYZE TABLE t1,t2,t3,t,t5; +Table Op Msg_type Msg_text ++test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK ++test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status Table is already up to date ++test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK +test.t analyze Error Table 'test.t' doesn't exist +test.t analyze status Operation failed ++test.t5 analyze status Engine-independent statistics collected +test.t5 analyze status OK ++set optimizer_switch='rowid_filter=off'; explain SELECT * FROM t3 JOIN t4 ON (t4.id_product = t3.id_product AND t4.id_shop = 1) @@@ -1893,21 -1853,18 +1908,22 @@@ AND t3.id_product IN (SELECT id_produc AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23) AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26); id select_type table type possible_keys key key_len ref rows Extra - 1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using index - 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.id_product 1 Using index + 1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 12 + 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t2_2.id_product 1 Using where; Using index 1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 4 func 1 Using where - 1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 Using where - 1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where - 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where - 1 PRIMARY t4 eq_ref PRIMARY PRIMARY 8 test.t1.id_product,const 1 Using where; Using index - 1 PRIMARY <subquery6> eq_ref distinct_key distinct_key 4 func 1 Using where 1 PRIMARY t5 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) + 1 PRIMARY <subquery6> eq_ref distinct_key distinct_key 4 func 1 Using where + 1 PRIMARY t4 eq_ref PRIMARY PRIMARY 8 test.t3.id_product,const 1 Using where; Using index + 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where + 1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 Using where + 1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using where; Using index; Using join buffer (flat, BNL join) + 3 MATERIALIZED t2_2 ref id_t2,id_product id_t2 5 const 12 Using where 5 MATERIALIZED t2_4 range id_t2,id_product id_t2 5 NULL 18 Using index condition; Using where - 4 MATERIALIZED t2_3 range id_t2,id_product id_t2 5 NULL 33 Using index condition; Using where - 3 MATERIALIZED t2_2 ref id_t2,id_product id_t2 5 const 12 - 2 MATERIALIZED t2_1 ref id_t2,id_product id_t2 5 const 51 -6 MATERIALIZED t2_5 range id_t2,id_product id_t2 5 NULL 30 Using index condition; Using where -2 MATERIALIZED t2_1 ref id_t2,id_product id_t2 5 const 50 -4 MATERIALIZED t2_3 range id_t2,id_product id_t2 5 NULL 32 Using index condition; Using where +6 MATERIALIZED t2_5 range id_t2,id_product id_t2 5 NULL 31 Using index condition; Using where ++2 MATERIALIZED t2_1 ref id_t2,id_product id_t2 5 const 51 ++4 MATERIALIZED t2_3 range id_t2,id_product id_t2 5 NULL 33 Using index condition; Using where ++set optimizer_switch='rowid_filter=default'; drop table t1,t2,t3,t4,t5; +set global innodb_stats_persistent= @innodb_stats_persistent_save; +set global innodb_stats_persistent_sample_pages= +@innodb_stats_persistent_sample_pages_save; diff --cc mysql-test/main/subselect_sj2_mat.test index 47e48283,6ae687a..91057f0 --- a/mysql-test/main/subselect_sj2_mat.test +++ b/mysql-test/main/subselect_sj2_mat.test @@@ -473,8 -467,6 +473,10 @@@ CREATE TABLE t5 (id_product int) ENGINE INSERT INTO `t5` VALUES (652),(668),(669),(670),(671),(673),(674),(675),(676), (677),(679),(680),(681),(682),(683),(684),(685),(686); + +ANALYZE TABLE t1,t2,t3,t,t5; ++ ++set optimizer_switch='rowid_filter=off'; explain SELECT * FROM t3 @@@ -488,8 -480,4 +490,10 @@@ AND t3.id_product IN (SELECT id_produc AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23) AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26); ++set optimizer_switch='rowid_filter=default'; ++ drop table t1,t2,t3,t4,t5; + +set global innodb_stats_persistent= @innodb_stats_persistent_save; +set global innodb_stats_persistent_sample_pages= + @innodb_stats_persistent_sample_pages_save; diff --cc sql/CMakeLists.txt index b37962d,a22ce69..6cb78f4 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@@ -134,10 -139,9 +139,10 @@@ SET (SQL_SOURC sql_sequence.cc sql_sequence.h ha_sequence.h sql_tvc.cc sql_tvc.h opt_split.cc + rowid_filter.cc rowid_filter.h ${WSREP_SOURCES} table_cache.cc encryption.cc temporary_tables.cc - proxy_protocol.cc + proxy_protocol.cc backup.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc_ora.cc diff --cc sql/structs.h index 12b5dee,3e29e13..8aec29b --- a/sql/structs.h +++ b/sql/structs.h @@@ -118,13 -109,8 +118,13 @@@ typedef struct st_key pk2 is explicitly present in idx1, it is not in the extension, so ext_key_part_map.is_set(1) == false */ - LEX_CSTRING name; key_part_map ext_key_part_map; + /* + Bitmap of indexes having common parts with this index + (only key parts from key definitions are taken into account) + */ + key_map overlapped; + LEX_CSTRING name; uint block_size; enum ha_key_alg algorithm; /* diff --cc storage/innobase/handler/ha_innodb.cc index 0b4880b,683a641..4606285 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@@ -7558,14 -7574,8 +7579,15 @@@ ha_innobase::build_template /* Below we check column by column if we need to access the clustered index. */ + if (pushed_rowid_filter && rowid_filter_is_active) { + fetch_primary_key_cols = TRUE; + m_prebuilt->pk_filter = this; + } else { + m_prebuilt->pk_filter = NULL; + } + - n_fields = (ulint) mysql_fields(table); + const bool skip_virtual = omits_virtual_cols(*table_share); + const ulint n_fields = table_share->fields; if (!m_prebuilt->mysql_template) { m_prebuilt->mysql_template = (mysql_row_templ_t*) @@@ -7585,26 -7595,24 +7607,25 @@@ /* Note that in InnoDB, i is the column number in the table. MySQL calls columns 'fields'. */ + ulint num_v = 0; + - if (active_index != MAX_KEY - && active_index == pushed_idx_cond_keyno) { + if ((active_index != MAX_KEY + && active_index == pushed_idx_cond_keyno) || + (pushed_rowid_filter && rowid_filter_is_active)) { - ulint num_v = 0; - /* Push down an index condition or an end_range check. */ - for (i = 0; i < n_fields; i++) { - ibool index_contains; - - if (innobase_is_v_fld(table->field[i])) { - index_contains = dict_index_contains_col_or_prefix( - index, num_v, true); - if (index_contains) - { - m_prebuilt->n_template = 0; - goto no_icp; - } - } else { - index_contains = dict_index_contains_col_or_prefix( - index, i - num_v, false); + for (ulint i = 0; i < n_fields; i++) { + const Field* field = table->field[i]; + const bool is_v = innobase_is_v_fld(field); + if (is_v && skip_virtual) { + num_v++; + continue; + } + bool index_contains = index->contains_col_or_prefix( + is_v ? num_v : i - num_v, is_v); + if (is_v && index_contains) { + m_prebuilt->n_template = 0; + num_v = 0; + goto no_icp; } /* Test if an end_range or an index condition
participants (1)
-
IgorBabaev