summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--CMakeLists.txt92
-rw-r--r--EXCEPTIONS-CLIENT136
-rw-r--r--README.md8
-rw-r--r--VERSION2
-rw-r--r--appveyor.yml39
-rw-r--r--client/CMakeLists.txt3
-rw-r--r--client/mysql.cc22
-rw-r--r--client/mysql_plugin.c63
-rw-r--r--client/mysqltest.cc15
-rw-r--r--cmake/FindGit.cmake13
-rw-r--r--cmake/FindJNI.cmake5
-rw-r--r--cmake/FindJava.cmake5
-rw-r--r--cmake/build_configurations/mysql_release.cmake28
-rw-r--r--cmake/cpack_rpm.cmake10
-rw-r--r--cmake/cpu_info.cmake4
-rw-r--r--cmake/do_abi_check.cmake5
-rw-r--r--cmake/for_clients.cmake2
-rw-r--r--cmake/jemalloc.cmake1
-rw-r--r--cmake/maintainer.cmake8
-rw-r--r--cmake/numa.cmake1
-rw-r--r--cmake/os/OpenBSD.cmake22
-rw-r--r--cmake/os/Windows.cmake1
-rw-r--r--cmake/package_name.cmake6
-rw-r--r--cmake/plugin.cmake35
-rw-r--r--cmake/readline.cmake2
-rw-r--r--cmake/ssl.cmake1
-rw-r--r--cmake/submodules.cmake2
-rw-r--r--cmake/systemd.cmake1
-rw-r--r--cmake/wsrep.cmake3
-rw-r--r--configure.cmake1
-rw-r--r--dbug/CMakeLists.txt2
-rwxr-xr-xdebian/autobake-deb.sh9
-rw-r--r--debian/control6
-rw-r--r--debian/mariadb-server-10.2.postinst12
-rw-r--r--extra/innochecksum.cc205
-rw-r--r--extra/mariabackup/CMakeLists.txt1
-rw-r--r--extra/mariabackup/backup_copy.cc2
-rw-r--r--extra/mariabackup/backup_mysql.cc8
-rw-r--r--extra/mariabackup/datasink.cc8
-rw-r--r--extra/mariabackup/datasink.h1
-rw-r--r--extra/mariabackup/ds_archive.cc281
-rw-r--r--extra/mariabackup/ds_archive.h28
-rw-r--r--extra/mariabackup/ds_xbstream.cc10
-rw-r--r--extra/mariabackup/innobackupex.cc95
-rw-r--r--extra/mariabackup/xtrabackup.cc118
-rw-r--r--extra/my_print_defaults.c2
-rw-r--r--include/ft_global.h3
-rw-r--r--include/my_context.h3
-rw-r--r--include/my_global.h2
-rw-r--r--include/my_pthread.h12
-rw-r--r--include/my_sys.h5
-rw-r--r--include/mysql/psi/psi.h6
-rw-r--r--include/mysql/psi/psi_abi_v1.h.pp6
m---------libmariadb0
-rw-r--r--man/mysql.19
-rw-r--r--man/mysqlbinlog.121
-rw-r--r--man/mysqldump.110
-rw-r--r--mysql-test/collections/smoke_test138
-rwxr-xr-xmysql-test/dgcov.pl38
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test18
-rw-r--r--mysql-test/extra/binlog_tests/ctype_ucs_binlog.test2
-rw-r--r--mysql-test/include/commit.inc2
-rw-r--r--mysql-test/lib/My/Debugger.pm6
-rw-r--r--mysql-test/lib/My/Find.pm2
-rw-r--r--mysql-test/lib/My/Options.pm22
-rw-r--r--mysql-test/lib/My/SafeProcess.pm20
-rw-r--r--mysql-test/lib/mtr_cases.pm6
-rw-r--r--mysql-test/lib/mtr_process.pl8
-rw-r--r--mysql-test/lib/mtr_report.pm30
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl8
-rwxr-xr-xmysql-test/mysql-test-run.pl190
-rw-r--r--mysql-test/r/alter_table.result17
-rw-r--r--mysql-test/r/commit_1innodb.result2
-rw-r--r--mysql-test/r/create_or_replace.result19
-rw-r--r--mysql-test/r/cte_nonrecursive.result335
-rw-r--r--mysql-test/r/cte_recursive.result103
-rw-r--r--mysql-test/r/ctype_filename.result29
-rw-r--r--mysql-test/r/ctype_utf16_def.result5
-rw-r--r--mysql-test/r/ctype_utf16le.result33
-rw-r--r--mysql-test/r/ctype_utf32_def.result6
-rw-r--r--mysql-test/r/ctype_utf32_uca.result22
-rw-r--r--mysql-test/r/ctype_utf8.result17
-rw-r--r--mysql-test/r/default.result8
-rw-r--r--mysql-test/r/delayed_blob.result17
-rw-r--r--mysql-test/r/derived_cond_pushdown.result185
-rw-r--r--mysql-test/r/derived_opt.result27
-rw-r--r--mysql-test/r/derived_view.result21
-rw-r--r--mysql-test/r/fulltext.result2
-rw-r--r--mysql-test/r/func_json.result6
-rw-r--r--mysql-test/r/func_str.result12
-rw-r--r--mysql-test/r/gis-json.result10
-rw-r--r--mysql-test/r/grant5.result45
-rw-r--r--mysql-test/r/information_schema-big.result4
-rw-r--r--mysql-test/r/information_schema.result22
-rw-r--r--mysql-test/r/information_schema_all_engines.result12
-rw-r--r--mysql-test/r/join_outer.result40
-rw-r--r--mysql-test/r/join_outer_jcl6.result40
-rw-r--r--mysql-test/r/mdev-504.result24
-rw-r--r--mysql-test/r/mdev19198.result15
-rw-r--r--mysql-test/r/mdev_22370.result4
-rw-r--r--mysql-test/r/multi_update.result53
-rw-r--r--mysql-test/r/mysql_binary_zero_insert.result54
-rw-r--r--mysql-test/r/mysql_client_test.result5
-rw-r--r--mysql-test/r/mysql_upgrade.result6
-rw-r--r--mysql-test/r/mysqld--help.result2
-rw-r--r--mysql-test/r/mysqldump-system.result24
-rw-r--r--mysql-test/r/order_by.result25
-rw-r--r--mysql-test/r/order_by_innodb.result52
-rw-r--r--mysql-test/r/plugin_vars.result35
-rw-r--r--mysql-test/r/processlist_notembedded.result17
-rw-r--r--mysql-test/r/ps.result55
-rw-r--r--mysql-test/r/selectivity_innodb.result51
-rw-r--r--mysql-test/r/selectivity_no_engine.result20
-rw-r--r--mysql-test/r/show.result32
-rw-r--r--mysql-test/r/skip_name_resolve.result22
-rw-r--r--mysql-test/r/sp-code.result24
-rw-r--r--mysql-test/r/sp.result15
-rw-r--r--mysql-test/r/subselect4.result80
-rw-r--r--mysql-test/r/subselect_exists2in.result18
-rw-r--r--mysql-test/r/truncate.result5
-rw-r--r--mysql-test/r/truncate_notembedded.result22
-rw-r--r--mysql-test/r/udf.result8
-rw-r--r--mysql-test/r/view.result54
-rw-r--r--mysql-test/r/win.result306
-rw-r--r--mysql-test/r/xa.result41
-rw-r--r--mysql-test/suite.pm4
-rw-r--r--mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result40
-rw-r--r--mysql-test/suite/binlog/r/binlog_checkpoint_flush_logs.result51
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result23
-rw-r--r--mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result24
-rw-r--r--mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test98
-rw-r--r--mysql-test/suite/binlog/t/binlog_checkpoint_flush_logs.test79
-rw-r--r--mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test1
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master.test3
-rw-r--r--mysql-test/suite/encryption/r/innodb-key-rotation-disable.result4
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb_import.result22
-rw-r--r--mysql-test/suite/encryption/r/key_version_rotation.result19
-rw-r--r--mysql-test/suite/encryption/r/tempfiles_encrypted.result306
-rw-r--r--mysql-test/suite/encryption/t/innodb-key-rotation-disable.test3
-rw-r--r--mysql-test/suite/encryption/t/innodb-page_encryption.test3
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption.test6
-rw-r--r--mysql-test/suite/encryption/t/innodb_import.combinations7
-rw-r--r--mysql-test/suite/encryption/t/innodb_import.test22
-rw-r--r--mysql-test/suite/encryption/t/key_version_rotation.opt2
-rw-r--r--mysql-test/suite/encryption/t/key_version_rotation.test41
-rw-r--r--mysql-test/suite/federated/federated_partition.result36
-rw-r--r--mysql-test/suite/federated/federated_partition.test25
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_views.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is.result92
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is_embedded.result92
-rw-r--r--mysql-test/suite/funcs_1/r/memory_views.result8
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views-big.result8
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result37
-rw-r--r--mysql-test/suite/galera/disabled.def13
-rw-r--r--mysql-test/suite/galera/include/have_qpress.inc4
-rw-r--r--mysql-test/suite/galera/include/have_stunnel.inc4
-rw-r--r--mysql-test/suite/galera/r/galera_fk_lock_wait.result52
-rw-r--r--mysql-test/suite/galera/r/galera_fk_multibyte.result33
-rw-r--r--mysql-test/suite/galera/r/galera_ftwrl_drain.result16
-rw-r--r--mysql-test/suite/galera/r/galera_fulltext.result28
-rw-r--r--mysql-test/suite/galera/r/galera_inject_bf_long_wait.result22
-rw-r--r--mysql-test/suite/galera/r/galera_ist_innodb_flush_logs,debug.rdiff13
-rw-r--r--mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result2
-rw-r--r--mysql-test/suite/galera/r/galera_password.result19
-rw-r--r--mysql-test/suite/galera/r/galera_roles.result4
-rw-r--r--mysql-test/suite/galera/r/galera_ssl_upgrade.result17
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key-openssl.result3
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key.result1
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key_server.result4
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_qpress.result4
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync_binlogname.result96
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync_encrypt_with_key.result400
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync_encrypt_with_server.result400
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync_logbasename.result96
-rw-r--r--mysql-test/suite/galera/r/galera_var_sst_auth.result2
-rw-r--r--mysql-test/suite/galera/r/galera_wan_restart_sst.result48
-rw-r--r--mysql-test/suite/galera/r/lp1376747-4.result2
-rw-r--r--mysql-test/suite/galera/suite.pm9
-rw-r--r--mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf7
-rw-r--r--mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test2
-rw-r--r--mysql-test/suite/galera/t/galera_fk_lock_wait.test40
-rw-r--r--mysql-test/suite/galera/t/galera_fk_multibyte.test23
-rw-r--r--mysql-test/suite/galera/t/galera_ftwrl_drain.test11
-rw-r--r--mysql-test/suite/galera/t/galera_fulltext.test26
-rw-r--r--mysql-test/suite/galera/t/galera_inject_bf_long_wait.test25
-rw-r--r--mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf3
-rw-r--r--mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test2
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mariabackup.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mysqldump.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_ist_rsync.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin.inc1
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin_opt.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_password.test14
-rw-r--r--mysql-test/suite/galera/t/galera_ssl_upgrade.test22
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key-openssl.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key-openssl.test12
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.test14
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.test25
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_qpress.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_qpress.test24
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync2.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_binlogname.test9
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf3
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.cnf14
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.test29
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.cnf16
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.test29
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf15
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_logbasename.test9
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf4
-rw-r--r--mysql-test/suite/galera/t/galera_var_sst_auth.cnf5
-rw-r--r--mysql-test/suite/galera/t/galera_var_sst_auth.test8
-rw-r--r--mysql-test/suite/galera/t/galera_wan_restart_sst.test43
-rw-r--r--mysql-test/suite/galera/t/lp1376747-4.test2
-rw-r--r--mysql-test/suite/galera_3nodes/disabled.def7
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result39
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result39
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result42
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf1
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.cnf1
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf3
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf3
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf3
-rw-r--r--mysql-test/suite/gcol/inc/gcol_column_def_options.inc11
-rw-r--r--mysql-test/suite/gcol/inc/gcol_ins_upd.inc74
-rw-r--r--mysql-test/suite/gcol/inc/gcol_keys.inc8
-rw-r--r--mysql-test/suite/gcol/inc/gcol_partition.inc28
-rw-r--r--mysql-test/suite/gcol/inc/gcol_view.inc55
-rw-r--r--mysql-test/suite/gcol/r/gcol_bugfixes.result74
-rw-r--r--mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result6
-rw-r--r--mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result6
-rw-r--r--mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result220
-rw-r--r--mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result70
-rw-r--r--mysql-test/suite/gcol/r/gcol_keys_innodb.result7
-rw-r--r--mysql-test/suite/gcol/r/gcol_keys_myisam.result5
-rw-r--r--mysql-test/suite/gcol/r/gcol_partition_innodb.result26
-rw-r--r--mysql-test/suite/gcol/r/gcol_partition_myisam.result26
-rw-r--r--mysql-test/suite/gcol/r/gcol_view_innodb.result41
-rw-r--r--mysql-test/suite/gcol/r/gcol_view_myisam.result41
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result72
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_fk.result203
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_index.result48
-rw-r--r--mysql-test/suite/gcol/r/virtual_index_drop.result69
-rw-r--r--mysql-test/suite/gcol/t/gcol_bugfixes.test84
-rw-r--r--mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test2
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test111
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_fk.test187
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_index.opt1
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_index.test53
-rw-r--r--mysql-test/suite/gcol/t/virtual_index_drop.test71
-rw-r--r--mysql-test/suite/innodb/r/alter_partitioned.result39
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_alter.result17
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff9
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_create.result23
-rw-r--r--mysql-test/suite/innodb/r/foreign_key.result11
-rw-r--r--mysql-test/suite/innodb/r/import_corrupted.result30
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-tempfile.result40
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_stats.result286
-rw-r--r--mysql-test/suite/innodb/r/log_file_name.result1
-rw-r--r--mysql-test/suite/innodb/r/mdev-14846.result52
-rw-r--r--mysql-test/suite/innodb/r/mvcc_secondary.result24
-rw-r--r--mysql-test/suite/innodb/r/temporary_table.result96
-rw-r--r--mysql-test/suite/innodb/r/undo_truncate.result22
-rw-r--r--mysql-test/suite/innodb/r/update_time.result3
-rw-r--r--mysql-test/suite/innodb/t/alter_partitioned.test40
-rw-r--r--mysql-test/suite/innodb/t/check_ibd_filesize.test6
-rw-r--r--mysql-test/suite/innodb/t/default_row_format_alter.test33
-rw-r--r--mysql-test/suite/innodb/t/default_row_format_create.test25
-rw-r--r--mysql-test/suite/innodb/t/foreign_key.test39
-rw-r--r--mysql-test/suite/innodb/t/import_corrupted.test69
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-tempfile.test49
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lz4.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test11
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats.test126
-rw-r--r--mysql-test/suite/innodb/t/log_file_name.test3
-rw-r--r--mysql-test/suite/innodb/t/mdev-14846.opt1
-rw-r--r--mysql-test/suite/innodb/t/mdev-14846.test70
-rw-r--r--mysql-test/suite/innodb/t/mvcc_secondary.test26
-rw-r--r--mysql-test/suite/innodb/t/temporary_table.test108
-rw-r--r--mysql-test/suite/innodb/t/undo_truncate.test64
-rw-r--r--mysql-test/suite/innodb/t/update_time-master.opt2
-rw-r--r--mysql-test/suite/innodb/t/update_time.test14
-rw-r--r--mysql-test/suite/innodb_fts/r/basic.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/bug_32831765.result131
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext.result15
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result12
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result31
-rw-r--r--mysql-test/suite/innodb_fts/r/misc_debug.result10
-rw-r--r--mysql-test/suite/innodb_fts/t/basic.test2
-rw-r--r--mysql-test/suite/innodb_fts/t/bug_32831765.test164
-rw-r--r--mysql-test/suite/innodb_fts/t/fulltext.test14
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt1
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test20
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.opt1
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test28
-rw-r--r--mysql-test/suite/innodb_fts/t/misc_debug.test12
-rw-r--r--mysql-test/suite/innodb_gis/disabled.def2
-rw-r--r--mysql-test/suite/innodb_gis/r/alter_spatial_index.result39
-rw-r--r--mysql-test/suite/innodb_gis/r/gis.result13
-rw-r--r--mysql-test/suite/innodb_gis/t/alter_spatial_index.test10
-rw-r--r--mysql-test/suite/innodb_gis/t/gis.test15
-rw-r--r--mysql-test/suite/innodb_zip/r/innochecksum_3.result8
-rw-r--r--mysql-test/suite/innodb_zip/t/innochecksum_3.test5
-rw-r--r--mysql-test/suite/mariabackup/auth_plugin_win.result2
-rw-r--r--mysql-test/suite/mariabackup/auth_plugin_win.test2
-rw-r--r--mysql-test/suite/mariabackup/partition_partial.test1
-rw-r--r--mysql-test/suite/perfschema/r/dml_accounts.result11
-rw-r--r--mysql-test/suite/perfschema/r/dml_cond_instances.result9
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_by_account_by_event_name.result15
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_by_host_by_event_name.result14
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_by_thread_by_event_name.result14
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_by_user_by_event_name.result14
-rw-r--r--mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result13
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_account_by_event_name.result34
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_digest.result36
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_host_by_event_name.result33
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_thread_by_event_name.result33
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_by_user_by_event_name.result33
-rw-r--r--mysql-test/suite/perfschema/r/dml_esms_global_by_event_name.result32
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_stages_current.result17
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_stages_history.result17
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_stages_history_long.result17
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_statements_current.result47
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_statements_history.result47
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_statements_history_long.result47
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_waits_current.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_waits_history.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_waits_history_long.result26
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_account_by_event_name.result15
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_host_by_event_name.result14
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_instance.result14
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result14
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_user_by_event_name.result14
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result13
-rw-r--r--mysql-test/suite/perfschema/r/dml_file_instances.result10
-rw-r--r--mysql-test/suite/perfschema/r/dml_fs_by_event_name.result30
-rw-r--r--mysql-test/suite/perfschema/r/dml_fs_by_instance.result32
-rw-r--r--mysql-test/suite/perfschema/r/dml_host_cache.result36
-rw-r--r--mysql-test/suite/perfschema/r/dml_hosts.result10
-rw-r--r--mysql-test/suite/perfschema/r/dml_mutex_instances.result10
-rw-r--r--mysql-test/suite/perfschema/r/dml_os_global_by_type.result15
-rw-r--r--mysql-test/suite/perfschema/r/dml_performance_timers.result11
-rw-r--r--mysql-test/suite/perfschema/r/dml_rwlock_instances.result11
-rw-r--r--mysql-test/suite/perfschema/r/dml_session_account_connect_attrs.result11
-rw-r--r--mysql-test/suite/perfschema/r/dml_session_connect_attrs.result11
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_actors.result10
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_consumers.result9
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_instruments.result10
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_objects.result12
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_timers.result9
-rw-r--r--mysql-test/suite/perfschema/r/dml_socket_instances.result14
-rw-r--r--mysql-test/suite/perfschema/r/dml_socket_summary_by_event_name.result30
-rw-r--r--mysql-test/suite/perfschema/r/dml_socket_summary_by_instance.result31
-rw-r--r--mysql-test/suite/perfschema/r/dml_threads.result21
-rw-r--r--mysql-test/suite/perfschema/r/dml_tiws_by_index_usage.result46
-rw-r--r--mysql-test/suite/perfschema/r/dml_tiws_by_table.result45
-rw-r--r--mysql-test/suite/perfschema/r/dml_tlws_by_table.result80
-rw-r--r--mysql-test/suite/perfschema/r/dml_users.result10
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_auth_ed25519.result119
-rw-r--r--mysql-test/suite/perfschema/r/schema.result1574
-rw-r--r--mysql-test/suite/perfschema/r/table_schema.result1595
-rw-r--r--mysql-test/suite/perfschema/t/dml_accounts.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_cond_instances.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_digest.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_stages_current.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_stages_history.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_stages_history_long.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_statements_current.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_statements_history.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_statements_history_long.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_waits_current.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_waits_history.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_waits_history_long.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_instance.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_file_instances.test8
-rw-r--r--mysql-test/suite/perfschema/t/dml_fs_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_fs_by_instance.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_host_cache.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_hosts.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_mutex_instances.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_os_global_by_type.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_performance_timers.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_rwlock_instances.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_session_account_connect_attrs.test9
-rw-r--r--mysql-test/suite/perfschema/t/dml_session_connect_attrs.test9
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_actors.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_consumers.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_instruments.test7
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_objects.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_timers.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_socket_instances.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_threads.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_tiws_by_table.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_tlws_by_table.test6
-rw-r--r--mysql-test/suite/perfschema/t/dml_users.test6
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_auth_ed25519.test53
-rw-r--r--mysql-test/suite/perfschema/t/table_schema.test5
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_load.result16
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_send.result20
-rw-r--r--mysql-test/suite/plugins/r/server_audit.result4
-rw-r--r--mysql-test/suite/plugins/r/unix_socket.result4
-rw-r--r--mysql-test/suite/plugins/t/feedback_plugin_load.test7
-rw-r--r--mysql-test/suite/plugins/t/feedback_plugin_send.test2
-rw-r--r--mysql-test/suite/plugins/t/server_audit.test2
-rw-r--r--mysql-test/suite/plugins/t/unix_socket.test12
-rw-r--r--mysql-test/suite/roles/admin.result44
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.result2
-rw-r--r--mysql-test/suite/roles/create_and_grant_role.result2
-rw-r--r--mysql-test/suite/roles/definer.result2
-rw-r--r--mysql-test/suite/roles/drop_routines.result14
-rw-r--r--mysql-test/suite/roles/flush_roles-17898.result4
-rw-r--r--mysql-test/suite/roles/grant-5771.result4
-rw-r--r--mysql-test/suite/roles/grant_empty.result2
-rw-r--r--mysql-test/suite/roles/grant_revoke_current.result4
-rw-r--r--mysql-test/suite/roles/ip-6401.result2
-rw-r--r--mysql-test/suite/roles/prepare_stmt_with_role.result8
-rw-r--r--mysql-test/suite/roles/rebuild_role_grants.result272
-rw-r--r--mysql-test/suite/roles/rebuild_role_grants.test31
-rw-r--r--mysql-test/suite/roles/recursive.result112
-rw-r--r--mysql-test/suite/roles/recursive_dbug.result112
-rw-r--r--mysql-test/suite/roles/revoke_all.result50
-rw-r--r--mysql-test/suite/roles/role_case_sensitive-10744.result6
-rw-r--r--mysql-test/suite/roles/rpl_definer.result12
-rw-r--r--mysql-test/suite/roles/set_and_drop.result2
-rw-r--r--mysql-test/suite/roles/set_default_role_clear.result6
-rw-r--r--mysql-test/suite/roles/set_default_role_for.result14
-rw-r--r--mysql-test/suite/roles/set_default_role_invalid.result24
-rw-r--r--mysql-test/suite/roles/set_default_role_new_connection.result12
-rw-r--r--mysql-test/suite/roles/set_role-13655.result6
-rw-r--r--mysql-test/suite/roles/set_role-9614.result6
-rw-r--r--mysql-test/suite/roles/set_role-database-recursive.result10
-rw-r--r--mysql-test/suite/roles/set_role-multiple-role.result42
-rw-r--r--mysql-test/suite/roles/set_role-recursive.result30
-rw-r--r--mysql-test/suite/roles/set_role-routine-simple.result18
-rw-r--r--mysql-test/suite/roles/set_role-simple.result4
-rw-r--r--mysql-test/suite/roles/set_role-table-column-priv.result10
-rw-r--r--mysql-test/suite/roles/set_role-table-simple.result10
-rw-r--r--mysql-test/suite/roles/show_grants.result44
-rw-r--r--mysql-test/suite/roles/show_grants_replicated.result2
-rw-r--r--mysql-test/suite/rpl/include/rpl_reset_slave_all_check.inc48
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_mix.result3
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_row.result3
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_statement.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_change_master_find_log_pos_err.result43
-rw-r--r--mysql-test/suite/rpl/r/rpl_incompatible_heartbeat.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_mark_optimize_tbl_ddl.result77
-rw-r--r--mysql-test/suite/rpl/r/rpl_reset_slave_all_clears_filters.result54
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result79
-rw-r--r--mysql-test/suite/rpl/t/rpl_change_master_find_log_pos_err.test93
-rw-r--r--mysql-test/suite/rpl/t/rpl_incompatible_heartbeat.test44
-rw-r--r--mysql-test/suite/rpl/t/rpl_mark_optimize_tbl_ddl.test142
-rw-r--r--mysql-test/suite/rpl/t/rpl_reset_slave_all_clears_filters.test72
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.cnf19
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test171
-rw-r--r--mysql-test/suite/sys_vars/r/insert_id_func.result25
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result12
-rw-r--r--mysql-test/suite/sys_vars/t/insert_id_func.test20
-rw-r--r--mysql-test/suite/unit/suite.pm2
-rw-r--r--mysql-test/suite/vcol/r/binlog.result27
-rw-r--r--mysql-test/suite/vcol/r/partition.result73
-rw-r--r--mysql-test/suite/vcol/r/vcol_syntax.result49
-rw-r--r--mysql-test/suite/vcol/t/binlog.test28
-rw-r--r--mysql-test/suite/vcol/t/partition.test48
-rw-r--r--mysql-test/suite/vcol/t/vcol_syntax.test61
-rw-r--r--mysql-test/t/alter_table.test12
-rw-r--r--mysql-test/t/auth_named_pipe.test5
-rw-r--r--mysql-test/t/create_or_replace.test19
-rw-r--r--mysql-test/t/cte_nonrecursive.test281
-rw-r--r--mysql-test/t/cte_recursive.test83
-rw-r--r--mysql-test/t/ctype_filename.test26
-rw-r--r--mysql-test/t/ctype_utf16_def.test7
-rw-r--r--mysql-test/t/ctype_utf16le.test37
-rw-r--r--mysql-test/t/ctype_utf32_def-master.opt1
-rw-r--r--mysql-test/t/ctype_utf32_def.test9
-rw-r--r--mysql-test/t/ctype_utf32_uca.test26
-rw-r--r--mysql-test/t/ctype_utf8.test18
-rw-r--r--mysql-test/t/default.test6
-rw-r--r--mysql-test/t/delayed_blob-master.opt1
-rw-r--r--mysql-test/t/delayed_blob.test21
-rw-r--r--mysql-test/t/derived_cond_pushdown.test95
-rw-r--r--mysql-test/t/derived_opt.test33
-rw-r--r--mysql-test/t/derived_view.test17
-rw-r--r--mysql-test/t/func_json.test6
-rw-r--r--mysql-test/t/func_str.test16
-rw-r--r--mysql-test/t/gis-json.test7
-rw-r--r--mysql-test/t/grant5.test23
-rw-r--r--mysql-test/t/information_schema.test21
-rw-r--r--mysql-test/t/join_outer.test50
-rw-r--r--mysql-test/t/lock_multi_bug38499.test3
-rw-r--r--mysql-test/t/lock_multi_bug38691.test2
-rw-r--r--mysql-test/t/mdev-504.test80
-rw-r--r--mysql-test/t/mdev19198.test15
-rw-r--r--mysql-test/t/mdev_22370.test17
-rw-r--r--mysql-test/t/multi_update.test53
-rw-r--r--mysql-test/t/mysql_binary_zero_insert.test170
-rw-r--r--mysql-test/t/mysql_client_test.test4
-rw-r--r--mysql-test/t/mysqld--help.test2
-rw-r--r--mysql-test/t/mysqldump-nl.test8
-rw-r--r--mysql-test/t/order_by.test16
-rw-r--r--mysql-test/t/order_by_innodb.test51
-rw-r--r--mysql-test/t/parser_not_embedded.test2
-rw-r--r--mysql-test/t/plugin_vars.test35
-rw-r--r--mysql-test/t/processlist_notembedded.test27
-rw-r--r--mysql-test/t/ps.test34
-rw-r--r--mysql-test/t/selectivity_innodb.test55
-rw-r--r--mysql-test/t/selectivity_no_engine.test21
-rw-r--r--mysql-test/t/show.test34
-rw-r--r--mysql-test/t/show_explain.opt1
-rw-r--r--mysql-test/t/show_explain.test9
-rw-r--r--mysql-test/t/skip_name_resolve.test26
-rw-r--r--mysql-test/t/sp-code.test24
-rw-r--r--mysql-test/t/sp.test20
-rw-r--r--mysql-test/t/subselect4.test70
-rw-r--r--mysql-test/t/subselect_exists2in.test23
-rw-r--r--mysql-test/t/truncate.test8
-rw-r--r--mysql-test/t/truncate_notembedded.test31
-rw-r--r--mysql-test/t/udf.test10
-rw-r--r--mysql-test/t/view.test68
-rw-r--r--mysql-test/t/win.test161
-rw-r--r--mysql-test/t/xa.test35
-rw-r--r--mysql-test/unstable-tests1
-rw-r--r--mysys/mf_iocache.c5
-rw-r--r--mysys/mf_qsort.c2
-rw-r--r--mysys/my_context.c7
-rw-r--r--mysys/my_delete.c33
-rw-r--r--mysys/psi_noop.c6
-rw-r--r--mysys/safemalloc.c4
-rw-r--r--pcre/AUTHORS10
-rw-r--r--pcre/CMakeLists.txt15
-rw-r--r--pcre/ChangeLog21
-rw-r--r--pcre/LICENCE10
-rw-r--r--pcre/NEWS10
-rw-r--r--pcre/NON-AUTOTOOLS-BUILD10
-rw-r--r--pcre/README11
-rw-r--r--pcre/configure.ac10
-rw-r--r--pcre/doc/html/NON-AUTOTOOLS-BUILD.txt10
-rw-r--r--pcre/doc/html/README.txt11
-rw-r--r--pcre/doc/html/pcre.html17
-rw-r--r--pcre/doc/html/pcreapi.html10
-rw-r--r--pcre/doc/html/pcredemo.html4
-rw-r--r--pcre/doc/html/pcrejit.html2
-rw-r--r--pcre/doc/html/pcrepattern.html6
-rw-r--r--pcre/doc/html/pcresyntax.html2
-rw-r--r--pcre/doc/pcre.319
-rw-r--r--pcre/doc/pcre.txt38
-rw-r--r--pcre/doc/pcreapi.310
-rw-r--r--pcre/doc/pcredemo.34
-rw-r--r--pcre/doc/pcrejit.32
-rw-r--r--pcre/doc/pcrepattern.36
-rw-r--r--pcre/doc/pcresyntax.32
-rw-r--r--pcre/pcre_compile.c9
-rw-r--r--pcre/pcre_exec.c4
-rw-r--r--pcre/pcredemo.c4
-rw-r--r--pcre/testdata/testinput13
-rw-r--r--pcre/testdata/testoutput15
-rw-r--r--plugin/auth_ed25519/server_ed25519.c8
-rw-r--r--plugin/auth_gssapi/CMakeLists.txt1
-rw-r--r--plugin/aws_key_management/CMakeLists.txt8
-rw-r--r--plugin/feedback/feedback.cc12
-rw-r--r--plugin/server_audit/server_audit.c30
-rw-r--r--plugin/win_auth_client/CMakeLists.txt2
-rw-r--r--scripts/mysql_install_db.sh6
-rw-r--r--scripts/mysql_setpermission.sh8
-rw-r--r--scripts/mysqld_safe.sh4
-rw-r--r--scripts/wsrep_sst_common.sh1211
-rw-r--r--scripts/wsrep_sst_mariabackup.sh1456
-rw-r--r--scripts/wsrep_sst_mysqldump.sh124
-rw-r--r--scripts/wsrep_sst_rsync.sh746
-rw-r--r--scripts/wsrep_sst_xtrabackup-v2.sh1613
-rw-r--r--scripts/wsrep_sst_xtrabackup.sh295
-rw-r--r--sql/event_data_objects.cc1
-rw-r--r--sql/event_data_objects.h6
-rw-r--r--sql/event_queue.cc1
-rw-r--r--sql/event_scheduler.cc2
-rw-r--r--sql/field.cc11
-rw-r--r--sql/field.h38
-rw-r--r--sql/filesort.cc9
-rw-r--r--sql/gen_win_tzname_data.ps11
-rw-r--r--sql/ha_partition.cc228
-rw-r--r--sql/ha_partition.h18
-rw-r--r--sql/handler.h16
-rw-r--r--sql/item.cc189
-rw-r--r--sql/item.h67
-rw-r--r--sql/item_cmpfunc.cc3
-rw-r--r--sql/item_create.cc11
-rw-r--r--sql/item_create.h6
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/item_jsonfunc.cc1
-rw-r--r--sql/item_strfunc.cc16
-rw-r--r--sql/item_subselect.cc78
-rw-r--r--sql/item_subselect.h3
-rw-r--r--sql/item_sum.cc8
-rw-r--r--sql/item_timefunc.cc1
-rw-r--r--sql/key.cc2
-rw-r--r--sql/lex.h7
-rw-r--r--sql/log.cc19
-rw-r--r--sql/log.h14
-rw-r--r--sql/log_event.cc38
-rw-r--r--sql/log_event.h13
-rw-r--r--sql/mf_iocache.cc2
-rw-r--r--sql/mysqld.cc8
-rw-r--r--sql/protocol.cc19
-rw-r--r--sql/rpl_gtid.cc2
-rw-r--r--sql/rpl_mi.cc8
-rw-r--r--sql/rpl_mi.h5
-rw-r--r--sql/rpl_parallel.cc15
-rw-r--r--sql/rpl_parallel.h2
-rw-r--r--sql/rpl_rli.cc4
-rw-r--r--sql/share/errmsg-utf8.txt31
-rw-r--r--sql/signal_handler.cc6
-rw-r--r--sql/slave.cc3
-rw-r--r--sql/sp_head.cc3
-rw-r--r--sql/spatial.cc28
-rw-r--r--sql/sql_acl.cc394
-rw-r--r--sql/sql_admin.cc73
-rw-r--r--sql/sql_base.cc91
-rw-r--r--sql/sql_base.h3
-rw-r--r--sql/sql_class.cc60
-rw-r--r--sql/sql_class.h26
-rw-r--r--sql/sql_cte.cc459
-rw-r--r--sql/sql_cte.h86
-rw-r--r--sql/sql_delete.cc19
-rw-r--r--sql/sql_derived.cc124
-rw-r--r--sql/sql_explain.cc2
-rw-r--r--sql/sql_explain.h2
-rw-r--r--sql/sql_handler.cc3
-rw-r--r--sql/sql_insert.cc40
-rw-r--r--sql/sql_lex.cc73
-rw-r--r--sql/sql_lex.h57
-rw-r--r--sql/sql_parse.cc24
-rw-r--r--sql/sql_prepare.cc28
-rw-r--r--sql/sql_repl.cc41
-rw-r--r--sql/sql_select.cc152
-rw-r--r--sql/sql_show.cc94
-rw-r--r--sql/sql_string.cc2
-rw-r--r--sql/sql_table.cc78
-rw-r--r--sql/sql_truncate.cc4
-rw-r--r--sql/sql_udf.cc6
-rw-r--r--sql/sql_union.cc32
-rw-r--r--sql/sql_update.cc48
-rw-r--r--sql/sql_view.cc16
-rw-r--r--sql/sql_window.cc12
-rw-r--r--sql/sql_window.h5
-rw-r--r--sql/sql_yacc.yy108
-rw-r--r--sql/sys_vars.cc22
-rw-r--r--sql/table.cc82
-rw-r--r--sql/table.h42
-rw-r--r--sql/threadpool_generic.cc4
-rw-r--r--sql/transaction.cc36
-rw-r--r--sql/win_tzname_data.h1
-rw-r--r--sql/wsrep_sst.cc315
-rw-r--r--storage/connect/CMakeLists.txt40
-rw-r--r--storage/connect/JavaWrappers.jarbin19192 -> 0 bytes
-rw-r--r--storage/connect/Mongo2.jarbin624130 -> 0 bytes
-rw-r--r--storage/connect/Mongo3.jarbin1706057 -> 0 bytes
-rw-r--r--storage/connect/bsonudf.cpp9
-rw-r--r--storage/connect/inihandl.cpp10
-rw-r--r--storage/connect/javaconn.cpp1
-rw-r--r--storage/connect/jsonudf.cpp2
-rw-r--r--storage/connect/mysql-test/connect/std_data/Mongo2.jarbin624130 -> 624130 bytes
-rw-r--r--storage/connect/mysql-test/connect/std_data/Mongo3.jarbin1706054 -> 1706057 bytes
-rw-r--r--storage/connect/tabbson.cpp2
-rw-r--r--storage/innobase/CMakeLists.txt4
-rw-r--r--storage/innobase/btr/btr0btr.cc22
-rw-r--r--storage/innobase/btr/btr0cur.cc23
-rw-r--r--storage/innobase/btr/btr0defragment.cc6
-rw-r--r--storage/innobase/btr/btr0scrub.cc16
-rw-r--r--storage/innobase/btr/btr0sea.cc9
-rw-r--r--storage/innobase/buf/buf0buf.cc55
-rw-r--r--storage/innobase/buf/buf0mtflu.cc8
-rw-r--r--storage/innobase/buf/buf0rea.cc14
-rw-r--r--storage/innobase/bzip2.cmake5
-rw-r--r--storage/innobase/dict/dict0dict.cc38
-rw-r--r--storage/innobase/dict/dict0mem.cc2
-rw-r--r--storage/innobase/dict/dict0stats_bg.cc19
-rw-r--r--storage/innobase/fil/fil0crypt.cc111
-rw-r--r--storage/innobase/fil/fil0fil.cc120
-rw-r--r--storage/innobase/fsp/fsp0fsp.cc26
-rw-r--r--storage/innobase/fsp/fsp0sysspace.cc12
-rw-r--r--storage/innobase/fts/fts0config.cc8
-rw-r--r--storage/innobase/fts/fts0fts.cc107
-rw-r--r--storage/innobase/fts/fts0opt.cc41
-rw-r--r--storage/innobase/fts/fts0que.cc15
-rw-r--r--storage/innobase/fts/fts0sql.cc4
-rw-r--r--storage/innobase/handler/ha_innodb.cc406
-rw-r--r--storage/innobase/handler/ha_innodb.h1
-rw-r--r--storage/innobase/handler/handler0alter.cc178
-rw-r--r--storage/innobase/handler/i_s.cc3599
-rw-r--r--storage/innobase/handler/i_s.h19
-rw-r--r--storage/innobase/include/btr0btr.h2
-rw-r--r--storage/innobase/include/btr0bulk.h2
-rw-r--r--storage/innobase/include/btr0scrub.h7
-rw-r--r--storage/innobase/include/buf0buf.h6
-rw-r--r--storage/innobase/include/dict0mem.h110
-rw-r--r--storage/innobase/include/fil0crypt.h6
-rw-r--r--storage/innobase/include/fil0fil.h14
-rw-r--r--storage/innobase/include/fts0fts.h4
-rw-r--r--storage/innobase/include/fts0types.h38
-rw-r--r--storage/innobase/include/fts0vlc.h124
-rw-r--r--storage/innobase/include/fts0vlc.ic142
-rw-r--r--storage/innobase/include/log0log.h14
-rw-r--r--storage/innobase/include/mach0data.h22
-rw-r--r--storage/innobase/include/mtr0mtr.h6
-rw-r--r--storage/innobase/include/mtr0mtr.ic6
-rw-r--r--storage/innobase/include/pars0pars.h12
-rw-r--r--storage/innobase/include/row0merge.h20
-rw-r--r--storage/innobase/include/row0mysql.h10
-rw-r--r--storage/innobase/include/srv0srv.h10
-rw-r--r--storage/innobase/include/trx0i_s.h6
-rw-r--r--storage/innobase/include/trx0sys.ic7
-rw-r--r--storage/innobase/include/trx0trx.h128
-rw-r--r--storage/innobase/include/trx0trx.ic19
-rw-r--r--storage/innobase/include/trx0types.h4
-rw-r--r--storage/innobase/include/univ.i10
-rw-r--r--storage/innobase/include/ut0byte.ic6
-rw-r--r--storage/innobase/include/ut0wqueue.h11
-rw-r--r--storage/innobase/innodb.cmake18
-rw-r--r--storage/innobase/lock/lock0lock.cc39
-rw-r--r--storage/innobase/lock/lock0wait.cc33
-rw-r--r--storage/innobase/log/log0crypt.cc8
-rw-r--r--storage/innobase/log/log0log.cc112
-rw-r--r--storage/innobase/log/log0recv.cc3
-rw-r--r--storage/innobase/lz4.cmake26
-rw-r--r--storage/innobase/lzma.cmake4
-rw-r--r--storage/innobase/lzo.cmake20
-rw-r--r--storage/innobase/mtr/mtr0mtr.cc86
-rw-r--r--storage/innobase/os/os0file.cc43
-rw-r--r--storage/innobase/page/page0zip.cc16
-rw-r--r--storage/innobase/pars/pars0grm.cc4
-rw-r--r--storage/innobase/pars/pars0grm.y4
-rw-r--r--storage/innobase/pars/pars0pars.cc7
-rw-r--r--storage/innobase/read/read0read.cc4
-rw-r--r--storage/innobase/row/row0ftsort.cc11
-rw-r--r--storage/innobase/row/row0import.cc262
-rw-r--r--storage/innobase/row/row0ins.cc29
-rw-r--r--storage/innobase/row/row0merge.cc65
-rw-r--r--storage/innobase/row/row0mysql.cc17
-rw-r--r--storage/innobase/row/row0purge.cc22
-rw-r--r--storage/innobase/row/row0sel.cc237
-rw-r--r--storage/innobase/row/row0uins.cc2
-rw-r--r--storage/innobase/row/row0umod.cc3
-rw-r--r--storage/innobase/row/row0undo.cc2
-rw-r--r--storage/innobase/row/row0upd.cc83
-rw-r--r--storage/innobase/row/row0vers.cc3
-rw-r--r--storage/innobase/snappy.cmake4
-rw-r--r--storage/innobase/srv/srv0srv.cc17
-rw-r--r--storage/innobase/trx/trx0i_s.cc20
-rw-r--r--storage/innobase/trx/trx0purge.cc21
-rw-r--r--storage/innobase/trx/trx0roll.cc45
-rw-r--r--storage/innobase/trx/trx0sys.cc14
-rw-r--r--storage/innobase/trx/trx0trx.cc115
-rw-r--r--storage/innobase/unittest/CMakeLists.txt22
-rw-r--r--storage/innobase/unittest/innodb_fts-t.cc52
-rw-r--r--storage/innobase/ut/ut0wqueue.cc29
-rw-r--r--storage/maria/ma_check.c8
-rw-r--r--storage/maria/ma_loghandler.c5
-rw-r--r--storage/maria/ma_rt_test.c3
-rw-r--r--storage/mroonga/CMakeLists.txt7
-rw-r--r--storage/mroonga/vendor/groonga/CMakeLists.txt11
-rw-r--r--storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt2
-rw-r--r--storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/version_full (renamed from storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/version)0
-rw-r--r--storage/mroonga/version_full (renamed from storage/mroonga/version)0
-rw-r--r--storage/myisam/ft_parser.c13
-rw-r--r--storage/myisam/ha_myisam.cc3
-rw-r--r--storage/myisam/mi_check.c8
-rw-r--r--storage/myisam/rt_test.c3
-rw-r--r--storage/oqgraph/CMakeLists.txt8
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/social.test3
-rw-r--r--storage/perfschema/CMakeLists.txt8
-rw-r--r--storage/perfschema/pfs.cc6
-rw-r--r--storage/perfschema/table_accounts.cc8
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.cc16
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.cc14
-rw-r--r--storage/perfschema/table_esgs_by_thread_by_event_name.cc14
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.cc14
-rw-r--r--storage/perfschema/table_esgs_global_by_event_name.cc12
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.cc54
-rw-r--r--storage/perfschema/table_esms_by_digest.cc58
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.cc52
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.cc52
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.cc52
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.cc50
-rw-r--r--storage/perfschema/table_events_stages.cc60
-rw-r--r--storage/perfschema/table_events_statements.cc240
-rw-r--r--storage/perfschema/table_events_waits.cc114
-rw-r--r--storage/perfschema/table_events_waits_summary.cc14
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.cc16
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.cc14
-rw-r--r--storage/perfschema/table_ews_by_thread_by_event_name.cc14
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.cc14
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.cc12
-rw-r--r--storage/perfschema/table_file_instances.cc6
-rw-r--r--storage/perfschema/table_file_summary_by_event_name.cc46
-rw-r--r--storage/perfschema/table_file_summary_by_instance.cc50
-rw-r--r--storage/perfschema/table_host_cache.cc58
-rw-r--r--storage/perfschema/table_hosts.cc6
-rw-r--r--storage/perfschema/table_os_global_by_type.cc16
-rw-r--r--storage/perfschema/table_performance_timers.cc8
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.cc8
-rw-r--r--storage/perfschema/table_session_connect_attrs.cc8
-rw-r--r--storage/perfschema/table_setup_actors.cc6
-rw-r--r--storage/perfschema/table_setup_consumers.cc4
-rw-r--r--storage/perfschema/table_setup_instruments.cc6
-rw-r--r--storage/perfschema/table_setup_objects.cc10
-rw-r--r--storage/perfschema/table_setup_timers.cc4
-rw-r--r--storage/perfschema/table_socket_instances.cc14
-rw-r--r--storage/perfschema/table_socket_summary_by_event_name.cc46
-rw-r--r--storage/perfschema/table_socket_summary_by_instance.cc48
-rw-r--r--storage/perfschema/table_sync_instances.cc18
-rw-r--r--storage/perfschema/table_threads.cc28
-rw-r--r--storage/perfschema/table_tiws_by_index_usage.cc78
-rw-r--r--storage/perfschema/table_tiws_by_table.cc76
-rw-r--r--storage/perfschema/table_tlws_by_table.cc146
-rw-r--r--storage/perfschema/table_users.cc6
-rw-r--r--storage/rocksdb/CMakeLists.txt10
-rw-r--r--storage/rocksdb/build_rocksdb.cmake9
-rw-r--r--storage/rocksdb/ha_rocksdb.h16
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/suite.pm2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/suite.pm2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_stress/suite.pm2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_sys_vars/suite.pm2
-rw-r--r--storage/spider/mysql-test/spider/include/init_master_1.inc5
-rw-r--r--storage/spider/mysql-test/spider/r/spider_fixes_part.result34
-rw-r--r--storage/spider/mysql-test/spider/r/udf_pushdown.result222
-rw-r--r--storage/spider/mysql-test/spider/t/spider_fixes_part.test35
-rw-r--r--storage/spider/mysql-test/spider/t/udf_pushdown.inc48
-rw-r--r--storage/spider/mysql-test/spider/t/udf_pushdown.test141
-rw-r--r--storage/spider/spd_db_conn.cc42
-rw-r--r--storage/spider/spd_db_mysql.cc6
-rw-r--r--storage/spider/spd_param.cc2
-rw-r--r--storage/test_sql_discovery/mysql-test/sql_discovery/simple.test1
-rw-r--r--storage/tokudb/ha_tokudb.cc4
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/bug-23786.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/bug-23786.test14
-rw-r--r--storage/xtradb/CMakeLists.txt1
-rw-r--r--support-files/CMakeLists.txt2
-rw-r--r--support-files/mariadb.service.in2
-rw-r--r--support-files/mariadb@.service.in2
-rw-r--r--support-files/mysql.server.sh15
-rw-r--r--support-files/rpm/server-posttrans.sh2
-rw-r--r--tests/mysql_client_test.c72
-rw-r--r--win/packaging/CMakeLists.txt6
-rw-r--r--win/packaging/CPackZIPTestConfig.cmake6
-rw-r--r--win/packaging/heidisql.cmake2
-rw-r--r--win/packaging/mysql_server.wxs.in2
-rw-r--r--win/upgrade_wizard/upgradeDlg.cpp5
881 files changed, 26543 insertions, 11968 deletions
diff --git a/.gitignore b/.gitignore
index 00754884d3d..c1a80c15aa6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -338,6 +338,7 @@ x86/
build/
bld/
[Bb]in/
+/cmake-build-debug/
[Oo]bj/
# Roslyn cache directories
@@ -517,3 +518,6 @@ compile_commands.json
# Visual Studio Code workspace
.vscode/
+
+/.idea/
+.cache/clangd
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80f87af2cb5..67216e0e443 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,20 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
+
+IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ # Setting build type to RelWithDebInfo as none was specified.
+ # Must occur before PROJECT
+ SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
+ "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel"
+ FORCE)
+ # Set the possible values of build type for cmake-gui
+ SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
+ "None" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+ENDIF()
+
+PROJECT(MySQL)
# explicitly set the policy to OLD
# (cannot use NEW, not everyone is on cmake-2.8.12 yet)
@@ -53,9 +66,6 @@ IF(NOT DEFINED MANUFACTURER)
MARK_AS_ADVANCED(MANUFACTURER)
ENDIF()
-SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
- "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel")
-
# MAX_INDEXES - Set the maximum number of indexes per table, default 64
IF (NOT MAX_INDEXES)
SET(MAX_INDEXES 64)
@@ -83,18 +93,8 @@ IF(UNIX AND NOT APPLE)
MARK_AS_ADVANCED(WITH_PIC)
ENDIF()
-# Optionally set project name, e.g.
-# foo.xcodeproj (mac) or foo.sln (windows)
+# This is used by TokuDB only
SET(MYSQL_PROJECT_NAME_DOCSTRING "MySQL project name")
-IF(DEFINED MYSQL_PROJECT_NAME)
- SET(MYSQL_PROJECT_NAME ${MYSQL_PROJECT_NAME} CACHE STRING
- ${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
-ELSE()
- SET(MYSQL_PROJECT_NAME "MySQL" CACHE STRING
- ${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
- MARK_AS_ADVANCED(MYSQL_PROJECT_NAME)
-ENDIF()
-PROJECT(${MYSQL_PROJECT_NAME})
SET(CPACK_PACKAGE_NAME "MariaDB")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB: a very fast and robust SQL database server")
@@ -122,11 +122,13 @@ FOREACH(_base
ENDIF()
ENDFOREACH()
+IF(NOT RPM AND NOT DEB)
FOREACH(tool gtar tar git)
STRING(TOUPPER ${tool} TOOL)
FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable")
MARK_AS_ADVANCED(${TOOL}_EXECUTABLE)
ENDFOREACH()
+ENDIF()
# Following autotools tradition, add preprocessor definitions
# specified in environment variable CPPFLAGS
@@ -134,7 +136,7 @@ IF(DEFINED ENV{CPPFLAGS})
ADD_DEFINITIONS($ENV{CPPFLAGS})
ENDIF()
-SET(MYSQL_MAINTAINER_MODE "AUTO" CACHE STRING "MySQL maintainer-specific development environment. Options are: ON OFF AUTO.")
+SET(MYSQL_MAINTAINER_MODE "AUTO" CACHE STRING "Enable MariaDB maintainer-specific warnings. One of: NO (warnings are disabled) WARN (warnings are enabled) ERR (warnings are errors) AUTO (warnings are errors in Debug only)")
# Packaging
IF (NOT CPACK_GENERATOR)
@@ -145,6 +147,7 @@ IF (NOT CPACK_GENERATOR)
ENDIF(WIN32)
ENDIF(NOT CPACK_GENERATOR)
+INCLUDE(FeatureSummary)
INCLUDE(misc)
INCLUDE(mysql_version)
INCLUDE(cpack_source_ignore_files)
@@ -416,11 +419,14 @@ ADD_SUBDIRECTORY(sql/share)
IF(NOT WITHOUT_SERVER)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(sql)
- OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
+ OPTION (WITH_EMBEDDED_SERVER "Compile MariaDB with embedded server" OFF)
IF(WITH_EMBEDDED_SERVER)
- ADD_SUBDIRECTORY(libmysqld)
- ADD_SUBDIRECTORY(libmysqld/examples)
+ ADD_SUBDIRECTORY(libmysqld)
+ ADD_SUBDIRECTORY(libmysqld/examples)
ENDIF(WITH_EMBEDDED_SERVER)
+ IF(NOT WIN32)
+ ADD_FEATURE_INFO(EMBEDDED_SERVER WITH_EMBEDDED_SERVER "Embedded MariaDB Server Library")
+ ENDIF()
IF(WITH_WSREP)
ADD_SUBDIRECTORY(wsrep)
@@ -485,8 +491,7 @@ ADD_CUSTOM_TARGET(INFO_BIN ALL
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
-INSTALL_DOCUMENTATION(README.md CREDITS COPYING THIRDPARTY
- EXCEPTIONS-CLIENT COMPONENT Readme)
+INSTALL_DOCUMENTATION(README.md CREDITS COPYING THIRDPARTY COMPONENT Readme)
# MDEV-6526 these files are not installed anymore
#INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
@@ -506,7 +511,52 @@ IF(WIN32 AND SIGNCODE)
INSTALL(SCRIPT ${PROJECT_BINARY_DIR}/sign.cmake)
ENDIF()
+FEATURE_SUMMARY(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES VAR MARIADB_FEATURE_SUMMARY)
+
+OPTION(FEATURE_SUMMARY "Print feature summary at the end of configure step" ON)
+IF (FEATURE_SUMMARY)
+ MESSAGE("${MARIADB_FEATURE_SUMMARY}")
+ SET(FEATURE_SUMMARY OFF CACHE BOOL "" FORCE)
+ENDIF()
+
IF(NON_DISTRIBUTABLE_WARNING)
MESSAGE(WARNING "
You have linked MariaDB with ${NON_DISTRIBUTABLE_WARNING} libraries! You may not distribute the resulting binary. If you do, you will put yourself into a legal problem with the Free Software Foundation.")
ENDIF()
+
+IF(NOT WITHOUT_SERVER)
+ # Define target for minimal mtr-testable build
+ ADD_CUSTOM_TARGET(minbuild)
+ ADD_DEPENDENCIES(minbuild
+ aria_chk
+ aria_pack
+ mysql
+ mysqladmin
+ mysqlbinlog
+ mysqlcheck
+ mysql_client_test
+ mysqldump
+ mysqlimport
+ mysql_plugin
+ mysqlshow
+ mysqlslap
+ mysqltest
+ mysql_tzinfo_to_sql
+ mysql_upgrade
+ mysqld
+ my_print_defaults
+ my_safe_process
+ myisam_ftdump
+ myisamchk
+ myisamlog
+ myisampack
+ perror
+ replace)
+ IF(WIN32)
+ ADD_DEPENDENCIES(minbuild echo my_safe_kill)
+ ENDIF()
+ ADD_CUSTOM_TARGET(smoketest
+ COMMAND perl ./mysql-test-run.pl main.1st
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mysql-test)
+ ADD_DEPENDENCIES(smoketest minbuild)
+ENDIF()
diff --git a/EXCEPTIONS-CLIENT b/EXCEPTIONS-CLIENT
deleted file mode 100644
index 11ba42c422f..00000000000
--- a/EXCEPTIONS-CLIENT
+++ /dev/null
@@ -1,136 +0,0 @@
- FOSS License Exception
-
- http://www.mysql.com/about/legal/licensing/foss-exception/
- Updated February 23, 2012
-
-What is the FOSS License Exception?
-
- Oracle's Free and Open Source Software ("FOSS") License Exception
- (formerly known as the FLOSS License Exception) allows developers of FOSS
- applications to include Oracle's MySQL Client Libraries (also referred to
- as "MySQL Drivers" or "MySQL Connectors") with their FOSS applications.
- MySQL Client Libraries are typically licensed pursuant to version 2 of the
- General Public License ("GPL"), but this exception permits distribution of
- certain MySQL Client Libraries with a developer's FOSS applications
- licensed under the terms of another FOSS license listed below, even though
- such other FOSS license may be incompatible with the GPL.
-
- The following terms and conditions describe the circumstances under which
- Oracle's FOSS License Exception applies.
-
-Oracle's FOSS License Exception Terms and Conditions
-
- 1. Definitions. "Derivative Work" means a derivative work, as defined
- under applicable copyright law, formed entirely from the Program and
- one or more FOSS Applications.
-
- "FOSS Application" means a free and open source software application
- distributed subject to a license listed in the section below titled
- "FOSS License List."
-
- "FOSS Notice" means a notice placed by Oracle or MySQL in a copy of
- the MySQL Client Libraries stating that such copy of the MySQL Client
- Libraries may be distributed under Oracle's or MySQL's FOSS (or FLOSS)
- License Exception.
-
- "Independent Work" means portions of the Derivative Work that are not
- derived from the Program and can reasonably be considered independent
- and separate works.
-
- "Program" means a copy of Oracle's MySQL Client Libraries that
- contains a FOSS Notice.
-
- 2. A FOSS application developer ("you" or "your") may distribute a
- Derivative Work provided that you and the Derivative Work meet all of
- the following conditions:
-
- a. You obey the GPL in all respects for the Program and all portions
- (including modifications) of the Program included in the
- Derivative Work (provided that this condition does not apply to
- Independent Works);
- b. The Derivative Work does not include any work licensed under the
- GPL other than the Program;
- c. You distribute Independent Works subject to a license listed in
- the section below titled "FOSS License List";
- d. You distribute Independent Works in object code or executable
- form with the complete corresponding machine-readable source code
- on the same medium and under the same FOSS license applying to
- the object code or executable forms;
- e. All works that are aggregated with the Program or the Derivative
- Work on a medium or volume of storage are not derivative works of
- the Program, Derivative Work or FOSS Application, and must
- reasonably be considered independent and separate works.
-
- 3. Oracle reserves all rights not expressly granted in these terms and
- conditions. If all of the above conditions are not met, then this FOSS
- License Exception does not apply to you or your Derivative Work.
-
-FOSS License List
-
-+------------------------------------------------------------------------+
-|License Name |Version(s)/Copyright Date|
-|----------------------------------------------+-------------------------|
-|Academic Free License |2.0 |
-|----------------------------------------------+-------------------------|
-|Apache Software License |1.0/1.1/2.0 |
-|----------------------------------------------+-------------------------|
-|Apple Public Source License |2.0 |
-|----------------------------------------------+-------------------------|
-|Artistic license |From Perl 5.8.0 |
-|----------------------------------------------+-------------------------|
-|BSD license |"July 22 1999" |
-|----------------------------------------------+-------------------------|
-|Common Development and Distribution License |1.0 |
-|(CDDL) | |
-|----------------------------------------------+-------------------------|
-|Common Public License |1.0 |
-|----------------------------------------------+-------------------------|
-|Eclipse Public License |1.0 |
-|----------------------------------------------+-------------------------|
-|European Union Public License (EUPL)¹ |1.1 |
-|----------------------------------------------+-------------------------|
-|GNU Affero General Public License (AGPL) |3.0 |
-|----------------------------------------------+-------------------------|
-|GNU Library or "Lesser" General Public License|2.0/2.1/3.0 |
-|(LGPL) | |
-|----------------------------------------------+-------------------------|
-|GNU General Public License (GPL) |3.0 |
-|----------------------------------------------+-------------------------|
-|IBM Public License |1.0 |
-|----------------------------------------------+-------------------------|
-|Jabber Open Source License |1.0 |
-|----------------------------------------------+-------------------------|
-|MIT License (As listed in file |- |
-|MIT-License.txt) | |
-|----------------------------------------------+-------------------------|
-|Mozilla Public License (MPL) |1.0/1.1 |
-|----------------------------------------------+-------------------------|
-|Open Software License |2.0 |
-|----------------------------------------------+-------------------------|
-|OpenSSL license (with original SSLeay license)|"2003" ("1998") |
-|----------------------------------------------+-------------------------|
-|PHP License |3.0/3.01 |
-|----------------------------------------------+-------------------------|
-|Python license (CNRI Python License) |- |
-|----------------------------------------------+-------------------------|
-|Python Software Foundation License |2.1.1 |
-|----------------------------------------------+-------------------------|
-|Sleepycat License |"1999" |
-|----------------------------------------------+-------------------------|
-|University of Illinois/NCSA Open Source |- |
-|License | |
-|----------------------------------------------+-------------------------|
-|W3C License |"2001" |
-|----------------------------------------------+-------------------------|
-|X11 License |"2001" |
-|----------------------------------------------+-------------------------|
-|Zlib/libpng License |- |
-|----------------------------------------------+-------------------------|
-|Zope Public License |2.0 |
-+------------------------------------------------------------------------+
-
-¹) When an Independent Work is licensed under a "Compatible License"
-pursuant to the EUPL, the Compatible License rather than the EUPL is the
-applicable license for purposes of these FOSS License Exception Terms and
-Conditions.
-
diff --git a/README.md b/README.md
index 03e71af7652..d208d171377 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,6 @@
Code status:
------------
-* [![Travis CI status](https://secure.travis-ci.org/MariaDB/server.png?branch=10.2)](https://travis-ci.org/MariaDB/server) travis-ci.org (10.2 branch)
* [![Appveyor CI status](https://ci.appveyor.com/api/projects/status/4u6pexmtpuf8jq66?svg=true)](https://ci.appveyor.com/project/rasmushoj/server) ci.appveyor.com
## MariaDB: drop-in replacement for MySQL
@@ -76,10 +75,3 @@ https://bugs.mysql.com
The code for MariaDB, including all revision history, can be found at:
https://github.com/MariaDB/server
-
-***************************************************************************
-
-Code status:
-------------
-
-* [![tests status](https://secure.travis-ci.org/MariaDB/server.png?branch=10.2)](https://travis-ci.org/MariaDB/server) travis-ci.org (10.2 branch)
diff --git a/VERSION b/VERSION
index 4619cee3174..494d4b1db72 100644
--- a/VERSION
+++ b/VERSION
@@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
-MYSQL_VERSION_PATCH=38
+MYSQL_VERSION_PATCH=41
diff --git a/appveyor.yml b/appveyor.yml
index 4a6a49fd8b5..b42453a8350 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,21 +1,30 @@
version: build-{build}~branch-{branch}
-before_build:
- - md %APPVEYOR_BUILD_FOLDER%\win_build
- - cd %APPVEYOR_BUILD_FOLDER%\win_build
- - cmake .. -G "Visual Studio 15 2017 Win64" -DWITH_UNIT_TESTS=0 -DWITH_MARIABACKUP=0 -DMYSQL_MAINTAINER_MODE=ERR -DPLUGIN_ROCKSDB=NO -DPLUGIN_CONNECT=NO -DBISON_EXECUTABLE=C:\cygwin64\bin\bison
+clone_depth: 1
-build:
- project: win_build\MySQL.sln
- parallel: true
- verbosity: minimal
-
-configuration: RelWithDebInfo
-platform: x64
+build_script:
+ # dump some system info
+ - echo processor='%PROCESSOR_IDENTIFIER%' , processor count= %NUMBER_OF_PROCESSORS%
+ - cd %APPVEYOR_BUILD_FOLDER%
+ # Disable unneeded submodules for the faster build
+ - git config submodule.storage/columnstore/columnstore.update none
+ - git config submodule.storage/maria/libmarias3.update none
+ - git config submodule.storage/rocksdb/rocksdb.update none
+ - git config submodule.wsrep-lib.update none
+ # Build minimal configuration
+ - mkdir _build
+ - cd _build
+ - set BUILD_TYPE=MinSizeRel
+ - set GENERATOR=-GNinja
+ - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
+ - cmake -E time cmake %GENERATOR% .. -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DMYSQL_MAINTAINER_MODE=ERR -DFAST_BUILD=1 -DBISON_EXECUTABLE=C:\cygwin64\bin\bison -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_FEEDBACK=NO
+ - set /A jobs=2*%NUMBER_OF_PROCESSORS%
+ - cmake -E time cmake --build . -j %jobs% --config %BUILD_TYPE% --target minbuild
test_script:
- - set PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
- - cd %APPVEYOR_BUILD_FOLDER%\win_build\mysql-test
- - perl mysql-test-run.pl --force --max-test-fail=10 --parallel=4 --testcase-timeout=10 --skip-test-list=unstable-tests --suite=main
+ - set PATH=C:\Strawberry\perl\bin;%PATH%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
+ - cd %APPVEYOR_BUILD_FOLDER%\_build\mysql-test
+ - set /A parallel=4*%NUMBER_OF_PROCESSORS%
+ - perl mysql-test-run.pl --force --max-test-fail=10 --retry=2 -parallel=%parallel% --testcase-timeout=4 --suite=main --skip-test-list=unstable-tests --mysqld=--loose-innodb-flush-log-at-trx-commit=2
-image: Visual Studio 2017
+image: Visual Studio 2019
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 37087b7c6c6..5822c9f6f08 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -81,9 +81,8 @@ MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c)
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqlslap ${CLIENT_LIB})
-# "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/".
IF(WIN32)
- MYSQL_ADD_EXECUTABLE(echo echo.c COMPONENT Junk)
+ MYSQL_ADD_EXECUTABLE(echo echo.c COMPONENT Test)
ENDIF(WIN32)
# async_example is just a code example, do not install it.
diff --git a/client/mysql.cc b/client/mysql.cc
index 2eb44d46512..cd2c37972bc 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1698,11 +1698,14 @@ static struct my_option my_long_options[] =
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"binary-mode", 0,
- "By default, ASCII '\\0' is disallowed and '\\r\\n' is translated to '\\n'. "
- "This switch turns off both features, and also turns off parsing of all client"
- "commands except \\C and DELIMITER, in non-interactive mode (for input "
- "piped to mysql or loaded using the 'source' command). This is necessary "
- "when processing output from mysqlbinlog that may contain blobs.",
+ "Binary mode allows certain character sequences to be processed as data "
+ "that would otherwise be treated with a special meaning by the parser. "
+ "Specifically, this switch turns off parsing of all client commands except "
+ "\\C and DELIMITER in non-interactive mode (i.e., when binary mode is "
+ "combined with either 1) piped input, 2) the --batch mysql option, or 3) "
+ "the 'source' command). Also, in binary mode, occurrences of '\\r\\n' and "
+ "ASCII '\\0' are preserved within strings, whereas by default, '\\r\\n' is "
+ "translated to '\\n' and '\\0' is disallowed in user input.",
&opt_binary_mode, &opt_binary_mode, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -2335,7 +2338,14 @@ static bool add_line(String &buffer, char *line, ulong line_length,
{
// Found possbile one character command like \c
- if (!(inchar = (uchar) *++pos))
+ /*
+ The null-terminating character (ASCII '\0') marks the end of user
+ input. Then, by default, upon encountering a '\0' while parsing, it
+ should stop. However, some data naturally contains binary zeros
+ (e.g., zipped files). Real_binary_mode signals the parser to expect
+ '\0' within the data and not to end parsing if found.
+ */
+ if (!(inchar = (uchar) *++pos) && (!real_binary_mode || !*in_string))
break; // readline adds one '\'
if (*in_string || inchar == 'N') // \N is short for NULL
{ // Don't allow commands in string
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c
index a777bdbb482..35852188fac 100644
--- a/client/mysql_plugin.c
+++ b/client/mysql_plugin.c
@@ -34,7 +34,7 @@ static uint opt_no_defaults= 0;
static uint opt_print_defaults= 0;
static char *opt_datadir=0, *opt_basedir=0,
*opt_plugin_dir=0, *opt_plugin_ini=0,
- *opt_mysqld=0, *opt_my_print_defaults=0;
+ *opt_mysqld=0, *opt_my_print_defaults=0, *opt_lc_messages_dir;
static char bootstrap[FN_REFLEN];
@@ -70,6 +70,8 @@ static struct my_option my_long_options[] =
{"my-print-defaults", 'f', "Path to my_print_defaults executable. "
"Example: /source/temp11/extra",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"lc-messages-dir", 'l', "The error messages dir for the server. ",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v',
"More verbose output; you can use this multiple times to get even more "
"verbose output.",
@@ -306,6 +308,7 @@ static char *add_quotes(const char *path)
--basedir
--plugin-dir
--plugin-ini
+ --lc-messages-dir
These values are used if the user has not specified a value.
@@ -377,14 +380,20 @@ static int get_default_values()
{
opt_basedir= my_strdup(value, MYF(MY_FAE));
}
- if ((opt_plugin_dir == 0) && ((value= get_value(line, "--plugin_dir"))))
+ if ((opt_plugin_dir == 0) && ((value= get_value(line, "--plugin_dir")) ||
+ (value= get_value(line, "--plugin-dir"))))
{
opt_plugin_dir= my_strdup(value, MYF(MY_FAE));
}
- if ((opt_plugin_ini == 0) && ((value= get_value(line, "--plugin_ini"))))
+ if ((opt_lc_messages_dir == 0) &&
+ ((value= get_value(line, "--lc_messages_dir")) ||
+ (value= get_value(line, "--lc_messages-dir")) ||
+ (value= get_value(line, "--lc-messages_dir")) ||
+ (value= get_value(line, "--lc-messages-dir"))))
{
- opt_plugin_ini= my_strdup(value, MYF(MY_FAE));
+ opt_lc_messages_dir= my_strdup(value, MYF(MY_FAE));
}
+
}
}
exit:
@@ -424,6 +433,7 @@ static void usage(void)
--basedir
--plugin-dir
--plugin-ini
+ --lc-messages-dir
*/
@@ -456,6 +466,10 @@ static void print_default_values(void)
{
printf("--my_print_defaults=%s ", opt_my_print_defaults);
}
+ if (opt_lc_messages_dir)
+ {
+ printf("--lc_messages_dir=%s ", opt_lc_messages_dir);
+ }
printf("\n");
}
@@ -510,6 +524,10 @@ get_one_option(int optid,
case 'f':
opt_my_print_defaults= my_strdup(argument, MYF(MY_FAE));
break;
+ case 'l':
+ opt_lc_messages_dir= my_strdup(argument, MYF(MY_FAE));
+ break;
+
}
return 0;
}
@@ -895,6 +913,8 @@ static int process_options(int argc, char *argv[], char *operation)
printf("# plugin_dir = %s\n", opt_plugin_dir);
printf("# datadir = %s\n", opt_datadir);
printf("# plugin_ini = %s\n", opt_plugin_ini);
+ if (opt_lc_messages_dir != 0)
+ printf("# lc_messages_dir = %s\n", opt_lc_messages_dir);
}
exit:
@@ -952,6 +972,12 @@ static int check_access()
opt_my_print_defaults);
goto exit;
}
+ if (opt_lc_messages_dir && (error= my_access(opt_lc_messages_dir, F_OK)))
+ {
+ fprintf(stderr, "ERROR: Cannot access lc-messages-dir path '%s'.\n",
+ opt_lc_messages_dir);
+ goto exit;
+ }
exit:
return error;
@@ -1181,18 +1207,33 @@ static int bootstrap_server(char *server_path, char *bootstrap_file)
verbose_str= "";
if (has_spaces(opt_datadir) || has_spaces(opt_basedir) ||
has_spaces(bootstrap_file))
- format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s < %s\"";
- else
- format_str= "%s %s --bootstrap --datadir=%s --basedir=%s < %s";
-
+ {
+ if (opt_lc_messages_dir != NULL)
+ format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\"";
+ else
+ format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s <%s\"";
+ }
+ else
+ {
+ if (opt_lc_messages_dir != NULL)
+ format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\"";
+ else
+ format_str= "%s %s --bootstrap --datadir=%s --basedir=%s <%s";
+ }
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd), format_str,
add_quotes(convert_path(server_path)), verbose_str,
add_quotes(opt_datadir), add_quotes(opt_basedir),
add_quotes(bootstrap_file));
#else
- snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
- "%s --no-defaults --bootstrap --datadir=%s --basedir=%s"
- " < %s", server_path, opt_datadir, opt_basedir, bootstrap_file);
+ if (opt_lc_messages_dir != NULL)
+ snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
+ "%s --no-defaults --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s"
+ " <%s", server_path, opt_datadir, opt_basedir, opt_lc_messages_dir, bootstrap_file);
+ else
+ snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
+ "%s --no-defaults --bootstrap --datadir=%s --basedir=%s"
+ " <%s", server_path, opt_datadir, opt_basedir, bootstrap_file);
+
#endif
/* Execute the command */
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 2a9560e8903..6d5b6ff31b6 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -90,6 +90,8 @@ static my_bool non_blocking_api_enabled= 0;
#define QUERY_PRINT_ORIGINAL_FLAG 4
+#define CLOSED_CONNECTION "-closed_connection-"
+
#ifndef HAVE_SETENV
static int setenv(const char *name, const char *value, int overwrite);
#endif
@@ -5569,11 +5571,12 @@ void do_close_connection(struct st_command *command)
my_free(con->name);
/*
- When the connection is closed set name to "-closed_connection-"
+ When the connection is closed set name to CLOSED_CONNECTION
to make it possible to reuse the connection name.
*/
- if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME))))
+ if (!(con->name = my_strdup(CLOSED_CONNECTION, MYF(MY_WME))))
die("Out of memory");
+ con->name_len= sizeof(CLOSED_CONNECTION)-1;
if (con == cur_con)
{
@@ -5957,7 +5960,7 @@ void do_connect(struct st_command *command)
con_slot= next_con;
else
{
- if (!(con_slot= find_connection_by_name("-closed_connection-")))
+ if (!(con_slot= find_connection_by_name(CLOSED_CONNECTION)))
die("Connection limit exhausted, you can have max %d connections",
opt_max_connections);
my_free(con_slot->name);
@@ -8571,7 +8574,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
log_file.flush();
dynstr_set(&ds_res, 0);
- if (view_protocol_enabled &&
+ if (view_protocol_enabled && mysql &&
complete_query &&
match_re(&view_re, query))
{
@@ -8617,7 +8620,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
dynstr_free(&query_str);
}
- if (sp_protocol_enabled &&
+ if (sp_protocol_enabled && mysql &&
complete_query &&
match_re(&sp_re, query))
{
@@ -8980,7 +8983,7 @@ static void dump_backtrace(void)
struct st_connection *conn= cur_con;
fprintf(stderr, "read_command_buf (%p): ", read_command_buf);
- my_safe_print_str(read_command_buf, sizeof(read_command_buf));
+ fprintf(stderr, "%.*s\n", (int)read_command_buflen, read_command_buf);
fputc('\n', stderr);
if (conn)
diff --git a/cmake/FindGit.cmake b/cmake/FindGit.cmake
new file mode 100644
index 00000000000..8178b614a3e
--- /dev/null
+++ b/cmake/FindGit.cmake
@@ -0,0 +1,13 @@
+if(GIT_EXECUTABLE)
+ set(GIT_FOUND TRUE)
+ return()
+endif()
+if(DEFINED GIT_EXECUTABLE)
+ set(GIT_FOUND FALSE)
+ return()
+endif()
+
+set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
+unset(CMAKE_MODULE_PATH)
+include(FindGit)
+set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH})
diff --git a/cmake/FindJNI.cmake b/cmake/FindJNI.cmake
index fb2f4801a70..b2c6f849c87 100644
--- a/cmake/FindJNI.cmake
+++ b/cmake/FindJNI.cmake
@@ -1,4 +1,9 @@
+if(JAVA_AWT_LIBRARY AND JAVA_INCLUDE_PATH)
+ set(JNI_FOUND TRUE)
+ return()
+endif()
if(DEFINED JAVA_AWT_LIBRARY)
+ set(JNI_FOUND FALSE)
return()
endif()
diff --git a/cmake/FindJava.cmake b/cmake/FindJava.cmake
index 95bbf8682cd..714f56b1f72 100644
--- a/cmake/FindJava.cmake
+++ b/cmake/FindJava.cmake
@@ -1,4 +1,9 @@
+if(Java_JAVA_EXECUTABLE)
+ set(JAVA_FOUND TRUE)
+ return()
+endif()
if(DEFINED Java_JAVA_EXECUTABLE)
+ set(JAVA_FOUND FALSE)
return()
endif()
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index efd736809e0..d844f436031 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -88,6 +88,12 @@ ENDIF()
SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
SET(WITH_NUMA 0 CACHE BOOL "")
+SET(CPU_LEVEL1_DCACHE_LINESIZE 0)
+
+IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git)
+ SET(GIT_EXECUTABLE GIT_EXECUTABLE-NOTFOUND CACHE FILEPATH "")
+ENDIF()
+
IF(WIN32)
SET(INSTALL_MYSQLTESTDIR "" CACHE STRING "")
SET(INSTALL_SQLBENCHDIR "" CACHE STRING "")
@@ -97,16 +103,38 @@ ELSEIF(RPM)
SET(WITH_ZLIB system CACHE STRING "")
SET(CHECKMODULE /usr/bin/checkmodule CACHE FILEPATH "")
SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE FILEPATH "")
+ SET(WITH_JEMALLOC "yes" CACHE STRING "")
+ IF(RPM MATCHES "fedora|centos|rhel")
+ SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
+ SET(WITH_INNODB_LZO OFF CACHE STRING "")
+ SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
+ ENDIF()
+ IF(RPM MATCHES "opensuse|sles|centos|rhel")
+ SET(WITH_INNODB_LZ4 OFF CACHE STRING "")
+ SET(WITH_ROCKSDB_LZ4 OFF CACHE STRING "")
+ SET(GRN_WITH_LZ4 no CACHE STRING "")
+ ENDIF()
ELSEIF(DEB)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
SET(WITH_LIBWRAP ON)
SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON)
+ SET(WITH_JEMALLOC "yes" CACHE STRING "")
+ SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
+ SET(WITH_INNODB_LZMA OFF CACHE STRING "")
+ SET(WITH_INNODB_LZO OFF CACHE STRING "")
+ SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
ELSE()
SET(WITH_SSL bundled CACHE STRING "")
SET(WITH_PCRE bundled CACHE STRING "")
SET(WITH_ZLIB bundled CACHE STRING "")
SET(WITH_JEMALLOC static CACHE STRING "")
+ SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
+ SET(WITH_INNODB_LZ4 OFF CACHE STRING "")
+ SET(WITH_INNODB_LZO OFF CACHE STRING "")
+ SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
+ SET(WITH_ROCKSDB_LZ4 OFF CACHE STRING "")
+ SET(GRN_WITH_LZ4 no CACHE STRING "")
ENDIF()
IF(NOT COMPILATION_COMMENT)
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 827b1e166a4..d8cd97d5043 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -120,12 +120,16 @@ SET(ignored
"%ignore ${CMAKE_INSTALL_PREFIX}/share/aclocal"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/doc"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man"
- "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1*"
- "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8*"
+ "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1"
+ "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig"
)
-SET(CPACK_RPM_server_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*")
+SET(CPACK_RPM_server_USER_FILELIST
+ ${ignored}
+ "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*"
+ "%config(noreplace) ${INSTALL_SYSCONFDIR}/logrotate.d/mysql"
+ )
SET(CPACK_RPM_common_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONFDIR}/my.cnf")
SET(CPACK_RPM_shared_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*")
SET(CPACK_RPM_client_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*")
diff --git a/cmake/cpu_info.cmake b/cmake/cpu_info.cmake
index 1acfad5897f..2abeb5e12c1 100644
--- a/cmake/cpu_info.cmake
+++ b/cmake/cpu_info.cmake
@@ -15,6 +15,8 @@
# Symbols with information about the CPU.
+IF(NOT DEFINED CPU_LEVEL1_DCACHE_LINESIZE)
+
IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
FIND_PROGRAM(SYSCTL sysctl)
MARK_AS_ADVANCED(SYSCTL)
@@ -37,3 +39,5 @@ ELSE()
)
ENDIF()
ENDIF()
+
+ENDIF()
diff --git a/cmake/do_abi_check.cmake b/cmake/do_abi_check.cmake
index 43d8b15a7ab..0ad0fa39670 100644
--- a/cmake/do_abi_check.cmake
+++ b/cmake/do_abi_check.cmake
@@ -74,7 +74,9 @@ FOREACH(file ${ABI_HEADERS})
FILE(REMOVE ${tmpfile})
EXECUTE_PROCESS(
COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
- IF(NOT ${result} EQUAL 0)
+ IF(result MATCHES "No such file or directory")
+ MESSAGE("Command 'diff' not found. ABI check for ${file} skipped.")
+ ELSEIF(NOT result EQUAL 0)
IF(ABI_UPDATE)
EXECUTE_PROCESS(COMMAND mv -v ${abi_check_out} ${file}.pp)
ELSE(ABI_UPDATE)
@@ -84,4 +86,3 @@ FOREACH(file ${ABI_HEADERS})
ENDIF()
FILE(REMOVE ${abi_check_out})
ENDFOREACH()
-
diff --git a/cmake/for_clients.cmake b/cmake/for_clients.cmake
index e5916c56ddc..e52e3b34f21 100644
--- a/cmake/for_clients.cmake
+++ b/cmake/for_clients.cmake
@@ -24,7 +24,7 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
FOREACH(lib ${${target}_LIB_DEPENDS})
# Filter out "general", it is not a library, just CMake hint
# Also, remove duplicates
- IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ")
+ IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} " AND NOT lib STREQUAL "zlib")
IF (lib MATCHES "^\\-")
SET(${var} "${${var}} ${lib} ")
ELSEIF(lib MATCHES "^/")
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index 5ad636d0e6c..08ab2877c89 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -37,5 +37,6 @@ MACRO (CHECK_JEMALLOC)
IF (NOT LIBJEMALLOC AND NOT WITH_JEMALLOC STREQUAL "auto")
MESSAGE(FATAL_ERROR "jemalloc is not found")
ENDIF()
+ ADD_FEATURE_INFO(JEMALLOC LIBJEMALLOC "Use the JeMalloc memory allocator")
ENDIF()
ENDMACRO()
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index 9c51cb797bb..933b04fb7f0 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -1,5 +1,5 @@
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
-# Copyright (c) 2020, MariaDB
+# Copyright (c) 2011, 2021, MariaDB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,6 +14,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
+IF(MYSQL_MAINTAINER_MODE STREQUAL "NO")
+ RETURN()
+ENDIF()
+
# Common warning flags for GCC, G++, Clang and Clang++
SET(MY_WARNING_FLAGS
-Wall
@@ -41,7 +45,7 @@ IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")
SET(MY_ERROR_FLAGS ${MY_ERROR_FLAGS} -Wno-error=maybe-uninitialized)
ENDIF()
-IF(MYSQL_MAINTAINER_MODE MATCHES "OFF")
+IF(MYSQL_MAINTAINER_MODE MATCHES "OFF|WARN")
RETURN()
ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")
SET(WHERE DEBUG)
diff --git a/cmake/numa.cmake b/cmake/numa.cmake
index 4bace0ee7f4..a7b0c0a3392 100644
--- a/cmake/numa.cmake
+++ b/cmake/numa.cmake
@@ -31,6 +31,7 @@ MACRO (MYSQL_CHECK_NUMA)
ENDIF()
ENDIF()
+ ADD_FEATURE_INFO(NUMA HAVE_LIBNUMA "NUMA memory allocation policy")
IF(WITH_NUMA AND NOT HAVE_LIBNUMA)
# Forget it in cache, abort the build.
UNSET(WITH_NUMA CACHE)
diff --git a/cmake/os/OpenBSD.cmake b/cmake/os/OpenBSD.cmake
new file mode 100644
index 00000000000..c8b91944275
--- /dev/null
+++ b/cmake/os/OpenBSD.cmake
@@ -0,0 +1,22 @@
+# Copyright (C) 2012 Monty Program Ab, 2021 Brad Smith
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
+
+# This file includes OpenBSD specific options and quirks, related to system checks
+
+# Find libexecinfo (library that contains backtrace_symbols etc)
+FIND_LIBRARY(EXECINFO NAMES execinfo)
+IF(EXECINFO)
+ SET(LIBEXECINFO ${EXECINFO})
+ENDIF()
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake
index 1eae92924a6..75a0d71cc2d 100644
--- a/cmake/os/Windows.cmake
+++ b/cmake/os/Windows.cmake
@@ -150,6 +150,7 @@ IF(MSVC)
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
# Temporarily disable size_t warnings, due to their amount
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267")
ENDIF()
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake
index 8acf52f1bb3..b93641109c3 100644
--- a/cmake/package_name.cmake
+++ b/cmake/package_name.cmake
@@ -110,7 +110,11 @@ IF(NOT VERSION)
SET(DEFAULT_MACHINE "x86")
ENDIF()
ENDIF()
-
+
+ IF(NOT DEFAULT_MACHINE MATCHES "64" AND 64BIT)
+ SET(DEFAULT_MACHINE "${DEFAULT_MACHINE}-64bit")
+ ENDIF()
+
IF(NOT PLATFORM)
SET(PLATFORM ${DEFAULT_PLATFORM})
ENDIF()
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 68eb715eed9..8b050a808ab 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -26,13 +26,13 @@ INCLUDE(CMakeParseArguments)
# [STATIC_OUTPUT_NAME static_name]
# [RECOMPILE_FOR_EMBEDDED]
# [LINK_LIBRARIES lib1...libN]
-# [DEPENDENCIES target1...targetN]
+# [DEPENDS target1...targetN]
MACRO(MYSQL_ADD_PLUGIN)
CMAKE_PARSE_ARGUMENTS(ARG
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENT"
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
- "LINK_LIBRARIES;DEPENDENCIES"
+ "LINK_LIBRARIES;DEPENDS"
${ARGN}
)
IF(NOT WITHOUT_SERVER OR ARG_CLIENT)
@@ -49,7 +49,7 @@ MACRO(MYSQL_ADD_PLUGIN)
LIST(REMOVE_AT SOURCES 0)
STRING(TOUPPER ${plugin} plugin)
STRING(TOLOWER ${plugin} target)
-
+
IF (ARG_MANDATORY)
UNSET(PLUGIN_${plugin} CACHE)
SET(PLUGIN_${plugin} "YES")
@@ -110,11 +110,11 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(with_var "WITH_${plugin}")
ENDIF()
UNSET(${with_var} CACHE)
-
- IF(NOT ARG_DEPENDENCIES)
- SET(ARG_DEPENDENCIES)
+
+ IF(NOT ARG_DEPENDS)
+ SET(ARG_DEPENDS)
ENDIF()
-
+
IF(NOT ARG_MODULE_OUTPUT_NAME)
IF(ARG_STORAGE_ENGINE)
SET(ARG_MODULE_OUTPUT_NAME "ha_${target}")
@@ -138,7 +138,7 @@ MACRO(MYSQL_ADD_PLUGIN)
ADD_LIBRARY(${target} STATIC ${SOURCES})
DTRACE_INSTRUMENT(${target})
- ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
+ ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDS})
RESTRICT_SYMBOL_EXPORTS(${target})
IF(WITH_EMBEDDED_SERVER)
# Embedded library should contain PIC code and be linkable
@@ -152,7 +152,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET_TARGET_PROPERTIES(${target}_embedded
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY")
ENDIF()
- ADD_DEPENDENCIES(${target}_embedded GenError)
+ ADD_DEPENDENCIES(${target}_embedded GenError ${ARG_DEPENDS})
ENDIF()
ENDIF()
@@ -213,7 +213,7 @@ MACRO(MYSQL_ADD_PLUGIN)
TARGET_LINK_LIBRARIES (${target} "-Wl,--no-undefined")
ENDIF()
- ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
+ ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDS})
SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
@@ -257,6 +257,21 @@ MACRO(MYSQL_ADD_PLUGIN)
INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/${subpath}")
ENDIF()
+ IF(TARGET ${target})
+ GET_TARGET_PROPERTY(plugin_type ${target} TYPE)
+ STRING(REPLACE "_LIBRARY" "" plugin_type ${plugin_type})
+ SET(have_target 1)
+ ELSE()
+ SET(plugin_type)
+ SET(have_target 0)
+ ENDIF()
+ IF(ARG_STORAGE_ENGINE)
+ ADD_FEATURE_INFO(${plugin} ${have_target} "Storage Engine ${plugin_type}")
+ ELSEIF(ARG_CLIENT)
+ ADD_FEATURE_INFO(${plugin} ${have_target} "Client plugin ${plugin_type}")
+ ELSE()
+ ADD_FEATURE_INFO(${plugin} ${have_target} "Server plugin ${plugin_type}")
+ ENDIF()
ENDIF(NOT WITHOUT_SERVER OR ARG_CLIENT)
ENDMACRO()
diff --git a/cmake/readline.cmake b/cmake/readline.cmake
index f676aeb7838..c423a8a830f 100644
--- a/cmake/readline.cmake
+++ b/cmake/readline.cmake
@@ -52,7 +52,7 @@ MACRO (MYSQL_CHECK_MULTIBYTE)
ENDMACRO()
MACRO (FIND_CURSES)
- FIND_PACKAGE(Curses)
+ FIND_PACKAGE(Curses REQUIRED)
MARK_AS_ADVANCED(CURSES_CURSES_H_PATH CURSES_FORM_LIBRARY CURSES_HAVE_CURSES_H)
IF(NOT CURSES_FOUND)
SET(ERRORMSG "Curses library not found. Please install appropriate package,
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index d87d2c8fbd0..1b238826311 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -126,6 +126,7 @@ MACRO (MYSQL_CHECK_SSL)
ENDIF()
ENDIF()
FIND_PACKAGE(OpenSSL)
+ SET_PACKAGE_PROPERTIES(OpenSSL PROPERTIES TYPE RECOMMENDED)
IF(OPENSSL_FOUND)
SET(OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY})
SET(SSL_SOURCES "")
diff --git a/cmake/submodules.cmake b/cmake/submodules.cmake
index 6e039bfeae3..b6c64b32f3d 100644
--- a/cmake/submodules.cmake
+++ b/cmake/submodules.cmake
@@ -28,7 +28,7 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
RESULT_VARIABLE update_result)
ELSE()
MESSAGE(STATUS "Updating submodules")
- EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init
+ EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --depth=1
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ENDIF()
diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake
index 8a5695a246c..df10d6396df 100644
--- a/cmake/systemd.cmake
+++ b/cmake/systemd.cmake
@@ -63,5 +63,6 @@ MACRO(CHECK_SYSTEMD)
ELSEIF(NOT WITH_SYSTEMD STREQUAL "no")
MESSAGE(FATAL_ERROR "Invalid value for WITH_SYSTEMD. Must be 'yes', 'no', or 'auto'.")
ENDIF()
+ ADD_FEATURE_INFO(SYSTEMD LIBSYSTEMD "Systemd scripts and notification support")
ENDIF()
ENDMACRO()
diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake
index a1e8fc39fca..990198ecf72 100644
--- a/cmake/wsrep.cmake
+++ b/cmake/wsrep.cmake
@@ -41,3 +41,6 @@ SET(WSREP_PROC_INFO ${WITH_WSREP})
IF(WITH_WSREP)
SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}")
ENDIF()
+IF (NOT WIN32)
+ ADD_FEATURE_INFO(WSREP WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)")
+ENDIF()
diff --git a/configure.cmake b/configure.cmake
index 1aa0827a503..942d5780ed9 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -161,6 +161,7 @@ IF(UNIX)
SET(LIBWRAP "wrap")
ENDIF()
ENDIF()
+ ADD_FEATURE_INFO(LIBWRAP HAVE_LIBWRAP "Support for tcp wrappers")
ENDIF()
#
diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt
index 8941ac5fc27..a6573b7444e 100644
--- a/dbug/CMakeLists.txt
+++ b/dbug/CMakeLists.txt
@@ -29,7 +29,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
TARGET_LINK_LIBRARIES(factorial dbug)
ENDIF()
-IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode)
+IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode AND NOT RPM AND NOT DEB)
FIND_PROGRAM(GROFF groff)
FIND_PROGRAM(NROFF nroff)
MARK_AS_ADVANCED(GROFF)
diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh
index 5cf2398575a..21ab4d8fe22 100755
--- a/debian/autobake-deb.sh
+++ b/debian/autobake-deb.sh
@@ -106,6 +106,15 @@ then
sed '/Package: mariadb-plugin-cassandra/,/^$/d' -i debian/control
fi
+# From Debian Stretch/Ubuntu Bionic onwards dh-systemd is just an empty
+# transitional metapackage and the functionality was merged into debhelper.
+# In Ubuntu Hirsute is was completely removed, so it can't be referenced anymore.
+# Keep using it only on Debian Jessie and Ubuntu Xenial.
+if apt-cache madison dh-systemd | grep 'dh-systemd' >/dev/null 2>&1
+then
+ sed 's/debhelper (>= 9.20160709~),/debhelper (>= 9), dh-systemd,/' -i debian/control
+fi
+
# Adjust changelog, add new version
echo "Incrementing changelog and starting build scripts"
diff --git a/debian/control b/debian/control
index ba6243c38dd..372abafe205 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: bison,
chrpath,
cmake (>= 2.7),
- debhelper (>= 9),
+ debhelper (>= 9.20160709~),
dh-apparmor,
dh-systemd,
dpatch,
@@ -164,14 +164,14 @@ Description: MariaDB database common files (e.g. /etc/mysql/my.cnf)
Package: mariadb-common
Architecture: all
Depends: mysql-common, ${misc:Depends}, ${shlibs:Depends}
-Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)
+Description: MariaDB database common files (e.g. /etc/mysql/mariadb.conf.d/)
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MariaDB are speed, robustness and
ease of use.
.
This package includes files needed by all versions of the client library
- (e.g. /etc/mysql/conf.d/mariadb.cnf).
+ (e.g. /etc/mysql/mariadb.conf.d/ or /etc/mysql/mariadb.cnf).
Package: mariadb-client-core-10.2
Architecture: any
diff --git a/debian/mariadb-server-10.2.postinst b/debian/mariadb-server-10.2.postinst
index 063f0d8c58b..14b2053b3a0 100644
--- a/debian/mariadb-server-10.2.postinst
+++ b/debian/mariadb-server-10.2.postinst
@@ -117,7 +117,7 @@ EOF
if [ ! -d "$mysql_datadir" -a ! -L "$mysql_datadir" ]; then mkdir "$mysql_datadir" ; fi
if [ ! -d "$mysql_logdir" -a ! -L "$mysql_logdir" ]; then mkdir "$mysql_logdir" ; fi
# When creating an ext3 jounal on an already mounted filesystem like e.g.
- # /var/lib/mysql, you get a .journal file that is not modifyable by chown.
+ # /var/lib/mysql, you get a .journal file that is not modifiable by chown.
# The mysql_statedir must not be writable by the mysql user under any
# circumstances as it contains scripts that are executed by root.
set +e
@@ -147,10 +147,6 @@ EOF
bash /usr/bin/mysql_install_db --rpm --cross-bootstrap --user=mysql --disable-log-bin 2>&1 | $ERR_LOGGER
set -e
-
- # To avoid downgrades.
- touch $mysql_statedir/debian-$MAJOR_VER.flag
-
## On every reconfiguration the maintenance user is recreated.
#
# - It is easier to regenerate the password every time but as people
@@ -247,8 +243,8 @@ EOF
;;
triggered)
- if [ -x "$(command -v systemctl)" ]; then
- systemctl daemon-reload
+ if [ -d /run/systemd/system ]; then
+ systemctl --system daemon-reload
fi
invoke restart
;;
@@ -259,7 +255,7 @@ EOF
;;
esac
-db_stop # in case invoke failes
+db_stop # in case invoke fails
# dh_systemd_start doesn't emit anything since we still ship /etc/init.d/mysql.
# Thus MariaDB server is started via init.d script, which in turn redirects to
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index 4dca6572434..f333ec20991 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
- Copyright (c) 2014, 2019, MariaDB Corporation.
+ Copyright (c) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -85,9 +85,9 @@ typedef void fil_space_t;
/* Global variables */
static bool verbose;
static bool just_count;
-static unsigned long long start_page;
-static unsigned long long end_page;
-static unsigned long long do_page;
+static uint32_t start_page;
+static uint32_t end_page;
+static uint32_t do_page;
static bool use_end_page;
static bool do_one_page;
static my_bool do_leaf;
@@ -99,9 +99,9 @@ static ulong logical_page_size; /* Page size when uncompressed. */
ulong srv_page_size;
page_size_t univ_page_size(0, 0, false);
/* Current page number (0 based). */
-unsigned long long cur_page_num;
+uint32_t cur_page_num;
/* Current space. */
-unsigned long long cur_space;
+uint32_t cur_space;
/* Skip the checksum verification. */
static bool no_check;
/* Enabled for strict checksum verification. */
@@ -494,11 +494,11 @@ is_page_corrupted(
/* enable if page is corrupted. */
bool is_corrupted;
/* use to store LSN values. */
- ulint logseq;
- ulint logseqfield;
+ uint32_t logseq;
+ uint32_t logseqfield;
ulint page_type = mach_read_from_2(buf+FIL_PAGE_TYPE);
- uint key_version = mach_read_from_4(buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
- ulint space_id = mach_read_from_4(
+ uint32_t key_version = mach_read_from_4(buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
+ uint32_t space_id = mach_read_from_4(
buf + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
if (mach_read_from_4(buf + FIL_PAGE_OFFSET) != cur_page_num
@@ -511,8 +511,8 @@ is_page_corrupted(
if (is_log_enabled) {
fprintf(log_file,
- "page id mismatch space::" ULINTPF
- " page::%llu \n",
+ "page id mismatch space::" UINT32PF
+ " page::" UINT32PF " \n",
space_id, cur_page_num);
}
@@ -539,13 +539,14 @@ is_page_corrupted(
if (is_log_enabled) {
fprintf(log_file,
- "space::" ULINTPF " page::%llu"
- "; log sequence number:first = " ULINTPF
- "; second = " ULINTPF "\n",
+ "space::" UINT32PF " page::" UINT32PF
+ "; log sequence number:first = " UINT32PF
+ "; second = " UINT32PF "\n",
space_id, cur_page_num, logseq, logseqfield);
if (logseq != logseqfield) {
fprintf(log_file,
- "Fail; space::" ULINTPF " page::%llu"
+ "Fail; space::" UINT32PF
+ " page::" UINT32PF
" invalid (fails log "
"sequence number check)\n",
space_id, cur_page_num);
@@ -567,9 +568,9 @@ is_page_corrupted(
page_size);
if (is_corrupted && log_file) {
fprintf(log_file,
- "[page id: space=" ULINTPF
- ", page_number=%llu] may be corrupted;"
- " key_version=%u\n",
+ "[page id: space=" UINT32PF
+ ", page_number=" UINT32PF "] may be corrupted;"
+ " key_version=" UINT32PF "\n",
space_id, cur_page_num,
mach_read_from_4(
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
@@ -680,8 +681,8 @@ update_checksum(
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum);
if (is_log_enabled) {
- fprintf(log_file, "page::%llu; Updated checksum ="
- " %u\n", cur_page_num, checksum);
+ fprintf(log_file, "page::" UINT32PF "; Updated checksum ="
+ " " UINT32PF "\n", cur_page_num, checksum);
}
} else {
@@ -711,8 +712,8 @@ update_checksum(
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum);
if (is_log_enabled) {
- fprintf(log_file, "page::%llu; Updated checksum field1"
- " = %u\n", cur_page_num, checksum);
+ fprintf(log_file, "page::" UINT32PF "; Updated checksum field1"
+ " = " UINT32PF "\n", cur_page_num, checksum);
}
if (write_check == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB
@@ -725,8 +726,8 @@ update_checksum(
FIL_PAGE_END_LSN_OLD_CHKSUM,checksum);
if (is_log_enabled) {
- fprintf(log_file, "page::%llu; Updated checksum "
- "field2 = %u\n", cur_page_num, checksum);
+ fprintf(log_file, "page::" UINT32PF "; Updated checksum "
+ "field2 = " UINT32PF "\n", cur_page_num, checksum);
}
}
@@ -800,7 +801,7 @@ write_file(
if (page_size
!= fwrite(buf, 1, page_size, file == stdin ? stdout : file)) {
- fprintf(stderr, "Failed to write page::%llu to %s: %s\n",
+ fprintf(stderr, "Failed to write page::" UINT32PF " to %s: %s\n",
cur_page_num, filename, strerror(errno));
return(false);
@@ -817,6 +818,16 @@ write_file(
return(true);
}
+// checks using current xdes page whether the page is free
+static inline bool is_page_free(const byte *xdes, page_size_t page_size,
+ uint32_t page_no)
+{
+ const byte *des=
+ xdes + XDES_ARR_OFFSET +
+ XDES_SIZE * ((page_no & (page_size.physical() - 1)) / FSP_EXTENT_SIZE);
+ return xdes_get_bit(des, XDES_FREE_BIT, page_no % FSP_EXTENT_SIZE);
+}
+
/*
Parse the page and collect/dump the information about page type
@param [in] page buffer page
@@ -834,12 +845,10 @@ parse_page(
bool is_encrypted)
{
unsigned long long id;
- ulint undo_page_type;
+ uint16_t undo_page_type;
char str[20]={'\0'};
ulint n_recs;
- ulint page_no;
- ulint left_page_no;
- ulint right_page_no;
+ uint32_t page_no, left_page_no, right_page_no;
ulint data_bytes;
bool is_leaf;
int size_range_id;
@@ -854,7 +863,7 @@ parse_page(
switch (mach_read_from_2(page + FIL_PAGE_TYPE)) {
case FIL_PAGE_INDEX: {
- uint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
+ uint32_t key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
page_type.n_fil_page_index++;
/* If page is encrypted we can't read index header */
@@ -878,7 +887,7 @@ parse_page(
is_leaf = (!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL)));
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tIndex page\t\t\t|"
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tIndex page\t\t\t|"
"\tindex id=%llu,", cur_page_num, id);
fprintf(file,
@@ -897,22 +906,13 @@ parse_page(
size_range_id = SIZE_RANGES_FOR_PAGE + 1;
}
if (per_page_details) {
- printf("index id=%llu page " ULINTPF " leaf %d n_recs " ULINTPF " data_bytes " ULINTPF
+ printf("index id=%llu page " UINT32PF " leaf %d n_recs " ULINTPF " data_bytes " ULINTPF
"\n", id, page_no, is_leaf, n_recs, data_bytes);
}
/* update per-index statistics */
{
- if (index_ids.count(id) == 0) {
- index_ids[id] = per_index_stats();
- }
- std::map<unsigned long long, per_index_stats>::iterator it;
- it = index_ids.find(id);
- per_index_stats &index = (it->second);
- const byte* des = xdes + XDES_ARR_OFFSET
- + XDES_SIZE * ((page_no & (page_size.physical() - 1))
- / FSP_EXTENT_SIZE);
- if (xdes_get_bit(des, XDES_FREE_BIT,
- page_no % FSP_EXTENT_SIZE)) {
+ per_index_stats &index = index_ids[id];
+ if (is_page_free(xdes, page_size, page_no)) {
index.free_pages++;
return;
}
@@ -940,8 +940,8 @@ parse_page(
index.pages_in_size_range[size_range_id] ++;
}
} else {
- fprintf(file, "#::%llu\t\t|\t\tEncrypted Index page\t\t\t|"
- "\tkey_version %u,%s\n", cur_page_num, key_version, str);
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tEncrypted Index page\t\t\t|"
+ "\tkey_version " UINT32PF ",%s\n", cur_page_num, key_version, str);
}
break;
@@ -951,7 +951,7 @@ parse_page(
undo_page_type = mach_read_from_2(page +
TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_TYPE);
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tUndo log page\t\t\t|",
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tUndo log page\t\t\t|",
cur_page_num);
}
if (undo_page_type == TRX_UNDO_INSERT) {
@@ -1025,7 +1025,7 @@ parse_page(
case FIL_PAGE_INODE:
page_type.n_fil_page_inode++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tInode page\t\t\t|"
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tInode page\t\t\t|"
"\t%s\n",cur_page_num, str);
}
break;
@@ -1033,7 +1033,7 @@ parse_page(
case FIL_PAGE_IBUF_FREE_LIST:
page_type.n_fil_page_ibuf_free_list++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tInsert buffer free list"
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tInsert buffer free list"
" page\t|\t%s\n", cur_page_num, str);
}
break;
@@ -1041,7 +1041,7 @@ parse_page(
case FIL_PAGE_TYPE_ALLOCATED:
page_type.n_fil_page_type_allocated++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tFreshly allocated "
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tFreshly allocated "
"page\t\t|\t%s\n", cur_page_num, str);
}
break;
@@ -1049,7 +1049,7 @@ parse_page(
case FIL_PAGE_IBUF_BITMAP:
page_type.n_fil_page_ibuf_bitmap++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tInsert Buffer "
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tInsert Buffer "
"Bitmap\t\t|\t%s\n", cur_page_num, str);
}
break;
@@ -1057,33 +1057,31 @@ parse_page(
case FIL_PAGE_TYPE_SYS:
page_type.n_fil_page_type_sys++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tSystem page\t\t\t|"
- "\t%s\n",cur_page_num, str);
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tSystem page\t\t\t|"
+ "\t%s\n", cur_page_num, str);
}
break;
case FIL_PAGE_TYPE_TRX_SYS:
page_type.n_fil_page_type_trx_sys++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tTransaction system "
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tTransaction system "
"page\t\t|\t%s\n", cur_page_num, str);
}
break;
case FIL_PAGE_TYPE_FSP_HDR:
page_type.n_fil_page_type_fsp_hdr++;
- memcpy(xdes, page, page_size.physical());
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tFile Space "
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tFile Space "
"Header\t\t|\t%s\n", cur_page_num, str);
}
break;
case FIL_PAGE_TYPE_XDES:
page_type.n_fil_page_type_xdes++;
- memcpy(xdes, page, page_size.physical());
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tExtent descriptor "
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tExtent descriptor "
"page\t\t|\t%s\n", cur_page_num, str);
}
break;
@@ -1091,7 +1089,7 @@ parse_page(
case FIL_PAGE_TYPE_BLOB:
page_type.n_fil_page_type_blob++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tBLOB page\t\t\t|\t%s\n",
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tBLOB page\t\t\t|\t%s\n",
cur_page_num, str);
}
break;
@@ -1099,7 +1097,7 @@ parse_page(
case FIL_PAGE_TYPE_ZBLOB:
page_type.n_fil_page_type_zblob++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tCompressed BLOB "
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tCompressed BLOB "
"page\t\t|\t%s\n", cur_page_num, str);
}
break;
@@ -1107,7 +1105,7 @@ parse_page(
case FIL_PAGE_TYPE_ZBLOB2:
page_type.n_fil_page_type_zblob2++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tSubsequent Compressed "
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tSubsequent Compressed "
"BLOB page\t|\t%s\n", cur_page_num, str);
}
break;
@@ -1115,7 +1113,7 @@ parse_page(
case FIL_PAGE_PAGE_COMPRESSED:
page_type.n_fil_page_type_page_compressed++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tPage compressed "
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tPage compressed "
"page\t|\t%s\n", cur_page_num, str);
}
break;
@@ -1123,7 +1121,7 @@ parse_page(
case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED:
page_type.n_fil_page_type_page_compressed_encrypted++;
if (page_type_dump) {
- fprintf(file, "#::%llu\t\t|\t\tPage compressed encrypted "
+ fprintf(file, "#::" UINT32PF "\t\t|\t\tPage compressed encrypted "
"page\t|\t%s\n", cur_page_num, str);
}
break;
@@ -1279,14 +1277,14 @@ static struct my_option innochecksum_options[] = {
{"count", 'c', "Print the count of pages in the file and exits.",
&just_count, &just_count, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"start_page", 's', "Start on this page number (0 based).",
- &start_page, &start_page, 0, GET_ULL, REQUIRED_ARG,
- 0, 0, ULLONG_MAX, 0, 1, 0},
+ &start_page, &start_page, 0, GET_UINT, REQUIRED_ARG,
+ 0, 0, FIL_NULL, 0, 1, 0},
{"end_page", 'e', "End at this page number (0 based).",
- &end_page, &end_page, 0, GET_ULL, REQUIRED_ARG,
- 0, 0, ULLONG_MAX, 0, 1, 0},
+ &end_page, &end_page, 0, GET_UINT, REQUIRED_ARG,
+ 0, 0, FIL_NULL, 0, 1, 0},
{"page", 'p', "Check only this page (0 based).",
- &do_page, &do_page, 0, GET_ULL, REQUIRED_ARG,
- 0, 0, ULLONG_MAX, 0, 1, 0},
+ &do_page, &do_page, 0, GET_UINT, REQUIRED_ARG,
+ 0, 0, FIL_NULL, 0, 1, 0},
{"strict-check", 'C', "Specify the strict checksum algorithm by the user.",
&strict_check, &strict_check, &innochecksum_algorithms_typelib,
GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -1480,14 +1478,14 @@ bool check_encryption(
return false;
}
- uint min_key_version = mach_read_from_4
+ uint32_t min_key_version = mach_read_from_4
(page + offset + MAGIC_SZ + 2 + iv_length);
- uint key_id = mach_read_from_4
+ uint32_t key_id = mach_read_from_4
(page + offset + MAGIC_SZ + 2 + iv_length + 4);
if (type == CRYPT_SCHEME_1 && is_log_enabled) {
- fprintf(log_file,"Tablespace %s encrypted key_version %u key_id %u\n",
+ fprintf(log_file,"Tablespace %s encrypted key_version " UINT32PF " key_id " UINT32PF "\n",
filename, min_key_version, key_id);
}
@@ -1518,7 +1516,7 @@ int verify_checksum(
buf, page_size, is_encrypted, is_compressed);
if (is_corrupted) {
- fprintf(stderr, "Fail: page::%llu invalid\n",
+ fprintf(stderr, "Fail: page::" UINT32PF " invalid\n",
cur_page_num);
(*mismatch_count)++;
@@ -1604,7 +1602,7 @@ int main(
/* size of file (has to be 64 bits) */
unsigned long long int size = 0;
/* number of pages in file */
- ulint pages;
+ uint32_t pages;
off_t offset = 0;
/* count the no. of page corrupted. */
@@ -1811,36 +1809,38 @@ int main(
}
if (per_page_details) {
- printf("page %llu ", cur_page_num);
+ printf("page " UINT32PF " ", cur_page_num);
}
+ memcpy(xdes, buf, physical_page_size);
+
if (page_type_summary || page_type_dump) {
parse_page(buf, xdes, fil_page_type, page_size, is_encrypted);
}
- pages = (ulint) (size / page_size.physical());
+ pages = uint32_t(size / page_size.physical());
if (just_count) {
- if (read_from_stdin) {
- fprintf(stderr, "Number of pages:" ULINTPF "\n", pages);
- } else {
- printf("Number of pages:" ULINTPF "\n", pages);
- }
+ fprintf(read_from_stdin ? stderr : stdout,
+ "Number of pages:" UINT32PF "\n", pages);
continue;
} else if (verbose && !read_from_stdin) {
if (is_log_enabled) {
fprintf(log_file, "file %s = %llu bytes "
- "(" ULINTPF " pages)\n", filename, size, pages);
+ "(" UINT32PF " pages)\n",
+ filename, size, pages);
if (do_one_page) {
fprintf(log_file, "Innochecksum: "
- "checking page::%llu;\n",
+ "checking page::"
+ UINT32PF ";\n",
do_page);
}
}
} else {
if (is_log_enabled) {
fprintf(log_file, "Innochecksum: checking "
- "pages in range::%llu to %llu\n",
+ "pages in range::" UINT32PF
+ " to " UINT32PF "\n",
start_page, use_end_page ?
end_page : (pages - 1));
}
@@ -1884,8 +1884,8 @@ int main(
the desired page. */
partial_page_read = false;
- offset = (off_t) start_page
- * (off_t) page_size.physical();
+ offset = off_t(ulonglong(start_page)
+ * page_size.physical());
#ifdef _WIN32
if (_fseeki64(fil_in, offset, SEEK_SET)) {
#else
@@ -1930,12 +1930,7 @@ int main(
count++;
if (!bytes || feof(fil_in)) {
- fprintf(stderr, "Error: Unable "
- "to seek to necessary "
- "offset");
-
- exit_status = 1;
- goto my_exit;
+ goto unexpected_eof;
}
}
}
@@ -1952,6 +1947,15 @@ int main(
partial_page_read = false;
if (!bytes && feof(fil_in)) {
+ if (cur_page_num == start_page) {
+unexpected_eof:
+ fputs("Error: Unable "
+ "to seek to necessary offset\n",
+ stderr);
+
+ exit_status = 1;
+ goto my_exit;
+ }
break;
}
@@ -1991,9 +1995,10 @@ first_non_zero:
/* If no-check is enabled, skip the
checksum verification.*/
- if (!no_check
- && !skip_page
- && (exit_status = verify_checksum(
+ if (!no_check &&
+ !is_page_free(xdes, page_size, cur_page_num) &&
+ !skip_page &&
+ (exit_status = verify_checksum(
buf, page_size,
is_encrypted, is_compressed,
&mismatch_count))) {
@@ -2011,7 +2016,11 @@ first_non_zero:
}
if (per_page_details) {
- printf("page %llu ", cur_page_num);
+ printf("page " UINT32PF " ", cur_page_num);
+ }
+
+ if (page_get_page_no(buf) % physical_page_size == 0) {
+ memcpy(xdes, buf, physical_page_size);
}
if (page_type_summary || page_type_dump) {
@@ -2027,10 +2036,10 @@ first_non_zero:
if (!lastt) {
lastt= now;
} else if (now - lastt >= 1 && is_log_enabled) {
- fprintf(log_file, "page::%llu "
+ fprintf(log_file, "page::" UINT32PF " "
"okay: %.3f%% done\n",
(cur_page_num - 1),
- (float) cur_page_num / pages * 100);
+ (double) cur_page_num / pages * 100);
lastt = now;
}
}
diff --git a/extra/mariabackup/CMakeLists.txt b/extra/mariabackup/CMakeLists.txt
index fd3ebd68d64..409dcd7efde 100644
--- a/extra/mariabackup/CMakeLists.txt
+++ b/extra/mariabackup/CMakeLists.txt
@@ -15,6 +15,7 @@
OPTION(WITH_MARIABACKUP "Include mariabackup" ON)
+ADD_FEATURE_INFO(MARIABACKUP WITH_MARIABACKUP "MariaDB Backup Utility")
IF(NOT WITH_MARIABACKUP)
RETURN()
ENDIF()
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc
index 5637ec3d4d7..c46c32213d6 100644
--- a/extra/mariabackup/backup_copy.cc
+++ b/extra/mariabackup/backup_copy.cc
@@ -196,6 +196,8 @@ datadir_iter_new(const char *path, bool skip_first_level = true)
datadir_iter_t *it;
it = static_cast<datadir_iter_t *>(malloc(sizeof(datadir_iter_t)));
+ if (!it)
+ goto error;
memset(it, 0, sizeof(datadir_iter_t));
pthread_mutex_init(&it->mutex, NULL);
diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc
index 1d7242c5c75..824b8b6d5f3 100644
--- a/extra/mariabackup/backup_mysql.cc
+++ b/extra/mariabackup/backup_mysql.cc
@@ -44,6 +44,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include <mysql.h>
#include <mysqld.h>
#include <my_sys.h>
+#include <stdlib.h>
#include <string.h>
#include <limits>
#include "common.h"
@@ -107,6 +108,13 @@ xb_mysql_connect()
return(NULL);
}
+#if !defined(DONT_USE_MYSQL_PWD)
+ if (!opt_password)
+ {
+ opt_password=getenv("MYSQL_PWD");
+ }
+#endif
+
if (!opt_secure_auth) {
mysql_options(connection, MYSQL_SECURE_AUTH,
(char *) &opt_secure_auth);
diff --git a/extra/mariabackup/datasink.cc b/extra/mariabackup/datasink.cc
index 4235a46ea00..ecd60a7df95 100644
--- a/extra/mariabackup/datasink.cc
+++ b/extra/mariabackup/datasink.cc
@@ -22,7 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
#include "common.h"
#include "datasink.h"
#include "ds_compress.h"
-#include "ds_archive.h"
#include "ds_xbstream.h"
#include "ds_local.h"
#include "ds_stdout.h"
@@ -44,13 +43,6 @@ ds_create(const char *root, ds_type_t type)
case DS_TYPE_LOCAL:
ds = &datasink_local;
break;
- case DS_TYPE_ARCHIVE:
-#ifdef HAVE_LIBARCHIVE
- ds = &datasink_archive;
-#else
- die("mariabackup was built without libarchive support");
-#endif
- break;
case DS_TYPE_XBSTREAM:
ds = &datasink_xbstream;
break;
diff --git a/extra/mariabackup/datasink.h b/extra/mariabackup/datasink.h
index 5c82556b9ba..4bede4ec9e7 100644
--- a/extra/mariabackup/datasink.h
+++ b/extra/mariabackup/datasink.h
@@ -63,7 +63,6 @@ static inline int dummy_remove(const char *) {
typedef enum {
DS_TYPE_STDOUT,
DS_TYPE_LOCAL,
- DS_TYPE_ARCHIVE,
DS_TYPE_XBSTREAM,
DS_TYPE_COMPRESS,
DS_TYPE_ENCRYPT,
diff --git a/extra/mariabackup/ds_archive.cc b/extra/mariabackup/ds_archive.cc
deleted file mode 100644
index 18f13fbcf3a..00000000000
--- a/extra/mariabackup/ds_archive.cc
+++ /dev/null
@@ -1,281 +0,0 @@
-/******************************************************
-Copyright (c) 2013 Percona LLC and/or its affiliates.
-
-Streaming implementation for XtraBackup.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
-
-*******************************************************/
-
-#include <my_base.h>
-#include <archive.h>
-#include <archive_entry.h>
-#include "common.h"
-#include "datasink.h"
-
-#if ARCHIVE_VERSION_NUMBER < 3000000
-#define archive_write_add_filter_none(X) archive_write_set_compression_none(X)
-#define archive_write_free(X) archive_write_finish(X)
-#endif
-
-typedef struct {
- struct archive *archive;
- ds_file_t *dest_file;
- pthread_mutex_t mutex;
-} ds_archive_ctxt_t;
-
-typedef struct {
- struct archive_entry *entry;
- ds_archive_ctxt_t *archive_ctxt;
-} ds_archive_file_t;
-
-
-/***********************************************************************
-General archive interface */
-
-static ds_ctxt_t *archive_init(const char *root);
-static ds_file_t *archive_open(ds_ctxt_t *ctxt, const char *path,
- MY_STAT *mystat);
-static int archive_write(ds_file_t *file, const void *buf, size_t len);
-static int archive_close(ds_file_t *file);
-static void archive_deinit(ds_ctxt_t *ctxt);
-
-datasink_t datasink_archive = {
- &archive_init,
- &archive_open,
- &archive_write,
- &archive_close,
- &dummy_remove,
- &archive_deinit
-};
-
-static
-int
-my_archive_open_callback(struct archive *a __attribute__((unused)),
- void *data __attribute__((unused)))
-{
- return ARCHIVE_OK;
-}
-
-static
-ssize_t
-my_archive_write_callback(struct archive *a __attribute__((unused)),
- void *data, const void *buffer, size_t length)
-{
- ds_archive_ctxt_t *archive_ctxt;
-
- archive_ctxt = (ds_archive_ctxt_t *) data;
-
- xb_ad(archive_ctxt != NULL);
- xb_ad(archive_ctxt->dest_file != NULL);
-
- if (!ds_write(archive_ctxt->dest_file, buffer, length)) {
- return length;
- }
- return -1;
-}
-
-static
-int
-my_archive_close_callback(struct archive *a __attribute__((unused)),
- void *data __attribute__((unused)))
-{
- return ARCHIVE_OK;
-}
-
-static
-ds_ctxt_t *
-archive_init(const char *root __attribute__((unused)))
-{
- ds_ctxt_t *ctxt;
- ds_archive_ctxt_t *archive_ctxt;
- struct archive *a;
-
- ctxt = my_malloc(sizeof(ds_ctxt_t) + sizeof(ds_archive_ctxt_t),
- MYF(MY_FAE));
- archive_ctxt = (ds_archive_ctxt_t *)(ctxt + 1);
-
- if (pthread_mutex_init(&archive_ctxt->mutex, NULL)) {
- msg("archive_init: pthread_mutex_init() failed.\n");
- goto err;
- }
-
- a = archive_write_new();
- if (a == NULL) {
- msg("archive_write_new() failed.\n");
- goto err;
- }
-
- archive_ctxt->archive = a;
- archive_ctxt->dest_file = NULL;
-
- if(archive_write_add_filter_none(a) != ARCHIVE_OK ||
- archive_write_set_format_pax_restricted(a) != ARCHIVE_OK ||
- /* disable internal buffering so we don't have to flush the
- output in xtrabackup */
- archive_write_set_bytes_per_block(a, 0) != ARCHIVE_OK) {
- msg("failed to set libarchive archive options: %s\n",
- archive_error_string(a));
- archive_write_free(a);
- goto err;
- }
-
- if (archive_write_open(a, archive_ctxt, my_archive_open_callback,
- my_archive_write_callback,
- my_archive_close_callback) != ARCHIVE_OK) {
- msg("cannot open output archive.\n");
- return NULL;
- }
-
- ctxt->ptr = archive_ctxt;
-
- return ctxt;
-
-err:
- my_free(ctxt);
- return NULL;
-}
-
-static
-ds_file_t *
-archive_open(ds_ctxt_t *ctxt, const char *path, MY_STAT *mystat)
-{
- ds_archive_ctxt_t *archive_ctxt;
- ds_ctxt_t *dest_ctxt;
- ds_file_t *file;
- ds_archive_file_t *archive_file;
-
- struct archive *a;
- struct archive_entry *entry;
-
- xb_ad(ctxt->pipe_ctxt != NULL);
- dest_ctxt = ctxt->pipe_ctxt;
-
- archive_ctxt = (ds_archive_ctxt_t *) ctxt->ptr;
-
- pthread_mutex_lock(&archive_ctxt->mutex);
- if (archive_ctxt->dest_file == NULL) {
- archive_ctxt->dest_file = ds_open(dest_ctxt, path, mystat);
- if (archive_ctxt->dest_file == NULL) {
- return NULL;
- }
- }
- pthread_mutex_unlock(&archive_ctxt->mutex);
-
- file = (ds_file_t *) my_malloc(sizeof(ds_file_t) +
- sizeof(ds_archive_file_t),
- MYF(MY_FAE));
-
- archive_file = (ds_archive_file_t *) (file + 1);
-
- a = archive_ctxt->archive;
-
- entry = archive_entry_new();
- if (entry == NULL) {
- msg("archive_entry_new() failed.\n");
- goto err;
- }
-
- archive_entry_set_size(entry, mystat->st_size);
- archive_entry_set_mode(entry, 0660);
- archive_entry_set_filetype(entry, AE_IFREG);
- archive_entry_set_pathname(entry, path);
- archive_entry_set_mtime(entry, mystat->st_mtime, 0);
-
- archive_file->entry = entry;
- archive_file->archive_ctxt = archive_ctxt;
-
- if (archive_write_header(a, entry) != ARCHIVE_OK) {
- msg("archive_write_header() failed.\n");
- archive_entry_free(entry);
- goto err;
- }
-
- file->ptr = archive_file;
- file->path = archive_ctxt->dest_file->path;
-
- return file;
-
-err:
- if (archive_ctxt->dest_file) {
- ds_close(archive_ctxt->dest_file);
- archive_ctxt->dest_file = NULL;
- }
- my_free(file);
-
- return NULL;
-}
-
-static
-int
-archive_write(ds_file_t *file, const void *buf, size_t len)
-{
- ds_archive_file_t *archive_file;
- struct archive *a;
-
- archive_file = (ds_archive_file_t *) file->ptr;
-
- a = archive_file->archive_ctxt->archive;
-
- xb_ad(archive_file->archive_ctxt->dest_file != NULL);
- if (archive_write_data(a, buf, len) < 0) {
- msg("archive_write_data() failed: %s (errno = %d)\n",
- archive_error_string(a), archive_errno(a));
- return 1;
- }
-
- return 0;
-}
-
-static
-int
-archive_close(ds_file_t *file)
-{
- ds_archive_file_t *archive_file;
- int rc = 0;
-
- archive_file = (ds_archive_file_t *)file->ptr;
-
- archive_entry_free(archive_file->entry);
-
- my_free(file);
-
- return rc;
-}
-
-static
-void
-archive_deinit(ds_ctxt_t *ctxt)
-{
- struct archive *a;
- ds_archive_ctxt_t *archive_ctxt;
-
- archive_ctxt = (ds_archive_ctxt_t *) ctxt->ptr;
-
- a = archive_ctxt->archive;
-
- if (archive_write_close(a) != ARCHIVE_OK) {
- msg("archive_write_close() failed.\n");
- }
- archive_write_free(a);
-
- if (archive_ctxt->dest_file) {
- ds_close(archive_ctxt->dest_file);
- archive_ctxt->dest_file = NULL;
- }
-
- pthread_mutex_destroy(&archive_ctxt->mutex);
-
- my_free(ctxt);
-}
diff --git a/extra/mariabackup/ds_archive.h b/extra/mariabackup/ds_archive.h
deleted file mode 100644
index f419fca0c9f..00000000000
--- a/extra/mariabackup/ds_archive.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/******************************************************
-Copyright (c) 2013 Percona LLC and/or its affiliates.
-
-Streaming interface for XtraBackup.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
-
-*******************************************************/
-
-#ifndef DS_ARCHIVE_H
-#define DS_ARCHIVE_H
-
-#include "datasink.h"
-
-extern datasink_t datasink_archive;
-
-#endif
diff --git a/extra/mariabackup/ds_xbstream.cc b/extra/mariabackup/ds_xbstream.cc
index 3b60456f8ed..798d7da6da4 100644
--- a/extra/mariabackup/ds_xbstream.cc
+++ b/extra/mariabackup/ds_xbstream.cc
@@ -126,15 +126,19 @@ xbstream_open(ds_ctxt_t *ctxt, const char *path, MY_STAT *mystat)
pthread_mutex_lock(&stream_ctxt->mutex);
if (stream_ctxt->dest_file == NULL) {
stream_ctxt->dest_file = ds_open(dest_ctxt, path, mystat);
- if (stream_ctxt->dest_file == NULL) {
- return NULL;
- }
}
pthread_mutex_unlock(&stream_ctxt->mutex);
+ if (stream_ctxt->dest_file == NULL) {
+ return NULL;
+ }
file = (ds_file_t *) my_malloc(sizeof(ds_file_t) +
sizeof(ds_stream_file_t),
MYF(MY_FAE));
+ if (!file) {
+ msg("my_malloc() failed.");
+ goto err;
+ }
stream_file = (ds_stream_file_t *) (file + 1);
xbstream = stream_ctxt->xbstream;
diff --git a/extra/mariabackup/innobackupex.cc b/extra/mariabackup/innobackupex.cc
index 5bc320264e4..4bbdeead0d6 100644
--- a/extra/mariabackup/innobackupex.cc
+++ b/extra/mariabackup/innobackupex.cc
@@ -41,7 +41,6 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include <my_global.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <mysql.h>
#include <my_dir.h>
@@ -215,7 +214,7 @@ ibx_mode_t ibx_mode = IBX_MODE_BACKUP;
static struct my_option ibx_long_options[] =
{
- {"version", 'v', "print xtrabackup version information",
+ {"version", 'v', "print version information",
(uchar *) &opt_ibx_version, (uchar *) &opt_ibx_version, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -258,12 +257,11 @@ static struct my_option ibx_long_options[] =
(uchar *) &opt_ibx_slave_info, (uchar *) &opt_ibx_slave_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"incremental", OPT_INCREMENTAL, "This option tells xtrabackup to "
- "create an incremental backup, rather than a full one. It is passed "
- "to the xtrabackup child process. When this option is specified, "
+ {"incremental", OPT_INCREMENTAL,
+ "Create an incremental backup, rather than a full one. When this option is specified, "
"either --incremental-lsn or --incremental-basedir can also be given. "
- "If neither option is given, option --incremental-basedir is passed "
- "to xtrabackup by default, set to the first timestamped backup "
+ "If neither option is given, option --incremental-basedir is used "
+ "by default, set to the first timestamped backup "
"directory in the backup base directory.",
(uchar *) &opt_ibx_incremental, (uchar *) &opt_ibx_incremental, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -309,7 +307,7 @@ static struct my_option ibx_long_options[] =
{"force-non-empty-directories", OPT_FORCE_NON_EMPTY_DIRS, "This "
"option, when specified, makes --copy-back or --move-back transfer "
"files to non-empty directories. Note that no existing files will be "
- "overwritten. If --copy-back or --nove-back has to copy a file from "
+ "overwritten. If --copy-back or --move-back has to copy a file from "
"the backup directory which already exists in the destination "
"directory, it will still fail with an error.",
(uchar *) &opt_ibx_force_non_empty_dirs,
@@ -378,14 +376,14 @@ static struct my_option ibx_long_options[] =
{"incremental-history-name", OPT_INCREMENTAL_HISTORY_NAME,
"This option specifies the name of the backup series stored in the "
"PERCONA_SCHEMA.xtrabackup_history history record to base an "
- "incremental backup on. Xtrabackup will search the history table "
+ "incremental backup on. Backup will search the history table "
"looking for the most recent (highest innodb_to_lsn), successful "
"backup in the series and take the to_lsn value to use as the "
"starting lsn for the incremental backup. This will be mutually "
"exclusive with --incremental-history-uuid, --incremental-basedir "
"and --incremental-lsn. If no valid lsn can be found (no series by "
- "that name, no successful backups by that name) xtrabackup will "
- "return with an error. It is used with the --incremental option.",
+ "that name, no successful backups by that name), "
+ "an error will be returned. It is used with the --incremental option.",
(uchar*) &opt_ibx_incremental_history_name,
(uchar*) &opt_ibx_incremental_history_name, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -395,8 +393,8 @@ static struct my_option ibx_long_options[] =
"stored in the PERCONA_SCHEMA.xtrabackup_history to base an "
"incremental backup on. --incremental-history-name, "
"--incremental-basedir and --incremental-lsn. If no valid lsn can be "
- "found (no success record with that uuid) xtrabackup will return "
- "with an error. It is used with the --incremental option.",
+ "found (no success record with that uuid), an error will be returned."
+ " It is used with the --incremental option.",
(uchar*) &opt_ibx_incremental_history_uuid,
(uchar*) &opt_ibx_incremental_history_uuid, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -425,7 +423,7 @@ static struct my_option ibx_long_options[] =
{"include", OPT_INCLUDE,
"This option is a regular expression to be matched against table "
"names in databasename.tablename format. It is passed directly to "
- "xtrabackup's --tables option. See the xtrabackup documentation for "
+ "--tables option. See the documentation for "
"details.",
(uchar*) &opt_ibx_include,
(uchar*) &opt_ibx_include, 0, GET_STR,
@@ -475,12 +473,6 @@ static struct my_option ibx_long_options[] =
(uchar*) &opt_ibx_lock_wait_threshold, 0, GET_UINT,
REQUIRED_ARG, 60, 0, 0, 0, 0, 0},
- {"debug-sleep-before-unlock", OPT_DEBUG_SLEEP_BEFORE_UNLOCK,
- "This is a debug-only option used by the XtraBackup test suite.",
- (uchar*) &opt_ibx_debug_sleep_before_unlock,
- (uchar*) &opt_ibx_debug_sleep_before_unlock, 0, GET_UINT,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-
{"safe-slave-backup-timeout", OPT_SAFE_SLAVE_BACKUP_TIMEOUT,
"How many seconds --safe-slave-backup should wait for "
"Slave_open_temp_tables to become zero. (default 300)",
@@ -493,22 +485,20 @@ static struct my_option ibx_long_options[] =
We put them here with only purpose for them to showup in
innobackupex --help output */
- {"close_files", OPT_CLOSE_FILES, "Do not keep files opened. This "
- "option is passed directly to xtrabackup. Use at your own risk.",
+ {"close_files", OPT_CLOSE_FILES, "Do not keep files opened."
+ " Use at your own risk.",
(uchar*) &ibx_xb_close_files, (uchar*) &ibx_xb_close_files, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"compress", OPT_COMPRESS, "This option instructs xtrabackup to "
- "compress backup copies of InnoDB data files. It is passed directly "
- "to the xtrabackup child process. Try 'xtrabackup --help' for more "
- "details.", (uchar*) &ibx_xtrabackup_compress_alg,
+ {"compress", OPT_COMPRESS, "This option instructs backup to "
+ "compress backup copies of InnoDB data files."
+ , (uchar*) &ibx_xtrabackup_compress_alg,
(uchar*) &ibx_xtrabackup_compress_alg, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"compress-threads", OPT_COMPRESS_THREADS,
"This option specifies the number of worker threads that will be used "
- "for parallel compression. It is passed directly to the xtrabackup "
- "child process. Try 'xtrabackup --help' for more details.",
+ "for parallel compression.",
(uchar*) &ibx_xtrabackup_compress_threads,
(uchar*) &ibx_xtrabackup_compress_threads,
0, GET_UINT, REQUIRED_ARG, 1, 1, UINT_MAX, 0, 0, 0},
@@ -519,17 +509,15 @@ static struct my_option ibx_long_options[] =
(uchar*) &ibx_xtrabackup_compress_chunk_size,
0, GET_ULL, REQUIRED_ARG, (1 << 16), 1024, ULONGLONG_MAX, 0, 0, 0},
- {"export", OPT_EXPORT, "This option is passed directly to xtrabackup's "
- "--export option. It enables exporting individual tables for import "
- "into another server. See the xtrabackup documentation for details.",
+ {"export", OPT_EXPORT, " enables exporting individual tables for import "
+ "into another server.",
(uchar*) &ibx_xtrabackup_export, (uchar*) &ibx_xtrabackup_export,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"extra-lsndir", OPT_EXTRA_LSNDIR, "This option specifies the "
"directory in which to save an extra copy of the "
"\"xtrabackup_checkpoints\" file. The option accepts a string "
- "argument. It is passed directly to xtrabackup's --extra-lsndir "
- "option. See the xtrabackup documentation for details.",
+ "argument.",
(uchar*) &ibx_xtrabackup_extra_lsndir,
(uchar*) &ibx_xtrabackup_extra_lsndir,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -551,7 +539,7 @@ static struct my_option ibx_long_options[] =
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"incremental-force-scan", OPT_INCREMENTAL_FORCE_SCAN,
- "This options tells xtrabackup to perform full scan of data files "
+ "Perform full scan of data files "
"for taking an incremental backup even if full changed page bitmap "
"data is available to enable the backup without the full scan.",
(uchar*)&ibx_xtrabackup_incremental_force_scan,
@@ -577,10 +565,8 @@ static struct my_option ibx_long_options[] =
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"parallel", OPT_PARALLEL, "On backup, this option specifies the "
- "number of threads the xtrabackup child process should use to back "
- "up files concurrently. The option accepts an integer argument. It "
- "is passed directly to xtrabackup's --parallel option. See the "
- "xtrabackup documentation for details.",
+ "number of threads to use to back "
+ "up files concurrently. The option accepts an integer argument.",
(uchar*) &ibx_xtrabackup_parallel, (uchar*) &ibx_xtrabackup_parallel,
0, GET_INT, REQUIRED_ARG, 1, 1, INT_MAX, 0, 0, 0},
@@ -588,23 +574,21 @@ static struct my_option ibx_long_options[] =
{"stream", OPT_STREAM, "This option specifies the format in which to "
"do the streamed backup. The option accepts a string argument. The "
"backup will be done to STDOUT in the specified format. Currently, "
- "the only supported formats are tar and mbstream/xbstream. This "
- "option is passed directly to xtrabackup's --stream option.",
+ "the only supported formats are tar and mbstream/xbstream.",
(uchar*) &ibx_xtrabackup_stream_str,
(uchar*) &ibx_xtrabackup_stream_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tables-file", OPT_TABLES_FILE, "This option specifies the file in "
"which there are a list of names of the form database. The option "
- "accepts a string argument.table, one per line. The option is passed "
- "directly to xtrabackup's --tables-file option.",
+ "accepts a string argument.table, one per line.",
(uchar*) &ibx_xtrabackup_tables_file,
(uchar*) &ibx_xtrabackup_tables_file,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"throttle", OPT_THROTTLE, "This option specifies a number of I/O "
"operations (pairs of read+write) per second. It accepts an integer "
- "argument. It is passed directly to xtrabackup's --throttle option.",
+ "argument.",
(uchar*) &ibx_xtrabackup_throttle, (uchar*) &ibx_xtrabackup_throttle,
0, GET_LONG, REQUIRED_ARG, 0, 0, LONG_MAX, 0, 1, 0},
@@ -616,11 +600,10 @@ static struct my_option ibx_long_options[] =
0, 0, 0, 0, 0, 0},
{"use-memory", OPT_USE_MEMORY, "This option accepts a string argument "
- "that specifies the amount of memory in bytes for xtrabackup to use "
+ "that specifies the amount of memory in bytes to use "
"for crash recovery while preparing a backup. Multiples are supported "
"providing the unit (e.g. 1MB, 1GB). It is used only with the option "
- "--apply-log. It is passed directly to xtrabackup's --use-memory "
- "option. See the xtrabackup documentation for details.",
+ "--apply-log.",
(uchar*) &ibx_xtrabackup_use_memory,
(uchar*) &ibx_xtrabackup_use_memory,
0, GET_LL, REQUIRED_ARG, 100*1024*1024L, 1024*1024L, LONGLONG_MAX, 0,
@@ -642,7 +625,7 @@ static struct my_option ibx_long_options[] =
static void usage(void)
{
- puts("Open source backup tool for InnoDB and XtraDB\n\
+ puts("Open source backup tool\n\
\n\
Copyright (C) 2009-2015 Percona LLC and/or its affiliates.\n\
Portions Copyright (C) 2000, 2011, MySQL AB & Innobase Oy. All Rights Reserved.\n\
@@ -693,7 +676,7 @@ innobackupex [--decompress]\n\
\n\
DESCRIPTION\n\
\n\
-The first command line above makes a hot backup of a MySQL database.\n\
+The first command line above makes a hot backup of a database.\n\
By default it creates a backup directory (named by the current date\n\
and time) in the given backup root directory. With the --no-timestamp\n\
option it does not create a time-stamped backup directory, but it puts\n\
@@ -703,22 +686,18 @@ indexes in all databases or in all of the databases specified with the\n\
--databases option. The created backup contains .frm, .MRG, .MYD,\n\
.MYI, .MAD, .MAI, .TRG, .TRN, .ARM, .ARZ, .CSM, CSV, .opt, .par, and\n\
InnoDB data and log files. The MY.CNF options file defines the\n\
-location of the database. This command connects to the MySQL server\n\
-using the mysql client program, and runs xtrabackup as a child\n\
-process.\n\
+location of the database.\n\
\n\
The --apply-log command prepares a backup for starting a MySQL\n\
server on the backup. This command recovers InnoDB data files as specified\n\
in BACKUP-DIR/backup-my.cnf using BACKUP-DIR/ib_logfile0,\n\
and creates new InnoDB log files as specified in BACKUP-DIR/backup-my.cnf.\n\
-The BACKUP-DIR should be the path to a backup directory created by\n\
-xtrabackup. This command runs xtrabackup as a child process, but it does not \n\
-connect to the database server.\n\
+The BACKUP-DIR should be the path to a backup directory\n\
\n\
The --copy-back command copies data, index, and log files\n\
from the backup directory back to their original locations.\n\
The MY.CNF options file defines the original location of the database.\n\
-The BACKUP-DIR is the path to a backup directory created by xtrabackup.\n\
+The BACKUP-DIR is the path to a backup directory.\n\
\n\
The --move-back command is similar to --copy-back with the only difference that\n\
it moves files to their original locations rather than copies them. As this\n\
@@ -905,12 +884,6 @@ ibx_init()
opt_user = opt_ibx_user;
opt_password = opt_ibx_password;
-#if !defined(DONT_USE_MYSQL_PWD)
- if (!opt_password)
- {
- opt_password=getenv("MYSQL_PWD");
- }
-#endif
opt_host = opt_ibx_host;
opt_defaults_group = opt_ibx_defaults_group;
opt_socket = opt_ibx_socket;
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 59551a7d044..12cfdb6c284 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -267,8 +267,6 @@ it every INNOBASE_WAKE_INTERVAL'th step. */
ulong innobase_active_counter = 0;
-static char *xtrabackup_debug_sync = NULL;
-
my_bool xtrabackup_incremental_force_scan = FALSE;
/*
@@ -1059,7 +1057,7 @@ enum options_xtrabackup
struct my_option xb_client_options[]= {
{"verbose", 'V', "display verbose output", (G_PTR *) &verbose,
(G_PTR *) &verbose, 0, GET_BOOL, NO_ARG, FALSE, 0, 0, 0, 0, 0},
- {"version", 'v', "print xtrabackup version information",
+ {"version", 'v', "print version information",
(G_PTR *) &xtrabackup_version, (G_PTR *) &xtrabackup_version, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"target-dir", OPT_XTRA_TARGET_DIR, "destination directory",
@@ -1283,7 +1281,7 @@ struct my_option xb_client_options[]= {
"This "
"option, when specified, makes --copy-back or --move-back transfer "
"files to non-empty directories. Note that no existing files will be "
- "overwritten. If --copy-back or --nove-back has to copy a file from "
+ "overwritten. If --copy-back or --move-back has to copy a file from "
"the backup directory which already exists in the destination "
"directory, it will still fail with an error.",
(uchar *) &opt_force_non_empty_dirs, (uchar *) &opt_force_non_empty_dirs,
@@ -1356,8 +1354,8 @@ struct my_option xb_client_options[]= {
"starting lsn for the incremental backup. This will be mutually "
"exclusive with --incremental-history-uuid, --incremental-basedir "
"and --incremental-lsn. If no valid lsn can be found (no series by "
- "that name, no successful backups by that name) xtrabackup will "
- "return with an error. It is used with the --incremental option.",
+ "that name, no successful backups by that name), an error will be returned."
+ " It is used with the --incremental option.",
(uchar *) &opt_incremental_history_name,
(uchar *) &opt_incremental_history_name, 0, GET_STR, REQUIRED_ARG, 0, 0,
0, 0, 0, 0},
@@ -1367,8 +1365,8 @@ struct my_option xb_client_options[]= {
"stored in the PERCONA_SCHEMA.xtrabackup_history to base an "
"incremental backup on. --incremental-history-name, "
"--incremental-basedir and --incremental-lsn. If no valid lsn can be "
- "found (no success record with that uuid) xtrabackup will return "
- "with an error. It is used with the --incremental option.",
+ "found (no success record with that uuid), an error will be returned."
+ " It is used with the --incremental option.",
(uchar *) &opt_incremental_history_uuid,
(uchar *) &opt_incremental_history_uuid, 0, GET_STR, REQUIRED_ARG, 0, 0,
0, 0, 0, 0},
@@ -1425,11 +1423,6 @@ struct my_option xb_client_options[]= {
(uchar *) &opt_lock_wait_threshold, (uchar *) &opt_lock_wait_threshold, 0,
GET_UINT, REQUIRED_ARG, 60, 0, 0, 0, 0, 0},
- {"debug-sleep-before-unlock", OPT_DEBUG_SLEEP_BEFORE_UNLOCK,
- "This is a debug-only option used by the XtraBackup test suite.",
- (uchar *) &opt_debug_sleep_before_unlock,
- (uchar *) &opt_debug_sleep_before_unlock, 0, GET_UINT, REQUIRED_ARG, 0, 0,
- 0, 0, 0, 0},
{"safe-slave-backup-timeout", OPT_SAFE_SLAVE_BACKUP_TIMEOUT,
"How many seconds --safe-slave-backup should wait for "
@@ -1439,9 +1432,9 @@ struct my_option xb_client_options[]= {
0, 0, 0, 0, 0},
{"binlog-info", OPT_BINLOG_INFO,
- "This option controls how XtraBackup should retrieve server's binary log "
+ "This option controls how backup should retrieve server's binary log "
"coordinates corresponding to the backup. Possible values are OFF, ON, "
- "LOCKLESS and AUTO. See the XtraBackup manual for more information",
+ "LOCKLESS and AUTO.",
&opt_binlog_info, &opt_binlog_info, &binlog_info_typelib, GET_ENUM,
OPT_ARG, BINLOG_INFO_AUTO, 0, 0, 0, 0, 0},
@@ -1615,13 +1608,6 @@ struct my_option xb_server_options[] =
&dbug_option, &dbug_option, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
#endif
-#ifndef __WIN__
- {"debug-sync", OPT_XTRA_DEBUG_SYNC,
- "Debug sync point. This is only used by the xtrabackup test suite",
- (G_PTR*) &xtrabackup_debug_sync,
- (G_PTR*) &xtrabackup_debug_sync,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#endif
{"innodb_checksum_algorithm", OPT_INNODB_CHECKSUM_ALGORITHM,
"The algorithm InnoDB uses for page checksumming. [CRC32, STRICT_CRC32, "
@@ -1665,7 +1651,7 @@ struct my_option xb_server_options[] =
REQUIRED_ARG, 0, 0, UINT_MAX, 0, 1, 0},
{"lock-ddl-per-table", OPT_LOCK_DDL_PER_TABLE, "Lock DDL for each table "
- "before xtrabackup starts to copy it and until the backup is completed.",
+ "before backup starts to copy it and until the backup is completed.",
(uchar*) &opt_lock_ddl_per_table, (uchar*) &opt_lock_ddl_per_table, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -1696,60 +1682,6 @@ struct my_option xb_server_options[] =
uint xb_server_options_count = array_elements(xb_server_options);
-#ifndef __WIN__
-static int debug_sync_resumed;
-
-static void sigcont_handler(int sig);
-
-static void sigcont_handler(int sig __attribute__((unused)))
-{
- debug_sync_resumed= 1;
-}
-#endif
-
-static inline
-void
-debug_sync_point(const char *name)
-{
-#ifndef __WIN__
- FILE *fp;
- pid_t pid;
- char pid_path[FN_REFLEN];
-
- if (xtrabackup_debug_sync == NULL) {
- return;
- }
-
- if (strcmp(xtrabackup_debug_sync, name)) {
- return;
- }
-
- pid = getpid();
-
- snprintf(pid_path, sizeof(pid_path), "%s/xtrabackup_debug_sync",
- xtrabackup_target_dir);
- fp = fopen(pid_path, "w");
- if (fp == NULL) {
- die("Can't open open %s", pid_path);
- }
- fprintf(fp, "%u\n", (uint) pid);
- fclose(fp);
-
- msg("mariabackup: DEBUG: Suspending at debug sync point '%s'. "
- "Resume with 'kill -SIGCONT %u'.", name, (uint) pid);
-
- debug_sync_resumed= 0;
- kill(pid, SIGSTOP);
- while (!debug_sync_resumed) {
- sleep(1);
- }
-
- /* On resume */
- msg("mariabackup: DEBUG: removing the pid file.");
- my_delete(pid_path, MYF(MY_WME));
-#endif
-}
-
static std::set<std::string> tables_for_export;
@@ -1815,33 +1747,33 @@ static int prepare_export()
// Process defaults-file , it can have some --lc-language stuff,
// which is* unfortunately* still necessary to get mysqld up
- if (strncmp(orig_argv1,"--defaults-file=",16) == 0)
+ if (strncmp(orig_argv1,"--defaults-file=", 16) == 0)
{
snprintf(cmdline, sizeof cmdline,
- IF_WIN("\"","") "\"%s\" --mysqld \"%s\" "
+ IF_WIN("\"","") "\"%s\" --mysqld \"%s\""
" --defaults-extra-file=./backup-my.cnf --defaults-group-suffix=%s --datadir=."
" --innodb --innodb-fast-shutdown=0 --loose-partition"
" --innodb_purge_rseg_truncate_frequency=1 --innodb-buffer-pool-size=%llu"
- " --console --skip-log-error --skip-log-bin --bootstrap %s < "
+ " --console --skip-log-error --skip-log-bin --bootstrap %s< "
BOOTSTRAP_FILENAME IF_WIN("\"",""),
mariabackup_exe,
orig_argv1, (my_defaults_group_suffix?my_defaults_group_suffix:""),
xtrabackup_use_memory,
- (srv_force_recovery ? "--innodb-force-recovery=1" : ""));
+ (srv_force_recovery ? "--innodb-force-recovery=1 " : ""));
}
else
{
snprintf(cmdline, sizeof cmdline,
- IF_WIN("\"","") "\"%s\" --mysqld"
+ IF_WIN("\"","") "\"%s\" --mysqld"
" --defaults-file=./backup-my.cnf --defaults-group-suffix=%s --datadir=."
" --innodb --innodb-fast-shutdown=0 --loose-partition"
" --innodb_purge_rseg_truncate_frequency=1 --innodb-buffer-pool-size=%llu"
- " --console --log-error= --skip-log-bin --bootstrap %s < "
+ " --console --log-error= --skip-log-bin --bootstrap %s< "
BOOTSTRAP_FILENAME IF_WIN("\"",""),
mariabackup_exe,
(my_defaults_group_suffix?my_defaults_group_suffix:""),
xtrabackup_use_memory,
- (srv_force_recovery ? "--innodb-force-recovery=1" : ""));
+ (srv_force_recovery ? "--innodb-force-recovery=1 " : ""));
}
msg("Prepare export : executing %s\n", cmdline);
@@ -3109,8 +3041,6 @@ static bool xtrabackup_copy_logfile(bool last = false)
log_copy_scanned_lsn = start_lsn;
pthread_cond_broadcast(&scanned_lsn_cond);
pthread_mutex_unlock(&backup_mutex);
-
- debug_sync_point("xtrabackup_copy_logfile_pause");
return(false);
}
@@ -3242,8 +3172,6 @@ data_copy_thread_func(
*/
my_thread_init();
- debug_sync_point("data_copy_thread_func");
-
while ((node = datafiles_iter_next(ctxt->it)) != NULL) {
DBUG_MARIABACKUP_EVENT("before_copy", node->space->name);
DBUG_EXECUTE_FOR_KEY("wait_innodb_redo_before_copy", node->space->name,
@@ -3477,7 +3405,7 @@ static void xb_load_single_table_tablespace(const char *dirname,
delete file;
if (err != DB_SUCCESS && xtrabackup_backup && !is_empty_file) {
- die("Failed to not validate first page of the file %s, error %d",name, (int)err);
+ die("Failed to validate first page of the file %s, error %d",name, (int)err);
}
ut_free(name);
@@ -3774,8 +3702,6 @@ xb_load_tablespaces()
if (err != DB_SUCCESS) {
return(err);
}
-
- debug_sync_point("xtrabackup_load_tablespaces_pause");
DBUG_MARIABACKUP_EVENT("after_load_tablespaces", 0);
return(DB_SUCCESS);
}
@@ -4660,8 +4586,6 @@ fail_before_log_copying_thread_start:
if (!flush_changed_page_bitmaps()) {
goto fail;
}
- debug_sync_point("xtrabackup_suspend_at_start");
-
ut_a(xtrabackup_parallel > 0);
@@ -6622,6 +6546,8 @@ int main(int argc, char **argv)
{
char **client_defaults, **server_defaults;
+ my_getopt_prefix_matching= 0;
+
if (get_exepath(mariabackup_exe,FN_REFLEN, argv[0]))
strncpy(mariabackup_exe,argv[0], FN_REFLEN-1);
@@ -6879,12 +6805,6 @@ static int main_low(char** argv)
}
}
-#ifndef __WIN__
- if (xtrabackup_debug_sync) {
- signal(SIGCONT, sigcont_handler);
- }
-#endif
-
/* --backup */
if (xtrabackup_backup && !xtrabackup_backup_func()) {
return(EXIT_FAILURE);
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index 5992af3bb78..d75c3f51319 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -116,7 +116,7 @@ static void usage()
{
version();
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
- puts("Prints all arguments that is give to some program using the default files");
+ puts("Displays the options from option groups of option files, which is useful to see which options a particular tool will use");
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
my_print_help(my_long_options);
my_print_default_files(config_file);
diff --git a/include/ft_global.h b/include/ft_global.h
index 725363c3aa8..9f2d52610ba 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -90,7 +90,8 @@ void ft_free_stopwords(void);
FT_INFO *ft_init_search(uint,void *, uint, uchar *, size_t,
CHARSET_INFO *, uchar *);
-my_bool ft_boolean_check_syntax_string(const uchar *);
+my_bool ft_boolean_check_syntax_string(const uchar *, size_t length,
+ CHARSET_INFO *cs);
/* Internal symbols for fulltext between maria and MyISAM */
diff --git a/include/my_context.h b/include/my_context.h
index ea0e3496887..45d2a7d7ffa 100644
--- a/include/my_context.h
+++ b/include/my_context.h
@@ -52,6 +52,9 @@ struct my_context {
#ifdef MY_CONTEXT_USE_UCONTEXT
+#if defined(__APPLE__) && !defined(_XOPEN_SOURCE)
+#define _XOPEN_SOURCE
+#endif
#include <ucontext.h>
struct my_context {
diff --git a/include/my_global.h b/include/my_global.h
index 5e96400eac1..dba63e75097 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -164,7 +164,7 @@
# if defined(__i386__) || defined(__ppc__)
# define SIZEOF_CHARP 4
# define SIZEOF_LONG 4
-# elif defined(__x86_64__) || defined(__ppc64__)
+# elif defined(__x86_64__) || defined(__ppc64__) || defined(__aarch64__)
# define SIZEOF_CHARP 8
# define SIZEOF_LONG 8
# else
diff --git a/include/my_pthread.h b/include/my_pthread.h
index f369b765edd..be336b00a35 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -289,16 +289,18 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif
-#if !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
-/* no pthread_yield() available */
#ifdef HAVE_SCHED_YIELD
#define pthread_yield() sched_yield()
-#elif defined(HAVE_PTHREAD_YIELD_NP) /* can be Mac OS X */
+#else
+#if !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
+/* no pthread_yield() available */
+#if defined(HAVE_PTHREAD_YIELD_NP) /* can be Mac OS X */
#define pthread_yield() pthread_yield_np()
#elif defined(HAVE_THR_YIELD)
#define pthread_yield() thr_yield()
-#endif
-#endif
+#endif //defined(HAVE_PTHREAD_YIELD_NP)
+#endif //!defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
+#endif //HAVE_SCHED_YIELD
/*
The defines set_timespec and set_timespec_nsec should be used
diff --git a/include/my_sys.h b/include/my_sys.h
index ac1730eeaff..1d2fff0e476 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2010, 2017, MariaDB Corporation.
+ Copyright (c) 2010, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -279,7 +279,8 @@ extern int my_umask_dir,
extern my_bool my_use_symdir;
extern ulong my_default_record_cache_size;
-extern my_bool my_disable_locking, my_disable_async_io,
+extern MYSQL_PLUGIN_IMPORT my_bool my_disable_locking;
+extern my_bool my_disable_async_io,
my_disable_flush_key_blocks, my_disable_symlinks;
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
extern char wild_many,wild_one,wild_prefix;
diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h
index 3f7b04b0841..4fa9c3842a8 100644
--- a/include/mysql/psi/psi.h
+++ b/include/mysql/psi/psi.h
@@ -1134,7 +1134,7 @@ typedef void (*register_socket_v1_t)
@return an instrumented mutex
*/
typedef struct PSI_mutex* (*init_mutex_v1_t)
- (PSI_mutex_key key, const void *identity);
+ (PSI_mutex_key key, void *identity);
/**
Mutex instrumentation destruction API.
@@ -1149,7 +1149,7 @@ typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex);
@return an instrumented rwlock
*/
typedef struct PSI_rwlock* (*init_rwlock_v1_t)
- (PSI_rwlock_key key, const void *identity);
+ (PSI_rwlock_key key, void *identity);
/**
Rwlock instrumentation destruction API.
@@ -1164,7 +1164,7 @@ typedef void (*destroy_rwlock_v1_t)(struct PSI_rwlock *rwlock);
@return an instrumented cond
*/
typedef struct PSI_cond* (*init_cond_v1_t)
- (PSI_cond_key key, const void *identity);
+ (PSI_cond_key key, void *identity);
/**
Cond instrumentation destruction API.
diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp
index 17ac0271da2..162c5bcccd1 100644
--- a/include/mysql/psi/psi_abi_v1.h.pp
+++ b/include/mysql/psi/psi_abi_v1.h.pp
@@ -300,13 +300,13 @@ typedef void (*register_statement_v1_t)
typedef void (*register_socket_v1_t)
(const char *category, struct PSI_socket_info_v1 *info, int count);
typedef struct PSI_mutex* (*init_mutex_v1_t)
- (PSI_mutex_key key, const void *identity);
+ (PSI_mutex_key key, void *identity);
typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex);
typedef struct PSI_rwlock* (*init_rwlock_v1_t)
- (PSI_rwlock_key key, const void *identity);
+ (PSI_rwlock_key key, void *identity);
typedef void (*destroy_rwlock_v1_t)(struct PSI_rwlock *rwlock);
typedef struct PSI_cond* (*init_cond_v1_t)
- (PSI_cond_key key, const void *identity);
+ (PSI_cond_key key, void *identity);
typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond);
typedef struct PSI_socket* (*init_socket_v1_t)
(PSI_socket_key key, const my_socket *fd,
diff --git a/libmariadb b/libmariadb
-Subproject fc431a035a21ac1d4ef25d9d3cd8c4d7e64a8ee
+Subproject 735a7299dbae19cc2b82b9697becaf90e9b4304
diff --git a/man/mysql.1 b/man/mysql.1
index 56e753160ce..6c05bbab311 100644
--- a/man/mysql.1
+++ b/man/mysql.1
@@ -206,7 +206,14 @@ option\&.
.\" binary-mode option: mysql
\fB\-\-binary\-mode\fR
.sp
-By default, ASCII '\e0' is disallowed and '\er\en' is translated to '\en'\&. This switch turns off both features, and also turns off parsing of all client commands except \eC and DELIMITER, in non-interactive mode (for input piped to mysql or loaded using the 'source' command)\&. This is necessary when processing output from mysqlbinlog that may contain blobs\&.
+Binary mode allows certain character sequences to be processed as data that
+would otherwise be treated with a special meaning by the parser\&.
+Specifically, this switch turns off parsing of all client commands except \eC
+and DELIMITER in non-interactive mode (i\&.e\&., when binary mode is combined
+with either 1) piped input, 2) the --batch mysql option, or 3) the 'source'
+command)\&. Also, in binary mode, occurrences of '\er\en' and ASCII '\e0' are
+preserved within strings, whereas by default, '\er\en' is translated to '\en'
+and '\e0' is disallowed in user input\&.
.RE
.sp
.RS 4
diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1
index 10ae7302247..22e32bd1628 100644
--- a/man/mysqlbinlog.1
+++ b/man/mysqlbinlog.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLBINLOG\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLBINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -1091,6 +1091,23 @@ This option is useful for point\-in\-time recovery\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlbinlog: table option
+.\" table option: mysqlbinlog
+\fB\-\-table\fR,
+\fB\-T\fR
+.sp
+List entries for just this table (local log only)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+
.\" mysqlbinlog: to-last-log option
.\" to-last-log option: mysqlbinlog
\fB\-\-to\-last\-log\fR,
@@ -2107,7 +2124,7 @@ option can be used to prevent this header from being written\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2021 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
diff --git a/man/mysqldump.1 b/man/mysqldump.1
index 2cfe308836a..907eeda4d38 100644
--- a/man/mysqldump.1
+++ b/man/mysqldump.1
@@ -2261,7 +2261,7 @@ servers \- remote (federated) servers as \fBCREATE SERVER\fR\&.
.sp -1
.IP \(bu 2.3
.\}
-stats \- statistics tables, InnoDB and Engine Independent Table Statistics (EITS), are dumped as \fBREPLACE INTO\fR (or \fBINSERT IGNORE\fR if \fB\-\-insert\-into\fR is specified) statements without (re)creating tables\&.
+stats \- statistics tables, InnoDB and Engine Independent Table Statistics (EITS), are dumped as \fBREPLACE INTO\fR (or \fBINSERT IGNORE\fR if \fB\-\-insert\-ignore\fR is specified) statements without (re)creating tables\&.
.RE
.RS 4
.ie n \{\
@@ -2271,17 +2271,17 @@ stats \- statistics tables, InnoDB and Engine Independent Table Statistics (EITS
.sp -1
.IP \(bu 2.3
.\}
-timezones \- timezone related system tables dumped as \fBREPLACE INTO\fR (or \fBINSERT IGNORE\fR if \fB\-\-insert\-into\fR is specified) statements without (re)creating tables\&.
+timezones \- timezone related system tables dumped as \fBREPLACE INTO\fR (or \fBINSERT IGNORE\fR if \fB\-\-insert\-ignore\fR is specified) statements without (re)creating tables\&.
.RE
.sp
-The format of the output is affected by \fB\-\-replace\fR and \fB\-\-insert\-into\fR\&. The \fB\-\-replace\fR option will output \fBCREATE OR REPLACE\fR
+The format of the output is affected by \fB\-\-replace\fR and \fB\-\-insert\-ignore\fR\&. The \fB\-\-replace\fR option will output \fBCREATE OR REPLACE\fR
forms of SQL, and also \fBDROP IF EXISTS\fR prior to \fBCREATE\fR, if a \fBCREATE OR REPLACE\fR option isn't available.
.sp
With \fB\-\-system=user\fR (or \fBall\fR), and \fB\-\-replace\fR, SQL is generated to generate an error if attempting to import the dump with a connection user that is being replaced within the dump\&.
.sp
-The \fB\-\-insert\-into\fR option will cause \fBCREATE IF NOT EXIST\fR forms of SQL to generated if available.
+The \fB\-\-insert\-ignore\fR option will cause \fBCREATE IF NOT EXIST\fR forms of SQL to generated if available.
.sp
-For stats, and timezones, \fB\-\-replace\fR and \fB\-\-insert\-into\fR have the usual effects.
+For stats, and timezones, \fB\-\-replace\fR and \fB\-\-insert\-ignore\fR have the usual effects.
.sp
Enabling specific options here will cause the relevant tables in the mysql database to be ignored when dumping the mysql database or \fB\-\-all\-databases\fR\&.
.sp
diff --git a/mysql-test/collections/smoke_test b/mysql-test/collections/smoke_test
new file mode 100644
index 00000000000..83b8f4771e0
--- /dev/null
+++ b/mysql-test/collections/smoke_test
@@ -0,0 +1,138 @@
+archive.archive
+archive.archive_gis
+archive.partition_archive
+binlog.binlog_base64_flag
+binlog.binlog_database
+binlog.binlog_innodb
+binlog.binlog_parallel_replication_marks_stm_mix
+binlog.binlog_row_mix_innodb_myisam
+binlog.flashback
+binlog_encryption.encrypted_slave
+connect.bin
+connect.bson
+connect.dbf
+connect.dir
+connect.endian
+connect.general
+connect.json
+connect.mysql
+connect.secure_file_priv
+connect.tbl
+csv.csv
+disks.disks
+encryption.encryption_force
+encryption.innodb_encryption_tables
+encryption.tempfiles_encrypted
+federated.federated
+federated.federatedx
+gcol.gcol_select_innodb
+handler.interface
+heap.heap
+innodb.innodb
+innodb.autoinc_persist
+innodb.innodb_defrag_binlog
+innodb.innodb_mysql
+innodb.monitor
+innodb.purge
+innodb.table_flags
+innodb.xa_recovery
+innodb_fts.fulltext
+innodb_gis.geometry
+innodb_gis.rtree
+innodb_zip.innodb-zip
+innodb_zip.page_size
+json.json_no_table
+main.blackhole
+main.bootstrap
+main.compress
+main.connect
+main.ctype_collate
+main.ctype_utf8
+main.default
+main.dyncol
+main.fulltext
+main.function_defaults
+main.gis
+main.grant
+main.handlersocket
+main.information_schema
+main.innodb_ext_key
+main.log_tables
+main.lowercase_fs_off
+main.myisam
+main.mysql_client_test
+main.mysql_protocols
+main.mysql_upgrade
+main.mysqladmin
+main.mysqlbinlog
+main.mysqlcheck
+main.mysqld--defaults-file
+main.mysqldump
+main.mysqlhotcopy_myisam
+main.mysqlshow
+main.mysqlslap
+main.mysqltest
+main.parser
+main.partition
+main.perror
+main.plugin
+main.plugin_auth
+main.pool_of_threads
+main.ps
+main.repair
+main.shutdown
+main.sp
+main.ssl
+main.ssl_compress
+main.stat_tables
+main.statistics
+main.subselect
+main.symlink
+main.temp_table
+main.timezone
+main.type_timestamp_hires
+main.user_var
+main.userstat
+main.variables
+main.view
+main.win
+main.xa
+maria.maria
+mariabackup.full_backup
+metadata_lock_info.table_metadata_lock
+mroonga/storage.variable_version
+mroonga/wrapper.count_star
+multi_source.multisource
+oqgraph.general-innodb
+parts.rpl_partition
+perfschema.selects
+plugins.auth_ed25519
+plugins.cracklib_password_check
+plugins.dialog
+plugins.fulltext_plugin
+plugins.locales
+plugins.pam_cleartext
+plugins.processlist
+plugins.qc_info
+plugins.server_audit
+plugins.simple_password_check
+plugins.sql_error_log
+plugins.two_password_validations
+plugins.unix_socket
+query_response_time.basic
+rocksdb.rocksdb
+roles.definer
+rpl.rpl_gtid_basic
+rpl.rpl_relayrotate
+rpl.rpl_row_blob_innodb
+rpl.rpl_semi_sync_event
+rpl.rpl_sp
+rpl.rpl_stm_binlog_max_cache_size
+rpl.rpl_switch_stm_row_mixed
+sequence.simple
+spider.basic_sql
+spider.ha
+sql_discovery.simple
+sys_vars.sysvars_aria
+sys_vars.sysvars_server_notembedded
+wsrep.variables
diff --git a/mysql-test/dgcov.pl b/mysql-test/dgcov.pl
index fbc5540e697..2c00c64d1ff 100755
--- a/mysql-test/dgcov.pl
+++ b/mysql-test/dgcov.pl
@@ -155,32 +155,34 @@ END
sub gcov_one_file {
return unless /\.gcda$/;
unless ($opt_skip_gcov) {
- $cmd= "gcov -i '$_' 2>/dev/null >/dev/null";
+ $cmd= "gcov -il '$_' 2>/dev/null >/dev/null";
print STDERR ++$file_no,"\r" if not $opt_verbose and -t STDERR;
logv "Running: $cmd";
system($cmd)==0 or die "system($cmd): $? $!";
}
# now, read the generated file
- open FH, '<', "$_.gcov" or die "open(<$_.gcov): $!";
- my $fname;
- while (<FH>) {
- chomp;
- if (/^function:/) {
- next;
- }
- if (/^file:/) {
- $fname=realpath($');
- next;
- }
- next if /^lcount:\d+,-\d+/; # whatever that means
- unless (/^lcount:(\d+),(\d+)/ and $fname) {
- warn "unknown line '$_' after running '$cmd'";
- next;
+ for my $gcov_file (<$_*.gcov>) {
+ open FH, '<', "$gcov_file" or die "open(<$gcov_file): $!";
+ my $fname;
+ while (<FH>) {
+ chomp;
+ if (/^function:/) {
+ next;
+ }
+ if (/^file:/) {
+ $fname=realpath(-f $' ? $' : $root.$');
+ next;
+ }
+ next if /^lcount:\d+,-\d+/; # whatever that means
+ unless (/^lcount:(\d+),(\d+)/ and $fname) {
+ warn "unknown line '$_' in $gcov_file";
+ next;
+ }
+ $cov{$fname}->{$1}+=$2;
}
- $cov{$fname}->{$1}+=$2;
+ close(FH);
}
- close(FH);
}
sub write_coverage {
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index 8fe710e2ac7..f982b87aae7 100644
--- a/mysql-test/extra/binlog_tests/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -408,4 +408,22 @@ SHOW SESSION VARIABLES LIKE "unique_checks";
DROP TABLE t1;
disconnect fresh;
+connection default;
+--echo #
+--echo # MDEV-25595 DROP part of failed CREATE OR REPLACE is not written into binary log
+--echo #
+reset master;
+--error ER_DUP_FIELDNAME
+create table t as select 1 as b, 2 as b;
+create table t (old_table_field int);
+--error ER_DUP_FIELDNAME
+create or replace table t as select 1 as b, 2 as b;
+--error ER_DUP_FIELDNAME
+create or replace temporary table t as select 1 as b, 2 as b;
+create table t (new_table_field int);
+
+--source include/show_binlog_events.inc
+
+# cleanup
+drop table t;
diff --git a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
index 11646f28bfe..0e9d49f6663 100644
--- a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
+++ b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
@@ -54,7 +54,7 @@ SELECT * FROM t1;
DROP TABLE t1;
FLUSH LOGS;
let $MYSQLD_DATADIR= `select @@datadir`;
---replace_regex /TIMESTAMP=[0-9]*/TIMESTAMP=XXX/ /# at [0-9]*/# at #/ /(exec_time=|end_log_pos |Xid = |thread_id=|server id |table id |mapped to number )[0-9]+/\1#/ /server v [^ ]*/server v #.##.##/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Gtid list [[][0-9]+-[0-9]+-[0-9]+[\]]/Gtid list [#-#-#]/ /session[.](gtid_domain_id|server_id|gtid_seq_no)=[0-9]+/session.\1=#/ /(^#|created )[0-9]{6} [ 1][0-9]:[0-9]{2}:[0-9]{2}/\1YYMMDD HH:MM:SS/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+--replace_regex /TIMESTAMP=[0-9]*/TIMESTAMP=XXX/ /# at [0-9]*/# at #/ /(exec_time=|end_log_pos |Xid = |thread_id=|server id |table id |mapped to number )[0-9]+/\1#/ /server v [^ ]*/server v #.##.##/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ /Gtid list [[][0-9]+-[0-9]+-[0-9]+[\]]/Gtid list [#-#-#]/ /session[.](gtid_domain_id|server_id|gtid_seq_no)=[0-9]+/session.\1=#/ /(^#|created )[0-9]{6} [ 12][0-9]:[0-9]{2}:[0-9]{2}/\1YYMMDD HH:MM:SS/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
--exec $MYSQL_BINLOG --base64-output=decode-rows -vv $MYSQLD_DATADIR/master-bin.000003
SET TIMESTAMP=DEFAULT;
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index a28d3e5f3d1..1844a5320f7 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -770,7 +770,7 @@ call p_verify_status_increment(2, 0, 2, 0);
commit;
call p_verify_status_increment(0, 0, 0, 0);
check table t1, t2, t3;
-call p_verify_status_increment(6, 0, 6, 0);
+call p_verify_status_increment(4, 0, 4, 0);
commit;
call p_verify_status_increment(0, 0, 0, 0);
drop view v1;
diff --git a/mysql-test/lib/My/Debugger.pm b/mysql-test/lib/My/Debugger.pm
index 7331238e1c8..cc151b233d5 100644
--- a/mysql-test/lib/My/Debugger.pm
+++ b/mysql-test/lib/My/Debugger.pm
@@ -139,7 +139,7 @@ sub do_args($$$$$) {
my $v = $debuggers{$k};
# on windows mtr args are quoted (for system), otherwise not (for exec)
- sub quote($) { $_[0] =~ / / ? "\"$_[0]\"" : $_[0] }
+ sub quote($) { $_[0] =~ /[; ]/ ? "\"$_[0]\"" : $_[0] }
sub unquote($) { $_[0] =~ s/^"(.*)"$/$1/; $_[0] }
sub quote_from_mtr($) { IS_WINDOWS() ? $_[0] : quote($_[0]) }
sub unquote_for_mtr($) { IS_WINDOWS() ? $_[0] : unquote($_[0]) }
@@ -147,7 +147,7 @@ sub do_args($$$$$) {
my %vars = (
vardir => $::opt_vardir,
exe => $$exe,
- args => join(' ', map { quote_from_mtr $_ } @$$args, '--gdb'),
+ args => join(' ', map { quote_from_mtr $_ } @$$args, '--loose-gdb'),
input => $input,
script => "$::opt_vardir/tmp/${k}init.$type",
log => "$::opt_vardir/log/$type.$k",
@@ -158,7 +158,7 @@ sub do_args($$$$$) {
my $script = join "\n", @params;
if ($v->{script}) {
- ::mtr_tofile($vars{script}, subst($v->{script}, %vars)."\n".$script);
+ ::mtr_tonewfile($vars{script}, subst($v->{script}, %vars)."\n".$script);
} elsif ($script) {
die "$k is not using a script file, nowhere to write the script \n---\n$script\n---\n";
}
diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm
index b5a07ac8632..b8c13752212 100644
--- a/mysql-test/lib/My/Find.pm
+++ b/mysql-test/lib/My/Find.pm
@@ -159,7 +159,7 @@ sub my_build_path_list {
# User can select to look in a special build dir
# which is a subdirectory of any of the paths
my @extra_dirs;
- my $build_dir= $::opt_vs_config || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
+ my $build_dir= $::multiconfig || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
push(@extra_dirs, $build_dir) if defined $build_dir;
if (defined $extension){
diff --git a/mysql-test/lib/My/Options.pm b/mysql-test/lib/My/Options.pm
index 6e0efe862e7..5827e0666a6 100644
--- a/mysql-test/lib/My/Options.pm
+++ b/mysql-test/lib/My/Options.pm
@@ -140,24 +140,16 @@ sub diff {
}
-sub is_set {
- my ($opts, $set_opts)= @_;
+sub is_subset {
+ my ($set, $subset)= @_;
+ my %cache = map { _split_option($_) } @$set;
- foreach my $opt (@$opts){
-
- my ($opt_name1, $value1)= _split_option($opt);
-
- foreach my $set_opt (@$set_opts){
- my ($opt_name2, $value2)= _split_option($set_opt);
-
- if ($opt_name1 eq $opt_name2 and $value1 eq $value2){
- # Option already set
- return 1;
- }
- }
+ for (@$subset){
+ my ($name, $value)= _split_option($_);
+ return 0 unless exists $cache{$name} and $cache{$name} eq $value;
}
- return 0;
+ return 1;
}
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
index 87054019759..30c8fe54642 100644
--- a/mysql-test/lib/My/SafeProcess.pm
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -395,10 +395,10 @@ sub _collect {
# 1 Still running
#
sub wait_one {
- my ($self, $timeout)= @_;
- croak "usage: \$safe_proc->wait_one([timeout])" unless ref $self;
+ my ($self, $timeout, $keep)= @_;
+ croak "usage: \$safe_proc->wait_one([timeout] [, keep])" unless ref $self;
- _verbose("wait_one $self, $timeout");
+ _verbose("wait_one $self, $timeout, $keep");
if ( ! defined($self->{SAFE_PID}) ) {
# No pid => not running
@@ -472,16 +472,16 @@ sub wait_one {
return 1;
}
- if ( not $blocking and $retpid == -1 ) {
- # still running
- _verbose("still running");
- return 1;
- }
+ #if ( not $blocking and $retpid == -1 ) {
+ # # still running
+ # _verbose("still running");
+ # return 1;
+ #}
#warn "wait_one: expected pid $pid but got $retpid"
# unless( $retpid == $pid );
- $self->_collect($exit_code);
+ $self->_collect($exit_code) unless $keep;
return 0;
}
@@ -628,7 +628,7 @@ sub self2str {
sub _verbose {
return unless $_verbose;
- print STDERR " ## ". @_. "\n";
+ print STDERR " ## @_\n";
}
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 8c94c281edf..27803ff1d85 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -623,8 +623,10 @@ sub make_combinations($$@)
{
# Skip all other combinations if the values they change
# are already fixed in master_opt or slave_opt
- if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
- My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){
+ # (empty combinations are not considered a subset of anything)
+ if (@{$comb->{comb_opt}} &&
+ My::Options::is_subset($test->{master_opt}, $comb->{comb_opt}) &&
+ My::Options::is_subset($test->{slave_opt}, $comb->{comb_opt}) ){
$test_combs->{$comb->{name}} = 2;
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index cee9f2b6ed6..2ff78c0e10a 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -40,7 +40,7 @@ BEGIN
eval 'sub USE_NETPING { $use_netping }';
}
-sub sleep_until_file_created ($$$$);
+sub sleep_until_file_created ($$$$$);
sub mtr_ping_port ($);
sub mtr_ping_port ($) {
@@ -102,8 +102,9 @@ sub mtr_ping_port ($) {
# FIXME check that the pidfile contains the expected pid!
-sub sleep_until_file_created ($$$$) {
+sub sleep_until_file_created ($$$$$) {
my $pidfile= shift;
+ my $expectfile = shift;
my $timeout= shift;
my $proc= shift;
my $warn_seconds = shift;
@@ -120,8 +121,9 @@ sub sleep_until_file_created ($$$$) {
my $seconds= ($loop * $sleeptime) / 1000;
# Check if it died after the fork() was successful
- if ( defined $proc and ! $proc->wait_one(0) )
+ if ( defined $proc and ! $proc->wait_one(0, 1) )
{
+ return 1 if -r $expectfile;
mtr_warning("Process $proc died after mysql-test-run waited $seconds " .
"seconds for $pidfile to be created.");
return 0;
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm
index 98ed77eea0f..8142b0a5cbb 100644
--- a/mysql-test/lib/mtr_report.pm
+++ b/mysql-test/lib/mtr_report.pm
@@ -497,23 +497,21 @@ sub mtr_report_stats ($$$$) {
$test_time = sprintf("%.3f", $test->{timer} / 1000);
$test->{'name'} =~ s/$current_suite\.//;
- my $test_result;
-
- # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
- if ($test->{'retries'} > 0) {
- $test_result = "MTR_RES_FAILED";
+ my $combinations;
+ if (defined($test->{combinations})){
+ $combinations = join ',', sort @{$test->{combinations}};
} else {
- $test_result = $test->{'result'};
+ $combinations = "";
}
- $xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" status="$test_result" time="$test_time");
+ $xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" ).
+ qq(status="$test->{'result'}" time="$test_time" combinations="$combinations");
- my $comment = $test->{'comment'};
- $comment =~ s/[\"]//g;
+ my $comment= replace_special_symbols($test->{'comment'});
- # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
- if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'} > 0) {
+ if ($test->{'result'} eq "MTR_RES_FAILED") {
my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'};
+ $logcontents= $logcontents.$test->{'warnings'}."\n";
# remove any double ] that would end the cdata
$logcontents =~ s/]]/\x{fffd}/g;
# replace wide characters that aren't allowed in XML 1.0
@@ -576,6 +574,16 @@ sub mtr_print_line () {
print '-' x 74 . "\n";
}
+sub replace_special_symbols($) {
+ my $text= shift;
+ $text =~ s/&/&#38;/g;
+ $text =~ s/'/&#39;/g;
+ $text =~ s/"/&#34;/g;
+ $text =~ s/</&lt;/g;
+ $text =~ s/>/&gt;/g;
+ return $text;
+}
+
sub mtr_print_thick_line {
my $char= shift || '=';
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index 6fe5f66fbfc..08f256bb2f2 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -141,7 +141,7 @@ our $opt_tmpdir; # A path but set directly on cmd line
# configuration used to build them. To make life easier, an environment
# variable or command-line option may be specified to control which set of
# executables will be used by the test suite.
-our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
+our $multiconfig = $ENV{'MTR_VS_CONFIG'};
our $default_vardir;
@@ -502,7 +502,7 @@ sub command_line_setup () {
'compress' => \$opt_compress,
'bench' => \$opt_bench,
'small-bench' => \$opt_small_bench,
- 'vs-config' => \$opt_vs_config,
+ 'vs-config' => \$multiconfig,
# Control what test suites or cases to run
'force' => \$opt_force,
@@ -2213,9 +2213,9 @@ sub vs_config_dirs ($$) {
$exe = "" if not defined $exe;
- if ($opt_vs_config)
+ if ($multiconfig)
{
- return ("$glob_bindir/$path_part/$opt_vs_config/$exe");
+ return ("$glob_bindir/$path_part/$multiconfig/$exe");
}
return ("$glob_bindir/$path_part/release/$exe",
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index fd25c28dc06..b87263eebd4 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -172,7 +172,7 @@ my $path_config_file; # The generated config file, var/my.cnf
# configuration used to build them. To make life easier, an environment
# variable or command-line option may be specified to control which set of
# executables will be used by the test suite.
-our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
+our $multiconfig = $ENV{'MTR_VS_CONFIG'};
my @DEFAULT_SUITES= qw(
main-
@@ -420,6 +420,7 @@ sub check_wsrep_support() {
my $my_print_defaults_exe=
mtr_exe_maybe_exists(
"$bindir/extra/my_print_defaults",
+ "$bindir/extra/$multiconfig/my_print_defaults",
"$path_client_bindir/my_print_defaults");
my $epath= "";
if ($my_print_defaults_exe ne "") {
@@ -480,7 +481,7 @@ sub check_mariabackup_support() {
$mariabackup_path= "";
$mariabackup_exe=
mtr_exe_maybe_exists(
- "$bindir/extra/mariabackup$opt_vs_config/mariabackup",
+ "$bindir/extra/mariabackup$multiconfig/mariabackup",
"$path_client_bindir/mariabackup");
if ($mariabackup_exe ne "") {
my $bpath= dirname($mariabackup_exe);
@@ -492,7 +493,7 @@ sub check_mariabackup_support() {
$ENV{XTRABACKUP}= $mariabackup_exe;
$ENV{XBSTREAM}= mtr_exe_maybe_exists(
- "$bindir/extra/mariabackup/$opt_vs_config/mbstream",
+ "$bindir/extra/mariabackup/$multiconfig/mbstream",
"$path_client_bindir/mbstream");
$ENV{INNOBACKUPEX}= "$mariabackup_exe --innobackupex";
@@ -888,9 +889,13 @@ sub run_test_server ($$$) {
rename $log_file_name, $log_file_name.".failed";
}
- delete($result->{result});
- $result->{retries}= $retries+1;
- $result->write_test($sock, 'TESTCASE');
+ {
+ local @$result{'retries', 'result'};
+ delete $result->{result};
+ $result->{retries}= $retries+1;
+ $result->write_test($sock, 'TESTCASE');
+ }
+ push(@$completed, $result);
next;
}
}
@@ -1231,7 +1236,7 @@ sub command_line_setup {
'ssl|with-openssl' => \$opt_ssl,
'skip-ssl' => \$opt_skip_ssl,
'compress' => \$opt_compress,
- 'vs-config=s' => \$opt_vs_config,
+ 'vs-config=s' => \$multiconfig,
# Max number of parallel threads to use
'parallel=s' => \$opt_parallel,
@@ -1411,7 +1416,8 @@ sub command_line_setup {
{
$path_client_bindir= mtr_path_exists("$bindir/client_release",
"$bindir/client_debug",
- "$bindir/client$opt_vs_config",
+ "$bindir/client/$multiconfig",
+ "$bindir/client$multiconfig",
"$bindir/client",
"$bindir/bin");
}
@@ -1968,7 +1974,7 @@ sub executable_setup () {
if ( $opt_embedded_server )
{
$exe_mysqltest=
- mtr_exe_exists("$bindir/libmysqld/examples$opt_vs_config/mysqltest_embedded",
+ mtr_exe_exists("$bindir/libmysqld/examples$multiconfig/mysqltest_embedded",
"$path_client_bindir/mysqltest_embedded");
}
else
@@ -2072,10 +2078,10 @@ sub mysql_client_test_arguments(){
# mysql_client_test executable may _not_ exist
if ( $opt_embedded_server ) {
$exe= mtr_exe_maybe_exists(
- "$bindir/libmysqld/examples$opt_vs_config/mysql_client_test_embedded",
+ "$bindir/libmysqld/examples$multiconfig/mysql_client_test_embedded",
"$bindir/bin/mysql_client_test_embedded");
} else {
- $exe= mtr_exe_maybe_exists("$bindir/tests$opt_vs_config/mysql_client_test",
+ $exe= mtr_exe_maybe_exists("$bindir/tests$multiconfig/mysql_client_test",
"$bindir/bin/mysql_client_test");
}
@@ -2245,7 +2251,7 @@ sub environment_setup {
my $client_config_exe=
mtr_exe_maybe_exists(
- "$bindir/libmariadb/mariadb_config$opt_vs_config/mariadb_config",
+ "$bindir/libmariadb/mariadb_config$multiconfig/mariadb_config",
"$bindir/bin/mariadb_config");
if ($client_config_exe)
{
@@ -2264,7 +2270,7 @@ sub environment_setup {
# some versions, test using it should be skipped
# ----------------------------------------------------
my $exe_bug25714=
- mtr_exe_maybe_exists("$bindir/tests$opt_vs_config/bug25714");
+ mtr_exe_maybe_exists("$bindir/tests$multiconfig/bug25714");
$ENV{'MYSQL_BUG25714'}= native_path($exe_bug25714);
# ----------------------------------------------------
@@ -2281,7 +2287,7 @@ sub environment_setup {
# my_print_defaults
# ----------------------------------------------------
my $exe_my_print_defaults=
- mtr_exe_exists("$bindir/extra$opt_vs_config/my_print_defaults",
+ mtr_exe_exists("$bindir/extra$multiconfig/my_print_defaults",
"$path_client_bindir/my_print_defaults");
$ENV{'MYSQL_MY_PRINT_DEFAULTS'}= native_path($exe_my_print_defaults);
@@ -2316,16 +2322,16 @@ sub environment_setup {
# ----------------------------------------------------
# perror
# ----------------------------------------------------
- my $exe_perror= mtr_exe_exists("$bindir/extra$opt_vs_config/perror",
+ my $exe_perror= mtr_exe_exists("$bindir/extra$multiconfig/perror",
"$path_client_bindir/perror");
$ENV{'MY_PERROR'}= native_path($exe_perror);
# ----------------------------------------------------
# mysql_tzinfo_to_sql
# ----------------------------------------------------
- my $exe_mysql_tzinfo_to_sql= mtr_exe_exists("$basedir/sql$opt_vs_config/mysql_tzinfo_to_sql",
+ my $exe_mysql_tzinfo_to_sql= mtr_exe_exists("$basedir/sql$multiconfig/mysql_tzinfo_to_sql",
"$path_client_bindir/mysql_tzinfo_to_sql",
- "$bindir/sql$opt_vs_config/mysql_tzinfo_to_sql");
+ "$bindir/sql$multiconfig/mysql_tzinfo_to_sql");
$ENV{'MYSQL_TZINFO_TO_SQL'}= native_path($exe_mysql_tzinfo_to_sql);
# ----------------------------------------------------
@@ -2333,7 +2339,7 @@ sub environment_setup {
# ----------------------------------------------------
my $exe_replace= mtr_exe_exists(vs_config_dirs('extra', 'replace'),
"$basedir/extra/replace",
- "$bindir/extra$opt_vs_config/replace",
+ "$bindir/extra$multiconfig/replace",
"$path_client_bindir/replace");
$ENV{'REPLACE'}= native_path($exe_replace);
@@ -2341,7 +2347,7 @@ sub environment_setup {
# innochecksum
# ----------------------------------------------------
my $exe_innochecksum=
- mtr_exe_maybe_exists("$bindir/extra$opt_vs_config/innochecksum",
+ mtr_exe_maybe_exists("$bindir/extra$multiconfig/innochecksum",
"$path_client_bindir/innochecksum");
if ($exe_innochecksum)
{
@@ -2529,10 +2535,10 @@ sub setup_vardir() {
{
if (!$opt_embedded_server)
{
- for (<$bindir/storage/*$opt_vs_config/*.dll>,
- <$bindir/plugin/*$opt_vs_config/*.dll>,
- <$bindir/libmariadb$opt_vs_config/*.dll>,
- <$bindir/sql$opt_vs_config/*.dll>)
+ for (<$bindir/storage/*$multiconfig/*.dll>,
+ <$bindir/plugin/*$multiconfig/*.dll>,
+ <$bindir/libmariadb$multiconfig/*.dll>,
+ <$bindir/sql$multiconfig/*.dll>)
{
my $pname=basename($_);
copy rel2abs($_), "$plugindir/$pname";
@@ -2549,11 +2555,11 @@ sub setup_vardir() {
unlink "$plugindir/symlink_test";
}
- for (<$bindir/storage/*/*.so>,
- <$bindir/plugin/*/*.so>,
+ for (<$bindir/storage/*$multiconfig/*.so>,
+ <$bindir/plugin/*$multiconfig/*.so>,
<$bindir/libmariadb/plugins/*/*.so>,
- <$bindir/libmariadb/*.so>,
- <$bindir/sql/*.so>)
+ <$bindir/libmariadb/$multiconfig/*.so>,
+ <$bindir/sql$multiconfig/*.so>)
{
my $pname=basename($_);
if ($opt_use_copy)
@@ -2675,23 +2681,24 @@ sub check_debug_support {
# executables, and plugins - that is, something that can affect the test suite
#
sub fix_vs_config_dir () {
- return $opt_vs_config="" unless IS_WINDOWS;
- return $opt_vs_config="/$opt_vs_config" if $opt_vs_config;
+ return $multiconfig="/$multiconfig" if $multiconfig;
my $modified = 1e30;
- $opt_vs_config="";
+ $multiconfig="";
- for (<$bindir/sql/*/mysqld.exe>) { #/
+ for (<$bindir/sql/*/mysqld.exe>,
+ <$bindir/sql/*/mysqld>
+ ) { #/
if (-M $_ < $modified)
{
$modified = -M _;
- $opt_vs_config = basename(dirname($_));
+ $multiconfig = basename(dirname($_));
}
}
- mtr_report("VS config: $opt_vs_config");
- $opt_vs_config="/$opt_vs_config" if $opt_vs_config;
+ mtr_report("VS config: $multiconfig");
+ $multiconfig="/$multiconfig" if $multiconfig;
}
@@ -2711,9 +2718,9 @@ sub vs_config_dirs ($$) {
# Don't look in these dirs when not on windows
return () unless IS_WINDOWS;
- if ($opt_vs_config)
+ if ($multiconfig)
{
- return ("$basedir/$path_part/$opt_vs_config/$exe");
+ return ("$basedir/$path_part/$multiconfig/$exe");
}
return ("$basedir/$path_part/release/$exe",
@@ -2816,7 +2823,9 @@ sub mysql_server_start($) {
if (!$opt_embedded_server)
{
- mysqld_start($mysqld,$extra_opts);
+ mysqld_start($mysqld, $extra_opts) or
+ mtr_error("Failed to start mysqld ".$mysqld->name()." with command "
+ . $ENV{MYSQLD_LAST_CMD});
# Save this test case information, so next can examine it
$mysqld->{'started_tinfo'}= $tinfo;
@@ -2839,11 +2848,11 @@ sub mysql_server_start($) {
sub mysql_server_wait {
my ($mysqld, $tinfo) = @_;
+ my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
- if (!sleep_until_file_created($mysqld->value('pid-file'),
- $opt_start_timeout,
- $mysqld->{'proc'},
- $warn_seconds))
+ if (!sleep_until_file_created($mysqld->value('pid-file'), $expect_file,
+ $opt_start_timeout, $mysqld->{'proc'},
+ $warn_seconds))
{
$tinfo->{comment}= "Failed to start ".$mysqld->name() . "\n";
return 1;
@@ -4131,9 +4140,12 @@ sub run_testcase ($$) {
# ----------------------------------------------------
# Check if it was an expected crash
# ----------------------------------------------------
- my $check_crash = check_expected_crash_and_restart($wait_for_proc);
+ my @mysqld = grep($wait_for_proc eq $_->{proc}, mysqlds());
+ goto SRVDIED unless @mysqld;
+ my $check_crash = check_expected_crash_and_restart($mysqld[0]);
if ($check_crash == 0) # unexpected exit/crash of $wait_for_proc
{
+ $proc= $mysqld[0]->{proc};
goto SRVDIED;
}
elsif ($check_crash == 1) # $wait_for_proc was started again by check_expected_crash_and_restart()
@@ -4691,61 +4703,52 @@ sub check_warnings_post_shutdown {
}
#
-# Loop through our list of processes and look for and entry
-# with the provided pid, if found check for the file indicating
-# expected crash and restart it.
+# Check for the file indicating expected crash and restart it.
#
sub check_expected_crash_and_restart {
- my ($proc)= @_;
+ my $mysqld = shift;
- foreach my $mysqld ( mysqlds() )
+ # Check if crash expected by looking at the .expect file
+ # in var/tmp
+ my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
+ if ( -f $expect_file )
{
- next unless ( $mysqld->{proc} and $mysqld->{proc} eq $proc );
+ mtr_verbose("Crash was expected, file '$expect_file' exists");
- # Check if crash expected by looking at the .expect file
- # in var/tmp
- my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
- if ( -f $expect_file )
+ for (my $waits = 0; $waits < 50; mtr_milli_sleep(100), $waits++)
{
- mtr_verbose("Crash was expected, file '$expect_file' exists");
-
- for (my $waits = 0; $waits < 50; mtr_milli_sleep(100), $waits++)
+ # Race condition seen on Windows: try again until file not empty
+ next if -z $expect_file;
+ # If last line in expect file starts with "wait"
+ # sleep a little and try again, thus allowing the
+ # test script to control when the server should start
+ # up again. Keep trying for up to 5s at a time.
+ my $last_line= mtr_lastlinesfromfile($expect_file, 1);
+ if ($last_line =~ /^wait/ )
{
- # Race condition seen on Windows: try again until file not empty
- next if -z $expect_file;
- # If last line in expect file starts with "wait"
- # sleep a little and try again, thus allowing the
- # test script to control when the server should start
- # up again. Keep trying for up to 5s at a time.
- my $last_line= mtr_lastlinesfromfile($expect_file, 1);
- if ($last_line =~ /^wait/ )
- {
- mtr_verbose("Test says wait before restart") if $waits == 0;
- next;
- }
-
- # Ignore any partial or unknown command
- next unless $last_line =~ /^restart/;
- # If last line begins "restart:", the rest of the line is read as
- # extra command line options to add to the restarted mysqld.
- # Anything other than 'wait' or 'restart:' (with a colon) will
- # result in a restart with original mysqld options.
- if ($last_line =~ /restart:(.+)/) {
- my @rest_opt= split(' ', $1);
- $mysqld->{'restart_opts'}= \@rest_opt;
- } else {
- delete $mysqld->{'restart_opts'};
- }
- unlink($expect_file);
-
- # Start server with same settings as last time
- mysqld_start($mysqld, $mysqld->{'started_opts'});
+ mtr_verbose("Test says wait before restart") if $waits == 0;
+ next;
+ }
- return 1;
+ # Ignore any partial or unknown command
+ next unless $last_line =~ /^restart/;
+ # If last line begins "restart:", the rest of the line is read as
+ # extra command line options to add to the restarted mysqld.
+ # Anything other than 'wait' or 'restart:' (with a colon) will
+ # result in a restart with original mysqld options.
+ if ($last_line =~ /restart:(.+)/) {
+ my @rest_opt= split(' ', $1);
+ $mysqld->{'restart_opts'}= \@rest_opt;
+ } else {
+ delete $mysqld->{'restart_opts'};
}
- # Loop ran through: we should keep waiting after a re-check
- return 2;
+ unlink($expect_file);
+
+ # Start server with same settings as last time
+ return mysqld_start($mysqld, $mysqld->{'started_opts'});
}
+ # Loop ran through: we should keep waiting after a re-check
+ return 2;
}
# Not an expected crash
@@ -5102,6 +5105,7 @@ sub mysqld_start ($$) {
if ( defined $exe )
{
+ mtr_tofile($output, "\$ $exe @$args\n");
pre_write_errorlog($output);
$mysqld->{'proc'}= My::SafeProcess->new
(
@@ -5120,17 +5124,11 @@ sub mysqld_start ($$) {
mtr_verbose("Started $mysqld->{proc}");
}
- if (!sleep_until_file_created($mysqld->value('pid-file'),
- $opt_start_timeout, $mysqld->{'proc'}, $warn_seconds))
- {
- my $mname= $mysqld->name();
- mtr_error("Failed to start mysqld $mname with command $exe");
- }
-
- # Remember options used when starting
$mysqld->{'started_opts'}= $extra_opts;
- return;
+ my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
+ return sleep_until_file_created($mysqld->value('pid-file'), $expect_file,
+ $opt_start_timeout, $mysqld->{'proc'}, $warn_seconds);
}
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 69322bb9028..1fcb8c6a33d 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -2517,5 +2517,22 @@ ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1);
ERROR HY000: Function or expression 'select ...' cannot be used in the DEFAULT clause of `k1`
DROP TABLE t1,t2;
#
+# MDEV-25403 ALTER TABLE wrongly checks for field's default value if AFTER is used
+#
+create table t1(t int, d date not null);
+insert into t1 values (1,'2001-1-1');
+set sql_mode = "no_zero_date";
+alter table t1 change d d date not null after t, add i int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t` int(11) DEFAULT NULL,
+ `d` date NOT NULL,
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t1 add x date not null;
+ERROR 22007: Incorrect date value: '0000-00-00' for column `test`.`t1`.`x` at row 1
+drop table t1;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result
index 1adba7b4c4c..24d0f79325a 100644
--- a/mysql-test/r/commit_1innodb.result
+++ b/mysql-test/r/commit_1innodb.result
@@ -873,7 +873,7 @@ Table Op Msg_type Msg_text
test.t1 check status OK
test.t2 check status OK
test.t3 check status OK
-call p_verify_status_increment(6, 0, 6, 0);
+call p_verify_status_increment(4, 0, 4, 0);
SUCCESS
commit;
diff --git a/mysql-test/r/create_or_replace.result b/mysql-test/r/create_or_replace.result
index 54bec5c3f9d..5684843c01c 100644
--- a/mysql-test/r/create_or_replace.result
+++ b/mysql-test/r/create_or_replace.result
@@ -313,6 +313,25 @@ create table t1 (i int);
drop table t1;
drop database mysqltest2;
#
+# MDEV-23391 Server crash in close_thread_table or assertion, upon CREATE OR REPLACE TABLE under lock
+#
+create table t1 (i int);
+lock table t1 write;
+select * from information_schema.metadata_lock_info;
+THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
+# MDL_INTENTION_EXCLUSIVE NULL Global read lock
+# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test
+# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1
+create or replace table t1 (a char(1)) engine=Innodb select 'foo' as a;
+ERROR 22001: Data too long for column 'a' at row 1
+show tables;
+Tables_in_test
+t2
+select * from information_schema.metadata_lock_info;
+THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
+create table t1 (i int);
+drop table t1;
+#
# Testing CREATE .. LIKE
#
create or replace table t1 like t2;
diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result
index da954c1f14b..2504e55d77c 100644
--- a/mysql-test/r/cte_nonrecursive.result
+++ b/mysql-test/r/cte_nonrecursive.result
@@ -606,7 +606,7 @@ with t(c) as (select a from t1 where b >= 'c')
select * from t r1 where r1.c=4;
show create view v3;
View Create View character_set_client collation_connection
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS with t as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c` from `t` `r1` where `r1`.`c` = 4 latin1 latin1_swedish_ci
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS with t(c) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c` from `t` `r1` where `r1`.`c` = 4 latin1 latin1_swedish_ci
select * from v3;
c
4
@@ -618,7 +618,7 @@ with t(c) as (select a from t1 where b >= 'c')
select * from t r1, t r2 where r1.c=r2.c and r2.c=4;
show create view v4;
View Create View character_set_client collation_connection
-v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join `t` `r2`) where `r1`.`c` = `r2`.`c` and `r2`.`c` = 4 latin1 latin1_swedish_ci
+v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t(c) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join `t` `r2`) where `r1`.`c` = `r2`.`c` and `r2`.`c` = 4 latin1 latin1_swedish_ci
select * from v4;
c d
4 4
@@ -1120,10 +1120,10 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using where
5 UNION t1 ALL NULL NULL NULL NULL 7 100.00 Using where
NULL UNION RESULT <union2,5> ALL NULL NULL NULL NULL NULL NULL
-6 UNION <derived9> ALL NULL NULL NULL NULL 14 100.00
-9 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using where
-12 UNION t1 ALL NULL NULL NULL NULL 7 100.00 Using where
-NULL UNION RESULT <union9,12> ALL NULL NULL NULL NULL NULL NULL
+6 UNION <derived14> ALL NULL NULL NULL NULL 14 100.00
+14 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using where
+11 UNION t1 ALL NULL NULL NULL NULL 7 100.00 Using where
+NULL UNION RESULT <union14,11> ALL NULL NULL NULL NULL NULL NULL
NULL UNION RESULT <union1,6> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1003 with cte_e as (with cte_o as (with cte_i as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union select `cte_e2`.`a` AS `a` from `cte_e` `cte_e2`
@@ -1763,4 +1763,327 @@ a c
2 1
7 3
drop table t1;
+#
+# MDEV-23886: Stored Function returning the result of a query
+# that uses CTE over a table twice
+#
+create table t1 (c1 int);
+insert into t1 values (1),(2),(6);
+create function f1() returns int return
+( with cte1 as (select c1 from t1)
+select sum(c1) from
+(select * from cte1 union all select * from cte1) dt
+);
+select f1();
+f1()
+18
+create function f2() returns int return
+( with cte1 as (select c1 from t1)
+select sum(s.c1) from cte1 as s, cte1 as t where s.c1=t.c1
+);
+select f2();
+f2()
+9
+create function f3() returns int return
+( with cte1 as (select c1 from t1)
+select
+case
+when exists(select 1 from cte1 where c1 between 1 and 2) then 1
+when exists(select 1 from cte1 where c1 between 5 and 6) then 2
+else 0
+end
+);
+select f3();
+f3()
+1
+create view v1 as (select c1 from t1);
+create function f4() returns int return
+( select sum(c1) from
+(select * from v1 union all select * from v1) dt
+);
+select f4();
+f4()
+18
+create function f5() returns int return
+( select sum(s.c1) from v1 as s, v1 as t where s.c1=t.c1
+);
+select f5();
+f5()
+9
+create view v2(s) as
+with cte1 as (select c1 from t1)
+select sum(c1) from (select * from cte1 union all select * from cte1) dt;
+create function f6() returns int return
+(select s from v2);
+select f6();
+f6()
+18
+create function f7() returns int return
+( select r.s from v2 as r, v2 as t where r.s=t.s
+);
+select f7();
+f7()
+18
+select f5() + f6();
+f5() + f6()
+27
+prepare stmt from "select f5() + f6();";
+execute stmt;
+f5() + f6()
+27
+execute stmt;
+f5() + f6()
+27
+deallocate prepare stmt;
+drop function f1;
+drop function f2;
+drop function f3;
+drop function f4;
+drop function f5;
+drop function f6;
+drop function f7;
+drop view v1;
+drop view v2;
+create table t2 (a int, b int);
+insert into t2
+with cte1 as (select c1 from t1)
+select * from cte1 as s, cte1 as t where s.c1=t.c1 and s.c1 > 5;
+select * from t2;
+a b
+6 6
+create procedure p1()
+begin
+insert into t2
+with cte1 as (select c1 from t1)
+select * from cte1 as s, cte1 as t where s.c1=t.c1 and s.c1 <= 2 and t.c1 >= 2;
+end |
+call p1();
+select * from t2;
+a b
+6 6
+2 2
+drop procedure p1;
+# checking CTE resolution for queries with hanging CTEs
+with
+cte1(a) as (select * from t1 where c1 <= 2),
+cte2(b) as (select * from cte1 where a >= 2),
+cte3 as (select * from cte1,cte2 where cte1.a < cte2.b)
+select * from cte3;
+a b
+1 2
+select * from t2;
+a b
+6 6
+2 2
+with
+cte1(a) as (select * from t1 where c1 <= 2),
+cte2(b) as (select * from cte1 where a >= 2),
+cte3 as (select * from cte1,cte2 where cte1.a < cte2.b)
+select * from t2;
+a b
+6 6
+2 2
+with
+cte1(a) as (select * from t1 where c1 <= 2),
+cte2(b) as (select * from cte1 where c1 >= 2),
+cte3 as (select * from cte1,cte2 where cte1.a < cte2.b)
+select * from t2;
+ERROR 42S22: Unknown column 'c1' in 'where clause'
+with
+cte1(a) as (select * from t1 where c1 <= 2),
+cte2(b) as (select * from cte1 where a >= 2),
+cte3 as (select * from cte1,cte2 where cte1.a < cte2.c1)
+select * from t2;
+ERROR 42S22: Unknown column 'cte2.c1' in 'where clause'
+with
+cte1 as (select * from t1 where c1 <= 2),
+cte2(a,b) as (select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+select * from cte2;
+a b
+1 1
+2 2
+with
+cte1 as (select * from t1 where c1 <= 2),
+cte2(a,b) as (select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+select * from t2;
+a b
+6 6
+2 2
+with
+cte1 as (select * from t1 where c1 <= 2),
+cte2(a,b) as (select * from cte1 as s1, cte1 as s2 where s1.c1=c1)
+select * from t2;
+ERROR 23000: Column 'c1' in where clause is ambiguous
+with cte3 as
+( with cte2(a,b) as
+( with cte1 as (select * from t1 where c1 <= 2)
+select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+select r1.a,r2.b from cte2 as r1, cte2 as r2)
+select * from cte3;
+a b
+1 1
+2 1
+1 2
+2 2
+with cte3 as
+( with cte2(a,b) as
+( with cte1 as (select * from t1 where c1 <= 2)
+select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+select r1.a,r2.b from cte2 as r1, cte2 as r2)
+select * from t2;
+a b
+6 6
+2 2
+with cte3 as
+( with cte2(a,b) as
+( with cte1 as (select * from t1 where c1 <= 2)
+select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+select r1.c1,r2.c1 from cte2 as r1, cte2 as r2)
+select * from t2;
+ERROR 42S22: Unknown column 'r1.c1' in 'field list'
+create procedure p1()
+begin
+insert into t2
+with cte1 as (select c1 from t1)
+select * from t1 as s, t1 as t where s.c1=t.c1 and s.c1 <= 2 and t.c1 >= 2;
+end |
+call p1();
+select * from t2;
+a b
+6 6
+2 2
+2 2
+drop procedure p1;
+create procedure p1()
+begin
+insert into t2
+with cte1 as (select a from t1)
+select * from t1 as s, t1 as t where s.c1=t.c1 and s.c1 <= 2 and t.c1 >= 2;
+end |
+call p1();
+ERROR 42S22: Unknown column 'a' in 'field list'
+drop procedure p1;
+drop table t1,t2;
+#
+# MDEV-20411: SP containing only one SELECT with WITH clause
+#
+create procedure sp1 ()
+with cte as (select 1 as a) select * from cte;
+call sp1();
+a
+1
+call sp1();
+a
+1
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (7), (1), (1), (3), (1), (5);
+create procedure sp2 ()
+with cte as (select * from t1) select * from cte;
+call sp2();
+a
+3
+7
+1
+7
+1
+1
+3
+1
+5
+call sp2();
+a
+3
+7
+1
+7
+1
+1
+3
+1
+5
+create procedure sp3 ()
+with cte as (select * from t1 group by a) select * from cte;
+call sp3();
+a
+1
+3
+5
+7
+call sp3();
+a
+1
+3
+5
+7
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop table t1;
+#
+# MDEV-26095: missing RECURSIVE for the recursive definition of CTE
+# embedded into another CTE definition
+#
+create table t1 (a int);
+insert into t1 values (5), (7);
+with cte_e as (
+with recursive cte_r as (
+select a from t1 union select a+1 as a from cte_r r where a < 10
+) select * from cte_r
+) select * from cte_e;
+a
+5
+7
+6
+8
+9
+10
+with cte_e as (
+with cte_r as (
+select a from t1 union select a+1 as a from cte_r r where a < 10
+) select * from cte_r
+) select * from cte_e;
+ERROR 42S02: Table 'test.cte_r' doesn't exist
+drop table t1;
+#
+# MDEV-26025: query with two usage of a CTE executing via PS /SP
+#
+create table t1 (a int, b int);
+insert into t1 value (1,3), (3,2), (1,3), (4,1);
+prepare stmt from "with
+cte1 as ( select a,b from t1 where a = 1 AND b = 3 ),
+cte2 as ( select a,b from cte1 ),
+cte3 as ( select a,b from cte2 )
+select * from cte3, cte2";
+execute stmt;
+a b a b
+1 3 1 3
+1 3 1 3
+1 3 1 3
+1 3 1 3
+execute stmt;
+a b a b
+1 3 1 3
+1 3 1 3
+1 3 1 3
+1 3 1 3
+deallocate prepare stmt;
+create procedure sp() with
+cte1 as ( select a,b from t1 where a = 1 AND b = 3 ),
+cte2 as ( select a,b from cte1 ),
+cte3 as ( select a,b from cte2 )
+select * from cte3, cte2;
+call sp();
+a b a b
+1 3 1 3
+1 3 1 3
+1 3 1 3
+1 3 1 3
+call sp();
+a b a b
+1 3 1 3
+1 3 1 3
+1 3 1 3
+1 3 1 3
+drop procedure sp;
+drop table t1;
# End of 10.2 tests
diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result
index b6b4ed7fb37..168777f9402 100644
--- a/mysql-test/r/cte_recursive.result
+++ b/mysql-test/r/cte_recursive.result
@@ -699,7 +699,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
NULL UNION RESULT <union3,4,5> ALL NULL NULL NULL NULL NULL NULL
2 DERIVED <derived3> ALL NULL NULL NULL NULL 12 100.00 Using where
Warnings:
-Note 1003 with recursive ancestor_couple_ids as (select `a`.`father` AS `h_id`,`a`.`mother` AS `w_id` from `coupled_ancestors` `a` where `a`.`father` is not null and `a`.`mother` is not null), coupled_ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `fa` where `test`.`p`.`id` = `fa`.`h_id` union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `ma` where `test`.`p`.`id` = `ma`.`w_id`)select `h`.`name` AS `name`,`h`.`dob` AS `dob`,`w`.`name` AS `name`,`w`.`dob` AS `dob` from `ancestor_couple_ids` `c` join `coupled_ancestors` `h` join `coupled_ancestors` `w` where `h`.`id` = `c`.`h_id` and `w`.`id` = `c`.`w_id`
+Note 1003 with recursive ancestor_couple_ids(h_id,w_id) as (select `a`.`father` AS `h_id`,`a`.`mother` AS `w_id` from `coupled_ancestors` `a` where `a`.`father` is not null and `a`.`mother` is not null), coupled_ancestors(id,name,dob,father,mother) as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `fa` where `test`.`p`.`id` = `fa`.`h_id` union all select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `ma` where `test`.`p`.`id` = `ma`.`w_id`)select `h`.`name` AS `name`,`h`.`dob` AS `dob`,`w`.`name` AS `name`,`w`.`dob` AS `dob` from `ancestor_couple_ids` `c` join `coupled_ancestors` `h` join `coupled_ancestors` `w` where `h`.`id` = `c`.`h_id` and `w`.`id` = `c`.`w_id`
# simple mutual recursion
with recursive
ancestor_couple_ids(h_id, w_id)
@@ -3047,7 +3047,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
4 DEPENDENT SUBQUERY <derived2> ALL NULL NULL NULL NULL 16 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 with recursive destinations as (select `test`.`a`.`arrival` AS `city`,1 AS `legs` from `test`.`flights` `a` where `test`.`a`.`departure` = 'Cairo' union select `test`.`b`.`arrival` AS `arrival`,`r`.`legs` + 1 AS `r.legs + 1` from `destinations` `r` join `test`.`flights` `b` where `r`.`city` = `test`.`b`.`departure` and !<in_optimizer>(`test`.`b`.`arrival`,<exists>(select `destinations`.`city` from `destinations` where trigcond(`test`.`b`.`arrival` = `destinations`.`city` or `destinations`.`city` is null) having trigcond(`destinations`.`city` is null))))select `destinations`.`city` AS `city`,`destinations`.`legs` AS `legs` from `destinations`
+Note 1003 with recursive destinations(city,legs) as (select `test`.`a`.`arrival` AS `city`,1 AS `legs` from `test`.`flights` `a` where `test`.`a`.`departure` = 'Cairo' union select `test`.`b`.`arrival` AS `arrival`,`r`.`legs` + 1 AS `r.legs + 1` from `destinations` `r` join `test`.`flights` `b` where `r`.`city` = `test`.`b`.`departure` and !<in_optimizer>(`test`.`b`.`arrival`,<exists>(select `destinations`.`city` from `destinations` where trigcond(`test`.`b`.`arrival` = `destinations`.`city` or `destinations`.`city` is null) having trigcond(`destinations`.`city` is null))))select `destinations`.`city` AS `city`,`destinations`.`legs` AS `legs` from `destinations`
set standard_compliant_cte=default;
drop table flights;
#
@@ -3334,7 +3334,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
5 DERIVED <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
5 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 with recursive rcte as (select 1 AS `a` union select cast(`rcte`.`a` + 1 as unsigned) AS `cast(a+1 as unsigned)` from `rcte` where `rcte`.`a` < 10), cte1 as (select count(0) AS `c1` from `rcte` join `test`.`t1` where `rcte`.`a` between 3 and 5 and `test`.`t1`.`id` = `rcte`.`a` - 3), cte2 as (select count(0) AS `c2` from `rcte` join `test`.`t1` where `rcte`.`a` between 7 and 8 and `test`.`t1`.`id` = `rcte`.`a` - 7)select `cte1`.`c1` AS `c1`,`cte2`.`c2` AS `c2` from `cte1` join `cte2`
+Note 1003 with recursive rcte(a) as (select 1 AS `a` union select cast(`rcte`.`a` + 1 as unsigned) AS `cast(a+1 as unsigned)` from `rcte` where `rcte`.`a` < 10), cte1 as (select count(0) AS `c1` from `rcte` join `test`.`t1` where `rcte`.`a` between 3 and 5 and `test`.`t1`.`id` = `rcte`.`a` - 3), cte2 as (select count(0) AS `c2` from `rcte` join `test`.`t1` where `rcte`.`a` between 7 and 8 and `test`.`t1`.`id` = `rcte`.`a` - 7)select `cte1`.`c1` AS `c1`,`cte2`.`c2` AS `c2` from `cte1` join `cte2`
prepare stmt from "with recursive
rcte(a) as
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
@@ -3420,7 +3420,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
4 DERIVED <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
4 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 with recursive rcte as (select 1 AS `a` union select cast(`rcte`.`a` + 1 as unsigned) AS `cast(a+1 as unsigned)` from `rcte` where `rcte`.`a` < 10), cte1 as (select count(0) AS `c1` from `rcte` join `test`.`t1` where `rcte`.`a` between 3 and 5 and `test`.`t1`.`id` = `rcte`.`a` - 3), cte2 as (select count(0) AS `c2` from `rcte` join `test`.`t1` where `rcte`.`a` between 7 and 8 and `test`.`t1`.`id` = `rcte`.`a` - 7)select `cte2`.`c2` AS `c2`,`cte1`.`c1` AS `c1` from `cte2` join `cte1`
+Note 1003 with recursive rcte(a) as (select 1 AS `a` union select cast(`rcte`.`a` + 1 as unsigned) AS `cast(a+1 as unsigned)` from `rcte` where `rcte`.`a` < 10), cte1 as (select count(0) AS `c1` from `rcte` join `test`.`t1` where `rcte`.`a` between 3 and 5 and `test`.`t1`.`id` = `rcte`.`a` - 3), cte2 as (select count(0) AS `c2` from `rcte` join `test`.`t1` where `rcte`.`a` between 7 and 8 and `test`.`t1`.`id` = `rcte`.`a` - 7)select `cte2`.`c2` AS `c2`,`cte1`.`c1` AS `c1` from `cte2` join `cte1`
prepare stmt from "with recursive
rcte(a) as
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
@@ -3689,7 +3689,7 @@ select * from t1 as t;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t ALL NULL NULL NULL NULL 4 100.00
Warnings:
-Note 1003 with recursive cte as (select `*` AS `*` from `test`.`t1` where `a` = 1 union select `a` + 1 AS `a+1` from `cte` where `a` < 3)select `test`.`t`.`a` AS `a` from `test`.`t1` `t`
+Note 1003 with recursive cte as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 union select `cte`.`a` + 1 AS `a+1` from `cte` where `cte`.`a` < 3)select `test`.`t`.`a` AS `a` from `test`.`t1` `t`
with recursive cte as
(select * from t1 where a=1 union select a+1 from cte where a<3)
select * from t1 as t;
@@ -3702,10 +3702,10 @@ create table t2 ( i1 int, i2 int);
insert into t2 values (1,1),(2,2);
explain
with recursive cte as
-( select * from t1 union select s1.* from t1 as s1, cte where s1.i1 = cte.i2 )
-select * from t1 as t;
+( select * from t2 union select s1.* from t2 as s1, cte where s1.i1 = cte.i2 )
+select * from t2 as t;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t ALL NULL NULL NULL NULL 4
+1 PRIMARY t ALL NULL NULL NULL NULL 2
drop table t1,t2;
#
# MDEV-22042: ANALYZE of query using stored function and recursive CTE
@@ -4454,5 +4454,92 @@ deallocate prepare stmt;
drop table folks;
set big_tables=@save_big_tables;
#
+# MDEV-26135: execution of PS for query with hanging recursive CTE
+#
+create table t1 (a int);
+insert into t1 values (5), (7);
+create table t2 (b int);
+insert into t2 values (3), (7), (1);
+with recursive r as (select a from t1 union select a+1 from r where a < 10)
+select * from t2;
+b
+3
+7
+1
+prepare stmt from "with recursive r as (select a from t1 union select a+1 from r where a < 10)
+select * from t2";
+execute stmt;
+b
+3
+7
+1
+execute stmt;
+b
+3
+7
+1
+deallocate prepare stmt;
+drop table t1,t2;
+#
+# MDEV-26189: Unknown column reference within hanging recursive CTE
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+with recursive
+r as (select * from t1 union select s1.* from t1 as s1, r where s1.a = r.b)
+select * from t1 as t;
+ERROR 42S22: Unknown column 'r.b' in 'where clause'
+explain with recursive
+r as (select * from t1 union select s1.* from t1 as s1, r where s1.a = r.b)
+select * from t1 as t;
+ERROR 42S22: Unknown column 'r.b' in 'where clause'
+create procedure sp1() with recursive
+r as (select * from t1 union select s1.* from t1 as s1, r where s1.a = r.b)
+select * from t1 as t;
+call sp1();
+ERROR 42S22: Unknown column 'r.b' in 'where clause'
+call sp1();
+ERROR 42S22: Unknown column 'r.b' in 'where clause'
+with recursive
+r as (select * from t1 union select s1.* from t1 as s1, r where s1.b = r.a)
+select * from t1 as t;
+ERROR 42S22: Unknown column 's1.b' in 'where clause'
+explain with recursive
+r as (select * from t1 union select s1.* from t1 as s1, r where s1.b = r.a)
+select * from t1 as t;
+ERROR 42S22: Unknown column 's1.b' in 'where clause'
+create procedure sp2() with recursive
+r as (select * from t1 union select s1.* from t1 as s1, r where s1.b = r.a)
+select * from t1 as t;
+call sp2();
+ERROR 42S22: Unknown column 's1.b' in 'where clause'
+call sp2();
+ERROR 42S22: Unknown column 's1.b' in 'where clause'
+drop procedure sp1;
+drop procedure sp2;
+drop table t1;
+#
+# MDEV-26202: Recursive CTE used indirectly twice
+# (fixed by the patch forMDEV-26025)
+#
+with recursive
+rcte as ( SELECT 1 AS a
+UNION ALL
+SELECT cast(a + 1 as unsigned int) FROM rcte WHERE a < 3),
+cte1 AS (SELECT a FROM rcte),
+cte2 AS (SELECT a FROM cte1),
+cte3 AS ( SELECT a FROM cte2)
+SELECT * FROM cte2, cte3;
+a a
+1 1
+2 1
+3 1
+1 2
+2 2
+3 2
+1 3
+2 3
+3 3
+#
# End of 10.2 tests
#
diff --git a/mysql-test/r/ctype_filename.result b/mysql-test/r/ctype_filename.result
index c6d7d1e39b9..46b48113f9d 100644
--- a/mysql-test/r/ctype_filename.result
+++ b/mysql-test/r/ctype_filename.result
@@ -21,3 +21,32 @@ SET NAMES utf8;
SELECT @a:=CONVERT('aя' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a), HEX(REVERSE(@a));
@a BINARY @a REVERSE(@a) HEX(@a) HEX(REVERSE(@a))
aя a@r1 яa 61407231 40723161
+#
+# Beginning of 10.2 test.
+#
+# MDEV-25462: Assertion `m_status == DA_ERROR || m_status == DA_OK ||
+# m_status == DA_OK_BULK' failed in Diagnostics_area::message from
+# get_schema_tables_record
+#
+SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
+@@character_set_client @@character_set_connection @@character_set_results
+utf8 utf8 utf8
+SET @old_character_set_client= @@character_set_client;
+SET @old_character_set_connection= @@character_set_connection;
+SET @old_character_set_results= @@character_set_results;
+SET NAMES 'filename';
+ERROR 42000: Variable 'character_set_client' can't be set to the value of 'filename'
+SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
+@@character_set_client @@character_set_connection @@character_set_results
+utf8 utf8 utf8
+CREATE VIEW v2 AS SELECT 1;
+SHOW TABLE STATUS;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+v2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL VIEW
+DROP VIEW v2;
+SET @@character_set_client= @old_character_set_client;
+SET @@character_set_connection= @old_character_set_connection;
+SET @@character_set_results= @old_character_set_results;
+#
+# End of 10.2 test
+#
diff --git a/mysql-test/r/ctype_utf16_def.result b/mysql-test/r/ctype_utf16_def.result
index 98b6f7d913d..b5827d45619 100644
--- a/mysql-test/r/ctype_utf16_def.result
+++ b/mysql-test/r/ctype_utf16_def.result
@@ -8,3 +8,8 @@ character_set_server utf16
SHOW VARIABLES LIKE 'ft_stopword_file';
Variable_name Value
ft_stopword_file (built-in)
+#
+# MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax
+#
+SET GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
+SET GLOBAL ft_boolean_syntax=DEFAULT;
diff --git a/mysql-test/r/ctype_utf16le.result b/mysql-test/r/ctype_utf16le.result
index a43ed6ee538..8dc51eb262b 100644
--- a/mysql-test/r/ctype_utf16le.result
+++ b/mysql-test/r/ctype_utf16le.result
@@ -3000,5 +3000,38 @@ DROP TABLE t1;
#
SET STORAGE_ENGINE=Default;
#
+# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
+#
+SET NAMES utf8;
+SET SESSION character_set_connection= utf16le;
+CREATE TABLE kv (v TEXT CHARACTER SET latin1);
+CREATE TABLE t (a INT);
+CREATE VIEW v AS SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+LOAD DATA INFILE 'MYSQLD_DATADIR/test/v.frm' REPLACE INTO TABLE kv CHARACTER SET latin1;
+SELECT LOWER(v) FROM kv WHERE v LIKE _binary'query=%';
+LOWER(v)
+query=select `information_schema`.`tables`.`table_catalog` as `table_catalog`,`information_schema`.`tables`.`table_schema` as `table_schema`,`information_schema`.`tables`.`table_name` as `table_name`,`information_schema`.`tables`.`table_type` as `table_type`,`information_schema`.`tables`.`engine` as `engine`,`information_schema`.`tables`.`version` as `version`,`information_schema`.`tables`.`row_format` as `row_format`,`information_schema`.`tables`.`table_rows` as `table_rows`,`information_schema`.`tables`.`avg_row_length` as `avg_row_length`,`information_schema`.`tables`.`data_length` as `data_length`,`information_schema`.`tables`.`max_data_length` as `max_data_length`,`information_schema`.`tables`.`index_length` as `index_length`,`information_schema`.`tables`.`data_free` as `data_free`,`information_schema`.`tables`.`auto_increment` as `auto_increment`,`information_schema`.`tables`.`create_time` as `create_time`,`information_schema`.`tables`.`update_time` as `update_time`,`information_schema`.`tables`.`check_time` as `check_time`,`information_schema`.`tables`.`table_collation` as `table_collation`,`information_schema`.`tables`.`checksum` as `checksum`,`information_schema`.`tables`.`create_options` as `create_options`,`information_schema`.`tables`.`table_comment` as `table_comment` from `information_schema`.`tables` where `information_schema`.`tables`.`table_name` = 't1'
+TRUNCATE TABLE kv;
+SELECT * FROM v;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
+LOCK TABLE t WRITE;
+UNLOCK TABLES;
+DROP VIEW v;
+DROP TABLE t;
+DROP TABLE kv;
+CREATE TABLE t (a INT);
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1');
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
+LOCK TABLE t WRITE;
+UNLOCK TABLES;
+DROP TABLE t;
+CREATE TABLE t (a INT);
+SELECT TABLE_NAME, HEX(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1');
+TABLE_NAME HEX(TABLE_NAME)
+SELECT TABLE_NAME, TABLE_SCHEMA, HEX(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=CONCAT('test',0x00,'1');
+TABLE_NAME TABLE_SCHEMA HEX(TABLE_NAME)
+DROP TABLE t;
+SET NAMES utf8;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/r/ctype_utf32_def.result b/mysql-test/r/ctype_utf32_def.result
new file mode 100644
index 00000000000..611072eb75b
--- /dev/null
+++ b/mysql-test/r/ctype_utf32_def.result
@@ -0,0 +1,6 @@
+call mtr.add_suppression("'utf32' can not be used as client character set");
+#
+# MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax
+#
+SET GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
+SET GLOBAL ft_boolean_syntax=DEFAULT;
diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result
index da23fa30ab4..46ca6e7baee 100644
--- a/mysql-test/r/ctype_utf32_uca.result
+++ b/mysql-test/r/ctype_utf32_uca.result
@@ -7919,5 +7919,27 @@ a b
DROP TABLE t1;
SET NAMES utf8;
#
+# MDEV-25402 Assertion `!str || str != Ptr' failed in String::copy
+#
+SET @c:="SET SESSION collation_connection=utf32_spanish_ci";
+PREPARE s FROM @c;
+EXECUTE s;
+CREATE PROCEDURE p (IN i INT) EXECUTE s;
+SET SESSION character_set_connection=latin1;
+SET @c:="SET @b=get_format(DATE,'EUR')";
+PREPARE s FROM @c;
+EXECUTE s;
+CALL p (@a);
+DEALLOCATE PREPARE s;
+DROP PROCEDURE p;
+SET NAMES utf8;
+SET @c:="SET @b=get_format(DATE,'EUR')";
+PREPARE s FROM @c;
+EXECUTE s;
+SET collation_connection=utf32_spanish_ci;
+EXECUTE s;
+DEALLOCATE PREPARE s;
+SET NAMES utf8;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 7189629b570..18398f2556a 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -11239,5 +11239,22 @@ DROP TABLE t1;
#
SET STORAGE_ENGINE=Default;
#
+# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
+#
+SET NAMES utf8;
+SET SESSION character_set_connection=latin1;
+CREATE VIEW v1 AS SELECT 'ä' AS c1;
+SELECT c1, HEX(c1) FROM v1;
+c1 HEX(c1)
+ä E4
+CREATE TABLE kv (v BLOB);
+LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv;
+SELECT * FROM kv WHERE v LIKE _binary'query=%';
+v
+query=select 'ä' AS `c1`
+DROP TABLE kv;
+DROP VIEW v1;
+SET NAMES utf8;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result
index 8335b553a8e..c7179e29723 100644
--- a/mysql-test/r/default.result
+++ b/mysql-test/r/default.result
@@ -3396,4 +3396,12 @@ CREATE OR REPLACE TABLE t1(i int);
ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`;
ERROR 42S22: Unknown column 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' in 'DEFAULT'
DROP TABLE t1;
+#
+# MDEV-18278 Misleading error message in error log upon failed table creation
+#
+create table t1 (a int as (a));
+ERROR 01000: Expression for field `a` is referring to uninitialized field `a`
+show warnings;
+Level Code Message
+Error 4029 Expression for field `a` is referring to uninitialized field `a`
# end of 10.2 test
diff --git a/mysql-test/r/delayed_blob.result b/mysql-test/r/delayed_blob.result
new file mode 100644
index 00000000000..caa2e3ae5fe
--- /dev/null
+++ b/mysql-test/r/delayed_blob.result
@@ -0,0 +1,17 @@
+#
+# MDEV-25925 Warning: Memory not freed: 32 on INSERT DELAYED
+#
+SET sql_mode='TRADITIONAL';
+CREATE TABLE t1 (c BLOB) ENGINE=MyISAM;
+INSERT DELAYED INTO t1 VALUES (''||'');
+ERROR 22007: Truncated incorrect DOUBLE value: ''
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
+# MDEV-24467 Memory not freed after failed INSERT DELAYED
+#
+CREATE TABLE t1 (a VARCHAR(1)) ENGINE=MyISAM;
+ALTER TABLE t1 ADD b BLOB DEFAULT 'x';
+INSERT DELAYED INTO t1 (a) VALUES ('foo');
+ERROR 22001: Data too long for column 'a' at row 1
+DROP TABLE t1;
diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result
index 25237aa11a9..f5ef3c3a84d 100644
--- a/mysql-test/r/derived_cond_pushdown.result
+++ b/mysql-test/r/derived_cond_pushdown.result
@@ -10634,4 +10634,189 @@ m
7
drop view v1;
drop table t1;
+#
+# MDEV-25635: pushdown into grouping view using aggregate functions
+# with constant arguments via a mergeable derived table
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (3), (7), (7), (3);
+create view v1 as select a, sum(1) as f, sum(1) as g from t1 group by a;
+select * from v1;
+a f g
+1 1 1
+3 3 3
+7 3 3
+select * from (select * from v1) as dt where a=f and a=g;
+a f g
+1 1 1
+3 3 3
+explain extended select * from (select * from v1) as dt where a=f and a=g;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived3> ALL NULL NULL NULL NULL 7 100.00 Using where
+3 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using temporary; Using filesort
+Warnings:
+Note 1003 select `v1`.`a` AS `a`,`v1`.`f` AS `f`,`v1`.`g` AS `g` from `test`.`v1` where `v1`.`a` = `v1`.`f` and `v1`.`a` = `v1`.`g`
+create view v2 as select a, min(1) as f, min(1) as g from t1 group by a;
+select * from v2;
+a f g
+1 1 1
+3 1 1
+7 1 1
+select * from (select * from v2) as dt where a=f and a=g;
+a f g
+1 1 1
+explain extended select * from (select * from v2) as dt where a=f and a=g;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived3> ALL NULL NULL NULL NULL 7 100.00 Using where
+3 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using temporary; Using filesort
+Warnings:
+Note 1003 select `v2`.`a` AS `a`,`v2`.`f` AS `f`,`v2`.`g` AS `g` from `test`.`v2` where `v2`.`f` = `v2`.`a` and `v2`.`g` = `v2`.`a`
+drop view v1,v2;
+drop table t1;
+#
+# MDEV-25969: Condition pushdown into derived table doesn't work if select list uses SP
+#
+create function f1(a int) returns int DETERMINISTIC return (a+1);
+create table t1 (
+pk int primary key,
+a int,
+b int,
+key(a)
+);
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t3(a int);
+insert into t3 select A.a + B.a* 10 + C.a * 100 from t2 A, t2 B, t2 C;
+insert into t1 select a,a,a from t3;
+create view v1 as
+select
+t1.a as col1,
+f1(t1.b) as col2
+from
+t1;
+create view v2 as
+select
+t1.a as col1,
+f1(t1.b) as col2
+from
+t1;
+create view v3 as
+select col2, col1 from v1
+union all
+select col2, col1 from v2;
+explain select * from v3 where col1=123;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where
+2 DERIVED t1 ref a a 5 const 1
+3 UNION t1 ref a a 5 const 1
+# This must use ref accesses for reading table t1, not full scans:
+explain format=json
+select * from v3 where col1=123 and col2=321;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "v3.col1 = 123 and v3.col2 = 321",
+ "materialized": {
+ "query_block": {
+ "union_result": {
+ "table_name": "<union2,3>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["const"],
+ "rows": 1,
+ "filtered": 100
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 3,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["const"],
+ "rows": 1,
+ "filtered": 100
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+}
+drop function f1;
+drop view v1,v2,v3;
+drop table t1, t2,t3;
+#
+# Another testcase, with pushdown through GROUP BY
+#
+create table t1 (a int, b int);
+insert into t1 values (1,1),(2,2),(3,3);
+create function f1(a int) returns int DETERMINISTIC return (a+1);
+create view v2(a, a2, s) as
+select a, f1(a), sum(b) from t1 group by a, f1(a);
+# Here,
+# "(s+1) > 10" will be pushed into HAVING
+# "a > 1" will be pushed all the way to the table scan on t1
+# "a2>123" will be pushed into HAVING (as it refers to an SP call which
+# prevents pushing it to the WHERE)
+explain format=json
+select * from v2 where (s+1) > 10 AND a > 1 and a2>123;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100,
+ "attached_condition": "v2.s + 1 > 10 and v2.a > 1 and v2.a2 > 123",
+ "materialized": {
+ "query_block": {
+ "select_id": 2,
+ "having_condition": "s + 1 > 10 and a2 > 123",
+ "filesort": {
+ "sort_key": "t1.a, f1(t1.a)",
+ "temporary_table": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100,
+ "attached_condition": "t1.a > 1"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+drop view v2;
+drop function f1;
+drop table t1;
# End of 10.2 tests
diff --git a/mysql-test/r/derived_opt.result b/mysql-test/r/derived_opt.result
index 0e8b49d5714..069b0aa65c9 100644
--- a/mysql-test/r/derived_opt.result
+++ b/mysql-test/r/derived_opt.result
@@ -537,4 +537,31 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
set join_cache_level=default;
DROP TABLE t1,t2;
+set @save_optimizer_switch= @@optimizer_switch;
+set optimizer_switch="derived_merge=on";
+CREATE TABLE t1 (id int, d2 datetime, id1 int) ;
+insert into t1 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',3);
+CREATE TABLE t2 (id int, d1 datetime, id1 int) ;
+insert into t2 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',2);
+prepare stmt from "
+SELECT * from
+ (SELECT min(d2) AS d2, min(d1) AS d1 FROM
+ (SELECT t1.d2 AS d2, (SELECT t2.d1
+ FROM t2 WHERE t1.id1 = t2.id1
+ ORDER BY t2.id DESC LIMIT 1) AS d1
+ FROM t1
+ ) dt2
+ ) ca
+ ORDER BY ca.d2;";
+execute stmt;
+d2 d1
+2020-01-01 10:10:10 2020-01-01 10:10:10
+execute stmt;
+d2 d1
+2020-01-01 10:10:10 2020-01-01 10:10:10
+set optimizer_switch= @save_optimizer_switch;
+DROP TABLE t1, t2;
+#
+# End of 10.3 tests
+#
set optimizer_switch=@exit_optimizer_switch;
diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result
index fe25feb5a38..d8ee508f5db 100644
--- a/mysql-test/r/derived_view.result
+++ b/mysql-test/r/derived_view.result
@@ -3436,3 +3436,24 @@ Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,3 AS `d`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`c` AS `c` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`a` = 3 and `test`.`t1`.`pk` <= 2
drop view v1;
drop table t1,t2,t3;
+#
+# MDEV-25679: view / derived table defined as ordered select with LIMIT
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+create view v1 as (select a from t1 limit 2) order by a desc;
+(select a from t1 limit 2) order by a desc;
+a
+7
+3
+select * from v1;
+a
+7
+3
+select * from ((select a from t1 limit 2) order by a desc) dt;
+a
+7
+3
+drop view v1;
+drop table t1;
+# End of 10.2 tests
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 5118cc38fdf..709e91cca4d 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -49,7 +49,7 @@ a b
Full-text indexes are called collections
Only MyISAM tables support collections
select * from t1 where MATCH(a,b) AGAINST ("indexes" IN BOOLEAN MODE WITH QUERY EXPANSION);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'QUERY EXPANSION)' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH QUERY EXPANSION)' at line 1
explain select * from t1 where MATCH(a,b) AGAINST ("collections");
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext a a 0 1 Using where
diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result
index 8f014c89733..f8e78c79f5d 100644
--- a/mysql-test/r/func_json.result
+++ b/mysql-test/r/func_json.result
@@ -934,5 +934,11 @@ CAST(JSON_EXTRACT('{"x":false}', '$.x') AS DECIMAL) AS cd;
cf cd
0 0
#
+# MDEV-24585 Assertion `je->s.cs == nice_js->charset()' failed in json_nice.
+#
+SELECT JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' );
+JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' )
+["x"]
+#
# End of 10.2 tests
#
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 798b4f9ff09..f9346a25151 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -4835,3 +4835,15 @@ DROP TABLE t1;
#
# End of 10.1 tests
#
+#
+# Start of 10.2 tests
+#
+#
+# MDEV-24742 Server crashes in Charset::numchars / String::numchars
+#
+SELECT NULL IN (RIGHT(AES_ENCRYPT('foo','bar'), LAST_INSERT_ID()), 'qux');
+NULL IN (RIGHT(AES_ENCRYPT('foo','bar'), LAST_INSERT_ID()), 'qux')
+NULL
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/r/gis-json.result b/mysql-test/r/gis-json.result
index e52a7c809c6..ace9e9e9ae2 100644
--- a/mysql-test/r/gis-json.result
+++ b/mysql-test/r/gis-json.result
@@ -107,6 +107,16 @@ Warning 4076 Incorrect GeoJSON format - empty 'coordinates' array.
SELECT ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }");
ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }")
NULL
+SELECT ST_ASTEXT (ST_GEOMFROMGEOJSON ('{ "type": "GEOMETRYCOLLECTION", "coordinates": [102.0, 0.0]}'));
+ST_ASTEXT (ST_GEOMFROMGEOJSON ('{ "type": "GEOMETRYCOLLECTION", "coordinates": [102.0, 0.0]}'))
+NULL
+Warnings:
+Warning 4048 Incorrect GeoJSON format specified for st_geomfromgeojson function.
+SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type": ["POINT"], "coINates": [0,0] }'));
+ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type": ["POINT"], "coINates": [0,0] }'))
+NULL
+Warnings:
+Warning 4048 Incorrect GeoJSON format specified for st_geomfromgeojson function.
#
# End of 10.2 tests
#
diff --git a/mysql-test/r/grant5.result b/mysql-test/r/grant5.result
index a69070e8399..3b16d033f5e 100644
--- a/mysql-test/r/grant5.result
+++ b/mysql-test/r/grant5.result
@@ -8,7 +8,7 @@ connect conn_1, localhost, test,,;
set role foo;
show grants for test;
Grants for test@%
-GRANT foo TO 'test'@'%'
+GRANT 'foo' TO 'test'@'%'
GRANT USAGE ON *.* TO 'test'@'%'
show grants for foo;
Grants for foo
@@ -45,29 +45,60 @@ GRANT test_role TO test_user;
SET DEFAULT ROLE test_role FOR test_user;
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT test_role TO 'test_user'@'%'
+GRANT 'test_role' TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
-SET DEFAULT ROLE test_role FOR 'test_user'@'%'
+SET DEFAULT ROLE 'test_role' FOR 'test_user'@'%'
SET DEFAULT ROLE NONE for test_user;
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT test_role TO 'test_user'@'%'
+GRANT 'test_role' TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
SET ROLE test_role;
SET DEFAULT ROLE test_role;
SHOW GRANTS;
Grants for root@localhost
-GRANT test_role TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'test_role' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'test_role'
-SET DEFAULT ROLE test_role FOR 'root'@'localhost'
+SET DEFAULT ROLE 'test_role' FOR 'root'@'localhost'
SET DEFAULT ROLE NONE;
SHOW GRANTS;
Grants for root@localhost
-GRANT test_role TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'test_role' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'test_role'
DROP USER test_user;
DROP ROLE test_role;
+CREATE ROLE 'test-role';
+CREATE USER 'test-user';
+GRANT 'test-role' TO 'test-user';
+SET DEFAULT ROLE 'test-role' FOR 'test-user';
+SHOW GRANTS FOR 'test-user';
+Grants for test-user@%
+GRANT 'test-role' TO 'test-user'@'%'
+GRANT USAGE ON *.* TO 'test-user'@'%'
+SET DEFAULT ROLE 'test-role' FOR 'test-user'@'%'
+DROP ROLE 'test-role';
+SHOW GRANTS FOR 'test-user';
+Grants for test-user@%
+GRANT USAGE ON *.* TO 'test-user'@'%'
+SET DEFAULT ROLE 'test-role' FOR 'test-user'@'%'
+SET DEFAULT ROLE NONE FOR 'test-user';
+SHOW GRANTS FOR 'test-user';
+Grants for test-user@%
+GRANT USAGE ON *.* TO 'test-user'@'%'
+CREATE ROLE `r``o'l"e`;
+select user from mysql.user where is_role='Y';
+user
+r`o'l"e
+GRANT `r``o'l"e` TO 'test-user';
+SET DEFAULT ROLE `r``o'l"e` FOR 'test-user';
+SHOW GRANTS FOR 'test-user';
+Grants for test-user@%
+GRANT 'r`o'l"e' TO 'test-user'@'%'
+GRANT USAGE ON *.* TO 'test-user'@'%'
+SET DEFAULT ROLE 'r`o'l"e' FOR 'test-user'@'%'
+DROP ROLE `r``o'l"e`;
+DROP USER 'test-user';
diff --git a/mysql-test/r/information_schema-big.result b/mysql-test/r/information_schema-big.result
index 0ed74d113ea..5c519014800 100644
--- a/mysql-test/r/information_schema-big.result
+++ b/mysql-test/r/information_schema-big.result
@@ -34,6 +34,7 @@ GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
+KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
@@ -48,6 +49,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
SPATIAL_REF_SYS SRID
+SQL_FUNCTIONS FUNCTION
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
@@ -92,6 +94,7 @@ GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
+KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
@@ -106,6 +109,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
SPATIAL_REF_SYS SRID
+SQL_FUNCTIONS FUNCTION
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 1594ebf75e0..cc9cf842570 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -65,6 +65,7 @@ GEOMETRY_COLUMNS
GLOBAL_STATUS
GLOBAL_VARIABLES
INDEX_STATISTICS
+KEYWORDS
KEY_CACHES
KEY_COLUMN_USAGE
PARAMETERS
@@ -79,6 +80,7 @@ SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
SPATIAL_REF_SYS
+SQL_FUNCTIONS
STATISTICS
SYSTEM_VARIABLES
TABLES
@@ -2208,5 +2210,25 @@ SELECT * FROM v LIMIT ROWS EXAMINED 9;
ERROR HY000: Sort aborted:
DROP VIEW v;
#
+# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
+#
+CREATE TABLE t (a INT);
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1');
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=CONCAT('test',0x00,'1');
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
+DROP TABLE t;
+CREATE TABLE `a/~.b` (a INT);
+SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='a/~.b';
+TABLE_SCHEMA TABLE_NAME
+test a/~.b
+DROP TABLE `a/~.b`;
+CREATE DATABASE `a/~.b`;
+CREATE TABLE `a/~.b`.t1 (a INT);
+SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='a/~.b';
+TABLE_SCHEMA TABLE_NAME
+a/~.b t1
+DROP DATABASE `a/~.b`;
+#
# End of 10.2 Test
#
diff --git a/mysql-test/r/information_schema_all_engines.result b/mysql-test/r/information_schema_all_engines.result
index 0ce9f15f753..542299ca5c1 100644
--- a/mysql-test/r/information_schema_all_engines.result
+++ b/mysql-test/r/information_schema_all_engines.result
@@ -41,6 +41,7 @@ INNODB_SYS_VIRTUAL
INNODB_TABLESPACES_ENCRYPTION
INNODB_TABLESPACES_SCRUBBING
INNODB_TRX
+KEYWORDS
KEY_CACHES
KEY_COLUMN_USAGE
PARAMETERS
@@ -55,6 +56,7 @@ SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
SPATIAL_REF_SYS
+SQL_FUNCTIONS
STATISTICS
SYSTEM_VARIABLES
TABLES
@@ -121,6 +123,7 @@ INNODB_SYS_VIRTUAL TABLE_ID
INNODB_TABLESPACES_ENCRYPTION SPACE
INNODB_TABLESPACES_SCRUBBING SPACE
INNODB_TRX trx_id
+KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
@@ -135,6 +138,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
SPATIAL_REF_SYS SRID
+SQL_FUNCTIONS FUNCTION
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
@@ -201,6 +205,7 @@ INNODB_SYS_VIRTUAL TABLE_ID
INNODB_TABLESPACES_ENCRYPTION SPACE
INNODB_TABLESPACES_SCRUBBING SPACE
INNODB_TRX trx_id
+KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
@@ -215,6 +220,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
SPATIAL_REF_SYS SRID
+SQL_FUNCTIONS FUNCTION
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
@@ -356,6 +362,7 @@ Database: information_schema
| INNODB_TABLESPACES_ENCRYPTION |
| INNODB_TABLESPACES_SCRUBBING |
| INNODB_TRX |
+| KEYWORDS |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
| PARAMETERS |
@@ -370,6 +377,7 @@ Database: information_schema
| SESSION_STATUS |
| SESSION_VARIABLES |
| SPATIAL_REF_SYS |
+| SQL_FUNCTIONS |
| STATISTICS |
| SYSTEM_VARIABLES |
| TABLES |
@@ -426,6 +434,7 @@ Database: INFORMATION_SCHEMA
| INNODB_TABLESPACES_ENCRYPTION |
| INNODB_TABLESPACES_SCRUBBING |
| INNODB_TRX |
+| KEYWORDS |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
| PARAMETERS |
@@ -440,6 +449,7 @@ Database: INFORMATION_SCHEMA
| SESSION_STATUS |
| SESSION_VARIABLES |
| SPATIAL_REF_SYS |
+| SQL_FUNCTIONS |
| STATISTICS |
| SYSTEM_VARIABLES |
| TABLES |
@@ -459,5 +469,5 @@ Wildcard: inf_rmation_schema
| information_schema |
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
table_schema count(*)
-information_schema 65
+information_schema 67
mysql 30
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index fdc36b74f63..1995640638a 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -2682,4 +2682,44 @@ id timestamp modifiedBy id REV REVTYPE profile_id id REV person_id id REV
12 1294650860266 u62C^Kzx3wH8 8 12 2 2 2 117548 300006 300006 97697
DROP TABLE t1,t2,t3,t4;
# end of 10.1 tests
+#
+# MDEV-25362: name resolution for subqueries in ON expressions
+#
+create table t1 (a int, b int);
+create table t2 (c int, d int);
+create table t3 (e int, f int);
+create table t4 (g int, h int);
+explain
+select *
+from
+t1 left join
+(t2
+join
+t3 on
+(t3.f=t1.a)
+) on (t2.c=t1.a );
+ERROR 42S22: Unknown column 't1.a' in 'on clause'
+explain
+select *
+from
+t1 left join
+(t2
+join
+t3 on
+(t3.f=(select max(g) from t4 where t4.h=t1.a))
+) on (t2.c=t1.a );
+ERROR 42S22: Unknown column 't1.a' in 'where clause'
+drop table t1,t2,t3,t4;
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2 (b int);
+insert into t2 values (1),(2);
+create table t3 (c int);
+insert into t3 values (1),(2);
+select * from ( select * from t1 left join t2
+on b in (select x from t3 as sq1)
+) as sq2;
+ERROR 42S22: Unknown column 'x' in 'field list'
+drop table t1,t2,t3;
+# end of 10.2 tests
SET optimizer_switch=@org_optimizer_switch;
diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result
index 6a6b1007866..58df4203c17 100644
--- a/mysql-test/r/join_outer_jcl6.result
+++ b/mysql-test/r/join_outer_jcl6.result
@@ -2690,6 +2690,46 @@ id timestamp modifiedBy id REV REVTYPE profile_id id REV person_id id REV
12 1294650860266 u62C^Kzx3wH8 8 12 2 2 2 117548 300006 300006 97697
DROP TABLE t1,t2,t3,t4;
# end of 10.1 tests
+#
+# MDEV-25362: name resolution for subqueries in ON expressions
+#
+create table t1 (a int, b int);
+create table t2 (c int, d int);
+create table t3 (e int, f int);
+create table t4 (g int, h int);
+explain
+select *
+from
+t1 left join
+(t2
+join
+t3 on
+(t3.f=t1.a)
+) on (t2.c=t1.a );
+ERROR 42S22: Unknown column 't1.a' in 'on clause'
+explain
+select *
+from
+t1 left join
+(t2
+join
+t3 on
+(t3.f=(select max(g) from t4 where t4.h=t1.a))
+) on (t2.c=t1.a );
+ERROR 42S22: Unknown column 't1.a' in 'where clause'
+drop table t1,t2,t3,t4;
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2 (b int);
+insert into t2 values (1),(2);
+create table t3 (c int);
+insert into t3 values (1),(2);
+select * from ( select * from t1 left join t2
+on b in (select x from t3 as sq1)
+) as sq2;
+ERROR 42S22: Unknown column 'x' in 'field list'
+drop table t1,t2,t3;
+# end of 10.2 tests
SET optimizer_switch=@org_optimizer_switch;
set join_cache_level=default;
set @@optimizer_switch=@save_optimizer_switch_jcl6;
diff --git a/mysql-test/r/mdev-504.result b/mysql-test/r/mdev-504.result
deleted file mode 100644
index 9b8b6795e0f..00000000000
--- a/mysql-test/r/mdev-504.result
+++ /dev/null
@@ -1,24 +0,0 @@
-SET GLOBAL net_write_timeout = 900;
-CREATE TABLE A (
-pk INTEGER AUTO_INCREMENT PRIMARY KEY,
-fdate DATE
-) ENGINE=MyISAM;
-CREATE PROCEDURE p_analyze()
-BEGIN
-DECLARE attempts INTEGER DEFAULT 100;
-wl_loop: WHILE attempts > 0 DO
-ANALYZE TABLE A;
-SET attempts = attempts - 1;
-END WHILE wl_loop;
-END |
-CREATE FUNCTION rnd3() RETURNS INT
-BEGIN
-RETURN ROUND(3 * RAND() + 0.5);
-END |
-SET GLOBAL use_stat_tables = PREFERABLY;
-connection default;
-DROP TABLE A;
-DROP PROCEDURE p_analyze;
-DROP FUNCTION rnd3;
-SET GLOBAL use_stat_tables = DEFAULT;
-SET GLOBAL net_write_timeout = DEFAULT;
diff --git a/mysql-test/r/mdev19198.result b/mysql-test/r/mdev19198.result
new file mode 100644
index 00000000000..77c08ca0fb7
--- /dev/null
+++ b/mysql-test/r/mdev19198.result
@@ -0,0 +1,15 @@
+CREATE TABLE t1 (c INT);
+CREATE TABLE t2 (c INT);
+LOCK TABLES t1 WRITE, t2 READ;
+CREATE TABLE IF NOT EXISTS t1 LIKE t2;
+Warnings:
+Note 1050 Table 't1' already exists
+UNLOCK TABLES;
+LOCK TABLES t1 READ , t2 READ;
+CREATE TABLE IF NOT EXISTS t1 LIKE t2;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+CREATE TABLE IF NOT EXISTS t1 LIKE t2;
+Warnings:
+Note 1050 Table 't1' already exists
+DROP TABLES t1,t2;
diff --git a/mysql-test/r/mdev_22370.result b/mysql-test/r/mdev_22370.result
new file mode 100644
index 00000000000..d422ee6e81f
--- /dev/null
+++ b/mysql-test/r/mdev_22370.result
@@ -0,0 +1,4 @@
+connect con1,localhost,root,,;
+SET DEBUG_DBUG='+d,mark_busy_mdev_22370';
+FLUSH TABLES WITH READ LOCK;
+connection default;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index a5c60d6dfc2..1532ebb6420 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -1043,3 +1043,56 @@ drop function f1;
#
# end of 5.5 tests
#
+#
+# MDEV-24823: Invalid multi-table update of view within SP
+#
+create table t1 (id int) engine=myisam;
+insert into t1 values (1),(2),(1);
+create table t2 (pk int, c0 int) engine=myisam;
+insert into t2 values (1,1), (2,3);
+create view v2 as select * from t2;
+create view v3 as select * from t2 where c0 < 3;
+create procedure sp0() update t1, v2 set v2.pk = 1 where v2.c0 = t1.c1;
+call sp0();
+ERROR 42S22: Unknown column 't1.c1' in 'where clause'
+call sp0();
+ERROR 42S22: Unknown column 't1.c1' in 'where clause'
+create procedure sp1() update (t1 join v2 on v2.c0 = t1.c1) set v2.pk = 1;
+call sp1();
+ERROR 42S22: Unknown column 't1.c1' in 'on clause'
+call sp1();
+ERROR 42S22: Unknown column 't1.c1' in 'on clause'
+create procedure sp2() update (t1 join v3 on v3.c0 = t1.c1) set v3.pk = 1;
+call sp2();
+ERROR 42S22: Unknown column 't1.c1' in 'on clause'
+call sp2();
+ERROR 42S22: Unknown column 't1.c1' in 'on clause'
+create procedure sp3()
+update (t1 join v2 on v2.c0 = t1.id) set v2.c0 = v2.c0+1;
+select * from t2;
+pk c0
+1 1
+2 3
+call sp3();
+select * from t2;
+pk c0
+1 2
+2 3
+call sp3();
+select * from t2;
+pk c0
+1 3
+2 3
+create procedure sp4() delete t1 from t1 join v2 on v2.c0 = t1.c1;
+call sp4();
+ERROR 42S22: Unknown column 't1.c1' in 'on clause'
+call sp4();
+ERROR 42S22: Unknown column 't1.c1' in 'on clause'
+drop procedure sp0;
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop procedure sp4;
+drop view v2,v3;
+drop table t1,t2;
+# End of 10.2 tests
diff --git a/mysql-test/r/mysql_binary_zero_insert.result b/mysql-test/r/mysql_binary_zero_insert.result
new file mode 100644
index 00000000000..0bed7487b3e
--- /dev/null
+++ b/mysql-test/r/mysql_binary_zero_insert.result
@@ -0,0 +1,54 @@
+# Note: This test assumes NO_BACKSLASH_ESCAPES is not set in SQL_MODE.
+##############################
+# Setup
+##############################
+#
+# Saving old state
+#
+set @old_sql_mode= @@global.SQL_MODE;
+set @@global.SQL_MODE= "";
+#
+# Create table for data entry
+#
+CREATE TABLE tb (`id` int(11) NOT NULL AUTO_INCREMENT,`cb` longblob DEFAULT NULL, PRIMARY KEY (`id`)) AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
+RESET MASTER;
+##############################
+# Test Case
+##############################
+#
+# \0 (0x5c00 in binary) should be allowed in data strings if
+# --binary-mode is enabled.
+#
+FOUND 10 /\x5c\x00/ in binary_zero_inserts.sql
+# MYSQL --binary-mode test < MYSQL_TMP_DIR/binary_zero_inserts.sql
+#
+# Ensure a row exists from each insert statement with a \0
+#
+SELECT COUNT(*)=8 from tb;
+COUNT(*)=8
+1
+#
+# Ensure that the binary zero was parsed and exists in the row data
+# Note: We only look for 00 because the 5c only served as an escape
+# in parsing.
+#
+# MYSQL_DUMP test tb --hex-blob | grep INSERT > MYSQL_TMP_DIR/dump.sql
+FOUND 10 /00/ in dump.sql
+#
+# Ensure data consistency on mysqlbinlog replay
+#
+FLUSH LOGS;
+# MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > MYSQL_TMP_DIR/binlog_zeros.sql
+FOUND 10 /\x5c\x00/ in binlog_zeros.sql
+# MYSQL --binary-mode test < MYSQL_TMP_DIR/binlog_zeros.sql
+# Table checksum is equivalent before and after binlog replay
+#
+# A \0 should still be treated as end-of-query in binary mode.
+#
+# MYSQL --binary-mode -B test < MYSQL_TMP_DIR/binary_zero_eoq.sql
+##############################
+# Cleanup
+##############################
+SET @@global.sql_mode= @old_sql_mode;
+drop table tb;
+RESET MASTER;
diff --git a/mysql-test/r/mysql_client_test.result b/mysql-test/r/mysql_client_test.result
index 9538475fb86..37a735286da 100644
--- a/mysql-test/r/mysql_client_test.result
+++ b/mysql-test/r/mysql_client_test.result
@@ -126,6 +126,11 @@ Data:
EOF
mysql_stmt_next_result(): 0; field_count: 0
# ------------------------------------
+# cat MYSQL_TMP_DIR/test_mdev26145.out.log
+# ------------------------------------
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def MAX(a) MAX(a) 3 11 0 Y 32768 0 63
+# ------------------------------------
SET @@global.general_log= @old_general_log;
SET @@global.slow_query_log= @old_slow_query_log;
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 3961c7e8c27..79c15984a12 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -840,15 +840,15 @@ CREATE ROLE `aRole`;
SET DEFAULT ROLE aRole;
SHOW GRANTS;
Grants for root@localhost
-GRANT aRole TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'aRole' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'aRole'
-SET DEFAULT ROLE aRole FOR 'root'@'localhost'
+SET DEFAULT ROLE 'aRole' FOR 'root'@'localhost'
SET DEFAULT ROLE NONE;
SHOW GRANTS;
Grants for root@localhost
-GRANT aRole TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'aRole' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'aRole'
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index 94f2ea0a28c..b24b9ee735f 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -1314,7 +1314,7 @@ lc-messages-dir MYSQL_SHAREDIR/
lc-time-names en_US
local-infile TRUE
lock-wait-timeout 86400
-log-bin (No default value)
+log-bin foo
log-bin-compress FALSE
log-bin-compress-min-len 256
log-bin-index (No default value)
diff --git a/mysql-test/r/mysqldump-system.result b/mysql-test/r/mysqldump-system.result
index 74cfc4e9882..7746417715f 100644
--- a/mysql-test/r/mysqldump-system.result
+++ b/mysql-test/r/mysqldump-system.result
@@ -61,17 +61,17 @@ SET ROLE mariadb_dump_import_role;
/*!80001 CREATE ROLE 'role_2' */;
/*M!100005 CREATE ROLE 'role_2' WITH ADMIN mariadb_dump_import_role */;
/*M!100005 GRANT 'role_2' TO 'role_1' WITH ADMIN OPTION */;
-GRANT role_1 TO 'root'@'localhost' WITH ADMIN OPTION;
+GRANT 'role_1' TO 'root'@'localhost' WITH ADMIN OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION;
/*M!100005 SET DEFAULT ROLE NONE FOR 'root'@'localhost' */;
/*!80001 ALTER USER 'root'@'localhost' DEFAULT ROLE NONE */;
-GRANT role_1 TO 'USER'@'%';
-GRANT role_2 TO 'USER'@'%';
+GRANT 'role_1' TO 'USER'@'%';
+GRANT 'role_2' TO 'USER'@'%';
GRANT USAGE ON *.* TO 'USER'@'%' IDENTIFIED VIA unix_socket;
/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'USER'@'%' */;
/*!80001 ALTER USER 'USER'@'%' DEFAULT ROLE 'role_2' */;
-GRANT role_2 TO 'role_1' WITH ADMIN OPTION;
+GRANT 'role_2' TO 'role_1' WITH ADMIN OPTION;
GRANT SHOW DATABASES ON *.* TO 'role_1';
GRANT USAGE ON *.* TO 'role_2';
GRANT USAGE ON *.* TO 'role_2';
@@ -196,17 +196,17 @@ SET ROLE mariadb_dump_import_role;
/*!80001 CREATE ROLE 'role_2' */;
/*M!100103 CREATE OR REPLACE ROLE 'role_2' WITH ADMIN mariadb_dump_import_role */;
/*M!100005 GRANT 'role_2' TO 'role_1' WITH ADMIN OPTION */;
-GRANT role_1 TO 'root'@'localhost' WITH ADMIN OPTION;
+GRANT 'role_1' TO 'root'@'localhost' WITH ADMIN OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION;
/*M!100005 SET DEFAULT ROLE NONE FOR 'root'@'localhost' */;
/*!80001 ALTER USER 'root'@'localhost' DEFAULT ROLE NONE */;
-GRANT role_1 TO 'USER'@'%';
-GRANT role_2 TO 'USER'@'%';
+GRANT 'role_1' TO 'USER'@'%';
+GRANT 'role_2' TO 'USER'@'%';
GRANT USAGE ON *.* TO 'USER'@'%' IDENTIFIED VIA unix_socket;
/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'USER'@'%' */;
/*!80001 ALTER USER 'USER'@'%' DEFAULT ROLE 'role_2' */;
-GRANT role_2 TO 'role_1' WITH ADMIN OPTION;
+GRANT 'role_2' TO 'role_1' WITH ADMIN OPTION;
GRANT SHOW DATABASES ON *.* TO 'role_1';
GRANT USAGE ON *.* TO 'role_2';
GRANT USAGE ON *.* TO 'role_2';
@@ -317,17 +317,17 @@ SET ROLE mariadb_dump_import_role;
/*!80001 CREATE ROLE IF NOT EXISTS 'role_2' */;
/*M!100005 CREATE ROLE IF NOT EXISTS 'role_2' WITH ADMIN mariadb_dump_import_role */;
/*M!100005 GRANT 'role_2' TO 'role_1' WITH ADMIN OPTION */;
-GRANT role_1 TO 'root'@'localhost' WITH ADMIN OPTION;
+GRANT 'role_1' TO 'root'@'localhost' WITH ADMIN OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION;
/*M!100005 SET DEFAULT ROLE NONE FOR 'root'@'localhost' */;
/*!80001 ALTER USER 'root'@'localhost' DEFAULT ROLE NONE */;
-GRANT role_1 TO 'USER'@'%';
-GRANT role_2 TO 'USER'@'%';
+GRANT 'role_1' TO 'USER'@'%';
+GRANT 'role_2' TO 'USER'@'%';
GRANT USAGE ON *.* TO 'USER'@'%' IDENTIFIED VIA unix_socket;
/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'USER'@'%' */;
/*!80001 ALTER USER 'USER'@'%' DEFAULT ROLE 'role_2' */;
-GRANT role_2 TO 'role_1' WITH ADMIN OPTION;
+GRANT 'role_2' TO 'role_1' WITH ADMIN OPTION;
GRANT SHOW DATABASES ON *.* TO 'role_1';
GRANT USAGE ON *.* TO 'role_2';
GRANT USAGE ON *.* TO 'role_2';
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index b1441013bc8..39b4e25d670 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -3460,4 +3460,29 @@ SET max_length_for_sort_data=@save_max_length_for_sort_data;
SET max_sort_length= @save_max_sort_length;
SET sql_select_limit= @save_sql_select_limit;
DROP TABLE t1;
+#
+# MDEV-25682: EXPLAIN for SELECT with ORDER BY after [ORDER BY] LIMIT
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+explain (select a from t1 limit 2) order by a desc;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+NULL UNION RESULT <union1> ALL NULL NULL NULL NULL NULL Using filesort
+(select a from t1 limit 2) order by a desc;
+a
+7
+3
+create table t2 (a int, b int);
+insert into t2 values (3,70), (7,10), (1,40), (4,30);
+explain (select b,a from t2 order by a limit 3) order by b desc;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using filesort
+NULL UNION RESULT <union1> ALL NULL NULL NULL NULL NULL Using filesort
+(select b,a from t2 order by a limit 3) order by b desc;
+b a
+70 3
+40 1
+30 4
+drop table t1,t2;
# End of 10.2 tests
diff --git a/mysql-test/r/order_by_innodb.result b/mysql-test/r/order_by_innodb.result
index 9cdf9800cee..14b9b861a14 100644
--- a/mysql-test/r/order_by_innodb.result
+++ b/mysql-test/r/order_by_innodb.result
@@ -147,4 +147,56 @@ i n
656 eight
set optimizer_switch= @save_optimizer_switch;
DROP TABLE t1,t2,t3;
+#
+# MDEV-25858: Query results are incorrect when indexes are added
+#
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY) engine=innodb;
+insert into t1 values (1),(2),(3);
+CREATE TABLE t2 (
+id int NOT NULL PRIMARY KEY,
+id2 int NOT NULL,
+d1 datetime,
+d2 timestamp NOT NULL,
+KEY id2 (id2)
+) engine=innodb;
+insert into t2 values
+(1,2,'2019-03-05 00:00:00','2019-03-06 00:00:00'),
+(2,3,'2019-03-05 00:00:00','2019-03-06 00:00:00'),
+(3,3,'2019-03-06 00:00:00','2019-03-05 00:00:00');
+select
+t1.id,t2.id
+from
+t1 left join
+t2 on t2.id2 = t1.id and
+t2.id = (select dd.id
+from t2 dd
+where
+dd.id2 = t1.id and
+d1 > '2019-02-06 00:00:00'
+ order by
+dd.d1 desc, dd.d2 desc, dd.id desc limit 1
+);
+id id
+1 NULL
+2 1
+3 3
+create index for_latest_sort on t2 (d1 desc, d2 desc, id desc);
+select
+t1.id,t2.id
+from
+t1 left join
+t2 on t2.id2 = t1.id and
+t2.id = (select dd.id
+from t2 dd
+where
+dd.id2 = t1.id and
+d1 > '2019-02-06 00:00:00'
+ order by
+dd.d1 desc, dd.d2 desc, dd.id desc limit 1
+);
+id id
+1 NULL
+2 1
+3 3
+drop table t1,t2;
# End of 10.2 tests
diff --git a/mysql-test/r/plugin_vars.result b/mysql-test/r/plugin_vars.result
index 0e382427b1d..3fadd5e74fd 100644
--- a/mysql-test/r/plugin_vars.result
+++ b/mysql-test/r/plugin_vars.result
@@ -30,3 +30,38 @@ disconnect con2;
USE test;
DROP PROCEDURE p_install;
DROP PROCEDURE p_show_vars;
+#
+# Bug#29363867: LOST CONNECTION TO MYSQL SERVER DURING QUERY
+#
+## prepared SET with a plugin variable prevents uninstall
+install plugin query_response_time soname 'query_response_time';
+prepare s from 'set global query_response_time_range_base=16';
+select plugin_status from information_schema.plugins where plugin_name='query_response_time';
+plugin_status
+ACTIVE
+uninstall plugin query_response_time;
+Warnings:
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+execute s;
+execute s;
+select plugin_status from information_schema.plugins where plugin_name='query_response_time';
+plugin_status
+DELETED
+deallocate prepare s;
+select plugin_status from information_schema.plugins where plugin_name='query_response_time';
+plugin_status
+## prepared SET mentioning a plugin otherwise does not prevent uninstall
+install plugin archive soname 'ha_archive';
+create table t1 (a int) engine=archive;
+insert t1 values (1),(2),(3);
+prepare s from 'set session auto_increment_increment=(select count(*) from t1)';
+flush tables;
+select plugin_status from information_schema.plugins where plugin_name='archive';
+plugin_status
+ACTIVE
+uninstall plugin archive;
+select plugin_status from information_schema.plugins where plugin_name='archive';
+plugin_status
+execute s;
+ERROR 42000: Unknown storage engine 'ARCHIVE'
+drop table t1;
diff --git a/mysql-test/r/processlist_notembedded.result b/mysql-test/r/processlist_notembedded.result
index ddde45f3031..46b1f0669cb 100644
--- a/mysql-test/r/processlist_notembedded.result
+++ b/mysql-test/r/processlist_notembedded.result
@@ -1,7 +1,7 @@
#
# MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
#
-connect con1,localhost,root,,;
+connect con1,localhost,root;
connection con1;
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go';
connection default;
@@ -13,17 +13,22 @@ user
disconnect con1;
connection default;
SET DEBUG_SYNC = 'RESET';
-End of 5.5 tests
+#
+# End of 5.5 tests
+#
#
# MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep
#
-connect con1,localhost,root,,;
-select sleep(100000);;
+connect con1,localhost,root;
+select sleep(100000);
connection default;
-SHOW EXPLAIN FOR con_id;
+SHOW EXPLAIN FOR $con_id;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select sleep(100000)
-KILL QUERY con_id;
+KILL QUERY $con_id;
+disconnect con1;
+#
# End of 10.2 tests
+#
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 17284a3cad8..f1f779ef03f 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -5419,5 +5419,60 @@ id select_type table type possible_keys key key_len ref rows Extra
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
#
+# MDEV-25108: Running of the EXPLAIN EXTENDED statement produces extra warning
+# in case it is executed in PS (prepared statement) mode
+#
+CREATE TABLE t1 (c int);
+CREATE TABLE t2 (d int);
+# EXPLAIN EXTENDED in regular way (not PS mode)
+EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 const row not found
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
+Note 1003 select (select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
+SHOW WARNINGS;
+Level Code Message
+Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
+Note 1003 select (select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
+# Now run the same EXPLAIN EXTENDED in PS mode. Number of warnings
+# and their content must be the same as in case running the statement
+# in regular way
+PREPARE stmt FROM "EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1";
+Warnings:
+Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 const row not found
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
+Note 1003 select (select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
+SHOW WARNINGS;
+Level Code Message
+Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
+Note 1003 select (select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# MDEV-25576: The statement EXPLAIN running as regular statement and
+# as prepared statement produces different results for
+# UPDATE with subquery
+#
+CREATE TABLE t1 (c1 INT KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (c2 INT) ENGINE=MyISAM;
+CREATE TABLE t3 (c3 INT) ENGINE=MyISAM;
+EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 );
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+PREPARE stmt FROM "EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 )";
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2, t3;
# End of 10.2 tests
#
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result
index 5452919aa6d..bf240af3c47 100644
--- a/mysql-test/r/selectivity_innodb.result
+++ b/mysql-test/r/selectivity_innodb.result
@@ -2103,6 +2103,57 @@ drop view v1;
#
# End of 10.1 tests
#
+#
+# MDEV-17783: AddressSanitizer: stack-buffer-overflow in table_cond_selectivity
+#
+set
+@tmp_jcl=@@join_cache_level,
+@tmp_sel=@@optimizer_use_condition_selectivity;
+set
+join_cache_level=3,
+optimizer_use_condition_selectivity=2;
+CREATE TABLE t1 (
+c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int,
+c11 int, c12 int, c13 int, c14 int, c15 int, c16 int, c17 int, c18 int, c19 int,
+c20 int, c21 int, c22 int, c23 int, c24 int, c25 int, c26 int, c27 int, c28 int,
+c29 int, c30 int, c31 int, c32 int, c33 int, c34 int
+) ENGINE=InnoDB;
+SELECT * FROM t1
+WHERE
+(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10,
+c11, c12, c13, c14, c15, c16, c17, c18, c19,
+c20, c21, c22, c23, c24, c25, c26, c27, c28, c29,
+c30, c31, c32, c33, c34) IN (SELECT * FROM t1) ;
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 c33 c34
+set
+join_cache_level=@tmp_jcl,
+optimizer_use_condition_selectivity=@tmp_sel;
+drop table t1;
+#
+# MDEV-25013: SIGSEGV in best_extension_by_limited_search | SIGSEGV in restore_prev_nj_state
+#
+SET join_cache_level=3;
+CREATE TABLE t1 (
+TEXT1 TEXT, TEXT2 TEXT, TEXT3 TEXT, TEXT4 TEXT, TEXT5 TEXT,
+TEXT6 TEXT, TEXT7 TEXT, TEXT8 TEXT, TEXT9 TEXT, TEXT10 TEXT,
+TEXT11 TEXT, TEXT12 TEXT,TEXT13 TEXT,TEXT14 TEXT,TEXT15 TEXT,
+TEXT16 TEXT,TEXT17 TEXT,TEXT18 TEXT,TEXT19 TEXT,TEXT20 TEXT,
+TEXT21 TEXT,TEXT22 TEXT,TEXT23 TEXT,TEXT24 TEXT,TEXT25 TEXT,
+TEXT26 TEXT,TEXT27 TEXT,TEXT28 TEXT,TEXT29 TEXT,TEXT30 TEXT,
+TEXT31 TEXT,TEXT32 TEXT,TEXT33 TEXT,TEXT34 TEXT,TEXT35 TEXT,
+TEXT36 TEXT,TEXT37 TEXT,TEXT38 TEXT,TEXT39 TEXT,TEXT40 TEXT,
+TEXT41 TEXT,TEXT42 TEXT,TEXT43 TEXT,TEXT44 TEXT,TEXT45 TEXT,
+TEXT46 TEXT,TEXT47 TEXT,TEXT48 TEXT,TEXT49 TEXT,TEXT50 TEXT
+) ENGINE=InnoDB;
+EXPLAIN SELECT 1 FROM t1 NATURAL JOIN t1 AS t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 150 test.t1.TEXT1,test.t1.TEXT2,test.t1.TEXT3,test.t1.TEXT4,test.t1.TEXT5,test.t1.TEXT6,test.t1.TEXT7,test.t1.TEXT8,test.t1.TEXT9,test.t1.TEXT10,test.t1.TEXT11,test.t1.TEXT12,test.t1.TEXT13,test.t1.TEXT14,test.t1.TEXT15,test.t1.TEXT16,test.t1.TEXT17,test.t1.TEXT18,test.t1.TEXT19,test.t1.TEXT20,test.t1.TEXT21,test.t1.TEXT22,test.t1.TEXT23,test.t1.TEXT24,test.t1.TEXT25,test.t1.TEXT26,test.t1.TEXT27,test.t1.TEXT28,test.t1.TEXT29,test.t1.TEXT30,test.t1.TEXT31,test.t1.TEXT32,test.t1.TEXT33,test.t1.TEXT34,test.t1.TEXT35,test.t1.TEXT36,test.t1.TEXT37,test.t1.TEXT38,test.t1.TEXT39,test.t1.TEXT40,test.t1.TEXT41,test.t1.TEXT42,test.t1.TEXT43,test.t1.TEXT44,test.t1.TEXT45,test.t1.TEXT46,test.t1.TEXT47,test.t1.TEXT48,test.t1.TEXT49,test.t1.TEXT50 1 Using where; Using join buffer (flat, BNLH join)
+set join_cache_level=@tmp_jcl;
+drop table t1;
+#
+# End of 10.1 tests
+#
set use_stat_tables= @tmp_ust;
set optimizer_use_condition_selectivity= @tmp_oucs;
set @@global.histogram_size=@save_histogram_size;
diff --git a/mysql-test/r/selectivity_no_engine.result b/mysql-test/r/selectivity_no_engine.result
index 7fc3c6e9909..74a52c9fed8 100644
--- a/mysql-test/r/selectivity_no_engine.result
+++ b/mysql-test/r/selectivity_no_engine.result
@@ -293,6 +293,26 @@ SELECT * FROM t1 WHERE t1.d = 0 AND t1.p = '1' AND t1.i != '-1' AND t1.n = 'some
i n d p
set optimizer_use_condition_selectivity= @tmp_mdev8779;
DROP TABLE t1;
+#
+# MDEV-23937: SIGSEGV in looped best_extension_by_limited_search from greedy_search
+# (Testcase only)
+#
+set
+@tmp_jcl= @@join_cache_level,
+@tmp_ucs= @@optimizer_use_condition_selectivity;
+set
+join_cache_level=3,
+optimizer_use_condition_selectivity=2;
+CREATE TABLE t1 AS SELECT * FROM mysql.user;
+CREATE TABLE t3 (b VARCHAR (1));
+CREATE TABLE t2 (c2 INT);
+INSERT INTO t2 VALUES (1);
+EXPLAIN
+SELECT * FROM t1 AS a NATURAL JOIN t1 AS b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE a ALL NULL NULL NULL NULL 4
+1 SIMPLE b hash_ALL NULL #hash#$hj 827 test.a.Host,test.a.User,test.a.Password,test.a.Select_priv,test.a.Insert_priv,test.a.Update_priv,test.a.Delete_priv,test.a.Create_priv,test.a.Drop_priv,test.a.Reload_priv,test.a.Shutdown_priv,test.a.Process_priv,test.a.File_priv,test.a.Grant_priv,test.a.References_priv,test.a.Index_priv,test.a.Alter_priv,test.a.Show_db_priv,test.a.Super_priv,test.a.Create_tmp_table_priv,test.a.Lock_tables_priv,test.a.Execute_priv,test.a.Repl_slave_priv,test.a.Repl_client_priv,test.a.Create_view_priv,test.a.Show_view_priv,test.a.Create_routine_priv,test.a.Alter_routine_priv,test.a.Create_user_priv,test.a.Event_priv,test.a.Trigger_priv,test.a.Create_tablespace_priv,test.a.ssl_type,test.a.ssl_cipher,test.a.x509_issuer,test.a.x509_subject,test.a.max_questions,test.a.max_updates,test.a.max_connections,test.a.max_user_connections,test.a.plugin,test.a.authentication_string,test.a.password_expired,test.a.is_role,test.a.default_role,test.a.max_statement_time 4 Using where; Using join buffer (flat, BNLH join)
+DROP TABLE t1,t2,t3;
#
# End of the test file
#
diff --git a/mysql-test/r/show.result b/mysql-test/r/show.result
index 3dd7af5de05..d1b373d8969 100644
--- a/mysql-test/r/show.result
+++ b/mysql-test/r/show.result
@@ -1,3 +1,8 @@
+#
+# MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
+# MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
+# MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
+#
show statistics;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'statistics' at line 1
show spatial_ref_sys
@@ -10,3 +15,30 @@ show geometry_columns;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'geometry_columns' at line 1
show nonexistent;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'nonexistent' at line 1
+#
+# MDEV-21603 Crashing SHOW TABLES with derived table in WHERE condition
+#
+create table t1 (nm varchar(32), a int);
+insert t1 values ('1',1),('2',2),('3',3);
+show tables
+where tables_in_test in (select *
+from (select nm from test.t1 group by nm) dt);
+Tables_in_test
+show fields from test.t1
+where field in (select * from (select nm from test.t1 group by nm) dt);
+Field Type Null Key Default Extra
+insert t1 values ('nm',0);
+show fields from test.t1
+where field in (select * from (select nm from test.t1 group by nm) dt);
+Field Type Null Key Default Extra
+nm varchar(32) YES NULL
+show fields from test.t1 where field in
+(select * from (select column_name from information_schema.columns
+where table_name='t1' group by column_name) dt);
+Field Type Null Key Default Extra
+nm varchar(32) YES NULL
+a int(11) YES NULL
+drop table t1;
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result
index 1362e482717..7159a1509b8 100644
--- a/mysql-test/r/skip_name_resolve.result
+++ b/mysql-test/r/skip_name_resolve.result
@@ -39,4 +39,24 @@ SET @@LOCAL.skip_name_resolve=0;
ERROR HY000: Variable 'skip_name_resolve' is a read only variable
SET @@GLOBAL.skip_name_resolve=0;
ERROR HY000: Variable 'skip_name_resolve' is a read only variable
-End of 5.1 tests
+#
+# End of 5.1 tests
+#
+#
+# MDEV-26081 set role crashes when a hostname cannot be resolved
+#
+create user u1@`%`;
+create role r1;
+create role r2;
+grant r2 to r1;
+grant r1 to u1@`%`;
+connect u1,127.0.0.1,u1,,,$MASTER_MYPORT;
+set role r2;
+ERROR OP000: User `u1`@`%` has not been granted role `r2`
+disconnect u1;
+connection default;
+drop user u1@`%`;
+drop role r1, r2;
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result
index 67932447c2a..4ad79f50d45 100644
--- a/mysql-test/r/sp-code.result
+++ b/mysql-test/r/sp-code.result
@@ -971,3 +971,27 @@ Pos Instruction
DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507;
#END OF BUG#11763507 test.
+#
+# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
+#
+SET NAMES utf8;
+SET SESSION character_set_connection=latin1;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE a VARCHAR(10) CHARACTER SET utf8;
+SET a='ä';
+SELECT a, 'ä' AS b;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 set a@0 NULL
+1 set a@0 'ä'
+2 stmt 0 "SELECT a, 'ä' AS b"
+CALL p1;
+a b
+ä ä
+DROP PROCEDURE p1;
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index b679f3f54fc..25675a11f4a 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -8486,4 +8486,19 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
+#
+# BUG#30366310: USING A FUNCTION TO ASSIGN DEFAULT VALUES TO
+# 2 OR MORE VARIABLES CRASHES SERVER
+#
+create function f1() returns bigint return now()-1|
+create procedure p1()
+begin
+declare b, c bigint default f1();
+select b-c;
+end|
+call p1()|
+b-c
+0
+drop procedure p1|
+drop function f1|
#End of 10.2 tests
diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result
index 2e24cbcb40c..b1db309ec18 100644
--- a/mysql-test/r/subselect4.result
+++ b/mysql-test/r/subselect4.result
@@ -2721,4 +2721,84 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);
a
DROP TABLE t1,t2;
+#
+# MDEV-22462: Item_in_subselect::create_single_in_to_exists_cond(JOIN *, Item **, Item **): Assertion `false' failed.
+#
+select 1 from dual where 1 in (select 5 from dual where 1);
+1
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+update t1 set a = 2 where a in (select a from dual where a = a);
+drop table t1;
+#
+# MDEV-24925: Server crashes in Item_subselect::init_expr_cache_tracker
+#
+CREATE TABLE t1 (id INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1),(2);
+SELECT
+1 IN (
+SELECT
+(SELECT COUNT(id)
+FROM t1
+WHERE t1_outer.id <> id
+) AS f
+FROM
+t1 AS t1_outer
+GROUP BY f
+);
+1 IN (
+SELECT
+(SELECT COUNT(id)
+FROM t1
+WHERE t1_outer.id <> id
+) AS f
+FROM
+t1 AS t1_outer
+GROUP BY f
+)
+1
+SELECT
+1 IN (
+SELECT
+(SELECT COUNT(id)
+FROM t1
+WHERE t1_outer.id <> id
+) AS f
+FROM
+t1 AS t1_outer
+GROUP BY 1
+);
+1 IN (
+SELECT
+(SELECT COUNT(id)
+FROM t1
+WHERE t1_outer.id <> id
+) AS f
+FROM
+t1 AS t1_outer
+GROUP BY 1
+)
+1
+DROP TABLE t1;
+#
+# MDEV-24898: Server crashes in st_select_lex::next_select / Item_subselect::is_expensive
+# (Testcase)
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+SELECT 1 IN (SELECT (SELECT a FROM t1) AS x FROM t2 GROUP BY x);
+ERROR 21000: Subquery returns more than 1 row
+drop table t1,t2;
+#
+# MDEV-25629: Crash in get_sort_by_table() in subquery with order by having outer ref
+#
+CREATE TABLE t1 (i1 int);
+insert into t1 values (1),(2);
+SELECT 1
+FROM (t1 JOIN t1 AS ref_t1 ON
+(t1.i1 > (SELECT ref_t1.i1 AS c0 FROM t1 b ORDER BY -c0)));
+ERROR 21000: Subquery returns more than 1 row
+DROP TABLE t1;
# End of 10.2 tests
diff --git a/mysql-test/r/subselect_exists2in.result b/mysql-test/r/subselect_exists2in.result
index de4e428e462..ff5605575ba 100644
--- a/mysql-test/r/subselect_exists2in.result
+++ b/mysql-test/r/subselect_exists2in.result
@@ -1099,4 +1099,22 @@ U5.`storage_target_id` = V0.`id`
);
id
drop table t1,t2,t3;
+#
+# MDEV-25407: EXISTS subquery with correlation in ON expression crashes
+#
+create table t10(a int primary key);
+insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t11(a int primary key);
+insert into t11 select a.a + b.a* 10 + c.a * 100 from t10 a, t10 b, t10 c;
+create table t1 (a int, b int);
+insert into t1 select a,a from t10;
+create table t2 (a int, b int);
+insert into t2 select a,a from t11;
+create table t3 as select * from t2;
+explain select * from t1 where exists (select t2.a from t2 left join t3 on (t3.b=t1.b) where t2.a=t1.a);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 10
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1000 Using where; Start temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 1000 Using where; End temporary; Using join buffer (incremental, BNL join)
+drop table t1, t2, t3, t10, t11;
set optimizer_switch=default;
diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result
index 48839f0eadb..fbdc0c90c55 100644
--- a/mysql-test/r/truncate.result
+++ b/mysql-test/r/truncate.result
@@ -1,4 +1,3 @@
-drop table if exists t1, t2;
create table t1 (a integer, b integer,c1 CHAR(10));
insert into t1 (a) values (1),(2);
truncate table t1;
@@ -158,4 +157,6 @@ TRUNCATE t1;
HANDLER t1 READ FIRST;
ERROR 42S02: Unknown table 't1' in HANDLER
DROP TABLE t1;
-# End of 6.0 tests
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/truncate_notembedded.result b/mysql-test/r/truncate_notembedded.result
new file mode 100644
index 00000000000..dabd5474141
--- /dev/null
+++ b/mysql-test/r/truncate_notembedded.result
@@ -0,0 +1,22 @@
+#
+# MDEV-23365: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+# is_bulk_op())' failed upon killed TRUNCATE
+#
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+LOCK TABLE t1 READ;
+connect con1,localhost,root,,test;
+SET SESSION max_session_mem_used= 45500;
+LOCK TABLE t1 WRITE;
+connection default;
+SELECT * FROM t1;
+a
+UNLOCK TABLES;
+connection con1;
+TRUNCATE TABLE t1;
+ERROR HY000: The MariaDB server is running with the --max-thread-mem-used=45500 option so it cannot execute this statement
+disconnect con1;
+connection default;
+DROP TABLE t1;
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result
index 49768f6c514..367fc187ed2 100644
--- a/mysql-test/r/udf.result
+++ b/mysql-test/r/udf.result
@@ -492,4 +492,12 @@ select * from mysql.plugin WHERE name='unexisting_udf';
name dl
DROP FUNCTION unexisting_udf;
ERROR 42000: FUNCTION test.unexisting_udf does not exist
+#
+# Bug #31674599: THE UDF_INIT() FUNCTION CAUSE SERVER CRASH
+#
+call mtr.add_suppression('Invalid row in mysql.func table');
+insert mysql.func () values ();
+delete from mysql.func where name = '';
+#
# End of 10.2 tests
+#
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index ef4f0a48534..001d26fc466 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -6833,5 +6833,59 @@ sum(z)
DROP TABLE t1;
DROP VIEW v1;
#
+# MDEV-24454: Crash at change_item_tree
+#
+CREATE TABLE t1(f0 INT);
+CREATE VIEW v1 AS
+SELECT
+f0 AS f1
+FROM t1;
+CREATE VIEW v2 AS
+SELECT
+(SELECT GROUP_CONCAT(v1.f1 SEPARATOR ', ')
+FROM v1 n) AS f2,
+GROUP_CONCAT('' SEPARATOR ', ') AS f3
+FROM v1;
+CREATE VIEW v3 AS
+SELECT 1 as f4 FROM v2;
+CREATE PROCEDURE p1()
+SELECT * FROM v3;
+CALL p1();
+f4
+1
+CALL p1();
+f4
+1
+drop procedure p1;
+drop view v1,v2,v3;
+drop table t1;
+#
+# MDEV-25631: Crash in st_select_lex::mark_as_dependent with
+# VIEW, aggregate and subquery
+#
+CREATE TABLE t1 (i1 int);
+insert into t1 values (1),(2),(3);
+CREATE VIEW v1 AS
+SELECT t1.i1 FROM (t1 a JOIN t1 ON (t1.i1 = (SELECT t1.i1 FROM t1 b)));
+SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ;
+ERROR 21000: Subquery returns more than 1 row
+delete from t1 where i1 > 1;
+SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ;
+1
+1
+drop view v1;
+drop table t1;
+#
+# MDEV-26299: Some views force server (and mysqldump) to generate
+# invalid SQL for their definitions
+#
+create view v1 as
+select * from
+(select
+"12345678901234567890123456789012345678901234567890123456789012345") as t1;
+drop view v1;
+CREATE VIEW v1 AS select `t1`.`12345678901234567890123456789012345678901234567890123456789012345` AS `Name_exp_1` from (select '12345678901234567890123456789012345678901234567890123456789012345') `t1`;
+drop view v1;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result
index dd74c5c77fd..bc017ea70a3 100644
--- a/mysql-test/r/win.result
+++ b/mysql-test/r/win.result
@@ -3892,5 +3892,311 @@ id rn
1 1
drop table t1;
#
+# MDEV-25630: Crash with window function in left expr of IN subquery
+#
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT lag(i) over (ORDER BY i) IN ( SELECT 1 FROM t1 a) FROM t1;
+lag(i) over (ORDER BY i) IN ( SELECT 1 FROM t1 a)
+NULL
+1
+0
+DROP TABLE t1;
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT sum(i) over () IN ( SELECT 1 FROM t1 a) FROM t1;
+sum(i) over () IN ( SELECT 1 FROM t1 a)
+0
+0
+0
+DROP TABLE t1;
+#
+# MDEV-25565: 2-nd call of SP with SELECT from view / derived table / CTE
+# returning the result of calculation of 2 window
+# functions that use the same window specification
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (7), (1), (1), (3), (1), (5);
+create view v2 as select a from t1 group by a;
+create view v1 as select * from v2;
+create procedure sp1() select v1.a,
+sum(v1.a) over (partition by v1.a order by v1.a) as k,
+avg(v1.a) over (partition by v1.a order by v1.a) as m
+from v1;
+call sp1();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp1();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "select v1.a,
+sum(v1.a) over (partition by v1.a order by v1.a) as k,
+avg(v1.a) over (partition by v1.a order by v1.a) as m
+from v1";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp2() select * from
+( select dt1.a,
+sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+from (select * from v2) as dt1
+) as dt;
+call sp2();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp2();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "select * from
+( select dt1.a,
+sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+from (select * from v2) as dt1
+) as dt";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp3() select * from
+( select dt1.a,
+sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+from ( select * from (select * from t1 group by a) as dt2 ) as dt1
+) as dt;
+call sp3();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp3();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "select * from
+( select dt1.a,
+sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+from ( select * from (select * from t1 group by a) as dt2 ) as dt1
+) as dt";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp4() with cte1 as (select * from (select * from t1 group by a) as dt2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte;
+call sp4();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp4();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "with cte1 as (select * from (select * from t1 group by a) as dt2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp5() with cte1 as (select * from v2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte;
+call sp5();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp5();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "with cte1 as (select * from v2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp6() with
+cte1 as (with cte2 as (select * from t1 group by a) select * from cte2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte;
+call sp6();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp6();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "with
+cte1 as (with cte2 as (select * from t1 group by a) select * from cte2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp7() with
+cte2 as (select * from v1),
+cte1 as (select * from cte2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte;
+call sp7();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp7();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "with
+cte2 as (select * from v1),
+cte1 as (select * from cte2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop procedure sp4;
+drop procedure sp5;
+drop procedure sp6;
+drop procedure sp7;
+drop view v1,v2;
+drop table t1;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result
index 8ff84862270..f6bae2adac2 100644
--- a/mysql-test/r/xa.result
+++ b/mysql-test/r/xa.result
@@ -317,3 +317,44 @@ XA ROLLBACK 'xid';
DROP TABLE t1;
disconnect con1;
connection default;
+#
+# XA states and SHOW commands
+#
+create table t1 (pk int primary key) engine=innodb;
+xa start 'foo';
+insert t1 set pk=1;
+xa end 'foo';
+xa prepare 'foo';
+show status like 'foo';
+Variable_name Value
+select table_name,table_comment from information_schema.tables where table_schema='test';
+table_name t1
+table_comment
+select table_name,table_rows,table_comment from information_schema.tables where table_schema='test';
+table_name t1
+table_rows NULL
+table_comment XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
+Warnings:
+Level Warning
+Code 1399
+Message XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
+xa commit 'foo';
+drop table t1;
+#
+# MDEV-22445 Crash on HANDLER READ NEXT after XA PREPARE
+#
+CREATE TABLE t (a INT KEY) ENGINE=InnoDB;
+HANDLER t OPEN AS t;
+XA START '0';
+SELECT * FROM t;
+a
+XA END '0';
+XA PREPARE '0';
+HANDLER t READ NEXT;
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
+# Cleanup
+XA COMMIT '0';
+DROP TABLE t;
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm
index 5fc6f00b460..31e59781064 100644
--- a/mysql-test/suite.pm
+++ b/mysql-test/suite.pm
@@ -63,7 +63,7 @@ sub skip_combinations {
unless ::have_mariabackup();
$skip{'include/have_mariabackup.inc'} = 'Need socket statistics utility'
- unless IS_WINDOWS || ::which("ss");
+ unless IS_WINDOWS || ! ::have_wsrep() || ::which("lsof") || ::which("sockstat") || ::which("ss");
$skip{'include/have_mariabackup.inc'} = 'Need socat or nc'
unless IS_WINDOWS || $ENV{MTR_GALERA_TFMT};
@@ -95,7 +95,6 @@ sub skip_combinations {
unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/
and $1 ge "1.0.1d" and $1 lt "1.1.1";
-
$skip{'t/ssl_7937.combinations'} = [ 'x509v3' ]
unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/
and $1 ge "1.0.2";
@@ -108,4 +107,3 @@ sub skip_combinations {
}
bless { };
-
diff --git a/mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result b/mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result
new file mode 100644
index 00000000000..d9bfead8dd1
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result
@@ -0,0 +1,40 @@
+#
+# Kill OPTIMIZE command prior to table modification
+#
+RESET MASTER;
+CREATE TABLE t1 (f INT) ENGINE=INNODB;
+CREATE TABLE t2 (f INT) ENGINE=INNODB;
+connect con1,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connection con1;
+SET debug_sync='admin_command_kill_before_modify SIGNAL ready_to_be_killed WAIT_FOR master_cont';
+OPTIMIZE TABLE t1,t2;
+connection default;
+SET debug_sync='now WAIT_FOR ready_to_be_killed';
+KILL THD_ID;
+SET debug_sync = 'reset';
+disconnect con1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (f INT) ENGINE=INNODB
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (f INT) ENGINE=INNODB
+DROP TABLE t1,t2;
+RESET MASTER;
+#
+# Kill OPTIMIZE command after table modification
+#
+CREATE TABLE t1 (f INT) ENGINE=INNODB;
+CREATE TABLE t2 (f INT) ENGINE=INNODB;
+connect con1,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connection con1;
+SET debug_sync='admin_command_kill_after_modify SIGNAL ready_to_be_killed WAIT_FOR master_cont';
+OPTIMIZE TABLE t1,t2;
+connection default;
+SET debug_sync='now WAIT_FOR ready_to_be_killed';
+KILL THD_ID;
+SET debug_sync = 'reset';
+disconnect con1;
+DROP TABLE t1,t2;
+FLUSH LOGS;
+FOUND 1 /OPTIMIZE TABLE t1,t2/ in mysqlbinlog.out
diff --git a/mysql-test/suite/binlog/r/binlog_checkpoint_flush_logs.result b/mysql-test/suite/binlog/r/binlog_checkpoint_flush_logs.result
new file mode 100644
index 00000000000..125324e2928
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_checkpoint_flush_logs.result
@@ -0,0 +1,51 @@
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
+*** Test that FLUSH LOGS waits if a transaction ordered commit is in progress.
+connect con1,localhost,root,,;
+SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go";
+INSERT INTO t1 VALUES (1, REPEAT("x", 1));
+connection default;
+SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
+SET DEBUG_SYNC= "rotate_after_rotate SIGNAL con_flush_ready WAIT_FOR default_go";
+FLUSH LOGS;
+connect con2,localhost,root,,;
+Trx_1 is not yet committed:
+SELECT count(*) as 'ZERO' from t1;
+ZERO
+0
+Wait for Trx_2 has rotated binlog:
+SET DEBUG_SYNC= "now WAIT_FOR con_flush_ready";
+SET DEBUG_SYNC= "now SIGNAL default_go";
+connection default;
+Must be tree logs in the list:
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+master-bin.000003 #
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000001 # Gtid_list # # []
+master-bin.000001 # Binlog_checkpoint # # master-bin.000001
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1, REPEAT("x", 1))
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Rotate # # master-bin.000002;pos=POS
+Only one Binlog checkpoint must exist and point to master-bin.000001
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+master-bin.000002 # Gtid_list # # [#-#-#]
+master-bin.000002 # Binlog_checkpoint # # master-bin.000001
+SELECT count(*) as 'ONE' from t1;
+ONE
+1
+connection default;
+DROP TABLE t1;
+SET debug_sync = 'reset';
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
index 4068a80771c..948ccee58ca 100644
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -1073,3 +1073,26 @@ Variable_name Value
unique_checks OFF
DROP TABLE t1;
disconnect fresh;
+connection default;
+#
+# MDEV-25595 DROP part of failed CREATE OR REPLACE is not written into binary log
+#
+reset master;
+create table t as select 1 as b, 2 as b;
+ERROR 42S21: Duplicate column name 'b'
+create table t (old_table_field int);
+create or replace table t as select 1 as b, 2 as b;
+ERROR 42S21: Duplicate column name 'b'
+create or replace temporary table t as select 1 as b, 2 as b;
+ERROR 42S21: Duplicate column name 'b'
+create table t (new_table_field int);
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t (old_table_field int)
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */
+master-bin.000001 # Query # # ROLLBACK
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t (new_table_field int)
+drop table t;
diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
index d6875ab60e0..a4cd5b4080d 100644
--- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
+++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
@@ -50,3 +50,4 @@ a
400
401
drop table t1;
+reset master;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
index 872ba40e05f..5016ed70242 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -673,3 +673,27 @@ Variable_name Value
unique_checks OFF
DROP TABLE t1;
disconnect fresh;
+connection default;
+#
+# MDEV-25595 DROP part of failed CREATE OR REPLACE is not written into binary log
+#
+reset master;
+create table t as select 1 as b, 2 as b;
+ERROR 42S21: Duplicate column name 'b'
+create table t (old_table_field int);
+create or replace table t as select 1 as b, 2 as b;
+ERROR 42S21: Duplicate column name 'b'
+create or replace temporary table t as select 1 as b, 2 as b;
+ERROR 42S21: Duplicate column name 'b'
+create table t (new_table_field int);
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t (old_table_field int)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; create table t (new_table_field int)
+drop table t;
diff --git a/mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test b/mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test
new file mode 100644
index 00000000000..e2397f0eab8
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test
@@ -0,0 +1,98 @@
+# ==== Purpose ====
+#
+# Test verifies that when an admin command execution is interrupted by KILL
+# command it should stop its execution. The admin command in binary log should
+# contain only the list of tables which have successfully executed admin
+# command prior to kill.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - Create two table t1,t2.
+# 1 - Execute OPTIMIZE TABLE t1,t2 command.
+# 2 - Using debug sync mechanism kill OPTIMIZE TABLE command at a stage
+# where it has not optimized any table.
+# 3 - Check that OPTIMIZE TABLE command is not written to binary log.
+# 4 - Using debug sync mechanism hold the execution of OPTIMIZE TABLE after
+# t1 table optimization. Now kill the OPTIMIZE TABLE command.
+# 5 - Observe the binlog output, the OPTIMIZE TABLE command should display `t1,t2`.
+# 6 - Please note that, we binlog the entire query even if at least one
+# table is modified as admin commands are safe to replicate and they will
+# not make the slave to diverge.
+#
+# ==== References ====
+#
+# MDEV-22530: Aborting OPTIMIZE TABLE still logs in binary log and replicates to the Slave server.
+#
+--source include/have_log_bin.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # Kill OPTIMIZE command prior to table modification
+--echo #
+RESET MASTER;
+
+CREATE TABLE t1 (f INT) ENGINE=INNODB;
+CREATE TABLE t2 (f INT) ENGINE=INNODB;
+
+--connect(con1,127.0.0.1,root,,test,$MASTER_MYPORT,)
+--connection con1
+SET debug_sync='admin_command_kill_before_modify SIGNAL ready_to_be_killed WAIT_FOR master_cont';
+--send OPTIMIZE TABLE t1,t2
+
+--connection default
+SET debug_sync='now WAIT_FOR ready_to_be_killed';
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%OPTIMIZE TABLE %'`
+
+# Now kill.
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+SET debug_sync = 'reset';
+--disconnect con1
+
+--source include/show_binlog_events.inc
+DROP TABLE t1,t2;
+
+RESET MASTER;
+
+--echo #
+--echo # Kill OPTIMIZE command after table modification
+--echo #
+
+CREATE TABLE t1 (f INT) ENGINE=INNODB;
+CREATE TABLE t2 (f INT) ENGINE=INNODB;
+
+--connect(con1,127.0.0.1,root,,test,$MASTER_MYPORT,)
+--connection con1
+SET debug_sync='admin_command_kill_after_modify SIGNAL ready_to_be_killed WAIT_FOR master_cont';
+--send OPTIMIZE TABLE t1,t2
+
+--connection default
+SET debug_sync='now WAIT_FOR ready_to_be_killed';
+--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%OPTIMIZE TABLE %'`
+
+# Now kill.
+--replace_result $thd_id THD_ID
+eval KILL $thd_id;
+
+SET debug_sync = 'reset';
+--disconnect con1
+
+--let $wait_binlog_event= OPTIMIZE
+--source include/wait_for_binlog_event.inc
+
+DROP TABLE t1,t2;
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+FLUSH LOGS;
+
+--let $MYSQLD_DATADIR= `select @@datadir`
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+
+--let SEARCH_PATTERN= OPTIMIZE TABLE t1,t2
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+--source include/search_pattern_in_file.inc
+
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
diff --git a/mysql-test/suite/binlog/t/binlog_checkpoint_flush_logs.test b/mysql-test/suite/binlog/t/binlog_checkpoint_flush_logs.test
new file mode 100644
index 00000000000..e21f1eb308d
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_checkpoint_flush_logs.test
@@ -0,0 +1,79 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_binlog_format_row.inc
+
+# References:
+#
+# MDEV-24526 binlog rotate via FLUSH LOGS may obsolate binlog file too eary
+#
+# The test for MDEV-24526 proves the fixes correct observed race condition
+# between a commiting transaction and FLUSH-LOGS.
+# The plot.
+# Trx_1 (con1) transaction binlogs first
+# to yield its turn acquiring LOCK_commit_ordered to Trx_2 and stand
+# still waiting of a signal that will never arrive.
+# Trx_2 can't acquire it in the fixed version even though
+# Trx_3 makes sure Trx_2 has reached a post-rotation execution point
+# to signal it to proceed.
+# Then the server gets crashed and Trx_1 must recover unlike
+# in the OLD buggy version.
+#
+SET GLOBAL innodb_flush_log_at_trx_commit= 1;
+RESET MASTER;
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
+
+--echo *** Test that FLUSH LOGS waits if a transaction ordered commit is in progress.
+
+connect(con1,localhost,root,,); # Trx_1
+# hang before doing acquiring Commit Ordered mutex
+SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go";
+
+--send INSERT INTO t1 VALUES (1, REPEAT("x", 1))
+
+connection default; # Trx_2
+
+SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
+SET DEBUG_SYNC= "rotate_after_rotate SIGNAL con_flush_ready WAIT_FOR default_go";
+--send FLUSH LOGS
+
+connect(con2,localhost,root,,); # Trx_3
+--echo Trx_1 is not yet committed:
+SELECT count(*) as 'ZERO' from t1;
+
+--echo Wait for Trx_2 has rotated binlog:
+SET DEBUG_SYNC= "now WAIT_FOR con_flush_ready";
+# Useless signal to prove Trx_2 cannot race Trx_1's commit
+# even though Trx_1 never received the being waited 'con1_go'.
+SET DEBUG_SYNC= "now SIGNAL default_go";
+
+--let $shutdown_timeout=0
+--source include/restart_mysqld.inc
+
+connection default;
+--enable_reconnect
+--error 0,2013
+--reap
+
+--echo Must be tree logs in the list:
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000001
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+
+--echo Only one Binlog checkpoint must exist and point to master-bin.000001
+--let $binlog_file= master-bin.000002
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+
+
+# In the buggy server version the following select may have
+# resulted with ZERO:
+SELECT count(*) as 'ONE' from t1;
+
+# Clean up.
+connection default;
+
+DROP TABLE t1;
+SET debug_sync = 'reset';
diff --git a/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
index 570a7440592..736bcaf0cbe 100644
--- a/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
+++ b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
@@ -10,3 +10,4 @@ disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
-- source extra/binlog_tests/binlog_insert_delayed.test
+reset master;
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master.test b/mysql-test/suite/binlog_encryption/encrypted_master.test
index f67e93ce815..f6fc172c79e 100644
--- a/mysql-test/suite/binlog_encryption/encrypted_master.test
+++ b/mysql-test/suite/binlog_encryption/encrypted_master.test
@@ -18,6 +18,9 @@
# - with annotated events, default checksums and minimal binlog row image
#
+# The test can take very long time with valgrind
+--source include/not_valgrind.inc
+
--source include/have_partition.inc
--source encryption_algorithms.inc
--source include/have_innodb.inc
diff --git a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
index a662f5e6343..7d0267d5057 100644
--- a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
+++ b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
@@ -1,7 +1,3 @@
-SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
-NAME
-SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
-NAME
create database enctests;
use enctests;
create table t1(a int not null primary key, b char(200)) engine=innodb;
diff --git a/mysql-test/suite/encryption/r/innodb_encryption.result b/mysql-test/suite/encryption/r/innodb_encryption.result
index 75614c6b88c..22b4c3a5ad6 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption.result
@@ -19,7 +19,7 @@ innodb_system
# Success!
# Now turn off encryption and wait for threads to decrypt everything
SET GLOBAL innodb_encrypt_tables = off;
-# Wait max 10 min for key encryption threads to encrypt all spaces
+# Wait max 10 min for key encryption threads to decrypt all spaces
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
NAME
diff --git a/mysql-test/suite/encryption/r/innodb_import.result b/mysql-test/suite/encryption/r/innodb_import.result
new file mode 100644
index 00000000000..54b95ab26d4
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_import.result
@@ -0,0 +1,22 @@
+#
+# MDEV-26131 SEGV in ha_innobase::discard_or_import_tablespace
+#
+CREATE TABLE t1(f1 int,f2 text)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, "InnoDB");
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 ADD KEY idx (f2(13));
+ALTER TABLE t2 DISCARD TABLESPACE;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+ERROR HY000: Internal error: Drop all secondary indexes before importing table test/t2 when .cfg file is missing.
+ALTER TABLE t2 DROP KEY idx;
+Warnings:
+Warning 1814 Tablespace has been discarded for table `t2`
+ALTER TABLE t2 IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
+SELECT * FROM t2;
+f1 f2
+1 InnoDB
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/r/key_version_rotation.result b/mysql-test/suite/encryption/r/key_version_rotation.result
new file mode 100644
index 00000000000..1a295abfe8d
--- /dev/null
+++ b/mysql-test/suite/encryption/r/key_version_rotation.result
@@ -0,0 +1,19 @@
+create table t1(f1 int not null)engine=innodb;
+create table t2(f1 int not null)engine=innodb;
+insert into t1 select * from seq_1_to_100;
+insert into t2 select * from seq_1_to_100;
+# Enable encryption
+set global innodb_encrypt_tables=ON;
+# Create a new table and it is added to rotation list
+create table t3(f1 int not null)engine=innodb;
+insert into t3 select * from seq_1_to_100;
+# Increase the version and it should set rotation
+# variable for the encryption plugin
+set global debug_key_management_version=10;
+select @@debug_key_management_version;
+@@debug_key_management_version
+10
+# Decrease the key version and Disable the encryption
+set global debug_key_management_version=1;
+set global innodb_encrypt_tables=off;
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result
index 27eedc45028..f66a5fd0b25 100644
--- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result
+++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result
@@ -3898,6 +3898,312 @@ id rn
1 1
drop table t1;
#
+# MDEV-25630: Crash with window function in left expr of IN subquery
+#
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT lag(i) over (ORDER BY i) IN ( SELECT 1 FROM t1 a) FROM t1;
+lag(i) over (ORDER BY i) IN ( SELECT 1 FROM t1 a)
+NULL
+1
+0
+DROP TABLE t1;
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT sum(i) over () IN ( SELECT 1 FROM t1 a) FROM t1;
+sum(i) over () IN ( SELECT 1 FROM t1 a)
+0
+0
+0
+DROP TABLE t1;
+#
+# MDEV-25565: 2-nd call of SP with SELECT from view / derived table / CTE
+# returning the result of calculation of 2 window
+# functions that use the same window specification
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (7), (1), (1), (3), (1), (5);
+create view v2 as select a from t1 group by a;
+create view v1 as select * from v2;
+create procedure sp1() select v1.a,
+sum(v1.a) over (partition by v1.a order by v1.a) as k,
+avg(v1.a) over (partition by v1.a order by v1.a) as m
+from v1;
+call sp1();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp1();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "select v1.a,
+sum(v1.a) over (partition by v1.a order by v1.a) as k,
+avg(v1.a) over (partition by v1.a order by v1.a) as m
+from v1";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp2() select * from
+( select dt1.a,
+sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+from (select * from v2) as dt1
+) as dt;
+call sp2();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp2();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "select * from
+( select dt1.a,
+sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+from (select * from v2) as dt1
+) as dt";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp3() select * from
+( select dt1.a,
+sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+from ( select * from (select * from t1 group by a) as dt2 ) as dt1
+) as dt;
+call sp3();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp3();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "select * from
+( select dt1.a,
+sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+from ( select * from (select * from t1 group by a) as dt2 ) as dt1
+) as dt";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp4() with cte1 as (select * from (select * from t1 group by a) as dt2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte;
+call sp4();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp4();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "with cte1 as (select * from (select * from t1 group by a) as dt2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp5() with cte1 as (select * from v2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte;
+call sp5();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp5();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "with cte1 as (select * from v2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp6() with
+cte1 as (with cte2 as (select * from t1 group by a) select * from cte2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte;
+call sp6();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp6();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "with
+cte1 as (with cte2 as (select * from t1 group by a) select * from cte2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+create procedure sp7() with
+cte2 as (select * from v1),
+cte1 as (select * from cte2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte;
+call sp7();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+call sp7();
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+prepare stmt from "with
+cte2 as (select * from v1),
+cte1 as (select * from cte2),
+cte as
+( select cte1.a,
+sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+from cte1 )
+select * from cte";
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+execute stmt;
+a k m
+1 1 1.0000
+3 3 3.0000
+5 5 5.0000
+7 7 7.0000
+deallocate prepare stmt;
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop procedure sp4;
+drop procedure sp5;
+drop procedure sp6;
+drop procedure sp7;
+drop view v1,v2;
+drop table t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
index 2e5d877f7c0..4541bfa2a0c 100644
--- a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
+++ b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
@@ -3,9 +3,6 @@
# not embedded because of restarts
-- source include/not_embedded.inc
-SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
-SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
-
--disable_query_log
--disable_warnings
let $encryption = `SELECT @@innodb_encrypt_tables`;
diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption.test b/mysql-test/suite/encryption/t/innodb-page_encryption.test
index df2d1d52aaa..d756f07aea0 100644
--- a/mysql-test/suite/encryption/t/innodb-page_encryption.test
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption.test
@@ -1,6 +1,9 @@
-- source include/have_innodb.inc
-- source include/have_file_key_management_plugin.inc
+# The test can take very long time with valgrind
+--source include/not_valgrind.inc
+
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
show warnings;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
diff --git a/mysql-test/suite/encryption/t/innodb_encryption.test b/mysql-test/suite/encryption/t/innodb_encryption.test
index cd844af0649..303e74fdba4 100644
--- a/mysql-test/suite/encryption/t/innodb_encryption.test
+++ b/mysql-test/suite/encryption/t/innodb_encryption.test
@@ -14,7 +14,9 @@ SHOW VARIABLES LIKE 'innodb_encrypt%';
SET GLOBAL innodb_encrypt_tables = ON;
---let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'`
+let $undo_count= `select @@global.innodb_undo_tablespaces`;
+
+--let $tables_count= `select count(*) + 1 + $undo_count from information_schema.tables where engine = 'InnoDB'`
--echo # Wait max 10 min for key encryption threads to encrypt all spaces
--let $wait_timeout= 600
@@ -33,7 +35,7 @@ AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats';
--echo # Now turn off encryption and wait for threads to decrypt everything
SET GLOBAL innodb_encrypt_tables = off;
---echo # Wait max 10 min for key encryption threads to encrypt all spaces
+--echo # Wait max 10 min for key encryption threads to decrypt all spaces
--let $wait_timeout= 600
--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--source include/wait_condition.inc
diff --git a/mysql-test/suite/encryption/t/innodb_import.combinations b/mysql-test/suite/encryption/t/innodb_import.combinations
new file mode 100644
index 00000000000..75458949582
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_import.combinations
@@ -0,0 +1,7 @@
+[page_compressed]
+innodb-compression-default=1
+[encryption]
+innodb-encrypt-tables=1
+[page_compressed_encryption]
+innodb-compression-default=1
+innodb-encrypt-tables=1
diff --git a/mysql-test/suite/encryption/t/innodb_import.test b/mysql-test/suite/encryption/t/innodb_import.test
new file mode 100644
index 00000000000..791a1757878
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_import.test
@@ -0,0 +1,22 @@
+--source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+--echo #
+--echo # MDEV-26131 SEGV in ha_innobase::discard_or_import_tablespace
+--echo #
+let $MYSQLD_DATADIR = `SELECT @@datadir`;
+CREATE TABLE t1(f1 int,f2 text)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, "InnoDB");
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 ADD KEY idx (f2(13));
+ALTER TABLE t2 DISCARD TABLESPACE;
+FLUSH TABLES t1 FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
+UNLOCK TABLES;
+--error ER_INTERNAL_ERROR
+ALTER TABLE t2 IMPORT TABLESPACE;
+
+ALTER TABLE t2 DROP KEY idx;
+--replace_regex /opening '.*\/test\//opening '.\/test\//
+ALTER TABLE t2 IMPORT TABLESPACE;
+SELECT * FROM t2;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/t/key_version_rotation.opt b/mysql-test/suite/encryption/t/key_version_rotation.opt
new file mode 100644
index 00000000000..d7933f0f943
--- /dev/null
+++ b/mysql-test/suite/encryption/t/key_version_rotation.opt
@@ -0,0 +1,2 @@
+--innodb-tablespaces-encryption
+--plugin-load-add=$DEBUG_KEY_MANAGEMENT_SO
diff --git a/mysql-test/suite/encryption/t/key_version_rotation.test b/mysql-test/suite/encryption/t/key_version_rotation.test
new file mode 100644
index 00000000000..d36d47251a1
--- /dev/null
+++ b/mysql-test/suite/encryption/t/key_version_rotation.test
@@ -0,0 +1,41 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_sequence.inc
+
+create table t1(f1 int not null)engine=innodb;
+create table t2(f1 int not null)engine=innodb;
+insert into t1 select * from seq_1_to_100;
+insert into t2 select * from seq_1_to_100;
+
+let $restart_parameters=--innodb_encrypt_tables=0 --innodb_encryption_threads=1 --innodb_encryption_rotate_key_age=9;
+--source include/restart_mysqld.inc
+
+--echo # Enable encryption
+
+set global innodb_encrypt_tables=ON;
+--let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'`
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+--source include/wait_condition.inc
+--echo # Create a new table and it is added to rotation list
+create table t3(f1 int not null)engine=innodb;
+insert into t3 select * from seq_1_to_100;
+
+--echo # Increase the version and it should set rotation
+--echo # variable for the encryption plugin
+
+set global debug_key_management_version=10;
+select @@debug_key_management_version;
+--let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'`
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+--source include/wait_condition.inc
+
+--echo # Decrease the key version and Disable the encryption
+set global debug_key_management_version=1;
+set global innodb_encrypt_tables=off;
+
+--let $wait_timeout= 600
+--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
+--source include/wait_condition.inc
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/federated/federated_partition.result b/mysql-test/suite/federated/federated_partition.result
index a2d5fcffd9b..cce5e3cf3e6 100644
--- a/mysql-test/suite/federated/federated_partition.result
+++ b/mysql-test/suite/federated/federated_partition.result
@@ -46,6 +46,42 @@ connection slave;
drop table federated.t1_1;
drop table federated.t1_2;
End of 5.1 tests
+#
+# MDEV-18734 ASAN heap-use-after-free upon sorting by blob column from partitioned table
+#
+connection slave;
+use federated;
+create table t1_1 (x int, b text, key(x));
+create table t1_2 (x int, b text, key(x));
+connection master;
+create table t1 (x int, b text, key(x)) engine=federated
+partition by range columns (x) (
+partition p1 values less than (40) connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_1',
+partition pn values less than (maxvalue) connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_2'
+);
+insert t1 values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8);
+insert t1 select x + 8, x + 8 from t1;
+insert t1 select x + 16, x + 16 from t1;
+insert t1 select x + 49, repeat(x + 49, 100) from t1;
+flush tables;
+# This produces wrong result before MDEV-17573
+select x, left(b, 10) from t1 where x > 30 and x < 60 order by b;
+x left(b, 10)
+31 31
+32 32
+50 5050505050
+51 5151515151
+52 5252525252
+53 5353535353
+54 5454545454
+55 5555555555
+56 5656565656
+57 5757575757
+58 5858585858
+59 5959595959
+drop table t1;
+connection slave;
+drop table t1_1, t1_2;
connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_partition.test b/mysql-test/suite/federated/federated_partition.test
index ef1e27ec505..c5c8433b4cf 100644
--- a/mysql-test/suite/federated/federated_partition.test
+++ b/mysql-test/suite/federated/federated_partition.test
@@ -50,4 +50,29 @@ drop table federated.t1_2;
--echo End of 5.1 tests
+--echo #
+--echo # MDEV-18734 ASAN heap-use-after-free upon sorting by blob column from partitioned table
+--echo #
+connection slave;
+use federated;
+create table t1_1 (x int, b text, key(x));
+create table t1_2 (x int, b text, key(x));
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table t1 (x int, b text, key(x)) engine=federated
+ partition by range columns (x) (
+ partition p1 values less than (40) connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_1',
+ partition pn values less than (maxvalue) connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_2'
+);
+insert t1 values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8);
+insert t1 select x + 8, x + 8 from t1;
+insert t1 select x + 16, x + 16 from t1;
+insert t1 select x + 49, repeat(x + 49, 100) from t1;
+flush tables;
+--echo # This produces wrong result before MDEV-17573
+select x, left(b, 10) from t1 where x > 30 and x < 60 order by b;
+drop table t1;
+connection slave;
+drop table t1_1, t1_2;
+
source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result
index 1316988ffc3..5e4b008326d 100644
--- a/mysql-test/suite/funcs_1/r/innodb_views.result
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result
@@ -3551,11 +3551,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'or REPLACE AS Select * from tb2 my_table' at line 1
CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASCADED CHECK OPTION AS Select *
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOCAL CHECK OPTION AS Select *
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
SELECT * FROM tb2 my_table CREATE VIEW As v1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE VIEW As v1' at line 1
@@ -3585,7 +3585,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHECK OPTION WITH CASCADED' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASCADED CHECK OPTION
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION;
@@ -3614,7 +3614,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHECK OPTION WITH LOCAL' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASCADED CHECK OPTION
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 672c8e0810a..3282d30669e 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -181,6 +181,7 @@ def information_schema INDEX_STATISTICS INDEX_NAME 3 '' NO varchar 192 576 NULL
def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
def information_schema INDEX_STATISTICS TABLE_NAME 2 '' NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) select NEVER NULL
def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 '' NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) select NEVER NULL
+def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema KEY_CACHES BLOCK_SIZE 5 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
def information_schema KEY_CACHES DIRTY_BLOCKS 8 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
def information_schema KEY_CACHES FULL_SIZE 4 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
@@ -336,6 +337,7 @@ def information_schema SPATIAL_REF_SYS AUTH_NAME 2 '' NO varchar 512 1536 NULL N
def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(5) select NEVER NULL
def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL
def information_schema SPATIAL_REF_SYS SRTEXT 4 '' NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select NEVER NULL
+def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8 utf8_general_ci varchar(1) select NEVER NULL
def information_schema STATISTICS COLUMN_NAME 8 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
@@ -716,6 +718,7 @@ NULL information_schema GEOMETRY_COLUMNS SRID smallint NULL NULL NULL NULL small
3.0000 information_schema INDEX_STATISTICS TABLE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
3.0000 information_schema INDEX_STATISTICS INDEX_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
NULL information_schema INDEX_STATISTICS ROWS_READ bigint NULL NULL NULL NULL bigint(21)
+3.0000 information_schema KEYWORDS WORD varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema KEY_CACHES KEY_CACHE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
NULL information_schema KEY_CACHES SEGMENTS int NULL NULL NULL NULL int(3) unsigned
NULL information_schema KEY_CACHES SEGMENT_NUMBER int NULL NULL NULL NULL int(3) unsigned
@@ -871,6 +874,7 @@ NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smalli
3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512)
NULL information_schema SPATIAL_REF_SYS AUTH_SRID int NULL NULL NULL NULL int(5)
3.0000 information_schema SPATIAL_REF_SYS SRTEXT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SQL_FUNCTIONS FUNCTION varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index 85026160b41..9116830e88c 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -181,6 +181,7 @@ def information_schema INDEX_STATISTICS INDEX_NAME 3 '' NO varchar 192 576 NULL
def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
def information_schema INDEX_STATISTICS TABLE_NAME 2 '' NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) NEVER NULL
def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 '' NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) NEVER NULL
+def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema KEY_CACHES BLOCK_SIZE 5 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
def information_schema KEY_CACHES DIRTY_BLOCKS 8 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
def information_schema KEY_CACHES FULL_SIZE 4 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
@@ -336,6 +337,7 @@ def information_schema SPATIAL_REF_SYS AUTH_NAME 2 '' NO varchar 512 1536 NULL N
def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(5) NEVER NULL
def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL
def information_schema SPATIAL_REF_SYS SRTEXT 4 '' NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) NEVER NULL
+def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8 utf8_general_ci varchar(1) NEVER NULL
def information_schema STATISTICS COLUMN_NAME 8 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
@@ -716,6 +718,7 @@ NULL information_schema GEOMETRY_COLUMNS SRID smallint NULL NULL NULL NULL small
3.0000 information_schema INDEX_STATISTICS TABLE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
3.0000 information_schema INDEX_STATISTICS INDEX_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
NULL information_schema INDEX_STATISTICS ROWS_READ bigint NULL NULL NULL NULL bigint(21)
+3.0000 information_schema KEYWORDS WORD varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema KEY_CACHES KEY_CACHE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
NULL information_schema KEY_CACHES SEGMENTS int NULL NULL NULL NULL int(3) unsigned
NULL information_schema KEY_CACHES SEGMENT_NUMBER int NULL NULL NULL NULL int(3) unsigned
@@ -871,6 +874,7 @@ NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smalli
3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512)
NULL information_schema SPATIAL_REF_SYS AUTH_SRID int NULL NULL NULL NULL int(5)
3.0000 information_schema SPATIAL_REF_SYS SRTEXT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
+3.0000 information_schema SQL_FUNCTIONS FUNCTION varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result
index 502b165cde3..aca57297574 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is.result
@@ -405,6 +405,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEYWORDS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME KEY_CACHES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -704,6 +727,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SQL_FUNCTIONS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1364,6 +1410,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEYWORDS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME KEY_CACHES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1663,6 +1732,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SQL_FUNCTIONS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
index 502b165cde3..aca57297574 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
@@ -405,6 +405,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEYWORDS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME KEY_CACHES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -704,6 +727,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SQL_FUNCTIONS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1364,6 +1410,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEYWORDS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME KEY_CACHES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1663,6 +1732,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SQL_FUNCTIONS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result
index 9f3fbd7bb1a..acd042511a0 100644
--- a/mysql-test/suite/funcs_1/r/memory_views.result
+++ b/mysql-test/suite/funcs_1/r/memory_views.result
@@ -3552,11 +3552,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'or REPLACE AS Select * from tb2 my_table' at line 1
CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASCADED CHECK OPTION AS Select *
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOCAL CHECK OPTION AS Select *
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
SELECT * FROM tb2 my_table CREATE VIEW As v1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE VIEW As v1' at line 1
@@ -3586,7 +3586,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHECK OPTION WITH CASCADED' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASCADED CHECK OPTION
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION;
@@ -3615,7 +3615,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHECK OPTION WITH LOCAL' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASCADED CHECK OPTION
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION;
diff --git a/mysql-test/suite/funcs_1/r/myisam_views-big.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result
index a1d59e1c2f9..d3227d83b01 100644
--- a/mysql-test/suite/funcs_1/r/myisam_views-big.result
+++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result
@@ -4054,11 +4054,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'or REPLACE AS Select * from tb2 my_table' at line 1
CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASCADED CHECK OPTION AS Select *
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH CASCADED CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOCAL CHECK OPTION AS Select *
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH LOCAL CHECK OPTION AS Select *
from tb2 my_table limit 50' at line 1
SELECT * FROM tb2 my_table CREATE VIEW As v1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE VIEW As v1' at line 1
@@ -4088,7 +4088,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHECK OPTION WITH CASCADED' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASCADED CHECK OPTION
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION;
@@ -4117,7 +4117,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHECK OPTION WITH LOCAL' at line 2
CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASCADED CHECK OPTION
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH CASCADED CHECK OPTION
AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
CREATE OR REPLACE AS SELECT F59, F60
FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION;
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index ac48e20eaed..64573ed2bd1 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -2807,7 +2807,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE with()
SELECT * from t1 where f2=f1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'with()
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE write()
SELECT * from t1 where f2=f1;
@@ -7125,7 +7125,7 @@ CALL sp1();
x y z
000 000 000
Warnings:
-Warning 1264 Out of range value for column 'z' at row 1
+Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7163,7 +7163,7 @@ CALL sp1();
x y z
00000 00000 00000
Warnings:
-Warning 1264 Out of range value for column 'z' at row 1
+Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7201,7 +7201,7 @@ CALL sp1();
x y z
00000000 00000000 00000000
Warnings:
-Warning 1264 Out of range value for column 'z' at row 1
+Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7239,7 +7239,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Warning 1264 Out of range value for column 'z' at row 1
+Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7277,7 +7277,7 @@ CALL sp1();
x y z
00000000000000000000 00000000000000000000 00000000000000000000
Warnings:
-Warning 1264 Out of range value for column 'z' at row 1
+Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7297,7 +7297,7 @@ CALL sp1();
x y z
-9999999999 -9999999999 -9999999999
Warnings:
-Warning 1264 Out of range value for column 'z' at row 1
+Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7308,7 +7308,7 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'z' at row 1
+Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7319,7 +7319,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Warning 1264 Out of range value for column 'z' at row 1
+Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7330,7 +7330,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'z' at row 1
+Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7341,7 +7341,7 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'z' at row 1
+Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7352,7 +7352,7 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'z' at row 1
+Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7363,7 +7363,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'z' at row 1
+Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7374,7 +7374,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'z' at row 1
+Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -9219,7 +9219,7 @@ CREATE PROCEDURE sp1()
BEGIN
declare with char;
END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'char;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'with char;
END' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
@@ -11547,9 +11547,8 @@ BEGIN
declare with condition for sqlstate '02000';
declare exit handler for with set @var2 = 1;
END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'condition for sqlstate '02000';
-declare exit handler for with set @var2 = 1;
-END' at line 3
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'with condition for sqlstate '02000';
+declare exit handler for with set @var2 ...' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
@@ -13649,7 +13648,7 @@ CREATE PROCEDURE sp1( )
BEGIN
declare with handler for sqlstate '02000' set @var2 = 1;
END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'with handler for sqlstate '02000' set @var2 = 1;
END' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index a72c84564f0..d92f3f7d6b8 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -5,7 +5,7 @@
# Separate the test case name and the comment with ':'.
#
# <testcasename> : MDEV-<xxxx> <comment>
-#
+#
# Do not use any TAB characters for whitespace.
#
##############################################################################
@@ -14,19 +14,20 @@ MW-328A : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600
MW-328B : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002
MW-329 : MDEV-19962 Galera test failure on MW-329
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
-galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc
galera_concurrent_ctas : MDEV-24842 Galera test failure on galera_concurrent_ctas
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
galera_mdl_race : MDEV-21524: galera.galera_mdl_race MTR failed: query 'reap' succeeded - should have failed with errno 1213
-galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
+galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
galera_partition : MDEV-21806: galera.galera_partition MTR failed: failed to recover from DONOR state
galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
-galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key
galera_var_node_address : MDEV-20485 Galera test failure
-galera_wan : MDEV-17259 Test failure on galera.galera_wan
+#galera_wan : MDEV-17259 Test failure on galera.galera_wan
partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache
-sql_log_bin : MDEV-21491 galera.sql_log_bin
+#sql_log_bin : MDEV-21491 galera.sql_log_bin
versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons
pxc-421: wsrep_provider is read-only for security reasons
+galera_sst_xtrabackup-v2: Test fails due to innodb issues
+galera_sst_xtrabackup-v2_encrypt_with_key: Test fails due to innodb issues
+galera_sst_xtrabackup-v2_data_dir: Test fails due to innodb issues
diff --git a/mysql-test/suite/galera/include/have_qpress.inc b/mysql-test/suite/galera/include/have_qpress.inc
new file mode 100644
index 00000000000..0dd693f2c63
--- /dev/null
+++ b/mysql-test/suite/galera/include/have_qpress.inc
@@ -0,0 +1,4 @@
+#
+# suite.pm will make sure that all tests including this file
+# will be skipped as needed
+#
diff --git a/mysql-test/suite/galera/include/have_stunnel.inc b/mysql-test/suite/galera/include/have_stunnel.inc
new file mode 100644
index 00000000000..0dd693f2c63
--- /dev/null
+++ b/mysql-test/suite/galera/include/have_stunnel.inc
@@ -0,0 +1,4 @@
+#
+# suite.pm will make sure that all tests including this file
+# will be skipped as needed
+#
diff --git a/mysql-test/suite/galera/r/galera_fk_lock_wait.result b/mysql-test/suite/galera/r/galera_fk_lock_wait.result
new file mode 100644
index 00000000000..7bbbf40cb29
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_lock_wait.result
@@ -0,0 +1,52 @@
+CREATE TABLE parent(parent_id int not null AUTO_INCREMENT PRIMARY KEY,
+parent_name varchar(80)) ENGINE=InnoDB;
+CREATE TABLE child(child_id int not null AUTO_INCREMENT PRIMARY KEY,
+child_name varchar(80),
+child_parent_id int not null,
+CONSTRAINT `fk_child_parent`
+ FOREIGN KEY (child_parent_id) REFERENCES parent (parent_id)
+ON DELETE CASCADE
+ON UPDATE CASCADE) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1, 'first'),(2,'second'),(3,'foo'),(4,'tmp');
+INSERT INTO child VALUES (NULL,'first_child',1);
+INSERT INTO child VALUES (NULL,'second_child',1);
+INSERT INTO child VALUES (NULL,'first_child2',2);
+INSERT INTO child VALUES (NULL,'first_child3',2);
+INSERT INTO child VALUES (NULL,'first_child4',3);
+BEGIN;
+UPDATE parent SET parent_name = 'bar' WHERE parent_id = 2;
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET SESSION innodb_lock_wait_timeout=2;
+UPDATE child SET child_parent_id = 5 where child_parent_id = 2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection node_1;
+COMMIT;
+SELECT * FROM parent;
+parent_id parent_name
+1 first
+2 bar
+3 foo
+4 tmp
+SELECT * FROM child;
+child_id child_name child_parent_id
+1 first_child 1
+3 second_child 1
+5 first_child2 2
+7 first_child3 2
+9 first_child4 3
+connection node_2;
+SELECT * FROM parent;
+parent_id parent_name
+1 first
+2 bar
+3 foo
+4 tmp
+SELECT * FROM child;
+child_id child_name child_parent_id
+1 first_child 1
+3 second_child 1
+5 first_child2 2
+7 first_child3 2
+9 first_child4 3
+DROP TABLE child, parent;
+disconnect node_1a;
diff --git a/mysql-test/suite/galera/r/galera_fk_multibyte.result b/mysql-test/suite/galera/r/galera_fk_multibyte.result
new file mode 100644
index 00000000000..dfb3b86ff38
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_multibyte.result
@@ -0,0 +1,33 @@
+create table p (i varchar(100) primary key, j int) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+create table c1 (i int primary key auto_increment, j varchar(100), k int, key(j), constraint fk1 foreign key (j) references p(i)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+create table c2 (i int primary key auto_increment, j varchar(100), k int, key(j), constraint fk2 foreign key (j) references p(i)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+insert into p values('sippo',1);
+insert into c1 values(1,'sippo',1);
+insert into c2 values(1,'sippo',1);
+update c1 set k = 100 where j = 'sippo';
+insert into c1 values(2,'sippo',1);
+select * from p;
+i j
+sippo 1
+select * from c1;
+i j k
+1 sippo 100
+2 sippo 1
+select * from c2;
+i j k
+1 sippo 1
+connection node_2;
+select * from p;
+i j
+sippo 1
+select * from c1;
+i j k
+1 sippo 100
+2 sippo 1
+select * from c2;
+i j k
+1 sippo 1
+connection node_1;
+drop table c1;
+drop table c2;
+drop table p;
diff --git a/mysql-test/suite/galera/r/galera_ftwrl_drain.result b/mysql-test/suite/galera/r/galera_ftwrl_drain.result
index 751811b88fd..f90e6dfcdfd 100644
--- a/mysql-test/suite/galera/r/galera_ftwrl_drain.result
+++ b/mysql-test/suite/galera/r/galera_ftwrl_drain.result
@@ -8,9 +8,9 @@ connection node_2;
SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
-SELECT COUNT(*) = 0 FROM t1;
-COUNT(*) = 0
-1
+SELECT COUNT(*) AS EXPECT_0 FROM t1;
+EXPECT_0
+0
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2a;
FLUSH TABLES WITH READ LOCK;;
@@ -27,12 +27,12 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection node_2a;
UNLOCK TABLES;
connection node_2;
-SELECT COUNT(*) = 1 FROM t1;
-COUNT(*) = 1
+SELECT COUNT(*) AS EXPECT_1 FROM t1;
+EXPECT_1
1
INSERT INTO t1 VALUES (3);
connection node_1;
-SELECT COUNT(*) = 2 FROM t1;
-COUNT(*) = 2
-1
+SELECT COUNT(*) AS EXPECT_2 FROM t1;
+EXPECT_2
+2
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_fulltext.result b/mysql-test/suite/galera/r/galera_fulltext.result
index af017083b4e..bb482b7f4f7 100644
--- a/mysql-test/suite/galera/r/galera_fulltext.result
+++ b/mysql-test/suite/galera/r/galera_fulltext.result
@@ -62,3 +62,31 @@ COUNT(*)
1
connection node_1;
DROP TABLE t;
+connection node_1;
+SET @value=REPEAT (1,5001);
+CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb DEFAULT CHARSET=utf8;
+INSERT IGNORE INTO t VALUES(@value);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT COUNT(*) FROM t;
+COUNT(*)
+1
+connection node_2;
+SELECT COUNT(*) FROM t;
+COUNT(*)
+1
+connection node_1;
+DROP TABLE t;
+CREATE TABLE t (a VARCHAR(5000)) engine=innodb DEFAULT CHARSET=utf8;
+INSERT IGNORE INTO t VALUES(@value);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT COUNT(*) FROM t;
+COUNT(*)
+1
+connection node_2;
+SELECT COUNT(*) FROM t;
+COUNT(*)
+1
+connection node_1;
+DROP TABLE t;
diff --git a/mysql-test/suite/galera/r/galera_inject_bf_long_wait.result b/mysql-test/suite/galera/r/galera_inject_bf_long_wait.result
new file mode 100644
index 00000000000..e9eab5401c4
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_inject_bf_long_wait.result
@@ -0,0 +1,22 @@
+CREATE TABLE t1(id int not null primary key, b int) engine=InnoDB;
+INSERT INTO t1 VALUES (0,0),(1,1),(2,2),(3,3);
+BEGIN;
+UPDATE t1 set b = 100 where id between 1 and 2;;
+connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+connection node_1b;
+SET @save_dbug = @@SESSION.debug_dbug;
+SET @@SESSION.innodb_lock_wait_timeout=2;
+SET @@SESSION.debug_dbug = '+d,wsrep_instrument_BF_lock_wait';
+UPDATE t1 set b = 200 WHERE id = 1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET @@SESSION.debug_dbug = @save_dbug;
+connection node_1;
+COMMIT;
+SELECT * FROM t1;
+id b
+0 0
+1 100
+2 100
+3 3
+disconnect node_1b;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs,debug.rdiff
index fa1b67e7ef3..55f1150c930 100644
--- a/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs,debug.rdiff
@@ -1,11 +1,12 @@
--- r/galera_ist_innodb_flush_logs.result 2018-09-05 10:34:36.192439933 +0300
+++ r/galera_ist_innodb_flush_logs.reject 2018-09-17 10:20:06.039150838 +0300
-@@ -86,3 +86,100 @@
+@@ -86,3 +86,111 @@
DROP TABLE t1;
COMMIT;
SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
++connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
@@ -14,6 +15,7 @@
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
++connection node_2;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
@@ -22,9 +24,12 @@
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
++connection node_1;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
++connection node_2;
+SET wsrep_sync_wait = 0;
+Killing server ...
++connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
@@ -39,6 +44,7 @@
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
@@ -46,7 +52,9 @@
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++connection node_2;
+Performing --wsrep-recover ...
++connection node_2;
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
@@ -57,6 +65,7 @@
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
++connection node_1;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
@@ -71,6 +80,7 @@
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
++connection node_1a_galera_st_kill_slave_ddl;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
@@ -88,6 +98,7 @@
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
++connection node_1;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
diff --git a/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result b/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result
index 8a7c02ab1b6..80a28d349ba 100644
--- a/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result
+++ b/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result
@@ -21,7 +21,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
INSERT INTO t1 VALUES ('node2_committed_before');
COMMIT;
Unloading wsrep provider ...
-SET GLOBAL wsrep_provider = 'none';
+SET GLOBAL wsrep_cluster_address = '';
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
diff --git a/mysql-test/suite/galera/r/galera_password.result b/mysql-test/suite/galera/r/galera_password.result
new file mode 100644
index 00000000000..7af0c2169a0
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_password.result
@@ -0,0 +1,19 @@
+SHOW VARIABLES LIKE '%password%';
+Variable_name Value
+old_passwords OFF
+report_password
+strict_password_validation ON
+CREATE USER 'user123456'@'localhost';
+GRANT SELECT, INSERT, UPDATE ON test.* TO 'user123456'@'localhost';
+SET PASSWORD FOR 'user123456'@'localhost' = PASSWORD('A$10abcdDCBA123456%7');
+SHOW GRANTS FOR 'user123456'@'localhost';
+Grants for user123456@localhost
+GRANT USAGE ON *.* TO 'user123456'@'localhost' IDENTIFIED BY PASSWORD '*5846CF4D641598B360B3562E581586155C59F65A'
+GRANT SELECT, INSERT, UPDATE ON `test`.* TO 'user123456'@'localhost'
+connection node_2;
+SHOW GRANTS FOR 'user123456'@'localhost';
+Grants for user123456@localhost
+GRANT USAGE ON *.* TO 'user123456'@'localhost' IDENTIFIED BY PASSWORD '*5846CF4D641598B360B3562E581586155C59F65A'
+GRANT SELECT, INSERT, UPDATE ON `test`.* TO 'user123456'@'localhost'
+connection node_1;
+DROP USER 'user123456'@'localhost';
diff --git a/mysql-test/suite/galera/r/galera_roles.result b/mysql-test/suite/galera/r/galera_roles.result
index bef89acfc92..d3654e4d0de 100644
--- a/mysql-test/suite/galera/r/galera_roles.result
+++ b/mysql-test/suite/galera/r/galera_roles.result
@@ -26,7 +26,7 @@ connect foo_node_2,127.0.0.1,foo,,test,$port_2,;
connection foo_node_1;
SHOW GRANTS;
Grants for foo@localhost
-GRANT role1 TO 'foo'@'localhost'
+GRANT 'role1' TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'foo'@'localhost'
FLUSH TABLES;
ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
@@ -62,7 +62,7 @@ pr1
connection foo_node_2;
SHOW GRANTS;
Grants for foo@localhost
-GRANT role1 TO 'foo'@'localhost'
+GRANT 'role1' TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'foo'@'localhost'
FLUSH TABLES;
ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
diff --git a/mysql-test/suite/galera/r/galera_ssl_upgrade.result b/mysql-test/suite/galera/r/galera_ssl_upgrade.result
index 8aab135c6a2..1443e34d041 100644
--- a/mysql-test/suite/galera/r/galera_ssl_upgrade.result
+++ b/mysql-test/suite/galera/r/galera_ssl_upgrade.result
@@ -1,10 +1,3 @@
-call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown");
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 2
-1
connection node_1;
call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*");
connection node_2;
@@ -12,6 +5,14 @@ call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*");
connection node_1;
connection node_2;
connection node_1;
+connection node_2;
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+connection node_1;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
@@ -23,3 +24,5 @@ connection node_1;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
+disconnect node_2;
+disconnect node_1;
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key-openssl.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key-openssl.result
new file mode 100644
index 00000000000..990e0a29506
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key-openssl.result
@@ -0,0 +1,3 @@
+SELECT 1;
+1
+1
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key.result
index 990e0a29506..8048cafecd8 100644
--- a/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key.result
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key.result
@@ -1,3 +1,4 @@
SELECT 1;
1
1
+include/assert_grep.inc [Using openssl based encryption with socat]
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key_server.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key_server.result
new file mode 100644
index 00000000000..8048cafecd8
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_encrypt_with_key_server.result
@@ -0,0 +1,4 @@
+SELECT 1;
+1
+1
+include/assert_grep.inc [Using openssl based encryption with socat]
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_qpress.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_qpress.result
new file mode 100644
index 00000000000..684a6d00c7e
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_qpress.result
@@ -0,0 +1,4 @@
+SELECT 1;
+1
+1
+include/assert_grep.inc [Compressed qpress files found]
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_binlogname.result b/mysql-test/suite/galera/r/galera_sst_rsync_binlogname.result
new file mode 100644
index 00000000000..0f0a673947c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_rsync_binlogname.result
@@ -0,0 +1,96 @@
+connection node_1;
+connection node_2;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_shutdown_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_encrypt_with_key.result b/mysql-test/suite/galera/r/galera_sst_rsync_encrypt_with_key.result
new file mode 100644
index 00000000000..251c087412b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_rsync_encrypt_with_key.result
@@ -0,0 +1,400 @@
+connection node_1;
+connection node_2;
+connection node_2;
+CALL mtr.add_suppression("\\[ERROR\\] .*ib_buffer_pool' for reading: No such file or directory");
+connection node_1;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_shutdown_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that starts from a clean var directory
+This is accomplished by shutting down node #2 and removing its var directory before restarting it
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+Cleaning var directory ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_clean_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_kill_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+connection node_2;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
+connection node_1;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+connection node_2;
+SET wsrep_sync_wait = 0;
+Killing server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Performing --wsrep-recover ...
+connection node_2;
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_kill_slave_ddl;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET GLOBAL debug_dbug = $debug_orig;
+include/assert_grep.inc [Using stunnel for SSL encryption]
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_encrypt_with_server.result b/mysql-test/suite/galera/r/galera_sst_rsync_encrypt_with_server.result
new file mode 100644
index 00000000000..251c087412b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_rsync_encrypt_with_server.result
@@ -0,0 +1,400 @@
+connection node_1;
+connection node_2;
+connection node_2;
+CALL mtr.add_suppression("\\[ERROR\\] .*ib_buffer_pool' for reading: No such file or directory");
+connection node_1;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_shutdown_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that starts from a clean var directory
+This is accomplished by shutting down node #2 and removing its var directory before restarting it
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+Cleaning var directory ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_clean_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Killing server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Performing --wsrep-recover ...
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_kill_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+connection node_2;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
+connection node_1;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+connection node_2;
+SET wsrep_sync_wait = 0;
+Killing server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Performing --wsrep-recover ...
+connection node_2;
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_kill_slave_ddl;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET GLOBAL debug_dbug = $debug_orig;
+include/assert_grep.inc [Using stunnel for SSL encryption]
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_logbasename.result b/mysql-test/suite/galera/r/galera_sst_rsync_logbasename.result
new file mode 100644
index 00000000000..0f0a673947c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_rsync_logbasename.result
@@ -0,0 +1,96 @@
+connection node_1;
+connection node_2;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+INSERT INTO t1 VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+INSERT INTO t1 VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_shutdown_slave;
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/r/galera_var_sst_auth.result b/mysql-test/suite/galera/r/galera_var_sst_auth.result
index 89a27dce4f6..e03576175c5 100644
--- a/mysql-test/suite/galera/r/galera_var_sst_auth.result
+++ b/mysql-test/suite/galera/r/galera_var_sst_auth.result
@@ -1,3 +1,5 @@
+connection node_1;
+connection node_2;
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
********
diff --git a/mysql-test/suite/galera/r/galera_wan_restart_sst.result b/mysql-test/suite/galera/r/galera_wan_restart_sst.result
index 71786cdd023..1adcbfd1d50 100644
--- a/mysql-test/suite/galera/r/galera_wan_restart_sst.result
+++ b/mysql-test/suite/galera/r/galera_wan_restart_sst.result
@@ -1,6 +1,6 @@
-SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 4
-1
+SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+EXPECT_4
+4
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
INSERT INTO t1 VALUES (1);
@@ -46,30 +46,30 @@ INSERT INTO t1 VALUES (33);
connection node_4;
INSERT INTO t1 VALUES (341);
connection node_1;
-SELECT COUNT(*) = 19 FROM t1;
-COUNT(*) = 19
-1
+SELECT COUNT(*) AS EXPECT_19 FROM t1;
+EXPECT_19
+19
connection node_2;
-SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 4
-1
-SELECT COUNT(*) = 19 FROM t1;
-COUNT(*) = 19
-1
+SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+EXPECT_4
+4
+SELECT COUNT(*) AS EXPECT_19 FROM t1;
+EXPECT_19
+19
connection node_3;
-SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 4
-1
-SELECT COUNT(*) = 19 FROM t1;
-COUNT(*) = 19
-1
+SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+EXPECT_4
+4
+SELECT COUNT(*) AS EXPECT_19 FROM t1;
+EXPECT_19
+19
connection node_4;
-SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 4
-1
-SELECT COUNT(*) = 19 FROM t1;
-COUNT(*) = 19
-1
+SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+EXPECT_4
+4
+SELECT COUNT(*) AS EXPECT_19 FROM t1;
+EXPECT_19
+19
connection node_1;
DROP TABLE t1;
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
diff --git a/mysql-test/suite/galera/r/lp1376747-4.result b/mysql-test/suite/galera/r/lp1376747-4.result
index 3370e1d3d8e..efce740ea88 100644
--- a/mysql-test/suite/galera/r/lp1376747-4.result
+++ b/mysql-test/suite/galera/r/lp1376747-4.result
@@ -27,8 +27,8 @@ t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
-set debug_sync= 'RESET';
connection node_2a;
+set debug_sync= 'RESET';
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = DEFAULT;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm
index 8ef5965834f..9ceedf82a0e 100644
--- a/mysql-test/suite/galera/suite.pm
+++ b/mysql-test/suite/galera/suite.pm
@@ -69,4 +69,13 @@ push @::global_suppressions,
qr|WSREP: Trying to continue unpaused monitor|,
);
+sub skip_combinations {
+ my %skip = ();
+ $skip{'include/have_stunnel.inc'} = "Need 'stunnel' utility"
+ unless ::which("stunnel");
+ $skip{'include/have_qpress.inc'} = "Need 'qpress' utility"
+ unless ::which("qpress");
+ %skip;
+}
+
bless { };
diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
index 7da7dd4e73b..2e25ecae317 100644
--- a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
+++ b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf
@@ -10,4 +10,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
-
diff --git a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf
new file mode 100644
index 00000000000..889c81b4a0a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+auto_increment_offset=1
+
+[mysqld.2]
+auto_increment_offset=2
diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test b/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test
index d902783ed64..7021681b2f9 100644
--- a/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test
+++ b/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test
@@ -93,7 +93,6 @@ SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
--connection node_1
# issue conflicting write to child table, it should fail in certification
---error ER_LOCK_DEADLOCK
--send update child set j=2;
--connection node_1a
@@ -103,6 +102,7 @@ SET GLOBAL debug_dbug = "";
SET DEBUG_SYNC = "RESET";
--connection node_1
+--error 0,ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT
--reap
--let $wait_condition = SELECT COUNT(*) = 0 FROM parent;
--source include/wait_condition.inc
diff --git a/mysql-test/suite/galera/t/galera_fk_lock_wait.test b/mysql-test/suite/galera/t/galera_fk_lock_wait.test
new file mode 100644
index 00000000000..150c7397f7e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_lock_wait.test
@@ -0,0 +1,40 @@
+--source include/galera_cluster.inc
+
+CREATE TABLE parent(parent_id int not null AUTO_INCREMENT PRIMARY KEY,
+parent_name varchar(80)) ENGINE=InnoDB;
+
+CREATE TABLE child(child_id int not null AUTO_INCREMENT PRIMARY KEY,
+child_name varchar(80),
+child_parent_id int not null,
+CONSTRAINT `fk_child_parent`
+ FOREIGN KEY (child_parent_id) REFERENCES parent (parent_id)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1, 'first'),(2,'second'),(3,'foo'),(4,'tmp');
+INSERT INTO child VALUES (NULL,'first_child',1);
+INSERT INTO child VALUES (NULL,'second_child',1);
+INSERT INTO child VALUES (NULL,'first_child2',2);
+INSERT INTO child VALUES (NULL,'first_child3',2);
+INSERT INTO child VALUES (NULL,'first_child4',3);
+
+BEGIN;
+UPDATE parent SET parent_name = 'bar' WHERE parent_id = 2;
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET SESSION innodb_lock_wait_timeout=2;
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE child SET child_parent_id = 5 where child_parent_id = 2;
+
+--connection node_1
+COMMIT;
+SELECT * FROM parent;
+SELECT * FROM child;
+
+--connection node_2
+
+SELECT * FROM parent;
+SELECT * FROM child;
+DROP TABLE child, parent;
+
+--disconnect node_1a
diff --git a/mysql-test/suite/galera/t/galera_fk_multibyte.test b/mysql-test/suite/galera/t/galera_fk_multibyte.test
new file mode 100644
index 00000000000..4bc03b6d84b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_multibyte.test
@@ -0,0 +1,23 @@
+--source include/galera_cluster.inc
+
+create table p (i varchar(100) primary key, j int) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+create table c1 (i int primary key auto_increment, j varchar(100), k int, key(j), constraint fk1 foreign key (j) references p(i)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+create table c2 (i int primary key auto_increment, j varchar(100), k int, key(j), constraint fk2 foreign key (j) references p(i)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+insert into p values('sippo',1);
+insert into c1 values(1,'sippo',1);
+insert into c2 values(1,'sippo',1);
+update c1 set k = 100 where j = 'sippo';
+insert into c1 values(2,'sippo',1);
+select * from p;
+select * from c1;
+select * from c2;
+
+--connection node_2
+select * from p;
+select * from c1;
+select * from c2;
+
+--connection node_1
+drop table c1;
+drop table c2;
+drop table p;
diff --git a/mysql-test/suite/galera/t/galera_ftwrl_drain.test b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
index 690e890cdea..9ed93643b3f 100644
--- a/mysql-test/suite/galera/t/galera_ftwrl_drain.test
+++ b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
@@ -18,7 +18,8 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
--connection node_2
-
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
+--source include/wait_condition.inc
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_set_sync_point.inc
@@ -31,7 +32,7 @@ SET SESSION wsrep_sync_wait = 0;
# Wait until applier has blocked
--source include/galera_wait_sync_point.inc
-SELECT COUNT(*) = 0 FROM t1;
+SELECT COUNT(*) AS EXPECT_0 FROM t1;
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--connection node_2a
@@ -61,9 +62,11 @@ INSERT INTO t2 VALUES (2);
UNLOCK TABLES;
--connection node_2
-SELECT COUNT(*) = 1 FROM t1;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1
+--source include/wait_condition.inc
+SELECT COUNT(*) AS EXPECT_1 FROM t1;
INSERT INTO t1 VALUES (3);
--connection node_1
-SELECT COUNT(*) = 2 FROM t1;
+SELECT COUNT(*) AS EXPECT_2 FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_fulltext.test b/mysql-test/suite/galera/t/galera_fulltext.test
index 19aa4f7a0a0..beb6a1b8f6f 100644
--- a/mysql-test/suite/galera/t/galera_fulltext.test
+++ b/mysql-test/suite/galera/t/galera_fulltext.test
@@ -1,6 +1,4 @@
---source include/big_test.inc
--source include/galera_cluster.inc
---source include/have_innodb.inc
#
# InnoDB FULLTEXT indexes
@@ -83,3 +81,27 @@ SELECT COUNT(*) FROM t;
--connection node_1
DROP TABLE t;
+
+#
+# Case 2: UTF-8
+#
+--connection node_1
+SET @value=REPEAT (1,5001);
+CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb DEFAULT CHARSET=utf8;
+INSERT IGNORE INTO t VALUES(@value);
+SELECT COUNT(*) FROM t;
+
+--connection node_2
+SELECT COUNT(*) FROM t;
+
+--connection node_1
+DROP TABLE t;
+CREATE TABLE t (a VARCHAR(5000)) engine=innodb DEFAULT CHARSET=utf8;
+INSERT IGNORE INTO t VALUES(@value);
+SELECT COUNT(*) FROM t;
+
+--connection node_2
+SELECT COUNT(*) FROM t;
+
+--connection node_1
+DROP TABLE t;
diff --git a/mysql-test/suite/galera/t/galera_inject_bf_long_wait.test b/mysql-test/suite/galera/t/galera_inject_bf_long_wait.test
new file mode 100644
index 00000000000..f4aac7fd795
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_inject_bf_long_wait.test
@@ -0,0 +1,25 @@
+--source include/galera_cluster.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1(id int not null primary key, b int) engine=InnoDB;
+INSERT INTO t1 VALUES (0,0),(1,1),(2,2),(3,3);
+
+BEGIN;
+--send UPDATE t1 set b = 100 where id between 1 and 2;
+
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1b
+SET @save_dbug = @@SESSION.debug_dbug;
+SET @@SESSION.innodb_lock_wait_timeout=2;
+SET @@SESSION.debug_dbug = '+d,wsrep_instrument_BF_lock_wait';
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 set b = 200 WHERE id = 1;
+SET @@SESSION.debug_dbug = @save_dbug;
+
+--connection node_1
+--reap
+COMMIT;
+SELECT * FROM t1;
+--disconnect node_1b
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf
index b91c897e66e..2c0cec0ab5a 100644
--- a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf
@@ -1,7 +1,7 @@
!include ../galera_2nodes.cnf
[mysqld]
-wsrep_sst_method=xtrabackup-v2
+wsrep_sst_method=mariabackup
wsrep_sst_auth=root:
innodb_safe_truncate=OFF
@@ -12,4 +12,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
-
diff --git a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test
index 839383ebfc1..fd362a26840 100644
--- a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test
+++ b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test
@@ -7,7 +7,7 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
---source include/have_xtrabackup.inc
+--source include/have_mariabackup.inc
--source suite/galera/include/galera_st_kill_slave.inc
--source suite/galera/include/galera_st_kill_slave_ddl.inc
diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf b/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf
index 75dff78149d..3dc62546591 100644
--- a/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf
@@ -9,4 +9,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
-
diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf
index 1542376b2b8..7979b23e085 100644
--- a/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf
@@ -11,4 +11,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
-
diff --git a/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf b/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf
index 357c8678658..807829f047f 100644
--- a/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf
@@ -8,5 +8,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
-
-
diff --git a/mysql-test/suite/galera/t/galera_ist_rsync.cnf b/mysql-test/suite/galera/t/galera_ist_rsync.cnf
index 797e3651967..7a3da6dad02 100644
--- a/mysql-test/suite/galera/t/galera_ist_rsync.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_rsync.cnf
@@ -10,4 +10,3 @@ wsrep_sync_wait=1
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
wsrep_sync_wait=1
-
diff --git a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf
index 52df3814129..5b35701aeab 100644
--- a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf
@@ -5,10 +5,8 @@ wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=root:
innodb_safe_truncate=OFF
-
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
-
diff --git a/mysql-test/suite/galera/t/galera_log_bin.cnf b/mysql-test/suite/galera/t/galera_log_bin.cnf
index 8f6a760def0..98e724fb2d0 100644
--- a/mysql-test/suite/galera/t/galera_log_bin.cnf
+++ b/mysql-test/suite/galera/t/galera_log_bin.cnf
@@ -7,4 +7,3 @@ log-slave-updates
[mysqld.2]
log-bin
log-slave-updates
-
diff --git a/mysql-test/suite/galera/t/galera_log_bin.inc b/mysql-test/suite/galera/t/galera_log_bin.inc
index f1d2a12b9de..12d6388615c 100644
--- a/mysql-test/suite/galera/t/galera_log_bin.inc
+++ b/mysql-test/suite/galera/t/galera_log_bin.inc
@@ -39,4 +39,3 @@ DROP TABLE t2;
--echo #cleanup
--connection node_1
RESET MASTER;
-
diff --git a/mysql-test/suite/galera/t/galera_log_bin_opt.cnf b/mysql-test/suite/galera/t/galera_log_bin_opt.cnf
index a09efd2e011..3c14cde794c 100644
--- a/mysql-test/suite/galera/t/galera_log_bin_opt.cnf
+++ b/mysql-test/suite/galera/t/galera_log_bin_opt.cnf
@@ -12,4 +12,4 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore
[sst]
transferfmt=@ENV.MTR_GALERA_TFMT
-streamfmt=xbstream
+streamfmt=mbstream
diff --git a/mysql-test/suite/galera/t/galera_password.test b/mysql-test/suite/galera/t/galera_password.test
new file mode 100644
index 00000000000..7843097c67e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_password.test
@@ -0,0 +1,14 @@
+--source include/galera_cluster.inc
+
+SHOW VARIABLES LIKE '%password%';
+
+CREATE USER 'user123456'@'localhost';
+GRANT SELECT, INSERT, UPDATE ON test.* TO 'user123456'@'localhost';
+SET PASSWORD FOR 'user123456'@'localhost' = PASSWORD('A$10abcdDCBA123456%7');
+SHOW GRANTS FOR 'user123456'@'localhost';
+
+--connection node_2
+SHOW GRANTS FOR 'user123456'@'localhost';
+
+--connection node_1
+DROP USER 'user123456'@'localhost';
diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.test b/mysql-test/suite/galera/t/galera_ssl_upgrade.test
index 33c5a43df9d..4d6b9159c78 100644
--- a/mysql-test/suite/galera/t/galera_ssl_upgrade.test
+++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.test
@@ -8,16 +8,16 @@
--source include/have_innodb.inc
--source include/have_ssl_communication.inc
-call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown");
-
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-
--connection node_1
call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*");
--connection node_2
call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*");
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
# Setup galera ports
--connection node_1
--source suite/galera/include/galera_base_port.inc
@@ -27,6 +27,9 @@ call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*");
--source suite/galera/include/galera_base_port.inc
--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
# 2. Restart node #1 with a socket.ssl_ca that includes both the new and the old certificate
--connection node_1
@@ -40,7 +43,7 @@ call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*");
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-# 3. Restart node #2 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
+# 3. Restart node #2 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
--connection node_2
--source include/shutdown_mysqld.inc
@@ -52,7 +55,7 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-# 4. Restart node #1 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
+# 4. Restart node #1 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
--connection node_1
--source include/shutdown_mysqld.inc
@@ -65,3 +68,8 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
# Upgrade complete. Both nodes now use the new key and certificate
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup.cnf
index 336296e9bfe..4110192b947 100644
--- a/mysql-test/suite/galera/t/galera_sst_mariabackup.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup.cnf
@@ -13,4 +13,4 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore
[sst]
transferfmt=@ENV.MTR_GALERA_TFMT
-streamfmt=xbstream
+streamfmt=mbstream
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key-openssl.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key-openssl.cnf
new file mode 100644
index 00000000000..63eb47b519d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key-openssl.cnf
@@ -0,0 +1,13 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+[sst]
+encrypt-format=openssl
+encrypt=1
+encrypt-algo=aes-256-ctr
+encrypt-key=4FA92C5873672E20FB163A0BCB2BB4A4
+transferfmt=@ENV.MTR_GALERA_TFMT
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key-openssl.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key-openssl.test
new file mode 100644
index 00000000000..1a78aa22cb3
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key-openssl.test
@@ -0,0 +1,12 @@
+#
+# This test checks that encryption with key using openssl with options
+# passed to mariabackup via the my.cnf file
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_mariabackup.inc
+
+SELECT 1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.test
index 4449ea43c43..523d44102dd 100644
--- a/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.test
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.test
@@ -1,6 +1,8 @@
#
-# This test checks that key and cert encryption options can be passed to mariabackup via the my.cnf file
-# Initial SST happens via mariabackup, so there is not much to do in the body of the test
+# This test checks that key and cert encryption options can be passed to
+# mariabackup via the my.cnf file
+# Initial SST happens via mariabackup, so there is not much to do in the body
+# of the test
#
--source include/big_test.inc
@@ -12,3 +14,11 @@ SELECT 1;
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
+
+# Confirm that transfer was SSL-encrypted
+--let $assert_text = Using openssl based encryption with socat
+--let $assert_select = Using openssl based encryption with socat: with key and crt
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = CURRENT_TEST
+--source include/assert_grep.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.cnf
new file mode 100644
index 00000000000..9abef8820e5
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.cnf
@@ -0,0 +1,13 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/server-cert.pem
+ssl-key=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem
+ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
+
+[sst]
+ssl-mode=VERIFY_CA
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.test
new file mode 100644
index 00000000000..5673dda30cb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.test
@@ -0,0 +1,25 @@
+#
+# This test checks that if SST SSL is not explicitly donfigured mariabackup SST
+# uses server SSL configuration if present.
+# Initial SST happens via mariabackup, so there is not much to do in the body
+# of the test
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_mariabackup.inc
+--source include/have_ssl_communication.inc
+
+SELECT 1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Confirm that transfer was SSL-encrypted
+--let $assert_text = Using openssl based encryption with socat
+--let $assert_select = Using openssl based encryption with socat: with key and crt
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = CURRENT_TEST
+--source include/assert_grep.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_qpress.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_qpress.cnf
new file mode 100644
index 00000000000..f58d22cba52
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_qpress.cnf
@@ -0,0 +1,13 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth="root:"
+wsrep_debug=ON
+
+[sst]
+transferfmt=@ENV.MTR_GALERA_TFMT
+compress=quicklz
+compress-threads=2
+compress-chunk-size=32768
+backup-threads=2
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_qpress.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_qpress.test
new file mode 100644
index 00000000000..b5386885ca0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_qpress.test
@@ -0,0 +1,24 @@
+#
+# This test checks that qpress compression works with mariabackup
+# Initial SST happens via mariabackup, so there is not much to do in the body
+# of the test
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_mariabackup.inc
+--source include/have_qpress.inc
+
+SELECT 1;
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Confirm that transfer was compressed using qpress algorithm
+--let $assert_text = Compressed qpress files found
+--let $assert_select = Compressed qpress files found
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = CURRENT_TEST
+--source include/assert_grep.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
index 5e6913d4d2b..13cb1aa5366 100644
--- a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
@@ -15,4 +15,4 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore
[sst]
transferfmt=@ENV.MTR_GALERA_TFMT
-streamfmt=xbstream
+streamfmt=mbstream
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync.cnf b/mysql-test/suite/galera/t/galera_sst_rsync.cnf
index 93981d9daa7..29d3a1e6219 100644
--- a/mysql-test/suite/galera/t/galera_sst_rsync.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_rsync.cnf
@@ -8,4 +8,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
-
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync2.cnf b/mysql-test/suite/galera/t/galera_sst_rsync2.cnf
index 34e67c66403..0159596f99b 100644
--- a/mysql-test/suite/galera/t/galera_sst_rsync2.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_rsync2.cnf
@@ -12,4 +12,3 @@ log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server1_binlog_index.index
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
log_bin=@ENV.MYSQLTEST_VARDIR/server2_binlog
log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server2_binlog_index.index
-
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf
new file mode 100644
index 00000000000..b1e4278dceb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+log_bin=server1_binlog
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+log_bin=server2_binlog
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.test b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.test
new file mode 100644
index 00000000000..b4ad6c43a0b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.test
@@ -0,0 +1,9 @@
+--source include/galera_cluster.inc
+
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf
index afe9796a11a..4cc3442bd87 100644
--- a/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf
@@ -9,3 +9,6 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore
[mysqld.2]
innodb_data_home_dir=@ENV.MYSQL_TMP_DIR/rsync_test_2
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[sst]
+backup_threads=2
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.cnf
new file mode 100644
index 00000000000..948b52d4bf7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.cnf
@@ -0,0 +1,14 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[sst]
+tkey=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem
+tcert=@ENV.MYSQL_TEST_DIR/std_data/server-cert.pem
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.test b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.test
new file mode 100644
index 00000000000..838c473b9ce
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.test
@@ -0,0 +1,29 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_debug.inc
+--source include/have_stunnel.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_2
+CALL mtr.add_suppression("\\[ERROR\\] .*ib_buffer_pool' for reading: No such file or directory");
+
+--connection node_1
+--source suite/galera/include/galera_st_shutdown_slave.inc
+--source suite/galera/include/galera_st_clean_slave.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
+
+# Confirm that transfer was SSL-encrypted
+--let $assert_text = Using stunnel for SSL encryption
+--let $assert_select = Using stunnel for SSL encryption
+--let $assert_count = 5
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = CURRENT_TEST
+--source include/assert_grep.inc
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.cnf
new file mode 100644
index 00000000000..8ed9348e789
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.cnf
@@ -0,0 +1,16 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/server-cert.pem
+ssl-key=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem
+ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
+
+[sst]
+ssl-mode=VERIFY_CA
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.test b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.test
new file mode 100644
index 00000000000..838c473b9ce
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.test
@@ -0,0 +1,29 @@
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_debug.inc
+--source include/have_stunnel.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_2
+CALL mtr.add_suppression("\\[ERROR\\] .*ib_buffer_pool' for reading: No such file or directory");
+
+--connection node_1
+--source suite/galera/include/galera_st_shutdown_slave.inc
+--source suite/galera/include/galera_st_clean_slave.inc
+
+--source suite/galera/include/galera_st_kill_slave.inc
+--source suite/galera/include/galera_st_kill_slave_ddl.inc
+
+# Confirm that transfer was SSL-encrypted
+--let $assert_text = Using stunnel for SSL encryption
+--let $assert_select = Using stunnel for SSL encryption
+--let $assert_count = 5
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = CURRENT_TEST
+--source include/assert_grep.inc
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf
new file mode 100644
index 00000000000..4f25af7cd8b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf
@@ -0,0 +1,15 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+log_basename=server1
+log_bin
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+log_basename=server2
+log_bin
+
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.test b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.test
new file mode 100644
index 00000000000..b4ad6c43a0b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.test
@@ -0,0 +1,9 @@
+--source include/galera_cluster.inc
+
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf
index 792b0d15ac4..7a98fd2aa58 100644
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf
@@ -7,7 +7,7 @@ wsrep_debug=ON
innodb_safe_truncate=OFF
[SST]
-tkey=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem
-tcert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
+tkey=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem
+tcert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
encrypt=3
transferfmt=@ENV.MTR_GALERA_TFMT
diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.cnf b/mysql-test/suite/galera/t/galera_var_sst_auth.cnf
index ff29db2306b..114815d446a 100644
--- a/mysql-test/suite/galera/t/galera_var_sst_auth.cnf
+++ b/mysql-test/suite/galera/t/galera_var_sst_auth.cnf
@@ -5,8 +5,3 @@ wsrep_sst_auth=root:
[mysqld.2]
wsrep_sst_auth=root:
-
-
-
-
-
diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.test b/mysql-test/suite/galera/t/galera_var_sst_auth.test
index ad7f46620ad..ebeaddc0e63 100644
--- a/mysql-test/suite/galera/t/galera_var_sst_auth.test
+++ b/mysql-test/suite/galera/t/galera_var_sst_auth.test
@@ -1,6 +1,11 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
#
# MDEV-10492: Assertion failure on shutdown when wsrep_sst_auth set in config
#
@@ -30,4 +35,5 @@ SELECT @@global.wsrep_sst_auth;
--source include/wait_condition.inc
SELECT @@global.wsrep_sst_auth;
-
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_wan_restart_sst.test b/mysql-test/suite/galera/t/galera_wan_restart_sst.test
index 9b12eeed1ac..16e073e7164 100644
--- a/mysql-test/suite/galera/t/galera_wan_restart_sst.test
+++ b/mysql-test/suite/galera/t/galera_wan_restart_sst.test
@@ -4,15 +4,17 @@
# We can not easily restart the first node, so instead we restart all the other nodes. MTR does not allow multiple nodes
# to be down at the same time, so restarts are sequential.
#
-# We can not test any of the actual WAN optimizations from inside MTR and no
+# We can not test any of the actual WAN optimizations from inside MTR and no
# status variables are provided. So we only check that simple replication works.
#
--source include/big_test.inc
--source include/galera_cluster.inc
---source include/have_innodb.inc
+--source include/force_restart.inc
-SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1
CREATE TABLE t1 (f1 INTEGER);
@@ -37,10 +39,11 @@ INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (13);
--source include/kill_galera.inc
---sleep 5
--connection node_1
--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
INSERT INTO t1 VALUES (11);
--connection node_2
@@ -51,9 +54,11 @@ INSERT INTO t1 VALUES (14);
--connection node_3
--source include/start_mysqld.inc
---sleep 5
--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
INSERT INTO t1 VALUES (131);
#
@@ -64,10 +69,12 @@ INSERT INTO t1 VALUES (131);
INSERT INTO t1 VALUES (22);
--source include/kill_galera.inc
---sleep 5
--connection node_1
--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
INSERT INTO t1 VALUES (21);
--connection node_3
@@ -78,8 +85,9 @@ INSERT INTO t1 VALUES (24);
--connection node_2
--source include/start_mysqld.inc
---sleep 5
--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
INSERT INTO t1 VALUES (221);
@@ -91,10 +99,11 @@ INSERT INTO t1 VALUES (221);
INSERT INTO t1 VALUES (34);
--source include/kill_galera.inc
---sleep 5
--connection node_1
--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
INSERT INTO t1 VALUES (31);
--connection node_2
@@ -105,12 +114,12 @@ INSERT INTO t1 VALUES (33);
--connection node_4
--source include/start_mysqld.inc
---sleep 5
--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
INSERT INTO t1 VALUES (341);
-
#
# Check all nodes
#
@@ -119,19 +128,19 @@ INSERT INTO t1 VALUES (341);
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
-SELECT COUNT(*) = 19 FROM t1;
+SELECT COUNT(*) AS EXPECT_19 FROM t1;
--connection node_2
-SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-SELECT COUNT(*) = 19 FROM t1;
+SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) AS EXPECT_19 FROM t1;
--connection node_3
-SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-SELECT COUNT(*) = 19 FROM t1;
+SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) AS EXPECT_19 FROM t1;
--connection node_4
-SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-SELECT COUNT(*) = 19 FROM t1;
+SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) AS EXPECT_19 FROM t1;
--connection node_1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/lp1376747-4.test b/mysql-test/suite/galera/t/lp1376747-4.test
index d19ff422ab0..724901da068 100644
--- a/mysql-test/suite/galera/t/lp1376747-4.test
+++ b/mysql-test/suite/galera/t/lp1376747-4.test
@@ -46,10 +46,10 @@ SET debug_sync='now SIGNAL go2';
# the cluster as there is new FTRL that is still pausing it.
UNLOCK TABLES;
SHOW CREATE TABLE t1;
-set debug_sync= 'RESET';
--connection node_2a
--reap
+set debug_sync= 'RESET';
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = DEFAULT;
diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def
index 87eca207d5a..9100db4d441 100644
--- a/mysql-test/suite/galera_3nodes/disabled.def
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -5,21 +5,16 @@
# Separate the test case name and the comment with ':'.
#
# <testcasename> : MDEV-<xxxx> <comment>
-#
+#
# Do not use any TAB characters for whitespace.
#
##############################################################################
GAL-501 : MDEV-24645 galera_3nodes.GAL-501 MTR failed: failed to open gcomm backend connection: 110
galera_gtid_2_cluster : MDEV-23775 Galera test failure on galera_3nodes.galera_gtid_2_cluster
-galera_ipv6_mariabackup : MDEV-24440: galera_3nodes.galera_ipv6_mariabackup MTR fails sporadically: Failed to read from: wsrep_sst_mariabackup --role 'donor' --address '[::1]:16028/xtrabackup_sst//1'
-galera_ipv6_mariabackup_section : MDEV-22195: galera_3nodes.galera_ipv6_mariabackup_section MTR failed: assert_grep.inc failed
-galera_ipv6_mysqldump : MDEV-24036: galera_3nodes.galera_ipv6_mysqldump: rare random crashes during shutdown
-galera_ipv6_rsync_section : MDEV-23580: galera_3nodes.galera_ipv6_rsync_section MTR failed: WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query
galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query
-galera_pc_bootstrap : MDEV-24650 galera_pc_bootstrap MTR failed: Could not execute 'check-testcase' before testcase
galera_safe_to_bootstrap : MDEV-24097 galera_3nodes.galera_safe_to_bootstrap MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
galera_slave_options_do : MDEV-8798
galera_slave_options_ignore : MDEV-8798
diff --git a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result
index 0461f1f1feb..a7234aa9778 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result
@@ -1,40 +1,79 @@
+connection node_1;
CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb;
INSERT INTO t1 VALUES (1, 1);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (2, 3);
+connection node_2;
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET wsrep_sync_wait = 0;
SET wsrep_on = OFF;
SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining';
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
INSERT INTO t1 VALUES (3, 2);
+connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
+connection node_3;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (4, 3);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
INSERT INTO t1 VALUES (5, 2);
+connection node_3;
+connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (6, 3);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
INSERT INTO t1 VALUES (7, 2);
+connection node_3;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (8, 3);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
+connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'signal=before_send_state_request';
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
+connection node_2;
INSERT INTO t1 VALUES (9, 2);
+connection node_3;
+connection node_1a;
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'dbug=';
+connection node_1;
DROP TABLE t1;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
+connection node_2;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
+connection node_3;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
diff --git a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result
index d878f60ca6b..e3ca22ef01e 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result
@@ -1,18 +1,37 @@
+connection node_1;
CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb;
INSERT INTO t1 VALUES (1, 1);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (2, 3);
+connection node_2;
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET wsrep_sync_wait = 0;
SET wsrep_on = OFF;
SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining';
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
INSERT INTO t1 VALUES (3, 2);
+connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
+connection node_3;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (4, 3);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
INSERT INTO t1 VALUES (5, 2);
+connection node_3;
+connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
SET SESSION wsrep_on = 0;
@@ -24,18 +43,35 @@ SET SESSION wsrep_on = 0;
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters';
VARIABLE_NAME VARIABLE_VALUE
WSREP_DEBUG_SYNC_WAITERS after_shift_to_joining
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (6, 3);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
INSERT INTO t1 VALUES (7, 2);
+connection node_3;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (8, 3);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
+connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
+connection node_2;
INSERT INTO t1 VALUES (9, 2);
+connection node_3;
+connection node_1a;
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
@@ -44,7 +80,10 @@ VARIABLE_NAME VARIABLE_VALUE
WSREP_DEBUG_SYNC_WAITERS process_primary_configuration
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'dbug=';
+connection node_1;
DROP TABLE t1;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
+connection node_2;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
+connection node_3;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
diff --git a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result
index df0a924029c..c37b8837900 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result
@@ -1,44 +1,83 @@
+connection node_1;
CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb;
INSERT INTO t1 VALUES (1, 1);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (2, 3);
+connection node_2;
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET wsrep_sync_wait = 0;
SET wsrep_on = OFF;
SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining';
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
INSERT INTO t1 VALUES (3, 2);
+connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
+connection node_3;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (4, 3);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
INSERT INTO t1 VALUES (5, 2);
+connection node_3;
+connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
SET GLOBAL wsrep_provider_options = 'dbug=';
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
+connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining';
SET GLOBAL wsrep_provider_options = 'signal=before_send_state_request';
4
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters';
VARIABLE_NAME VARIABLE_VALUE
WSREP_DEBUG_SYNC_WAITERS
+connection node_3;
INSERT INTO t1 VALUES (6, 3);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
INSERT INTO t1 VALUES (7, 2);
+connection node_3;
+connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_2;
+connection node_3;
INSERT INTO t1 VALUES (8, 3);
+connection node_2;
+connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+connection node_2;
+connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
+connection node_2;
INSERT INTO t1 VALUES (9, 2);
+connection node_3;
+connection node_1a;
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
@@ -48,8 +87,11 @@ SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
+connection node_1;
DROP TABLE t1;
call mtr.add_suppression("WSREP: Send action {\(.*\), STATE_REQUEST} returned -107 \\(Transport endpoint is not connected\\)");
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
+connection node_2;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
+connection node_3;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf
index 8432b1c368c..3b0f0173b35 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf
@@ -34,4 +34,3 @@ bind-address=::
[SST]
transferfmt=@ENV.MTR_GALERA_TFMT
streamfmt=xbstream
-sockopt=",pf=ip6"
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.cnf
index aa3da690416..a3ab9a85707 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.cnf
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.cnf
@@ -38,4 +38,5 @@ bind-address=::
[SST]
transferfmt=@ENV.MTR_GALERA_TFMT
streamfmt=xbstream
+# Not needed, but left here for debugging:
sockopt=",pf=ip6"
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf
index 5e77a45210b..c163f798335 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf
@@ -24,6 +24,3 @@ wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
-
-[SST]
-sockopt=",pf=ip6"
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf
index 5e77a45210b..c163f798335 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf
@@ -24,6 +24,3 @@ wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
-
-[SST]
-sockopt=",pf=ip6"
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf
index 809b83bb782..ee92efeff1d 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf
@@ -29,6 +29,3 @@ wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
-
-[SST]
-sockopt=",pf=ip6"
diff --git a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc
index f4350d25ae9..17e926758ee 100644
--- a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc
+++ b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc
@@ -585,3 +585,14 @@ ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7,
--disable_info
DROP TABLE t1;
--enable_warnings
+
+--echo #
+--echo # MDEV-26262 frm is corrupted after ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
+--echo #
+
+--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
+CREATE TABLE MDEV_26262 (a INT,b INT AS (b) VIRTUAL);
+
+--let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err
+--let SEARCH_PATTERN=Incorrect information in file: './test/MDEV_26262.frm'
+--source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/gcol/inc/gcol_ins_upd.inc b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc
index 7fde9c2e852..e02a3828ea2 100644
--- a/mysql-test/suite/gcol/inc/gcol_ins_upd.inc
+++ b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc
@@ -607,4 +607,78 @@ DELETE FROM t1;
DROP TEMPORARY TABLE t1;
+--echo #
+--echo # Original test case from MDEV-17890
+--echo #
+
+CREATE TABLE t1 (
+ pk BIGINT AUTO_INCREMENT,
+ b BIT(15),
+ v BIT(10) AS (b) VIRTUAL,
+ PRIMARY KEY(pk),
+ UNIQUE(v)
+);
+
+INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101');
+SELECT pk, b FROM t1 INTO OUTFILE 'load.data';
+--error ER_DATA_TOO_LONG
+LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b);
+
+# Cleanup
+DROP TABLE t1;
+--let $datadir= `SELECT @@datadir`
+--remove_file $datadir/test/load.data
+
+
+--echo #
+--echo # MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+--echo #
+
+CREATE TABLE t1 (
+ id INT NOT NULL AUTO_INCREMENT,
+ f ENUM('a','b','c'),
+ v ENUM('a','b','c') AS (f),
+ KEY(v,id)
+) ENGINE=MyISAM;
+INSERT INTO t1 (f) VALUES ('a'),('b');
+INSERT IGNORE INTO t1 SELECT * FROM t1;
+
+# Cleanup
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (
+ id INT NOT NULL AUTO_INCREMENT,
+ f ENUM('a','b','c'),
+ v ENUM('a','b','c') AS (f),
+ KEY(v,id)
+) ENGINE=MyISAM;
+INSERT INTO t1 (f) VALUES ('a'),('b');
+INSERT IGNORE INTO t1 SELECT * FROM t1;
+
+# Cleanup
+DROP TABLE t1;
+
}
+
+--echo #
+--echo # MDEV-23597 Assertion `marked_for_read()' failed while evaluating DEFAULT
+--echo #
+
+CREATE TABLE t1 (a INT UNIQUE, b INT DEFAULT (c+1), c int);
+INSERT INTO t1 VALUES (1,1,1);
+UPDATE t1 SET b=DEFAULT;
+SELECT * from t1;
+
+REPLACE t1 VALUES(1,1,1);
+INSERT INTO t1 VALUES (1,1,1) ON DUPLICATE KEY UPDATE b= DEFAULT;
+SELECT * from t1;
+
+REPLACE t1 VALUES(1,1,1);
+CREATE TABLE t2 (a INT, b INT DEFAULT (c+1), c int);
+INSERT INTO t2 VALUES (5,5,5);
+UPDATE t1 join t2 set t1.b= DEFAULT, t2.b= DEFAULT;
+SELECT * from t1, t2;
+
+DROP TABLE t1, t2;
+
diff --git a/mysql-test/suite/gcol/inc/gcol_keys.inc b/mysql-test/suite/gcol/inc/gcol_keys.inc
index 475ab96e56f..cf0612b0d0c 100644
--- a/mysql-test/suite/gcol/inc/gcol_keys.inc
+++ b/mysql-test/suite/gcol/inc/gcol_keys.inc
@@ -809,4 +809,12 @@ eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (p
--remove_file $MYSQLTEST_VARDIR/tmp/load.data
DROP TABLE t1;
+
+--echo # MDEV-19011 Assertion `file->s->base.reclength < file->s->vreclength'
+--echo # failed in ha_myisam::setup_vcols_for_repair
+CREATE TABLE t1 (a INT GENERATED ALWAYS AS (1) VIRTUAL);
+ALTER TABLE t1 ADD KEY (a);
+
+DROP TABLE t1;
+
}
diff --git a/mysql-test/suite/gcol/inc/gcol_partition.inc b/mysql-test/suite/gcol/inc/gcol_partition.inc
index df199e86c68..50a743c0153 100644
--- a/mysql-test/suite/gcol/inc/gcol_partition.inc
+++ b/mysql-test/suite/gcol/inc/gcol_partition.inc
@@ -153,3 +153,31 @@ CHECK TABLE t EXTENDED;
FLUSH TABLES;
CHECK TABLE t EXTENDED;
DROP TABLE t;
+
+--echo #
+--echo # MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+--echo #
+CREATE TABLE t1 (
+ a INT,
+ b INT,
+ c BIT(4) NOT NULL DEFAULT b'0',
+ pk INTEGER AUTO_INCREMENT,
+ d BIT(4) AS (c) VIRTUAL,
+ PRIMARY KEY(pk),
+ KEY (b,d)
+) PARTITION BY HASH(pk);
+INSERT INTO t1 () VALUES (),();
+UPDATE t1 SET a = 0 WHERE b IS NULL ORDER BY pk;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26220 Server crashes with indexed by prefix virtual column
+--echo #
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b CHAR(20), c CHAR(20) AS (b),
+ KEY (c(10),a)) PARTITION BY HASH(pk);
+INSERT INTO t1 (pk,a,b) VALUES (1,10,'foo'),(2,11,'baz');
+SELECT a FROM t1;
+
+# Cleanup
+DROP TABLE t1;
diff --git a/mysql-test/suite/gcol/inc/gcol_view.inc b/mysql-test/suite/gcol/inc/gcol_view.inc
index 51cb9b5d725..6f9ce673199 100644
--- a/mysql-test/suite/gcol/inc/gcol_view.inc
+++ b/mysql-test/suite/gcol/inc/gcol_view.inc
@@ -221,3 +221,58 @@ select * from t1;
drop view v1;
drop table t1;
+
+--echo #
+--echo # MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+--echo #
+
+CREATE TABLE t1 (d DATETIME(3), v DATETIME(2) AS (d));
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+INSERT INTO t1 (d) VALUES ('2004-04-19 15:37:39.123'),
+ ('1985-12-24 10:15:08.456');
+DELETE FROM v1 ORDER BY v LIMIT 4;
+
+# Cleanup
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
+--echo # [duplicate] MDEV-19306 Assertion `marked_for_read()' failed in
+--echo # Field_blob::val_str with virtual columns and views
+--echo #
+
+CREATE TABLE t1 (a BLOB, b TEXT AS (a) VIRTUAL);
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (a) VALUES ('foo'),('bar');
+DELETE FROM v1 ORDER BY b LIMIT 2;
+
+# Cleanup
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (d INT, v TINYINT AS (d));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (d) VALUES ('2004'),('1985') ;
+DELETE FROM v1 ORDER BY v LIMIT 4;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (d VARCHAR(64), v VARCHAR(63) AS (d));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (d) VALUES ('2004-04-19 15:37:39.123'),('1985-12-24 10:15:08.456') ;
+DELETE FROM v1 ORDER BY v LIMIT 4;
+
+DROP TABLE t1;
+DROP VIEW v1;
+
+
+--echo #
+--echo # MDEV-18249 ASSERT_COLUMN_MARKED_FOR_READ failed in ANALYZE TABLE
+--echo #
+
+create table t1 (c varchar(3) not null, v varchar(4) as (c) virtual);
+insert into t1 (c) values ('a'),('b');
+analyze table t1 persistent for columns (v) indexes ();
+
diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result
index 8eb7a9372b5..4bc424d1b1e 100644
--- a/mysql-test/suite/gcol/r/gcol_bugfixes.result
+++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result
@@ -669,3 +669,77 @@ PRIMARY KEY (number)
REPLACE t2(number) VALUES('1');
REPLACE t2(number) VALUES('1');
DROP TABLE t2;
+# MDEV-24583 SELECT aborts after failed REPLACE into table with vcol
+CREATE TABLE t1 (pk INT, a VARCHAR(3), v VARCHAR(3) AS (CONCAT('x-',a)),
+PRIMARY KEY(pk)) ENGINE=MyISAM;
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (pk, a) VALUES (1,'foo');
+SET sql_mode=CONCAT(@@sql_mode,',STRICT_ALL_TABLES');
+REPLACE INTO t1 (pk,a) VALUES (1,'qux');
+SELECT * FROM v1;
+pk a v
+1 foo x-f
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (
+pk INT,
+a VARCHAR(1),
+v VARCHAR(1) AS (CONCAT('virt-',a)) VIRTUAL,
+PRIMARY KEY (pk)
+) ENGINE=InnoDB;
+INSERT INTO t1 (pk,a) VALUES
+(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f');
+REPLACE INTO t1 (pk) VALUES (1);
+ERROR 22001: Data too long for column 'v' at row 1
+SELECT * FROM t1 ORDER BY a;
+pk a v
+1 a v
+2 b v
+3 c v
+4 d v
+5 e v
+6 f v
+SET SQL_MODE=DEFAULT;
+DROP TABLE t1;
+# (duplicate) MDEV-24656
+# [FATAL] InnoDB: Data field type 0, len 0, ASAN heap-buffer-overflow
+# upon LOAD DATA with virtual columns
+CREATE TABLE t1 (id INT PRIMARY KEY, a VARCHAR(2333),
+va VARCHAR(171) AS (a)) ENGINE=InnoDB;
+INSERT INTO t1 (id,a) VALUES (1,REPEAT('x',200));
+SELECT id, va INTO OUTFILE 'load_t1' FROM t1;
+LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id,va);
+ERROR 22001: Data too long for column 'va' at row 1
+SELECT * FROM t1;
+id a va
+1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+LOAD DATA INFILE 'load_t1' IGNORE INTO TABLE t1 (id,va);
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+DROP TABLE t1;
+CREATE TABLE t1 (id BIGINT PRIMARY KEY, a VARCHAR(2333),
+va VARCHAR(171) AS (a)) ENGINE=InnoDB;
+INSERT INTO t1 (id,a) VALUES (1,REPEAT('x',200));
+SELECT id, va INTO OUTFILE 'load_t1' FROM t1;
+LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id,va);
+ERROR 22001: Data too long for column 'va' at row 1
+SELECT * FROM t1;
+id a va
+1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+LOAD DATA INFILE 'load_t1' IGNORE INTO TABLE t1 (id,va);
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+DROP TABLE t1;
+# (duplicate) MDEV-24665
+# ASAN errors, assertion failures, corrupt values after failed
+# LOAD DATA into table with virtual/stored column
+CREATE TABLE t1 (id INT PRIMARY KEY,
+ts TIMESTAMP DEFAULT '1971-01-01 00:00:00',
+c VARBINARY(8) DEFAULT '', vc VARCHAR(3) AS (c) STORED);
+INSERT IGNORE INTO t1 (id,c) VALUES (1,'foobar');
+Warnings:
+Warning 1265 Data truncated for column 'vc' at row 1
+SELECT id, ts, vc INTO OUTFILE 'load_t1' FROM t1;
+LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id, ts, vc);
+INSERT IGNORE INTO t1 (id) VALUES (2);
+DROP TABLE t1;
diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result
index 48c4613f6ca..2c0adc3d493 100644
--- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result
@@ -699,6 +699,12 @@ ADD COLUMN c INT AS (1 + DEFAULT(a)) VIRTUAL;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
DROP TABLE t1;
+#
+# MDEV-26262 frm is corrupted after ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
+#
+CREATE TABLE MDEV_26262 (a INT,b INT AS (b) VIRTUAL);
+ERROR 01000: Expression for field `b` is referring to uninitialized field `b`
+NOT FOUND /Incorrect information in file: './test/MDEV_26262.frm'/ in mysqld.1.err
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
index b7ae6488c95..126a6c5e271 100644
--- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
@@ -699,6 +699,12 @@ ADD COLUMN c INT AS (1 + DEFAULT(a)) VIRTUAL;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
DROP TABLE t1;
+#
+# MDEV-26262 frm is corrupted after ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
+#
+CREATE TABLE MDEV_26262 (a INT,b INT AS (b) VIRTUAL);
+ERROR 01000: Expression for field `b` is referring to uninitialized field `b`
+NOT FOUND /Incorrect information in file: './test/MDEV_26262.frm'/ in mysqld.1.err
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
index 3024b58da54..143e1b725c4 100644
--- a/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
@@ -435,6 +435,26 @@ UPDATE t1 SET col1 = 2;
UPDATE t1 SET col7 = DEFAULT;
UPDATE t1 SET col8 = DEFAULT;
DROP TABLE t1;
+Bug#20797344: WL#8149: ALLOCATED SPACE FOR INDEXED BLOB VGC CAN BE
+OVERWRITTEN FOR UPDATE
+#
+CREATE TABLE t (a varchar(100), b blob,
+c blob GENERATED ALWAYS AS (concat(a,b)) VIRTUAL,
+d blob GENERATED ALWAYS AS (b) VIRTUAL,
+e int(11) GENERATED ALWAYS AS (10) VIRTUAL,
+h int(11) NOT NULL, PRIMARY KEY (h), key(c(20)));
+INSERT INTO t(a,b,h) VALUES('aaaaaaa','1111111', 11);
+INSERT INTO t(a,b,h) VALUES('bbbbbbb','2222222', 22);
+SELECT c FROM t;
+c
+aaaaaaa1111111
+bbbbbbb2222222
+UPDATE t SET a='ccccccc';
+SELECT c FROM t;
+c
+ccccccc1111111
+ccccccc2222222
+DROP TABLE t;
# Bug#21081742: ASSERTION !TABLE || (!TABLE->WRITE_SET ||
# BITMAP_IS_SET(TABLE->WRITE_SET
#
@@ -491,6 +511,21 @@ SELECT * FROM t;
x y gc
2 1 3
DROP TABLE t;
+CREATE TABLE t (
+x INT, y INT, gc INT GENERATED ALWAYS AS (x+1), KEY (x,gc)
+);
+INSERT INTO t VALUES ();
+UPDATE t t1, t t2 SET t1.x = 1, t2.y = 2;
+SELECT * FROM t;
+x y gc
+1 2 2
+SELECT gc FROM t;
+gc
+2
+CHECK TABLE t;
+Table Op Msg_type Msg_text
+test.t check status OK
+DROP TABLE t;
# stored
CREATE TABLE C (
col_varchar_nokey VARCHAR(1),
@@ -552,6 +587,99 @@ SELECT * from C;
col_varchar_nokey col_varchar_key
a aa
DROP TABLE C;
+# virtual, indexed
+CREATE TABLE C (
+col_varchar_nokey VARCHAR(1),
+col_varchar_key VARCHAR(2) GENERATED ALWAYS AS
+(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL,
+KEY (col_varchar_key, col_varchar_nokey)
+);
+INSERT INTO C (col_varchar_nokey) VALUES ('c');
+EXPLAIN UPDATE C AS OUTR1, C AS OUTR2
+SET OUTR1.`col_varchar_nokey` = 'f',
+OUTR2.`col_varchar_nokey` = "a";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE OUTR1 ALL NULL NULL NULL NULL 1
+1 SIMPLE OUTR2 ALL NULL NULL NULL NULL 1
+UPDATE C AS OUTR1, C AS OUTR2
+SET OUTR1.`col_varchar_nokey` = 'f',
+OUTR2.`col_varchar_nokey` = "a";
+SELECT * from C;
+col_varchar_nokey col_varchar_key
+a aa
+DROP TABLE C;
+#
+# Bug #21530366 CRASH/ASSERTION, CORRUPTION WITH INDEXES +
+# VIRTUAL COLUMNS, BLOB
+#
+CREATE TABLE t (
+a INTEGER,
+b BLOB GENERATED ALWAYS AS (a) VIRTUAL,
+INDEX (b(57))
+);
+INSERT INTO t (a) VALUES (9);
+UPDATE t SET a = 10;
+DELETE FROM t WHERE a = 10;
+DROP TABLE t;
+# Bug#21807818: Generated columns not updated with empty insert list
+CREATE TABLE t (
+a BLOB GENERATED ALWAYS AS ('') VIRTUAL,
+b TIMESTAMP(4) GENERATED ALWAYS AS ('') VIRTUAL,
+KEY (a(183),b)
+);
+INSERT IGNORE INTO t VALUES(), (), ();
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 2
+Warning 1265 Data truncated for column 'b' at row 3
+DELETE IGNORE FROM t;
+DROP TABLE t;
+#
+# Bug#22195458:GCOLS: ASSERTION 0 AND CORRUPTION...
+#
+CREATE TABLE t (
+a INT,
+b YEAR GENERATED ALWAYS AS ('a') VIRTUAL,
+c YEAR GENERATED ALWAYS AS ('aaaa') VIRTUAL,
+b1 YEAR GENERATED ALWAYS AS ('a') STORED,
+c1 YEAR GENERATED ALWAYS AS ('aaaa') STORED,
+UNIQUE(b),
+UNIQUE(b1)
+);
+INSERT IGNORE INTO t VALUES();
+SELECT b from t;
+b
+0000
+SELECT b1 from t;
+b1
+0000
+SELECT * from t;
+a b c b1 c1
+NULL 0000 0000 0000 0000
+DELETE FROM t;
+CHECK TABLE t EXTENDED;
+Table Op Msg_type Msg_text
+test.t check status OK
+DROP TABLE t;
+# Bug#22195364:GCOLS: FAILING ASSERTION:
+# DFIELD_IS_NULL(DFIELD2) || DFIELD2->DATA
+CREATE TABLE t (
+a INT,
+c BLOB GENERATED ALWAYS AS ('') VIRTUAL,
+UNIQUE KEY(c(1),a)
+);
+INSERT INTO t(a) VALUES(1) ON DUPLICATE KEY UPDATE a=2;
+SELECT * FROM t;
+a c
+1
+INSERT INTO t(a) VALUES(1) ON DUPLICATE KEY UPDATE a=2;
+SELECT * FROM t;
+a c
+2
+SELECT GROUP_CONCAT(c ORDER BY c) FROM t;
+GROUP_CONCAT(c ORDER BY c)
+
+DROP TABLE t;
#Bug#21929967:GCOLS:GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE
CREATE TABLE t(c1 INT GENERATED ALWAYS AS (1) VIRTUAL,
c2 INT GENERATED ALWAYS AS(2) STORED);
@@ -593,6 +721,98 @@ i1 i2
5 10
5 10
DROP TABLE t1,t2;
+#
+# Bug#22070021 GCOL:ASSERTION `!TABLE || (!TABLE->WRITE_SET ||
+# BITMAP_IS_SET(TABLE->WRITE_SET,
+#
+CREATE TABLE t1(
+c1 INT,
+c2 INT GENERATED ALWAYS AS (c1 + c1) VIRTUAL,
+KEY(c2)
+);
+INSERT INTO t1(c1) VALUES(0);
+DELETE O1.* FROM t1 AS O1, t1 AS O2;
+SELECT * FROM t1;
+c1 c2
+DROP TABLE t1;
+#
+# Bug#21944199 SIMPLE DELETE QUERY CAUSES INNODB: FAILING ASSERTION: 0
+# & DATA CORRUPTION
+#
+CREATE TEMPORARY TABLE t1 (
+a INTEGER NOT NULL,
+b INTEGER GENERATED ALWAYS AS (a+1) VIRTUAL
+);
+INSERT INTO t1 (a) VALUES (0), (0), (0);
+ALTER TABLE t1 ADD INDEX idx (b);
+DELETE FROM t1;
+DROP TEMPORARY TABLE t1;
+#
+# Original test case from MDEV-17890
+#
+CREATE TABLE t1 (
+pk BIGINT AUTO_INCREMENT,
+b BIT(15),
+v BIT(10) AS (b) VIRTUAL,
+PRIMARY KEY(pk),
+UNIQUE(v)
+);
+INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101');
+Warnings:
+Warning 1264 Out of range value for column 'v' at row 1
+SELECT pk, b FROM t1 INTO OUTFILE 'load.data';
+LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b);
+ERROR 22001: Data too long for column 'v' at row 1
+DROP TABLE t1;
+#
+# MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+#
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT,
+f ENUM('a','b','c'),
+v ENUM('a','b','c') AS (f),
+KEY(v,id)
+) ENGINE=MyISAM;
+INSERT INTO t1 (f) VALUES ('a'),('b');
+INSERT IGNORE INTO t1 SELECT * FROM t1;
+Warnings:
+Warning 1906 The value specified for generated column 'v' in table 't1' has been ignored
+Warning 1906 The value specified for generated column 'v' in table 't1' has been ignored
+DROP TABLE t1;
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT,
+f ENUM('a','b','c'),
+v ENUM('a','b','c') AS (f),
+KEY(v,id)
+) ENGINE=MyISAM;
+INSERT INTO t1 (f) VALUES ('a'),('b');
+INSERT IGNORE INTO t1 SELECT * FROM t1;
+Warnings:
+Warning 1906 The value specified for generated column 'v' in table 't1' has been ignored
+Warning 1906 The value specified for generated column 'v' in table 't1' has been ignored
+DROP TABLE t1;
+#
+# MDEV-23597 Assertion `marked_for_read()' failed while evaluating DEFAULT
+#
+CREATE TABLE t1 (a INT UNIQUE, b INT DEFAULT (c+1), c int);
+INSERT INTO t1 VALUES (1,1,1);
+UPDATE t1 SET b=DEFAULT;
+SELECT * from t1;
+a b c
+1 2 1
+REPLACE t1 VALUES(1,1,1);
+INSERT INTO t1 VALUES (1,1,1) ON DUPLICATE KEY UPDATE b= DEFAULT;
+SELECT * from t1;
+a b c
+1 2 1
+REPLACE t1 VALUES(1,1,1);
+CREATE TABLE t2 (a INT, b INT DEFAULT (c+1), c int);
+INSERT INTO t2 VALUES (5,5,5);
+UPDATE t1 join t2 set t1.b= DEFAULT, t2.b= DEFAULT;
+SELECT * from t1, t2;
+a b c a b c
+1 2 1 5 6 5
+DROP TABLE t1, t2;
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result
index c7e5cab4f8c..2c883b2de35 100644
--- a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result
@@ -571,13 +571,13 @@ UNIQUE(b1)
INSERT IGNORE INTO t VALUES();
SELECT b from t;
b
-2000
+0000
SELECT b1 from t;
b1
0000
SELECT * from t;
a b c b1 c1
-NULL 2000 0000 0000 0000
+NULL 0000 0000 0000 0000
DELETE FROM t;
CHECK TABLE t EXTENDED;
Table Op Msg_type Msg_text
@@ -669,6 +669,72 @@ INSERT INTO t1 (a) VALUES (0), (0), (0);
ALTER TABLE t1 ADD INDEX idx (b);
DELETE FROM t1;
DROP TEMPORARY TABLE t1;
+#
+# Original test case from MDEV-17890
+#
+CREATE TABLE t1 (
+pk BIGINT AUTO_INCREMENT,
+b BIT(15),
+v BIT(10) AS (b) VIRTUAL,
+PRIMARY KEY(pk),
+UNIQUE(v)
+);
+INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101');
+Warnings:
+Warning 1264 Out of range value for column 'v' at row 1
+SELECT pk, b FROM t1 INTO OUTFILE 'load.data';
+LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b);
+ERROR 22001: Data too long for column 'v' at row 1
+DROP TABLE t1;
+#
+# MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+#
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT,
+f ENUM('a','b','c'),
+v ENUM('a','b','c') AS (f),
+KEY(v,id)
+) ENGINE=MyISAM;
+INSERT INTO t1 (f) VALUES ('a'),('b');
+INSERT IGNORE INTO t1 SELECT * FROM t1;
+Warnings:
+Warning 1906 The value specified for generated column 'v' in table 't1' has been ignored
+Warning 1906 The value specified for generated column 'v' in table 't1' has been ignored
+DROP TABLE t1;
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT,
+f ENUM('a','b','c'),
+v ENUM('a','b','c') AS (f),
+KEY(v,id)
+) ENGINE=MyISAM;
+INSERT INTO t1 (f) VALUES ('a'),('b');
+INSERT IGNORE INTO t1 SELECT * FROM t1;
+Warnings:
+Warning 1906 The value specified for generated column 'v' in table 't1' has been ignored
+Warning 1906 The value specified for generated column 'v' in table 't1' has been ignored
+DROP TABLE t1;
+#
+# MDEV-23597 Assertion `marked_for_read()' failed while evaluating DEFAULT
+#
+CREATE TABLE t1 (a INT UNIQUE, b INT DEFAULT (c+1), c int);
+INSERT INTO t1 VALUES (1,1,1);
+UPDATE t1 SET b=DEFAULT;
+SELECT * from t1;
+a b c
+1 2 1
+REPLACE t1 VALUES(1,1,1);
+INSERT INTO t1 VALUES (1,1,1) ON DUPLICATE KEY UPDATE b= DEFAULT;
+SELECT * from t1;
+a b c
+1 2 1
+REPLACE t1 VALUES(1,1,1);
+CREATE TABLE t2 (a INT, b INT DEFAULT (c+1), c int);
+INSERT INTO t2 VALUES (5,5,5);
+UPDATE t1 join t2 set t1.b= DEFAULT, t2.b= DEFAULT;
+SELECT * from t1, t2;
+a b c a b c
+1 2 1 5 6 5
+DROP TABLE t1, t2;
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
index ae2843dd2ec..2d8b81a0ea1 100644
--- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
@@ -691,6 +691,8 @@ a b c
1 127 0
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t ADD UNIQUE INDEX (c(1));
+Warnings:
+Warning 1264 Out of range value for column 'b' at row 1
SELECT * FROM t WHERE c = '0';
a b c
1 127 0
@@ -875,6 +877,11 @@ Warning 1264 Out of range value for column 'vi' at row 1
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts);
ERROR 22003: Out of range value for column 'vi' at row 1
DROP TABLE t1;
+# MDEV-19011 Assertion `file->s->base.reclength < file->s->vreclength'
+# failed in ha_myisam::setup_vcols_for_repair
+CREATE TABLE t1 (a INT GENERATED ALWAYS AS (1) VIRTUAL);
+ALTER TABLE t1 ADD KEY (a);
+DROP TABLE t1;
#
# BUG#21365158 WL8149:ASSERTION `!TABLE || (!TABLE->WRITE_SET
#
diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result
index a91a77aedf3..17b15826813 100644
--- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result
@@ -877,6 +877,11 @@ Warning 1264 Out of range value for column 'vi' at row 1
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts);
ERROR 22003: Out of range value for column 'vi' at row 1
DROP TABLE t1;
+# MDEV-19011 Assertion `file->s->base.reclength < file->s->vreclength'
+# failed in ha_myisam::setup_vcols_for_repair
+CREATE TABLE t1 (a INT GENERATED ALWAYS AS (1) VIRTUAL);
+ALTER TABLE t1 ADD KEY (a);
+DROP TABLE t1;
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/gcol/r/gcol_partition_innodb.result b/mysql-test/suite/gcol/r/gcol_partition_innodb.result
index e5a68cdb177..e61c0a26417 100644
--- a/mysql-test/suite/gcol/r/gcol_partition_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_partition_innodb.result
@@ -89,6 +89,32 @@ Table Op Msg_type Msg_text
test.t check status OK
DROP TABLE t;
#
+# MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+#
+CREATE TABLE t1 (
+a INT,
+b INT,
+c BIT(4) NOT NULL DEFAULT b'0',
+pk INTEGER AUTO_INCREMENT,
+d BIT(4) AS (c) VIRTUAL,
+PRIMARY KEY(pk),
+KEY (b,d)
+) PARTITION BY HASH(pk);
+INSERT INTO t1 () VALUES (),();
+UPDATE t1 SET a = 0 WHERE b IS NULL ORDER BY pk;
+DROP TABLE t1;
+#
+# MDEV-26220 Server crashes with indexed by prefix virtual column
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b CHAR(20), c CHAR(20) AS (b),
+KEY (c(10),a)) PARTITION BY HASH(pk);
+INSERT INTO t1 (pk,a,b) VALUES (1,10,'foo'),(2,11,'baz');
+SELECT a FROM t1;
+a
+11
+10
+DROP TABLE t1;
+#
# MDEV-16980 Wrongly set tablename len while opening the
# table for purge thread
#
diff --git a/mysql-test/suite/gcol/r/gcol_partition_myisam.result b/mysql-test/suite/gcol/r/gcol_partition_myisam.result
index 81324da6fcd..e54b0ad83c6 100644
--- a/mysql-test/suite/gcol/r/gcol_partition_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_partition_myisam.result
@@ -86,6 +86,32 @@ CHECK TABLE t EXTENDED;
Table Op Msg_type Msg_text
test.t check status OK
DROP TABLE t;
+#
+# MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+#
+CREATE TABLE t1 (
+a INT,
+b INT,
+c BIT(4) NOT NULL DEFAULT b'0',
+pk INTEGER AUTO_INCREMENT,
+d BIT(4) AS (c) VIRTUAL,
+PRIMARY KEY(pk),
+KEY (b,d)
+) PARTITION BY HASH(pk);
+INSERT INTO t1 () VALUES (),();
+UPDATE t1 SET a = 0 WHERE b IS NULL ORDER BY pk;
+DROP TABLE t1;
+#
+# MDEV-26220 Server crashes with indexed by prefix virtual column
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b CHAR(20), c CHAR(20) AS (b),
+KEY (c(10),a)) PARTITION BY HASH(pk);
+INSERT INTO t1 (pk,a,b) VALUES (1,10,'foo'),(2,11,'baz');
+SELECT a FROM t1;
+a
+11
+10
+DROP TABLE t1;
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/gcol/r/gcol_view_innodb.result b/mysql-test/suite/gcol/r/gcol_view_innodb.result
index ec82c792493..03c4a15620a 100644
--- a/mysql-test/suite/gcol/r/gcol_view_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_view_innodb.result
@@ -271,6 +271,47 @@ a b c
1 -1 -1
drop view v1;
drop table t1;
+#
+# MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+#
+CREATE TABLE t1 (d DATETIME(3), v DATETIME(2) AS (d));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (d) VALUES ('2004-04-19 15:37:39.123'),
+('1985-12-24 10:15:08.456');
+DELETE FROM v1 ORDER BY v LIMIT 4;
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# [duplicate] MDEV-19306 Assertion `marked_for_read()' failed in
+# Field_blob::val_str with virtual columns and views
+#
+CREATE TABLE t1 (a BLOB, b TEXT AS (a) VIRTUAL);
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (a) VALUES ('foo'),('bar');
+DELETE FROM v1 ORDER BY b LIMIT 2;
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (d INT, v TINYINT AS (d));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (d) VALUES ('2004'),('1985') ;
+DELETE FROM v1 ORDER BY v LIMIT 4;
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (d VARCHAR(64), v VARCHAR(63) AS (d));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (d) VALUES ('2004-04-19 15:37:39.123'),('1985-12-24 10:15:08.456') ;
+DELETE FROM v1 ORDER BY v LIMIT 4;
+DROP TABLE t1;
+DROP VIEW v1;
+#
+# MDEV-18249 ASSERT_COLUMN_MARKED_FOR_READ failed in ANALYZE TABLE
+#
+create table t1 (c varchar(3) not null, v varchar(4) as (c) virtual);
+insert into t1 (c) values ('a'),('b');
+analyze table t1 persistent for columns (v) indexes ();
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/gcol/r/gcol_view_myisam.result b/mysql-test/suite/gcol/r/gcol_view_myisam.result
index 13cb74ebcb5..a030c73401c 100644
--- a/mysql-test/suite/gcol/r/gcol_view_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_view_myisam.result
@@ -271,6 +271,47 @@ a b c
1 -1 -1
drop view v1;
drop table t1;
+#
+# MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+#
+CREATE TABLE t1 (d DATETIME(3), v DATETIME(2) AS (d));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (d) VALUES ('2004-04-19 15:37:39.123'),
+('1985-12-24 10:15:08.456');
+DELETE FROM v1 ORDER BY v LIMIT 4;
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# [duplicate] MDEV-19306 Assertion `marked_for_read()' failed in
+# Field_blob::val_str with virtual columns and views
+#
+CREATE TABLE t1 (a BLOB, b TEXT AS (a) VIRTUAL);
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (a) VALUES ('foo'),('bar');
+DELETE FROM v1 ORDER BY b LIMIT 2;
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (d INT, v TINYINT AS (d));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (d) VALUES ('2004'),('1985') ;
+DELETE FROM v1 ORDER BY v LIMIT 4;
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (d VARCHAR(64), v VARCHAR(63) AS (d));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (d) VALUES ('2004-04-19 15:37:39.123'),('1985-12-24 10:15:08.456') ;
+DELETE FROM v1 ORDER BY v LIMIT 4;
+DROP TABLE t1;
+DROP VIEW v1;
+#
+# MDEV-18249 ASSERT_COLUMN_MARKED_FOR_READ failed in ANALYZE TABLE
+#
+create table t1 (c varchar(3) not null, v varchar(4) as (c) virtual);
+insert into t1 (c) values ('a'),('b');
+analyze table t1 persistent for columns (v) indexes ();
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
index c9d95dae579..724f6167ce1 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
@@ -232,4 +232,76 @@ set debug_sync= "now WAIT_FOR got_no_such_table TIMEOUT 1";
set global debug_dbug= @saved_dbug;
drop table t1;
set debug_sync=reset;
+#
+# MDEV-18546 ASAN heap-use-after-free
+# in innobase_get_computed_value / row_purge
+#
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT,
+b BIT(15),
+v BIT(15) AS (b) VIRTUAL,
+PRIMARY KEY(pk),
+UNIQUE(v)
+) ENGINE=InnoDB;
+INSERT IGNORE INTO t1 (b) VALUES
+(NULL),(b'011'),(b'000110100'),
+(b'01101101010'),(b'01111001001011'),(NULL);
+SET GLOBAL innodb_debug_sync = "ib_clust_v_col_before_row_allocated "
+ "SIGNAL before_row_allocated "
+ "WAIT_FOR flush_unlock";
+SET GLOBAL innodb_debug_sync = "ib_open_after_dict_open "
+ "SIGNAL purge_open "
+ "WAIT_FOR select_open";
+set global debug_dbug= "d,ib_purge_virtual_index_callback";
+connect purge_waiter,localhost,root;
+SET debug_sync= "now WAIT_FOR before_row_allocated";
+connection default;
+REPLACE INTO t1 (pk, b) SELECT pk, b FROM t1;
+connection purge_waiter;
+connection default;
+disconnect purge_waiter;
+FLUSH TABLES;
+SET GLOBAL innodb_debug_sync = reset;
+SET debug_sync= "now SIGNAL flush_unlock WAIT_FOR purge_open";
+SET GLOBAL innodb_debug_sync = reset;
+SET debug_sync= "ib_open_after_dict_open SIGNAL select_open";
+SELECT * FROM t1;
+pk b v
+1 NULL NULL
+2
+3
+4 j j
+5 K K
+6 NULL NULL
+DROP TABLE t1;
+SET debug_sync= reset;
+set global debug_dbug= @old_dbug;
+# MDEV-16962 Assertion '!error || !ot_ctx.can_recover_from_failed_open()'
+# failed in open_purge_table upon concurrent ALTER and FLUSH
+CREATE TABLE t1 (
+pk SERIAL,
+c VARCHAR(128),
+d DATE,
+vd DATE AS (d) VIRTUAL,
+PRIMARY KEY(pk),
+KEY(vd,c)
+) ENGINE=InnoDB;
+INSERT IGNORE INTO t1 (pk,c) VALUES (1,'foo');
+set debug_sync="now WAIT_FOR purge";
+connect con1,localhost,root,,test;
+SET GLOBAL innodb_debug_sync="after_open_table_mdl_shared SIGNAL purge WAIT_FOR flush";
+SET global debug_dbug="d,ib_purge_virtual_index_callback";
+REPLACE INTO t1 (pk,c) VALUES (1,'bar');
+connection default;
+SET debug_sync="alter_table_before_rename_result_table WAIT_FOR flush";
+ALTER TABLE t1 ADD FULLTEXT KEY(c), ALGORITHM=COPY;
+connection con1;
+SET debug_sync="after_flush_unlock SIGNAL flush ";
+FLUSH TABLES;
+disconnect con1;
+connection default;
+InnoDB 0 transactions not purged
+DROP TABLE t1;
+SET debug_sync= reset;
+SET global debug_dbug=@old_dbug;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk.result b/mysql-test/suite/gcol/r/innodb_virtual_fk.result
index 252274f3e0a..de61c16f739 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_fk.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_fk.result
@@ -809,17 +809,220 @@ generated_email_id int as (email_id),
PRIMARY KEY (id),
KEY mautic_generated_sent_date_email_id (generated_email_id),
FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
+ON UPDATE CASCADE
) ENGINE=InnoDB;
CREATE TABLE emails_metadata (
email_id int,
PRIMARY KEY (email_id),
CONSTRAINT FK FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE
+ON UPDATE CASCADE
) ENGINE=InnoDB;
INSERT INTO emails VALUES (1);
INSERT INTO email_stats (id, email_id, date_sent) VALUES (1,1,'Jan');
INSERT INTO emails_metadata VALUES (1);
+UPDATE emails SET id=2;
DELETE FROM emails;
DROP TABLE email_stats;
DROP TABLE emails_metadata;
DROP TABLE emails;
DROP DATABASE `a-b`;
+USE test;
+#
+# Bug#33053297 VIRTUAL INDEX CORRUPTED DURING CASCADE UPDATE ON CHILD TABLE
+#
+# Test-Case 1
+CREATE TABLE emails (
+id int unsigned NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE email_stats (
+id bigint unsigned NOT NULL AUTO_INCREMENT,
+email_id int unsigned DEFAULT NULL,
+date_sent datetime NOT NULL,
+generated_sent_date date GENERATED ALWAYS AS
+(concat(year(date_sent), '-', lpad(month(date_sent), 2, '0'),
+'-', lpad(dayofmonth(date_sent), 2, '0'))),
+PRIMARY KEY (id),
+KEY IDX_ES1 (email_id),
+KEY mautic_generated_sent_date_email_id(generated_sent_date, email_id),
+FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
+) ENGINE = InnoDB;
+INSERT INTO emails VALUES (1);
+INSERT INTO email_stats (id, email_id, date_sent)
+VALUES (1, 1, '2020-10-22 13:32:41');
+SELECT * FROM email_stats;
+id email_id date_sent generated_sent_date
+1 1 2020-10-22 13:32:41 2020-10-22
+DELETE FROM emails;
+DELETE FROM email_stats;
+# Clean up.
+DROP TABLE email_stats;
+DROP TABLE emails;
+# Test-Case 2
+CREATE TABLE emails (
+id int unsigned NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE = InnoDB
+DEFAULT CHARSET = utf8mb4
+COLLATE = utf8mb4_unicode_ci
+ROW_FORMAT = DYNAMIC;
+CREATE TABLE email_stats (
+id bigint unsigned NOT NULL AUTO_INCREMENT,
+email_id int unsigned DEFAULT NULL,
+date_sent datetime NOT NULL,
+generated_sent_date date GENERATED ALWAYS AS
+(concat(year(date_sent), '-', lpad(month(date_sent), 2, '0'),
+'-', lpad(dayofmonth(date_sent), 2, '0'))),
+PRIMARY KEY (id),
+KEY IDX_ES1 (email_id),
+KEY mautic_generated_sent_date_email_id(generated_sent_date, email_id),
+FOREIGN KEY (email_id) REFERENCES emails (id)
+ON DELETE SET NULL
+ON UPDATE SET NULL
+) ENGINE = InnoDB;
+INSERT INTO emails VALUES (1);
+INSERT INTO email_stats (id, email_id, date_sent)
+VALUES (1, 1, '2020-10-22 13:32:41');
+UPDATE emails SET id = 2 where id = 1;
+SELECT id FROM email_stats WHERE generated_sent_date IS NULL;
+id
+SELECT * FROM email_stats;
+id email_id date_sent generated_sent_date
+1 NULL 2020-10-22 13:32:41 2020-10-22
+UPDATE email_stats
+SET email_id=2
+WHERE DATE(generated_sent_date) = '2020-10-22';
+SELECT * FROM email_stats;
+id email_id date_sent generated_sent_date
+1 2 2020-10-22 13:32:41 2020-10-22
+# Clean up.
+DROP TABLE email_stats;
+DROP TABLE emails;
+# Test-case 3
+CREATE TABLE emails (
+id int unsigned NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE = INNODB
+DEFAULT CHARSET = utf8mb4
+COLLATE = utf8mb4_unicode_ci
+ROW_FORMAT = DYNAMIC;
+CREATE TABLE email_stats (
+id bigint unsigned NOT NULL AUTO_INCREMENT,
+email_id int unsigned DEFAULT NULL,
+date_sent datetime NOT NULL,
+generated_sent_email varchar(20) GENERATED ALWAYS AS
+(CONCAT(YEAR(date_sent), '-', COALESCE(email_id, '$'))),
+PRIMARY KEY (id),
+KEY idx_es1 (email_id),
+KEY mautic_generated_sent_date_email(generated_sent_email, email_id),
+FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
+) ENGINE = INNODB;
+INSERT INTO emails VALUES (1);
+INSERT INTO email_stats (id, email_id, date_sent)
+VALUES (1, 1, '2020-10-22 13:32:41');
+SELECT * FROM email_stats;
+id email_id date_sent generated_sent_email
+1 1 2020-10-22 13:32:41 2020-1
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-1';
+date_sent
+2020-10-22 13:32:41
+DELETE FROM emails;
+SELECT * FROM email_stats;
+id email_id date_sent generated_sent_email
+1 NULL 2020-10-22 13:32:41 2020-$
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-$';
+date_sent
+2020-10-22 13:32:41
+# Clean up.
+DROP TABLE email_stats;
+DROP TABLE emails;
+# Test-case 4
+CREATE TABLE emails (
+id int unsigned NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE = INNODB;
+CREATE TABLE email_stats (
+id bigint unsigned NOT NULL AUTO_INCREMENT,
+email_id int unsigned DEFAULT NULL,
+date_sent datetime NOT NULL,
+generated_sent_email varchar(20) GENERATED ALWAYS AS
+(CONCAT(YEAR(date_sent), '-', COALESCE(email_id, '$'))),
+PRIMARY KEY (id),
+KEY idx_es1 (email_id),
+KEY mautic_generated_sent_date_email(generated_sent_email, email_id),
+FOREIGN KEY (email_id) REFERENCES emails (id) ON UPDATE SET NULL
+) ENGINE = INNODB;
+INSERT INTO emails VALUES (1);
+INSERT INTO email_stats (id, email_id, date_sent)
+VALUES (1, 1, '2020-10-22 13:32:41');
+SELECT * FROM email_stats;
+id email_id date_sent generated_sent_email
+1 1 2020-10-22 13:32:41 2020-1
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-1';
+date_sent
+2020-10-22 13:32:41
+UPDATE emails SET id = 2 WHERE id = 1;
+SELECT * FROM email_stats;
+id email_id date_sent generated_sent_email
+1 NULL 2020-10-22 13:32:41 2020-$
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-$';
+date_sent
+2020-10-22 13:32:41
+DROP TABLE email_stats;
+DROP TABLE emails;
+CREATE TABLE emails (breaker int unsigned,
+KEY (breaker),
+id int unsigned NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE=INNODB;
+CREATE TABLE email_stats (
+id bigint unsigned NOT NULL AUTO_INCREMENT,
+email_id int unsigned DEFAULT NULL,
+date_sent datetime NOT NULL,
+generated_sent_email varchar(20) GENERATED ALWAYS AS
+(CONCAT(YEAR(date_sent),
+'-',
+COALESCE(email_id, '$'))),
+PRIMARY KEY (id),
+KEY idx_es1 (email_id),
+KEY mautic_generated_sent_date_email (generated_sent_email, email_id),
+FOREIGN KEY fk_ea1 (email_id) REFERENCES emails (breaker)
+ON DELETE SET NULL
+) ENGINE=INNODB;
+show create table email_stats;
+Table Create Table
+email_stats CREATE TABLE `email_stats` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ `email_id` int(10) unsigned DEFAULT NULL,
+ `date_sent` datetime NOT NULL,
+ `generated_sent_email` varchar(20) GENERATED ALWAYS AS (concat(year(`date_sent`),'-',coalesce(`email_id`,'$'))) VIRTUAL,
+ PRIMARY KEY (`id`),
+ KEY `idx_es1` (`email_id`),
+ KEY `mautic_generated_sent_date_email` (`generated_sent_email`,`email_id`),
+ CONSTRAINT `fk_ea1` FOREIGN KEY (`email_id`) REFERENCES `emails` (`breaker`) ON DELETE SET NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO emails VALUES (1,1);
+INSERT INTO email_stats(id, email_id, date_sent)
+VALUES (1, 1, '2020-10-22 13:32:41');
+SELECT * FROM email_stats;
+id email_id date_sent generated_sent_email
+1 1 2020-10-22 13:32:41 2020-1
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-1';
+date_sent
+2020-10-22 13:32:41
+DELETE FROM emails;
+SELECT * FROM email_stats;
+id email_id date_sent generated_sent_email
+1 NULL 2020-10-22 13:32:41 2020-$
+SELECT date_sent
+FROM email_stats force index (mautic_generated_sent_date_email)
+WHERE generated_sent_email = '2020-$';
+date_sent
+2020-10-22 13:32:41
+SELECT date_sent
+FROM email_stats force index (idx_es1)
+WHERE generated_sent_email = '2020-$';
+date_sent
+2020-10-22 13:32:41
+DROP TABLE email_stats;
+DROP TABLE emails;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result
index 20311a21136..4b7af8784eb 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_index.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result
@@ -266,3 +266,51 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+#
+# MDEV-25872 InnoDB: Assertion failure in row_merge_read_clustered_index
+# upon ALTER on table with indexed virtual columns
+#
+CREATE TABLE t1 (
+id BIGINT AUTO_INCREMENT PRIMARY KEY,
+a INT,
+va INT ZEROFILL AS (a) VIRTUAL,
+b TIMESTAMP,
+c CHAR(204),
+vc CHAR(8),
+KEY(vc,c(64),b,va)
+) ENGINE=InnoDB CHARACTER SET utf32;
+INSERT INTO t1 (id) SELECT NULL FROM seq_1_to_75;
+INSERT IGNORE INTO t1 (id, a) VALUES (NULL, -1);
+Warnings:
+Warning 1264 Out of range value for column 'va' at row 1
+ALTER TABLE t1 FORCE;
+ERROR 22003: Out of range value for column 'va' at row 1
+DROP TABLE t1;
+#
+# MDEV-24713 Assertion `dict_table_is_comp(index->table)' failed
+# in row_merge_buf_add()
+#
+CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(3),
+b CHAR(8) AS (a) VIRTUAL, KEY(b))
+ROW_FORMAT=REDUNDANT ENGINE=InnoDB
+CHARACTER SET utf8;
+INSERT INTO t1 (id,a) VALUES (1,'foo');
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+DROP TABLE t1;
+#
+# MDEV-20154 Assertion `len <= col->len || ((col->mtype) == 5
+# || (col->mtype) == 14)' failed in row_merge_buf_add
+#
+CREATE TABLE t1 (
+a VARCHAR(2500),
+b VARCHAR(2499) AS (a) VIRTUAL
+) ENGINE=InnoDB;
+INSERT INTO t1 (a) VALUES ('foo');
+ALTER TABLE t1 MODIFY a VARCHAR(2600), ALGORITHM=INPLACE;
+ALTER TABLE t1 ADD KEY (b), ALGORITHM=INPLACE;
+# Cleanup
+DROP TABLE t1;
+# End of 10.2 tests
diff --git a/mysql-test/suite/gcol/r/virtual_index_drop.result b/mysql-test/suite/gcol/r/virtual_index_drop.result
new file mode 100644
index 00000000000..012e61be459
--- /dev/null
+++ b/mysql-test/suite/gcol/r/virtual_index_drop.result
@@ -0,0 +1,69 @@
+#
+# MDEV-24971 InnoDB access freed virtual column
+# after rollback of secondary index
+#
+CREATE TABLE t1(f1 INT, f2 INT AS (f1 + 2) VIRTUAL)ENGINE=InnoDB;
+INSERT INTO t1(f1) VALUES(1), (1);
+ALTER TABLE t1 ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE, LOCK=EXCLUSIVE;
+ERROR 23000: Duplicate entry '3' for key 'f2'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL,
+ `f2` int(11) GENERATED ALWAYS AS (`f1` + 2) VIRTUAL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT, f2 INT AS (f1 + 2) VIRTUAL)ENGINE=InnoDB;
+INSERT INTO t1(f1) VALUES(1), (1);
+ALTER TABLE t1 ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE, LOCK=SHARED;
+ERROR 23000: Duplicate entry '3' for key 'f2'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL,
+ `f2` int(11) GENERATED ALWAYS AS (`f1` + 2) VIRTUAL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB;
+SET DEBUG_DBUG="+d,create_index_fail";
+SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal";
+ALTER TABLE t1 ADD COLUMN f3 INT AS (f1) VIRTUAL, ADD INDEX(f2, f3);
+connect con1,localhost,root,,,;
+SET DEBUG_SYNC="now WAIT_FOR con1_go";
+BEGIN;
+SELECT * FROM t1;
+f1 f2
+SET DEBUG_SYNC="now SIGNAL alter_signal";
+connection default;
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+connection con1;
+rollback;
+connection default;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL,
+ `f2` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB;
+SET DEBUG_DBUG="+d,create_index_fail";
+SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal";
+ALTER TABLE t1 ADD INDEX(f2);
+connection con1;
+SET DEBUG_SYNC="now WAIT_FOR con1_go";
+BEGIN;
+INSERT INTO t1(f1) VALUES(1);
+SET DEBUG_SYNC="now SIGNAL alter_signal";
+connection default;
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+connection con1;
+rollback;
+connection default;
+disconnect con1;
+DROP TABLE t1;
+CREATE TABLE t1(f1 CHAR(100), f2 CHAR(100) as (f1) VIRTUAL)ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN f3 CHAR(100) AS (f2) VIRTUAL, ADD INDEX(f3(10), f1, f3(12));
+ERROR 42S21: Duplicate column name 'f3'
+DROP TABLE t1;
+SET DEBUG_SYNC=RESET;
diff --git a/mysql-test/suite/gcol/t/gcol_bugfixes.test b/mysql-test/suite/gcol/t/gcol_bugfixes.test
index 033c430853d..a1f277199eb 100644
--- a/mysql-test/suite/gcol/t/gcol_bugfixes.test
+++ b/mysql-test/suite/gcol/t/gcol_bugfixes.test
@@ -634,3 +634,87 @@ REPLACE t2(number) VALUES('1');
REPLACE t2(number) VALUES('1');
DROP TABLE t2;
+
+--echo # MDEV-24583 SELECT aborts after failed REPLACE into table with vcol
+
+CREATE TABLE t1 (pk INT, a VARCHAR(3), v VARCHAR(3) AS (CONCAT('x-',a)),
+ PRIMARY KEY(pk)) ENGINE=MyISAM;
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 (pk, a) VALUES (1,'foo');
+SET sql_mode=CONCAT(@@sql_mode,',STRICT_ALL_TABLES');
+--error 0,ER_DATA_TOO_LONG
+REPLACE INTO t1 (pk,a) VALUES (1,'qux');
+SELECT * FROM v1;
+
+# Cleanup
+DROP VIEW v1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ pk INT,
+ a VARCHAR(1),
+ v VARCHAR(1) AS (CONCAT('virt-',a)) VIRTUAL,
+ PRIMARY KEY (pk)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (pk,a) VALUES
+(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f');
+
+ --error ER_DATA_TOO_LONG
+REPLACE INTO t1 (pk) VALUES (1);
+SELECT * FROM t1 ORDER BY a;
+
+SET SQL_MODE=DEFAULT;
+DROP TABLE t1;
+
+--echo # (duplicate) MDEV-24656
+--echo # [FATAL] InnoDB: Data field type 0, len 0, ASAN heap-buffer-overflow
+--echo # upon LOAD DATA with virtual columns
+
+CREATE TABLE t1 (id INT PRIMARY KEY, a VARCHAR(2333),
+ va VARCHAR(171) AS (a)) ENGINE=InnoDB;
+INSERT INTO t1 (id,a) VALUES (1,REPEAT('x',200));
+SELECT id, va INTO OUTFILE 'load_t1' FROM t1;
+--error ER_DATA_TOO_LONG
+LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id,va);
+SELECT * FROM t1;
+LOAD DATA INFILE 'load_t1' IGNORE INTO TABLE t1 (id,va);
+
+DROP TABLE t1;
+--let $datadir= `select @@datadir`
+--remove_file $datadir/test/load_t1
+
+CREATE TABLE t1 (id BIGINT PRIMARY KEY, a VARCHAR(2333),
+ va VARCHAR(171) AS (a)) ENGINE=InnoDB;
+INSERT INTO t1 (id,a) VALUES (1,REPEAT('x',200));
+SELECT id, va INTO OUTFILE 'load_t1' FROM t1;
+--error ER_DATA_TOO_LONG
+LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id,va);
+SELECT * FROM t1;
+LOAD DATA INFILE 'load_t1' IGNORE INTO TABLE t1 (id,va);
+
+# Cleanup
+DROP TABLE t1;
+--let $datadir= `select @@datadir`
+--remove_file $datadir/test/load_t1
+
+
+--echo # (duplicate) MDEV-24665
+--echo # ASAN errors, assertion failures, corrupt values after failed
+--echo # LOAD DATA into table with virtual/stored column
+
+CREATE TABLE t1 (id INT PRIMARY KEY,
+ ts TIMESTAMP DEFAULT '1971-01-01 00:00:00',
+ c VARBINARY(8) DEFAULT '', vc VARCHAR(3) AS (c) STORED);
+INSERT IGNORE INTO t1 (id,c) VALUES (1,'foobar');
+SELECT id, ts, vc INTO OUTFILE 'load_t1' FROM t1;
+--error 0,ER_DATA_TOO_LONG
+LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id, ts, vc);
+INSERT IGNORE INTO t1 (id) VALUES (2);
+
+# Cleanup
+DROP TABLE t1;
+--let $datadir= `select @@datadir`
+--remove_file $datadir/test/load_t1
+
+
diff --git a/mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test b/mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test
index 23d97a797e0..15a0db29615 100644
--- a/mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test
+++ b/mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test
@@ -36,7 +36,7 @@ eval SET @@session.default_storage_engine = 'InnoDB';
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
-let $support_virtual_index= 0;
+let $support_virtual_index= 1;
--source suite/gcol/inc/gcol_ins_upd.inc
#------------------------------------------------------------------------------#
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
index 238a4937e9f..a40e788f9a7 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
@@ -322,4 +322,115 @@ drop table t1;
--source include/wait_until_count_sessions.inc
set debug_sync=reset;
+
+--echo #
+--echo # MDEV-18546 ASAN heap-use-after-free
+--echo # in innobase_get_computed_value / row_purge
+--echo #
+
+CREATE TABLE t1 (
+ pk INT AUTO_INCREMENT,
+ b BIT(15),
+ v BIT(15) AS (b) VIRTUAL,
+ PRIMARY KEY(pk),
+ UNIQUE(v)
+) ENGINE=InnoDB;
+INSERT IGNORE INTO t1 (b) VALUES
+ (NULL),(b'011'),(b'000110100'),
+ (b'01101101010'),(b'01111001001011'),(NULL);
+
+SET GLOBAL innodb_debug_sync = "ib_clust_v_col_before_row_allocated "
+ "SIGNAL before_row_allocated "
+ "WAIT_FOR flush_unlock";
+SET GLOBAL innodb_debug_sync = "ib_open_after_dict_open "
+ "SIGNAL purge_open "
+ "WAIT_FOR select_open";
+
+# In 10.2 trx_undo_roll_ptr_is_insert(t_roll_ptr) condition never pass in purge,
+# so this condition is forced to pass in row_vers_old_has_index_entry
+set global debug_dbug= "d,ib_purge_virtual_index_callback";
+
+# The purge starts from REPLACE command. To avoid possible race, separate
+# connection is used.
+--connect(purge_waiter,localhost,root)
+--send
+SET debug_sync= "now WAIT_FOR before_row_allocated";
+
+--connection default
+REPLACE INTO t1 (pk, b) SELECT pk, b FROM t1;
+
+--connection purge_waiter
+# Now we will definitely catch ib_clust_v_col_before_row_allocated
+--reap
+--connection default
+--disconnect purge_waiter
+
+# purge hangs on the sync point. table is purged, ref_count is set to 0
+FLUSH TABLES;
+
+# Avoid hang on repeating purge.
+# Reset Will be applied after first record is purged
+SET GLOBAL innodb_debug_sync = reset;
+
+SET debug_sync= "now SIGNAL flush_unlock WAIT_FOR purge_open";
+
+# Avoid hang on repeating purge
+SET GLOBAL innodb_debug_sync = reset;
+
+# select unblocks purge thread
+SET debug_sync= "ib_open_after_dict_open SIGNAL select_open";
+SELECT * FROM t1;
+
+# Cleanup
+DROP TABLE t1;
+SET debug_sync= reset;
+set global debug_dbug= @old_dbug;
+
+
+--echo # MDEV-16962 Assertion '!error || !ot_ctx.can_recover_from_failed_open()'
+--echo # failed in open_purge_table upon concurrent ALTER and FLUSH
+
+CREATE TABLE t1 (
+ pk SERIAL,
+ c VARCHAR(128),
+ d DATE,
+ vd DATE AS (d) VIRTUAL,
+ PRIMARY KEY(pk),
+ KEY(vd,c)
+) ENGINE=InnoDB;
+INSERT IGNORE INTO t1 (pk,c) VALUES (1,'foo');
+
+--send
+set debug_sync="now WAIT_FOR purge";
+--connect (con1,localhost,root,,test)
+# Will break innodb purge thread inside open_purge_table after mdl
+# acquired, but before tdc->flushed check
+SET GLOBAL innodb_debug_sync="after_open_table_mdl_shared SIGNAL purge WAIT_FOR flush";
+
+# Workaround to pass trx_undo_roll_ptr_is_insert() in 10.2
+SET global debug_dbug="d,ib_purge_virtual_index_callback";
+
+REPLACE INTO t1 (pk,c) VALUES (1,'bar');
+
+--connection default
+# wait for MDL acquired by purge
+--reap
+# MDL_SHARED will be acquired, but will hang before MDL upgrade started.
+SET debug_sync="alter_table_before_rename_result_table WAIT_FOR flush";
+--send
+ALTER TABLE t1 ADD FULLTEXT KEY(c), ALGORITHM=COPY;
+--connection con1
+# Will hang after tdc->flushed is set, but before emptying tdc cache.
+SET debug_sync="after_flush_unlock SIGNAL flush ";
+FLUSH TABLES;
+
+# Cleanup
+--disconnect con1
+--connection default
+--reap
+--source ../../innodb/include/wait_all_purged.inc
+DROP TABLE t1;
+SET debug_sync= reset;
+SET global debug_dbug=@old_dbug;
+
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_fk.test b/mysql-test/suite/gcol/t/innodb_virtual_fk.test
index 24b6a4631e6..0f0406b5dd4 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_fk.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_fk.test
@@ -670,6 +670,7 @@ CREATE TABLE email_stats (
PRIMARY KEY (id),
KEY mautic_generated_sent_date_email_id (generated_email_id),
FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
+ ON UPDATE CASCADE
) ENGINE=InnoDB;
@@ -677,6 +678,7 @@ CREATE TABLE emails_metadata (
email_id int,
PRIMARY KEY (email_id),
CONSTRAINT FK FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE
+ ON UPDATE CASCADE
) ENGINE=InnoDB;
@@ -684,9 +686,194 @@ INSERT INTO emails VALUES (1);
INSERT INTO email_stats (id, email_id, date_sent) VALUES (1,1,'Jan');
INSERT INTO emails_metadata VALUES (1);
+UPDATE emails SET id=2;
DELETE FROM emails;
DROP TABLE email_stats;
DROP TABLE emails_metadata;
DROP TABLE emails;
DROP DATABASE `a-b`;
+USE test;
+
+--echo #
+--echo # Bug#33053297 VIRTUAL INDEX CORRUPTED DURING CASCADE UPDATE ON CHILD TABLE
+--echo #
+
+--echo # Test-Case 1
+CREATE TABLE emails (
+ id int unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE email_stats (
+ id bigint unsigned NOT NULL AUTO_INCREMENT,
+ email_id int unsigned DEFAULT NULL,
+ date_sent datetime NOT NULL,
+ generated_sent_date date GENERATED ALWAYS AS
+ (concat(year(date_sent), '-', lpad(month(date_sent), 2, '0'),
+ '-', lpad(dayofmonth(date_sent), 2, '0'))),
+ PRIMARY KEY (id),
+ KEY IDX_ES1 (email_id),
+ KEY mautic_generated_sent_date_email_id(generated_sent_date, email_id),
+ FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
+) ENGINE = InnoDB;
+
+INSERT INTO emails VALUES (1);
+INSERT INTO email_stats (id, email_id, date_sent)
+ VALUES (1, 1, '2020-10-22 13:32:41');
+SELECT * FROM email_stats;
+
+DELETE FROM emails;
+DELETE FROM email_stats;
+
+--echo # Clean up.
+DROP TABLE email_stats;
+DROP TABLE emails;
+
+--echo # Test-Case 2
+CREATE TABLE emails (
+ id int unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4
+ COLLATE = utf8mb4_unicode_ci
+ ROW_FORMAT = DYNAMIC;
+
+CREATE TABLE email_stats (
+ id bigint unsigned NOT NULL AUTO_INCREMENT,
+ email_id int unsigned DEFAULT NULL,
+ date_sent datetime NOT NULL,
+ generated_sent_date date GENERATED ALWAYS AS
+ (concat(year(date_sent), '-', lpad(month(date_sent), 2, '0'),
+ '-', lpad(dayofmonth(date_sent), 2, '0'))),
+ PRIMARY KEY (id),
+ KEY IDX_ES1 (email_id),
+ KEY mautic_generated_sent_date_email_id(generated_sent_date, email_id),
+ FOREIGN KEY (email_id) REFERENCES emails (id)
+ ON DELETE SET NULL
+ ON UPDATE SET NULL
+) ENGINE = InnoDB;
+
+INSERT INTO emails VALUES (1);
+INSERT INTO email_stats (id, email_id, date_sent)
+ VALUES (1, 1, '2020-10-22 13:32:41');
+
+UPDATE emails SET id = 2 where id = 1;
+
+SELECT id FROM email_stats WHERE generated_sent_date IS NULL;
+SELECT * FROM email_stats;
+UPDATE email_stats
+ SET email_id=2
+ WHERE DATE(generated_sent_date) = '2020-10-22';
+SELECT * FROM email_stats;
+
+--echo # Clean up.
+DROP TABLE email_stats;
+DROP TABLE emails;
+
+--echo # Test-case 3
+CREATE TABLE emails (
+ id int unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+) ENGINE = INNODB
+ DEFAULT CHARSET = utf8mb4
+ COLLATE = utf8mb4_unicode_ci
+ ROW_FORMAT = DYNAMIC;
+CREATE TABLE email_stats (
+ id bigint unsigned NOT NULL AUTO_INCREMENT,
+ email_id int unsigned DEFAULT NULL,
+ date_sent datetime NOT NULL,
+ generated_sent_email varchar(20) GENERATED ALWAYS AS
+ (CONCAT(YEAR(date_sent), '-', COALESCE(email_id, '$'))),
+ PRIMARY KEY (id),
+ KEY idx_es1 (email_id),
+ KEY mautic_generated_sent_date_email(generated_sent_email, email_id),
+ FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
+) ENGINE = INNODB;
+
+INSERT INTO emails VALUES (1);
+INSERT INTO email_stats (id, email_id, date_sent)
+ VALUES (1, 1, '2020-10-22 13:32:41');
+SELECT * FROM email_stats;
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-1';
+
+DELETE FROM emails;
+
+SELECT * FROM email_stats;
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-$';
+
+--echo # Clean up.
+DROP TABLE email_stats;
+DROP TABLE emails;
+
+--echo # Test-case 4
+CREATE TABLE emails (
+ id int unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+) ENGINE = INNODB;
+
+CREATE TABLE email_stats (
+ id bigint unsigned NOT NULL AUTO_INCREMENT,
+ email_id int unsigned DEFAULT NULL,
+ date_sent datetime NOT NULL,
+ generated_sent_email varchar(20) GENERATED ALWAYS AS
+ (CONCAT(YEAR(date_sent), '-', COALESCE(email_id, '$'))),
+ PRIMARY KEY (id),
+ KEY idx_es1 (email_id),
+ KEY mautic_generated_sent_date_email(generated_sent_email, email_id),
+ FOREIGN KEY (email_id) REFERENCES emails (id) ON UPDATE SET NULL
+) ENGINE = INNODB;
+
+INSERT INTO emails VALUES (1);
+INSERT INTO email_stats (id, email_id, date_sent)
+ VALUES (1, 1, '2020-10-22 13:32:41');
+SELECT * FROM email_stats;
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-1';
+
+UPDATE emails SET id = 2 WHERE id = 1;
+
+SELECT * FROM email_stats;
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-$';
+
+#clean up.
+DROP TABLE email_stats;
+DROP TABLE emails;
+
+CREATE TABLE emails (breaker int unsigned,
+ KEY (breaker),
+ id int unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+) ENGINE=INNODB;
+
+CREATE TABLE email_stats (
+ id bigint unsigned NOT NULL AUTO_INCREMENT,
+ email_id int unsigned DEFAULT NULL,
+ date_sent datetime NOT NULL,
+ generated_sent_email varchar(20) GENERATED ALWAYS AS
+ (CONCAT(YEAR(date_sent),
+ '-',
+ COALESCE(email_id, '$'))),
+ PRIMARY KEY (id),
+ KEY idx_es1 (email_id),
+ KEY mautic_generated_sent_date_email (generated_sent_email, email_id),
+ FOREIGN KEY fk_ea1 (email_id) REFERENCES emails (breaker)
+ ON DELETE SET NULL
+) ENGINE=INNODB;
+
+show create table email_stats;
+INSERT INTO emails VALUES (1,1);
+INSERT INTO email_stats(id, email_id, date_sent)
+ VALUES (1, 1, '2020-10-22 13:32:41');
+SELECT * FROM email_stats;
+SELECT date_sent FROM email_stats WHERE generated_sent_email = '2020-1';
+DELETE FROM emails;
+SELECT * FROM email_stats;
+SELECT date_sent
+ FROM email_stats force index (mautic_generated_sent_date_email)
+ WHERE generated_sent_email = '2020-$';
+SELECT date_sent
+ FROM email_stats force index (idx_es1)
+ WHERE generated_sent_email = '2020-$';
+
+DROP TABLE email_stats;
+DROP TABLE emails;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.opt b/mysql-test/suite/gcol/t/innodb_virtual_index.opt
new file mode 100644
index 00000000000..c3f4a891cca
--- /dev/null
+++ b/mysql-test/suite/gcol/t/innodb_virtual_index.opt
@@ -0,0 +1 @@
+--innodb_sort_buffer_size=64k
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test
index 353841840dc..46ffadcdd8c 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_index.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/have_sequence.inc
# Ensure that the history list length will actually be decremented by purge.
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
@@ -281,3 +282,55 @@ ROLLBACK;
SELECT * FROM t1;
CHECK TABLE t1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-25872 InnoDB: Assertion failure in row_merge_read_clustered_index
+--echo # upon ALTER on table with indexed virtual columns
+--echo #
+
+CREATE TABLE t1 (
+ id BIGINT AUTO_INCREMENT PRIMARY KEY,
+ a INT,
+ va INT ZEROFILL AS (a) VIRTUAL,
+ b TIMESTAMP,
+ c CHAR(204),
+ vc CHAR(8),
+ KEY(vc,c(64),b,va)
+) ENGINE=InnoDB CHARACTER SET utf32;
+INSERT INTO t1 (id) SELECT NULL FROM seq_1_to_75;
+INSERT IGNORE INTO t1 (id, a) VALUES (NULL, -1);
+--error ER_WARN_DATA_OUT_OF_RANGE
+ALTER TABLE t1 FORCE;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-24713 Assertion `dict_table_is_comp(index->table)' failed
+--echo # in row_merge_buf_add()
+--echo #
+CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(3),
+ b CHAR(8) AS (a) VIRTUAL, KEY(b))
+ ROW_FORMAT=REDUNDANT ENGINE=InnoDB
+ CHARACTER SET utf8;
+INSERT INTO t1 (id,a) VALUES (1,'foo');
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-20154 Assertion `len <= col->len || ((col->mtype) == 5
+--echo # || (col->mtype) == 14)' failed in row_merge_buf_add
+--echo #
+
+CREATE TABLE t1 (
+ a VARCHAR(2500),
+ b VARCHAR(2499) AS (a) VIRTUAL
+) ENGINE=InnoDB;
+INSERT INTO t1 (a) VALUES ('foo');
+
+ALTER TABLE t1 MODIFY a VARCHAR(2600), ALGORITHM=INPLACE;
+ALTER TABLE t1 ADD KEY (b), ALGORITHM=INPLACE;
+
+--echo # Cleanup
+DROP TABLE t1;
+
+--echo # End of 10.2 tests
+
diff --git a/mysql-test/suite/gcol/t/virtual_index_drop.test b/mysql-test/suite/gcol/t/virtual_index_drop.test
new file mode 100644
index 00000000000..016832b9e6d
--- /dev/null
+++ b/mysql-test/suite/gcol/t/virtual_index_drop.test
@@ -0,0 +1,71 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+--echo #
+--echo # MDEV-24971 InnoDB access freed virtual column
+--echo # after rollback of secondary index
+--echo #
+
+# Exclusive lock must not defer the index removal
+
+CREATE TABLE t1(f1 INT, f2 INT AS (f1 + 2) VIRTUAL)ENGINE=InnoDB;
+INSERT INTO t1(f1) VALUES(1), (1);
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE, LOCK=EXCLUSIVE;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# If Shared lock and table doesn't have any other open handle
+# then InnoDB must not defer the index removal
+
+CREATE TABLE t1(f1 INT, f2 INT AS (f1 + 2) VIRTUAL)ENGINE=InnoDB;
+INSERT INTO t1(f1) VALUES(1), (1);
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE, LOCK=SHARED;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# InnoDB should store the newly dropped virtual column into
+# new_vcol_info in index when rollback of alter happens
+
+CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB;
+SET DEBUG_DBUG="+d,create_index_fail";
+SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal";
+SEND ALTER TABLE t1 ADD COLUMN f3 INT AS (f1) VIRTUAL, ADD INDEX(f2, f3);
+connect(con1,localhost,root,,,);
+SET DEBUG_SYNC="now WAIT_FOR con1_go";
+BEGIN;
+SELECT * FROM t1;
+SET DEBUG_SYNC="now SIGNAL alter_signal";
+connection default;
+--error ER_DUP_ENTRY
+reap;
+connection con1;
+rollback;
+connection default;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB;
+SET DEBUG_DBUG="+d,create_index_fail";
+SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal";
+send ALTER TABLE t1 ADD INDEX(f2);
+connection con1;
+SET DEBUG_SYNC="now WAIT_FOR con1_go";
+BEGIN;
+INSERT INTO t1(f1) VALUES(1);
+SET DEBUG_SYNC="now SIGNAL alter_signal";
+connection default;
+--error ER_DUP_ENTRY
+reap;
+connection con1;
+rollback;
+connection default;
+disconnect con1;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 CHAR(100), f2 CHAR(100) as (f1) VIRTUAL)ENGINE=InnoDB;
+--error ER_DUP_FIELDNAME
+ALTER TABLE t1 ADD COLUMN f3 CHAR(100) AS (f2) VIRTUAL, ADD INDEX(f3(10), f1, f3(12));
+DROP TABLE t1;
+SET DEBUG_SYNC=RESET;
diff --git a/mysql-test/suite/innodb/r/alter_partitioned.result b/mysql-test/suite/innodb/r/alter_partitioned.result
new file mode 100644
index 00000000000..fe8aabb796c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_partitioned.result
@@ -0,0 +1,39 @@
+#
+# MDEV-26077 Assertion failure err != DB_DUPLICATE_KEY
+# or unexpected ER_TABLE_EXISTS_ERROR
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+connect con1,localhost,root,,test;
+START TRANSACTION;
+INSERT INTO t2 (pk) VALUES (1);
+SAVEPOINT sp;
+INSERT INTO t1 (pk) VALUES (1);
+ROLLBACK TO SAVEPOINT sp;
+connection default;
+SET @save_timeout=@@lock_wait_timeout;
+SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
+SET lock_wait_timeout=0;
+Warnings:
+Warning 1292 Truncated incorrect lock_wait_timeout value: '0'
+SET innodb_lock_wait_timeout=0;
+Warnings:
+Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '0'
+ALTER TABLE t1 PARTITION BY HASH(pk);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET lock_wait_timeout=@save_timeout;
+SET innodb_lock_wait_timeout=@save_innodb_timeout;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ PRIMARY KEY (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+connection con1;
+COMMIT;
+connection default;
+ALTER TABLE t2 PARTITION BY HASH(pk);
+disconnect con1;
+connection default;
+DROP TABLE t1, t2;
+# End of 10.2 tests
diff --git a/mysql-test/suite/innodb/r/default_row_format_alter.result b/mysql-test/suite/innodb/r/default_row_format_alter.result
index fd88fb5a3fe..1c31a287fcd 100644
--- a/mysql-test/suite/innodb/r/default_row_format_alter.result
+++ b/mysql-test/suite/innodb/r/default_row_format_alter.result
@@ -23,6 +23,7 @@ INSERT INTO t1 VALUES (1, 'abc');
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL
+CREATE TABLE t2 (b VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL) ENGINE=InnoDB;
SET GLOBAL innodb_default_row_format = DYNAMIC;
ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY;
# Here we expect DYNAMIC because there is no explicit ROW_FORMAT and the
@@ -31,6 +32,10 @@ SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 InnoDB # Dynamic # # # # # # NULL # # NULL latin1_swedish_ci NULL
DROP TABLE t1;
+ALTER TABLE t2 ADD INDEX(b);
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes
+ALTER TABLE t2 FORCE, ADD INDEX(b);
+DROP TABLE t2;
####################################
# Check the row_format effect on ALTER, ALGORITHM=COPY
SET GLOBAL innodb_default_row_format = REDUNDANT;
@@ -39,6 +44,7 @@ INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 InnoDB # Redundant # # # # # # NULL # # NULL latin1_swedish_ci NULL
+CREATE TABLE t2 (b VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL) ENGINE=InnoDB;
SET GLOBAL innoDB_default_row_format = COMPACT;
ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY;
# Because of ALGORITHM=COPY, there is TABLE REBUILD and the table isn't
@@ -47,9 +53,18 @@ SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL
DROP TABLE t1;
+ALTER TABLE t2 ADD INDEX(b);
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes
+ALTER TABLE t2 FORCE, ADD INDEX(b);
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes
+SET GLOBAL innodb_default_row_format = DYNAMIC;
+ALTER TABLE t2 ADD INDEX(b);
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes
+ALTER TABLE t2 FORCE, ADD INDEX(b);
+DROP TABLE t2;
###################################
-# Check the row_format effect on ALTER, ALGORITH=COPY on
+# Check the row_format effect on ALTER, ALGORITHM=COPY on
# create table with explicit row_format
CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
diff --git a/mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff b/mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff
index 29bc560907e..0e94bfd1c0f 100644
--- a/mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/default_row_format_create,redundant.rdiff
@@ -20,3 +20,12 @@
SET @save_format = @@GLOBAL.innodb_default_row_format;
SET GLOBAL innodb_default_row_format = redundant;
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
+@@ -49,7 +49,7 @@
+ ERROR HY000: Can't create table `test`.`t` (errno: 140 "Wrong create options")
+ SHOW WARNINGS;
+ Level Code Message
+-Warning 1478 InnoDB: PAGE_COMPRESSED requires PAGE_COMPRESSION_LEVEL or innodb_compression_level > 0
++Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT
+ Error 1005 Can't create table `test`.`t` (errno: 140 "Wrong create options")
+ Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+ CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1 page_compression_level=1;
diff --git a/mysql-test/suite/innodb/r/default_row_format_create.result b/mysql-test/suite/innodb/r/default_row_format_create.result
index d51a63dbd01..0dfcbd80e88 100644
--- a/mysql-test/suite/innodb/r/default_row_format_create.result
+++ b/mysql-test/suite/innodb/r/default_row_format_create.result
@@ -42,3 +42,26 @@ SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 InnoDB # Redundant # # # # # # NULL # NULL NULL latin1_swedish_ci NULL
DROP TABLE t1;
+SET @save_level=@@GLOBAL.innodb_compression_level;
+SET GLOBAL innodb_compression_level=0;
+CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1;
+ERROR HY000: Can't create table `test`.`t` (errno: 140 "Wrong create options")
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: PAGE_COMPRESSED requires PAGE_COMPRESSION_LEVEL or innodb_compression_level > 0
+Error 1005 Can't create table `test`.`t` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1 page_compression_level=1;
+DROP TABLE IF EXISTS t;
+SET GLOBAL innodb_compression_level=1;
+CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1;
+DROP TABLE IF EXISTS t;
+SET GLOBAL innodb_compression_level=1;
+CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
+SET GLOBAL innodb_compression_level=0;
+ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE;
+ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
+ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY;
+ERROR HY000: Can't create table `test`.`t` (errno: 140 "Wrong create options")
+DROP TABLE t;
+SET GLOBAL innodb_compression_level=@save_level;
diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result
index ca27595ffa0..efaa9028eae 100644
--- a/mysql-test/suite/innodb/r/foreign_key.result
+++ b/mysql-test/suite/innodb/r/foreign_key.result
@@ -801,4 +801,15 @@ ERROR 23000: Duplicate entry '10' for key 'ind9'
SET FOREIGN_KEY_CHECKS= 0;
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (pk);
DROP TABLE t1;
+SET FOREIGN_KEY_CHECKS= 1;
+#
+# MDEV-23455 Hangs + Sig11 in unknown location(s) due to single complex FK query
+#
+Parsing foreign keys 1...
+ERROR HY000: Can't create table `test`.`t0` (errno: 150 "Foreign key constraint is incorrectly formed")
+Parsing foreign keys 2...
+ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
+Parsing foreign keys 3...
+ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
+Parsing foreign keys 4...
# End of 10.2 tests
diff --git a/mysql-test/suite/innodb/r/import_corrupted.result b/mysql-test/suite/innodb/r/import_corrupted.result
new file mode 100644
index 00000000000..c0474ebbb1d
--- /dev/null
+++ b/mysql-test/suite/innodb/r/import_corrupted.result
@@ -0,0 +1,30 @@
+call mtr.add_suppression("Table `test`.`t2` should have 2 indexes but the tablespace has 1 indexes");
+call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it");
+call mtr.add_suppression("Trying to read page number 23 in space .*, space name test/t2, which is outside the tablespace bounds. Byte offset 0, len 16384");
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+not_id INT,
+data CHAR(255),
+data2 BLOB
+) ENGINE=INNODB;
+ALTER TABLE t1 MODIFY not_id INT UNIQUE KEY;
+connect purge_control,localhost,root,,;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+DELETE FROM t1 WHERE id % 2 = 1;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+connection purge_control;
+COMMIT;
+connection default;
+DROP TABLE t1;
+CREATE TABLE t2 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+not_id INT UNIQUE KEY,
+data CHAR(255),
+data2 BLOB
+) ENGINE=INNODB;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t2 IMPORT TABLESPACE;
+ERROR HY000: Index for table 't2' is corrupt; try to repair it
+DROP TABLE t2;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
index 3b797559603..ad6e17b920c 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
@@ -1,3 +1,7 @@
+call mtr.add_suppression("Cannot find index f2 in InnoDB index dictionary.");
+call mtr.add_suppression("InnoDB indexes are inconsistent with what defined in .frm for table .*");
+call mtr.add_suppression("Table test/t1 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the MariaDB .*");
+call mtr.add_suppression("InnoDB could not find key no 1 with name f2 from dict cache for table .*");
#
# Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS
#
@@ -25,3 +29,39 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f2`,`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
+#
+# MDEV-22928 InnoDB fails to fetch index type
+# when index mismatch
+#
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+index(f1), index(f2))ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1), (2, 2);
+connect con1,localhost,root,,test;
+SET DEBUG_SYNC="alter_table_inplace_after_commit SIGNAL default_signal WAIT_FOR default_done";
+ALTER TABLE t1 DROP INDEX f2, ALGORITHM=INPLACE;
+connection default;
+set DEBUG_SYNC="now WAIT_FOR default_signal";
+disconnect con1;
+SHOW KEYS FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 f1 1 f1 A 2 NULL NULL BTREE
+t1 1 f2 1 f2 A NULL NULL NULL Corrupted
+Warnings:
+Warning 1082 InnoDB: Table test/t1 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the MariaDB
+Warning 1082 InnoDB: Table test/t1 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the MariaDB
+DROP TABLE t1;
+#
+# MDEV-25503 InnoDB hangs on startup during recovery
+#
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=1;
+connect con1,localhost,root,,;
+BEGIN;
+DELETE FROM mysql.innodb_table_stats;
+connect con2,localhost,root,,;
+SET DEBUG_SYNC='inplace_after_index_build SIGNAL blocked WAIT_FOR ever';
+ALTER TABLE t1 FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR blocked';
+SELECT * FROM t1;
+a
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index 80cf14c1725..53e6c95af0f 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -1041,7 +1041,9 @@ CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
iNSERT INTO t1 VALUES (10);
ALTER TABLE t1 ADD b DATE NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'b' at row 1
SELECT * FROM t1;
a b
10 2001-01-01
@@ -1050,7 +1052,9 @@ CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
iNSERT INTO t1 VALUES (10);
ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'b' at row 1
SELECT * FROM t1;
a b
10 10:20:30
diff --git a/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result b/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result
new file mode 100644
index 00000000000..9f6959cb993
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result
@@ -0,0 +1,7 @@
+call mtr.add_suppression("InnoDB: Cannot allocate memory for the buffer pool");
+call mtr.add_suppression("InnoDB: Plugin initialization aborted at srv0start.cc.*");
+call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
+call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
+#
+# MDEV-25019 memory allocation failures during startup cause server failure in different, confusing ways
+#
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_stats.result b/mysql-test/suite/innodb/r/innodb_defrag_stats.result
index 7092688f07b..d1e9e2e78ae 100644
--- a/mysql-test/suite/innodb/r/innodb_defrag_stats.result
+++ b/mysql-test/suite/innodb/r/innodb_defrag_stats.result
@@ -1,175 +1,137 @@
-DROP TABLE if exists t1;
-select @@global.innodb_stats_persistent;
-@@global.innodb_stats_persistent
-0
-set global innodb_defragment_stats_accuracy = 20;
+SET GLOBAL innodb_defragment_stats_accuracy = 20;
+DELETE FROM mysql.innodb_index_stats;
# Create table.
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
-# Populate data
-INSERT INTO t1 VALUES(1, REPEAT('A', 256));
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
+CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256),
+KEY SECOND(a, b)) ENGINE=INNODB STATS_PERSISTENT=0;
+INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
+FROM seq_1_to_1024;
# Not enough page splits to trigger persistent stats write yet.
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) = 0
-1
-INSERT INTO t1 (b) SELECT b from t1;
-# Persistent stats recorded.
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
-# Delete some rows.
-delete from t1 where a between 100 * 20 and 100 * 20 + 30;
-delete from t1 where a between 100 * 19 and 100 * 19 + 30;
-delete from t1 where a between 100 * 18 and 100 * 18 + 30;
-delete from t1 where a between 100 * 17 and 100 * 17 + 30;
-delete from t1 where a between 100 * 16 and 100 * 16 + 30;
-delete from t1 where a between 100 * 15 and 100 * 15 + 30;
-delete from t1 where a between 100 * 14 and 100 * 14 + 30;
-delete from t1 where a between 100 * 13 and 100 * 13 + 30;
-delete from t1 where a between 100 * 12 and 100 * 12 + 30;
-delete from t1 where a between 100 * 11 and 100 * 11 + 30;
-delete from t1 where a between 100 * 10 and 100 * 10 + 30;
-delete from t1 where a between 100 * 9 and 100 * 9 + 30;
-delete from t1 where a between 100 * 8 and 100 * 8 + 30;
-delete from t1 where a between 100 * 7 and 100 * 7 + 30;
-delete from t1 where a between 100 * 6 and 100 * 6 + 30;
-delete from t1 where a between 100 * 5 and 100 * 5 + 30;
-delete from t1 where a between 100 * 4 and 100 * 4 + 30;
-delete from t1 where a between 100 * 3 and 100 * 3 + 30;
-delete from t1 where a between 100 * 2 and 100 * 2 + 30;
-delete from t1 where a between 100 * 1 and 100 * 1 + 30;
-# Server Restarted
-# Confirm persistent stats still there after restart.
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
+SELECT * FROM mysql.innodb_index_stats;
+database_name table_name index_name last_update stat_name stat_value sample_size stat_description
+INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
+FROM seq_1025_to_1433;
+BEGIN;
+INSERT INTO t1 SELECT 100*20+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*19+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*18+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*17+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*16+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*15+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*14+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*13+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*12+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*11+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*10+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*9+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*8+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*7+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*6+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*5+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*4+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*3+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*2+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+INSERT INTO t1 SELECT 100*1+seq, REPEAT('A', 256)
+FROM seq_70_to_99;
+ROLLBACK;
+SELECT @@GLOBAL.innodb_force_recovery<2 "have background defragmentation";
+have background defragmentation
+1
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
+table_name index_name stat_name
+t1 PRIMARY n_leaf_pages_defrag
+t1 PRIMARY n_leaf_pages_reserved
+t1 PRIMARY n_page_split
+t1 SECOND n_leaf_pages_defrag
+t1 SECOND n_leaf_pages_reserved
+t1 SECOND n_page_split
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
-select sleep(2);
-sleep(2)
-0
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
+table_name index_name stat_name
+t1 PRIMARY n_leaf_pages_defrag
+t1 PRIMARY n_leaf_pages_reserved
+t1 PRIMARY n_page_split
+t1 PRIMARY n_pages_freed
+t1 SECOND n_leaf_pages_defrag
+t1 SECOND n_leaf_pages_reserved
+t1 SECOND n_page_split
+t1 SECOND n_pages_freed
set global innodb_defragment_stats_accuracy = 40;
INSERT INTO t1 (b) SELECT b from t1;
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
+table_name index_name stat_name
+t1 PRIMARY n_leaf_pages_defrag
+t1 PRIMARY n_leaf_pages_reserved
+t1 PRIMARY n_page_split
+t1 PRIMARY n_pages_freed
+t1 SECOND n_leaf_pages_defrag
+t1 SECOND n_leaf_pages_reserved
+t1 SECOND n_page_split
+t1 SECOND n_pages_freed
INSERT INTO t1 (b) SELECT b from t1;
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
+SELECT stat_name FROM mysql.innodb_index_stats WHERE table_name='t1';
+stat_name
+n_leaf_pages_defrag
+n_leaf_pages_defrag
+n_leaf_pages_reserved
+n_leaf_pages_reserved
+n_page_split
+n_page_split
+n_pages_freed
+n_pages_freed
# Table rename should cause stats rename.
rename table t1 to t2;
-select sleep(1);
-sleep(1)
-0
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) = 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
-# Drop index should cause stats drop.
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
+table_name index_name stat_name
+t2 PRIMARY n_leaf_pages_defrag
+t2 PRIMARY n_leaf_pages_reserved
+t2 PRIMARY n_page_split
+t2 PRIMARY n_pages_freed
+t2 SECOND n_leaf_pages_defrag
+t2 SECOND n_leaf_pages_reserved
+t2 SECOND n_page_split
+t2 SECOND n_pages_freed
+# Drop index should cause stats drop, but will not.
drop index SECOND on t2;
-select sleep(3);
-sleep(3)
-0
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_pages_freed');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
-Server Restarted
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) = 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
+#
+# MDEV-26636: Statistics must not be written for temporary tables
+#
+SET GLOBAL innodb_defragment_stats_accuracy = 1;
+CREATE TEMPORARY TABLE t (a INT PRIMARY KEY, c CHAR(255) NOT NULL)
+ENGINE=InnoDB;
+INSERT INTO t SELECT seq, '' FROM seq_1_to_100;
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
+table_name index_name stat_name
+t2 PRIMARY n_leaf_pages_defrag
+t2 PRIMARY n_leaf_pages_reserved
+t2 PRIMARY n_page_split
+t2 PRIMARY n_pages_freed
+t2 SECOND n_leaf_pages_defrag
+t2 SECOND n_leaf_pages_reserved
+t2 SECOND n_page_split
+t2 SECOND n_pages_freed
# Clean up
+ALTER TABLE t2 STATS_PERSISTENT=1;
DROP TABLE t2;
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) = 0
-1
+SELECT * FROM mysql.innodb_index_stats;
+database_name table_name index_name last_update stat_name stat_value sample_size stat_description
diff --git a/mysql-test/suite/innodb/r/log_file_name.result b/mysql-test/suite/innodb/r/log_file_name.result
index 220f5ab6699..6004f05ff98 100644
--- a/mysql-test/suite/innodb/r/log_file_name.result
+++ b/mysql-test/suite/innodb/r/log_file_name.result
@@ -21,7 +21,6 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /InnoDB: Ignoring data file '.*t1.ibd' with space ID.*/ in mysqld.1.err
FOUND 1 /InnoDB: Tablespace \d+ was not found at.*t3.ibd.*/ in mysqld.1.err
# Fault 3: Wrong space_id in a dirty file, and no missing file.
SELECT * FROM INFORMATION_SCHEMA.ENGINES
diff --git a/mysql-test/suite/innodb/r/mdev-14846.result b/mysql-test/suite/innodb/r/mdev-14846.result
new file mode 100644
index 00000000000..219bd718feb
--- /dev/null
+++ b/mysql-test/suite/innodb/r/mdev-14846.result
@@ -0,0 +1,52 @@
+CREATE TABLE t1 (
+pk INT,
+f1 VARCHAR(10) NOT NULL,
+f2 VARCHAR(10) NULL,
+f3 INT UNSIGNED NULL,
+KEY (f1),
+PRIMARY KEY (pk)
+) ENGINE=InnoDB;
+CREATE OR REPLACE ALGORITHM=MERGE VIEW v4 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES (1,'k','g',6),(2,'y','r',0),(3,'t','q',1),(4,'a','r',NULL),(5,'z','t',NULL);
+CREATE TABLE t2 (f VARCHAR(10) NULL) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (NULL),('g'),('e'),('g');
+CREATE TABLE t3 (
+f1 VARCHAR(10) NOT NULL,
+f2 VARCHAR(10) NULL,
+f3 INT UNSIGNED NULL
+) ENGINE=InnoDB;
+INSERT INTO t3 VALUES ('k','n',9),('y','b',8),('m','w',6);
+CREATE TABLE t4 (f INT NULL) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (8),(9);
+UPDATE t1 SET t1.pk = -109 WHERE t1.f1 IN ( SELECT 'a' FROM t4 WHERE f >= 1 );
+SET DEBUG_SYNC='now SIGNAL con1_dml';
+connect con1,localhost,root,,test;
+SET DEBUG_SYNC='now WAIT_FOR con1_dml';
+begin;
+SELECT * FROM t1 for update;
+pk f1 f2 f3
+-109 a r NULL
+1 k g 6
+2 y r 0
+3 t q 1
+5 z t NULL
+SET DEBUG_SYNC='now SIGNAL default_dml';
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR default_dml';
+UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h';
+connect con2,localhost,root,,test;
+set debug_sync='now WAIT_FOR default_dml';
+SET DEBUG_SYNC='now SIGNAL con1_dml2';
+disconnect con2;
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR con1_dml2';
+UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 );
+connection default;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+connection con1;
+COMMIT;
+disconnect con1;
+connection default;
+DROP VIEW v4;
+DROP TABLE t1, t2, t3, t4;
+set debug_sync= reset;
diff --git a/mysql-test/suite/innodb/r/mvcc_secondary.result b/mysql-test/suite/innodb/r/mvcc_secondary.result
new file mode 100644
index 00000000000..2289742e830
--- /dev/null
+++ b/mysql-test/suite/innodb/r/mvcc_secondary.result
@@ -0,0 +1,24 @@
+#
+# MDEV-25459 MVCC read from index on CHAR or VARCHAR wrongly omits rows
+#
+CREATE TABLE t1 (
+pk int PRIMARY KEY, c varchar(255) UNIQUE,
+d char(255), e varchar(255), f char(255), g char(255)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC DEFAULT CHARACTER SET ucs2;
+INSERT INTO t1 VALUES
+(1,REPEAT('c',248),REPEAT('a',106),REPEAT('b',220),REPEAT('x',14),'');
+BEGIN;
+UPDATE t1 SET c=REPEAT('d',170);
+connect con1,localhost,root,,;
+SELECT pk FROM t1 FORCE INDEX (c);
+pk
+1
+connection default;
+COMMIT;
+connection con1;
+SELECT pk FROM t1 FORCE INDEX (c);
+pk
+1
+disconnect con1;
+connection default;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result
index 628bb648ead..0307ba88200 100644
--- a/mysql-test/suite/innodb/r/temporary_table.result
+++ b/mysql-test/suite/innodb/r/temporary_table.result
@@ -663,3 +663,99 @@ DROP TABLE t1;
END//
call t1_proc;
drop procedure t1_proc;
+CREATE TABLE t (c INT) ENGINE=InnoDB;
+INSERT INTO t VALUES(0);
+CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+INSERT INTO t2 SELECT * FROM t;
+COMMIT;
+DROP TABLE t, t2;
+CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+INSERT INTO t VALUES(0);
+ERROR 21S01: Column count doesn't match value count at row 1
+SAVEPOINT s;
+INSERT INTO t VALUES(0,0);
+COMMIT;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+INSERT INTO t VALUES(0);
+ERROR 21S01: Column count doesn't match value count at row 1
+SAVEPOINT s;
+INSERT INTO t VALUES(0,0);
+ROLLBACK;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t(c INT) ENGINE=InnoDB;
+SET SESSION tx_read_only=TRUE;
+LOCK TABLE test.t READ;
+SELECT * FROM t;
+c
+INSERT INTO t VALUES(0xADC3);
+SET SESSION tx_read_only=FALSE;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET b= 2;
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int, c varchar(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 1, repeat('a', 200));
+START TRANSACTION READ ONLY;
+UPDATE t1 SET b= 2, c=repeat('a', 250);
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+ROLLBACK;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+DELETE FROM t1 WHERE a= 2;
+COMMIT;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE tmp (a INT) ENGINE=InnoDB;
+INSERT INTO tmp () VALUES (),();
+SET TX_READ_ONLY= 1;
+INSERT INTO tmp SELECT * FROM tmp;
+SET TX_READ_ONLY= 0;
+DROP TABLE tmp;
+SET sql_mode='';
+SET GLOBAL tx_read_only=TRUE;
+CREATE TEMPORARY TABLE t (c INT);
+SET SESSION tx_read_only=DEFAULT;
+INSERT INTO t VALUES(1);
+INSERT INTO t SELECT * FROM t;
+SET SESSION tx_read_only=FALSE;
+SET GLOBAL tx_read_only=OFF;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t(a INT);
+SET SESSION tx_read_only=ON;
+LOCK TABLE t READ;
+SELECT COUNT(*)FROM t;
+COUNT(*)
+0
+INSERT INTO t VALUES (0);
+SET SESSION tx_read_only=OFF;
+DROP TABLE t;
+CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t SET a = NULL;
+ROLLBACK;
diff --git a/mysql-test/suite/innodb/r/undo_truncate.result b/mysql-test/suite/innodb/r/undo_truncate.result
index 89171d36d0f..67a587b3c1c 100644
--- a/mysql-test/suite/innodb/r/undo_truncate.result
+++ b/mysql-test/suite/innodb/r/undo_truncate.result
@@ -10,28 +10,12 @@ SET @trunc_start=
WHERE variable_name = 'innodb_undo_truncations');
create table t1(keyc int primary key, c char(100)) engine = innodb;
create table t2(keyc int primary key, c char(100)) engine = innodb;
-CREATE PROCEDURE populate_t1()
-BEGIN
-DECLARE i INT DEFAULT 1;
-while (i <= 20000) DO
-insert into t1 values (i, 'a');
-SET i = i + 1;
-END WHILE;
-END |
-CREATE PROCEDURE populate_t2()
-BEGIN
-DECLARE i INT DEFAULT 1;
-while (i <= 20000) DO
-insert into t2 values (i, 'a');
-SET i = i + 1;
-END WHILE;
-END |
connect con1,localhost,root,,;
begin;
-call populate_t1();
+insert into t1 select seq,'a' from seq_1_to_20000;
connect con2,localhost,root,,;
begin;
-call populate_t2();
+insert into t2 select seq,'a' from seq_1_to_20000;
connection con1;
update t1 set c = 'mysql';
connection con2;
@@ -53,8 +37,6 @@ commit;
disconnect con2;
connection default;
drop table t1, t2;
-drop PROCEDURE populate_t1;
-drop PROCEDURE populate_t2;
InnoDB 0 transactions not purged
SET GLOBAL innodb_undo_logs = @save_undo_logs;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency;
diff --git a/mysql-test/suite/innodb/r/update_time.result b/mysql-test/suite/innodb/r/update_time.result
index d8b9069b1ae..96d1af4c09c 100644
--- a/mysql-test/suite/innodb/r/update_time.result
+++ b/mysql-test/suite/innodb/r/update_time.result
@@ -24,8 +24,7 @@ SELECT COUNT(*) FROM information_schema.innodb_buffer_page
WHERE table_name = '`test`.`t`';
COUNT(*)
1
-# INSERT lots of data in table 'big': begin
-# INSERT lots of data in table 'big': end
+INSERT INTO big SELECT REPEAT('a', 1024) FROM seq_1_to_10240;
SELECT COUNT(*) FROM information_schema.innodb_buffer_page
WHERE table_name = '`test`.`t`';
COUNT(*)
diff --git a/mysql-test/suite/innodb/t/alter_partitioned.test b/mysql-test/suite/innodb/t/alter_partitioned.test
new file mode 100644
index 00000000000..f8ffb06af45
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_partitioned.test
@@ -0,0 +1,40 @@
+--source include/have_innodb.inc
+--source include/have_partition.inc
+
+--echo #
+--echo # MDEV-26077 Assertion failure err != DB_DUPLICATE_KEY
+--echo # or unexpected ER_TABLE_EXISTS_ERROR
+--echo #
+
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connect (con1,localhost,root,,test)
+
+START TRANSACTION;
+INSERT INTO t2 (pk) VALUES (1);
+SAVEPOINT sp;
+INSERT INTO t1 (pk) VALUES (1);
+ROLLBACK TO SAVEPOINT sp;
+
+--connection default
+SET @save_timeout=@@lock_wait_timeout;
+SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
+SET lock_wait_timeout=0;
+SET innodb_lock_wait_timeout=0;
+--error ER_LOCK_WAIT_TIMEOUT
+ALTER TABLE t1 PARTITION BY HASH(pk);
+SET lock_wait_timeout=@save_timeout;
+SET innodb_lock_wait_timeout=@save_innodb_timeout;
+
+SHOW CREATE TABLE t1;
+--connection con1
+COMMIT;
+--connection default
+ALTER TABLE t2 PARTITION BY HASH(pk);
+# Cleanup
+--disconnect con1
+--connection default
+DROP TABLE t1, t2;
+
+--echo # End of 10.2 tests
diff --git a/mysql-test/suite/innodb/t/check_ibd_filesize.test b/mysql-test/suite/innodb/t/check_ibd_filesize.test
index 92f9061a3f6..b6ab95e1930 100644
--- a/mysql-test/suite/innodb/t/check_ibd_filesize.test
+++ b/mysql-test/suite/innodb/t/check_ibd_filesize.test
@@ -46,6 +46,12 @@ perl;
print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
EOF
INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
+# Ensure that the file will be extended with the last 1024-byte page
+# after the file was pre-extended in 4096-byte increments.
+--disable_query_log
+FLUSH TABLE t1 FOR EXPORT;
+UNLOCK TABLES;
+--enable_query_log
perl;
print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
EOF
diff --git a/mysql-test/suite/innodb/t/default_row_format_alter.test b/mysql-test/suite/innodb/t/default_row_format_alter.test
index 8f7217bcf0c..56ad70e78ca 100644
--- a/mysql-test/suite/innodb/t/default_row_format_alter.test
+++ b/mysql-test/suite/innodb/t/default_row_format_alter.test
@@ -5,7 +5,7 @@ SET @row_format = @@GLOBAL.innodb_default_row_format;
--echo ####################################
--echo # Check if table rebuilding alter isn't affect if table is created
--echo # with explicit row_format
-eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=INNODB;
+CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=INNODB;
INSERT INTO t1 VALUES (1, 'abc');
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
SHOW TABLE STATUS LIKE 't1';
@@ -22,12 +22,14 @@ DROP TABLE t1;
--echo # Check if table rebuilding alter is affected when there is no
--echo # row_format specified at CREATE TABLE.
SET GLOBAL innodb_default_row_format = COMPACT;
-eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
+CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, 'abc');
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
SHOW TABLE STATUS LIKE 't1';
+CREATE TABLE t2 (b VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL) ENGINE=InnoDB;
+
SET GLOBAL innodb_default_row_format = DYNAMIC;
ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY;
@@ -37,15 +39,22 @@ ALTER TABLE t1 DROP PRIMARY KEY, ADD COLUMN c INT PRIMARY KEY;
SHOW TABLE STATUS LIKE 't1';
DROP TABLE t1;
+--error ER_INDEX_COLUMN_TOO_LONG
+ALTER TABLE t2 ADD INDEX(b);
+ALTER TABLE t2 FORCE, ADD INDEX(b);
+DROP TABLE t2;
+
--echo ####################################
--echo # Check the row_format effect on ALTER, ALGORITHM=COPY
SET GLOBAL innodb_default_row_format = REDUNDANT;
-eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
+CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
SHOW TABLE STATUS LIKE 't1';
+CREATE TABLE t2 (b VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL) ENGINE=InnoDB;
+
SET GLOBAL innoDB_default_row_format = COMPACT;
ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY;
@@ -55,11 +64,23 @@ ALTER TABLE t1 ADD COLUMN c2 BLOB, ALGORITHM=COPY;
SHOW TABLE STATUS LIKE 't1';
DROP TABLE t1;
+--error ER_INDEX_COLUMN_TOO_LONG
+ALTER TABLE t2 ADD INDEX(b);
+--error ER_INDEX_COLUMN_TOO_LONG
+ALTER TABLE t2 FORCE, ADD INDEX(b);
+
+SET GLOBAL innodb_default_row_format = DYNAMIC;
+--error ER_INDEX_COLUMN_TOO_LONG
+ALTER TABLE t2 ADD INDEX(b);
+ALTER TABLE t2 FORCE, ADD INDEX(b);
+
+DROP TABLE t2;
+
--echo
--echo ###################################
---echo # Check the row_format effect on ALTER, ALGORITH=COPY on
+--echo # Check the row_format effect on ALTER, ALGORITHM=COPY on
--echo # create table with explicit row_format
-eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=INNODB;
+CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
@@ -80,7 +101,7 @@ DROP TABLE t1;
--echo # Check row_format on ALTER ALGORITHM=INPLACE
SET GLOBAL innodb_default_row_format=COMPACT;
-eval CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT, KEY k1(b(10))) ENGINE=INNODB;
+CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT, KEY k1(b(10))) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('abc',1000));
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
diff --git a/mysql-test/suite/innodb/t/default_row_format_create.test b/mysql-test/suite/innodb/t/default_row_format_create.test
index 03a7ebd3752..534a7312620 100644
--- a/mysql-test/suite/innodb/t/default_row_format_create.test
+++ b/mysql-test/suite/innodb/t/default_row_format_create.test
@@ -44,3 +44,28 @@ TRUNCATE TABLE t1;
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
SHOW TABLE STATUS LIKE 't1';
DROP TABLE t1;
+
+SET @save_level=@@GLOBAL.innodb_compression_level;
+SET GLOBAL innodb_compression_level=0;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1;
+SHOW WARNINGS;
+--disable_warnings
+--error 0,ER_CANT_CREATE_TABLE
+CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1 page_compression_level=1;
+DROP TABLE IF EXISTS t;
+SET GLOBAL innodb_compression_level=1;
+--error 0,ER_CANT_CREATE_TABLE
+CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1;
+DROP TABLE IF EXISTS t;
+--enable_warnings
+
+SET GLOBAL innodb_compression_level=1;
+CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
+SET GLOBAL innodb_compression_level=0;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE;
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY;
+DROP TABLE t;
+SET GLOBAL innodb_compression_level=@save_level;
diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test
index 7756d48046f..08f2c529659 100644
--- a/mysql-test/suite/innodb/t/foreign_key.test
+++ b/mysql-test/suite/innodb/t/foreign_key.test
@@ -782,6 +782,45 @@ ALTER TABLE t1 ADD UNIQUE INDEX ind9 (b), LOCK=SHARED;
SET FOREIGN_KEY_CHECKS= 0;
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (pk);
DROP TABLE t1;
+SET FOREIGN_KEY_CHECKS= 1;
+
+--echo #
+--echo # MDEV-23455 Hangs + Sig11 in unknown location(s) due to single complex FK query
+--echo #
+let $constr_prefix= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+let $fk_ref= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
+let $fk_field= yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy;
+let $constr_count= 200; # each 100 constrs is 1 sec of test execution
+let $i= 0;
+
+while ($i < $constr_count)
+{
+ let $p= $constr_prefix$i;
+ let $constr= CONSTRAINT $p FOREIGN KEY ($fk_field) REFERENCES t1($fk_ref) ON UPDATE SET NULL;
+ if ($i)
+ {
+ let $constrs= $constrs, $constr;
+ }
+ if (!$i)
+ {
+ let $constrs= $constr;
+ }
+ inc $i;
+}
+--disable_query_log
+--echo Parsing foreign keys 1...
+--error ER_CANT_CREATE_TABLE
+eval create table t0($fk_field int, $constrs) engine innodb;
+--echo Parsing foreign keys 2...
+--error ER_CANT_CREATE_TABLE
+eval create table t1($fk_field int, $constrs) engine innodb;
+--echo Parsing foreign keys 3...
+--error ER_CANT_CREATE_TABLE
+eval create table t1($fk_ref int, $fk_field int, $constrs) engine innodb;
+--echo Parsing foreign keys 4...
+eval create table t1($fk_ref int primary key, $fk_field int, $constrs) engine innodb;
+drop table t1;
+--enable_query_log
--echo # End of 10.2 tests
diff --git a/mysql-test/suite/innodb/t/import_corrupted.test b/mysql-test/suite/innodb/t/import_corrupted.test
new file mode 100644
index 00000000000..050bde5d97d
--- /dev/null
+++ b/mysql-test/suite/innodb/t/import_corrupted.test
@@ -0,0 +1,69 @@
+--source include/have_innodb.inc
+
+call mtr.add_suppression("Table `test`.`t2` should have 2 indexes but the tablespace has 1 indexes");
+call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it");
+call mtr.add_suppression("Trying to read page number 23 in space .*, space name test/t2, which is outside the tablespace bounds. Byte offset 0, len 16384");
+
+let MYSQLD_DATADIR = `SELECT @@datadir`;
+
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ not_id INT,
+ data CHAR(255),
+ data2 BLOB
+) ENGINE=INNODB;
+
+--disable_query_log
+--let i = 0
+while ($i != 1000) {
+ eval INSERT INTO t1 VALUES (DEFAULT, $i, REPEAT('b', 255), REPEAT('a', 5000));
+ --inc $i
+}
+--enable_query_log
+
+ALTER TABLE t1 MODIFY not_id INT UNIQUE KEY;
+
+connect (purge_control,localhost,root,,);
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+
+DELETE FROM t1 WHERE id % 2 = 1;
+
+FLUSH TABLES t1 FOR EXPORT;
+
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/tmp.ibd
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/tmp.cfg
+
+perl;
+use strict;
+die unless open(FILE, "+<$ENV{MYSQLD_DATADIR}/test/tmp.ibd");
+die unless truncate(FILE, 16384*23);
+close(FILE);
+EOF
+
+UNLOCK TABLES;
+connection purge_control;
+COMMIT;
+connection default;
+DROP TABLE t1;
+
+CREATE TABLE t2 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ not_id INT UNIQUE KEY,
+ data CHAR(255),
+ data2 BLOB
+) ENGINE=INNODB;
+
+ALTER TABLE t2 DISCARD TABLESPACE;
+
+--copy_file $MYSQLD_DATADIR/test/tmp.ibd $MYSQLD_DATADIR/test/t2.ibd
+--copy_file $MYSQLD_DATADIR/test/tmp.cfg $MYSQLD_DATADIR/test/t2.cfg
+
+--error ER_NOT_KEYFILE
+ALTER TABLE t2 IMPORT TABLESPACE;
+
+DROP TABLE t2;
+
+--remove_file $MYSQLD_DATADIR/test/tmp.ibd
+--remove_file $MYSQLD_DATADIR/test/tmp.cfg
+--remove_file $MYSQLD_DATADIR/test/t2.ibd
diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
index de27c7ebf62..7e4244d09f8 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
@@ -12,6 +12,14 @@
--source include/innodb_page_size.inc
+--source include/have_debug_sync.inc
+
+call mtr.add_suppression("Cannot find index f2 in InnoDB index dictionary.");
+call mtr.add_suppression("InnoDB indexes are inconsistent with what defined in .frm for table .*");
+call mtr.add_suppression("Table test/t1 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the MariaDB .*");
+call mtr.add_suppression("InnoDB could not find key no 1 with name f2 from dict cache for table .*");
+
+
--echo #
--echo # Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS
--echo #
@@ -42,3 +50,44 @@ show create table t1;
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
show create table t1;
drop table t1;
+
+--echo #
+--echo # MDEV-22928 InnoDB fails to fetch index type
+--echo # when index mismatch
+--echo #
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+ index(f1), index(f2))ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1), (2, 2);
+
+connect (con1,localhost,root,,test);
+SET DEBUG_SYNC="alter_table_inplace_after_commit SIGNAL default_signal WAIT_FOR default_done";
+--send
+ALTER TABLE t1 DROP INDEX f2, ALGORITHM=INPLACE;
+connection default;
+set DEBUG_SYNC="now WAIT_FOR default_signal";
+--let $shutdown_timeout=0
+--source include/restart_mysqld.inc
+disconnect con1;
+SHOW KEYS FROM t1;
+DROP TABLE t1;
+remove_files_wildcard $datadir/test #sql-*.frm;
+
+--echo #
+--echo # MDEV-25503 InnoDB hangs on startup during recovery
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=1;
+connect (con1,localhost,root,,);
+BEGIN;
+DELETE FROM mysql.innodb_table_stats;
+
+connect (con2,localhost,root,,);
+SET DEBUG_SYNC='inplace_after_index_build SIGNAL blocked WAIT_FOR ever';
+send ALTER TABLE t1 FORCE;
+
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR blocked';
+--let $shutdown_timeout=0
+--source include/restart_mysqld.inc
+SELECT * FROM t1;
+DROP TABLE t1;
+remove_files_wildcard $datadir/test #sql-*.frm;
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
index 1b1df674e3c..47d24d638e9 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
@@ -1,6 +1,8 @@
-- source include/have_innodb.inc
-- source include/have_innodb_lz4.inc
-- source include/not_embedded.inc
+# The test can take very long time with valgrind
+--source include/not_valgrind.inc
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test
new file mode 100644
index 00000000000..1d938e12e78
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test
@@ -0,0 +1,11 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+call mtr.add_suppression("InnoDB: Cannot allocate memory for the buffer pool");
+call mtr.add_suppression("InnoDB: Plugin initialization aborted at srv0start.cc.*");
+call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
+call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
+--echo #
+--echo # MDEV-25019 memory allocation failures during startup cause server failure in different, confusing ways
+--echo #
+let restart_parameters=--debug_dbug="+d,ib_buf_chunk_init_fails";
+--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats.test b/mysql-test/suite/innodb/t/innodb_defrag_stats.test
index 2a5026a68e5..799faa93ff0 100644
--- a/mysql-test/suite/innodb/t/innodb_defrag_stats.test
+++ b/mysql-test/suite/innodb/t/innodb_defrag_stats.test
@@ -1,125 +1,89 @@
--source include/have_innodb.inc
---source include/big_test.inc
--source include/not_valgrind.inc
--source include/not_embedded.inc
+--source include/have_sequence.inc
---disable_warnings
-DROP TABLE if exists t1;
---enable_warnings
+SET GLOBAL innodb_defragment_stats_accuracy = 20;
---disable_query_log
-let $innodb_defragment_stats_accuracy_orig=`select @@innodb_defragment_stats_accuracy`;
---enable_query_log
-
-select @@global.innodb_stats_persistent;
-set global innodb_defragment_stats_accuracy = 20;
+DELETE FROM mysql.innodb_index_stats;
--echo # Create table.
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
+CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256),
+ KEY SECOND(a, b)) ENGINE=INNODB STATS_PERSISTENT=0;
---echo # Populate data
-INSERT INTO t1 VALUES(1, REPEAT('A', 256));
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
+INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
+FROM seq_1_to_1024;
--echo # Not enough page splits to trigger persistent stats write yet.
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+SELECT * FROM mysql.innodb_index_stats;
-INSERT INTO t1 (b) SELECT b from t1;
-
---echo # Persistent stats recorded.
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
+FROM seq_1025_to_1433;
---echo # Delete some rows.
+BEGIN;
let $num_delete = 20;
while ($num_delete)
{
- let $j = 100 * $num_delete;
- eval delete from t1 where a between $j and $j + 30;
+ eval INSERT INTO t1 SELECT 100*$num_delete+seq, REPEAT('A', 256)
+ FROM seq_70_to_99;
dec $num_delete;
}
+ROLLBACK;
---source include/restart_mysqld.inc
---echo # Server Restarted
+SELECT @@GLOBAL.innodb_force_recovery<2 "have background defragmentation";
+
+# Wait for defrag_pool to be processed.
+
+let $wait_timeout=30;
+let $wait_condition = SELECT COUNT(*)>0 FROM mysql.innodb_index_stats;
+--source include/wait_condition.inc
---echo # Confirm persistent stats still there after restart.
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+--sorted_result
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
optimize table t1;
-select sleep(2);
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
+--sorted_result
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
set global innodb_defragment_stats_accuracy = 40;
INSERT INTO t1 (b) SELECT b from t1;
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
+--sorted_result
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
INSERT INTO t1 (b) SELECT b from t1;
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
+--sorted_result
+SELECT stat_name FROM mysql.innodb_index_stats WHERE table_name='t1';
--echo # Table rename should cause stats rename.
rename table t1 to t2;
-select sleep(1);
-
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
+--sorted_result
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
---echo # Drop index should cause stats drop.
+--echo # Drop index should cause stats drop, but will not.
drop index SECOND on t2;
-select sleep(3);
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_page_split');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_leaf_pages_defrag');
+--echo #
+--echo # MDEV-26636: Statistics must not be written for temporary tables
+--echo #
+SET GLOBAL innodb_defragment_stats_accuracy = 1;
+CREATE TEMPORARY TABLE t (a INT PRIMARY KEY, c CHAR(255) NOT NULL)
+ENGINE=InnoDB;
+INSERT INTO t SELECT seq, '' FROM seq_1_to_100;
--source include/restart_mysqld.inc
---echo Server Restarted
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
+--sorted_result
+SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
--echo # Clean up
+# Starting with 10.6, DROP TABLE will not touch persistent statistics
+# (not defragmentation statistics either) if the table has none!
+ALTER TABLE t2 STATS_PERSISTENT=1;
DROP TABLE t2;
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
-
---disable_query_log
-EVAL SET GLOBAL innodb_defragment_stats_accuracy = $innodb_defragment_stats_accuracy_orig;
---enable_query_log
+SELECT * FROM mysql.innodb_index_stats;
diff --git a/mysql-test/suite/innodb/t/log_file_name.test b/mysql-test/suite/innodb/t/log_file_name.test
index df9f8664a64..b8f6025e617 100644
--- a/mysql-test/suite/innodb/t/log_file_name.test
+++ b/mysql-test/suite/innodb/t/log_file_name.test
@@ -54,9 +54,6 @@ let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Ano
--source include/start_mysqld.inc
eval $check_no_innodb;
-let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t1.ibd' with space ID.*;
---source include/search_pattern_in_file.inc
-
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at.*t3.ibd.*;
--source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/innodb/t/mdev-14846.opt b/mysql-test/suite/innodb/t/mdev-14846.opt
new file mode 100644
index 00000000000..c8fe0561390
--- /dev/null
+++ b/mysql-test/suite/innodb/t/mdev-14846.opt
@@ -0,0 +1 @@
+--loose-innodb_lock_waits
diff --git a/mysql-test/suite/innodb/t/mdev-14846.test b/mysql-test/suite/innodb/t/mdev-14846.test
new file mode 100644
index 00000000000..adcefecd52f
--- /dev/null
+++ b/mysql-test/suite/innodb/t/mdev-14846.test
@@ -0,0 +1,70 @@
+--source include/have_innodb.inc
+--source include/count_sessions.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (
+ pk INT,
+ f1 VARCHAR(10) NOT NULL,
+ f2 VARCHAR(10) NULL,
+ f3 INT UNSIGNED NULL,
+ KEY (f1),
+ PRIMARY KEY (pk)
+) ENGINE=InnoDB;
+
+CREATE OR REPLACE ALGORITHM=MERGE VIEW v4 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES (1,'k','g',6),(2,'y','r',0),(3,'t','q',1),(4,'a','r',NULL),(5,'z','t',NULL);
+
+CREATE TABLE t2 (f VARCHAR(10) NULL) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (NULL),('g'),('e'),('g');
+
+CREATE TABLE t3 (
+ f1 VARCHAR(10) NOT NULL,
+ f2 VARCHAR(10) NULL,
+ f3 INT UNSIGNED NULL
+) ENGINE=InnoDB;
+
+INSERT INTO t3 VALUES ('k','n',9),('y','b',8),('m','w',6);
+
+CREATE TABLE t4 (f INT NULL) ENGINE=InnoDB;
+INSERT INTO t4 VALUES (8),(9);
+UPDATE t1 SET t1.pk = -109 WHERE t1.f1 IN ( SELECT 'a' FROM t4 WHERE f >= 1 );
+SET DEBUG_SYNC='now SIGNAL con1_dml';
+
+--connect (con1,localhost,root,,test)
+SET DEBUG_SYNC='now WAIT_FOR con1_dml';
+begin;
+SELECT * FROM t1 for update; # Holds x lock of all records in the table t1
+SET DEBUG_SYNC='now SIGNAL default_dml';
+
+--connection default
+SET DEBUG_SYNC='now WAIT_FOR default_dml';
+--send UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h'
+# It holds the lock of all record in t3 and tries to acquire record lock for the table t1.
+
+--connect (con2,localhost,root,,test)
+set debug_sync='now WAIT_FOR default_dml';
+let $wait_condition=
+select count(*) > 0 from information_schema.innodb_lock_waits;
+--source include/wait_condition.inc
+SET DEBUG_SYNC='now SIGNAL con1_dml2';
+disconnect con2;
+
+# Cleanup
+--connection con1
+SET DEBUG_SYNC='now WAIT_FOR con1_dml2';
+UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 );
+# It holds the record lock on table t1 and tries to acquire record lock on t3.
+# leads to deadlock (con1 trx is waiting for default trx and vice versa)
+
+--connection default
+--error ER_LOCK_DEADLOCK
+--reap
+
+connection con1;
+COMMIT;
+disconnect con1;
+
+--connection default
+DROP VIEW v4;
+DROP TABLE t1, t2, t3, t4;
+set debug_sync= reset;
diff --git a/mysql-test/suite/innodb/t/mvcc_secondary.test b/mysql-test/suite/innodb/t/mvcc_secondary.test
new file mode 100644
index 00000000000..93c91c40076
--- /dev/null
+++ b/mysql-test/suite/innodb/t/mvcc_secondary.test
@@ -0,0 +1,26 @@
+--source include/innodb_page_size_small.inc
+
+--echo #
+--echo # MDEV-25459 MVCC read from index on CHAR or VARCHAR wrongly omits rows
+--echo #
+
+CREATE TABLE t1 (
+ pk int PRIMARY KEY, c varchar(255) UNIQUE,
+ d char(255), e varchar(255), f char(255), g char(255)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC DEFAULT CHARACTER SET ucs2;
+
+INSERT INTO t1 VALUES
+(1,REPEAT('c',248),REPEAT('a',106),REPEAT('b',220),REPEAT('x',14),'');
+
+BEGIN;
+UPDATE t1 SET c=REPEAT('d',170);
+
+connect (con1,localhost,root,,);
+SELECT pk FROM t1 FORCE INDEX (c);
+connection default;
+COMMIT;
+connection con1;
+SELECT pk FROM t1 FORCE INDEX (c);
+disconnect con1;
+connection default;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test
index 6856ca86323..d7fe66e2efb 100644
--- a/mysql-test/suite/innodb/t/temporary_table.test
+++ b/mysql-test/suite/innodb/t/temporary_table.test
@@ -493,3 +493,111 @@ delimiter ;//
call t1_proc;
drop procedure t1_proc;
+
+
+CREATE TABLE t (c INT) ENGINE=InnoDB;
+INSERT INTO t VALUES(0);
+CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+INSERT INTO t2 SELECT * FROM t;
+COMMIT;
+DROP TABLE t, t2;
+
+CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t VALUES(0);
+SAVEPOINT s;
+INSERT INTO t VALUES(0,0);
+COMMIT;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t VALUES(0);
+SAVEPOINT s;
+INSERT INTO t VALUES(0,0);
+ROLLBACK;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t(c INT) ENGINE=InnoDB;
+SET SESSION tx_read_only=TRUE;
+LOCK TABLE test.t READ;
+SELECT * FROM t;
+INSERT INTO t VALUES(0xADC3);
+SET SESSION tx_read_only=FALSE;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET b= 2;
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int, c varchar(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 1, repeat('a', 200));
+START TRANSACTION READ ONLY;
+UPDATE t1 SET b= 2, c=repeat('a', 250);
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t1 SET a= 2;
+ROLLBACK;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION READ ONLY;
+DELETE FROM t1 WHERE a= 2;
+COMMIT;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE tmp (a INT) ENGINE=InnoDB;
+INSERT INTO tmp () VALUES (),();
+SET TX_READ_ONLY= 1;
+INSERT INTO tmp SELECT * FROM tmp;
+SET TX_READ_ONLY= 0;
+DROP TABLE tmp;
+
+SET sql_mode='';
+SET GLOBAL tx_read_only=TRUE;
+CREATE TEMPORARY TABLE t (c INT);
+SET SESSION tx_read_only=DEFAULT;
+INSERT INTO t VALUES(1);
+INSERT INTO t SELECT * FROM t;
+SET SESSION tx_read_only=FALSE;
+SET GLOBAL tx_read_only=OFF;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t(a INT);
+SET SESSION tx_read_only=ON;
+LOCK TABLE t READ;
+SELECT COUNT(*)FROM t;
+INSERT INTO t VALUES (0);
+SET SESSION tx_read_only=OFF;
+DROP TABLE t;
+
+CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1);
+START TRANSACTION READ ONLY;
+UPDATE t SET a = NULL;
+ROLLBACK;
diff --git a/mysql-test/suite/innodb/t/undo_truncate.test b/mysql-test/suite/innodb/t/undo_truncate.test
index 4f350e380ee..9feee84491a 100644
--- a/mysql-test/suite/innodb/t/undo_truncate.test
+++ b/mysql-test/suite/innodb/t/undo_truncate.test
@@ -5,6 +5,7 @@
# --source include/innodb_page_size.inc
--source include/innodb_page_size_small.inc
--source include/have_undo_tablespaces.inc
+--source include/have_sequence.inc
call mtr.add_suppression("InnoDB: The transaction log size is too large");
@@ -27,37 +28,14 @@ WHERE variable_name = 'innodb_undo_truncations');
create table t1(keyc int primary key, c char(100)) engine = innodb;
create table t2(keyc int primary key, c char(100)) engine = innodb;
#
-delimiter |;
-CREATE PROCEDURE populate_t1()
-BEGIN
- DECLARE i INT DEFAULT 1;
- while (i <= 20000) DO
- insert into t1 values (i, 'a');
- SET i = i + 1;
- END WHILE;
-END |
-delimiter ;|
-#
-delimiter |;
-CREATE PROCEDURE populate_t2()
-BEGIN
- DECLARE i INT DEFAULT 1;
- while (i <= 20000) DO
- insert into t2 values (i, 'a');
- SET i = i + 1;
- END WHILE;
-END |
-delimiter ;|
-#
-#
let DATADIR = `select @@datadir`;
connect (con1,localhost,root,,);
begin;
-send call populate_t1();
+send insert into t1 select seq,'a' from seq_1_to_20000;
connect (con2,localhost,root,,);
begin;
-send call populate_t2();
+send insert into t2 select seq,'a' from seq_1_to_20000;
connection con1; reap; send update t1 set c = 'mysql';
connection con2; reap; send update t2 set c = 'mysql';
@@ -67,25 +45,12 @@ connection con1; reap; send delete from t1;
connection con2; reap; delete from t2;
connection con1; reap;
-let CHECKFILE = $MYSQL_TMP_DIR/check.txt;
-perl;
-($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size1)
- = stat("$ENV{DATADIR}/undo001");
-($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size2)
- = stat("$ENV{DATADIR}/undo002");
-open(OUT, ">$ENV{CHECKFILE}") || die;
-print OUT "let \$size1='$size1,$size2';\n";
-close(OUT);
-EOF
-
SET GLOBAL innodb_undo_log_truncate = 1;
commit; disconnect con1;
connection con2; commit; disconnect con2;
connection default;
drop table t1, t2;
-drop PROCEDURE populate_t1;
-drop PROCEDURE populate_t2;
--source include/wait_all_purged.inc
@@ -100,29 +65,6 @@ if (`select @@innodb_page_size IN (4096,8192,16384)`)
source include/wait_condition.inc;
}
---source $CHECKFILE
-perl;
-($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size1)
- = stat("$ENV{DATADIR}/undo001");
-($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size2)
- = stat("$ENV{DATADIR}/undo002");
-open(OUT, ">$ENV{CHECKFILE}") || die;
-print OUT "let \$size2='$size1,$size2';\n";
-close(OUT);
-EOF
-
---source $CHECKFILE
---remove_file $CHECKFILE
-
-if ($size1 == $size2)
-{
- # This fails for innodb_page_size=64k, occasionally also for 32k.
- if (`select @@innodb_page_size IN (4096,8192,16384)`)
- {
- echo Truncation did not happen: $size1;
- }
-}
-
SET GLOBAL innodb_undo_logs = @save_undo_logs;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency;
SET GLOBAL innodb_undo_log_truncate = @save_truncate;
diff --git a/mysql-test/suite/innodb/t/update_time-master.opt b/mysql-test/suite/innodb/t/update_time-master.opt
index 9f283a9503f..f0fd647546d 100644
--- a/mysql-test/suite/innodb/t/update_time-master.opt
+++ b/mysql-test/suite/innodb/t/update_time-master.opt
@@ -1 +1 @@
---innodb-buffer-pool-size=10M
+--innodb-buffer-pool-size=5M
diff --git a/mysql-test/suite/innodb/t/update_time.test b/mysql-test/suite/innodb/t/update_time.test
index a95c5171e9b..fd1e082f5f2 100644
--- a/mysql-test/suite/innodb/t/update_time.test
+++ b/mysql-test/suite/innodb/t/update_time.test
@@ -10,6 +10,7 @@
-- source include/not_embedded.inc
# This test is slow on buildbot.
--source include/big_test.inc
+--source include/have_sequence.inc
CREATE TABLE t (a INT) ENGINE=INNODB;
@@ -33,18 +34,7 @@ SELECT COUNT(*) FROM information_schema.innodb_buffer_page
WHERE table_name = '`test`.`t`';
# evict table 't' by inserting as much data as the BP size itself
--- echo # INSERT lots of data in table 'big': begin
--- disable_query_log
-BEGIN;
--- let $i = 10240
-while ($i)
-{
- INSERT INTO big VALUES (REPEAT('a', 1024));
- dec $i;
-}
-COMMIT;
--- enable_query_log
--- echo # INSERT lots of data in table 'big': end
+INSERT INTO big SELECT REPEAT('a', 1024) FROM seq_1_to_10240;
# confirm that all pages for table 't' have been evicted
SELECT COUNT(*) FROM information_schema.innodb_buffer_page
diff --git a/mysql-test/suite/innodb_fts/r/basic.result b/mysql-test/suite/innodb_fts/r/basic.result
index b3fd94509c3..a98de60674a 100644
--- a/mysql-test/suite/innodb_fts/r/basic.result
+++ b/mysql-test/suite/innodb_fts/r/basic.result
@@ -313,9 +313,7 @@ FTS_DOC_ID
65536
131071
drop table t1;
-call mtr.add_suppression("\\[ERROR\\] InnoDB: Doc ID 20030101000000 is too big. Its difference with largest used Doc ID 0 cannot exceed or equal to 65535");
CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200), FULLTEXT(title)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL, NULL), (20030101000000, 20030102000000);
-ERROR HY000: Invalid InnoDB FTS Doc ID
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/r/bug_32831765.result b/mysql-test/suite/innodb_fts/r/bug_32831765.result
new file mode 100644
index 00000000000..1b828f4266b
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/r/bug_32831765.result
@@ -0,0 +1,131 @@
+#
+# Bug#32831765 SERVER HITS OOM CONDITION WHEN LOADING TWO
+# INNODB TABLES WITH FTS INDEXES
+#
+create table t1 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text,
+`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07`
+text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text,
+`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18`
+text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text,
+`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29`
+text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY
+(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY
+(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY
+(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY
+(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY
+(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY
+(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY
+(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY
+(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY
+(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY
+(`col29`), FULLTEXT KEY (`col30`)) engine=innodb;
+create table t2 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text,
+`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07`
+text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text,
+`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18`
+text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text,
+`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29`
+text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY
+(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY
+(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY
+(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY
+(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY
+(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY
+(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY
+(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY
+(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY
+(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY
+(`col29`), FULLTEXT KEY (`col30`)) engine=innodb;
+create table t3 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text,
+`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07`
+text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text,
+`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18`
+text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text,
+`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29`
+text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY
+(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY
+(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY
+(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY
+(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY
+(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY
+(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY
+(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY
+(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY
+(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY
+(`col29`), FULLTEXT KEY (`col30`)) engine=innodb;
+create table t4 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text,
+`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07`
+text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text,
+`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18`
+text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text,
+`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29`
+text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY
+(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY
+(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY
+(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY
+(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY
+(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY
+(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY
+(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY
+(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY
+(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY
+(`col29`), FULLTEXT KEY (`col30`)) engine=innodb;
+#create procedure to inset into the table.
+CREATE PROCEDURE `proc_insert`(IN tab_name VARCHAR(40))
+BEGIN
+DECLARE i INT DEFAULT 1;
+SET @insert_tbl =CONCAT('INSERT INTO ', tab_name, '( `col01`, `col02`,
+ `col03`, `col04`, `col05`, `col06`, `col07`, `col08`, `col09`, `col10`,
+ `col11`, `col12`, `col13`, `col14`, `col15`, `col16`, `col17`, `col18`,
+ `col19`, `col20`, `col21`, `col22`, `col23`, `col24`, `col25`, `col26`,
+ `col27`, `col28`, `col29`, `col30`)
+ VALUES ( MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()))');
+PREPARE ins_stmt FROM @insert_tbl;
+while (i <= 2000) DO
+EXECUTE ins_stmt;
+SET i = i + 1;
+END WHILE;
+DEALLOCATE PREPARE ins_stmt;
+END |
+SET @save_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,fts_optimize_wq_count_check";
+connect con1,localhost,root,,;
+call proc_insert('t1');
+connect con2,localhost,root,,;
+call proc_insert('t1');
+connect con3,localhost,root,,;
+call proc_insert('t2');
+connect con4,localhost,root,,;
+call proc_insert('t2');
+connect con5,localhost,root,,;
+call proc_insert('t3');
+connect con6,localhost,root,,;
+call proc_insert('t3');
+connect con7,localhost,root,,;
+call proc_insert('t4');
+connection default;
+call proc_insert('t4');
+SET GLOBAL debug_dbug= @save_dbug;
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection con4;
+disconnect con4;
+connection con5;
+disconnect con5;
+connection con6;
+disconnect con6;
+connection con7;
+disconnect con7;
+connection default;
+DROP TABLE t1,t2,t3,t4;
+DROP PROCEDURE proc_insert;
diff --git a/mysql-test/suite/innodb_fts/r/fulltext.result b/mysql-test/suite/innodb_fts/r/fulltext.result
index 42e294b3293..1e5a83fd44c 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext.result
@@ -56,7 +56,7 @@ Only MyISAM tables support collections
MySQL has now support for full-text search
Full-text search in MySQL implements vector space model
select * from t1 where MATCH(a,b) AGAINST ("indexes" IN BOOLEAN MODE WITH QUERY EXPANSION);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'QUERY EXPANSION)' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH QUERY EXPANSION)' at line 1
explain select * from t1 where MATCH(a,b) AGAINST ("collections");
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext a a 0 1 Using where
@@ -691,3 +691,16 @@ FTS_DOC_ID t
2 foo bar
3 foo
DROP TABLE t;
+#
+# MDEV-25295 Aborted FTS_DOC_ID_INDEX considered as
+# existing FTS_DOC_ID_INDEX during DDL
+#
+SET sql_mode='';
+CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL,title CHAR(1),body TEXT)engine=innodb;
+INSERT INTO t1 (FTS_DOC_ID,title,body)VALUES(1,0,0), (1,0,0);
+CREATE FULLTEXT INDEX idx1 ON t1 (title,body);
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+CREATE FULLTEXT INDEX idx1 ON t1 (title,body);
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+DROP TABLE t1;
+SET sql_mode = DEFAULT;
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
index f1e625037f3..4efab17d441 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
@@ -266,3 +266,15 @@ t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
+#
+# MDEV-25271 Double free of table when inplace alter
+# FTS add index fails
+#
+call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
+call mtr.add_suppression("InnoDB: Error number .* means");
+call mtr.add_suppression("InnoDB: Cannot create file");
+call mtr.add_suppression("InnoDB: Failed to create");
+CREATE TABLE t1(a TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL UNIQUE) ENGINE=InnoDB;
+ALTER TABLE t1 ADD FULLTEXT(a), ALGORITHM=INPLACE;
+ERROR HY000: Got error 11 "Resource temporarily unavailable" from storage engine InnoDB
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result
index e039b7e77d9..42730d7916a 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result
@@ -962,3 +962,34 @@ UPDATE t1 SET f6='cascade';
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_3` FOREIGN KEY (`f5`) REFERENCES `t1` (`f6`) ON UPDATE SET NULL)
DROP TABLE t1;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
+#
+# MDEV-25536 sym_node->table != NULL in pars_retrieve_table_def
+#
+CREATE TABLE t1 (f1 TEXT,FULLTEXT (f1)) ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+SET GLOBAL innodb_ft_aux_table='test/t1';
+SELECT * FROM information_schema.innodb_ft_deleted;
+DOC_ID
+DROP TABLE t1;
+SET GLOBAL innodb_ft_aux_table=DEFAULT;
+#
+# MDEV-19522 InnoDB commit fails when FTS_DOC_ID value
+# is greater than 4294967295
+#
+CREATE TABLE t1(
+FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
+f1 TEXT, f2 TEXT, PRIMARY KEY (FTS_DOC_ID),
+FULLTEXT KEY (f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,'txt','bbb');
+UPDATE t1 SET FTS_DOC_ID = 4294967298;
+SELECT * FROM t1 WHERE match(f1) against("txt");
+FTS_DOC_ID f1 f2
+4294967298 txt bbb
+SET @@session.insert_id = 100000000000;
+INSERT INTO t1(f1, f2) VALUES ('aaa', 'bbb');
+CREATE FULLTEXT INDEX i ON t1 (f2);
+SELECT * FROM t1 WHERE match(f2) against("bbb");
+FTS_DOC_ID f1 f2
+4294967298 txt bbb
+100000000000 aaa bbb
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/r/misc_debug.result b/mysql-test/suite/innodb_fts/r/misc_debug.result
index b162b2f7415..70b239bb189 100644
--- a/mysql-test/suite/innodb_fts/r/misc_debug.result
+++ b/mysql-test/suite/innodb_fts/r/misc_debug.result
@@ -31,19 +31,17 @@ DROP TABLE t2, t1;
#
CREATE TABLE t1(a INT, b TEXT, c TEXT, FULLTEXT INDEX(b)) ENGINE=InnoDB;
connect con1,localhost,root,,test;
-SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL s1 WAIT_FOR g1';
+SET DEBUG_DBUG="+d,innodb_OOM_inplace_alter";
SET DEBUG_SYNC='innodb_commit_inplace_alter_table_enter SIGNAL s2 WAIT_FOR g2';
ALTER TABLE t1 ADD FULLTEXT(c);
connection default;
-SET DEBUG_SYNC='now WAIT_FOR s1';
-KILL QUERY @id;
-SET DEBUG_SYNC='now SIGNAL g1 WAIT_FOR s2';
+SET DEBUG_SYNC='now WAIT_FOR s2';
START TRANSACTION;
SELECT * FROM t1;
a b c
-SET DEBUG_SYNC='now SIGNAL s2';
+SET DEBUG_SYNC='now SIGNAL g2';
connection con1;
-ERROR 70100: Query execution was interrupted
+ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
disconnect con1;
connection default;
SET DEBUG_SYNC=RESET;
diff --git a/mysql-test/suite/innodb_fts/t/basic.test b/mysql-test/suite/innodb_fts/t/basic.test
index 7a5c83ffb06..53ad978a5b1 100644
--- a/mysql-test/suite/innodb_fts/t/basic.test
+++ b/mysql-test/suite/innodb_fts/t/basic.test
@@ -277,9 +277,7 @@ insert into t1(f1, f2) values(3, "This is the third record");
select FTS_DOC_ID from t1;
drop table t1;
-call mtr.add_suppression("\\[ERROR\\] InnoDB: Doc ID 20030101000000 is too big. Its difference with largest used Doc ID 0 cannot exceed or equal to 65535");
CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200), FULLTEXT(title)) ENGINE=InnoDB;
---error 182
INSERT INTO t1 VALUES (NULL, NULL), (20030101000000, 20030102000000);
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/t/bug_32831765.test b/mysql-test/suite/innodb_fts/t/bug_32831765.test
new file mode 100644
index 00000000000..a4551cf91ef
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/bug_32831765.test
@@ -0,0 +1,164 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/big_test.inc
+
+--echo #
+--echo # Bug#32831765 SERVER HITS OOM CONDITION WHEN LOADING TWO
+--echo # INNODB TABLES WITH FTS INDEXES
+--echo #
+
+create table t1 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text,
+`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07`
+text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text,
+`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18`
+text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text,
+`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29`
+text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY
+(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY
+(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY
+(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY
+(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY
+(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY
+(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY
+(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY
+(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY
+(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY
+(`col29`), FULLTEXT KEY (`col30`)) engine=innodb;
+
+create table t2 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text,
+`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07`
+text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text,
+`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18`
+text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text,
+`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29`
+text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY
+(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY
+(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY
+(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY
+(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY
+(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY
+(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY
+(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY
+(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY
+(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY
+(`col29`), FULLTEXT KEY (`col30`)) engine=innodb;
+
+
+create table t3 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text,
+`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07`
+text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text,
+`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18`
+text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text,
+`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29`
+text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY
+(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY
+(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY
+(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY
+(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY
+(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY
+(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY
+(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY
+(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY
+(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY
+(`col29`), FULLTEXT KEY (`col30`)) engine=innodb;
+
+create table t4 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text,
+`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07`
+text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text,
+`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18`
+text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text,
+`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29`
+text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY
+(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY
+(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY
+(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY
+(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY
+(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY
+(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY
+(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY
+(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY
+(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY
+(`col29`), FULLTEXT KEY (`col30`)) engine=innodb;
+
+delimiter |;
+
+--echo #create procedure to inset into the table.
+CREATE PROCEDURE `proc_insert`(IN tab_name VARCHAR(40))
+BEGIN
+ DECLARE i INT DEFAULT 1;
+ SET @insert_tbl =CONCAT('INSERT INTO ', tab_name, '( `col01`, `col02`,
+ `col03`, `col04`, `col05`, `col06`, `col07`, `col08`, `col09`, `col10`,
+ `col11`, `col12`, `col13`, `col14`, `col15`, `col16`, `col17`, `col18`,
+ `col19`, `col20`, `col21`, `col22`, `col23`, `col24`, `col25`, `col26`,
+ `col27`, `col28`, `col29`, `col30`)
+ VALUES ( MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()),
+ MD5(RAND()))');
+ PREPARE ins_stmt FROM @insert_tbl;
+ while (i <= 2000) DO
+ EXECUTE ins_stmt;
+ SET i = i + 1;
+ END WHILE;
+ DEALLOCATE PREPARE ins_stmt;
+END |
+
+delimiter ;|
+
+# Ensure that the number of SYNC requests will not exceed 1000.
+SET @save_dbug= @@GLOBAL.debug_dbug;
+SET GLOBAL debug_dbug="+d,fts_optimize_wq_count_check";
+
+connect (con1,localhost,root,,);
+send call proc_insert('t1');
+connect (con2,localhost,root,,);
+send call proc_insert('t1');
+connect (con3,localhost,root,,);
+send call proc_insert('t2');
+connect (con4,localhost,root,,);
+send call proc_insert('t2');
+connect (con5,localhost,root,,);
+send call proc_insert('t3');
+connect (con6,localhost,root,,);
+send call proc_insert('t3');
+connect (con7,localhost,root,,);
+send call proc_insert('t4');
+
+connection default;
+call proc_insert('t4');
+SET GLOBAL debug_dbug= @save_dbug;
+
+connection con1;
+reap;
+disconnect con1;
+
+connection con2;
+reap;
+disconnect con2;
+
+connection con3;
+reap;
+disconnect con3;
+
+connection con4;
+reap;
+disconnect con4;
+
+connection con5;
+reap;
+disconnect con5;
+
+connection con6;
+reap;
+disconnect con6;
+
+connection con7;
+reap;
+disconnect con7;
+
+connection default;
+DROP TABLE t1,t2,t3,t4;
+DROP PROCEDURE proc_insert;
diff --git a/mysql-test/suite/innodb_fts/t/fulltext.test b/mysql-test/suite/innodb_fts/t/fulltext.test
index 663b202265b..1533c573ebf 100644
--- a/mysql-test/suite/innodb_fts/t/fulltext.test
+++ b/mysql-test/suite/innodb_fts/t/fulltext.test
@@ -717,3 +717,17 @@ while ($N)
}
DROP TABLE t;
+
+--echo #
+--echo # MDEV-25295 Aborted FTS_DOC_ID_INDEX considered as
+--echo # existing FTS_DOC_ID_INDEX during DDL
+--echo #
+SET sql_mode='';
+CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL,title CHAR(1),body TEXT)engine=innodb;
+INSERT INTO t1 (FTS_DOC_ID,title,body)VALUES(1,0,0), (1,0,0);
+--error ER_DUP_ENTRY
+CREATE FULLTEXT INDEX idx1 ON t1 (title,body);
+--error ER_DUP_ENTRY
+CREATE FULLTEXT INDEX idx1 ON t1 (title,body);
+DROP TABLE t1;
+SET sql_mode = DEFAULT;
diff --git a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt
new file mode 100644
index 00000000000..e6ae8d0fe0a
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt
@@ -0,0 +1 @@
+--enable-plugin-innodb-sys-tables
diff --git a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
index e055acc4968..824e719b7a8 100644
--- a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
+++ b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
@@ -319,3 +319,23 @@ ALTER TABLE t1 ADD FTS_DOC_ID INT UNSIGNED NOT NULL, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-25271 Double free of table when inplace alter
+--echo # FTS add index fails
+--echo #
+call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
+call mtr.add_suppression("InnoDB: Error number .* means");
+call mtr.add_suppression("InnoDB: Cannot create file");
+call mtr.add_suppression("InnoDB: Failed to create");
+
+let MYSQLD_DATADIR=`select @@datadir`;
+CREATE TABLE t1(a TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL UNIQUE) ENGINE=InnoDB;
+let $fts_aux_file= `select concat('FTS_',right(concat(repeat('0',16), lower(hex(TABLE_ID))),16),'_BEING_DELETED.ibd') FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test/t1'`;
+write_file $MYSQLD_DATADIR/test/$fts_aux_file;
+EOF
+--error ER_GET_ERRNO
+ALTER TABLE t1 ADD FULLTEXT(a), ALGORITHM=INPLACE;
+DROP TABLE t1;
+remove_file $MYSQLD_DATADIR/test/$fts_aux_file;
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.opt b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.opt
new file mode 100644
index 00000000000..b38416a0349
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.opt
@@ -0,0 +1 @@
+--innodb-ft-deleted
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test
index 46b65590298..b0bf2c669ad 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test
@@ -932,3 +932,31 @@ UPDATE t1 SET f6='cascade';
DROP TABLE t1;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
+
+--echo #
+--echo # MDEV-25536 sym_node->table != NULL in pars_retrieve_table_def
+--echo #
+CREATE TABLE t1 (f1 TEXT,FULLTEXT (f1)) ENGINE=InnoDB;
+ALTER TABLE t1 DISCARD TABLESPACE;
+SET GLOBAL innodb_ft_aux_table='test/t1';
+SELECT * FROM information_schema.innodb_ft_deleted;
+DROP TABLE t1;
+SET GLOBAL innodb_ft_aux_table=DEFAULT;
+
+--echo #
+--echo # MDEV-19522 InnoDB commit fails when FTS_DOC_ID value
+--echo # is greater than 4294967295
+--echo #
+CREATE TABLE t1(
+ FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ f1 TEXT, f2 TEXT, PRIMARY KEY (FTS_DOC_ID),
+ FULLTEXT KEY (f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,'txt','bbb');
+UPDATE t1 SET FTS_DOC_ID = 4294967298;
+SELECT * FROM t1 WHERE match(f1) against("txt");
+SET @@session.insert_id = 100000000000;
+INSERT INTO t1(f1, f2) VALUES ('aaa', 'bbb');
+CREATE FULLTEXT INDEX i ON t1 (f2);
+SELECT * FROM t1 WHERE match(f2) against("bbb");
+# Cleanup
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/t/misc_debug.test b/mysql-test/suite/innodb_fts/t/misc_debug.test
index 461e3f1d9d4..e42fc09bcd5 100644
--- a/mysql-test/suite/innodb_fts/t/misc_debug.test
+++ b/mysql-test/suite/innodb_fts/t/misc_debug.test
@@ -60,20 +60,16 @@ DROP TABLE t2, t1;
--echo #
CREATE TABLE t1(a INT, b TEXT, c TEXT, FULLTEXT INDEX(b)) ENGINE=InnoDB;
connect(con1,localhost,root,,test);
-let $ID= `SELECT @id := CONNECTION_ID()`;
-SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL s1 WAIT_FOR g1';
+SET DEBUG_DBUG="+d,innodb_OOM_inplace_alter";
SET DEBUG_SYNC='innodb_commit_inplace_alter_table_enter SIGNAL s2 WAIT_FOR g2';
send ALTER TABLE t1 ADD FULLTEXT(c);
connection default;
-SET DEBUG_SYNC='now WAIT_FOR s1';
-let $ignore= `SELECT @id := $ID`;
-KILL QUERY @id;
-SET DEBUG_SYNC='now SIGNAL g1 WAIT_FOR s2';
+SET DEBUG_SYNC='now WAIT_FOR s2';
START TRANSACTION;
SELECT * FROM t1;
-SET DEBUG_SYNC='now SIGNAL s2';
+SET DEBUG_SYNC='now SIGNAL g2';
connection con1;
---error ER_QUERY_INTERRUPTED
+--error ER_OUT_OF_RESOURCES
reap;
disconnect con1;
connection default;
diff --git a/mysql-test/suite/innodb_gis/disabled.def b/mysql-test/suite/innodb_gis/disabled.def
index 8cae44a3607..bf500c1cb93 100644
--- a/mysql-test/suite/innodb_gis/disabled.def
+++ b/mysql-test/suite/innodb_gis/disabled.def
@@ -10,3 +10,5 @@
#
##############################################################################
+rtree_concurrent_srch : MDEV-15284 COUNT(*) mismatch
+rtree_recovery : MDEV-15284 COUNT(*) mismatch
diff --git a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
index bef144e6072..f550d6168e2 100644
--- a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
+++ b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
@@ -252,6 +252,16 @@ UNLOCK TABLES;
ALTER TABLE tab DISCARD TABLESPACE;
SELECT c1,ST_Astext(c2),ST_Astext(c4) FROM tab;
ERROR HY000: Tablespace has been discarded for table `tab`
+ERROR HY000: Internal error: Drop all secondary indexes before importing table test/tab when .cfg file is missing.
+Table Create Table
+tab CREATE TABLE `tab` (
+ `c1` int(11) NOT NULL,
+ `c2` point NOT NULL,
+ `c3` linestring NOT NULL,
+ `c4` polygon NOT NULL,
+ `c5` geometry NOT NULL,
+ PRIMARY KEY (`c2`(25))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
CHECK TABLE tab;
Table Op Msg_type Msg_text
test.tab check status OK
@@ -282,9 +292,6 @@ INSERT INTO tab SELECT * FROM tab1;
ALTER TABLE tab DROP PRIMARY KEY;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
-ALTER TABLE tab DROP INDEX idx2;
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
CREATE TEMPORARY TABLE temp_tab AS SELECT * FROM tab where c1 = c2;
INSERT INTO temp_tab SELECT * FROM tab;
@@ -322,18 +329,10 @@ tab CREATE TABLE `tab` (
`c2` point NOT NULL,
`c3` linestring NOT NULL,
`c4` polygon NOT NULL,
- `c5` geometry NOT NULL,
- SPATIAL KEY `idx3` (`c3`),
- SPATIAL KEY `idx4` (`c4`) COMMENT 'testing spatial index on Polygon',
- SPATIAL KEY `idx5` (`c5`) COMMENT 'testing spatial index on Geometry',
- KEY `idx6` (`c4`(10)) USING BTREE
+ `c5` geometry NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW INDEX FROM tab;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-tab 1 idx3 1 c3 A # 32 NULL SPATIAL
-tab 1 idx4 1 c4 A # 32 NULL SPATIAL testing spatial index on Polygon
-tab 1 idx5 1 c5 A # 32 NULL SPATIAL testing spatial index on Geometry
-tab 1 idx6 1 c4 A # 10 NULL BTREE
DELETE FROM tab;
ALTER TABLE tab ADD PRIMARY KEY(c2);
affected rows: 0
@@ -354,20 +353,12 @@ tab CREATE TABLE `tab` (
`c5` geometry NOT NULL,
PRIMARY KEY (`c2`(25)),
UNIQUE KEY `const_1` (`c2`(25)),
- SPATIAL KEY `idx3` (`c3`),
- SPATIAL KEY `idx4` (`c4`) COMMENT 'testing spatial index on Polygon',
- SPATIAL KEY `idx5` (`c5`) COMMENT 'testing spatial index on Geometry',
- KEY `idx6` (`c4`(10)) USING BTREE,
SPATIAL KEY `idx2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW INDEX FROM tab;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tab 0 PRIMARY 1 c2 A # 25 NULL BTREE
tab 0 const_1 1 c2 A # 25 NULL BTREE
-tab 1 idx3 1 c3 A # 32 NULL SPATIAL
-tab 1 idx4 1 c4 A # 32 NULL SPATIAL testing spatial index on Polygon
-tab 1 idx5 1 c5 A # 32 NULL SPATIAL testing spatial index on Geometry
-tab 1 idx6 1 c4 A # 10 NULL BTREE
tab 1 idx2 1 c2 A # 32 NULL SPATIAL
INSERT INTO tab(c1,c2,c3,c4,c5)
VALUES(1,ST_GeomFromText('POINT(10 10)'),ST_GeomFromText('LINESTRING(5 5,20 20,30 30)'),
@@ -396,20 +387,12 @@ tab CREATE TABLE `tab` (
`c5` geometry NOT NULL,
PRIMARY KEY (`c5`(10)),
UNIQUE KEY `const_1` (`c5`(10)),
- SPATIAL KEY `idx3` (`c3`),
- SPATIAL KEY `idx4` (`c4`) COMMENT 'testing spatial index on Polygon',
- SPATIAL KEY `idx5` (`c5`) COMMENT 'testing spatial index on Geometry',
- KEY `idx6` (`c4`(10)) USING BTREE,
SPATIAL KEY `idx2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW INDEX FROM tab;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
tab 0 PRIMARY 1 c5 A # 10 NULL BTREE
tab 0 const_1 1 c5 A # 10 NULL BTREE
-tab 1 idx3 1 c3 A # 32 NULL SPATIAL
-tab 1 idx4 1 c4 A # 32 NULL SPATIAL testing spatial index on Polygon
-tab 1 idx5 1 c5 A # 32 NULL SPATIAL testing spatial index on Geometry
-tab 1 idx6 1 c4 A # 10 NULL BTREE
tab 1 idx2 1 c2 A # 32 NULL SPATIAL
INSERT INTO tab(c1,c2,c3,c4,c5)
VALUES(1,ST_GeomFromText('POINT(10 10)'),ST_GeomFromText('LINESTRING(5 5,20 20,30 30)'),
diff --git a/mysql-test/suite/innodb_gis/r/gis.result b/mysql-test/suite/innodb_gis/r/gis.result
index 33e0c1c0410..3a1a1aa28fd 100644
--- a/mysql-test/suite/innodb_gis/r/gis.result
+++ b/mysql-test/suite/innodb_gis/r/gis.result
@@ -1482,10 +1482,21 @@ FROM buildings, bridges
WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1;
count(*)
1
-DROP DATABASE gis_ogs;
#
# Bug#13362660 ASSERTION `FIELD_POS < FIELD_COUNT' FAILED. IN PROTOCOL_TEXT::STORE
#
SELECT ST_Union('', ''), md5(1);
ST_Union('', '') md5(1)
NULL c4ca4238a0b923820dcc509a6f75849b
+#
+# MDEV-25758 InnoDB spatial indexes miss large geometry
+# fields after MDEV-25459
+#
+CREATE TABLE t1(l LINESTRING NOT NULL, SPATIAL INDEX(l))ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SELECT GROUP_CONCAT(CONCAT(seq, ' ', seq) SEPARATOR ',') INTO @g FROM seq_0_to_190;
+INSERT INTO t1 SET l=ST_GeomFromText(CONCAT('LINESTRING(',@g,',0 0)'));
+SELECT COUNT(*) FROM t1 WHERE MBRIntersects(GeomFromText('Polygon((0 0,0 10,10 10,10 0,0 0))'), l);
+COUNT(*)
+1
+DROP TABLE t1;
+DROP DATABASE gis_ogs;
diff --git a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
index c4cd100c7e3..cd148820e85 100644
--- a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
+++ b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
@@ -277,8 +277,17 @@ SELECT c1,ST_Astext(c2),ST_Astext(c4) FROM tab;
--disable_query_log
+--error ER_INTERNAL_ERROR
ALTER TABLE tab IMPORT TABLESPACE;
+ALTER TABLE tab DROP INDEX idx2;
+ALTER TABLE tab DROP INDEX idx3;
+ALTER TABLE tab DROP INDEX idx4;
+ALTER TABLE tab DROP INDEX idx5;
+ALTER TABLE tab DROP INDEX idx6;
+
+SHOW CREATE TABLE tab;
+ALTER TABLE tab IMPORT TABLESPACE;
--enable_query_log
CHECK TABLE tab;
@@ -308,7 +317,6 @@ INSERT INTO tab SELECT * FROM tab1;
--enable_info
ALTER TABLE tab DROP PRIMARY KEY;
-ALTER TABLE tab DROP INDEX idx2;
--disable_info
# Check spatial index on temp tables
diff --git a/mysql-test/suite/innodb_gis/t/gis.test b/mysql-test/suite/innodb_gis/t/gis.test
index ba1b3b12ec2..acc2b1e36d8 100644
--- a/mysql-test/suite/innodb_gis/t/gis.test
+++ b/mysql-test/suite/innodb_gis/t/gis.test
@@ -2,6 +2,7 @@
--source include/have_innodb.inc
-- source include/have_geometry.inc
+--source include/have_sequence.inc
SET default_storage_engine=InnoDB;
@@ -1422,10 +1423,20 @@ WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1;
#FROM lakes
#WHERE lakes.name = 'Blue Lake';
-DROP DATABASE gis_ogs;
-
--echo #
--echo # Bug#13362660 ASSERTION `FIELD_POS < FIELD_COUNT' FAILED. IN PROTOCOL_TEXT::STORE
--echo #
SELECT ST_Union('', ''), md5(1);
+
+--echo #
+--echo # MDEV-25758 InnoDB spatial indexes miss large geometry
+--echo # fields after MDEV-25459
+--echo #
+CREATE TABLE t1(l LINESTRING NOT NULL, SPATIAL INDEX(l))ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SELECT GROUP_CONCAT(CONCAT(seq, ' ', seq) SEPARATOR ',') INTO @g FROM seq_0_to_190;
+INSERT INTO t1 SET l=ST_GeomFromText(CONCAT('LINESTRING(',@g,',0 0)'));
+SELECT COUNT(*) FROM t1 WHERE MBRIntersects(GeomFromText('Polygon((0 0,0 10,10 10,10 0,0 0))'), l);
+DROP TABLE t1;
+
+DROP DATABASE gis_ogs;
diff --git a/mysql-test/suite/innodb_zip/r/innochecksum_3.result b/mysql-test/suite/innodb_zip/r/innochecksum_3.result
index aaab68b3df9..46fe282ee15 100644
--- a/mysql-test/suite/innodb_zip/r/innochecksum_3.result
+++ b/mysql-test/suite/innodb_zip/r/innochecksum_3.result
@@ -210,10 +210,10 @@ Filename::tab#.ibd
# allow-mismatches,page,start-page,end-page
[9]: check the both short and long options "page" and "start-page" when
# seek value is larger than file size.
-FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
-FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
-FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
-FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
+FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err
+FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err
+FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err
+FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err
[34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page.
# innochecksum will fail with error code: 1
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
diff --git a/mysql-test/suite/innodb_zip/t/innochecksum_3.test b/mysql-test/suite/innodb_zip/t/innochecksum_3.test
index dab10dcc997..6d14d4c334e 100644
--- a/mysql-test/suite/innodb_zip/t/innochecksum_3.test
+++ b/mysql-test/suite/innodb_zip/t/innochecksum_3.test
@@ -339,22 +339,19 @@ cat_file $MYSQLTEST_VARDIR/tmp/dump.txt;
--echo # seek value is larger than file size.
--error 1
--exec $INNOCHECKSUM --page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
-let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
+let SEARCH_PATTERN= Error: Unable to seek to necessary offset;
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -p 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
-let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM --start-page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
-let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
--source include/search_pattern_in_file.inc
--error 1
--exec $INNOCHECKSUM -s 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
-let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
--source include/search_pattern_in_file.inc
--echo [34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page.
diff --git a/mysql-test/suite/mariabackup/auth_plugin_win.result b/mysql-test/suite/mariabackup/auth_plugin_win.result
index 7a623be147f..caf5d8df87d 100644
--- a/mysql-test/suite/mariabackup/auth_plugin_win.result
+++ b/mysql-test/suite/mariabackup/auth_plugin_win.result
@@ -1,5 +1,5 @@
INSTALL SONAME 'auth_named_pipe';
CREATE USER 'USERNAME' IDENTIFIED WITH named_pipe;
-GRANT ALL PRIVILEGES ON *.* to USERNAME;
+GRANT ALL PRIVILEGES ON *.* to 'USERNAME';
DROP USER 'USERNAME';
UNINSTALL SONAME 'auth_named_pipe';
diff --git a/mysql-test/suite/mariabackup/auth_plugin_win.test b/mysql-test/suite/mariabackup/auth_plugin_win.test
index 9c8cd5ad411..70ae74b7028 100644
--- a/mysql-test/suite/mariabackup/auth_plugin_win.test
+++ b/mysql-test/suite/mariabackup/auth_plugin_win.test
@@ -18,7 +18,7 @@ INSTALL SONAME 'auth_named_pipe';
--replace_result $USERNAME USERNAME
eval CREATE USER '$USERNAME' IDENTIFIED WITH named_pipe;
--replace_result $USERNAME USERNAME
-eval GRANT ALL PRIVILEGES ON *.* to $USERNAME;
+eval GRANT ALL PRIVILEGES ON *.* to '$USERNAME';
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
--disable_result_log
diff --git a/mysql-test/suite/mariabackup/partition_partial.test b/mysql-test/suite/mariabackup/partition_partial.test
index 8e288ec997f..7ccc42c036c 100644
--- a/mysql-test/suite/mariabackup/partition_partial.test
+++ b/mysql-test/suite/mariabackup/partition_partial.test
@@ -1,4 +1,5 @@
#--source include/innodb_page_size.inc
+--source include/have_partition.inc
# import partitioned table from table from partial backup
diff --git a/mysql-test/suite/perfschema/r/dml_accounts.result b/mysql-test/suite/perfschema/r/dml_accounts.result
index cbf9491f806..7e04bb3ea08 100644
--- a/mysql-test/suite/perfschema/r/dml_accounts.result
+++ b/mysql-test/suite/perfschema/r/dml_accounts.result
@@ -23,3 +23,14 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.accounts WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='accounts';
+column_name column_comment
+USER The connection's client user name for the connection, or NULL if an internal thread.
+HOST The connection client's host name, or NULL if an internal thread.
+CURRENT_CONNECTIONS Current connections for the account.
+TOTAL_CONNECTIONS Total connections for the account.
diff --git a/mysql-test/suite/perfschema/r/dml_cond_instances.result b/mysql-test/suite/perfschema/r/dml_cond_instances.result
index 0b7d4e7188e..d9baa2a2c0f 100644
--- a/mysql-test/suite/perfschema/r/dml_cond_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_cond_instances.result
@@ -18,3 +18,12 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.cond_instances WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'cond_instances'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='cond_instances';
+column_name column_comment
+NAME Client user name for the connection, or NULL if an internal thread.
+OBJECT_INSTANCE_BEGIN Address in memory of the instrumented condition.
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_by_account_by_event_name.result
index 7157e18bdfd..9081ee9dfdc 100644
--- a/mysql-test/suite/perfschema/r/dml_esgs_by_account_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esgs_by_account_by_event_name.result
@@ -24,3 +24,18 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_account_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_account_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_by_account_by_event_name';
+column_name column_comment
+USER User. Used together with HOST and EVENT_NAME for grouping events.
+HOST Host. Used together with USER and EVENT_NAME for grouping events.
+EVENT_NAME Event name. Used together with USER and HOST for grouping events.
+COUNT_STAR Number of summarized events, which includes all timed and untimed events.
+SUM_TIMER_WAIT Total wait time of the timed summarized events.
+MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
+AVG_TIMER_WAIT Average wait time of the timed summarized events.
+MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_by_host_by_event_name.result
index 7a157ead3c9..a8c3584fa6e 100644
--- a/mysql-test/suite/perfschema/r/dml_esgs_by_host_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esgs_by_host_by_event_name.result
@@ -24,3 +24,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_host_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_host_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_by_host_by_event_name';
+column_name column_comment
+HOST Host. Used together with EVENT_NAME for grouping events.
+EVENT_NAME Event name. Used together with HOST for grouping events.
+COUNT_STAR Number of summarized events, which includes all timed and untimed events.
+SUM_TIMER_WAIT Total wait time of the timed summarized events.
+MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
+AVG_TIMER_WAIT Average wait time of the timed summarized events.
+MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_by_thread_by_event_name.result
index 18b6214213a..4e0fe6c8f24 100644
--- a/mysql-test/suite/perfschema/r/dml_esgs_by_thread_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esgs_by_thread_by_event_name.result
@@ -24,3 +24,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_thread_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_thread_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_by_thread_by_event_name';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.
+EVENT_NAME Event name. Used together with THREAD_ID for grouping events.
+COUNT_STAR Number of summarized events, which includes all timed and untimed events.
+SUM_TIMER_WAIT Total wait time of the timed summarized events.
+MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
+AVG_TIMER_WAIT Average wait time of the timed summarized events.
+MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_by_user_by_event_name.result
index 0ff678ca5a4..bf492015fe4 100644
--- a/mysql-test/suite/perfschema/r/dml_esgs_by_user_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esgs_by_user_by_event_name.result
@@ -24,3 +24,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_user_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_user_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_by_user_by_event_name';
+column_name column_comment
+USER User. Used together with EVENT_NAME for grouping events.
+EVENT_NAME Event name. Used together with USER for grouping events.
+COUNT_STAR Number of summarized events, which includes all timed and untimed events.
+SUM_TIMER_WAIT Total wait time of the timed summarized events.
+MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
+AVG_TIMER_WAIT Average wait time of the timed summarized events.
+MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
diff --git a/mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result
index 07e127679b9..4fb98fdfdcc 100644
--- a/mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result
@@ -23,3 +23,16 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_global_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_global_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_global_by_event_name';
+column_name column_comment
+EVENT_NAME Event name.
+COUNT_STAR Number of summarized events, which includes all timed and untimed events.
+SUM_TIMER_WAIT Total wait time of the timed summarized events.
+MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
+AVG_TIMER_WAIT Average wait time of the timed summarized events.
+MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_by_account_by_event_name.result
index 57a9cd695dd..fdcf5f45c37 100644
--- a/mysql-test/suite/perfschema/r/dml_esms_by_account_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_account_by_event_name.result
@@ -24,3 +24,37 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_account_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_account_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_account_by_event_name';
+column_name column_comment
+USER User. Used together with HOST and EVENT_NAME for grouping events.
+HOST Host. Used together with USER and EVENT_NAME for grouping events.
+EVENT_NAME Event name. Used together with USER and HOST for grouping events.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_current table.
+SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
+SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
+SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
+SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
+SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
+SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
+SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
+SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
+SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.
+SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
+SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
+SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
+SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
+SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
+SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
+SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
+SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
+SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_digest.result b/mysql-test/suite/perfschema/r/dml_esms_by_digest.result
index f831b4c2e86..0d43041b502 100644
--- a/mysql-test/suite/perfschema/r/dml_esms_by_digest.result
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_digest.result
@@ -25,3 +25,39 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_digest WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_digest'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_digest';
+column_name column_comment
+SCHEMA_NAME Database name. Records are summarised together with DIGEST.
+DIGEST Performance Schema digest. Records are summarised together with SCHEMA NAME.
+DIGEST_TEXT The unhashed form of the digest.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_current table.
+SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
+SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
+SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
+SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
+SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
+SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
+SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
+SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
+SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.
+SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
+SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
+SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
+SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
+SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
+SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
+SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
+SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
+SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
+FIRST_SEEN Time at which the digest was first seen.
+LAST_SEEN Time at which the digest was most recently seen.
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_by_host_by_event_name.result
index d98f6a7e0d6..3d38c94ac52 100644
--- a/mysql-test/suite/perfschema/r/dml_esms_by_host_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_host_by_event_name.result
@@ -24,3 +24,36 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_host_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_host_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_host_by_event_name';
+column_name column_comment
+HOST Host. Used together with EVENT_NAME for grouping events.
+EVENT_NAME Event name. Used together with HOST for grouping events.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_currentd table.
+SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
+SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
+SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
+SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
+SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
+SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
+SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
+SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
+SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOINW column in the events_statements_current table.
+SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
+SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
+SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
+SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
+SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
+SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
+SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
+SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
+SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_by_thread_by_event_name.result
index 9573798349c..ef464440ebf 100644
--- a/mysql-test/suite/perfschema/r/dml_esms_by_thread_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_thread_by_event_name.result
@@ -24,3 +24,36 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_thread_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_thread_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_thread_by_event_name';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.
+EVENT_NAME Event name. Used together with THREAD_ID for grouping events.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_current table.
+SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
+SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
+SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
+SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
+SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
+SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
+SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
+SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
+SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.
+SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
+SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
+SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
+SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
+SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
+SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
+SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
+SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
+SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_by_user_by_event_name.result
index 950af5ca8b7..e92d87b45ad 100644
--- a/mysql-test/suite/perfschema/r/dml_esms_by_user_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esms_by_user_by_event_name.result
@@ -24,3 +24,36 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_user_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_user_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_user_by_event_name';
+column_name column_comment
+USER User. Used together with EVENT_NAME for grouping events.
+EVENT_NAME Event name. Used together with USER for grouping events.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_current table.
+SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
+SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
+SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
+SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
+SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
+SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
+SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
+SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
+SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.
+SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
+SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
+SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
+SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
+SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
+SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
+SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
+SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
+SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
diff --git a/mysql-test/suite/perfschema/r/dml_esms_global_by_event_name.result b/mysql-test/suite/perfschema/r/dml_esms_global_by_event_name.result
index e5623ed131d..14c1026fedd 100644
--- a/mysql-test/suite/perfschema/r/dml_esms_global_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_esms_global_by_event_name.result
@@ -23,3 +23,35 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_global_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_global_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_global_by_event_name';
+column_name column_comment
+EVENT_NAME Event name.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_current table.
+SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
+SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
+SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
+SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
+SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
+SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
+SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
+SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
+SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.
+SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
+SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
+SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
+SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
+SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
+SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
+SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
+SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
+SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
diff --git a/mysql-test/suite/perfschema/r/dml_events_stages_current.result b/mysql-test/suite/perfschema/r/dml_events_stages_current.result
index 7d0c3bed19c..326f87644ea 100644
--- a/mysql-test/suite/perfschema/r/dml_events_stages_current.result
+++ b/mysql-test/suite/perfschema/r/dml_events_stages_current.result
@@ -23,3 +23,20 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_current WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_current'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_current';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_ID uniquely identifies the row.
+EVENT_ID Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.
+END_EVENT_ID NULL when the event starts, set to the thread's current event number at the end of the event.
+EVENT_NAME Event instrument name and a NAME from the setup_instruments table
+SOURCE Name and line number of the source file containing the instrumented code that produced the event.
+TIMER_START Value in picoseconds when the event timing started or NULL if timing is not collected.
+TIMER_END Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.
+TIMER_WAIT Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected.
+NESTING_EVENT_ID EVENT_ID of event within which this event nests.
+NESTING_EVENT_TYPE Nesting event type. Either statement, stage or wait.
diff --git a/mysql-test/suite/perfschema/r/dml_events_stages_history.result b/mysql-test/suite/perfschema/r/dml_events_stages_history.result
index 66047e9615b..b00963e5bd9 100644
--- a/mysql-test/suite/perfschema/r/dml_events_stages_history.result
+++ b/mysql-test/suite/perfschema/r/dml_events_stages_history.result
@@ -27,3 +27,20 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_history WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_history'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_history';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_ID uniquely identifies the row.
+EVENT_ID Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.
+END_EVENT_ID NULL when the event starts, set to the thread's current event number at the end of the event.
+EVENT_NAME Event instrument name and a NAME from the setup_instruments table
+SOURCE Name and line number of the source file containing the instrumented code that produced the event.
+TIMER_START Value in picoseconds when the event timing started or NULL if timing is not collected.
+TIMER_END Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.
+TIMER_WAIT Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected.
+NESTING_EVENT_ID EVENT_ID of event within which this event nests.
+NESTING_EVENT_TYPE Nesting event type. Either statement, stage or wait.
diff --git a/mysql-test/suite/perfschema/r/dml_events_stages_history_long.result b/mysql-test/suite/perfschema/r/dml_events_stages_history_long.result
index da1fae71aa5..9c20113b2af 100644
--- a/mysql-test/suite/perfschema/r/dml_events_stages_history_long.result
+++ b/mysql-test/suite/perfschema/r/dml_events_stages_history_long.result
@@ -27,3 +27,20 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_history_long WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_history_long'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_history_long';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_ID uniquely identifies the row.
+EVENT_ID Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.
+END_EVENT_ID NULL when the event starts, set to the thread's current event number at the end of the event.
+EVENT_NAME Event instrument name and a NAME from the setup_instruments table
+SOURCE Name and line number of the source file containing the instrumented code that produced the event.
+TIMER_START Value in picoseconds when the event timing started or NULL if timing is not collected.
+TIMER_END Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.
+TIMER_WAIT Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected.
+NESTING_EVENT_ID EVENT_ID of event within which this event nests.
+NESTING_EVENT_TYPE Nesting event type. Either statement, stage or wait.
diff --git a/mysql-test/suite/perfschema/r/dml_events_statements_current.result b/mysql-test/suite/perfschema/r/dml_events_statements_current.result
index af18f0bba79..5f3b0f221c0 100644
--- a/mysql-test/suite/perfschema/r/dml_events_statements_current.result
+++ b/mysql-test/suite/perfschema/r/dml_events_statements_current.result
@@ -23,3 +23,50 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_current WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_current'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_current';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_ID uniquely identifies the row.
+EVENT_ID Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.
+END_EVENT_ID NULL when the event starts, set to the thread's current event number at the end of the event.
+EVENT_NAME Event instrument name and a NAME from the setup_instruments table
+SOURCE Name and line number of the source file containing the instrumented code that produced the event.
+TIMER_START Value in picoseconds when the event timing started or NULL if timing is not collected.
+TIMER_END Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.
+TIMER_WAIT Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected.
+LOCK_TIME Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.
+SQL_TEXT The SQL statement, or NULL if the command is not associated with an SQL statement.
+DIGEST Statement digest.
+DIGEST_TEXT Statement digest text.
+CURRENT_SCHEMA Statement's default database for the statement, or NULL if there was none.
+OBJECT_TYPE Reserved, currently NULL
+OBJECT_SCHEMA Reserved, currently NULL
+OBJECT_NAME Reserved, currently NULL
+OBJECT_INSTANCE_BEGIN Address in memory of the statement object.
+MYSQL_ERRNO Error code. See MariaDB Error Codes for a full list.
+RETURNED_SQLSTATE The SQLSTATE value.
+MESSAGE_TEXT Statement error message. See MariaDB Error Codes.
+ERRORS 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.
+WARNINGS Number of warnings from the diagnostics area.
+ROWS_AFFECTED Number of rows affected the statement affected.
+ROWS_SENT Number of rows returned.
+ROWS_EXAMINED Number of rows read during the statement's execution.
+CREATED_TMP_DISK_TABLES Number of on-disk temp tables created by the statement.
+CREATED_TMP_TABLES Number of temp tables created by the statement.
+SELECT_FULL_JOIN Number of joins performed by the statement which did not use an index.
+SELECT_FULL_RANGE_JOIN Number of joins performed by the statement which used a range search of the first table.
+SELECT_RANGE Number of joins performed by the statement which used a range of the first table.
+SELECT_RANGE_CHECK Number of joins without keys performed by the statement that check for key usage after each row.
+SELECT_SCAN Number of joins performed by the statement which used a full scan of the first table.
+SORT_MERGE_PASSES Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.
+SORT_RANGE Number of sorts performed by the statement which used a range.
+SORT_ROWS Number of rows sorted by the statement.
+SORT_SCAN Number of sorts performed by the statement which used a full table scan.
+NO_INDEX_USED 0 if the statement performed a table scan with an index, 1 if without an index.
+NO_GOOD_INDEX_USED 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.
+NESTING_EVENT_ID Reserved, currently NULL.
+NESTING_EVENT_TYPE Reserved, currently NULL.
diff --git a/mysql-test/suite/perfschema/r/dml_events_statements_history.result b/mysql-test/suite/perfschema/r/dml_events_statements_history.result
index 3f24f94196e..f5f77bfdfb5 100644
--- a/mysql-test/suite/perfschema/r/dml_events_statements_history.result
+++ b/mysql-test/suite/perfschema/r/dml_events_statements_history.result
@@ -27,3 +27,50 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_history WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_history'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_history';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_ID uniquely identifies the row.
+EVENT_ID Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.
+END_EVENT_ID NULL when the event starts, set to the thread's current event number at the end of the event.
+EVENT_NAME Event instrument name and a NAME from the setup_instruments table
+SOURCE Name and line number of the source file containing the instrumented code that produced the event.
+TIMER_START Value in picoseconds when the event timing started or NULL if timing is not collected.
+TIMER_END Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.
+TIMER_WAIT Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected.
+LOCK_TIME Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.
+SQL_TEXT The SQL statement, or NULL if the command is not associated with an SQL statement.
+DIGEST Statement digest.
+DIGEST_TEXT Statement digest text.
+CURRENT_SCHEMA Statement's default database for the statement, or NULL if there was none.
+OBJECT_TYPE Reserved, currently NULL
+OBJECT_SCHEMA Reserved, currently NULL
+OBJECT_NAME Reserved, currently NULL
+OBJECT_INSTANCE_BEGIN Address in memory of the statement object.
+MYSQL_ERRNO Error code. See MariaDB Error Codes for a full list.
+RETURNED_SQLSTATE The SQLSTATE value.
+MESSAGE_TEXT Statement error message. See MariaDB Error Codes.
+ERRORS 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.
+WARNINGS Number of warnings from the diagnostics area.
+ROWS_AFFECTED Number of rows affected the statement affected.
+ROWS_SENT Number of rows returned.
+ROWS_EXAMINED Number of rows read during the statement's execution.
+CREATED_TMP_DISK_TABLES Number of on-disk temp tables created by the statement.
+CREATED_TMP_TABLES Number of temp tables created by the statement.
+SELECT_FULL_JOIN Number of joins performed by the statement which did not use an index.
+SELECT_FULL_RANGE_JOIN Number of joins performed by the statement which used a range search of the first table.
+SELECT_RANGE Number of joins performed by the statement which used a range of the first table.
+SELECT_RANGE_CHECK Number of joins without keys performed by the statement that check for key usage after each row.
+SELECT_SCAN Number of joins performed by the statement which used a full scan of the first table.
+SORT_MERGE_PASSES Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.
+SORT_RANGE Number of sorts performed by the statement which used a range.
+SORT_ROWS Number of rows sorted by the statement.
+SORT_SCAN Number of sorts performed by the statement which used a full table scan.
+NO_INDEX_USED 0 if the statement performed a table scan with an index, 1 if without an index.
+NO_GOOD_INDEX_USED 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.
+NESTING_EVENT_ID Reserved, currently NULL.
+NESTING_EVENT_TYPE Reserved, currently NULL.
diff --git a/mysql-test/suite/perfschema/r/dml_events_statements_history_long.result b/mysql-test/suite/perfschema/r/dml_events_statements_history_long.result
index 88634e93bb5..e8b58122b16 100644
--- a/mysql-test/suite/perfschema/r/dml_events_statements_history_long.result
+++ b/mysql-test/suite/perfschema/r/dml_events_statements_history_long.result
@@ -27,3 +27,50 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_history_long WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_history_long'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_history_long';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_ID uniquely identifies the row.
+EVENT_ID Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.
+END_EVENT_ID NULL when the event starts, set to the thread's current event number at the end of the event.
+EVENT_NAME Event instrument name and a NAME from the setup_instruments table
+SOURCE Name and line number of the source file containing the instrumented code that produced the event.
+TIMER_START Value in picoseconds when the event timing started or NULL if timing is not collected.
+TIMER_END Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.
+TIMER_WAIT Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected.
+LOCK_TIME Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.
+SQL_TEXT The SQL statement, or NULL if the command is not associated with an SQL statement.
+DIGEST Statement digest.
+DIGEST_TEXT Statement digest text.
+CURRENT_SCHEMA Statement's default database for the statement, or NULL if there was none.
+OBJECT_TYPE Reserved, currently NULL
+OBJECT_SCHEMA Reserved, currently NULL
+OBJECT_NAME Reserved, currently NULL
+OBJECT_INSTANCE_BEGIN Address in memory of the statement object.
+MYSQL_ERRNO Error code. See MariaDB Error Codes for a full list.
+RETURNED_SQLSTATE The SQLSTATE value.
+MESSAGE_TEXT Statement error message. See MariaDB Error Codes.
+ERRORS 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.
+WARNINGS Number of warnings from the diagnostics area.
+ROWS_AFFECTED Number of rows affected the statement affected.
+ROWS_SENT Number of rows returned.
+ROWS_EXAMINED Number of rows read during the statement's execution.
+CREATED_TMP_DISK_TABLES Number of on-disk temp tables created by the statement.
+CREATED_TMP_TABLES Number of temp tables created by the statement.
+SELECT_FULL_JOIN Number of joins performed by the statement which did not use an index.
+SELECT_FULL_RANGE_JOIN Number of joins performed by the statement which used a range search of the first table.
+SELECT_RANGE Number of joins performed by the statement which used a range of the first table.
+SELECT_RANGE_CHECK Number of joins without keys performed by the statement that check for key usage after each row.
+SELECT_SCAN Number of joins performed by the statement which used a full scan of the first table.
+SORT_MERGE_PASSES Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.
+SORT_RANGE Number of sorts performed by the statement which used a range.
+SORT_ROWS Number of rows sorted by the statement.
+SORT_SCAN Number of sorts performed by the statement which used a full table scan.
+NO_INDEX_USED 0 if the statement performed a table scan with an index, 1 if without an index.
+NO_GOOD_INDEX_USED 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.
+NESTING_EVENT_ID Reserved, currently NULL.
+NESTING_EVENT_TYPE Reserved, currently NULL.
diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_current.result b/mysql-test/suite/perfschema/r/dml_events_waits_current.result
index 53e2bc02bbb..0d9b343a852 100644
--- a/mysql-test/suite/perfschema/r/dml_events_waits_current.result
+++ b/mysql-test/suite/perfschema/r/dml_events_waits_current.result
@@ -23,3 +23,29 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_current WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_current'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_current';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_ID uniquely identifies the row.
+EVENT_ID Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.
+END_EVENT_ID NULL when the event starts, set to the thread's current event number at the end of the event.
+EVENT_NAME Event instrument name and a NAME from the setup_instruments table
+SOURCE Name and line number of the source file containing the instrumented code that produced the event.
+TIMER_START Value in picoseconds when the event timing started or NULL if timing is not collected.
+TIMER_END Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.
+TIMER_WAIT Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected.
+SPINS Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.
+OBJECT_SCHEMA Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.
+OBJECT_NAME File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object.
+INDEX_NAME Name of the index, PRIMARY for the primary key, or NULL for no index used.
+OBJECT_TYPE FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.
+OBJECT_INSTANCE_BEGIN Address in memory of the object.
+NESTING_EVENT_ID EVENT_ID of event within which this event nests.
+NESTING_EVENT_TYPE Nesting event type. Either statement, stage or wait.
+OPERATION Operation type, for example read, write or lock
+NUMBER_OF_BYTES Number of bytes that the operation read or wrote, or NULL for table I/O waits.
+FLAGS Reserved for use in the future.
diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history.result b/mysql-test/suite/perfschema/r/dml_events_waits_history.result
index 4beb51aeaf5..96d2b4b680e 100644
--- a/mysql-test/suite/perfschema/r/dml_events_waits_history.result
+++ b/mysql-test/suite/perfschema/r/dml_events_waits_history.result
@@ -27,3 +27,29 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_history WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_history';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_ID uniquely identifies the row.
+EVENT_ID Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.
+END_EVENT_ID NULL when the event starts, set to the thread's current event number at the end of the event.
+EVENT_NAME Event instrument name and a NAME from the setup_instruments table
+SOURCE Name and line number of the source file containing the instrumented code that produced the event.
+TIMER_START Value in picoseconds when the event timing started or NULL if timing is not collected.
+TIMER_END Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.
+TIMER_WAIT Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected.
+SPINS Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.
+OBJECT_SCHEMA Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.
+OBJECT_NAME File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object.
+INDEX_NAME Name of the index, PRIMARY for the primary key, or NULL for no index used.
+OBJECT_TYPE FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.
+OBJECT_INSTANCE_BEGIN Address in memory of the object.
+NESTING_EVENT_ID EVENT_ID of event within which this event nests.
+NESTING_EVENT_TYPE Nesting event type. Either statement, stage or wait.
+OPERATION Operation type, for example read, write or lock
+NUMBER_OF_BYTES Number of bytes that the operation read or wrote, or NULL for table I/O waits.
+FLAGS Reserved for use in the future.
diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
index 13571fbf513..99af65297ef 100644
--- a/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
@@ -27,3 +27,29 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_history_long WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_history_long'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_history_long';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_ID uniquely identifies the row.
+EVENT_ID Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.
+END_EVENT_ID NULL when the event starts, set to the thread's current event number at the end of the event.
+EVENT_NAME Event instrument name and a NAME from the setup_instruments table
+SOURCE Name and line number of the source file containing the instrumented code that produced the event.
+TIMER_START Value in picoseconds when the event timing started or NULL if timing is not collected.
+TIMER_END Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.
+TIMER_WAIT Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected.
+SPINS Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.
+OBJECT_SCHEMA Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.
+OBJECT_NAME File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object.
+INDEX_NAME Name of the index, PRIMARY for the primary key, or NULL for no index used.
+OBJECT_TYPE FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.
+OBJECT_INSTANCE_BEGIN Address in memory of the object.
+NESTING_EVENT_ID EVENT_ID of event within which this event nests.
+NESTING_EVENT_TYPE Nesting event type. Either statement, stage or wait.
+OPERATION Operation type, for example read, write or lock
+NUMBER_OF_BYTES Number of bytes that the operation read or wrote, or NULL for table I/O waits.
+FLAGS Reserved for use in the future.
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_account_by_event_name.result
index a4808251228..bfe9e29446b 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_by_account_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_account_by_event_name.result
@@ -27,3 +27,18 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_account_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_account_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_account_by_event_name';
+column_name column_comment
+USER User. Used together with HOST and EVENT_NAME for grouping events.
+HOST Host. Used together with USER and EVENT_NAME for grouping events.
+EVENT_NAME Event name. Used together with USER and HOST for grouping events.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_host_by_event_name.result
index 2a250eee5a5..dc717e8b7c5 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_by_host_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_host_by_event_name.result
@@ -27,3 +27,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_host_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_host_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_host_by_event_name';
+column_name column_comment
+HOST Host. Used together with EVENT_NAME for grouping events.
+EVENT_NAME Event name. Used together with USER and HOST for grouping events.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_instance.result b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result
index 17619918b01..a9686526a77 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_by_instance.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result
@@ -32,3 +32,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_instance WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_instance';
+column_name column_comment
+EVENT_NAME Event name. Used together with OBJECT_INSTANCE_BEGIN for grouping events.
+OBJECT_INSTANCE_BEGIN If an instrument creates multiple instances, each instance has a unique OBJECT_INSTANCE_BEGIN value to allow for grouping by instance.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
index 879abf90f4b..e974523df7c 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
@@ -24,3 +24,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_thread_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_thread_by_event_name';
+column_name column_comment
+THREAD_ID Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.
+EVENT_NAME Event name. Used together with THREAD_ID for grouping events.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_user_by_event_name.result
index 3fa3deedaef..6cfc44961b9 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_by_user_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_user_by_event_name.result
@@ -27,3 +27,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_user_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_by_user_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_user_by_event_name';
+column_name column_comment
+USER User. Used together with EVENT_NAME for grouping events.
+EVENT_NAME Event name. Used together with USER for grouping events.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
index ccf88c282b8..37a5a22795c 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
@@ -23,3 +23,16 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_global_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_global_by_event_name';
+column_name column_comment
+EVENT_NAME Event name.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_file_instances.result b/mysql-test/suite/perfschema/r/dml_file_instances.result
index d2564cb58dd..3ecbc18c0ad 100644
--- a/mysql-test/suite/perfschema/r/dml_file_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_file_instances.result
@@ -18,3 +18,13 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.file_instances WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='file_instances';
+column_name column_comment
+FILE_NAME File name.
+EVENT_NAME Instrument name associated with the file.
+OPEN_COUNT Open handles on the file. A value of greater than zero means that the file is currently open.
diff --git a/mysql-test/suite/perfschema/r/dml_fs_by_event_name.result b/mysql-test/suite/perfschema/r/dml_fs_by_event_name.result
index ffd63232631..15dededb288 100644
--- a/mysql-test/suite/perfschema/r/dml_fs_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_fs_by_event_name.result
@@ -23,3 +23,33 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.file_summary_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='file_summary_by_event_name';
+column_name column_comment
+EVENT_NAME Event name.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+COUNT_READ Number of all read operations, including FGETS, FGETC, FREAD, and READ.
+SUM_TIMER_READ Total wait time of all read operations that are timed.
+MIN_TIMER_READ Minimum wait time of all read operations that are timed.
+AVG_TIMER_READ Average wait time of all read operations that are timed.
+MAX_TIMER_READ Maximum wait time of all read operations that are timed.
+SUM_NUMBER_OF_BYTES_READ Bytes read by read operations.
+COUNT_WRITE Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE.
+SUM_TIMER_WRITE Total wait time of all write operations that are timed.
+MIN_TIMER_WRITE Minimum wait time of all write operations that are timed.
+AVG_TIMER_WRITE Average wait time of all write operations that are timed.
+MAX_TIMER_WRITE Maximum wait time of all write operations that are timed.
+SUM_NUMBER_OF_BYTES_WRITE Bytes written by write operations.
+COUNT_MISC Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC.
+SUM_TIMER_MISC Total wait time of all miscellaneous operations that are timed.
+MIN_TIMER_MISC Minimum wait time of all miscellaneous operations that are timed.
+AVG_TIMER_MISC Average wait time of all miscellaneous operations that are timed.
+MAX_TIMER_MISC Maximum wait time of all miscellaneous operations that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_fs_by_instance.result b/mysql-test/suite/perfschema/r/dml_fs_by_instance.result
index cde57dd19ce..39e871b0e50 100644
--- a/mysql-test/suite/perfschema/r/dml_fs_by_instance.result
+++ b/mysql-test/suite/perfschema/r/dml_fs_by_instance.result
@@ -23,3 +23,35 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.file_summary_by_instance WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='file_summary_by_instance';
+column_name column_comment
+FILE_NAME File name.
+EVENT_NAME Event name.
+OBJECT_INSTANCE_BEGIN Address in memory. Together with FILE_NAME and EVENT_NAME uniquely identifies a row.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+COUNT_READ Number of all read operations, including FGETS, FGETC, FREAD, and READ.
+SUM_TIMER_READ Total wait time of all read operations that are timed.
+MIN_TIMER_READ Minimum wait time of all read operations that are timed.
+AVG_TIMER_READ Average wait time of all read operations that are timed.
+MAX_TIMER_READ Maximum wait time of all read operations that are timed.
+SUM_NUMBER_OF_BYTES_READ Bytes read by read operations.
+COUNT_WRITE Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE.
+SUM_TIMER_WRITE Total wait time of all write operations that are timed.
+MIN_TIMER_WRITE Minimum wait time of all write operations that are timed.
+AVG_TIMER_WRITE Average wait time of all write operations that are timed.
+MAX_TIMER_WRITE Maximum wait time of all write operations that are timed.
+SUM_NUMBER_OF_BYTES_WRITE Bytes written by write operations.
+COUNT_MISC Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC.
+SUM_TIMER_MISC Total wait time of all miscellaneous operations that are timed.
+MIN_TIMER_MISC Minimum wait time of all miscellaneous operations that are timed.
+AVG_TIMER_MISC Average wait time of all miscellaneous operations that are timed.
+MAX_TIMER_MISC Maximum wait time of all miscellaneous operations that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_host_cache.result b/mysql-test/suite/perfschema/r/dml_host_cache.result
index a0ed1a3f3b1..1165be23804 100644
--- a/mysql-test/suite/perfschema/r/dml_host_cache.result
+++ b/mysql-test/suite/perfschema/r/dml_host_cache.result
@@ -25,3 +25,39 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.host_cache WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'host_cache'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='host_cache';
+column_name column_comment
+IP Client IP address.
+HOST IP's resolved DNS host name, or NULL if unknown.
+HOST_VALIDATED YES if the IP-to-host DNS lookup was successful, and the HOST column can be used to avoid DNS calls, or NO if unsuccessful, in which case DNS lookup is performed for each connect until either successful or a permanent error.
+SUM_CONNECT_ERRORS Number of connection errors. Counts only protocol handshake errors for hosts that passed validation. These errors count towards max_connect_errors.
+COUNT_HOST_BLOCKED_ERRORS Number of blocked connections because SUM_CONNECT_ERRORS exceeded the max_connect_errors system variable.
+COUNT_NAMEINFO_TRANSIENT_ERRORS Number of transient errors during IP-to-host DNS lookups.
+COUNT_NAMEINFO_PERMANENT_ERRORS Number of permanent errors during IP-to-host DNS lookups.
+COUNT_FORMAT_ERRORS Number of host name format errors, for example a numeric host column.
+COUNT_ADDRINFO_TRANSIENT_ERRORS Number of transient errors during host-to-IP reverse DNS lookups.
+COUNT_ADDRINFO_PERMANENT_ERRORS Number of permanent errors during host-to-IP reverse DNS lookups.
+COUNT_FCRDNS_ERRORS Number of forward-confirmed reverse DNS errors, which occur when IP-to-host DNS lookup does not match the originating IP address.
+COUNT_HOST_ACL_ERRORS Number of errors occurring because no user from the host is permitted to log in. These attempts return error code 1130 ER_HOST_NOT_PRIVILEGED and do not proceed to username and password authentication.
+COUNT_NO_AUTH_PLUGIN_ERRORS Number of errors due to requesting an authentication plugin that was not available. This can be due to the plugin never having been loaded, or the load attempt failing.
+COUNT_AUTH_PLUGIN_ERRORS Number of errors reported by an authentication plugin. Plugins can increment COUNT_AUTHENTICATION_ERRORS or COUNT_HANDSHAKE_ERRORS instead, but, if specified or the error is unknown, this column is incremented.
+COUNT_HANDSHAKE_ERRORS Number of errors detected at the wire protocol level.
+COUNT_PROXY_USER_ERRORS Number of errors detected when a proxy user is proxied to a user that does not exist.
+COUNT_PROXY_USER_ACL_ERRORS Number of errors detected when a proxy user is proxied to a user that exists, but the proxy user doesn't have the PROXY privilege.
+COUNT_AUTHENTICATION_ERRORS Number of errors where authentication failed.
+COUNT_SSL_ERRORS Number of errors due to TLS problems.
+COUNT_MAX_USER_CONNECTIONS_ERRORS Number of errors due to the per-user quota being exceeded.
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS Number of errors due to the per-hour quota being exceeded.
+COUNT_DEFAULT_DATABASE_ERRORS Number of errors due to the user not having permission to access the specified default database, or it not existing.
+COUNT_INIT_CONNECT_ERRORS Number of errors due to statements in the init_connect system variable.
+COUNT_LOCAL_ERRORS Number of local server errors, such as out-of-memory errors, unrelated to network, authentication, or authorization.
+COUNT_UNKNOWN_ERRORS Number of unknown errors that cannot be allocated to another column.
+FIRST_SEEN Timestamp of the first connection attempt by the IP.
+LAST_SEEN Timestamp of the most recent connection attempt by the IP.
+FIRST_ERROR_SEEN Timestamp of the first error seen from the IP.
+LAST_ERROR_SEEN Timestamp of the most recent error seen from the IP.
diff --git a/mysql-test/suite/perfschema/r/dml_hosts.result b/mysql-test/suite/perfschema/r/dml_hosts.result
index 8ae4e3b0984..e282110bf77 100644
--- a/mysql-test/suite/perfschema/r/dml_hosts.result
+++ b/mysql-test/suite/perfschema/r/dml_hosts.result
@@ -23,3 +23,13 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.hosts WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'hosts'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='hosts';
+column_name column_comment
+HOST Host name used by the client to connect, NULL for internal threads or user sessions that failed to authenticate.
+CURRENT_CONNECTIONS Current number of the host's connections.
+TOTAL_CONNECTIONS Total number of the host's connections
diff --git a/mysql-test/suite/perfschema/r/dml_mutex_instances.result b/mysql-test/suite/perfschema/r/dml_mutex_instances.result
index 03d2cfb1260..2f222118001 100644
--- a/mysql-test/suite/perfschema/r/dml_mutex_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_mutex_instances.result
@@ -18,3 +18,13 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.mutex_instances WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'mutex_instances'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='mutex_instances';
+column_name column_comment
+NAME Instrument name associated with the mutex.
+OBJECT_INSTANCE_BEGIN Memory address of the instrumented mutex.
+LOCKED_BY_THREAD_ID The THREAD_ID of the locking thread if a thread has a mutex locked, otherwise NULL.
diff --git a/mysql-test/suite/perfschema/r/dml_os_global_by_type.result b/mysql-test/suite/perfschema/r/dml_os_global_by_type.result
index 681ec364973..72ba764e7c3 100644
--- a/mysql-test/suite/perfschema/r/dml_os_global_by_type.result
+++ b/mysql-test/suite/perfschema/r/dml_os_global_by_type.result
@@ -43,3 +43,18 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.objects_summary_global_by_type WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'objects_summary_global_by_type'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='objects_summary_global_by_type';
+column_name column_comment
+OBJECT_TYPE Groups records together with OBJECT_SCHEMA and OBJECT_NAME.
+OBJECT_SCHEMA Groups records together with OBJECT_TYPE and OBJECT_NAME.
+OBJECT_NAME Groups records together with OBJECT_SCHEMA and OBJECT_TYPE.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_performance_timers.result b/mysql-test/suite/perfschema/r/dml_performance_timers.result
index 7e1d3005fb0..b1d4406137c 100644
--- a/mysql-test/suite/perfschema/r/dml_performance_timers.result
+++ b/mysql-test/suite/perfschema/r/dml_performance_timers.result
@@ -27,3 +27,14 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.performance_timers WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'performance_timers'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='performance_timers';
+column_name column_comment
+TIMER_NAME Time name, used in the setup_timers table.
+TIMER_FREQUENCY Number of timer units per second. Dependent on the processor speed.
+TIMER_RESOLUTION Number of timer units by which timed values increase each time.
+TIMER_OVERHEAD Minimum timer overhead, determined during initialization by calling the timer 20 times and selecting the smallest value. Total overhead will be at least double this, as the timer is called at the beginning and end of each timed event.
diff --git a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result
index e127ace2dfe..4ffe125dfd7 100644
--- a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result
@@ -18,3 +18,14 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.rwlock_instances WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'rwlock_instances'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='rwlock_instances';
+column_name column_comment
+NAME Instrument name associated with the read write lock
+OBJECT_INSTANCE_BEGIN Address in memory of the instrumented lock
+WRITE_LOCKED_BY_THREAD_ID THREAD_ID of the locking thread if locked in write (exclusive) mode, otherwise NULL.
+READ_LOCKED_BY_COUNT Count of current read locks held
diff --git a/mysql-test/suite/perfschema/r/dml_session_account_connect_attrs.result b/mysql-test/suite/perfschema/r/dml_session_account_connect_attrs.result
index 61b1cddd513..e79deb172b3 100644
--- a/mysql-test/suite/perfschema/r/dml_session_account_connect_attrs.result
+++ b/mysql-test/suite/perfschema/r/dml_session_account_connect_attrs.result
@@ -23,3 +23,14 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.session_account_connect_attrs WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'session_account_connect_attrs'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='session_account_connect_attrs';
+column_name column_comment
+PROCESSLIST_ID Session connection identifier.
+ATTR_NAME Attribute name.
+ATTR_VALUE Attribute value.
+ORDINAL_POSITION Order in which attribute was added to the connection attributes.
diff --git a/mysql-test/suite/perfschema/r/dml_session_connect_attrs.result b/mysql-test/suite/perfschema/r/dml_session_connect_attrs.result
index d1dea1472d4..c56af4a448d 100644
--- a/mysql-test/suite/perfschema/r/dml_session_connect_attrs.result
+++ b/mysql-test/suite/perfschema/r/dml_session_connect_attrs.result
@@ -23,3 +23,14 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.session_connect_attrs WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'session_connect_attrs'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='session_connect_attrs';
+column_name column_comment
+PROCESSLIST_ID Session connection identifier.
+ATTR_NAME Attribute name.
+ATTR_VALUE Attribute value.
+ORDINAL_POSITION Order in which attribute was added to the connection attributes.
diff --git a/mysql-test/suite/perfschema/r/dml_setup_actors.result b/mysql-test/suite/perfschema/r/dml_setup_actors.result
index 2d12300b7be..e487bb1995b 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_actors.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_actors.result
@@ -58,3 +58,13 @@ truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors
select * from test.setup_actors;
drop table test.setup_actors;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_actors';
+column_name column_comment
+HOST Host name, either a literal, or the % wildcard representing any host.
+USER User name, either a literal or the % wildcard representing any name.
+ROLE Unused
diff --git a/mysql-test/suite/perfschema/r/dml_setup_consumers.result b/mysql-test/suite/perfschema/r/dml_setup_consumers.result
index 8a1efeb455e..c8d4515583e 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_consumers.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_consumers.result
@@ -51,3 +51,12 @@ LOCK TABLES performance_schema.setup_consumers READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.setup_consumers WRITE;
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_consumers';
+column_name column_comment
+NAME Consumer name
+ENABLED YES or NO for whether or not the consumer is enabled. You can modify this column to ensure that event information is added, or is not added.
diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
index 10d576a0583..a338ce88f2d 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
@@ -80,3 +80,13 @@ UNLOCK TABLES;
UPDATE performance_schema.setup_instruments SET timed='NO'
ORDER BY RAND();
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_instruments';
+column_name column_comment
+NAME Instrument name
+ENABLED Whether or not the instrument is enabled. It can be disabled, and the instrument will produce no events.
+TIMED Whether or not the instrument is timed. It can be set, but if disabled, events produced by the instrument will have NULL values for the corresponding TIMER_START, TIMER_END, and TIMER_WAIT values.
diff --git a/mysql-test/suite/perfschema/r/dml_setup_objects.result b/mysql-test/suite/perfschema/r/dml_setup_objects.result
index a505501c8b6..92c8cab01c7 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_objects.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_objects.result
@@ -68,3 +68,15 @@ truncate table performance_schema.setup_objects;
insert into performance_schema.setup_objects
select * from test.setup_objects;
drop table test.setup_objects;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_objects';
+column_name column_comment
+OBJECT_TYPE Type of object to instrument. Currently, only TABLE, for base table.
+OBJECT_SCHEMA Schema containing the object, either the literal or % for any schema.
+OBJECT_NAME Name of the instrumented object, either the literal or % for any object.
+ENABLED Whether the object's events are instrumented or not. Can be disabled, in which case monitoring is not enabled for those objects.
+TIMED Whether the object's events are timed or not. Can be modified.
diff --git a/mysql-test/suite/perfschema/r/dml_setup_timers.result b/mysql-test/suite/perfschema/r/dml_setup_timers.result
index 60792998359..9dcc7f8e1c6 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_timers.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_timers.result
@@ -59,3 +59,12 @@ idle MICROSECOND
wait CYCLE
stage NANOSECOND
statement NANOSECOND
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_timers';
+column_name column_comment
+NAME Type of instrument the timer is used for.
+TIMER_NAME Timer applying to the instrument type. Can be modified.
diff --git a/mysql-test/suite/perfschema/r/dml_socket_instances.result b/mysql-test/suite/perfschema/r/dml_socket_instances.result
index 957f9bf9080..d54e956e51b 100644
--- a/mysql-test/suite/perfschema/r/dml_socket_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_socket_instances.result
@@ -18,3 +18,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.socket_instances WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'socket_instances'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='socket_instances';
+column_name column_comment
+EVENT_NAME NAME from the setup_instruments table, and the name of the wait/io/socket/* instrument that produced the event.
+OBJECT_INSTANCE_BEGIN Memory address of the object.
+THREAD_ID Thread identifier that the server assigns to each socket.
+SOCKET_ID The socket's internal file handle.
+IP Client IP address. Blank for Unix socket file, otherwise an IPv4 or IPv6 address. Together with the PORT identifies the connection.
+PORT TCP/IP port number, from 0 to 65535. Together with the IP identifies the connection.
+STATE Socket status, either IDLE if waiting to receive a request from a client, or ACTIVE
diff --git a/mysql-test/suite/perfschema/r/dml_socket_summary_by_event_name.result b/mysql-test/suite/perfschema/r/dml_socket_summary_by_event_name.result
index 39d14f413db..62085b067cc 100644
--- a/mysql-test/suite/perfschema/r/dml_socket_summary_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_socket_summary_by_event_name.result
@@ -24,3 +24,33 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.socket_summary_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'socket_summary_by_event_name'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='socket_summary_by_event_name';
+column_name column_comment
+EVENT_NAME Socket instrument.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+COUNT_READ Number of all read operations, including RECV, RECVFROM, and RECVMSG.
+SUM_TIMER_READ Total wait time of all read operations that are timed.
+MIN_TIMER_READ Minimum wait time of all read operations that are timed.
+AVG_TIMER_READ Average wait time of all read operations that are timed.
+MAX_TIMER_READ Maximum wait time of all read operations that are timed.
+SUM_NUMBER_OF_BYTES_READ Bytes read by read operations.
+COUNT_WRITE Number of all write operations, including SEND, SENDTO, and SENDMSG.
+SUM_TIMER_WRITE Total wait time of all write operations that are timed.
+MIN_TIMER_WRITE Minimum wait time of all write operations that are timed.
+AVG_TIMER_WRITE Average wait time of all write operations that are timed.
+MAX_TIMER_WRITE Maximum wait time of all write operations that are timed.
+SUM_NUMBER_OF_BYTES_WRITE Bytes written by write operations.
+COUNT_MISC Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN.
+SUM_TIMER_MISC Total wait time of all miscellaneous operations that are timed.
+MIN_TIMER_MISC Minimum wait time of all miscellaneous operations that are timed.
+AVG_TIMER_MISC Average wait time of all miscellaneous operations that are timed.
+MAX_TIMER_MISC Maximum wait time of all miscellaneous operations that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_socket_summary_by_instance.result b/mysql-test/suite/perfschema/r/dml_socket_summary_by_instance.result
index 35ad763d9a7..77baea763cb 100644
--- a/mysql-test/suite/perfschema/r/dml_socket_summary_by_instance.result
+++ b/mysql-test/suite/perfschema/r/dml_socket_summary_by_instance.result
@@ -24,3 +24,34 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.socket_summary_by_instance WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'socket_summary_by_instance'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='socket_summary_by_instance';
+column_name column_comment
+EVENT_NAME Socket instrument.
+OBJECT_INSTANCE_BEGIN Address in memory.
+COUNT_STAR Number of summarized events
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+COUNT_READ Number of all read operations, including RECV, RECVFROM, and RECVMSG.
+SUM_TIMER_READ Total wait time of all read operations that are timed.
+MIN_TIMER_READ Minimum wait time of all read operations that are timed.
+AVG_TIMER_READ Average wait time of all read operations that are timed.
+MAX_TIMER_READ Maximum wait time of all read operations that are timed.
+SUM_NUMBER_OF_BYTES_READ Bytes read by read operations.
+COUNT_WRITE Number of all write operations, including SEND, SENDTO, and SENDMSG.
+SUM_TIMER_WRITE Total wait time of all write operations that are timed.
+MIN_TIMER_WRITE Minimum wait time of all write operations that are timed.
+AVG_TIMER_WRITE Average wait time of all write operations that are timed.
+MAX_TIMER_WRITE Maximum wait time of all write operations that are timed.
+SUM_NUMBER_OF_BYTES_WRITE Bytes written by write operations.
+COUNT_MISC Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN.
+SUM_TIMER_MISC Total wait time of all miscellaneous operations that are timed.
+MIN_TIMER_MISC Minimum wait time of all miscellaneous operations that are timed.
+AVG_TIMER_MISC Average wait time of all miscellaneous operations that are timed.
+MAX_TIMER_MISC Maximum wait time of all miscellaneous operations that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_threads.result b/mysql-test/suite/perfschema/r/dml_threads.result
index 6306cac8cee..a5fcc80f944 100644
--- a/mysql-test/suite/perfschema/r/dml_threads.result
+++ b/mysql-test/suite/perfschema/r/dml_threads.result
@@ -32,3 +32,24 @@ LOCK TABLES performance_schema.threads READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.threads WRITE;
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='threads';
+column_name column_comment
+THREAD_ID A unique thread identifier.
+NAME Name associated with the server's thread instrumentation code, for example thread/sql/main for the server's main() function, and thread/sql/one_connection for a user connection.
+TYPE FOREGROUND or BACKGROUND, depending on the thread type. User connection threads are FOREGROUND, internal server threads are BACKGROUND.
+PROCESSLIST_ID The PROCESSLIST.ID value for threads displayed in the INFORMATION_SCHEMA.PROCESSLIST table, or 0 for background threads. Also corresponds with the CONNECTION_ID() return value for the thread.
+PROCESSLIST_USER Foreground thread user, or NULL for a background thread.
+PROCESSLIST_HOST Foreground thread host, or NULL for a background thread.
+PROCESSLIST_DB Thread's default database, or NULL if none exists.
+PROCESSLIST_COMMAND Type of command executed by the thread. These correspond to the the COM_xxx client/server protocol commands, and the Com_xxx status variables. See Thread Command Values.
+PROCESSLIST_TIME Time in seconds the thread has been in its current state.
+PROCESSLIST_STATE Action, event or state indicating what the thread is doing.
+PROCESSLIST_INFO Statement being executed by the thread, or NULL if a statement is not being executed. If a statement results in calling other statements, such as for a stored procedure, the innermost statement from the stored procedure is shown here.
+PARENT_THREAD_ID THREAD_ID of the parent thread, if any. Subthreads can for example be spawned as a result of INSERT DELAYED statements.
+ROLE Unused.
+INSTRUMENTED YES or NO for Whether the thread is instrumented or not. For foreground threads, the initial value is determined by whether there's a user/host match in the setup_actors table. Subthreads are again matched, while for background threads, this will be set to YES by default. To monitor events that the thread executes, INSTRUMENTED must be YES and the thread_instrumentation consumer in the setup_consumers table must also be YES.
diff --git a/mysql-test/suite/perfschema/r/dml_tiws_by_index_usage.result b/mysql-test/suite/perfschema/r/dml_tiws_by_index_usage.result
index cf1ed766731..f7bb29cae4e 100644
--- a/mysql-test/suite/perfschema/r/dml_tiws_by_index_usage.result
+++ b/mysql-test/suite/perfschema/r/dml_tiws_by_index_usage.result
@@ -24,3 +24,49 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.table_io_waits_summary_by_index_usage WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_index_usage'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='table_io_waits_summary_by_index_usage';
+column_name column_comment
+OBJECT_TYPE TABLE in the case of all indexes.
+OBJECT_SCHEMA Schema name.
+OBJECT_NAME Table name.
+INDEX_NAME Index name, or PRIMARY for the primary index, NULL for no index (inserts are counted in this case).
+COUNT_STAR Number of summarized events and the sum of the x_READ and x_WRITE columns.
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+COUNT_READ Number of all read operations, and the sum of the equivalent x_FETCH columns.
+SUM_TIMER_READ Total wait time of all read operations that are timed.
+MIN_TIMER_READ Minimum wait time of all read operations that are timed.
+AVG_TIMER_READ Average wait time of all read operations that are timed.
+MAX_TIMER_READ Maximum wait time of all read operations that are timed.
+COUNT_WRITE Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns.
+SUM_TIMER_WRITE Total wait time of all write operations that are timed.
+MIN_TIMER_WRITE Minimum wait time of all write operations that are timed.
+AVG_TIMER_WRITE Average wait time of all write operations that are timed.
+MAX_TIMER_WRITE Maximum wait time of all write operations that are timed.
+COUNT_FETCH Number of all fetch operations.
+SUM_TIMER_FETCH Total wait time of all fetch operations that are timed.
+MIN_TIMER_FETCH Minimum wait time of all fetch operations that are timed.
+AVG_TIMER_FETCH Average wait time of all fetch operations that are timed.
+MAX_TIMER_FETCH Maximum wait time of all fetch operations that are timed.
+COUNT_INSERT Number of all insert operations.
+SUM_TIMER_INSERT Total wait time of all insert operations that are timed.
+MIN_TIMER_INSERT Minimum wait time of all insert operations that are timed.
+AVG_TIMER_INSERT Average wait time of all insert operations that are timed.
+MAX_TIMER_INSERT Maximum wait time of all insert operations that are timed.
+COUNT_UPDATE Number of all update operations.
+SUM_TIMER_UPDATE Total wait time of all update operations that are timed.
+MIN_TIMER_UPDATE Minimum wait time of all update operations that are timed.
+AVG_TIMER_UPDATE Average wait time of all update operations that are timed.
+MAX_TIMER_UPDATE Maximum wait time of all update operations that are timed.
+COUNT_DELETE Number of all delete operations.
+SUM_TIMER_DELETE Total wait time of all delete operations that are timed.
+MIN_TIMER_DELETE Minimum wait time of all delete operations that are timed.
+AVG_TIMER_DELETE Average wait time of all delete operations that are timed.
+MAX_TIMER_DELETE Maximum wait time of all delete operations that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_tiws_by_table.result b/mysql-test/suite/perfschema/r/dml_tiws_by_table.result
index 1ec1940194a..5a83ddfa87e 100644
--- a/mysql-test/suite/perfschema/r/dml_tiws_by_table.result
+++ b/mysql-test/suite/perfschema/r/dml_tiws_by_table.result
@@ -24,3 +24,48 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.table_io_waits_summary_by_table WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'table_io_waits_summary_by_table'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='table_io_waits_summary_by_table';
+column_name column_comment
+OBJECT_TYPE Since this table records waits by table, always set to TABLE.
+OBJECT_SCHEMA Schema name.
+OBJECT_NAME Table name.
+COUNT_STAR Number of summarized events and the sum of the x_READ and x_WRITE columns.
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+COUNT_READ Number of all read operations, and the sum of the equivalent x_FETCH columns.
+SUM_TIMER_READ Total wait time of all read operations that are timed.
+MIN_TIMER_READ Minimum wait time of all read operations that are timed.
+AVG_TIMER_READ Average wait time of all read operations that are timed.
+MAX_TIMER_READ Maximum wait time of all read operations that are timed.
+COUNT_WRITE Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns.
+SUM_TIMER_WRITE Total wait time of all write operations that are timed.
+MIN_TIMER_WRITE Minimum wait time of all write operations that are timed.
+AVG_TIMER_WRITE Average wait time of all write operations that are timed.
+MAX_TIMER_WRITE Maximum wait time of all write operations that are timed.
+COUNT_FETCH Number of all fetch operations.
+SUM_TIMER_FETCH Total wait time of all fetch operations that are timed.
+MIN_TIMER_FETCH Minimum wait time of all fetch operations that are timed.
+AVG_TIMER_FETCH Average wait time of all fetch operations that are timed.
+MAX_TIMER_FETCH Maximum wait time of all fetch operations that are timed.
+COUNT_INSERT Number of all insert operations.
+SUM_TIMER_INSERT Total wait time of all insert operations that are timed.
+MIN_TIMER_INSERT Minimum wait time of all insert operations that are timed.
+AVG_TIMER_INSERT Average wait time of all insert operations that are timed.
+MAX_TIMER_INSERT Maximum wait time of all insert operations that are timed.
+COUNT_UPDATE Number of all update operations.
+SUM_TIMER_UPDATE Total wait time of all update operations that are timed.
+MIN_TIMER_UPDATE Minimum wait time of all update operations that are timed.
+AVG_TIMER_UPDATE Average wait time of all update operations that are timed.
+MAX_TIMER_UPDATE Maximum wait time of all update operations that are timed.
+COUNT_DELETE Number of all delete operations.
+SUM_TIMER_DELETE Total wait time of all delete operations that are timed.
+MIN_TIMER_DELETE Minimum wait time of all delete operations that are timed.
+AVG_TIMER_DELETE Average wait time of all delete operations that are timed.
+MAX_TIMER_DELETE Maximum wait time of all delete operations that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_tlws_by_table.result b/mysql-test/suite/perfschema/r/dml_tlws_by_table.result
index 1d39794d6c8..24f6c79ac61 100644
--- a/mysql-test/suite/perfschema/r/dml_tlws_by_table.result
+++ b/mysql-test/suite/perfschema/r/dml_tlws_by_table.result
@@ -24,3 +24,83 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.table_lock_waits_summary_by_table WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'table_lock_waits_summary_by_table'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='table_lock_waits_summary_by_table';
+column_name column_comment
+OBJECT_TYPE Since this table records waits by table, always set to TABLE.
+OBJECT_SCHEMA Schema name.
+OBJECT_NAME Table name.
+COUNT_STAR Number of summarized events and the sum of the x_READ and x_WRITE columns.
+SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
+MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
+AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
+MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
+COUNT_READ Number of all read operations, and the sum of the equivalent x_READ_NORMAL, x_READ_WITH_SHARED_LOCKS, x_READ_HIGH_PRIORITY and x_READ_NO_INSERT columns.
+SUM_TIMER_READ Total wait time of all read operations that are timed.
+MIN_TIMER_READ Minimum wait time of all read operations that are timed.
+AVG_TIMER_READ Average wait time of all read operations that are timed.
+MAX_TIMER_READ Maximum wait time of all read operations that are timed.
+COUNT_WRITE Number of all write operations, and the sum of the equivalent x_WRITE_ALLOW_WRITE, x_WRITE_CONCURRENT_INSERT, x_WRITE_DELAYED, x_WRITE_LOW_PRIORITY and x_WRITE_NORMAL columns.
+SUM_TIMER_WRITE Total wait time of all write operations that are timed.
+MIN_TIMER_WRITE Minimum wait time of all write operations that are timed.
+AVG_TIMER_WRITE Average wait time of all write operations that are timed.
+MAX_TIMER_WRITE Maximum wait time of all write operations that are timed.
+COUNT_READ_NORMAL Number of all internal read normal locks.
+SUM_TIMER_READ_NORMAL Total wait time of all internal read normal locks that are timed.
+MIN_TIMER_READ_NORMAL Minimum wait time of all internal read normal locks that are timed.
+AVG_TIMER_READ_NORMAL Average wait time of all internal read normal locks that are timed.
+MAX_TIMER_READ_NORMAL Maximum wait time of all internal read normal locks that are timed.
+COUNT_READ_WITH_SHARED_LOCKS Number of all internal read with shared locks.
+SUM_TIMER_READ_WITH_SHARED_LOCKS Total wait time of all internal read with shared locks that are timed.
+MIN_TIMER_READ_WITH_SHARED_LOCKS Minimum wait time of all internal read with shared locks that are timed.
+AVG_TIMER_READ_WITH_SHARED_LOCKS Average wait time of all internal read with shared locks that are timed.
+MAX_TIMER_READ_WITH_SHARED_LOCKS Maximum wait time of all internal read with shared locks that are timed.
+COUNT_READ_HIGH_PRIORITY Number of all internal read high priority locks.
+SUM_TIMER_READ_HIGH_PRIORITY Total wait time of all internal read high priority locks that are timed.
+MIN_TIMER_READ_HIGH_PRIORITY Minimum wait time of all internal read high priority locks that are timed.
+AVG_TIMER_READ_HIGH_PRIORITY Average wait time of all internal read high priority locks that are timed.
+MAX_TIMER_READ_HIGH_PRIORITY Maximum wait time of all internal read high priority locks that are timed.
+COUNT_READ_NO_INSERT Number of all internal read no insert locks.
+SUM_TIMER_READ_NO_INSERT Total wait time of all internal read no insert locks that are timed.
+MIN_TIMER_READ_NO_INSERT Minimum wait time of all internal read no insert locks that are timed.
+AVG_TIMER_READ_NO_INSERT Average wait time of all internal read no insert locks that are timed.
+MAX_TIMER_READ_NO_INSERT Maximum wait time of all internal read no insert locks that are timed.
+COUNT_READ_EXTERNAL Number of all external read locks.
+SUM_TIMER_READ_EXTERNAL Total wait time of all external read locks that are timed.
+MIN_TIMER_READ_EXTERNAL Minimum wait time of all external read locks that are timed.
+AVG_TIMER_READ_EXTERNAL Average wait time of all external read locks that are timed.
+MAX_TIMER_READ_EXTERNAL Maximum wait time of all external read locks that are timed.
+COUNT_WRITE_ALLOW_WRITE Number of all internal read normal locks.
+SUM_TIMER_WRITE_ALLOW_WRITE Total wait time of all internal write allow write locks that are timed.
+MIN_TIMER_WRITE_ALLOW_WRITE Minimum wait time of all internal write allow write locks that are timed.
+AVG_TIMER_WRITE_ALLOW_WRITE Average wait time of all internal write allow write locks that are timed.
+MAX_TIMER_WRITE_ALLOW_WRITE Maximum wait time of all internal write allow write locks that are timed.
+COUNT_WRITE_CONCURRENT_INSERT Number of all internal concurrent insert write locks.
+SUM_TIMER_WRITE_CONCURRENT_INSERT Total wait time of all internal concurrent insert write locks that are timed.
+MIN_TIMER_WRITE_CONCURRENT_INSERT Minimum wait time of all internal concurrent insert write locks that are timed.
+AVG_TIMER_WRITE_CONCURRENT_INSERT Average wait time of all internal concurrent insert write locks that are timed.
+MAX_TIMER_WRITE_CONCURRENT_INSERT Maximum wait time of all internal concurrent insert write locks that are timed.
+COUNT_WRITE_DELAYED Number of all internal write delayed locks.
+SUM_TIMER_WRITE_DELAYED Total wait time of all internal write delayed locks that are timed.
+MIN_TIMER_WRITE_DELAYED Minimum wait time of all internal write delayed locks that are timed.
+AVG_TIMER_WRITE_DELAYED Average wait time of all internal write delayed locks that are timed.
+MAX_TIMER_WRITE_DELAYED Maximum wait time of all internal write delayed locks that are timed.
+COUNT_WRITE_LOW_PRIORITY Number of all internal write low priority locks.
+SUM_TIMER_WRITE_LOW_PRIORITY Total wait time of all internal write low priority locks that are timed.
+MIN_TIMER_WRITE_LOW_PRIORITY Minimum wait time of all internal write low priority locks that are timed.
+AVG_TIMER_WRITE_LOW_PRIORITY Average wait time of all internal write low priority locks that are timed.
+MAX_TIMER_WRITE_LOW_PRIORITY Maximum wait time of all internal write low priority locks that are timed.
+COUNT_WRITE_NORMAL Number of all internal write normal locks.
+SUM_TIMER_WRITE_NORMAL Total wait time of all internal write normal locks that are timed.
+MIN_TIMER_WRITE_NORMAL Minimum wait time of all internal write normal locks that are timed.
+AVG_TIMER_WRITE_NORMAL Average wait time of all internal write normal locks that are timed.
+MAX_TIMER_WRITE_NORMAL Maximum wait time of all internal write normal locks that are timed.
+COUNT_WRITE_EXTERNAL Number of all external write locks.
+SUM_TIMER_WRITE_EXTERNAL Total wait time of all external write locks that are timed.
+MIN_TIMER_WRITE_EXTERNAL Minimum wait time of all external write locks that are timed.
+AVG_TIMER_WRITE_EXTERNAL Average wait time of all external write locks that are timed.
+MAX_TIMER_WRITE_EXTERNAL Maximum wait time of all external write locks that are timed.
diff --git a/mysql-test/suite/perfschema/r/dml_users.result b/mysql-test/suite/perfschema/r/dml_users.result
index fa2d29731da..b38cf034bc0 100644
--- a/mysql-test/suite/perfschema/r/dml_users.result
+++ b/mysql-test/suite/perfschema/r/dml_users.result
@@ -23,3 +23,13 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.users WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'users'
UNLOCK TABLES;
+#
+# MDEV-25325 column_comment for performance_schema tables
+#
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='users';
+column_name column_comment
+USER The connection's client user name for the connection, or NULL if an internal thread.
+CURRENT_CONNECTIONS Current connections for the user.
+TOTAL_CONNECTIONS Total connections for the user.
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_ed25519.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_ed25519.result
new file mode 100644
index 00000000000..ac40e37dd66
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_ed25519.result
@@ -0,0 +1,119 @@
+install soname 'auth_ed25519';
+flush status;
+flush hosts;
+flush user_resources;
+flush privileges;
+select `User`, `Host` from mysql.`user` where `host` like '%\\%%';
+User Host
+select `User`, `Host` from mysql.`user` where `user` like '192.%';
+User Host
+select `User`, `Host` from mysql.`user` where `user` like '2001:%';
+User Host
+select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
+User Host
+create user plug1@'santa.claus.ipv4.example.com'
+ identified with ed25519 as 'foo';
+create user plug2@'santa.claus.ipv4.example.com'
+ identified with ED25519 as 'vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI';
+set @saved_dbug = @@global.debug_dbug;
+set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+connect(127.0.0.1,plug1,foo,test,PORT,SOCKET);
+connect con1, 127.0.0.1, plug1,foo,,$MASTER_MYPORT;
+ERROR 28000: Access denied for user 'plug1'@'santa.claus.ipv4.example.com' (using password: NO)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 1
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 0
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+connect(127.0.0.1,plug2,bar,test,PORT,SOCKET);
+connect con1, 127.0.0.1, plug2,bar,,$MASTER_MYPORT;
+ERROR 28000: Access denied for user 'plug2'@'santa.claus.ipv4.example.com' (using password: YES)
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 1
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 1
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+connect con1, 127.0.0.1, plug2,foo,,$MASTER_MYPORT;
+select current_user();
+current_user()
+plug2@santa.claus.ipv4.example.com
+disconnect con1;
+connection default;
+"Dumping performance_schema.host_cache"
+IP 192.0.2.4
+HOST santa.claus.ipv4.example.com
+HOST_VALIDATED YES
+SUM_CONNECT_ERRORS 0
+COUNT_HOST_BLOCKED_ERRORS 0
+COUNT_NAMEINFO_TRANSIENT_ERRORS 0
+COUNT_NAMEINFO_PERMANENT_ERRORS 0
+COUNT_FORMAT_ERRORS 0
+COUNT_ADDRINFO_TRANSIENT_ERRORS 0
+COUNT_ADDRINFO_PERMANENT_ERRORS 0
+COUNT_FCRDNS_ERRORS 0
+COUNT_HOST_ACL_ERRORS 0
+COUNT_NO_AUTH_PLUGIN_ERRORS 0
+COUNT_AUTH_PLUGIN_ERRORS 1
+COUNT_HANDSHAKE_ERRORS 0
+COUNT_PROXY_USER_ERRORS 0
+COUNT_PROXY_USER_ACL_ERRORS 0
+COUNT_AUTHENTICATION_ERRORS 1
+COUNT_SSL_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_ERRORS 0
+COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
+COUNT_DEFAULT_DATABASE_ERRORS 0
+COUNT_INIT_CONNECT_ERRORS 0
+COUNT_LOCAL_ERRORS 0
+COUNT_UNKNOWN_ERRORS 0
+FIRST_ERROR_SEEN set
+LAST_ERROR_SEEN set
+drop user plug1@'santa.claus.ipv4.example.com';
+drop user plug2@'santa.claus.ipv4.example.com';
+set @@global.debug_dbug = @saved_dbug;
+uninstall plugin ed25519;
diff --git a/mysql-test/suite/perfschema/r/schema.result b/mysql-test/suite/perfschema/r/schema.result
index 8ce4cad4f4b..8b3e5eff8b7 100644
--- a/mysql-test/suite/perfschema/r/schema.result
+++ b/mysql-test/suite/perfschema/r/schema.result
@@ -62,987 +62,987 @@ users
show create table accounts;
Table Create Table
accounts CREATE TABLE `accounts` (
- `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `CURRENT_CONNECTIONS` bigint(20) NOT NULL,
- `TOTAL_CONNECTIONS` bigint(20) NOT NULL
+ `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'The connection''s client user name for the connection, or NULL if an internal thread.',
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'The connection client''s host name, or NULL if an internal thread.',
+ `CURRENT_CONNECTIONS` bigint(20) NOT NULL COMMENT 'Current connections for the account.',
+ `TOTAL_CONNECTIONS` bigint(20) NOT NULL COMMENT 'Total connections for the account.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table cond_instances;
Table Create Table
cond_instances CREATE TABLE `cond_instances` (
- `NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL
+ `NAME` varchar(128) NOT NULL COMMENT 'Client user name for the connection, or NULL if an internal thread.',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'Address in memory of the instrumented condition.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_stages_current;
Table Create Table
events_stages_current CREATE TABLE `events_stages_current` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_ID` bigint(20) unsigned NOT NULL,
- `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `SOURCE` varchar(64) DEFAULT NULL,
- `TIMER_START` bigint(20) unsigned DEFAULT NULL,
- `TIMER_END` bigint(20) unsigned DEFAULT NULL,
- `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',
+ `EVENT_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'NULL when the event starts, set to the thread''s current event number at the end of the event.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event instrument name and a NAME from the setup_instruments table',
+ `SOURCE` varchar(64) DEFAULT NULL COMMENT 'Name and line number of the source file containing the instrumented code that produced the event.',
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing started or NULL if timing is not collected.',
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'EVENT_ID of event within which this event nests.',
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL COMMENT 'Nesting event type. Either statement, stage or wait.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_stages_history;
Table Create Table
events_stages_history CREATE TABLE `events_stages_history` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_ID` bigint(20) unsigned NOT NULL,
- `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `SOURCE` varchar(64) DEFAULT NULL,
- `TIMER_START` bigint(20) unsigned DEFAULT NULL,
- `TIMER_END` bigint(20) unsigned DEFAULT NULL,
- `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',
+ `EVENT_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'NULL when the event starts, set to the thread''s current event number at the end of the event.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event instrument name and a NAME from the setup_instruments table',
+ `SOURCE` varchar(64) DEFAULT NULL COMMENT 'Name and line number of the source file containing the instrumented code that produced the event.',
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing started or NULL if timing is not collected.',
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'EVENT_ID of event within which this event nests.',
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL COMMENT 'Nesting event type. Either statement, stage or wait.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_stages_history_long;
Table Create Table
events_stages_history_long CREATE TABLE `events_stages_history_long` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_ID` bigint(20) unsigned NOT NULL,
- `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `SOURCE` varchar(64) DEFAULT NULL,
- `TIMER_START` bigint(20) unsigned DEFAULT NULL,
- `TIMER_END` bigint(20) unsigned DEFAULT NULL,
- `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',
+ `EVENT_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'NULL when the event starts, set to the thread''s current event number at the end of the event.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event instrument name and a NAME from the setup_instruments table',
+ `SOURCE` varchar(64) DEFAULT NULL COMMENT 'Name and line number of the source file containing the instrumented code that produced the event.',
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing started or NULL if timing is not collected.',
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'EVENT_ID of event within which this event nests.',
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL COMMENT 'Nesting event type. Either statement, stage or wait.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_stages_summary_by_host_by_event_name;
Table Create Table
events_stages_summary_by_host_by_event_name CREATE TABLE `events_stages_summary_by_host_by_event_name` (
- `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Host. Used together with EVENT_NAME for grouping events.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with HOST for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events, which includes all timed and untimed events.',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the timed summarized events.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the timed summarized events.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the timed summarized events.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the timed summarized events.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_stages_summary_by_thread_by_event_name;
Table Create Table
events_stages_summary_by_thread_by_event_name CREATE TABLE `events_stages_summary_by_thread_by_event_name` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with THREAD_ID for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events, which includes all timed and untimed events.',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the timed summarized events.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the timed summarized events.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the timed summarized events.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the timed summarized events.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_stages_summary_by_user_by_event_name;
Table Create Table
events_stages_summary_by_user_by_event_name CREATE TABLE `events_stages_summary_by_user_by_event_name` (
- `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'User. Used together with EVENT_NAME for grouping events.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with USER for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events, which includes all timed and untimed events.',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the timed summarized events.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the timed summarized events.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the timed summarized events.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the timed summarized events.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_stages_summary_by_account_by_event_name;
Table Create Table
events_stages_summary_by_account_by_event_name CREATE TABLE `events_stages_summary_by_account_by_event_name` (
- `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'User. Used together with HOST and EVENT_NAME for grouping events.',
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Host. Used together with USER and EVENT_NAME for grouping events.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with USER and HOST for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events, which includes all timed and untimed events.',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the timed summarized events.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the timed summarized events.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the timed summarized events.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the timed summarized events.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_stages_summary_global_by_event_name;
Table Create Table
events_stages_summary_global_by_event_name CREATE TABLE `events_stages_summary_global_by_event_name` (
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events, which includes all timed and untimed events.',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the timed summarized events.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the timed summarized events.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the timed summarized events.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the timed summarized events.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_statements_current;
Table Create Table
events_statements_current CREATE TABLE `events_statements_current` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_ID` bigint(20) unsigned NOT NULL,
- `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `SOURCE` varchar(64) DEFAULT NULL,
- `TIMER_START` bigint(20) unsigned DEFAULT NULL,
- `TIMER_END` bigint(20) unsigned DEFAULT NULL,
- `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
- `LOCK_TIME` bigint(20) unsigned NOT NULL,
- `SQL_TEXT` longtext DEFAULT NULL,
- `DIGEST` varchar(32) DEFAULT NULL,
- `DIGEST_TEXT` longtext DEFAULT NULL,
- `CURRENT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(64) DEFAULT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned DEFAULT NULL,
- `MYSQL_ERRNO` int(11) DEFAULT NULL,
- `RETURNED_SQLSTATE` varchar(5) DEFAULT NULL,
- `MESSAGE_TEXT` varchar(128) DEFAULT NULL,
- `ERRORS` bigint(20) unsigned NOT NULL,
- `WARNINGS` bigint(20) unsigned NOT NULL,
- `ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
- `ROWS_SENT` bigint(20) unsigned NOT NULL,
- `ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
- `CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
- `CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
- `SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
- `SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
- `SELECT_RANGE` bigint(20) unsigned NOT NULL,
- `SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
- `SELECT_SCAN` bigint(20) unsigned NOT NULL,
- `SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
- `SORT_RANGE` bigint(20) unsigned NOT NULL,
- `SORT_ROWS` bigint(20) unsigned NOT NULL,
- `SORT_SCAN` bigint(20) unsigned NOT NULL,
- `NO_INDEX_USED` bigint(20) unsigned NOT NULL,
- `NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,
- `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',
+ `EVENT_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'NULL when the event starts, set to the thread''s current event number at the end of the event.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event instrument name and a NAME from the setup_instruments table',
+ `SOURCE` varchar(64) DEFAULT NULL COMMENT 'Name and line number of the source file containing the instrumented code that produced the event.',
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing started or NULL if timing is not collected.',
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',
+ `LOCK_TIME` bigint(20) unsigned NOT NULL COMMENT 'Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.',
+ `SQL_TEXT` longtext DEFAULT NULL COMMENT 'The SQL statement, or NULL if the command is not associated with an SQL statement.',
+ `DIGEST` varchar(32) DEFAULT NULL COMMENT 'Statement digest.',
+ `DIGEST_TEXT` longtext DEFAULT NULL COMMENT 'Statement digest text.',
+ `CURRENT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Statement''s default database for the statement, or NULL if there was none.',
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'Reserved, currently NULL',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Reserved, currently NULL',
+ `OBJECT_NAME` varchar(64) DEFAULT NULL COMMENT 'Reserved, currently NULL',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned DEFAULT NULL COMMENT 'Address in memory of the statement object.',
+ `MYSQL_ERRNO` int(11) DEFAULT NULL COMMENT 'Error code. See MariaDB Error Codes for a full list.',
+ `RETURNED_SQLSTATE` varchar(5) DEFAULT NULL COMMENT 'The SQLSTATE value.',
+ `MESSAGE_TEXT` varchar(128) DEFAULT NULL COMMENT 'Statement error message. See MariaDB Error Codes.',
+ `ERRORS` bigint(20) unsigned NOT NULL COMMENT '0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.',
+ `WARNINGS` bigint(20) unsigned NOT NULL COMMENT 'Number of warnings from the diagnostics area.',
+ `ROWS_AFFECTED` bigint(20) unsigned NOT NULL COMMENT 'Number of rows affected the statement affected.',
+ `ROWS_SENT` bigint(20) unsigned NOT NULL COMMENT 'Number of rows returned.',
+ `ROWS_EXAMINED` bigint(20) unsigned NOT NULL COMMENT 'Number of rows read during the statement''s execution.',
+ `CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Number of on-disk temp tables created by the statement.',
+ `CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Number of temp tables created by the statement.',
+ `SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which did not use an index.',
+ `SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which used a range search of the first table.',
+ `SELECT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which used a range of the first table.',
+ `SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL COMMENT 'Number of joins without keys performed by the statement that check for key usage after each row.',
+ `SELECT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which used a full scan of the first table.',
+ `SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL COMMENT 'Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.',
+ `SORT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Number of sorts performed by the statement which used a range.',
+ `SORT_ROWS` bigint(20) unsigned NOT NULL COMMENT 'Number of rows sorted by the statement.',
+ `SORT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Number of sorts performed by the statement which used a full table scan.',
+ `NO_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT '0 if the statement performed a table scan with an index, 1 if without an index.',
+ `NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT '0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.',
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'Reserved, currently NULL.',
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL COMMENT 'Reserved, currently NULL.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_statements_history;
Table Create Table
events_statements_history CREATE TABLE `events_statements_history` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_ID` bigint(20) unsigned NOT NULL,
- `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `SOURCE` varchar(64) DEFAULT NULL,
- `TIMER_START` bigint(20) unsigned DEFAULT NULL,
- `TIMER_END` bigint(20) unsigned DEFAULT NULL,
- `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
- `LOCK_TIME` bigint(20) unsigned NOT NULL,
- `SQL_TEXT` longtext DEFAULT NULL,
- `DIGEST` varchar(32) DEFAULT NULL,
- `DIGEST_TEXT` longtext DEFAULT NULL,
- `CURRENT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(64) DEFAULT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned DEFAULT NULL,
- `MYSQL_ERRNO` int(11) DEFAULT NULL,
- `RETURNED_SQLSTATE` varchar(5) DEFAULT NULL,
- `MESSAGE_TEXT` varchar(128) DEFAULT NULL,
- `ERRORS` bigint(20) unsigned NOT NULL,
- `WARNINGS` bigint(20) unsigned NOT NULL,
- `ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
- `ROWS_SENT` bigint(20) unsigned NOT NULL,
- `ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
- `CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
- `CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
- `SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
- `SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
- `SELECT_RANGE` bigint(20) unsigned NOT NULL,
- `SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
- `SELECT_SCAN` bigint(20) unsigned NOT NULL,
- `SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
- `SORT_RANGE` bigint(20) unsigned NOT NULL,
- `SORT_ROWS` bigint(20) unsigned NOT NULL,
- `SORT_SCAN` bigint(20) unsigned NOT NULL,
- `NO_INDEX_USED` bigint(20) unsigned NOT NULL,
- `NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,
- `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',
+ `EVENT_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'NULL when the event starts, set to the thread''s current event number at the end of the event.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event instrument name and a NAME from the setup_instruments table',
+ `SOURCE` varchar(64) DEFAULT NULL COMMENT 'Name and line number of the source file containing the instrumented code that produced the event.',
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing started or NULL if timing is not collected.',
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',
+ `LOCK_TIME` bigint(20) unsigned NOT NULL COMMENT 'Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.',
+ `SQL_TEXT` longtext DEFAULT NULL COMMENT 'The SQL statement, or NULL if the command is not associated with an SQL statement.',
+ `DIGEST` varchar(32) DEFAULT NULL COMMENT 'Statement digest.',
+ `DIGEST_TEXT` longtext DEFAULT NULL COMMENT 'Statement digest text.',
+ `CURRENT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Statement''s default database for the statement, or NULL if there was none.',
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'Reserved, currently NULL',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Reserved, currently NULL',
+ `OBJECT_NAME` varchar(64) DEFAULT NULL COMMENT 'Reserved, currently NULL',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned DEFAULT NULL COMMENT 'Address in memory of the statement object.',
+ `MYSQL_ERRNO` int(11) DEFAULT NULL COMMENT 'Error code. See MariaDB Error Codes for a full list.',
+ `RETURNED_SQLSTATE` varchar(5) DEFAULT NULL COMMENT 'The SQLSTATE value.',
+ `MESSAGE_TEXT` varchar(128) DEFAULT NULL COMMENT 'Statement error message. See MariaDB Error Codes.',
+ `ERRORS` bigint(20) unsigned NOT NULL COMMENT '0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.',
+ `WARNINGS` bigint(20) unsigned NOT NULL COMMENT 'Number of warnings from the diagnostics area.',
+ `ROWS_AFFECTED` bigint(20) unsigned NOT NULL COMMENT 'Number of rows affected the statement affected.',
+ `ROWS_SENT` bigint(20) unsigned NOT NULL COMMENT 'Number of rows returned.',
+ `ROWS_EXAMINED` bigint(20) unsigned NOT NULL COMMENT 'Number of rows read during the statement''s execution.',
+ `CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Number of on-disk temp tables created by the statement.',
+ `CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Number of temp tables created by the statement.',
+ `SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which did not use an index.',
+ `SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which used a range search of the first table.',
+ `SELECT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which used a range of the first table.',
+ `SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL COMMENT 'Number of joins without keys performed by the statement that check for key usage after each row.',
+ `SELECT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which used a full scan of the first table.',
+ `SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL COMMENT 'Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.',
+ `SORT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Number of sorts performed by the statement which used a range.',
+ `SORT_ROWS` bigint(20) unsigned NOT NULL COMMENT 'Number of rows sorted by the statement.',
+ `SORT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Number of sorts performed by the statement which used a full table scan.',
+ `NO_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT '0 if the statement performed a table scan with an index, 1 if without an index.',
+ `NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT '0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.',
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'Reserved, currently NULL.',
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL COMMENT 'Reserved, currently NULL.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_statements_history_long;
Table Create Table
events_statements_history_long CREATE TABLE `events_statements_history_long` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_ID` bigint(20) unsigned NOT NULL,
- `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `SOURCE` varchar(64) DEFAULT NULL,
- `TIMER_START` bigint(20) unsigned DEFAULT NULL,
- `TIMER_END` bigint(20) unsigned DEFAULT NULL,
- `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
- `LOCK_TIME` bigint(20) unsigned NOT NULL,
- `SQL_TEXT` longtext DEFAULT NULL,
- `DIGEST` varchar(32) DEFAULT NULL,
- `DIGEST_TEXT` longtext DEFAULT NULL,
- `CURRENT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(64) DEFAULT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned DEFAULT NULL,
- `MYSQL_ERRNO` int(11) DEFAULT NULL,
- `RETURNED_SQLSTATE` varchar(5) DEFAULT NULL,
- `MESSAGE_TEXT` varchar(128) DEFAULT NULL,
- `ERRORS` bigint(20) unsigned NOT NULL,
- `WARNINGS` bigint(20) unsigned NOT NULL,
- `ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
- `ROWS_SENT` bigint(20) unsigned NOT NULL,
- `ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
- `CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
- `CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
- `SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
- `SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
- `SELECT_RANGE` bigint(20) unsigned NOT NULL,
- `SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
- `SELECT_SCAN` bigint(20) unsigned NOT NULL,
- `SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
- `SORT_RANGE` bigint(20) unsigned NOT NULL,
- `SORT_ROWS` bigint(20) unsigned NOT NULL,
- `SORT_SCAN` bigint(20) unsigned NOT NULL,
- `NO_INDEX_USED` bigint(20) unsigned NOT NULL,
- `NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,
- `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',
+ `EVENT_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'NULL when the event starts, set to the thread''s current event number at the end of the event.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event instrument name and a NAME from the setup_instruments table',
+ `SOURCE` varchar(64) DEFAULT NULL COMMENT 'Name and line number of the source file containing the instrumented code that produced the event.',
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing started or NULL if timing is not collected.',
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',
+ `LOCK_TIME` bigint(20) unsigned NOT NULL COMMENT 'Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.',
+ `SQL_TEXT` longtext DEFAULT NULL COMMENT 'The SQL statement, or NULL if the command is not associated with an SQL statement.',
+ `DIGEST` varchar(32) DEFAULT NULL COMMENT 'Statement digest.',
+ `DIGEST_TEXT` longtext DEFAULT NULL COMMENT 'Statement digest text.',
+ `CURRENT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Statement''s default database for the statement, or NULL if there was none.',
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'Reserved, currently NULL',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Reserved, currently NULL',
+ `OBJECT_NAME` varchar(64) DEFAULT NULL COMMENT 'Reserved, currently NULL',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned DEFAULT NULL COMMENT 'Address in memory of the statement object.',
+ `MYSQL_ERRNO` int(11) DEFAULT NULL COMMENT 'Error code. See MariaDB Error Codes for a full list.',
+ `RETURNED_SQLSTATE` varchar(5) DEFAULT NULL COMMENT 'The SQLSTATE value.',
+ `MESSAGE_TEXT` varchar(128) DEFAULT NULL COMMENT 'Statement error message. See MariaDB Error Codes.',
+ `ERRORS` bigint(20) unsigned NOT NULL COMMENT '0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.',
+ `WARNINGS` bigint(20) unsigned NOT NULL COMMENT 'Number of warnings from the diagnostics area.',
+ `ROWS_AFFECTED` bigint(20) unsigned NOT NULL COMMENT 'Number of rows affected the statement affected.',
+ `ROWS_SENT` bigint(20) unsigned NOT NULL COMMENT 'Number of rows returned.',
+ `ROWS_EXAMINED` bigint(20) unsigned NOT NULL COMMENT 'Number of rows read during the statement''s execution.',
+ `CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Number of on-disk temp tables created by the statement.',
+ `CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Number of temp tables created by the statement.',
+ `SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which did not use an index.',
+ `SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which used a range search of the first table.',
+ `SELECT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which used a range of the first table.',
+ `SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL COMMENT 'Number of joins without keys performed by the statement that check for key usage after each row.',
+ `SELECT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Number of joins performed by the statement which used a full scan of the first table.',
+ `SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL COMMENT 'Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.',
+ `SORT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Number of sorts performed by the statement which used a range.',
+ `SORT_ROWS` bigint(20) unsigned NOT NULL COMMENT 'Number of rows sorted by the statement.',
+ `SORT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Number of sorts performed by the statement which used a full table scan.',
+ `NO_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT '0 if the statement performed a table scan with an index, 1 if without an index.',
+ `NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT '0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.',
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'Reserved, currently NULL.',
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL COMMENT 'Reserved, currently NULL.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_statements_summary_by_digest;
Table Create Table
events_statements_summary_by_digest CREATE TABLE `events_statements_summary_by_digest` (
- `SCHEMA_NAME` varchar(64) DEFAULT NULL,
- `DIGEST` varchar(32) DEFAULT NULL,
- `DIGEST_TEXT` longtext DEFAULT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
- `SUM_ERRORS` bigint(20) unsigned NOT NULL,
- `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
- `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
- `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
- `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,
- `FIRST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `LAST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+ `SCHEMA_NAME` varchar(64) DEFAULT NULL COMMENT 'Database name. Records are summarised together with DIGEST.',
+ `DIGEST` varchar(32) DEFAULT NULL COMMENT 'Performance Schema digest. Records are summarised together with SCHEMA NAME.',
+ `DIGEST_TEXT` longtext DEFAULT NULL COMMENT 'The unhashed form of the digest.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL COMMENT 'Sum of the LOCK_TIME column in the events_statements_current table.',
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ERRORS column in the events_statements_current table.',
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the WARNINGS column in the events_statements_current table.',
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_SENT column in the events_statements_current table.',
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE column in the events_statements_current table.',
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_SCAN column in the events_statements_current table.',
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_RANGE column in the events_statements_current table.',
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_ROWS column in the events_statements_current table.',
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_SCAN column in the events_statements_current table.',
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_INDEX_USED column in the events_statements_current table.',
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.',
+ `FIRST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Time at which the digest was first seen.',
+ `LAST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Time at which the digest was most recently seen.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_statements_summary_by_host_by_event_name;
Table Create Table
events_statements_summary_by_host_by_event_name CREATE TABLE `events_statements_summary_by_host_by_event_name` (
- `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
- `SUM_ERRORS` bigint(20) unsigned NOT NULL,
- `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
- `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
- `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
- `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Host. Used together with EVENT_NAME for grouping events.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with HOST for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL COMMENT 'Sum of the LOCK_TIME column in the events_statements_currentd table.',
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ERRORS column in the events_statements_current table.',
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the WARNINGS column in the events_statements_current table.',
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_SENT column in the events_statements_current table.',
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_RANGE_JOINW column in the events_statements_current table.',
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE column in the events_statements_current table.',
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_SCAN column in the events_statements_current table.',
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_RANGE column in the events_statements_current table.',
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_ROWS column in the events_statements_current table.',
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_SCAN column in the events_statements_current table.',
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_INDEX_USED column in the events_statements_current table.',
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_statements_summary_by_thread_by_event_name;
Table Create Table
events_statements_summary_by_thread_by_event_name CREATE TABLE `events_statements_summary_by_thread_by_event_name` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
- `SUM_ERRORS` bigint(20) unsigned NOT NULL,
- `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
- `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
- `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
- `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with THREAD_ID for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL COMMENT 'Sum of the LOCK_TIME column in the events_statements_current table.',
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ERRORS column in the events_statements_current table.',
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the WARNINGS column in the events_statements_current table.',
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_SENT column in the events_statements_current table.',
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE column in the events_statements_current table.',
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_SCAN column in the events_statements_current table.',
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_RANGE column in the events_statements_current table.',
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_ROWS column in the events_statements_current table.',
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_SCAN column in the events_statements_current table.',
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_INDEX_USED column in the events_statements_current table.',
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_statements_summary_by_user_by_event_name;
Table Create Table
events_statements_summary_by_user_by_event_name CREATE TABLE `events_statements_summary_by_user_by_event_name` (
- `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
- `SUM_ERRORS` bigint(20) unsigned NOT NULL,
- `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
- `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
- `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
- `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
+ `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'User. Used together with EVENT_NAME for grouping events.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with USER for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL COMMENT 'Sum of the LOCK_TIME column in the events_statements_current table.',
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ERRORS column in the events_statements_current table.',
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the WARNINGS column in the events_statements_current table.',
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_SENT column in the events_statements_current table.',
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE column in the events_statements_current table.',
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_SCAN column in the events_statements_current table.',
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_RANGE column in the events_statements_current table.',
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_ROWS column in the events_statements_current table.',
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_SCAN column in the events_statements_current table.',
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_INDEX_USED column in the events_statements_current table.',
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_statements_summary_by_account_by_event_name;
Table Create Table
events_statements_summary_by_account_by_event_name CREATE TABLE `events_statements_summary_by_account_by_event_name` (
- `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
- `SUM_ERRORS` bigint(20) unsigned NOT NULL,
- `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
- `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
- `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
- `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
+ `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'User. Used together with HOST and EVENT_NAME for grouping events.',
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Host. Used together with USER and EVENT_NAME for grouping events.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with USER and HOST for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL COMMENT 'Sum of the LOCK_TIME column in the events_statements_current table.',
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ERRORS column in the events_statements_current table.',
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the WARNINGS column in the events_statements_current table.',
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_SENT column in the events_statements_current table.',
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE column in the events_statements_current table.',
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_SCAN column in the events_statements_current table.',
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_RANGE column in the events_statements_current table.',
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_ROWS column in the events_statements_current table.',
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_SCAN column in the events_statements_current table.',
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_INDEX_USED column in the events_statements_current table.',
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_statements_summary_global_by_event_name;
Table Create Table
events_statements_summary_global_by_event_name CREATE TABLE `events_statements_summary_global_by_event_name` (
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,
- `SUM_ERRORS` bigint(20) unsigned NOT NULL,
- `SUM_WARNINGS` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,
- `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,
- `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,
- `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,
- `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,
- `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,
- `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,
- `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL COMMENT 'Sum of the LOCK_TIME column in the events_statements_current table.',
+ `SUM_ERRORS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ERRORS column in the events_statements_current table.',
+ `SUM_WARNINGS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the WARNINGS column in the events_statements_current table.',
+ `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',
+ `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_SENT column in the events_statements_current table.',
+ `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',
+ `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',
+ `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',
+ `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',
+ `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE column in the events_statements_current table.',
+ `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',
+ `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SELECT_SCAN column in the events_statements_current table.',
+ `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',
+ `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_RANGE column in the events_statements_current table.',
+ `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_ROWS column in the events_statements_current table.',
+ `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL COMMENT 'Sum of the SORT_SCAN column in the events_statements_current table.',
+ `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_INDEX_USED column in the events_statements_current table.',
+ `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL COMMENT 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_current;
Table Create Table
events_waits_current CREATE TABLE `events_waits_current` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_ID` bigint(20) unsigned NOT NULL,
- `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `SOURCE` varchar(64) DEFAULT NULL,
- `TIMER_START` bigint(20) unsigned DEFAULT NULL,
- `TIMER_END` bigint(20) unsigned DEFAULT NULL,
- `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
- `SPINS` int(10) unsigned DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(512) DEFAULT NULL,
- `INDEX_NAME` varchar(64) DEFAULT NULL,
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
- `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL,
- `OPERATION` varchar(32) NOT NULL,
- `NUMBER_OF_BYTES` bigint(20) DEFAULT NULL,
- `FLAGS` int(10) unsigned DEFAULT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',
+ `EVENT_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'NULL when the event starts, set to the thread''s current event number at the end of the event.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event instrument name and a NAME from the setup_instruments table',
+ `SOURCE` varchar(64) DEFAULT NULL COMMENT 'Name and line number of the source file containing the instrumented code that produced the event.',
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing started or NULL if timing is not collected.',
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',
+ `SPINS` int(10) unsigned DEFAULT NULL COMMENT 'Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.',
+ `OBJECT_NAME` varchar(512) DEFAULT NULL COMMENT 'File name for file I/O objects, table name for table I/O objects, the socket''s IP:PORT value for a socket object or NULL for a synchronization object.',
+ `INDEX_NAME` varchar(64) DEFAULT NULL COMMENT 'Name of the index, PRIMARY for the primary key, or NULL for no index used.',
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'Address in memory of the object.',
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'EVENT_ID of event within which this event nests.',
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL COMMENT 'Nesting event type. Either statement, stage or wait.',
+ `OPERATION` varchar(32) NOT NULL COMMENT 'Operation type, for example read, write or lock',
+ `NUMBER_OF_BYTES` bigint(20) DEFAULT NULL COMMENT 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',
+ `FLAGS` int(10) unsigned DEFAULT NULL COMMENT 'Reserved for use in the future.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_history;
Table Create Table
events_waits_history CREATE TABLE `events_waits_history` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_ID` bigint(20) unsigned NOT NULL,
- `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `SOURCE` varchar(64) DEFAULT NULL,
- `TIMER_START` bigint(20) unsigned DEFAULT NULL,
- `TIMER_END` bigint(20) unsigned DEFAULT NULL,
- `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
- `SPINS` int(10) unsigned DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(512) DEFAULT NULL,
- `INDEX_NAME` varchar(64) DEFAULT NULL,
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
- `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL,
- `OPERATION` varchar(32) NOT NULL,
- `NUMBER_OF_BYTES` bigint(20) DEFAULT NULL,
- `FLAGS` int(10) unsigned DEFAULT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',
+ `EVENT_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'NULL when the event starts, set to the thread''s current event number at the end of the event.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event instrument name and a NAME from the setup_instruments table',
+ `SOURCE` varchar(64) DEFAULT NULL COMMENT 'Name and line number of the source file containing the instrumented code that produced the event.',
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing started or NULL if timing is not collected.',
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',
+ `SPINS` int(10) unsigned DEFAULT NULL COMMENT 'Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.',
+ `OBJECT_NAME` varchar(512) DEFAULT NULL COMMENT 'File name for file I/O objects, table name for table I/O objects, the socket''s IP:PORT value for a socket object or NULL for a synchronization object.',
+ `INDEX_NAME` varchar(64) DEFAULT NULL COMMENT 'Name of the index, PRIMARY for the primary key, or NULL for no index used.',
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'Address in memory of the object.',
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'EVENT_ID of event within which this event nests.',
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL COMMENT 'Nesting event type. Either statement, stage or wait.',
+ `OPERATION` varchar(32) NOT NULL COMMENT 'Operation type, for example read, write or lock',
+ `NUMBER_OF_BYTES` bigint(20) DEFAULT NULL COMMENT 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',
+ `FLAGS` int(10) unsigned DEFAULT NULL COMMENT 'Reserved for use in the future.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_history_long;
Table Create Table
events_waits_history_long CREATE TABLE `events_waits_history_long` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_ID` bigint(20) unsigned NOT NULL,
- `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `SOURCE` varchar(64) DEFAULT NULL,
- `TIMER_START` bigint(20) unsigned DEFAULT NULL,
- `TIMER_END` bigint(20) unsigned DEFAULT NULL,
- `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
- `SPINS` int(10) unsigned DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(512) DEFAULT NULL,
- `INDEX_NAME` varchar(64) DEFAULT NULL,
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
- `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
- `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL,
- `OPERATION` varchar(32) NOT NULL,
- `NUMBER_OF_BYTES` bigint(20) DEFAULT NULL,
- `FLAGS` int(10) unsigned DEFAULT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',
+ `EVENT_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',
+ `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'NULL when the event starts, set to the thread''s current event number at the end of the event.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event instrument name and a NAME from the setup_instruments table',
+ `SOURCE` varchar(64) DEFAULT NULL COMMENT 'Name and line number of the source file containing the instrumented code that produced the event.',
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing started or NULL if timing is not collected.',
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL COMMENT 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',
+ `SPINS` int(10) unsigned DEFAULT NULL COMMENT 'Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.',
+ `OBJECT_NAME` varchar(512) DEFAULT NULL COMMENT 'File name for file I/O objects, table name for table I/O objects, the socket''s IP:PORT value for a socket object or NULL for a synchronization object.',
+ `INDEX_NAME` varchar(64) DEFAULT NULL COMMENT 'Name of the index, PRIMARY for the primary key, or NULL for no index used.',
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'Address in memory of the object.',
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'EVENT_ID of event within which this event nests.',
+ `NESTING_EVENT_TYPE` enum('STATEMENT','STAGE','WAIT') DEFAULT NULL COMMENT 'Nesting event type. Either statement, stage or wait.',
+ `OPERATION` varchar(32) NOT NULL COMMENT 'Operation type, for example read, write or lock',
+ `NUMBER_OF_BYTES` bigint(20) DEFAULT NULL COMMENT 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',
+ `FLAGS` int(10) unsigned DEFAULT NULL COMMENT 'Reserved for use in the future.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_summary_by_host_by_event_name;
Table Create Table
events_waits_summary_by_host_by_event_name CREATE TABLE `events_waits_summary_by_host_by_event_name` (
- `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Host. Used together with EVENT_NAME for grouping events.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with USER and HOST for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_summary_by_instance;
Table Create Table
events_waits_summary_by_instance CREATE TABLE `events_waits_summary_by_instance` (
- `EVENT_NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with OBJECT_INSTANCE_BEGIN for grouping events.',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'If an instrument creates multiple instances, each instance has a unique OBJECT_INSTANCE_BEGIN value to allow for grouping by instance.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_summary_by_thread_by_event_name;
Table Create Table
events_waits_summary_by_thread_by_event_name CREATE TABLE `events_waits_summary_by_thread_by_event_name` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with THREAD_ID for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_summary_by_user_by_event_name;
Table Create Table
events_waits_summary_by_user_by_event_name CREATE TABLE `events_waits_summary_by_user_by_event_name` (
- `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'User. Used together with EVENT_NAME for grouping events.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with USER for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_summary_by_account_by_event_name;
Table Create Table
events_waits_summary_by_account_by_event_name CREATE TABLE `events_waits_summary_by_account_by_event_name` (
- `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'User. Used together with HOST and EVENT_NAME for grouping events.',
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Host. Used together with USER and EVENT_NAME for grouping events.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name. Used together with USER and HOST for grouping events.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table events_waits_summary_global_by_event_name;
Table Create Table
events_waits_summary_global_by_event_name CREATE TABLE `events_waits_summary_global_by_event_name` (
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table file_instances;
Table Create Table
file_instances CREATE TABLE `file_instances` (
- `FILE_NAME` varchar(512) NOT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `OPEN_COUNT` int(10) unsigned NOT NULL
+ `FILE_NAME` varchar(512) NOT NULL COMMENT 'File name.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Instrument name associated with the file.',
+ `OPEN_COUNT` int(10) unsigned NOT NULL COMMENT 'Open handles on the file. A value of greater than zero means that the file is currently open.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table file_summary_by_event_name;
Table Create Table
file_summary_by_event_name CREATE TABLE `file_summary_by_event_name` (
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `COUNT_READ` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL,
- `COUNT_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL,
- `COUNT_MISC` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `COUNT_READ` bigint(20) unsigned NOT NULL COMMENT 'Number of all read operations, including FGETS, FGETC, FREAD, and READ.',
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all read operations that are timed.',
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all read operations that are timed.',
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all read operations that are timed.',
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all read operations that are timed.',
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL COMMENT 'Bytes read by read operations.',
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE.',
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all write operations that are timed.',
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all write operations that are timed.',
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all write operations that are timed.',
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all write operations that are timed.',
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL COMMENT 'Bytes written by write operations.',
+ `COUNT_MISC` bigint(20) unsigned NOT NULL COMMENT 'Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC.',
+ `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all miscellaneous operations that are timed.',
+ `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all miscellaneous operations that are timed.',
+ `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all miscellaneous operations that are timed.',
+ `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all miscellaneous operations that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table file_summary_by_instance;
Table Create Table
file_summary_by_instance CREATE TABLE `file_summary_by_instance` (
- `FILE_NAME` varchar(512) NOT NULL,
- `EVENT_NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `COUNT_READ` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL,
- `COUNT_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL,
- `COUNT_MISC` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
+ `FILE_NAME` varchar(512) NOT NULL COMMENT 'File name.',
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Event name.',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'Address in memory. Together with FILE_NAME and EVENT_NAME uniquely identifies a row.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `COUNT_READ` bigint(20) unsigned NOT NULL COMMENT 'Number of all read operations, including FGETS, FGETC, FREAD, and READ.',
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all read operations that are timed.',
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all read operations that are timed.',
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all read operations that are timed.',
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all read operations that are timed.',
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL COMMENT 'Bytes read by read operations.',
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE.',
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all write operations that are timed.',
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all write operations that are timed.',
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all write operations that are timed.',
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all write operations that are timed.',
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL COMMENT 'Bytes written by write operations.',
+ `COUNT_MISC` bigint(20) unsigned NOT NULL COMMENT 'Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC.',
+ `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all miscellaneous operations that are timed.',
+ `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all miscellaneous operations that are timed.',
+ `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all miscellaneous operations that are timed.',
+ `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all miscellaneous operations that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table host_cache;
Table Create Table
host_cache CREATE TABLE `host_cache` (
- `IP` varchar(64) NOT NULL,
- `HOST` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `HOST_VALIDATED` enum('YES','NO') NOT NULL,
- `SUM_CONNECT_ERRORS` bigint(20) NOT NULL,
- `COUNT_HOST_BLOCKED_ERRORS` bigint(20) NOT NULL,
- `COUNT_NAMEINFO_TRANSIENT_ERRORS` bigint(20) NOT NULL,
- `COUNT_NAMEINFO_PERMANENT_ERRORS` bigint(20) NOT NULL,
- `COUNT_FORMAT_ERRORS` bigint(20) NOT NULL,
- `COUNT_ADDRINFO_TRANSIENT_ERRORS` bigint(20) NOT NULL,
- `COUNT_ADDRINFO_PERMANENT_ERRORS` bigint(20) NOT NULL,
- `COUNT_FCRDNS_ERRORS` bigint(20) NOT NULL,
- `COUNT_HOST_ACL_ERRORS` bigint(20) NOT NULL,
- `COUNT_NO_AUTH_PLUGIN_ERRORS` bigint(20) NOT NULL,
- `COUNT_AUTH_PLUGIN_ERRORS` bigint(20) NOT NULL,
- `COUNT_HANDSHAKE_ERRORS` bigint(20) NOT NULL,
- `COUNT_PROXY_USER_ERRORS` bigint(20) NOT NULL,
- `COUNT_PROXY_USER_ACL_ERRORS` bigint(20) NOT NULL,
- `COUNT_AUTHENTICATION_ERRORS` bigint(20) NOT NULL,
- `COUNT_SSL_ERRORS` bigint(20) NOT NULL,
- `COUNT_MAX_USER_CONNECTIONS_ERRORS` bigint(20) NOT NULL,
- `COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS` bigint(20) NOT NULL,
- `COUNT_DEFAULT_DATABASE_ERRORS` bigint(20) NOT NULL,
- `COUNT_INIT_CONNECT_ERRORS` bigint(20) NOT NULL,
- `COUNT_LOCAL_ERRORS` bigint(20) NOT NULL,
- `COUNT_UNKNOWN_ERRORS` bigint(20) NOT NULL,
- `FIRST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `LAST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `FIRST_ERROR_SEEN` timestamp NULL DEFAULT '0000-00-00 00:00:00',
- `LAST_ERROR_SEEN` timestamp NULL DEFAULT '0000-00-00 00:00:00'
+ `IP` varchar(64) NOT NULL COMMENT 'Client IP address.',
+ `HOST` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'IP''s resolved DNS host name, or NULL if unknown.',
+ `HOST_VALIDATED` enum('YES','NO') NOT NULL COMMENT 'YES if the IP-to-host DNS lookup was successful, and the HOST column can be used to avoid DNS calls, or NO if unsuccessful, in which case DNS lookup is performed for each connect until either successful or a permanent error.',
+ `SUM_CONNECT_ERRORS` bigint(20) NOT NULL COMMENT 'Number of connection errors. Counts only protocol handshake errors for hosts that passed validation. These errors count towards max_connect_errors.',
+ `COUNT_HOST_BLOCKED_ERRORS` bigint(20) NOT NULL COMMENT 'Number of blocked connections because SUM_CONNECT_ERRORS exceeded the max_connect_errors system variable.',
+ `COUNT_NAMEINFO_TRANSIENT_ERRORS` bigint(20) NOT NULL COMMENT 'Number of transient errors during IP-to-host DNS lookups.',
+ `COUNT_NAMEINFO_PERMANENT_ERRORS` bigint(20) NOT NULL COMMENT 'Number of permanent errors during IP-to-host DNS lookups.',
+ `COUNT_FORMAT_ERRORS` bigint(20) NOT NULL COMMENT 'Number of host name format errors, for example a numeric host column.',
+ `COUNT_ADDRINFO_TRANSIENT_ERRORS` bigint(20) NOT NULL COMMENT 'Number of transient errors during host-to-IP reverse DNS lookups.',
+ `COUNT_ADDRINFO_PERMANENT_ERRORS` bigint(20) NOT NULL COMMENT 'Number of permanent errors during host-to-IP reverse DNS lookups.',
+ `COUNT_FCRDNS_ERRORS` bigint(20) NOT NULL COMMENT 'Number of forward-confirmed reverse DNS errors, which occur when IP-to-host DNS lookup does not match the originating IP address.',
+ `COUNT_HOST_ACL_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors occurring because no user from the host is permitted to log in. These attempts return error code 1130 ER_HOST_NOT_PRIVILEGED and do not proceed to username and password authentication.',
+ `COUNT_NO_AUTH_PLUGIN_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors due to requesting an authentication plugin that was not available. This can be due to the plugin never having been loaded, or the load attempt failing.',
+ `COUNT_AUTH_PLUGIN_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors reported by an authentication plugin. Plugins can increment COUNT_AUTHENTICATION_ERRORS or COUNT_HANDSHAKE_ERRORS instead, but, if specified or the error is unknown, this column is incremented.',
+ `COUNT_HANDSHAKE_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors detected at the wire protocol level.',
+ `COUNT_PROXY_USER_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors detected when a proxy user is proxied to a user that does not exist.',
+ `COUNT_PROXY_USER_ACL_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors detected when a proxy user is proxied to a user that exists, but the proxy user doesn''t have the PROXY privilege.',
+ `COUNT_AUTHENTICATION_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors where authentication failed.',
+ `COUNT_SSL_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors due to TLS problems.',
+ `COUNT_MAX_USER_CONNECTIONS_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors due to the per-user quota being exceeded.',
+ `COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors due to the per-hour quota being exceeded.',
+ `COUNT_DEFAULT_DATABASE_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors due to the user not having permission to access the specified default database, or it not existing.',
+ `COUNT_INIT_CONNECT_ERRORS` bigint(20) NOT NULL COMMENT 'Number of errors due to statements in the init_connect system variable.',
+ `COUNT_LOCAL_ERRORS` bigint(20) NOT NULL COMMENT 'Number of local server errors, such as out-of-memory errors, unrelated to network, authentication, or authorization.',
+ `COUNT_UNKNOWN_ERRORS` bigint(20) NOT NULL COMMENT 'Number of unknown errors that cannot be allocated to another column.',
+ `FIRST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Timestamp of the first connection attempt by the IP.',
+ `LAST_SEEN` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Timestamp of the most recent connection attempt by the IP.',
+ `FIRST_ERROR_SEEN` timestamp NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Timestamp of the first error seen from the IP.',
+ `LAST_ERROR_SEEN` timestamp NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Timestamp of the most recent error seen from the IP.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table hosts;
Table Create Table
hosts CREATE TABLE `hosts` (
- `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `CURRENT_CONNECTIONS` bigint(20) NOT NULL,
- `TOTAL_CONNECTIONS` bigint(20) NOT NULL
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Host name used by the client to connect, NULL for internal threads or user sessions that failed to authenticate.',
+ `CURRENT_CONNECTIONS` bigint(20) NOT NULL COMMENT 'Current number of the host''s connections.',
+ `TOTAL_CONNECTIONS` bigint(20) NOT NULL COMMENT 'Total number of the host''s connections'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table mutex_instances;
Table Create Table
mutex_instances CREATE TABLE `mutex_instances` (
- `NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
- `LOCKED_BY_THREAD_ID` bigint(20) unsigned DEFAULT NULL
+ `NAME` varchar(128) NOT NULL COMMENT 'Instrument name associated with the mutex.',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'Memory address of the instrumented mutex.',
+ `LOCKED_BY_THREAD_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'The THREAD_ID of the locking thread if a thread has a mutex locked, otherwise NULL.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table objects_summary_global_by_type;
Table Create Table
objects_summary_global_by_type CREATE TABLE `objects_summary_global_by_type` (
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(64) DEFAULT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'Groups records together with OBJECT_SCHEMA and OBJECT_NAME.',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Groups records together with OBJECT_TYPE and OBJECT_NAME.',
+ `OBJECT_NAME` varchar(64) DEFAULT NULL COMMENT 'Groups records together with OBJECT_SCHEMA and OBJECT_TYPE.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table performance_timers;
Table Create Table
performance_timers CREATE TABLE `performance_timers` (
- `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL,
- `TIMER_FREQUENCY` bigint(20) DEFAULT NULL,
- `TIMER_RESOLUTION` bigint(20) DEFAULT NULL,
- `TIMER_OVERHEAD` bigint(20) DEFAULT NULL
+ `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL COMMENT 'Time name, used in the setup_timers table.',
+ `TIMER_FREQUENCY` bigint(20) DEFAULT NULL COMMENT 'Number of timer units per second. Dependent on the processor speed.',
+ `TIMER_RESOLUTION` bigint(20) DEFAULT NULL COMMENT 'Number of timer units by which timed values increase each time.',
+ `TIMER_OVERHEAD` bigint(20) DEFAULT NULL COMMENT 'Minimum timer overhead, determined during initialization by calling the timer 20 times and selecting the smallest value. Total overhead will be at least double this, as the timer is called at the beginning and end of each timed event.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table rwlock_instances;
Table Create Table
rwlock_instances CREATE TABLE `rwlock_instances` (
- `NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
- `WRITE_LOCKED_BY_THREAD_ID` bigint(20) unsigned DEFAULT NULL,
- `READ_LOCKED_BY_COUNT` int(10) unsigned NOT NULL
+ `NAME` varchar(128) NOT NULL COMMENT 'Instrument name associated with the read write lock',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'Address in memory of the instrumented lock',
+ `WRITE_LOCKED_BY_THREAD_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'THREAD_ID of the locking thread if locked in write (exclusive) mode, otherwise NULL.',
+ `READ_LOCKED_BY_COUNT` int(10) unsigned NOT NULL COMMENT 'Count of current read locks held'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table setup_actors;
Table Create Table
setup_actors CREATE TABLE `setup_actors` (
- `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
- `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
- `ROLE` char(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%'
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%' COMMENT 'Host name, either a literal, or the % wildcard representing any host.',
+ `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%' COMMENT 'User name, either a literal or the % wildcard representing any name.',
+ `ROLE` char(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%' COMMENT 'Unused'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table setup_consumers;
Table Create Table
setup_consumers CREATE TABLE `setup_consumers` (
- `NAME` varchar(64) NOT NULL,
- `ENABLED` enum('YES','NO') NOT NULL
+ `NAME` varchar(64) NOT NULL COMMENT 'Consumer name',
+ `ENABLED` enum('YES','NO') NOT NULL COMMENT 'YES or NO for whether or not the consumer is enabled. You can modify this column to ensure that event information is added, or is not added.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table setup_instruments;
Table Create Table
setup_instruments CREATE TABLE `setup_instruments` (
- `NAME` varchar(128) NOT NULL,
- `ENABLED` enum('YES','NO') NOT NULL,
- `TIMED` enum('YES','NO') NOT NULL
+ `NAME` varchar(128) NOT NULL COMMENT 'Instrument name',
+ `ENABLED` enum('YES','NO') NOT NULL COMMENT 'Whether or not the instrument is enabled. It can be disabled, and the instrument will produce no events.',
+ `TIMED` enum('YES','NO') NOT NULL COMMENT 'Whether or not the instrument is timed. It can be set, but if disabled, events produced by the instrument will have NULL values for the corresponding TIMER_START, TIMER_END, and TIMER_WAIT values.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table setup_objects;
Table Create Table
setup_objects CREATE TABLE `setup_objects` (
- `OBJECT_TYPE` enum('TABLE') NOT NULL DEFAULT 'TABLE',
- `OBJECT_SCHEMA` varchar(64) DEFAULT '%',
- `OBJECT_NAME` varchar(64) NOT NULL DEFAULT '%',
- `ENABLED` enum('YES','NO') NOT NULL DEFAULT 'YES',
- `TIMED` enum('YES','NO') NOT NULL DEFAULT 'YES'
+ `OBJECT_TYPE` enum('TABLE') NOT NULL DEFAULT 'TABLE' COMMENT 'Type of object to instrument. Currently, only TABLE, for base table.',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT '%' COMMENT 'Schema containing the object, either the literal or % for any schema.',
+ `OBJECT_NAME` varchar(64) NOT NULL DEFAULT '%' COMMENT 'Name of the instrumented object, either the literal or % for any object.',
+ `ENABLED` enum('YES','NO') NOT NULL DEFAULT 'YES' COMMENT 'Whether the object''s events are instrumented or not. Can be disabled, in which case monitoring is not enabled for those objects.',
+ `TIMED` enum('YES','NO') NOT NULL DEFAULT 'YES' COMMENT 'Whether the object''s events are timed or not. Can be modified.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table setup_timers;
Table Create Table
setup_timers CREATE TABLE `setup_timers` (
- `NAME` varchar(64) NOT NULL,
- `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL
+ `NAME` varchar(64) NOT NULL COMMENT 'Type of instrument the timer is used for.',
+ `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL COMMENT 'Timer applying to the instrument type. Can be modified.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table socket_instances;
Table Create Table
socket_instances CREATE TABLE `socket_instances` (
- `EVENT_NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
- `THREAD_ID` bigint(20) unsigned DEFAULT NULL,
- `SOCKET_ID` int(11) NOT NULL,
- `IP` varchar(64) NOT NULL,
- `PORT` int(11) NOT NULL,
- `STATE` enum('IDLE','ACTIVE') NOT NULL
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'NAME from the setup_instruments table, and the name of the wait/io/socket/* instrument that produced the event.',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'Memory address of the object.',
+ `THREAD_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'Thread identifier that the server assigns to each socket.',
+ `SOCKET_ID` int(11) NOT NULL COMMENT 'The socket''s internal file handle.',
+ `IP` varchar(64) NOT NULL COMMENT 'Client IP address. Blank for Unix socket file, otherwise an IPv4 or IPv6 address. Together with the PORT identifies the connection.',
+ `PORT` int(11) NOT NULL COMMENT 'TCP/IP port number, from 0 to 65535. Together with the IP identifies the connection.',
+ `STATE` enum('IDLE','ACTIVE') NOT NULL COMMENT 'Socket status, either IDLE if waiting to receive a request from a client, or ACTIVE'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table socket_summary_by_instance;
Table Create Table
socket_summary_by_instance CREATE TABLE `socket_summary_by_instance` (
- `EVENT_NAME` varchar(128) NOT NULL,
- `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `COUNT_READ` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL,
- `COUNT_MISC` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Socket instrument.',
+ `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL COMMENT 'Address in memory.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `COUNT_READ` bigint(20) unsigned NOT NULL COMMENT 'Number of all read operations, including RECV, RECVFROM, and RECVMSG.',
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all read operations that are timed.',
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all read operations that are timed.',
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all read operations that are timed.',
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all read operations that are timed.',
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL COMMENT 'Bytes read by read operations.',
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Number of all write operations, including SEND, SENDTO, and SENDMSG.',
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all write operations that are timed.',
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all write operations that are timed.',
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all write operations that are timed.',
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all write operations that are timed.',
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Bytes written by write operations.',
+ `COUNT_MISC` bigint(20) unsigned NOT NULL COMMENT 'Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN.',
+ `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all miscellaneous operations that are timed.',
+ `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all miscellaneous operations that are timed.',
+ `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all miscellaneous operations that are timed.',
+ `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all miscellaneous operations that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table socket_summary_by_event_name;
Table Create Table
socket_summary_by_event_name CREATE TABLE `socket_summary_by_event_name` (
- `EVENT_NAME` varchar(128) NOT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `COUNT_READ` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL,
- `COUNT_MISC` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
+ `EVENT_NAME` varchar(128) NOT NULL COMMENT 'Socket instrument.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `COUNT_READ` bigint(20) unsigned NOT NULL COMMENT 'Number of all read operations, including RECV, RECVFROM, and RECVMSG.',
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all read operations that are timed.',
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all read operations that are timed.',
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all read operations that are timed.',
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all read operations that are timed.',
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL COMMENT 'Bytes read by read operations.',
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Number of all write operations, including SEND, SENDTO, and SENDMSG.',
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all write operations that are timed.',
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all write operations that are timed.',
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all write operations that are timed.',
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all write operations that are timed.',
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Bytes written by write operations.',
+ `COUNT_MISC` bigint(20) unsigned NOT NULL COMMENT 'Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN.',
+ `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all miscellaneous operations that are timed.',
+ `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all miscellaneous operations that are timed.',
+ `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all miscellaneous operations that are timed.',
+ `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all miscellaneous operations that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table table_io_waits_summary_by_index_usage;
Table Create Table
table_io_waits_summary_by_index_usage CREATE TABLE `table_io_waits_summary_by_index_usage` (
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(64) DEFAULT NULL,
- `INDEX_NAME` varchar(64) DEFAULT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `COUNT_READ` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `COUNT_FETCH` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_FETCH` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_FETCH` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_FETCH` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_FETCH` bigint(20) unsigned NOT NULL,
- `COUNT_INSERT` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_INSERT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_INSERT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_INSERT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_INSERT` bigint(20) unsigned NOT NULL,
- `COUNT_UPDATE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
- `COUNT_DELETE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_DELETE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_DELETE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_DELETE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_DELETE` bigint(20) unsigned NOT NULL
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'TABLE in the case of all indexes.',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Schema name.',
+ `OBJECT_NAME` varchar(64) DEFAULT NULL COMMENT 'Table name.',
+ `INDEX_NAME` varchar(64) DEFAULT NULL COMMENT 'Index name, or PRIMARY for the primary index, NULL for no index (inserts are counted in this case).',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events and the sum of the x_READ and x_WRITE columns.',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `COUNT_READ` bigint(20) unsigned NOT NULL COMMENT 'Number of all read operations, and the sum of the equivalent x_FETCH columns.',
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all read operations that are timed.',
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all read operations that are timed.',
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all read operations that are timed.',
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all read operations that are timed.',
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns.',
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all write operations that are timed.',
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all write operations that are timed.',
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all write operations that are timed.',
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all write operations that are timed.',
+ `COUNT_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Number of all fetch operations.',
+ `SUM_TIMER_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all fetch operations that are timed.',
+ `MIN_TIMER_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all fetch operations that are timed.',
+ `AVG_TIMER_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all fetch operations that are timed.',
+ `MAX_TIMER_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all fetch operations that are timed.',
+ `COUNT_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Number of all insert operations.',
+ `SUM_TIMER_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all insert operations that are timed.',
+ `MIN_TIMER_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all insert operations that are timed.',
+ `AVG_TIMER_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all insert operations that are timed.',
+ `MAX_TIMER_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all insert operations that are timed.',
+ `COUNT_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Number of all update operations.',
+ `SUM_TIMER_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all update operations that are timed.',
+ `MIN_TIMER_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all update operations that are timed.',
+ `AVG_TIMER_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all update operations that are timed.',
+ `MAX_TIMER_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all update operations that are timed.',
+ `COUNT_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Number of all delete operations.',
+ `SUM_TIMER_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all delete operations that are timed.',
+ `MIN_TIMER_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all delete operations that are timed.',
+ `AVG_TIMER_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all delete operations that are timed.',
+ `MAX_TIMER_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all delete operations that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table table_io_waits_summary_by_table;
Table Create Table
table_io_waits_summary_by_table CREATE TABLE `table_io_waits_summary_by_table` (
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(64) DEFAULT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `COUNT_READ` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `COUNT_FETCH` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_FETCH` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_FETCH` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_FETCH` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_FETCH` bigint(20) unsigned NOT NULL,
- `COUNT_INSERT` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_INSERT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_INSERT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_INSERT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_INSERT` bigint(20) unsigned NOT NULL,
- `COUNT_UPDATE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_UPDATE` bigint(20) unsigned NOT NULL,
- `COUNT_DELETE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_DELETE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_DELETE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_DELETE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_DELETE` bigint(20) unsigned NOT NULL
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'Since this table records waits by table, always set to TABLE.',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Schema name.',
+ `OBJECT_NAME` varchar(64) DEFAULT NULL COMMENT 'Table name.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events and the sum of the x_READ and x_WRITE columns.',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `COUNT_READ` bigint(20) unsigned NOT NULL COMMENT 'Number of all read operations, and the sum of the equivalent x_FETCH columns.',
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all read operations that are timed.',
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all read operations that are timed.',
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all read operations that are timed.',
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all read operations that are timed.',
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns.',
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all write operations that are timed.',
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all write operations that are timed.',
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all write operations that are timed.',
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all write operations that are timed.',
+ `COUNT_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Number of all fetch operations.',
+ `SUM_TIMER_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all fetch operations that are timed.',
+ `MIN_TIMER_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all fetch operations that are timed.',
+ `AVG_TIMER_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all fetch operations that are timed.',
+ `MAX_TIMER_FETCH` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all fetch operations that are timed.',
+ `COUNT_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Number of all insert operations.',
+ `SUM_TIMER_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all insert operations that are timed.',
+ `MIN_TIMER_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all insert operations that are timed.',
+ `AVG_TIMER_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all insert operations that are timed.',
+ `MAX_TIMER_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all insert operations that are timed.',
+ `COUNT_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Number of all update operations.',
+ `SUM_TIMER_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all update operations that are timed.',
+ `MIN_TIMER_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all update operations that are timed.',
+ `AVG_TIMER_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all update operations that are timed.',
+ `MAX_TIMER_UPDATE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all update operations that are timed.',
+ `COUNT_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Number of all delete operations.',
+ `SUM_TIMER_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all delete operations that are timed.',
+ `MIN_TIMER_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all delete operations that are timed.',
+ `AVG_TIMER_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all delete operations that are timed.',
+ `MAX_TIMER_DELETE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all delete operations that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table table_lock_waits_summary_by_table;
Table Create Table
table_lock_waits_summary_by_table CREATE TABLE `table_lock_waits_summary_by_table` (
- `OBJECT_TYPE` varchar(64) DEFAULT NULL,
- `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
- `OBJECT_NAME` varchar(64) DEFAULT NULL,
- `COUNT_STAR` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
- `COUNT_READ` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
- `COUNT_READ_NORMAL` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL,
- `COUNT_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL,
- `COUNT_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL,
- `COUNT_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL,
- `COUNT_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL,
- `COUNT_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL,
- `SUM_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL,
- `MIN_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL,
- `AVG_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL,
- `MAX_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL COMMENT 'Since this table records waits by table, always set to TABLE.',
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL COMMENT 'Schema name.',
+ `OBJECT_NAME` varchar(64) DEFAULT NULL COMMENT 'Table name.',
+ `COUNT_STAR` bigint(20) unsigned NOT NULL COMMENT 'Number of summarized events and the sum of the x_READ and x_WRITE columns.',
+ `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of the summarized events that are timed.',
+ `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of the summarized events that are timed.',
+ `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of the summarized events that are timed.',
+ `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of the summarized events that are timed.',
+ `COUNT_READ` bigint(20) unsigned NOT NULL COMMENT 'Number of all read operations, and the sum of the equivalent x_READ_NORMAL, x_READ_WITH_SHARED_LOCKS, x_READ_HIGH_PRIORITY and x_READ_NO_INSERT columns.',
+ `SUM_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all read operations that are timed.',
+ `MIN_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all read operations that are timed.',
+ `AVG_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all read operations that are timed.',
+ `MAX_TIMER_READ` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all read operations that are timed.',
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Number of all write operations, and the sum of the equivalent x_WRITE_ALLOW_WRITE, x_WRITE_CONCURRENT_INSERT, x_WRITE_DELAYED, x_WRITE_LOW_PRIORITY and x_WRITE_NORMAL columns.',
+ `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all write operations that are timed.',
+ `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all write operations that are timed.',
+ `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all write operations that are timed.',
+ `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all write operations that are timed.',
+ `COUNT_READ_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Number of all internal read normal locks.',
+ `SUM_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all internal read normal locks that are timed.',
+ `MIN_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all internal read normal locks that are timed.',
+ `AVG_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all internal read normal locks that are timed.',
+ `MAX_TIMER_READ_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all internal read normal locks that are timed.',
+ `COUNT_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL COMMENT 'Number of all internal read with shared locks.',
+ `SUM_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all internal read with shared locks that are timed.',
+ `MIN_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all internal read with shared locks that are timed.',
+ `AVG_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all internal read with shared locks that are timed.',
+ `MAX_TIMER_READ_WITH_SHARED_LOCKS` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all internal read with shared locks that are timed.',
+ `COUNT_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Number of all internal read high priority locks.',
+ `SUM_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all internal read high priority locks that are timed.',
+ `MIN_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all internal read high priority locks that are timed.',
+ `AVG_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all internal read high priority locks that are timed.',
+ `MAX_TIMER_READ_HIGH_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all internal read high priority locks that are timed.',
+ `COUNT_READ_NO_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Number of all internal read no insert locks.',
+ `SUM_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all internal read no insert locks that are timed.',
+ `MIN_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all internal read no insert locks that are timed.',
+ `AVG_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all internal read no insert locks that are timed.',
+ `MAX_TIMER_READ_NO_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all internal read no insert locks that are timed.',
+ `COUNT_READ_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Number of all external read locks.',
+ `SUM_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all external read locks that are timed.',
+ `MIN_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all external read locks that are timed.',
+ `AVG_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all external read locks that are timed.',
+ `MAX_TIMER_READ_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all external read locks that are timed.',
+ `COUNT_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Number of all internal read normal locks.',
+ `SUM_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all internal write allow write locks that are timed.',
+ `MIN_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all internal write allow write locks that are timed.',
+ `AVG_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all internal write allow write locks that are timed.',
+ `MAX_TIMER_WRITE_ALLOW_WRITE` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all internal write allow write locks that are timed.',
+ `COUNT_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Number of all internal concurrent insert write locks.',
+ `SUM_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all internal concurrent insert write locks that are timed.',
+ `MIN_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all internal concurrent insert write locks that are timed.',
+ `AVG_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all internal concurrent insert write locks that are timed.',
+ `MAX_TIMER_WRITE_CONCURRENT_INSERT` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all internal concurrent insert write locks that are timed.',
+ `COUNT_WRITE_DELAYED` bigint(20) unsigned NOT NULL COMMENT 'Number of all internal write delayed locks.',
+ `SUM_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all internal write delayed locks that are timed.',
+ `MIN_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all internal write delayed locks that are timed.',
+ `AVG_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all internal write delayed locks that are timed.',
+ `MAX_TIMER_WRITE_DELAYED` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all internal write delayed locks that are timed.',
+ `COUNT_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Number of all internal write low priority locks.',
+ `SUM_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all internal write low priority locks that are timed.',
+ `MIN_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all internal write low priority locks that are timed.',
+ `AVG_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all internal write low priority locks that are timed.',
+ `MAX_TIMER_WRITE_LOW_PRIORITY` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all internal write low priority locks that are timed.',
+ `COUNT_WRITE_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Number of all internal write normal locks.',
+ `SUM_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all internal write normal locks that are timed.',
+ `MIN_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all internal write normal locks that are timed.',
+ `AVG_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all internal write normal locks that are timed.',
+ `MAX_TIMER_WRITE_NORMAL` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all internal write normal locks that are timed.',
+ `COUNT_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Number of all external write locks.',
+ `SUM_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Total wait time of all external write locks that are timed.',
+ `MIN_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Minimum wait time of all external write locks that are timed.',
+ `AVG_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Average wait time of all external write locks that are timed.',
+ `MAX_TIMER_WRITE_EXTERNAL` bigint(20) unsigned NOT NULL COMMENT 'Maximum wait time of all external write locks that are timed.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table threads;
Table Create Table
threads CREATE TABLE `threads` (
- `THREAD_ID` bigint(20) unsigned NOT NULL,
- `NAME` varchar(128) NOT NULL,
- `TYPE` varchar(10) NOT NULL,
- `PROCESSLIST_ID` bigint(20) unsigned DEFAULT NULL,
- `PROCESSLIST_USER` varchar(128) DEFAULT NULL,
- `PROCESSLIST_HOST` varchar(60) DEFAULT NULL,
- `PROCESSLIST_DB` varchar(64) DEFAULT NULL,
- `PROCESSLIST_COMMAND` varchar(16) DEFAULT NULL,
- `PROCESSLIST_TIME` bigint(20) DEFAULT NULL,
- `PROCESSLIST_STATE` varchar(64) DEFAULT NULL,
- `PROCESSLIST_INFO` longtext DEFAULT NULL,
- `PARENT_THREAD_ID` bigint(20) unsigned DEFAULT NULL,
- `ROLE` varchar(64) DEFAULT NULL,
- `INSTRUMENTED` enum('YES','NO') NOT NULL
+ `THREAD_ID` bigint(20) unsigned NOT NULL COMMENT 'A unique thread identifier.',
+ `NAME` varchar(128) NOT NULL COMMENT 'Name associated with the server''s thread instrumentation code, for example thread/sql/main for the server''s main() function, and thread/sql/one_connection for a user connection.',
+ `TYPE` varchar(10) NOT NULL COMMENT 'FOREGROUND or BACKGROUND, depending on the thread type. User connection threads are FOREGROUND, internal server threads are BACKGROUND.',
+ `PROCESSLIST_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'The PROCESSLIST.ID value for threads displayed in the INFORMATION_SCHEMA.PROCESSLIST table, or 0 for background threads. Also corresponds with the CONNECTION_ID() return value for the thread.',
+ `PROCESSLIST_USER` varchar(128) DEFAULT NULL COMMENT 'Foreground thread user, or NULL for a background thread.',
+ `PROCESSLIST_HOST` varchar(60) DEFAULT NULL COMMENT 'Foreground thread host, or NULL for a background thread.',
+ `PROCESSLIST_DB` varchar(64) DEFAULT NULL COMMENT 'Thread''s default database, or NULL if none exists.',
+ `PROCESSLIST_COMMAND` varchar(16) DEFAULT NULL COMMENT 'Type of command executed by the thread. These correspond to the the COM_xxx client/server protocol commands, and the Com_xxx status variables. See Thread Command Values.',
+ `PROCESSLIST_TIME` bigint(20) DEFAULT NULL COMMENT 'Time in seconds the thread has been in its current state.',
+ `PROCESSLIST_STATE` varchar(64) DEFAULT NULL COMMENT 'Action, event or state indicating what the thread is doing.',
+ `PROCESSLIST_INFO` longtext DEFAULT NULL COMMENT 'Statement being executed by the thread, or NULL if a statement is not being executed. If a statement results in calling other statements, such as for a stored procedure, the innermost statement from the stored procedure is shown here.',
+ `PARENT_THREAD_ID` bigint(20) unsigned DEFAULT NULL COMMENT 'THREAD_ID of the parent thread, if any. Subthreads can for example be spawned as a result of INSERT DELAYED statements.',
+ `ROLE` varchar(64) DEFAULT NULL COMMENT 'Unused.',
+ `INSTRUMENTED` enum('YES','NO') NOT NULL COMMENT 'YES or NO for Whether the thread is instrumented or not. For foreground threads, the initial value is determined by whether there''s a user/host match in the setup_actors table. Subthreads are again matched, while for background threads, this will be set to YES by default. To monitor events that the thread executes, INSTRUMENTED must be YES and the thread_instrumentation consumer in the setup_consumers table must also be YES.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
show create table users;
Table Create Table
users CREATE TABLE `users` (
- `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
- `CURRENT_CONNECTIONS` bigint(20) NOT NULL,
- `TOTAL_CONNECTIONS` bigint(20) NOT NULL
+ `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'The connection''s client user name for the connection, or NULL if an internal thread.',
+ `CURRENT_CONNECTIONS` bigint(20) NOT NULL COMMENT 'Current connections for the user.',
+ `TOTAL_CONNECTIONS` bigint(20) NOT NULL COMMENT 'Total connections for the user.'
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
diff --git a/mysql-test/suite/perfschema/r/table_schema.result b/mysql-test/suite/perfschema/r/table_schema.result
index a9beee31f28..12cddc08e3b 100644
--- a/mysql-test/suite/perfschema/r/table_schema.result
+++ b/mysql-test/suite/perfschema/r/table_schema.result
@@ -1,801 +1,801 @@
select * from information_schema.columns where table_schema="performance_schema"
order by table_name, ordinal_position;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def performance_schema accounts USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema accounts HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
-def performance_schema accounts CURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema accounts TOTAL_CONNECTIONS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema cond_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema cond_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_stages_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_current NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_current NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL
-def performance_schema events_stages_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_stages_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_history_long NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
-def performance_schema events_statements_current DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
-def performance_schema events_statements_current CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8 utf8_general_ci varchar(5) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_current ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_current NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL
-def performance_schema events_statements_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
-def performance_schema events_statements_history DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
-def performance_schema events_statements_history CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8 utf8_general_ci varchar(5) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8 utf8_general_ci varchar(5) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_history_long NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_ERRORS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_WARNINGS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_AFFECTED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_SENT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_EXAMINED 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_DISK_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_TABLES 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_RANGE_JOIN 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE_CHECK 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_SCAN 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_MERGE_PASSES 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_RANGE 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_ROWS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_SCAN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_GOOD_INDEX_USED 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SCHEMA_NAME 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest DIGEST 2 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest DIGEST_TEXT 3 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_ERRORS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_WARNINGS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_ROWS_AFFECTED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_ROWS_SENT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_ROWS_EXAMINED 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_DISK_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_TABLES 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_RANGE_JOIN 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE_CHECK 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_SCAN 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SORT_MERGE_PASSES 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SORT_RANGE 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SORT_ROWS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SORT_SCAN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_NO_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_NO_GOOD_INDEX_USED 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest FIRST_SEEN 28 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_digest LAST_SEEN 29 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_LOCK_TIME 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_ERRORS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_WARNINGS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_AFFECTED 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_SENT 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_EXAMINED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_DISK_TABLES 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_JOIN 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_RANGE_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE_CHECK 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_SCAN 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SORT_MERGE_PASSES 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SORT_RANGE 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SORT_ROWS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SORT_SCAN 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_NO_INDEX_USED 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_NO_GOOD_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_current OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
-def performance_schema events_waits_current INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_current OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_current OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_current NESTING_EVENT_TYPE 16 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL
-def performance_schema events_waits_current OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references NEVER NULL
-def performance_schema events_waits_current NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema events_waits_current FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history NESTING_EVENT_TYPE 16 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL
-def performance_schema events_waits_history OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long NESTING_EVENT_TYPE 16 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema events_waits_history_long FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_instances FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
-def performance_schema file_instances EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema file_instances OPEN_COUNT 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance OBJECT_INSTANCE_BEGIN 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_READ 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance COUNT_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance SUM_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance MIN_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance AVG_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema file_summary_by_instance MAX_TIMER_MISC 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema hosts HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
-def performance_schema hosts CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema hosts TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache IP 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema host_cache HOST 2 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255) select,insert,update,references NEVER NULL
-def performance_schema host_cache HOST_VALIDATED 3 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
-def performance_schema host_cache SUM_CONNECT_ERRORS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_HOST_BLOCKED_ERRORS 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_NAMEINFO_TRANSIENT_ERRORS 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_NAMEINFO_PERMANENT_ERRORS 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_FORMAT_ERRORS 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_ADDRINFO_TRANSIENT_ERRORS 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_ADDRINFO_PERMANENT_ERRORS 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_FCRDNS_ERRORS 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_HOST_ACL_ERRORS 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_NO_AUTH_PLUGIN_ERRORS 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_AUTH_PLUGIN_ERRORS 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_HANDSHAKE_ERRORS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_PROXY_USER_ERRORS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_PROXY_USER_ACL_ERRORS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_AUTHENTICATION_ERRORS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_SSL_ERRORS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_ERRORS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_DEFAULT_DATABASE_ERRORS 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_INIT_CONNECT_ERRORS 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_LOCAL_ERRORS 24 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache COUNT_UNKNOWN_ERRORS 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema host_cache FIRST_SEEN 26 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def performance_schema host_cache LAST_SEEN 27 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def performance_schema host_cache FIRST_ERROR_SEEN 28 '0000-00-00 00:00:00' YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def performance_schema host_cache LAST_ERROR_SEEN 29 '0000-00-00 00:00:00' YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def performance_schema mutex_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema mutex_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema mutex_instances LOCKED_BY_THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema objects_summary_global_by_type OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema objects_summary_global_by_type OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema objects_summary_global_by_type OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema objects_summary_global_by_type COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema objects_summary_global_by_type SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema objects_summary_global_by_type MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema objects_summary_global_by_type AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema objects_summary_global_by_type MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema performance_timers TIMER_NAME 1 NULL NO enum 11 33 NULL NULL NULL utf8 utf8_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references NEVER NULL
-def performance_schema performance_timers TIMER_FREQUENCY 2 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema performance_timers TIMER_RESOLUTION 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema performance_timers TIMER_OVERHEAD 4 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema rwlock_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema rwlock_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema rwlock_instances WRITE_LOCKED_BY_THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema rwlock_instances READ_LOCKED_BY_COUNT 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def performance_schema session_account_connect_attrs PROCESSLIST_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def performance_schema session_account_connect_attrs ATTR_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_bin varchar(32) select,insert,update,references NEVER NULL
-def performance_schema session_account_connect_attrs ATTR_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_bin varchar(1024) select,insert,update,references NEVER NULL
-def performance_schema session_account_connect_attrs ORDINAL_POSITION 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def performance_schema session_connect_attrs PROCESSLIST_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def performance_schema session_connect_attrs ATTR_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_bin varchar(32) select,insert,update,references NEVER NULL
-def performance_schema session_connect_attrs ATTR_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_bin varchar(1024) select,insert,update,references NEVER NULL
-def performance_schema session_connect_attrs ORDINAL_POSITION 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def performance_schema setup_actors HOST 1 '%' NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
-def performance_schema setup_actors USER 2 '%' NO char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema setup_actors ROLE 3 '%' NO char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema setup_consumers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema setup_consumers ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
-def performance_schema setup_instruments NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema setup_instruments ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
-def performance_schema setup_instruments TIMED 3 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
-def performance_schema setup_objects OBJECT_TYPE 1 'TABLE' NO enum 5 15 NULL NULL NULL utf8 utf8_general_ci enum('TABLE') select,insert,update,references NEVER NULL
-def performance_schema setup_objects OBJECT_SCHEMA 2 '%' YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema setup_objects OBJECT_NAME 3 '%' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema setup_objects ENABLED 4 'YES' NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
-def performance_schema setup_objects TIMED 5 'YES' NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
-def performance_schema setup_timers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema setup_timers TIMER_NAME 2 NULL NO enum 11 33 NULL NULL NULL utf8 utf8_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references NEVER NULL
-def performance_schema socket_instances EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema socket_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_instances THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_instances SOCKET_ID 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def performance_schema socket_instances IP 5 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema socket_instances PORT 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def performance_schema socket_instances STATE 7 NULL NO enum 6 18 NULL NULL NULL utf8 utf8_general_ci enum('IDLE','ACTIVE') select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance COUNT_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance SUM_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance MIN_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance AVG_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance MAX_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance COUNT_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance SUM_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance MIN_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance AVG_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema socket_summary_by_instance MAX_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage INDEX_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_STAR 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WAIT 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_READ 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_FETCH 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_INSERT 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_UPDATE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_DELETE 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_FETCH 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_INSERT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_UPDATE 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_DELETE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_NORMAL 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NORMAL 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NORMAL 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NORMAL 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NORMAL 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_WITH_SHARED_LOCKS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_WITH_SHARED_LOCKS 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_WITH_SHARED_LOCKS 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_WITH_SHARED_LOCKS 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_WITH_SHARED_LOCKS 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_HIGH_PRIORITY 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_HIGH_PRIORITY 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_HIGH_PRIORITY 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_HIGH_PRIORITY 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_HIGH_PRIORITY 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_NO_INSERT 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NO_INSERT 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NO_INSERT 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NO_INSERT 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NO_INSERT 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_EXTERNAL 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_EXTERNAL 40 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_EXTERNAL 41 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_EXTERNAL 42 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_EXTERNAL 43 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_ALLOW_WRITE 44 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_ALLOW_WRITE 45 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_ALLOW_WRITE 46 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_ALLOW_WRITE 47 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_ALLOW_WRITE 48 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_CONCURRENT_INSERT 49 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_CONCURRENT_INSERT 50 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_CONCURRENT_INSERT 51 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_CONCURRENT_INSERT 52 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_CONCURRENT_INSERT 53 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_DELAYED 54 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_DELAYED 55 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_DELAYED 56 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_DELAYED 57 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_DELAYED 58 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_LOW_PRIORITY 59 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_LOW_PRIORITY 60 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_LOW_PRIORITY 61 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_LOW_PRIORITY 62 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_LOW_PRIORITY 63 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_NORMAL 64 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_NORMAL 65 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_NORMAL 66 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_NORMAL 67 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_NORMAL 68 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_EXTERNAL 69 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_EXTERNAL 70 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_EXTERNAL 71 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_EXTERNAL 72 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_EXTERNAL 73 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema threads THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema threads NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema threads TYPE 3 NULL NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) select,insert,update,references NEVER NULL
-def performance_schema threads PROCESSLIST_ID 4 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema threads PROCESSLIST_USER 5 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
-def performance_schema threads PROCESSLIST_HOST 6 NULL YES varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) select,insert,update,references NEVER NULL
-def performance_schema threads PROCESSLIST_DB 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema threads PROCESSLIST_COMMAND 8 NULL YES varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select,insert,update,references NEVER NULL
-def performance_schema threads PROCESSLIST_TIME 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema threads PROCESSLIST_STATE 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema threads PROCESSLIST_INFO 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
-def performance_schema threads PARENT_THREAD_ID 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def performance_schema threads ROLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL
-def performance_schema threads INSTRUMENTED 14 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
-def performance_schema users USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL
-def performance_schema users CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def performance_schema users TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
+def performance_schema accounts USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references The connection's client user name for the connection, or NULL if an internal thread. NEVER NULL
+def performance_schema accounts HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references The connection client's host name, or NULL if an internal thread. NEVER NULL
+def performance_schema accounts CURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current connections for the account. NEVER NULL
+def performance_schema accounts TOTAL_CONNECTIONS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Total connections for the account. NEVER NULL
+def performance_schema cond_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Client user name for the connection, or NULL if an internal thread. NEVER NULL
+def performance_schema cond_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the instrumented condition. NEVER NULL
+def performance_schema events_stages_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_stages_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_stages_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
+def performance_schema events_stages_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
+def performance_schema events_stages_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
+def performance_schema events_stages_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
+def performance_schema events_stages_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_stages_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_stages_current NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
+def performance_schema events_stages_current NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL
+def performance_schema events_stages_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_stages_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_stages_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
+def performance_schema events_stages_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
+def performance_schema events_stages_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
+def performance_schema events_stages_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
+def performance_schema events_stages_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_stages_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_stages_history NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
+def performance_schema events_stages_history NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL
+def performance_schema events_stages_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_stages_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_stages_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
+def performance_schema events_stages_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
+def performance_schema events_stages_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
+def performance_schema events_stages_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
+def performance_schema events_stages_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_stages_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_stages_history_long NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
+def performance_schema events_stages_history_long NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL
+def performance_schema events_stages_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references User. Used together with HOST and EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_stages_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references Host. Used together with USER and EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_stages_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL
+def performance_schema events_stages_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
+def performance_schema events_stages_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references Host. Used together with EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_stages_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with HOST for grouping events. NEVER NULL
+def performance_schema events_stages_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
+def performance_schema events_stages_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_NAME uniquely identifies the row. NEVER NULL
+def performance_schema events_stages_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with THREAD_ID for grouping events. NEVER NULL
+def performance_schema events_stages_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
+def performance_schema events_stages_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references User. Used together with EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_stages_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with USER for grouping events. NEVER NULL
+def performance_schema events_stages_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
+def performance_schema events_stages_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
+def performance_schema events_stages_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
+def performance_schema events_stages_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
+def performance_schema events_stages_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
+def performance_schema events_statements_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_statements_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_statements_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
+def performance_schema events_statements_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
+def performance_schema events_statements_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
+def performance_schema events_statements_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
+def performance_schema events_statements_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_statements_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_statements_current LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. NEVER NULL
+def performance_schema events_statements_current SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references The SQL statement, or NULL if the command is not associated with an SQL statement. NEVER NULL
+def performance_schema events_statements_current DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references Statement digest. NEVER NULL
+def performance_schema events_statements_current DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references Statement digest text. NEVER NULL
+def performance_schema events_statements_current CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Statement's default database for the statement, or NULL if there was none. NEVER NULL
+def performance_schema events_statements_current OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Reserved, currently NULL NEVER NULL
+def performance_schema events_statements_current OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Reserved, currently NULL NEVER NULL
+def performance_schema events_statements_current OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Reserved, currently NULL NEVER NULL
+def performance_schema events_statements_current OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the statement object. NEVER NULL
+def performance_schema events_statements_current MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Error code. See MariaDB Error Codes for a full list. NEVER NULL
+def performance_schema events_statements_current RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8 utf8_general_ci varchar(5) select,insert,update,references The SQLSTATE value. NEVER NULL
+def performance_schema events_statements_current MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Statement error message. See MariaDB Error Codes. NEVER NULL
+def performance_schema events_statements_current ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1. NEVER NULL
+def performance_schema events_statements_current WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of warnings from the diagnostics area. NEVER NULL
+def performance_schema events_statements_current ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows affected the statement affected. NEVER NULL
+def performance_schema events_statements_current ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows returned. NEVER NULL
+def performance_schema events_statements_current ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows read during the statement's execution. NEVER NULL
+def performance_schema events_statements_current CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of on-disk temp tables created by the statement. NEVER NULL
+def performance_schema events_statements_current CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of temp tables created by the statement. NEVER NULL
+def performance_schema events_statements_current SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which did not use an index. NEVER NULL
+def performance_schema events_statements_current SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range search of the first table. NEVER NULL
+def performance_schema events_statements_current SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range of the first table. NEVER NULL
+def performance_schema events_statements_current SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins without keys performed by the statement that check for key usage after each row. NEVER NULL
+def performance_schema events_statements_current SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a full scan of the first table. NEVER NULL
+def performance_schema events_statements_current SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size. NEVER NULL
+def performance_schema events_statements_current SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a range. NEVER NULL
+def performance_schema events_statements_current SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows sorted by the statement. NEVER NULL
+def performance_schema events_statements_current SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a full table scan. NEVER NULL
+def performance_schema events_statements_current NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if the statement performed a table scan with an index, 1 if without an index. NEVER NULL
+def performance_schema events_statements_current NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article. NEVER NULL
+def performance_schema events_statements_current NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Reserved, currently NULL. NEVER NULL
+def performance_schema events_statements_current NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references Reserved, currently NULL. NEVER NULL
+def performance_schema events_statements_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_statements_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_statements_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
+def performance_schema events_statements_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
+def performance_schema events_statements_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
+def performance_schema events_statements_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
+def performance_schema events_statements_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_statements_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_statements_history LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. NEVER NULL
+def performance_schema events_statements_history SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references The SQL statement, or NULL if the command is not associated with an SQL statement. NEVER NULL
+def performance_schema events_statements_history DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references Statement digest. NEVER NULL
+def performance_schema events_statements_history DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references Statement digest text. NEVER NULL
+def performance_schema events_statements_history CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Statement's default database for the statement, or NULL if there was none. NEVER NULL
+def performance_schema events_statements_history OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Reserved, currently NULL NEVER NULL
+def performance_schema events_statements_history OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Reserved, currently NULL NEVER NULL
+def performance_schema events_statements_history OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Reserved, currently NULL NEVER NULL
+def performance_schema events_statements_history OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the statement object. NEVER NULL
+def performance_schema events_statements_history MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Error code. See MariaDB Error Codes for a full list. NEVER NULL
+def performance_schema events_statements_history RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8 utf8_general_ci varchar(5) select,insert,update,references The SQLSTATE value. NEVER NULL
+def performance_schema events_statements_history MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Statement error message. See MariaDB Error Codes. NEVER NULL
+def performance_schema events_statements_history ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1. NEVER NULL
+def performance_schema events_statements_history WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of warnings from the diagnostics area. NEVER NULL
+def performance_schema events_statements_history ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows affected the statement affected. NEVER NULL
+def performance_schema events_statements_history ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows returned. NEVER NULL
+def performance_schema events_statements_history ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows read during the statement's execution. NEVER NULL
+def performance_schema events_statements_history CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of on-disk temp tables created by the statement. NEVER NULL
+def performance_schema events_statements_history CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of temp tables created by the statement. NEVER NULL
+def performance_schema events_statements_history SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which did not use an index. NEVER NULL
+def performance_schema events_statements_history SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range search of the first table. NEVER NULL
+def performance_schema events_statements_history SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range of the first table. NEVER NULL
+def performance_schema events_statements_history SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins without keys performed by the statement that check for key usage after each row. NEVER NULL
+def performance_schema events_statements_history SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a full scan of the first table. NEVER NULL
+def performance_schema events_statements_history SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size. NEVER NULL
+def performance_schema events_statements_history SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a range. NEVER NULL
+def performance_schema events_statements_history SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows sorted by the statement. NEVER NULL
+def performance_schema events_statements_history SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a full table scan. NEVER NULL
+def performance_schema events_statements_history NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if the statement performed a table scan with an index, 1 if without an index. NEVER NULL
+def performance_schema events_statements_history NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article. NEVER NULL
+def performance_schema events_statements_history NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Reserved, currently NULL. NEVER NULL
+def performance_schema events_statements_history NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references Reserved, currently NULL. NEVER NULL
+def performance_schema events_statements_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_statements_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_statements_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
+def performance_schema events_statements_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
+def performance_schema events_statements_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
+def performance_schema events_statements_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
+def performance_schema events_statements_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_statements_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_statements_history_long LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. NEVER NULL
+def performance_schema events_statements_history_long SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references The SQL statement, or NULL if the command is not associated with an SQL statement. NEVER NULL
+def performance_schema events_statements_history_long DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references Statement digest. NEVER NULL
+def performance_schema events_statements_history_long DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references Statement digest text. NEVER NULL
+def performance_schema events_statements_history_long CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Statement's default database for the statement, or NULL if there was none. NEVER NULL
+def performance_schema events_statements_history_long OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Reserved, currently NULL NEVER NULL
+def performance_schema events_statements_history_long OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Reserved, currently NULL NEVER NULL
+def performance_schema events_statements_history_long OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Reserved, currently NULL NEVER NULL
+def performance_schema events_statements_history_long OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the statement object. NEVER NULL
+def performance_schema events_statements_history_long MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Error code. See MariaDB Error Codes for a full list. NEVER NULL
+def performance_schema events_statements_history_long RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8 utf8_general_ci varchar(5) select,insert,update,references The SQLSTATE value. NEVER NULL
+def performance_schema events_statements_history_long MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Statement error message. See MariaDB Error Codes. NEVER NULL
+def performance_schema events_statements_history_long ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1. NEVER NULL
+def performance_schema events_statements_history_long WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of warnings from the diagnostics area. NEVER NULL
+def performance_schema events_statements_history_long ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows affected the statement affected. NEVER NULL
+def performance_schema events_statements_history_long ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows returned. NEVER NULL
+def performance_schema events_statements_history_long ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows read during the statement's execution. NEVER NULL
+def performance_schema events_statements_history_long CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of on-disk temp tables created by the statement. NEVER NULL
+def performance_schema events_statements_history_long CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of temp tables created by the statement. NEVER NULL
+def performance_schema events_statements_history_long SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which did not use an index. NEVER NULL
+def performance_schema events_statements_history_long SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range search of the first table. NEVER NULL
+def performance_schema events_statements_history_long SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range of the first table. NEVER NULL
+def performance_schema events_statements_history_long SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins without keys performed by the statement that check for key usage after each row. NEVER NULL
+def performance_schema events_statements_history_long SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a full scan of the first table. NEVER NULL
+def performance_schema events_statements_history_long SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size. NEVER NULL
+def performance_schema events_statements_history_long SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a range. NEVER NULL
+def performance_schema events_statements_history_long SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows sorted by the statement. NEVER NULL
+def performance_schema events_statements_history_long SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a full table scan. NEVER NULL
+def performance_schema events_statements_history_long NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if the statement performed a table scan with an index, 1 if without an index. NEVER NULL
+def performance_schema events_statements_history_long NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article. NEVER NULL
+def performance_schema events_statements_history_long NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Reserved, currently NULL. NEVER NULL
+def performance_schema events_statements_history_long NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references Reserved, currently NULL. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references User. Used together with HOST and EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references Host. Used together with USER and EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ERRORS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_WARNINGS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_AFFECTED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_SENT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_EXAMINED 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_DISK_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_TABLES 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_RANGE_JOIN 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE_CHECK 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_SCAN 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_MERGE_PASSES 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_RANGE 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_ROWS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_SCAN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_GOOD_INDEX_USED 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SCHEMA_NAME 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Database name. Records are summarised together with DIGEST. NEVER NULL
+def performance_schema events_statements_summary_by_digest DIGEST 2 NULL YES varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references Performance Schema digest. Records are summarised together with SCHEMA NAME. NEVER NULL
+def performance_schema events_statements_summary_by_digest DIGEST_TEXT 3 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references The unhashed form of the digest. NEVER NULL
+def performance_schema events_statements_summary_by_digest COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_digest MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_digest AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_digest MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_ERRORS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_WARNINGS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_ROWS_AFFECTED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_ROWS_SENT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_ROWS_EXAMINED 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_DISK_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_TABLES 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_RANGE_JOIN 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE_CHECK 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_SELECT_SCAN 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_SORT_MERGE_PASSES 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_SORT_RANGE 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_SORT_ROWS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_SORT_SCAN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_NO_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest SUM_NO_GOOD_INDEX_USED 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_digest FIRST_SEEN 28 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Time at which the digest was first seen. NEVER NULL
+def performance_schema events_statements_summary_by_digest LAST_SEEN 29 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Time at which the digest was most recently seen. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references Host. Used together with EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with HOST for grouping events. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_currentd table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOINW column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_NAME uniquely identifies the row. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with THREAD_ID for grouping events. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references User. Used together with EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with USER for grouping events. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_LOCK_TIME 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_ERRORS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_WARNINGS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_AFFECTED 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_SENT 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_EXAMINED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_DISK_TABLES 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_JOIN 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_RANGE_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE_CHECK 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_SCAN 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_MERGE_PASSES 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_RANGE 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_ROWS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_SCAN 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_NO_INDEX_USED 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_statements_summary_global_by_event_name SUM_NO_GOOD_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
+def performance_schema events_waits_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_waits_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_waits_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
+def performance_schema events_waits_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
+def performance_schema events_waits_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
+def performance_schema events_waits_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
+def performance_schema events_waits_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_waits_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_waits_current SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented. NEVER NULL
+def performance_schema events_waits_current OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects. NEVER NULL
+def performance_schema events_waits_current OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object. NEVER NULL
+def performance_schema events_waits_current INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name of the index, PRIMARY for the primary key, or NULL for no index used. NEVER NULL
+def performance_schema events_waits_current OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object. NEVER NULL
+def performance_schema events_waits_current OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the object. NEVER NULL
+def performance_schema events_waits_current NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
+def performance_schema events_waits_current NESTING_EVENT_TYPE 16 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL
+def performance_schema events_waits_current OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references Operation type, for example read, write or lock NEVER NULL
+def performance_schema events_waits_current NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of bytes that the operation read or wrote, or NULL for table I/O waits. NEVER NULL
+def performance_schema events_waits_current FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Reserved for use in the future. NEVER NULL
+def performance_schema events_waits_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_waits_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_waits_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
+def performance_schema events_waits_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
+def performance_schema events_waits_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
+def performance_schema events_waits_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
+def performance_schema events_waits_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_waits_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_waits_history SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented. NEVER NULL
+def performance_schema events_waits_history OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects. NEVER NULL
+def performance_schema events_waits_history OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object. NEVER NULL
+def performance_schema events_waits_history INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name of the index, PRIMARY for the primary key, or NULL for no index used. NEVER NULL
+def performance_schema events_waits_history OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object. NEVER NULL
+def performance_schema events_waits_history OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the object. NEVER NULL
+def performance_schema events_waits_history NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
+def performance_schema events_waits_history NESTING_EVENT_TYPE 16 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL
+def performance_schema events_waits_history OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references Operation type, for example read, write or lock NEVER NULL
+def performance_schema events_waits_history NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of bytes that the operation read or wrote, or NULL for table I/O waits. NEVER NULL
+def performance_schema events_waits_history FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Reserved for use in the future. NEVER NULL
+def performance_schema events_waits_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_waits_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
+def performance_schema events_waits_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
+def performance_schema events_waits_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
+def performance_schema events_waits_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
+def performance_schema events_waits_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
+def performance_schema events_waits_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_waits_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
+def performance_schema events_waits_history_long SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented. NEVER NULL
+def performance_schema events_waits_history_long OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects. NEVER NULL
+def performance_schema events_waits_history_long OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object. NEVER NULL
+def performance_schema events_waits_history_long INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name of the index, PRIMARY for the primary key, or NULL for no index used. NEVER NULL
+def performance_schema events_waits_history_long OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object. NEVER NULL
+def performance_schema events_waits_history_long OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the object. NEVER NULL
+def performance_schema events_waits_history_long NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
+def performance_schema events_waits_history_long NESTING_EVENT_TYPE 16 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL
+def performance_schema events_waits_history_long OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references Operation type, for example read, write or lock NEVER NULL
+def performance_schema events_waits_history_long NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of bytes that the operation read or wrote, or NULL for table I/O waits. NEVER NULL
+def performance_schema events_waits_history_long FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Reserved for use in the future. NEVER NULL
+def performance_schema events_waits_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references User. Used together with HOST and EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_waits_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references Host. Used together with USER and EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_waits_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL
+def performance_schema events_waits_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_waits_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references Host. Used together with EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_waits_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL
+def performance_schema events_waits_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_waits_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with OBJECT_INSTANCE_BEGIN for grouping events. NEVER NULL
+def performance_schema events_waits_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references If an instrument creates multiple instances, each instance has a unique OBJECT_INSTANCE_BEGIN value to allow for grouping by instance. NEVER NULL
+def performance_schema events_waits_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_waits_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_NAME uniquely identifies the row. NEVER NULL
+def performance_schema events_waits_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with THREAD_ID for grouping events. NEVER NULL
+def performance_schema events_waits_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_waits_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references User. Used together with EVENT_NAME for grouping events. NEVER NULL
+def performance_schema events_waits_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. Used together with USER for grouping events. NEVER NULL
+def performance_schema events_waits_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_waits_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
+def performance_schema events_waits_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema events_waits_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema events_waits_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema file_instances FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references File name. NEVER NULL
+def performance_schema file_instances EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Instrument name associated with the file. NEVER NULL
+def performance_schema file_instances OPEN_COUNT 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Open handles on the file. A value of greater than zero means that the file is currently open. NEVER NULL
+def performance_schema file_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
+def performance_schema file_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema file_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including FGETS, FGETC, FREAD, and READ. NEVER NULL
+def performance_schema file_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes read by read operations. NEVER NULL
+def performance_schema file_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE. NEVER NULL
+def performance_schema file_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes written by write operations. NEVER NULL
+def performance_schema file_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC. NEVER NULL
+def performance_schema file_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema file_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references File name. NEVER NULL
+def performance_schema file_summary_by_instance EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
+def performance_schema file_summary_by_instance OBJECT_INSTANCE_BEGIN 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory. Together with FILE_NAME and EVENT_NAME uniquely identifies a row. NEVER NULL
+def performance_schema file_summary_by_instance COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema file_summary_by_instance SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema file_summary_by_instance MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema file_summary_by_instance AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema file_summary_by_instance MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema file_summary_by_instance COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including FGETS, FGETC, FREAD, and READ. NEVER NULL
+def performance_schema file_summary_by_instance SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_READ 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes read by read operations. NEVER NULL
+def performance_schema file_summary_by_instance COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE. NEVER NULL
+def performance_schema file_summary_by_instance SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes written by write operations. NEVER NULL
+def performance_schema file_summary_by_instance COUNT_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC. NEVER NULL
+def performance_schema file_summary_by_instance SUM_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance MIN_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance AVG_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema file_summary_by_instance MAX_TIMER_MISC 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema hosts HOST 1 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references Host name used by the client to connect, NULL for internal threads or user sessions that failed to authenticate. NEVER NULL
+def performance_schema hosts CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of the host's connections. NEVER NULL
+def performance_schema hosts TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Total number of the host's connections NEVER NULL
+def performance_schema host_cache IP 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Client IP address. NEVER NULL
+def performance_schema host_cache HOST 2 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_bin varchar(255) select,insert,update,references IP's resolved DNS host name, or NULL if unknown. NEVER NULL
+def performance_schema host_cache HOST_VALIDATED 3 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references YES if the IP-to-host DNS lookup was successful, and the HOST column can be used to avoid DNS calls, or NO if unsuccessful, in which case DNS lookup is performed for each connect until either successful or a permanent error. NEVER NULL
+def performance_schema host_cache SUM_CONNECT_ERRORS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of connection errors. Counts only protocol handshake errors for hosts that passed validation. These errors count towards max_connect_errors. NEVER NULL
+def performance_schema host_cache COUNT_HOST_BLOCKED_ERRORS 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of blocked connections because SUM_CONNECT_ERRORS exceeded the max_connect_errors system variable. NEVER NULL
+def performance_schema host_cache COUNT_NAMEINFO_TRANSIENT_ERRORS 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of transient errors during IP-to-host DNS lookups. NEVER NULL
+def performance_schema host_cache COUNT_NAMEINFO_PERMANENT_ERRORS 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of permanent errors during IP-to-host DNS lookups. NEVER NULL
+def performance_schema host_cache COUNT_FORMAT_ERRORS 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of host name format errors, for example a numeric host column. NEVER NULL
+def performance_schema host_cache COUNT_ADDRINFO_TRANSIENT_ERRORS 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of transient errors during host-to-IP reverse DNS lookups. NEVER NULL
+def performance_schema host_cache COUNT_ADDRINFO_PERMANENT_ERRORS 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of permanent errors during host-to-IP reverse DNS lookups. NEVER NULL
+def performance_schema host_cache COUNT_FCRDNS_ERRORS 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of forward-confirmed reverse DNS errors, which occur when IP-to-host DNS lookup does not match the originating IP address. NEVER NULL
+def performance_schema host_cache COUNT_HOST_ACL_ERRORS 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors occurring because no user from the host is permitted to log in. These attempts return error code 1130 ER_HOST_NOT_PRIVILEGED and do not proceed to username and password authentication. NEVER NULL
+def performance_schema host_cache COUNT_NO_AUTH_PLUGIN_ERRORS 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to requesting an authentication plugin that was not available. This can be due to the plugin never having been loaded, or the load attempt failing. NEVER NULL
+def performance_schema host_cache COUNT_AUTH_PLUGIN_ERRORS 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors reported by an authentication plugin. Plugins can increment COUNT_AUTHENTICATION_ERRORS or COUNT_HANDSHAKE_ERRORS instead, but, if specified or the error is unknown, this column is incremented. NEVER NULL
+def performance_schema host_cache COUNT_HANDSHAKE_ERRORS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors detected at the wire protocol level. NEVER NULL
+def performance_schema host_cache COUNT_PROXY_USER_ERRORS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors detected when a proxy user is proxied to a user that does not exist. NEVER NULL
+def performance_schema host_cache COUNT_PROXY_USER_ACL_ERRORS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors detected when a proxy user is proxied to a user that exists, but the proxy user doesn't have the PROXY privilege. NEVER NULL
+def performance_schema host_cache COUNT_AUTHENTICATION_ERRORS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors where authentication failed. NEVER NULL
+def performance_schema host_cache COUNT_SSL_ERRORS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to TLS problems. NEVER NULL
+def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_ERRORS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to the per-user quota being exceeded. NEVER NULL
+def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to the per-hour quota being exceeded. NEVER NULL
+def performance_schema host_cache COUNT_DEFAULT_DATABASE_ERRORS 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to the user not having permission to access the specified default database, or it not existing. NEVER NULL
+def performance_schema host_cache COUNT_INIT_CONNECT_ERRORS 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to statements in the init_connect system variable. NEVER NULL
+def performance_schema host_cache COUNT_LOCAL_ERRORS 24 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of local server errors, such as out-of-memory errors, unrelated to network, authentication, or authorization. NEVER NULL
+def performance_schema host_cache COUNT_UNKNOWN_ERRORS 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of unknown errors that cannot be allocated to another column. NEVER NULL
+def performance_schema host_cache FIRST_SEEN 26 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the first connection attempt by the IP. NEVER NULL
+def performance_schema host_cache LAST_SEEN 27 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the most recent connection attempt by the IP. NEVER NULL
+def performance_schema host_cache FIRST_ERROR_SEEN 28 '0000-00-00 00:00:00' YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the first error seen from the IP. NEVER NULL
+def performance_schema host_cache LAST_ERROR_SEEN 29 '0000-00-00 00:00:00' YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the most recent error seen from the IP. NEVER NULL
+def performance_schema mutex_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Instrument name associated with the mutex. NEVER NULL
+def performance_schema mutex_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Memory address of the instrumented mutex. NEVER NULL
+def performance_schema mutex_instances LOCKED_BY_THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The THREAD_ID of the locking thread if a thread has a mutex locked, otherwise NULL. NEVER NULL
+def performance_schema objects_summary_global_by_type OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Groups records together with OBJECT_SCHEMA and OBJECT_NAME. NEVER NULL
+def performance_schema objects_summary_global_by_type OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Groups records together with OBJECT_TYPE and OBJECT_NAME. NEVER NULL
+def performance_schema objects_summary_global_by_type OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Groups records together with OBJECT_SCHEMA and OBJECT_TYPE. NEVER NULL
+def performance_schema objects_summary_global_by_type COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema objects_summary_global_by_type SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema objects_summary_global_by_type MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema objects_summary_global_by_type AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema objects_summary_global_by_type MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema performance_timers TIMER_NAME 1 NULL NO enum 11 33 NULL NULL NULL utf8 utf8_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references Time name, used in the setup_timers table. NEVER NULL
+def performance_schema performance_timers TIMER_FREQUENCY 2 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of timer units per second. Dependent on the processor speed. NEVER NULL
+def performance_schema performance_timers TIMER_RESOLUTION 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of timer units by which timed values increase each time. NEVER NULL
+def performance_schema performance_timers TIMER_OVERHEAD 4 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Minimum timer overhead, determined during initialization by calling the timer 20 times and selecting the smallest value. Total overhead will be at least double this, as the timer is called at the beginning and end of each timed event. NEVER NULL
+def performance_schema rwlock_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Instrument name associated with the read write lock NEVER NULL
+def performance_schema rwlock_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the instrumented lock NEVER NULL
+def performance_schema rwlock_instances WRITE_LOCKED_BY_THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references THREAD_ID of the locking thread if locked in write (exclusive) mode, otherwise NULL. NEVER NULL
+def performance_schema rwlock_instances READ_LOCKED_BY_COUNT 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Count of current read locks held NEVER NULL
+def performance_schema session_account_connect_attrs PROCESSLIST_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Session connection identifier. NEVER NULL
+def performance_schema session_account_connect_attrs ATTR_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_bin varchar(32) select,insert,update,references Attribute name. NEVER NULL
+def performance_schema session_account_connect_attrs ATTR_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_bin varchar(1024) select,insert,update,references Attribute value. NEVER NULL
+def performance_schema session_account_connect_attrs ORDINAL_POSITION 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Order in which attribute was added to the connection attributes. NEVER NULL
+def performance_schema session_connect_attrs PROCESSLIST_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Session connection identifier. NEVER NULL
+def performance_schema session_connect_attrs ATTR_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_bin varchar(32) select,insert,update,references Attribute name. NEVER NULL
+def performance_schema session_connect_attrs ATTR_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_bin varchar(1024) select,insert,update,references Attribute value. NEVER NULL
+def performance_schema session_connect_attrs ORDINAL_POSITION 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Order in which attribute was added to the connection attributes. NEVER NULL
+def performance_schema setup_actors HOST 1 '%' NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references Host name, either a literal, or the % wildcard representing any host. NEVER NULL
+def performance_schema setup_actors USER 2 '%' NO char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references User name, either a literal or the % wildcard representing any name. NEVER NULL
+def performance_schema setup_actors ROLE 3 '%' NO char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references Unused NEVER NULL
+def performance_schema setup_consumers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Consumer name NEVER NULL
+def performance_schema setup_consumers ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references YES or NO for whether or not the consumer is enabled. You can modify this column to ensure that event information is added, or is not added. NEVER NULL
+def performance_schema setup_instruments NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Instrument name NEVER NULL
+def performance_schema setup_instruments ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references Whether or not the instrument is enabled. It can be disabled, and the instrument will produce no events. NEVER NULL
+def performance_schema setup_instruments TIMED 3 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references Whether or not the instrument is timed. It can be set, but if disabled, events produced by the instrument will have NULL values for the corresponding TIMER_START, TIMER_END, and TIMER_WAIT values. NEVER NULL
+def performance_schema setup_objects OBJECT_TYPE 1 'TABLE' NO enum 5 15 NULL NULL NULL utf8 utf8_general_ci enum('TABLE') select,insert,update,references Type of object to instrument. Currently, only TABLE, for base table. NEVER NULL
+def performance_schema setup_objects OBJECT_SCHEMA 2 '%' YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Schema containing the object, either the literal or % for any schema. NEVER NULL
+def performance_schema setup_objects OBJECT_NAME 3 '%' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Name of the instrumented object, either the literal or % for any object. NEVER NULL
+def performance_schema setup_objects ENABLED 4 'YES' NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references Whether the object's events are instrumented or not. Can be disabled, in which case monitoring is not enabled for those objects. NEVER NULL
+def performance_schema setup_objects TIMED 5 'YES' NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references Whether the object's events are timed or not. Can be modified. NEVER NULL
+def performance_schema setup_timers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Type of instrument the timer is used for. NEVER NULL
+def performance_schema setup_timers TIMER_NAME 2 NULL NO enum 11 33 NULL NULL NULL utf8 utf8_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references Timer applying to the instrument type. Can be modified. NEVER NULL
+def performance_schema socket_instances EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NAME from the setup_instruments table, and the name of the wait/io/socket/* instrument that produced the event. NEVER NULL
+def performance_schema socket_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Memory address of the object. NEVER NULL
+def performance_schema socket_instances THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread identifier that the server assigns to each socket. NEVER NULL
+def performance_schema socket_instances SOCKET_ID 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references The socket's internal file handle. NEVER NULL
+def performance_schema socket_instances IP 5 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Client IP address. Blank for Unix socket file, otherwise an IPv4 or IPv6 address. Together with the PORT identifies the connection. NEVER NULL
+def performance_schema socket_instances PORT 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references TCP/IP port number, from 0 to 65535. Together with the IP identifies the connection. NEVER NULL
+def performance_schema socket_instances STATE 7 NULL NO enum 6 18 NULL NULL NULL utf8 utf8_general_ci enum('IDLE','ACTIVE') select,insert,update,references Socket status, either IDLE if waiting to receive a request from a client, or ACTIVE NEVER NULL
+def performance_schema socket_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Socket instrument. NEVER NULL
+def performance_schema socket_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema socket_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including RECV, RECVFROM, and RECVMSG. NEVER NULL
+def performance_schema socket_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes read by read operations. NEVER NULL
+def performance_schema socket_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including SEND, SENDTO, and SENDMSG. NEVER NULL
+def performance_schema socket_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes written by write operations. NEVER NULL
+def performance_schema socket_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN. NEVER NULL
+def performance_schema socket_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Socket instrument. NEVER NULL
+def performance_schema socket_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory. NEVER NULL
+def performance_schema socket_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
+def performance_schema socket_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance COUNT_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including RECV, RECVFROM, and RECVMSG. NEVER NULL
+def performance_schema socket_summary_by_instance SUM_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance MIN_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance AVG_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance MAX_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes read by read operations. NEVER NULL
+def performance_schema socket_summary_by_instance COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including SEND, SENDTO, and SENDMSG. NEVER NULL
+def performance_schema socket_summary_by_instance SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes written by write operations. NEVER NULL
+def performance_schema socket_summary_by_instance COUNT_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN. NEVER NULL
+def performance_schema socket_summary_by_instance SUM_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance MIN_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance AVG_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema socket_summary_by_instance MAX_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references TABLE in the case of all indexes. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Schema name. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Table name. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage INDEX_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Index name, or PRIMARY for the primary index, NULL for no index (inserts are counted in this case). NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage COUNT_STAR 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events and the sum of the x_READ and x_WRITE columns. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WAIT 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage COUNT_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, and the sum of the equivalent x_FETCH columns. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_READ 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage COUNT_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all fetch operations. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all fetch operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all fetch operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all fetch operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_FETCH 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all fetch operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage COUNT_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all insert operations. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all insert operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all insert operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all insert operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_INSERT 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all insert operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage COUNT_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all update operations. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all update operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all update operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all update operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_UPDATE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all update operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage COUNT_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all delete operations. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all delete operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all delete operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all delete operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_DELETE 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all delete operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Since this table records waits by table, always set to TABLE. NEVER NULL
+def performance_schema table_io_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Schema name. NEVER NULL
+def performance_schema table_io_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Table name. NEVER NULL
+def performance_schema table_io_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events and the sum of the x_READ and x_WRITE columns. NEVER NULL
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, and the sum of the equivalent x_FETCH columns. NEVER NULL
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns. NEVER NULL
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table COUNT_FETCH 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all fetch operations. NEVER NULL
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all fetch operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all fetch operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all fetch operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all fetch operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table COUNT_INSERT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all insert operations. NEVER NULL
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all insert operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all insert operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all insert operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all insert operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table COUNT_UPDATE 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all update operations. NEVER NULL
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all update operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all update operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all update operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all update operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table COUNT_DELETE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all delete operations. NEVER NULL
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all delete operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all delete operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all delete operations that are timed. NEVER NULL
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all delete operations that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Since this table records waits by table, always set to TABLE. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Schema name. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Table name. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events and the sum of the x_READ and x_WRITE columns. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, and the sum of the equivalent x_READ_NORMAL, x_READ_WITH_SHARED_LOCKS, x_READ_HIGH_PRIORITY and x_READ_NO_INSERT columns. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, and the sum of the equivalent x_WRITE_ALLOW_WRITE, x_WRITE_CONCURRENT_INSERT, x_WRITE_DELAYED, x_WRITE_LOW_PRIORITY and x_WRITE_NORMAL columns. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_NORMAL 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read normal locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NORMAL 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read normal locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NORMAL 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read normal locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NORMAL 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read normal locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NORMAL 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read normal locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_WITH_SHARED_LOCKS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read with shared locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_WITH_SHARED_LOCKS 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read with shared locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_WITH_SHARED_LOCKS 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read with shared locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_WITH_SHARED_LOCKS 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read with shared locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_WITH_SHARED_LOCKS 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read with shared locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_HIGH_PRIORITY 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read high priority locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_HIGH_PRIORITY 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read high priority locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_HIGH_PRIORITY 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read high priority locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_HIGH_PRIORITY 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read high priority locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_HIGH_PRIORITY 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read high priority locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_NO_INSERT 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read no insert locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NO_INSERT 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read no insert locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NO_INSERT 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read no insert locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NO_INSERT 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read no insert locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NO_INSERT 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read no insert locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_EXTERNAL 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all external read locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_EXTERNAL 40 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all external read locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_EXTERNAL 41 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all external read locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_EXTERNAL 42 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all external read locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_EXTERNAL 43 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all external read locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_ALLOW_WRITE 44 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read normal locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_ALLOW_WRITE 45 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write allow write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_ALLOW_WRITE 46 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write allow write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_ALLOW_WRITE 47 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write allow write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_ALLOW_WRITE 48 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write allow write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_CONCURRENT_INSERT 49 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal concurrent insert write locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_CONCURRENT_INSERT 50 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal concurrent insert write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_CONCURRENT_INSERT 51 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal concurrent insert write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_CONCURRENT_INSERT 52 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal concurrent insert write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_CONCURRENT_INSERT 53 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal concurrent insert write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_DELAYED 54 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal write delayed locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_DELAYED 55 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write delayed locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_DELAYED 56 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write delayed locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_DELAYED 57 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write delayed locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_DELAYED 58 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write delayed locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_LOW_PRIORITY 59 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal write low priority locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_LOW_PRIORITY 60 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write low priority locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_LOW_PRIORITY 61 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write low priority locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_LOW_PRIORITY 62 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write low priority locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_LOW_PRIORITY 63 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write low priority locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_NORMAL 64 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal write normal locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_NORMAL 65 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write normal locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_NORMAL 66 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write normal locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_NORMAL 67 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write normal locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_NORMAL 68 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write normal locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_EXTERNAL 69 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all external write locks. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_EXTERNAL 70 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all external write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_EXTERNAL 71 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all external write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_EXTERNAL 72 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all external write locks that are timed. NEVER NULL
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_EXTERNAL 73 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all external write locks that are timed. NEVER NULL
+def performance_schema threads THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references A unique thread identifier. NEVER NULL
+def performance_schema threads NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Name associated with the server's thread instrumentation code, for example thread/sql/main for the server's main() function, and thread/sql/one_connection for a user connection. NEVER NULL
+def performance_schema threads TYPE 3 NULL NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) select,insert,update,references FOREGROUND or BACKGROUND, depending on the thread type. User connection threads are FOREGROUND, internal server threads are BACKGROUND. NEVER NULL
+def performance_schema threads PROCESSLIST_ID 4 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The PROCESSLIST.ID value for threads displayed in the INFORMATION_SCHEMA.PROCESSLIST table, or 0 for background threads. Also corresponds with the CONNECTION_ID() return value for the thread. NEVER NULL
+def performance_schema threads PROCESSLIST_USER 5 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references Foreground thread user, or NULL for a background thread. NEVER NULL
+def performance_schema threads PROCESSLIST_HOST 6 NULL YES varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) select,insert,update,references Foreground thread host, or NULL for a background thread. NEVER NULL
+def performance_schema threads PROCESSLIST_DB 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Thread's default database, or NULL if none exists. NEVER NULL
+def performance_schema threads PROCESSLIST_COMMAND 8 NULL YES varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select,insert,update,references Type of command executed by the thread. These correspond to the the COM_xxx client/server protocol commands, and the Com_xxx status variables. See Thread Command Values. NEVER NULL
+def performance_schema threads PROCESSLIST_TIME 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Time in seconds the thread has been in its current state. NEVER NULL
+def performance_schema threads PROCESSLIST_STATE 10 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Action, event or state indicating what the thread is doing. NEVER NULL
+def performance_schema threads PROCESSLIST_INFO 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references Statement being executed by the thread, or NULL if a statement is not being executed. If a statement results in calling other statements, such as for a stored procedure, the innermost statement from the stored procedure is shown here. NEVER NULL
+def performance_schema threads PARENT_THREAD_ID 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references THREAD_ID of the parent thread, if any. Subthreads can for example be spawned as a result of INSERT DELAYED statements. NEVER NULL
+def performance_schema threads ROLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references Unused. NEVER NULL
+def performance_schema threads INSTRUMENTED 14 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references YES or NO for Whether the thread is instrumented or not. For foreground threads, the initial value is determined by whether there's a user/host match in the setup_actors table. Subthreads are again matched, while for background threads, this will be set to YES by default. To monitor events that the thread executes, INSTRUMENTED must be YES and the thread_instrumentation consumer in the setup_consumers table must also be YES. NEVER NULL
+def performance_schema users USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references The connection's client user name for the connection, or NULL if an internal thread. NEVER NULL
+def performance_schema users CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current connections for the user. NEVER NULL
+def performance_schema users TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Total connections for the user. NEVER NULL
select count(*) from information_schema.columns
where table_schema="performance_schema" and data_type = "bigint"
and column_name like "%number_of_bytes" into @count_byte_columns;
@@ -822,3 +822,8 @@ where table_schema="performance_schema" and data_type="bigint"
select (@count_object_columns - @count_object_unsigned) = 0;
(@count_object_columns - @count_object_unsigned) = 0
1
+select count(*) from information_schema.columns
+where table_schema="performance_schema"
+ and (column_comment is null or column_comment = '');
+count(*)
+0
diff --git a/mysql-test/suite/perfschema/t/dml_accounts.test b/mysql-test/suite/perfschema/t/dml_accounts.test
index e462847279c..84c6cee93ef 100644
--- a/mysql-test/suite/perfschema/t/dml_accounts.test
+++ b/mysql-test/suite/perfschema/t/dml_accounts.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.accounts WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='accounts';
diff --git a/mysql-test/suite/perfschema/t/dml_cond_instances.test b/mysql-test/suite/perfschema/t/dml_cond_instances.test
index d80c97cbd31..3d3d019480d 100644
--- a/mysql-test/suite/perfschema/t/dml_cond_instances.test
+++ b/mysql-test/suite/perfschema/t/dml_cond_instances.test
@@ -33,3 +33,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.cond_instances WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='cond_instances';
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test
index b9633ec8ea7..fb54b332c23 100644
--- a/mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_account_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_by_account_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test
index bb973cd31ed..e7a8e465e89 100644
--- a/mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_host_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_by_host_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test
index 50fc1fff848..f7675363e82 100644
--- a/mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_thread_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_by_thread_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test
index a3f0bdfd5c9..d0e126645db 100644
--- a/mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_user_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_by_user_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test
index 8f466517a90..bca0e4ededc 100644
--- a/mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_global_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_summary_global_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test
index 92e58c83a56..f86baaef040 100644
--- a/mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_account_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_account_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_digest.test b/mysql-test/suite/perfschema/t/dml_esms_by_digest.test
index b71c6f2815b..5bdeeb1085e 100644
--- a/mysql-test/suite/perfschema/t/dml_esms_by_digest.test
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_digest.test
@@ -61,3 +61,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_digest WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_digest';
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test
index 7a8c0498a97..19547d991f4 100644
--- a/mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_host_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_host_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test
index 5c079ade643..f28ae4d3a40 100644
--- a/mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_thread_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_thread_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test
index 21b65e182d3..db6d2d845c3 100644
--- a/mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_user_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_by_user_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test b/mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test
index 5ef477aea6f..108efeee981 100644
--- a/mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_global_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_summary_global_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_events_stages_current.test b/mysql-test/suite/perfschema/t/dml_events_stages_current.test
index 8db105fe01e..20dc1927ca1 100644
--- a/mysql-test/suite/perfschema/t/dml_events_stages_current.test
+++ b/mysql-test/suite/perfschema/t/dml_events_stages_current.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_current WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_current';
diff --git a/mysql-test/suite/perfschema/t/dml_events_stages_history.test b/mysql-test/suite/perfschema/t/dml_events_stages_history.test
index 54bebc8a328..ab62e23ab87 100644
--- a/mysql-test/suite/perfschema/t/dml_events_stages_history.test
+++ b/mysql-test/suite/perfschema/t/dml_events_stages_history.test
@@ -45,3 +45,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_history WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_history';
diff --git a/mysql-test/suite/perfschema/t/dml_events_stages_history_long.test b/mysql-test/suite/perfschema/t/dml_events_stages_history_long.test
index b52f539871d..ef342f1af2c 100644
--- a/mysql-test/suite/perfschema/t/dml_events_stages_history_long.test
+++ b/mysql-test/suite/perfschema/t/dml_events_stages_history_long.test
@@ -45,3 +45,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_history_long WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_stages_history_long';
diff --git a/mysql-test/suite/perfschema/t/dml_events_statements_current.test b/mysql-test/suite/perfschema/t/dml_events_statements_current.test
index 152d9b74d42..1bf00320ac8 100644
--- a/mysql-test/suite/perfschema/t/dml_events_statements_current.test
+++ b/mysql-test/suite/perfschema/t/dml_events_statements_current.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_current WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_current';
diff --git a/mysql-test/suite/perfschema/t/dml_events_statements_history.test b/mysql-test/suite/perfschema/t/dml_events_statements_history.test
index 4b84e6e7200..7e5e0d387f9 100644
--- a/mysql-test/suite/perfschema/t/dml_events_statements_history.test
+++ b/mysql-test/suite/perfschema/t/dml_events_statements_history.test
@@ -45,3 +45,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_history WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_history';
diff --git a/mysql-test/suite/perfschema/t/dml_events_statements_history_long.test b/mysql-test/suite/perfschema/t/dml_events_statements_history_long.test
index 79580fcf13e..bc481fe1c4f 100644
--- a/mysql-test/suite/perfschema/t/dml_events_statements_history_long.test
+++ b/mysql-test/suite/perfschema/t/dml_events_statements_history_long.test
@@ -45,3 +45,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_history_long WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_statements_history_long';
diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_current.test b/mysql-test/suite/perfschema/t/dml_events_waits_current.test
index e59802d0f25..15f1e716e26 100644
--- a/mysql-test/suite/perfschema/t/dml_events_waits_current.test
+++ b/mysql-test/suite/perfschema/t/dml_events_waits_current.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_current WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_current';
diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_history.test b/mysql-test/suite/perfschema/t/dml_events_waits_history.test
index bd9ac2f438e..0ecb4c204c4 100644
--- a/mysql-test/suite/perfschema/t/dml_events_waits_history.test
+++ b/mysql-test/suite/perfschema/t/dml_events_waits_history.test
@@ -45,3 +45,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_history WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_history';
diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test b/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test
index d5e9f0630e0..a5857548e01 100644
--- a/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test
+++ b/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test
@@ -45,3 +45,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_history_long WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_history_long';
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test
index e9eda8ece2a..ca33c15ce19 100644
--- a/mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_account_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_account_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test
index add375bf6c1..f2123fa01f4 100644
--- a/mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_host_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_host_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_instance.test b/mysql-test/suite/perfschema/t/dml_ews_by_instance.test
index 9b9dddfa48d..0645dadd34a 100644
--- a/mysql-test/suite/perfschema/t/dml_ews_by_instance.test
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_instance.test
@@ -52,3 +52,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_instance WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_instance';
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test
index 763961dec4e..1b1e0147d12 100644
--- a/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_thread_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_thread_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test
index 1b927dd12a6..4e89ec7a925 100644
--- a/mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_by_user_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_by_user_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test
index ac4829640fb..d32e23ff1d2 100644
--- a/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_waits_summary_global_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='events_waits_summary_global_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_file_instances.test b/mysql-test/suite/perfschema/t/dml_file_instances.test
index f95f74fd61a..33969452f03 100644
--- a/mysql-test/suite/perfschema/t/dml_file_instances.test
+++ b/mysql-test/suite/perfschema/t/dml_file_instances.test
@@ -33,3 +33,11 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.file_instances WRITE;
UNLOCK TABLES;
+
+
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='file_instances';
diff --git a/mysql-test/suite/perfschema/t/dml_fs_by_event_name.test b/mysql-test/suite/perfschema/t/dml_fs_by_event_name.test
index dbf31d1963d..50c6486e625 100644
--- a/mysql-test/suite/perfschema/t/dml_fs_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_fs_by_event_name.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.file_summary_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='file_summary_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_fs_by_instance.test b/mysql-test/suite/perfschema/t/dml_fs_by_instance.test
index 5f69c2d0dc7..f175e76f1f0 100644
--- a/mysql-test/suite/perfschema/t/dml_fs_by_instance.test
+++ b/mysql-test/suite/perfschema/t/dml_fs_by_instance.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.file_summary_by_instance WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='file_summary_by_instance';
diff --git a/mysql-test/suite/perfschema/t/dml_host_cache.test b/mysql-test/suite/perfschema/t/dml_host_cache.test
index c56099ab748..3968c08fb30 100644
--- a/mysql-test/suite/perfschema/t/dml_host_cache.test
+++ b/mysql-test/suite/perfschema/t/dml_host_cache.test
@@ -41,3 +41,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.host_cache WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='host_cache';
diff --git a/mysql-test/suite/perfschema/t/dml_hosts.test b/mysql-test/suite/perfschema/t/dml_hosts.test
index d23f6f69339..83caed37d8d 100644
--- a/mysql-test/suite/perfschema/t/dml_hosts.test
+++ b/mysql-test/suite/perfschema/t/dml_hosts.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.hosts WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='hosts';
diff --git a/mysql-test/suite/perfschema/t/dml_mutex_instances.test b/mysql-test/suite/perfschema/t/dml_mutex_instances.test
index ac3a7c788a8..c0d6f2e54b6 100644
--- a/mysql-test/suite/perfschema/t/dml_mutex_instances.test
+++ b/mysql-test/suite/perfschema/t/dml_mutex_instances.test
@@ -33,3 +33,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.mutex_instances WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='mutex_instances';
diff --git a/mysql-test/suite/perfschema/t/dml_os_global_by_type.test b/mysql-test/suite/perfschema/t/dml_os_global_by_type.test
index 1ea8381bc56..010423f9205 100644
--- a/mysql-test/suite/perfschema/t/dml_os_global_by_type.test
+++ b/mysql-test/suite/perfschema/t/dml_os_global_by_type.test
@@ -55,3 +55,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.objects_summary_global_by_type WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='objects_summary_global_by_type';
diff --git a/mysql-test/suite/perfschema/t/dml_performance_timers.test b/mysql-test/suite/perfschema/t/dml_performance_timers.test
index 587c54144aa..af6d2a2aac9 100644
--- a/mysql-test/suite/perfschema/t/dml_performance_timers.test
+++ b/mysql-test/suite/perfschema/t/dml_performance_timers.test
@@ -35,3 +35,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.performance_timers WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='performance_timers';
diff --git a/mysql-test/suite/perfschema/t/dml_rwlock_instances.test b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test
index 7832a02ccb8..1230c680f75 100644
--- a/mysql-test/suite/perfschema/t/dml_rwlock_instances.test
+++ b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test
@@ -33,3 +33,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.rwlock_instances WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='rwlock_instances';
diff --git a/mysql-test/suite/perfschema/t/dml_session_account_connect_attrs.test b/mysql-test/suite/perfschema/t/dml_session_account_connect_attrs.test
index 82768cb0d6b..3ed60c5780c 100644
--- a/mysql-test/suite/perfschema/t/dml_session_account_connect_attrs.test
+++ b/mysql-test/suite/perfschema/t/dml_session_account_connect_attrs.test
@@ -1,3 +1,5 @@
+# Tests for PERFORMANCE_SCHEMA
+
--source include/not_embedded.inc
--source include/have_perfschema.inc
@@ -36,3 +38,10 @@ UNLOCK TABLES;
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.session_account_connect_attrs WRITE;
UNLOCK TABLES;
+
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='session_account_connect_attrs';
diff --git a/mysql-test/suite/perfschema/t/dml_session_connect_attrs.test b/mysql-test/suite/perfschema/t/dml_session_connect_attrs.test
index db2bcb7afd6..b0a40d73a7b 100644
--- a/mysql-test/suite/perfschema/t/dml_session_connect_attrs.test
+++ b/mysql-test/suite/perfschema/t/dml_session_connect_attrs.test
@@ -1,3 +1,5 @@
+# Tests for PERFORMANCE_SCHEMA
+
--source include/not_embedded.inc
--source include/have_perfschema.inc
@@ -36,3 +38,10 @@ UNLOCK TABLES;
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.session_connect_attrs WRITE;
UNLOCK TABLES;
+
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='session_connect_attrs';
diff --git a/mysql-test/suite/perfschema/t/dml_setup_actors.test b/mysql-test/suite/perfschema/t/dml_setup_actors.test
index d5424cad7e3..4d39ef3cb2e 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_actors.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_actors.test
@@ -70,3 +70,9 @@ insert into performance_schema.setup_actors
select * from test.setup_actors;
drop table test.setup_actors;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_actors';
diff --git a/mysql-test/suite/perfschema/t/dml_setup_consumers.test b/mysql-test/suite/perfschema/t/dml_setup_consumers.test
index 7a95e5d48c1..78eeca01990 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_consumers.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_consumers.test
@@ -38,3 +38,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.setup_consumers WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_consumers';
diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test
index 098d6bd031d..e3cc07fb889 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test
@@ -98,3 +98,10 @@ ORDER BY RAND();
update performance_schema.setup_instruments set timed='YES';
--enable_query_log
+
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_instruments';
diff --git a/mysql-test/suite/perfschema/t/dml_setup_objects.test b/mysql-test/suite/perfschema/t/dml_setup_objects.test
index ac7b5fd35bb..8c9374293ef 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_objects.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_objects.test
@@ -94,3 +94,9 @@ insert into performance_schema.setup_objects
select * from test.setup_objects;
drop table test.setup_objects;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_objects';
diff --git a/mysql-test/suite/perfschema/t/dml_setup_timers.test b/mysql-test/suite/perfschema/t/dml_setup_timers.test
index bd8822d2b19..c14ad6e73c2 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_timers.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_timers.test
@@ -64,3 +64,9 @@ update performance_schema.setup_timers
select * from performance_schema.setup_timers;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='setup_timers';
diff --git a/mysql-test/suite/perfschema/t/dml_socket_instances.test b/mysql-test/suite/perfschema/t/dml_socket_instances.test
index 929853d574e..2f92c0f5c6e 100644
--- a/mysql-test/suite/perfschema/t/dml_socket_instances.test
+++ b/mysql-test/suite/perfschema/t/dml_socket_instances.test
@@ -33,3 +33,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.socket_instances WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='socket_instances';
diff --git a/mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test b/mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test
index 2c06fca77e4..3fbea327e37 100644
--- a/mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.socket_summary_by_event_name WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='socket_summary_by_event_name';
diff --git a/mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test b/mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test
index 5a5d829308c..d55cf2434de 100644
--- a/mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test
+++ b/mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.socket_summary_by_instance WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='socket_summary_by_instance';
diff --git a/mysql-test/suite/perfschema/t/dml_threads.test b/mysql-test/suite/perfschema/t/dml_threads.test
index 328f6a6d989..f6239d58690 100644
--- a/mysql-test/suite/perfschema/t/dml_threads.test
+++ b/mysql-test/suite/perfschema/t/dml_threads.test
@@ -48,3 +48,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.threads WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='threads';
diff --git a/mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test b/mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test
index ecd83987291..e3b6405a782 100644
--- a/mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test
+++ b/mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.table_io_waits_summary_by_index_usage WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='table_io_waits_summary_by_index_usage';
diff --git a/mysql-test/suite/perfschema/t/dml_tiws_by_table.test b/mysql-test/suite/perfschema/t/dml_tiws_by_table.test
index 4d2f9b7fba5..c00cec31bc5 100644
--- a/mysql-test/suite/perfschema/t/dml_tiws_by_table.test
+++ b/mysql-test/suite/perfschema/t/dml_tiws_by_table.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.table_io_waits_summary_by_table WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='table_io_waits_summary_by_table';
diff --git a/mysql-test/suite/perfschema/t/dml_tlws_by_table.test b/mysql-test/suite/perfschema/t/dml_tlws_by_table.test
index b88ca1a66aa..ab76d85ffad 100644
--- a/mysql-test/suite/perfschema/t/dml_tlws_by_table.test
+++ b/mysql-test/suite/perfschema/t/dml_tlws_by_table.test
@@ -40,3 +40,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.table_lock_waits_summary_by_table WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='table_lock_waits_summary_by_table';
diff --git a/mysql-test/suite/perfschema/t/dml_users.test b/mysql-test/suite/perfschema/t/dml_users.test
index 290a6d7f253..68942d27763 100644
--- a/mysql-test/suite/perfschema/t/dml_users.test
+++ b/mysql-test/suite/perfschema/t/dml_users.test
@@ -39,3 +39,9 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.users WRITE;
UNLOCK TABLES;
+--echo #
+--echo # MDEV-25325 column_comment for performance_schema tables
+--echo #
+select column_name, column_comment
+from information_schema.columns
+where table_schema='performance_schema' and table_name='users';
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_ed25519.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_ed25519.test
new file mode 100644
index 00000000000..6a97b6d0958
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_ed25519.test
@@ -0,0 +1,53 @@
+#
+# Tests for the performance_schema host_cache.
+#
+# Test authorization with auth plugins.
+# error reporting in:
+# - column COUNT_AUTH_PLUGIN_ERRORS
+# - column COUNT_PROXY_USER_ERRORS
+# - column COUNT_PROXY_USER_ACL_ERRORS
+
+source include/not_embedded.inc;
+source include/have_debug.inc;
+source include/have_perfschema.inc;
+source include/have_plugin_auth.inc;
+source include/have_hostname_cache.inc;
+
+if (!$AUTH_ED25519_SO) {
+ skip No auth_ed25519 plugin;
+}
+install soname 'auth_ed25519';
+
+# Enforce a clean state
+source ../include/wait_for_pfs_thread_count.inc;
+source ../include/hostcache_set_state.inc;
+
+create user plug1@'santa.claus.ipv4.example.com'
+ identified with ed25519 as 'foo';
+create user plug2@'santa.claus.ipv4.example.com'
+ identified with ED25519 as 'vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI';
+
+set @saved_dbug = @@global.debug_dbug;
+set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+replace_result $MASTER_MYPORT PORT $MASTER_MYSOCK SOCKET;
+error ER_ACCESS_DENIED_ERROR;
+connect con1, 127.0.0.1, plug1,foo,,$MASTER_MYPORT;
+source ../include/hostcache_dump.inc;
+
+replace_result $MASTER_MYPORT PORT $MASTER_MYSOCK SOCKET;
+error ER_ACCESS_DENIED_ERROR;
+connect con1, 127.0.0.1, plug2,bar,,$MASTER_MYPORT;
+source ../include/hostcache_dump.inc;
+
+connect con1, 127.0.0.1, plug2,foo,,$MASTER_MYPORT;
+select current_user();
+disconnect con1;
+connection default;
+source ../include/hostcache_dump.inc;
+
+drop user plug1@'santa.claus.ipv4.example.com';
+drop user plug2@'santa.claus.ipv4.example.com';
+
+set @@global.debug_dbug = @saved_dbug;
+uninstall plugin ed25519;
diff --git a/mysql-test/suite/perfschema/t/table_schema.test b/mysql-test/suite/perfschema/t/table_schema.test
index f903419bd78..d141420b209 100644
--- a/mysql-test/suite/perfschema/t/table_schema.test
+++ b/mysql-test/suite/perfschema/t/table_schema.test
@@ -55,3 +55,8 @@ select count(*) from information_schema.columns
select (@count_object_columns - @count_object_unsigned) = 0;
+# Confirm that all columns have comments
+#
+select count(*) from information_schema.columns
+ where table_schema="performance_schema"
+ and (column_comment is null or column_comment = '');
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result
index 843cd15ac94..8b2a561b9f0 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_load.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result
@@ -24,3 +24,19 @@ VARIABLE_VALUE>0 VARIABLE_NAME
1 Collation used latin1_swedish_ci
1 Collation used utf8_bin
1 Collation used utf8_general_ci
+prepare stmt from "SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK WHERE VARIABLE_NAME LIKE 'Collation used %' ORDER BY VARIABLE_NAME";
+execute stmt;
+VARIABLE_VALUE>0 VARIABLE_NAME
+1 Collation used binary
+1 Collation used latin1_bin
+1 Collation used latin1_swedish_ci
+1 Collation used utf8_bin
+1 Collation used utf8_general_ci
+execute stmt;
+VARIABLE_VALUE>0 VARIABLE_NAME
+1 Collation used binary
+1 Collation used latin1_bin
+1 Collation used latin1_swedish_ci
+1 Collation used utf8_bin
+1 Collation used utf8_general_ci
+deallocate prepare stmt;
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result
index 70dfbcb62dc..fec42f577ad 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_send.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result
@@ -24,6 +24,22 @@ VARIABLE_VALUE>0 VARIABLE_NAME
1 Collation used latin1_swedish_ci
1 Collation used utf8_bin
1 Collation used utf8_general_ci
+prepare stmt from "SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK WHERE VARIABLE_NAME LIKE 'Collation used %' ORDER BY VARIABLE_NAME";
+execute stmt;
+VARIABLE_VALUE>0 VARIABLE_NAME
+1 Collation used binary
+1 Collation used latin1_bin
+1 Collation used latin1_swedish_ci
+1 Collation used utf8_bin
+1 Collation used utf8_general_ci
+execute stmt;
+VARIABLE_VALUE>0 VARIABLE_NAME
+1 Collation used binary
+1 Collation used latin1_bin
+1 Collation used latin1_swedish_ci
+1 Collation used utf8_bin
+1 Collation used utf8_general_ci
+deallocate prepare stmt;
set global sql_mode=ONLY_FULL_GROUP_BY;
-6: feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent
-6: feedback plugin: server replied 'ok'
+feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent
+feedback plugin: server replied 'ok'
diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result
index b82b38f4f0a..733b542df19 100644
--- a/mysql-test/suite/plugins/r/server_audit.result
+++ b/mysql-test/suite/plugins/r/server_audit.result
@@ -261,6 +261,9 @@ A B C D
A B C D
set global server_audit_query_log_limit= 1024;
drop database sa_db;
+select length('01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789');
+length('0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456
+2750
set global server_audit_file_path='.';
show status like 'server_audit_current_log';
Variable_name Value
@@ -485,6 +488,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc,
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc,
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select length(\'012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0
diff --git a/mysql-test/suite/plugins/r/unix_socket.result b/mysql-test/suite/plugins/r/unix_socket.result
index 0e08794fbe6..096b736cd68 100644
--- a/mysql-test/suite/plugins/r/unix_socket.result
+++ b/mysql-test/suite/plugins/r/unix_socket.result
@@ -2,7 +2,7 @@ install plugin unix_socket soname 'auth_socket.so';
#
# with named user
#
-create user USER identified via unix_socket;
+create user 'USER' identified via unix_socket;
#
# name match = ok
#
@@ -12,7 +12,7 @@ USER@localhost USER@% test
#
# name does not match = failure
#
-drop user USER;
+drop user 'USER';
#
# and now with anonymous user
#
diff --git a/mysql-test/suite/plugins/t/feedback_plugin_load.test b/mysql-test/suite/plugins/t/feedback_plugin_load.test
index c0546cef0f9..9fbe523e5f3 100644
--- a/mysql-test/suite/plugins/t/feedback_plugin_load.test
+++ b/mysql-test/suite/plugins/t/feedback_plugin_load.test
@@ -42,3 +42,10 @@ if (`SELECT VERSION() LIKE '%embedded%'`)
SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK
WHERE VARIABLE_NAME LIKE 'Collation used %'
ORDER BY VARIABLE_NAME;
+
+prepare stmt from "SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK WHERE VARIABLE_NAME LIKE 'Collation used %' ORDER BY VARIABLE_NAME";
+
+execute stmt;
+execute stmt;
+
+deallocate prepare stmt;
diff --git a/mysql-test/suite/plugins/t/feedback_plugin_send.test b/mysql-test/suite/plugins/t/feedback_plugin_send.test
index b28f9d4cb38..0ea1814ec29 100644
--- a/mysql-test/suite/plugins/t/feedback_plugin_send.test
+++ b/mysql-test/suite/plugins/t/feedback_plugin_send.test
@@ -38,6 +38,6 @@ perl;
while ($_=<LOG>) {
$logg{$&}++ if /feedback plugin:.*/;
}
- print "$logg{$_}: $_\n" for sort keys %logg;
+ print "$_\n" for sort keys %logg;
close LOG;
EOF
diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test
index eba3e5d6770..a70c0b89200 100644
--- a/mysql-test/suite/plugins/t/server_audit.test
+++ b/mysql-test/suite/plugins/t/server_audit.test
@@ -210,6 +210,8 @@ select 'A', 'B', 'C', 'D';
set global server_audit_query_log_limit= 1024;
drop database sa_db;
+select length('01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789');
+
set global server_audit_file_path='.';
--replace_regex /\.[\\\/]/HOME_DIR\//
show status like 'server_audit_current_log';
diff --git a/mysql-test/suite/plugins/t/unix_socket.test b/mysql-test/suite/plugins/t/unix_socket.test
index bd0323c0274..75409ec70b4 100644
--- a/mysql-test/suite/plugins/t/unix_socket.test
+++ b/mysql-test/suite/plugins/t/unix_socket.test
@@ -12,9 +12,9 @@ eval install plugin unix_socket soname '$AUTH_SOCKET_SO';
--echo # with named user
--echo #
---let $replace=create user $USER
---replace_result $replace "create user USER"
-eval create user $USER identified via unix_socket;
+--let $replace=create user '$USER'
+--replace_result $replace "create user 'USER'"
+eval create user '$USER' identified via unix_socket;
--write_file $MYSQLTEST_VARDIR/tmp/peercred_test.txt
--let $replace1=$USER@localhost
@@ -34,9 +34,9 @@ EOF
--error 1
--exec $MYSQL_TEST -u foobar --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/peercred_test.txt
---let $replace=drop user $USER
---replace_result $replace "drop user USER"
-eval drop user $USER;
+--let $replace=drop user '$USER'
+--replace_result $replace "drop user 'USER'"
+eval drop user '$USER';
--echo #
--echo # and now with anonymous user
diff --git a/mysql-test/suite/roles/admin.result b/mysql-test/suite/roles/admin.result
index 87d2888b47c..d5e4e1370db 100644
--- a/mysql-test/suite/roles/admin.result
+++ b/mysql-test/suite/roles/admin.result
@@ -27,19 +27,19 @@ grant select on *.* to foo@localhost with admin option;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'admin option' at line 1
show grants for foo@localhost;
Grants for foo@localhost
+GRANT 'role1' TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT 'role2' TO 'foo'@'localhost'
+GRANT 'role5' TO 'foo'@'localhost' WITH ADMIN OPTION
GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role1 TO 'foo'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
show grants for role1;
Grants for role1
+GRANT 'role2' TO 'role1'
+GRANT 'role3' TO 'role1' WITH ADMIN OPTION
+GRANT 'role4' TO 'role3' WITH ADMIN OPTION
GRANT USAGE ON *.* TO 'role1'
GRANT USAGE ON *.* TO 'role2'
GRANT USAGE ON *.* TO 'role3'
GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1'
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3' WITH ADMIN OPTION
show grants for role4;
Grants for role4
GRANT USAGE ON *.* TO 'role4'
@@ -58,19 +58,19 @@ localhost root role4 Y
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
+GRANT 'role1' TO 'foo'@'localhost' WITH ADMIN OPTION
+GRANT 'role2' TO 'foo'@'localhost'
+GRANT 'role5' TO 'foo'@'localhost' WITH ADMIN OPTION
GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role1 TO 'foo'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
show grants for role1;
Grants for role1
+GRANT 'role2' TO 'role1'
+GRANT 'role3' TO 'role1' WITH ADMIN OPTION
+GRANT 'role4' TO 'role3' WITH ADMIN OPTION
GRANT USAGE ON *.* TO 'role1'
GRANT USAGE ON *.* TO 'role2'
GRANT USAGE ON *.* TO 'role3'
GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1'
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3' WITH ADMIN OPTION
show grants for role4;
Grants for role4
GRANT USAGE ON *.* TO 'role4'
@@ -89,18 +89,18 @@ revoke admin option for role2 from foo@localhost;
revoke admin option for role1 from root@localhost;
show grants for foo@localhost;
Grants for foo@localhost
+GRANT 'role2' TO 'foo'@'localhost'
+GRANT 'role5' TO 'foo'@'localhost' WITH ADMIN OPTION
GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
show grants for role1;
Grants for role1
+GRANT 'role2' TO 'role1' WITH ADMIN OPTION
+GRANT 'role3' TO 'role1' WITH ADMIN OPTION
+GRANT 'role4' TO 'role3'
GRANT USAGE ON *.* TO 'role1'
GRANT USAGE ON *.* TO 'role2'
GRANT USAGE ON *.* TO 'role3'
GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1' WITH ADMIN OPTION
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3'
show grants for role4;
Grants for role4
GRANT USAGE ON *.* TO 'role4'
@@ -118,18 +118,18 @@ localhost root role4 Y
flush privileges;
show grants for foo@localhost;
Grants for foo@localhost
+GRANT 'role2' TO 'foo'@'localhost'
+GRANT 'role5' TO 'foo'@'localhost' WITH ADMIN OPTION
GRANT CREATE USER ON *.* TO 'foo'@'localhost'
-GRANT role2 TO 'foo'@'localhost'
-GRANT role5 TO 'foo'@'localhost' WITH ADMIN OPTION
show grants for role1;
Grants for role1
+GRANT 'role2' TO 'role1' WITH ADMIN OPTION
+GRANT 'role3' TO 'role1' WITH ADMIN OPTION
+GRANT 'role4' TO 'role3'
GRANT USAGE ON *.* TO 'role1'
GRANT USAGE ON *.* TO 'role2'
GRANT USAGE ON *.* TO 'role3'
GRANT USAGE ON *.* TO 'role4'
-GRANT role2 TO 'role1' WITH ADMIN OPTION
-GRANT role3 TO 'role1' WITH ADMIN OPTION
-GRANT role4 TO 'role3'
show grants for role4;
Grants for role4
GRANT USAGE ON *.* TO 'role4'
diff --git a/mysql-test/suite/roles/create_and_drop_role.result b/mysql-test/suite/roles/create_and_drop_role.result
index a163ee82f42..b13f6eb4cb8 100644
--- a/mysql-test/suite/roles/create_and_drop_role.result
+++ b/mysql-test/suite/roles/create_and_drop_role.result
@@ -66,7 +66,7 @@ localhost r1 r2 N
localhost root r2 Y
SHOW GRANTS FOR r1@localhost;
Grants for r1@localhost
-GRANT r2 TO 'r1'@'localhost'
+GRANT 'r2' TO 'r1'@'localhost'
GRANT USAGE ON *.* TO 'r1'@'localhost'
DROP USER u1;
DROP ROLE r2;
diff --git a/mysql-test/suite/roles/create_and_grant_role.result b/mysql-test/suite/roles/create_and_grant_role.result
index 883ae44397d..b298b2baeee 100644
--- a/mysql-test/suite/roles/create_and_grant_role.result
+++ b/mysql-test/suite/roles/create_and_grant_role.result
@@ -13,10 +13,10 @@ Host User Role Admin_option
localhost root r1 Y
show grants;
Grants for root@localhost
+GRANT 'r1' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'r1'
-GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
drop role r1;
select * from mysql.roles_mapping;
Host User Role Admin_option
diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result
index 0a83262add1..19d5a026e65 100644
--- a/mysql-test/suite/roles/definer.result
+++ b/mysql-test/suite/roles/definer.result
@@ -38,7 +38,7 @@ connect c1, localhost, foo,,mysqltest1;
connection c1;
show grants;
Grants for foo@localhost
-GRANT role4 TO 'foo'@'localhost'
+GRANT 'role4' TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT CREATE VIEW ON `mysqltest1`.* TO 'foo'@'localhost'
select * from test.v1;
diff --git a/mysql-test/suite/roles/drop_routines.result b/mysql-test/suite/roles/drop_routines.result
index 11eda3a290f..8a5bb4f218c 100644
--- a/mysql-test/suite/roles/drop_routines.result
+++ b/mysql-test/suite/roles/drop_routines.result
@@ -7,15 +7,15 @@ grant r3 to r2;
grant r1 to u1;
show grants for u1;
Grants for u1@%
+GRANT 'r1' TO 'u1'@'%'
GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
show grants for r1;
Grants for r1
+GRANT 'r2' TO 'r1'
+GRANT 'r3' TO 'r2'
GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
grant SELECT on *.* to u1;
grant INSERT on mysql.* to r1;
grant DELETE on mysql.roles_mapping to r2;
@@ -33,6 +33,8 @@ revoke execute on procedure mysql.test_proc from r2;
ERROR 42000: There is no such grant defined for user 'r2' on host '' on routine 'test_proc'
show grants for r1;
Grants for r1
+GRANT 'r2' TO 'r1'
+GRANT 'r3' TO 'r2'
GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
@@ -41,17 +43,15 @@ GRANT UPDATE ON `mysql`.`user` TO 'r3'
GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
show grants for r2;
Grants for r2
+GRANT 'r3' TO 'r2'
GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
GRANT UPDATE ON `mysql`.`user` TO 'r3'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
-GRANT r3 TO 'r2'
show grants for r3;
Grants for r3
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
@@ -64,11 +64,11 @@ returns CHAR(50) DETERMINISTIC
return concat('Test string: ',s);
show grants for r2;
Grants for r2
+GRANT 'r3' TO 'r2'
GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
GRANT UPDATE ON `mysql`.`user` TO 'r3'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
-GRANT r3 TO 'r2'
connect u1,localhost,u1,,;
select mysql.test_func("none");
ERROR 42000: execute command denied to user 'u1'@'%' for routine 'mysql.test_func'
diff --git a/mysql-test/suite/roles/flush_roles-17898.result b/mysql-test/suite/roles/flush_roles-17898.result
index ae8fb0a27d2..a1a8f1a5dde 100644
--- a/mysql-test/suite/roles/flush_roles-17898.result
+++ b/mysql-test/suite/roles/flush_roles-17898.result
@@ -24,11 +24,11 @@ grant select on m_.* to r2;
grant r2 to r1;
show grants for u1@localhost;
Grants for u1@localhost
-GRANT r1 TO 'u1'@'localhost'
+GRANT 'r1' TO 'u1'@'localhost'
GRANT USAGE ON *.* TO 'u1'@'localhost'
show grants for r1;
Grants for r1
-GRANT r2 TO 'r1'
+GRANT 'r2' TO 'r1'
GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT SELECT ON `test`.* TO 'r2'
diff --git a/mysql-test/suite/roles/grant-5771.result b/mysql-test/suite/roles/grant-5771.result
index 87797d8b9a4..5b4c98522f0 100644
--- a/mysql-test/suite/roles/grant-5771.result
+++ b/mysql-test/suite/roles/grant-5771.result
@@ -21,9 +21,9 @@ show tables in mysqltest2;
Tables_in_mysqltest2
show grants;
Grants for foo@localhost
-GRANT r2 TO 'foo'@'localhost'
+GRANT 'r2' TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT r1 TO 'r2'
+GRANT 'r1' TO 'r2'
GRANT USAGE ON *.* TO 'r2'
GRANT ALL PRIVILEGES ON `mysqltest2`.* TO 'r2'
GRANT USAGE ON *.* TO 'r1'
diff --git a/mysql-test/suite/roles/grant_empty.result b/mysql-test/suite/roles/grant_empty.result
index 3316c755b9f..7ed9c663128 100644
--- a/mysql-test/suite/roles/grant_empty.result
+++ b/mysql-test/suite/roles/grant_empty.result
@@ -9,7 +9,7 @@ current_user
@localhost
show grants;
Grants for @localhost
-GRANT r1 TO ''@'localhost'
+GRANT 'r1' TO ''@'localhost'
GRANT USAGE ON *.* TO ''@'localhost'
connection default;
drop role r1;
diff --git a/mysql-test/suite/roles/grant_revoke_current.result b/mysql-test/suite/roles/grant_revoke_current.result
index 436bec92a8f..c3774923cd3 100644
--- a/mysql-test/suite/roles/grant_revoke_current.result
+++ b/mysql-test/suite/roles/grant_revoke_current.result
@@ -27,14 +27,14 @@ GRANT USAGE ON *.* TO 'r1'
set password=password('foobar');
show grants;
Grants for root@localhost
-GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'r1' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'r1'
grant r1 to current_user() identified by 'barfoo';
show grants;
Grants for root@localhost
-GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'r1' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'r1'
diff --git a/mysql-test/suite/roles/ip-6401.result b/mysql-test/suite/roles/ip-6401.result
index 1afd649636e..1b27e82bce1 100644
--- a/mysql-test/suite/roles/ip-6401.result
+++ b/mysql-test/suite/roles/ip-6401.result
@@ -4,7 +4,7 @@ grant r1 to foo@'127.0.0.1';
connect con1,127.0.0.1,foo,,;
show grants;
Grants for foo@127.0.0.1
-GRANT r1 TO 'foo'@'127.0.0.1'
+GRANT 'r1' TO 'foo'@'127.0.0.1'
GRANT USAGE ON *.* TO 'foo'@'127.0.0.1'
set role r1;
select * from information_schema.enabled_roles;
diff --git a/mysql-test/suite/roles/prepare_stmt_with_role.result b/mysql-test/suite/roles/prepare_stmt_with_role.result
index 0352502c35c..b2af23c8fbb 100644
--- a/mysql-test/suite/roles/prepare_stmt_with_role.result
+++ b/mysql-test/suite/roles/prepare_stmt_with_role.result
@@ -17,7 +17,7 @@ user host is_role
developers Y
SHOW GRANTS;
Grants for root@localhost
-GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'developers' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
# Test reexecution.
@@ -40,7 +40,7 @@ Host User Role Admin_option
localhost root developers Y
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT developers TO 'test_user'@'%'
+GRANT 'developers' TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
#
# Test revoking a role.
@@ -56,7 +56,7 @@ GRANT USAGE ON *.* TO 'test_user'@'%'
EXECUTE stmtGrantRole;
SHOW GRANTS FOR test_user;
Grants for test_user@%
-GRANT developers TO 'test_user'@'%'
+GRANT 'developers' TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
EXECUTE stmtRevokeRole;
SHOW GRANTS FOR test_user;
@@ -96,7 +96,7 @@ Host User Role Admin_option
localhost root developers Y
SHOW GRANTS;
Grants for root@localhost
-GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'developers' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR test_user;
diff --git a/mysql-test/suite/roles/rebuild_role_grants.result b/mysql-test/suite/roles/rebuild_role_grants.result
index 1068be9bc01..101efd47569 100644
--- a/mysql-test/suite/roles/rebuild_role_grants.result
+++ b/mysql-test/suite/roles/rebuild_role_grants.result
@@ -3,13 +3,13 @@ create user u1;
grant r1 to u1;
show grants for u1;
Grants for u1@%
+GRANT 'r1' TO 'u1'@'%'
GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
create user u2;
show grants for u1;
Grants for u1@%
+GRANT 'r1' TO 'u1'@'%'
GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
show grants for u2;
Grants for u2@%
GRANT USAGE ON *.* TO 'u2'@'%'
@@ -30,8 +30,8 @@ grant r1 to u1;
grant r1 to u1;
show grants for u1;
Grants for u1@%
+GRANT 'r1' TO 'u1'@'%'
GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
select * from mysql.roles_mapping;
Host User Role Admin_option
% u1 r1 N
@@ -65,3 +65,269 @@ drop role look, isp, xxx, ppp;
connection default;
disconnect con1;
drop user nnnn@'%';
+CREATE USER u@localhost;
+CREATE ROLE r1;
+CREATE ROLE r2;
+CREATE ROLE r3;
+CREATE ROLE r4;
+CREATE ROLE r5;
+CREATE ROLE r6;
+CREATE ROLE r7;
+CREATE ROLE r8;
+CREATE ROLE r9;
+CREATE ROLE r10;
+CREATE ROLE r11;
+CREATE ROLE r12;
+CREATE ROLE r13;
+CREATE ROLE r14;
+CREATE ROLE r15;
+CREATE ROLE r16;
+CREATE ROLE r17;
+CREATE ROLE r18;
+CREATE ROLE r19;
+CREATE ROLE r20;
+CREATE ROLE r21;
+CREATE ROLE r22;
+CREATE ROLE r23;
+CREATE ROLE r24;
+CREATE ROLE r25;
+CREATE ROLE r26;
+CREATE ROLE r27;
+CREATE ROLE r28;
+CREATE ROLE r29;
+CREATE ROLE r30;
+CREATE ROLE r31;
+CREATE ROLE r32;
+CREATE ROLE r33;
+CREATE ROLE r34;
+CREATE ROLE r35;
+CREATE ROLE r36;
+CREATE ROLE r37;
+CREATE ROLE r38;
+CREATE ROLE r39;
+CREATE ROLE r40;
+CREATE ROLE r41;
+CREATE ROLE r42;
+CREATE ROLE r43;
+CREATE ROLE r44;
+CREATE ROLE r45;
+CREATE ROLE r46;
+CREATE ROLE r47;
+CREATE ROLE r48;
+CREATE ROLE r49;
+CREATE ROLE r50;
+CREATE ROLE r51;
+CREATE ROLE r52;
+CREATE ROLE r53;
+CREATE ROLE r54;
+CREATE ROLE r55;
+CREATE ROLE r56;
+CREATE ROLE r57;
+CREATE ROLE r58;
+CREATE ROLE r59;
+CREATE ROLE r60;
+CREATE ROLE r61;
+CREATE ROLE r62;
+CREATE ROLE r63;
+CREATE ROLE r64;
+CREATE ROLE r65;
+CREATE ROLE r66;
+CREATE ROLE r67;
+CREATE ROLE r68;
+CREATE ROLE r69;
+CREATE ROLE r70;
+CREATE ROLE r71;
+CREATE ROLE r72;
+CREATE ROLE r73;
+CREATE ROLE r74;
+CREATE ROLE r75;
+CREATE ROLE r76;
+CREATE ROLE r77;
+CREATE ROLE r78;
+CREATE ROLE r79;
+CREATE ROLE r80;
+CREATE ROLE r81;
+CREATE ROLE r82;
+CREATE ROLE r83;
+CREATE ROLE r84;
+CREATE ROLE r85;
+CREATE ROLE r86;
+CREATE ROLE r87;
+CREATE ROLE r88;
+CREATE ROLE r89;
+CREATE ROLE r90;
+CREATE ROLE r91;
+CREATE ROLE r92;
+CREATE ROLE r93;
+CREATE ROLE r94;
+CREATE ROLE r95;
+CREATE ROLE r96;
+CREATE ROLE r97;
+CREATE ROLE r98;
+CREATE ROLE r99;
+CREATE ROLE r100;
+CREATE ROLE r101;
+CREATE ROLE r102;
+CREATE ROLE r103;
+CREATE ROLE r104;
+CREATE ROLE r105;
+CREATE ROLE r106;
+CREATE ROLE r107;
+CREATE ROLE r108;
+CREATE ROLE r109;
+CREATE ROLE r110;
+CREATE ROLE r111;
+CREATE ROLE r112;
+CREATE ROLE r113;
+CREATE ROLE r114;
+CREATE ROLE r115;
+CREATE ROLE r116;
+CREATE ROLE r117;
+CREATE ROLE r118;
+CREATE ROLE r119;
+CREATE ROLE r120;
+CREATE ROLE r121;
+CREATE ROLE r122;
+CREATE ROLE r123;
+CREATE ROLE r124;
+CREATE ROLE r125;
+CREATE ROLE r126;
+CREATE ROLE r127;
+CREATE ROLE r128;
+CREATE ROLE n;
+CREATE ROLE d WITH ADMIN n;
+CREATE ROLE '%' WITH ADMIN u@localhost;
+DROP ROLE n;
+CREATE USER 't';
+DROP ROLE r1;
+DROP ROLE r2;
+DROP ROLE r3;
+DROP ROLE r4;
+DROP ROLE r5;
+DROP ROLE r6;
+DROP ROLE r7;
+DROP ROLE r8;
+DROP ROLE r9;
+DROP ROLE r10;
+DROP ROLE r11;
+DROP ROLE r12;
+DROP ROLE r13;
+DROP ROLE r14;
+DROP ROLE r15;
+DROP ROLE r16;
+DROP ROLE r17;
+DROP ROLE r18;
+DROP ROLE r19;
+DROP ROLE r20;
+DROP ROLE r21;
+DROP ROLE r22;
+DROP ROLE r23;
+DROP ROLE r24;
+DROP ROLE r25;
+DROP ROLE r26;
+DROP ROLE r27;
+DROP ROLE r28;
+DROP ROLE r29;
+DROP ROLE r30;
+DROP ROLE r31;
+DROP ROLE r32;
+DROP ROLE r33;
+DROP ROLE r34;
+DROP ROLE r35;
+DROP ROLE r36;
+DROP ROLE r37;
+DROP ROLE r38;
+DROP ROLE r39;
+DROP ROLE r40;
+DROP ROLE r41;
+DROP ROLE r42;
+DROP ROLE r43;
+DROP ROLE r44;
+DROP ROLE r45;
+DROP ROLE r46;
+DROP ROLE r47;
+DROP ROLE r48;
+DROP ROLE r49;
+DROP ROLE r50;
+DROP ROLE r51;
+DROP ROLE r52;
+DROP ROLE r53;
+DROP ROLE r54;
+DROP ROLE r55;
+DROP ROLE r56;
+DROP ROLE r57;
+DROP ROLE r58;
+DROP ROLE r59;
+DROP ROLE r60;
+DROP ROLE r61;
+DROP ROLE r62;
+DROP ROLE r63;
+DROP ROLE r64;
+DROP ROLE r65;
+DROP ROLE r66;
+DROP ROLE r67;
+DROP ROLE r68;
+DROP ROLE r69;
+DROP ROLE r70;
+DROP ROLE r71;
+DROP ROLE r72;
+DROP ROLE r73;
+DROP ROLE r74;
+DROP ROLE r75;
+DROP ROLE r76;
+DROP ROLE r77;
+DROP ROLE r78;
+DROP ROLE r79;
+DROP ROLE r80;
+DROP ROLE r81;
+DROP ROLE r82;
+DROP ROLE r83;
+DROP ROLE r84;
+DROP ROLE r85;
+DROP ROLE r86;
+DROP ROLE r87;
+DROP ROLE r88;
+DROP ROLE r89;
+DROP ROLE r90;
+DROP ROLE r91;
+DROP ROLE r92;
+DROP ROLE r93;
+DROP ROLE r94;
+DROP ROLE r95;
+DROP ROLE r96;
+DROP ROLE r97;
+DROP ROLE r98;
+DROP ROLE r99;
+DROP ROLE r100;
+DROP ROLE r101;
+DROP ROLE r102;
+DROP ROLE r103;
+DROP ROLE r104;
+DROP ROLE r105;
+DROP ROLE r106;
+DROP ROLE r107;
+DROP ROLE r108;
+DROP ROLE r109;
+DROP ROLE r110;
+DROP ROLE r111;
+DROP ROLE r112;
+DROP ROLE r113;
+DROP ROLE r114;
+DROP ROLE r115;
+DROP ROLE r116;
+DROP ROLE r117;
+DROP ROLE r118;
+DROP ROLE r119;
+DROP ROLE r120;
+DROP ROLE r121;
+DROP ROLE r122;
+DROP ROLE r123;
+DROP ROLE r124;
+DROP ROLE r125;
+DROP ROLE r126;
+DROP ROLE r127;
+DROP ROLE r128;
+DROP ROLE d;
+DROP ROLE '%';
+DROP USER 't';
+DROP USER u@localhost;
diff --git a/mysql-test/suite/roles/rebuild_role_grants.test b/mysql-test/suite/roles/rebuild_role_grants.test
index 84dbdf78fb8..7007df0ecdd 100644
--- a/mysql-test/suite/roles/rebuild_role_grants.test
+++ b/mysql-test/suite/roles/rebuild_role_grants.test
@@ -67,3 +67,34 @@ drop role look, isp, xxx, ppp;
connection default;
disconnect con1;
drop user nnnn@'%';
+
+#
+# MDEV-17964 Assertion `status == 0' failed in add_role_user_mapping_action
+# upon CREATE USER and DROP ROLE
+#
+CREATE USER u@localhost;
+
+--let $n= 1
+while ($n < 129)
+{
+ eval CREATE ROLE r$n;
+ inc $n;
+}
+
+CREATE ROLE n;
+CREATE ROLE d WITH ADMIN n;
+CREATE ROLE '%' WITH ADMIN u@localhost;
+DROP ROLE n;
+CREATE USER 't';
+
+--let $n= 1
+while ($n < 129)
+{
+ eval DROP ROLE r$n;
+ inc $n;
+}
+
+DROP ROLE d;
+DROP ROLE '%';
+DROP USER 't';
+DROP USER u@localhost;
diff --git a/mysql-test/suite/roles/recursive.result b/mysql-test/suite/roles/recursive.result
index 897577ba2ff..18fb573ecc0 100644
--- a/mysql-test/suite/roles/recursive.result
+++ b/mysql-test/suite/roles/recursive.result
@@ -26,8 +26,8 @@ ERROR HY000: Cannot grant role 'role10' to: 'role2'
connect foo, localhost, foo;
show grants;
Grants for foo@localhost
+GRANT 'role10' TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT role10 TO 'foo'@'localhost'
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@localhost role10 NO NO
@@ -56,6 +56,17 @@ count(*)
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT ON *.* TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'role10'
@@ -66,17 +77,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
select * from information_schema.enabled_roles;
ROLE_NAME
role1
@@ -114,6 +114,17 @@ count(*)
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT ON `mysql`.* TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'role1'
@@ -125,17 +136,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
connection default;
revoke select on mysql.* from role1;
show status like 'debug%';
@@ -157,6 +157,17 @@ count(*)
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT ON `mysql`.`roles_mapping` TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'role1'
@@ -168,17 +179,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
connection default;
revoke select on mysql.roles_mapping from role1;
show status like 'debug%';
@@ -202,6 +202,17 @@ count(concat(User))
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'role1'
@@ -213,17 +224,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
connection default;
grant select(Host) on mysql.roles_mapping to role3;
show status like 'debug%';
@@ -236,6 +236,17 @@ count(concat(User,Host))
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO 'role3'
GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
@@ -248,17 +259,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
connection default;
revoke select(User) on mysql.roles_mapping from role1;
show status like 'debug%';
diff --git a/mysql-test/suite/roles/recursive_dbug.result b/mysql-test/suite/roles/recursive_dbug.result
index cec461be4a2..a5772a6354c 100644
--- a/mysql-test/suite/roles/recursive_dbug.result
+++ b/mysql-test/suite/roles/recursive_dbug.result
@@ -30,8 +30,8 @@ ERROR HY000: Cannot grant role 'role10' to: 'role2'
connect foo, localhost, foo;
show grants;
Grants for foo@localhost
+GRANT 'role10' TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'foo'@'localhost'
-GRANT role10 TO 'foo'@'localhost'
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@localhost role10 NO NO
@@ -70,6 +70,17 @@ count(*)
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT ON *.* TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'role10'
@@ -80,17 +91,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
select * from information_schema.enabled_roles;
ROLE_NAME
role1
@@ -138,6 +138,17 @@ count(*)
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT ON `mysql`.* TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'role1'
@@ -149,17 +160,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
connection default;
revoke select on mysql.* from role1;
show status like 'debug%';
@@ -191,6 +191,17 @@ count(*)
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT ON `mysql`.`roles_mapping` TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'role1'
@@ -202,17 +213,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
connection default;
revoke select on mysql.roles_mapping from role1;
show status like 'debug%';
@@ -246,6 +246,17 @@ count(concat(User))
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'role1'
@@ -257,17 +268,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
connection default;
grant select(Host) on mysql.roles_mapping to role3;
show status like 'debug%';
@@ -285,6 +285,17 @@ count(concat(User,Host))
22
show grants;
Grants for foo@localhost
+GRANT 'role1' TO 'role2'
+GRANT 'role10' TO 'foo'@'localhost'
+GRANT 'role2' TO 'role4'
+GRANT 'role2' TO 'role5'
+GRANT 'role3' TO 'role5'
+GRANT 'role4' TO 'role6'
+GRANT 'role5' TO 'role6'
+GRANT 'role5' TO 'role7'
+GRANT 'role6' TO 'role9'
+GRANT 'role7' TO 'role9'
+GRANT 'role9' TO 'role10'
GRANT SELECT (Host) ON `mysql`.`roles_mapping` TO 'role3'
GRANT SELECT (User) ON `mysql`.`roles_mapping` TO 'role1'
GRANT USAGE ON *.* TO 'foo'@'localhost'
@@ -297,17 +308,6 @@ GRANT USAGE ON *.* TO 'role5'
GRANT USAGE ON *.* TO 'role6'
GRANT USAGE ON *.* TO 'role7'
GRANT USAGE ON *.* TO 'role9'
-GRANT role1 TO 'role2'
-GRANT role10 TO 'foo'@'localhost'
-GRANT role2 TO 'role4'
-GRANT role2 TO 'role5'
-GRANT role3 TO 'role5'
-GRANT role4 TO 'role6'
-GRANT role5 TO 'role6'
-GRANT role5 TO 'role7'
-GRANT role6 TO 'role9'
-GRANT role7 TO 'role9'
-GRANT role9 TO 'role10'
connection default;
revoke select(User) on mysql.roles_mapping from role1;
show status like 'debug%';
diff --git a/mysql-test/suite/roles/revoke_all.result b/mysql-test/suite/roles/revoke_all.result
index 7e72b5bc766..b2457e6b5f5 100644
--- a/mysql-test/suite/roles/revoke_all.result
+++ b/mysql-test/suite/roles/revoke_all.result
@@ -10,18 +10,18 @@ grant r1 to u1;
grant r4 to r1;
show grants for u1;
Grants for u1@%
+GRANT 'r1' TO 'u1'@'%'
GRANT USAGE ON *.* TO 'u1'@'%'
-GRANT r1 TO 'u1'@'%'
show grants for r1;
Grants for r1
+GRANT 'r2' TO 'r1'
+GRANT 'r3' TO 'r2'
+GRANT 'r4' TO 'r1'
+GRANT 'r4' TO 'r3'
GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
-GRANT r4 TO 'r3'
grant SELECT on *.* to u1;
grant INSERT on mysql.* to r1;
grant DELETE on mysql.roles_mapping to r2;
@@ -38,6 +38,10 @@ grant execute on procedure mysql.test_proc to r3;
grant execute on mysql.* to r4;
show grants for r1;
Grants for r1
+GRANT 'r2' TO 'r1'
+GRANT 'r3' TO 'r2'
+GRANT 'r4' TO 'r1'
+GRANT 'r4' TO 'r3'
GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
@@ -48,12 +52,10 @@ GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
-GRANT r4 TO 'r3'
show grants for r2;
Grants for r2
+GRANT 'r3' TO 'r2'
+GRANT 'r4' TO 'r3'
GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
@@ -62,16 +64,14 @@ GRANT UPDATE ON `mysql`.`user` TO 'r3'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
GRANT USAGE ON *.* TO 'r4'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r3'
show grants for r3;
Grants for r3
+GRANT 'r4' TO 'r3'
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
GRANT EXECUTE ON `mysql`.* TO 'r4'
GRANT UPDATE ON `mysql`.`user` TO 'r3'
GRANT USAGE ON *.* TO 'r3'
GRANT USAGE ON *.* TO 'r4'
-GRANT r4 TO 'r3'
show grants for r4;
Grants for r4
GRANT EXECUTE ON `mysql`.* TO 'r4'
@@ -79,6 +79,10 @@ GRANT USAGE ON *.* TO 'r4'
revoke all privileges, grant option from r4;
show grants for r1;
Grants for r1
+GRANT 'r2' TO 'r1'
+GRANT 'r3' TO 'r2'
+GRANT 'r4' TO 'r1'
+GRANT 'r4' TO 'r3'
GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
@@ -88,12 +92,10 @@ GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
-GRANT r4 TO 'r3'
show grants for r2;
Grants for r2
+GRANT 'r3' TO 'r2'
+GRANT 'r4' TO 'r3'
GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
@@ -101,21 +103,22 @@ GRANT UPDATE ON `mysql`.`user` TO 'r3'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
GRANT USAGE ON *.* TO 'r4'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r3'
show grants for r3;
Grants for r3
+GRANT 'r4' TO 'r3'
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'r3'
GRANT UPDATE ON `mysql`.`user` TO 'r3'
GRANT USAGE ON *.* TO 'r3'
GRANT USAGE ON *.* TO 'r4'
-GRANT r4 TO 'r3'
show grants for r4;
Grants for r4
GRANT USAGE ON *.* TO 'r4'
revoke all privileges, grant option from r3;
show grants for r1;
Grants for r1
+GRANT 'r2' TO 'r1'
+GRANT 'r3' TO 'r2'
+GRANT 'r4' TO 'r1'
GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
GRANT INSERT ON `mysql`.* TO 'r1'
@@ -123,16 +126,13 @@ GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r3 TO 'r2'
-GRANT r4 TO 'r1'
show grants for r2;
Grants for r2
+GRANT 'r3' TO 'r2'
GRANT DELETE ON `mysql`.`roles_mapping` TO 'r2'
GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'r2'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
-GRANT r3 TO 'r2'
show grants for r3;
Grants for r3
GRANT USAGE ON *.* TO 'r3'
@@ -142,12 +142,12 @@ GRANT USAGE ON *.* TO 'r4'
revoke all privileges, grant option from r2;
show grants for r1;
Grants for r1
+GRANT 'r2' TO 'r1'
+GRANT 'r4' TO 'r1'
GRANT INSERT ON `mysql`.* TO 'r1'
GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r4'
-GRANT r2 TO 'r1'
-GRANT r4 TO 'r1'
show grants for r2;
Grants for r2
GRANT USAGE ON *.* TO 'r2'
diff --git a/mysql-test/suite/roles/role_case_sensitive-10744.result b/mysql-test/suite/roles/role_case_sensitive-10744.result
index b898310e83c..4870300eefc 100644
--- a/mysql-test/suite/roles/role_case_sensitive-10744.result
+++ b/mysql-test/suite/roles/role_case_sensitive-10744.result
@@ -21,7 +21,7 @@ grant select on secret_db.* to test_role;
grant test_role to test_user;
show grants for test_user;
Grants for test_user@%
-GRANT test_role TO 'test_user'@'%'
+GRANT 'test_role' TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
#
# Now test the UPPER case role.
@@ -30,8 +30,8 @@ grant test_ROLE to test_user;
grant insert on secret_db.t1 to test_ROLE;
show grants for test_user;
Grants for test_user@%
-GRANT test_role TO 'test_user'@'%'
-GRANT test_ROLE TO 'test_user'@'%'
+GRANT 'test_role' TO 'test_user'@'%'
+GRANT 'test_ROLE' TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
connect test_user,localhost,test_user;
#
diff --git a/mysql-test/suite/roles/rpl_definer.result b/mysql-test/suite/roles/rpl_definer.result
index 2d10dc6cd7a..44f0d883ba3 100644
--- a/mysql-test/suite/roles/rpl_definer.result
+++ b/mysql-test/suite/roles/rpl_definer.result
@@ -7,14 +7,14 @@ grant role2 to role1;
set role role1;
show grants;
Grants for root@localhost
+GRANT 'role1' TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'role2' TO 'role1'
+GRANT 'role2' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT EXECUTE ON `test`.* TO 'role2'
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'role1'
GRANT USAGE ON *.* TO 'role2'
-GRANT role1 TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'role1'
-GRANT role2 TO 'root'@'localhost' WITH ADMIN OPTION
create definer=current_user procedure pcu() select current_user;
create definer=root@localhost procedure pu() select "root@localhost";
create definer=current_role procedure pcr() select current_role;
@@ -39,14 +39,14 @@ connection slave;
set role role1;
show grants;
Grants for root@localhost
+GRANT 'role1' TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'role2' TO 'role1'
+GRANT 'role2' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT EXECUTE ON `test`.* TO 'role2'
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'role1'
GRANT USAGE ON *.* TO 'role2'
-GRANT role1 TO 'root'@'localhost' WITH ADMIN OPTION
-GRANT role2 TO 'role1'
-GRANT role2 TO 'root'@'localhost' WITH ADMIN OPTION
show create procedure pcu;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
pcu STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`()
diff --git a/mysql-test/suite/roles/set_and_drop.result b/mysql-test/suite/roles/set_and_drop.result
index 2d3e675ebd0..69e2128c170 100644
--- a/mysql-test/suite/roles/set_and_drop.result
+++ b/mysql-test/suite/roles/set_and_drop.result
@@ -56,7 +56,7 @@ drop role role2;
connection foo;
show grants;
Grants for foo@localhost
-GRANT role1 TO 'foo'@'localhost'
+GRANT 'role1' TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'foo'@'localhost'
GRANT USAGE ON *.* TO 'role1'
select * from information_schema.enabled_roles;
diff --git a/mysql-test/suite/roles/set_default_role_clear.result b/mysql-test/suite/roles/set_default_role_clear.result
index 3cb13f55b4b..3e322a2df9f 100644
--- a/mysql-test/suite/roles/set_default_role_clear.result
+++ b/mysql-test/suite/roles/set_default_role_clear.result
@@ -4,7 +4,7 @@ grant select on *.* to test_role;
grant test_role to test_user@localhost;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
+GRANT 'test_role' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
set default role test_role;
select user, host, default_role from mysql.user;
@@ -14,10 +14,10 @@ user host default_role
test_user localhost test_role
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
+GRANT 'test_role' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT SELECT ON *.* TO 'test_role'
-SET DEFAULT ROLE test_role FOR 'test_user'@'localhost'
+SET DEFAULT ROLE 'test_role' FOR 'test_user'@'localhost'
select user, host, default_role from mysql.user where user='test_user';
user host default_role
test_user localhost test_role
diff --git a/mysql-test/suite/roles/set_default_role_for.result b/mysql-test/suite/roles/set_default_role_for.result
index 62c31373486..1f0812caeb9 100644
--- a/mysql-test/suite/roles/set_default_role_for.result
+++ b/mysql-test/suite/roles/set_default_role_for.result
@@ -14,14 +14,14 @@ set default role role_a for user_a@localhost;
set default role invalid_role for user_a@localhost;
ERROR OP000: Invalid role specification `invalid_role`
set default role role_b for user_a@localhost;
-ERROR OP000: User `user_a@localhost` has not been granted role `role_b`
+ERROR OP000: User `root`@`localhost` has not been granted role `role_b`
set default role role_b for user_b@localhost;
show grants;
Grants for user_a@localhost
-GRANT role_a TO 'user_a'@'localhost'
+GRANT 'role_a' TO 'user_a'@'localhost'
GRANT USAGE ON *.* TO 'user_a'@'localhost'
GRANT SELECT ON *.* TO 'role_a'
-SET DEFAULT ROLE role_a FOR 'user_a'@'localhost'
+SET DEFAULT ROLE 'role_a' FOR 'user_a'@'localhost'
select user, host, default_role from mysql.user where user like 'user_%';
user host default_role
user_a localhost role_a
@@ -37,13 +37,13 @@ user host default_role
user_a localhost role_a
user_b localhost role_b
set default role role_b for current_user;
-ERROR OP000: User `user_a@localhost` has not been granted role `role_b`
+ERROR OP000: User `user_a`@`localhost` has not been granted role `role_b`
show grants;
Grants for user_b@localhost
-GRANT role_b TO 'user_b'@'localhost'
+GRANT 'role_b' TO 'user_b'@'localhost'
GRANT USAGE ON *.* TO 'user_b'@'localhost'
GRANT INSERT, UPDATE ON *.* TO 'role_b'
-SET DEFAULT ROLE role_b FOR 'user_b'@'localhost'
+SET DEFAULT ROLE 'role_b' FOR 'user_b'@'localhost'
select user, host, default_role from mysql.user where user like 'user_%';
ERROR 42000: SELECT command denied to user 'user_b'@'localhost' for table 'user'
insert ignore into mysql.user (user, host) values ('someuser', 'somehost');
@@ -55,7 +55,7 @@ Warning 1364 Field 'authentication_string' doesn't have a default value
set default role NONE for user_a@localhost;
show grants;
Grants for user_a@localhost
-GRANT role_a TO 'user_a'@'localhost'
+GRANT 'role_a' TO 'user_a'@'localhost'
GRANT USAGE ON *.* TO 'user_a'@'localhost'
GRANT INSERT, UPDATE ON *.* TO 'role_b'
select user, host, default_role from mysql.user where user like 'user_%';
diff --git a/mysql-test/suite/roles/set_default_role_invalid.result b/mysql-test/suite/roles/set_default_role_invalid.result
index 53ee464e2c1..b18f0154c91 100644
--- a/mysql-test/suite/roles/set_default_role_invalid.result
+++ b/mysql-test/suite/roles/set_default_role_invalid.result
@@ -5,7 +5,7 @@ grant select on *.* to test_role;
grant test_role to test_user@localhost;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
+GRANT 'test_role' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
select user, host, default_role from mysql.user;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
@@ -21,10 +21,10 @@ user host default_role
test_user localhost test_role
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
+GRANT 'test_role' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT SELECT ON *.* TO 'test_role'
-SET DEFAULT ROLE test_role FOR 'test_user'@'localhost'
+SET DEFAULT ROLE 'test_role' FOR 'test_user'@'localhost'
select user, host, default_role from mysql.user where user='test_user';
user host default_role
test_user localhost test_role
@@ -48,7 +48,7 @@ CREATE USER b;
CREATE ROLE r1;
CREATE ROLE r2;
SET DEFAULT ROLE r1 FOR a;
-ERROR OP000: User `a@%` has not been granted role `r1`
+ERROR OP000: User `root`@`localhost` has not been granted role `r1`
GRANT r1 TO b;
GRANT r2 TO b;
SET DEFAULT ROLE r1 FOR b;
@@ -68,11 +68,11 @@ GRANT SELECT ON mysql.* TO b;
# Change user b (session 1: select_priv)
SHOW GRANTS FOR b;
Grants for b@%
-GRANT r1 TO 'b'@'%'
-GRANT r2 TO 'b'@'%'
+GRANT 'r1' TO 'b'@'%'
+GRANT 'r2' TO 'b'@'%'
GRANT USAGE ON *.* TO 'b'@'%'
GRANT SELECT ON `mysql`.* TO 'b'@'%'
-SET DEFAULT ROLE r2 FOR 'b'@'%'
+SET DEFAULT ROLE 'r2' FOR 'b'@'%'
SET DEFAULT ROLE r1 FOR a;
ERROR 42000: Access denied for user 'b'@'%' to database 'mysql'
SELECT CURRENT_ROLE;
@@ -94,13 +94,13 @@ GRANT UPDATE ON mysql.* TO b;
# Change user b
SHOW GRANTS FOR b;
Grants for b@%
-GRANT r1 TO 'b'@'%'
-GRANT r2 TO 'b'@'%'
+GRANT 'r1' TO 'b'@'%'
+GRANT 'r2' TO 'b'@'%'
GRANT USAGE ON *.* TO 'b'@'%'
GRANT SELECT, UPDATE ON `mysql`.* TO 'b'@'%'
-SET DEFAULT ROLE r2 FOR 'b'@'%'
+SET DEFAULT ROLE 'r2' FOR 'b'@'%'
SET DEFAULT ROLE r1 FOR a;
-ERROR OP000: User `a@%` has not been granted role `r1`
+ERROR OP000: User `b`@`%` has not been granted role `r1`
SET DEFAULT ROLE invalid_role;
ERROR OP000: Invalid role specification `invalid_role`
SET DEFAULT ROLE invalid_role FOR a;
@@ -117,7 +117,7 @@ SET DEFAULT ROLE None;
# Change user b (session 3: role granted to user a)
SET DEFAULT ROLE r1 FOR a;
SET DEFAULT ROLE r2 FOR a;
-ERROR OP000: User `a@%` has not been granted role `r2`
+ERROR OP000: User `b`@`%` has not been granted role `r2`
SET DEFAULT ROLE invalid_role;
ERROR OP000: Invalid role specification `invalid_role`
SET DEFAULT ROLE invalid_role FOR a;
diff --git a/mysql-test/suite/roles/set_default_role_new_connection.result b/mysql-test/suite/roles/set_default_role_new_connection.result
index 75e4075ff9e..79ce800ed43 100644
--- a/mysql-test/suite/roles/set_default_role_new_connection.result
+++ b/mysql-test/suite/roles/set_default_role_new_connection.result
@@ -5,7 +5,7 @@ grant test_role to test_user@localhost;
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
+GRANT 'test_role' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
select user, host, default_role from mysql.user where user = 'test_user';
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
@@ -20,10 +20,10 @@ test_user localhost test_role
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
+GRANT 'test_role' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT SELECT ON *.* TO 'test_role'
-SET DEFAULT ROLE test_role FOR 'test_user'@'localhost'
+SET DEFAULT ROLE 'test_role' FOR 'test_user'@'localhost'
select user, host, default_role from mysql.user where user = 'test_user';
user host default_role
test_user localhost test_role
@@ -36,7 +36,7 @@ test_user localhost
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
+GRANT 'test_role' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
select user, host, default_role from mysql.user where user = 'test_user';
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
@@ -49,10 +49,10 @@ set default role test_role for test_user@localhost;
connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
-GRANT test_role TO 'test_user'@'localhost'
+GRANT 'test_role' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT SELECT ON *.* TO 'test_role'
-SET DEFAULT ROLE test_role FOR 'test_user'@'localhost'
+SET DEFAULT ROLE 'test_role' FOR 'test_user'@'localhost'
select user, host, default_role from mysql.user where user = 'test_user';
user host default_role
test_user localhost test_role
diff --git a/mysql-test/suite/roles/set_role-13655.result b/mysql-test/suite/roles/set_role-13655.result
index c30e4115953..9d7008ad921 100644
--- a/mysql-test/suite/roles/set_role-13655.result
+++ b/mysql-test/suite/roles/set_role-13655.result
@@ -18,7 +18,7 @@ create role admin;
grant simple to admin;
show grants for admin;
Grants for admin
-GRANT simple TO 'admin'
+GRANT 'simple' TO 'admin'
GRANT USAGE ON *.* TO 'admin'
GRANT USAGE ON *.* TO 'simple'
GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO 'simple'
@@ -37,9 +37,9 @@ ERROR 42000: Access denied for user 'foo'@'%' to database 't'
set role admin;
show grants;
Grants for foo@%
-GRANT admin TO 'foo'@'%'
+GRANT 'admin' TO 'foo'@'%'
GRANT USAGE ON *.* TO 'foo'@'%'
-GRANT simple TO 'admin'
+GRANT 'simple' TO 'admin'
GRANT USAGE ON *.* TO 'admin'
GRANT ALL PRIVILEGES ON `t`.* TO 'admin'
GRANT USAGE ON *.* TO 'simple'
diff --git a/mysql-test/suite/roles/set_role-9614.result b/mysql-test/suite/roles/set_role-9614.result
index 37f6db070c0..60986c2c133 100644
--- a/mysql-test/suite/roles/set_role-9614.result
+++ b/mysql-test/suite/roles/set_role-9614.result
@@ -35,11 +35,11 @@ GRANT `client` TO `usertestjohn`@`%`;
#
SHOW GRANTS FOR `john`@`%`;
Grants for john@%
-GRANT client TO 'john'@'%'
+GRANT 'client' TO 'john'@'%'
GRANT USAGE ON *.* TO 'john'@'%'
SHOW GRANTS FOR `usertestjohn`@`%`;
Grants for usertestjohn@%
-GRANT client TO 'usertestjohn'@'%'
+GRANT 'client' TO 'usertestjohn'@'%'
GRANT USAGE ON *.* TO 'usertestjohn'@'%'
SHOW GRANTS FOR `client`;
Grants for client
@@ -84,7 +84,7 @@ information_schema
test
show grants;
Grants for usertestjohn@%
-GRANT client TO 'usertestjohn'@'%'
+GRANT 'client' TO 'usertestjohn'@'%'
GRANT USAGE ON *.* TO 'usertestjohn'@'%'
GRANT USAGE ON *.* TO 'client'
GRANT SELECT ON `bug_db`.`t0` TO 'client'
diff --git a/mysql-test/suite/roles/set_role-database-recursive.result b/mysql-test/suite/roles/set_role-database-recursive.result
index 479e553c3d1..64cf2a2f9af 100644
--- a/mysql-test/suite/roles/set_role-database-recursive.result
+++ b/mysql-test/suite/roles/set_role-database-recursive.result
@@ -67,6 +67,11 @@ set role test_role1;
delete from mysql.user where user='no such user';
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
+GRANT 'test_role2' TO 'test_user'@'localhost'
+GRANT 'test_role3' TO 'test_role2'
+GRANT 'test_role4' TO 'test_role3'
GRANT DELETE ON `mysql`.* TO 'test_role4'
GRANT SELECT ON `mysql`.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
@@ -74,10 +79,5 @@ GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role3'
GRANT USAGE ON *.* TO 'test_role4'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
-GRANT test_role2 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_role2'
-GRANT test_role4 TO 'test_role3'
drop user test_user@localhost;
drop role test_role1, test_role2, test_role3, test_role4;
diff --git a/mysql-test/suite/roles/set_role-multiple-role.result b/mysql-test/suite/roles/set_role-multiple-role.result
index fca53b4d645..eb359e85f52 100644
--- a/mysql-test/suite/roles/set_role-multiple-role.result
+++ b/mysql-test/suite/roles/set_role-multiple-role.result
@@ -25,14 +25,14 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
+GRANT 'r_crt' TO 'test_user'@'localhost'
+GRANT 'r_del' TO 'test_user'@'localhost'
+GRANT 'r_drp' TO 'test_user'@'localhost'
+GRANT 'r_ins' TO 'test_user'@'localhost'
+GRANT 'r_rld' TO 'test_user'@'localhost'
+GRANT 'r_sel' TO 'test_user'@'localhost'
+GRANT 'r_upd' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT r_crt TO 'test_user'@'localhost'
-GRANT r_del TO 'test_user'@'localhost'
-GRANT r_drp TO 'test_user'@'localhost'
-GRANT r_ins TO 'test_user'@'localhost'
-GRANT r_rld TO 'test_user'@'localhost'
-GRANT r_sel TO 'test_user'@'localhost'
-GRANT r_upd TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -42,15 +42,15 @@ current_user() current_role()
test_user@localhost r_sel
show grants;
Grants for test_user@localhost
+GRANT 'r_crt' TO 'test_user'@'localhost'
+GRANT 'r_del' TO 'test_user'@'localhost'
+GRANT 'r_drp' TO 'test_user'@'localhost'
+GRANT 'r_ins' TO 'test_user'@'localhost'
+GRANT 'r_rld' TO 'test_user'@'localhost'
+GRANT 'r_sel' TO 'test_user'@'localhost'
+GRANT 'r_upd' TO 'test_user'@'localhost'
GRANT SELECT ON *.* TO 'r_sel'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT r_crt TO 'test_user'@'localhost'
-GRANT r_del TO 'test_user'@'localhost'
-GRANT r_drp TO 'test_user'@'localhost'
-GRANT r_ins TO 'test_user'@'localhost'
-GRANT r_rld TO 'test_user'@'localhost'
-GRANT r_sel TO 'test_user'@'localhost'
-GRANT r_upd TO 'test_user'@'localhost'
select * from mysql.roles_mapping;
Host User Role Admin_option
localhost root r_crt Y
@@ -73,15 +73,15 @@ current_user() current_role()
test_user@localhost r_ins
show grants;
Grants for test_user@localhost
+GRANT 'r_crt' TO 'test_user'@'localhost'
+GRANT 'r_del' TO 'test_user'@'localhost'
+GRANT 'r_drp' TO 'test_user'@'localhost'
+GRANT 'r_ins' TO 'test_user'@'localhost'
+GRANT 'r_rld' TO 'test_user'@'localhost'
+GRANT 'r_sel' TO 'test_user'@'localhost'
+GRANT 'r_upd' TO 'test_user'@'localhost'
GRANT INSERT ON *.* TO 'r_ins'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT r_crt TO 'test_user'@'localhost'
-GRANT r_del TO 'test_user'@'localhost'
-GRANT r_drp TO 'test_user'@'localhost'
-GRANT r_ins TO 'test_user'@'localhost'
-GRANT r_rld TO 'test_user'@'localhost'
-GRANT r_sel TO 'test_user'@'localhost'
-GRANT r_upd TO 'test_user'@'localhost'
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
insert into mysql.roles_mapping values ('', 'r_sel', 'r_rld', 'N');
diff --git a/mysql-test/suite/roles/set_role-recursive.result b/mysql-test/suite/roles/set_role-recursive.result
index b0d79377183..fb62019c2e4 100644
--- a/mysql-test/suite/roles/set_role-recursive.result
+++ b/mysql-test/suite/roles/set_role-recursive.result
@@ -25,8 +25,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -36,79 +36,79 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
GRANT SELECT ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
select * from mysql.roles_mapping where Host='';
Host User Role Admin_option
test_role1 test_role2 N
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
GRANT SELECT ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
set role test_role2;
-ERROR OP000: User `test_user@localhost` has not been granted role `test_role2`
+ERROR OP000: User `test_user`@`localhost` has not been granted role `test_role2`
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
set role test_role1;
select current_user(), current_role();
current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
GRANT SELECT ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
select * from mysql.roles_mapping where Host='';
Host User Role Admin_option
test_role1 test_role2 N
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
GRANT SELECT ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
delete from mysql.user where user='test_role1';
diff --git a/mysql-test/suite/roles/set_role-routine-simple.result b/mysql-test/suite/roles/set_role-routine-simple.result
index 3e17a78ad77..b25926af209 100644
--- a/mysql-test/suite/roles/set_role-routine-simple.result
+++ b/mysql-test/suite/roles/set_role-routine-simple.result
@@ -31,9 +31,9 @@ grant execute on procedure mysql.test_proc to test_role2;
grant execute on mysql.* to test_role3;
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role3' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_user'@'localhost'
use mysql;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
select current_user(), current_role();
@@ -53,23 +53,23 @@ test_func('AABBCCDD')
Test string: AABBCCDD
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
+GRANT 'test_role3' TO 'test_user'@'localhost'
GRANT EXECUTE ON FUNCTION `mysql`.`test_func` TO 'test_role2'
GRANT EXECUTE ON PROCEDURE `mysql`.`test_proc` TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
-GRANT test_role3 TO 'test_user'@'localhost'
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role3' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_user'@'localhost'
call test_proc(@a);
ERROR 42000: execute command denied to user 'test_user'@'localhost' for routine 'mysql.test_proc'
SELECT test_func('AABBCCDD');
@@ -80,11 +80,11 @@ current_user() current_role()
test_user@localhost test_role3
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role3' TO 'test_user'@'localhost'
GRANT EXECUTE ON `mysql`.* TO 'test_role3'
GRANT USAGE ON *.* TO 'test_role3'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role3 TO 'test_user'@'localhost'
call test_proc(@a);
SELECT @a;
@a
diff --git a/mysql-test/suite/roles/set_role-simple.result b/mysql-test/suite/roles/set_role-simple.result
index 29b176776e7..0eeba8f6c64 100644
--- a/mysql-test/suite/roles/set_role-simple.result
+++ b/mysql-test/suite/roles/set_role-simple.result
@@ -17,8 +17,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -28,9 +28,9 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT SELECT ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
select * from mysql.roles_mapping;
Host User Role Admin_option
localhost root test_role1 Y
diff --git a/mysql-test/suite/roles/set_role-table-column-priv.result b/mysql-test/suite/roles/set_role-table-column-priv.result
index 721bd3039a3..ca1cbd8004f 100644
--- a/mysql-test/suite/roles/set_role-table-column-priv.result
+++ b/mysql-test/suite/roles/set_role-table-column-priv.result
@@ -19,8 +19,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -30,12 +30,12 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for column 'Host' in table 'roles_mapping'
select Role from mysql.roles_mapping;
@@ -46,12 +46,12 @@ test_role2
test_role2
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
use mysql;
set role none;
select current_user(), current_role();
diff --git a/mysql-test/suite/roles/set_role-table-simple.result b/mysql-test/suite/roles/set_role-table-simple.result
index f5688dbe62e..57fcb78ea09 100644
--- a/mysql-test/suite/roles/set_role-table-simple.result
+++ b/mysql-test/suite/roles/set_role-table-simple.result
@@ -19,8 +19,8 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -30,12 +30,12 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
GRANT SELECT ON `mysql`.`roles_mapping` TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
select * from mysql.roles_mapping;
Host User Role Admin_option
test_role1 test_role2 N
@@ -44,12 +44,12 @@ localhost root test_role2 Y
localhost test_user test_role1 N
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
GRANT SELECT ON `mysql`.`roles_mapping` TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
use mysql;
set role none;
select current_user(), current_role();
diff --git a/mysql-test/suite/roles/show_grants.result b/mysql-test/suite/roles/show_grants.result
index b523211420b..7732daa6d93 100644
--- a/mysql-test/suite/roles/show_grants.result
+++ b/mysql-test/suite/roles/show_grants.result
@@ -34,9 +34,9 @@ test_user@localhost test_role1 NO NO
test_user@localhost test_role2 NO NO
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
@@ -50,13 +50,13 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_role1'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT SELECT ON `mysql`.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_role1'
-GRANT test_role2 TO 'test_user'@'localhost'
set role none;
select * from information_schema.enabled_roles;
ROLE_NAME
@@ -66,28 +66,28 @@ current_user() current_role()
test_user@localhost NULL
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
show grants for test_user@localhost;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
show grants for test_role1;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
show grants for test_role2;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
show grants for CURRENT_USER;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
show grants for CURRENT_USER();
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
show grants for CURRENT_ROLE;
ERROR 42000: There is no such grant defined for user 'test_user' on host 'localhost'
show grants for CURRENT_ROLE();
@@ -101,36 +101,36 @@ current_user() current_role()
test_user@localhost test_role2
show grants;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT SELECT ON `mysql`.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
show grants for test_user@localhost;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
show grants for test_role1;
Grants for test_role1
+GRANT 'test_role2' TO 'test_role1'
GRANT SELECT ON `mysql`.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_role2'
-GRANT test_role2 TO 'test_role1'
show grants for test_role2;
Grants for test_role2
GRANT SELECT ON `mysql`.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role2'
show grants for CURRENT_USER;
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
show grants for CURRENT_USER();
Grants for test_user@localhost
+GRANT 'test_role1' TO 'test_user'@'localhost'
+GRANT 'test_role2' TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
-GRANT test_role1 TO 'test_user'@'localhost'
-GRANT test_role2 TO 'test_user'@'localhost'
show grants for CURRENT_ROLE;
Grants for test_role2
GRANT SELECT ON `mysql`.* TO 'test_role2'
diff --git a/mysql-test/suite/roles/show_grants_replicated.result b/mysql-test/suite/roles/show_grants_replicated.result
index cb9df65dbbd..f26a22c8ee6 100644
--- a/mysql-test/suite/roles/show_grants_replicated.result
+++ b/mysql-test/suite/roles/show_grants_replicated.result
@@ -44,7 +44,7 @@ GRANT USAGE ON *.* TO 'r1'
set role r1;
show grants;
Grants for root@localhost
-GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT 'r1' TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'r1'
diff --git a/mysql-test/suite/rpl/include/rpl_reset_slave_all_check.inc b/mysql-test/suite/rpl/include/rpl_reset_slave_all_check.inc
new file mode 100644
index 00000000000..adbaf32ebd7
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_reset_slave_all_check.inc
@@ -0,0 +1,48 @@
+# This file ensures that a slave's id filtering variables (i.e. DO_DOMAIN_IDS,
+# IGNORE_DOMAIN_IDS, and IGNORE_SERVER_IDS) are cleared after issuing
+# `RESET SLAVE ALL`.
+#
+# param $_do_domain_ids Integer list of values to use for DO_DOMAIN_IDS
+# param $_ignore_domain_ids Integer list of values to use for IGNORE_DOMAIN_IDS
+# param $_ignore_server_ids Integer list of values to use for IGNORE_SERVER_IDS
+#
+
+--echo # Id filtering variable values should be empty initially
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+let $ignore_server_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
+
+if (`SELECT "$do_domain_ids_before" != "" OR
+ "$ignore_domain_ids_before" != "" OR
+ "$ignore_server_ids_before" != ""`)
+{
+ die("CHANGE MASTER TO id filter variables are not empty initially");
+}
+
+
+--echo # Set id filtering variables
+eval CHANGE MASTER TO DO_DOMAIN_IDS=$_do_domain_ids, IGNORE_DOMAIN_IDS=$_ignore_domain_ids, IGNORE_SERVER_IDS=$_ignore_server_ids, MASTER_USE_GTID=SLAVE_POS;
+let $do_domain_ids_set= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_set= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+let $ignore_server_ids_set= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
+--echo # do domain id list: $do_domain_ids_set
+--echo # ignore domain id list: $ignore_domain_ids_set
+--echo # ignore server id list: $ignore_server_ids_set
+
+
+--echo # RESET SLAVE ALL should clear values for all id filtering variables
+RESET SLAVE ALL;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval change master to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+--source include/start_slave.inc
+--source include/stop_slave.inc
+
+let $do_domain_ids_cleared= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_cleared= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+let $ignore_server_ids_cleared= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
+if (`SELECT "$do_domain_ids_cleared" != "" OR
+ "$ignore_domain_ids_cleared" != "" OR
+ "$ignore_server_ids_cleared" != ""`)
+{
+ die("RESET SLAVE ALL did not clear id filtering variables");
+}
diff --git a/mysql-test/suite/rpl/r/create_or_replace_mix.result b/mysql-test/suite/rpl/r/create_or_replace_mix.result
index 661278aa7ef..b44b2a5c10f 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_mix.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_mix.result
@@ -100,6 +100,9 @@ include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */
+master-bin.000001 # Query # # ROLLBACK
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'test.t1'
diff --git a/mysql-test/suite/rpl/r/create_or_replace_row.result b/mysql-test/suite/rpl/r/create_or_replace_row.result
index c45daefd671..16f92b5e4b6 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_row.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_row.result
@@ -128,6 +128,9 @@ include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */
+master-bin.000001 # Query # # ROLLBACK
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'test.t1'
diff --git a/mysql-test/suite/rpl/r/create_or_replace_statement.result b/mysql-test/suite/rpl/r/create_or_replace_statement.result
index f95b451e5ec..4d6409b1710 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_statement.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_statement.result
@@ -103,6 +103,8 @@ include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'test.t1'
diff --git a/mysql-test/suite/rpl/r/rpl_change_master_find_log_pos_err.result b/mysql-test/suite/rpl/r/rpl_change_master_find_log_pos_err.result
new file mode 100644
index 00000000000..0ff76b5b60f
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_change_master_find_log_pos_err.result
@@ -0,0 +1,43 @@
+include/master-slave.inc
+[connection master]
+#
+# Failed CHANGE MASTER TO should not change relay log status
+#
+connection slave;
+include/stop_slave.inc
+SET @@debug_dbug="d,simulate_find_log_pos_error";
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+ERROR HY000: Target log not found in binlog index
+SET @@debug_dbug="";
+include/start_slave.inc
+#
+# Ensure relay log can be updated after a failed CHANGE MASTER
+#
+FLUSH RELAY LOGS;
+include/wait_for_slave_param.inc [Relay_Log_File]
+#
+# Slave should continue to receive data from old master after failed
+# CHANGE MASTER TO
+#
+connection master;
+CREATE TABLE t1 (a int);
+insert into t1 values (1);
+connection slave;
+connection slave;
+#
+# Future CHANGE MASTER calls should succeed
+#
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
+include/start_slave.inc
+########################
+# Cleanup
+########################
+connection master;
+DROP TABLE t1;
+connection slave;
+include/stop_slave.inc
+RESET SLAVE ALL;
+change master to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_incompatible_heartbeat.result b/mysql-test/suite/rpl/r/rpl_incompatible_heartbeat.result
new file mode 100644
index 00000000000..51da761c50d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_incompatible_heartbeat.result
@@ -0,0 +1,17 @@
+include/master-slave.inc
+[connection master]
+connection master;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
+SET @@global.debug_dbug= 'd,simulate_pos_4G';
+connection slave;
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.001;
+include/start_slave.inc
+connection master;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
+connection slave;
+connection master;
+CREATE TABLE t (f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+DROP TABLE t;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mark_optimize_tbl_ddl.result b/mysql-test/suite/rpl/r/rpl_mark_optimize_tbl_ddl.result
new file mode 100644
index 00000000000..a39dad85244
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_mark_optimize_tbl_ddl.result
@@ -0,0 +1,77 @@
+include/rpl_init.inc [topology=1->2]
+connection server_1;
+FLUSH TABLES;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+connection server_2;
+SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
+SET @save_slave_parallel_mode= @@GLOBAL.slave_parallel_mode;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=2;
+SET GLOBAL slave_parallel_mode=optimistic;
+include/start_slave.inc
+connection server_1;
+CREATE TABLE t1(a INT) ENGINE=INNODB;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 SELECT 1+a FROM t1;
+INSERT INTO t1 SELECT 2+a FROM t1;
+connection server_2;
+#
+# Verify that following admin commands are marked as ddl
+# 'OPTIMIZE TABLE', 'REPAIR TABLE' and 'ANALYZE TABLE'
+#
+connection server_1;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair note The storage engine for the table doesn't support repair
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+FLUSH LOGS;
+FOUND 1 /GTID 0-1-8 ddl/ in mysqlbinlog.out
+FOUND 1 /GTID 0-1-9 ddl/ in mysqlbinlog.out
+FOUND 1 /GTID 0-1-10 ddl/ in mysqlbinlog.out
+#
+# Clean up
+#
+DROP TABLE t1;
+connection server_2;
+FLUSH LOGS;
+#
+# Check that ALTER TABLE commands with ANALYZE, OPTIMIZE and REPAIR on
+# partitions will be marked as DDL in binary log.
+#
+connection server_1;
+CREATE TABLE t1(id INT) PARTITION BY RANGE (id) (PARTITION p0 VALUES LESS THAN (100),
+PARTITION pmax VALUES LESS THAN (MAXVALUE));
+INSERT INTO t1 VALUES (1), (10), (100), (1000);
+ALTER TABLE t1 ANALYZE PARTITION p0;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+ALTER TABLE t1 OPTIMIZE PARTITION p0;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+ALTER TABLE t1 REPAIR PARTITION p0;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+FLUSH LOGS;
+FOUND 1 /GTID 0-1-14 ddl/ in mysqlbinlog.out
+FOUND 1 /GTID 0-1-15 ddl/ in mysqlbinlog.out
+FOUND 1 /GTID 0-1-16 ddl/ in mysqlbinlog.out
+#
+# Clean up
+#
+DROP TABLE t1;
+connection server_2;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads= @save_slave_parallel_threads;
+SET GLOBAL slave_parallel_mode= @save_slave_parallel_mode;
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_reset_slave_all_clears_filters.result b/mysql-test/suite/rpl/r/rpl_reset_slave_all_clears_filters.result
new file mode 100644
index 00000000000..a273aeaa678
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_reset_slave_all_clears_filters.result
@@ -0,0 +1,54 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+include/stop_slave.inc
+#
+# Category 1) DO_DOMAIN_IDS and IGNORE_SERVER_IDS specified together
+#
+# Id filtering variable values should be empty initially
+# Set id filtering variables
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(), IGNORE_SERVER_IDS=(3), MASTER_USE_GTID=SLAVE_POS;
+# do domain id list: 1
+# ignore domain id list:
+# ignore server id list: 3
+# RESET SLAVE ALL should clear values for all id filtering variables
+RESET SLAVE ALL;
+change master to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+include/start_slave.inc
+include/stop_slave.inc
+#
+# Category 2) IGNORE_DOMAIN_IDS and IGNORE_SERVER_IDS specified together
+#
+# Id filtering variable values should be empty initially
+# Set id filtering variables
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(2), IGNORE_SERVER_IDS=(3), MASTER_USE_GTID=SLAVE_POS;
+# do domain id list:
+# ignore domain id list: 2
+# ignore server id list: 3
+# RESET SLAVE ALL should clear values for all id filtering variables
+RESET SLAVE ALL;
+change master to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+include/start_slave.inc
+include/stop_slave.inc
+#
+# Category 3) Null check - edge case with all empty lists to ensure a
+# lack of specification doesn't break anything
+#
+# Id filtering variable values should be empty initially
+# Set id filtering variables
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), IGNORE_SERVER_IDS=(), MASTER_USE_GTID=SLAVE_POS;
+# do domain id list:
+# ignore domain id list:
+# ignore server id list:
+# RESET SLAVE ALL should clear values for all id filtering variables
+RESET SLAVE ALL;
+change master to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+include/start_slave.inc
+include/stop_slave.inc
+############################
+# Cleanup
+############################
+connection slave;
+change master to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result b/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result
new file mode 100644
index 00000000000..f90d2126103
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result
@@ -0,0 +1,79 @@
+include/rpl_init.inc [topology=1->3]
+connection server_3;
+set default_master_connection = '';
+include/start_slave.inc
+Warnings:
+Note 1254 Slave is already running
+set default_master_connection = 'm2';
+change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos;
+include/start_slave.inc
+select @@global.slave_parallel_workers as two;
+two
+2
+connection server_3;
+SHUTDOWN;
+connection server_3;
+connection server_3;
+connection server_1;
+create table t1 (i int primary key) engine=Innodb;
+connection server_2;
+create table t2 (i int primary key) engine=Innodb;
+connection server_3;
+set default_master_connection = '';
+include/start_slave.inc
+Warnings:
+Note 1254 Slave is already running
+set default_master_connection = 'm2';
+include/start_slave.inc
+Warnings:
+Note 1254 Slave is already running
+connection server_2;
+insert into t2 values (1);
+connection server_3;
+connection server_1;
+insert into t1 values (1);
+connection server_3;
+connection server_3;
+SHUTDOWN;
+connection server_3;
+connection server_3;
+connection server_3;
+set default_master_connection = '';
+include/start_slave.inc
+Warnings:
+Note 1254 Slave is already running
+set default_master_connection = 'm2';
+include/start_slave.inc
+Warnings:
+Note 1254 Slave is already running
+connect conn_block_server3, 127.0.0.1, root,, test, $SERVER_MYPORT_3,;
+begin;
+insert into t1 values (2);
+insert into t2 values (2);
+connection server_1;
+insert into t1 values (2);
+connection server_2;
+insert into t2 values (2);
+connection server_3;
+SHUTDOWN;
+connection server_3;
+connection server_3;
+connection server_3;
+set default_master_connection = '';
+include/start_slave.inc
+Warnings:
+Note 1254 Slave is already running
+set default_master_connection = 'm2';
+include/start_slave.inc
+Warnings:
+Note 1254 Slave is already running
+connection server_1;
+drop table t1;
+connection server_2;
+drop table t2;
+connection server_3;
+set default_master_connection = 'm2';
+include/stop_slave.inc
+RESET SLAVE ALL;
+set default_master_connection = '';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_change_master_find_log_pos_err.test b/mysql-test/suite/rpl/t/rpl_change_master_find_log_pos_err.test
new file mode 100644
index 00000000000..d1c2c03f010
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_change_master_find_log_pos_err.test
@@ -0,0 +1,93 @@
+#
+# Purpose:
+# This test ensures that issuing a CHANGE MASTER will not put a replica into
+# an inconsistent state if the slave cannot find the log files (i.e. the call to
+# find_log_pos in reset_logs fails). More specifically, right before a replica
+# purges the relay logs (part of the `CHANGE MASTER TO` logic), the relay log is
+# temporarily closed with state LOG_TO_BE_OPENED. If the server is issued a
+# CHANGE MASTER and it errors in-between the temporary log closure and purge,
+# i.e. during the function find_log_pos, the log should be closed. The bug
+# reported by MDEV-25284 revealed the log is not properly closed, such that
+# future relay log updates fail, and future CHANGE MASTER calls crash the
+# server.
+#
+# Methodology:
+# This test ensures that the relay log is properly closed by ensuring future
+# updates and CHANGE MASTER calls succeed.
+#
+# References:
+# MDEV-25284: Assertion `info->type == READ_CACHE ||
+# info->type == WRITE_CACHE' failed
+#
+--source include/master-slave.inc
+--source include/have_debug.inc
+
+--echo #
+--echo # Failed CHANGE MASTER TO should not change relay log status
+--echo #
+
+--connection slave
+--source include/stop_slave.inc
+SET @@debug_dbug="d,simulate_find_log_pos_error";
+error 1373;
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+SET @@debug_dbug="";
+--source include/start_slave.inc
+
+
+--echo #
+--echo # Ensure relay log can be updated after a failed CHANGE MASTER
+--echo #
+
+FLUSH RELAY LOGS;
+--let $slave_param= Relay_Log_File
+--let $slave_param_value= slave-relay-bin.000003
+--source include/wait_for_slave_param.inc
+
+
+--echo #
+--echo # Slave should continue to receive data from old master after failed
+--echo # CHANGE MASTER TO
+--echo #
+
+--connection master
+CREATE TABLE t1 (a int);
+insert into t1 values (1);
+--let $master_checksum= `CHECKSUM TABLE t1`
+--sync_slave_with_master
+
+--connection slave
+if ($master_checksum != `CHECKSUM TABLE t1`)
+{
+ die("Replica failed to pull data from primary after failed CHANGE MASTER TO");
+}
+
+
+--echo #
+--echo # Future CHANGE MASTER calls should succeed
+--echo #
+
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
+--source include/start_slave.inc
+
+
+--echo ########################
+--echo # Cleanup
+--echo ########################
+
+--connection master
+DROP TABLE t1;
+
+--connection slave
+--source include/stop_slave.inc
+RESET SLAVE ALL;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval change master to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+--source include/start_slave.inc
+
+--disable_query_log
+call mtr.add_suppression("Failed to locate old binlog or relay log files");
+--enable_query_log
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_incompatible_heartbeat.test b/mysql-test/suite/rpl/t/rpl_incompatible_heartbeat.test
new file mode 100644
index 00000000000..104debe707f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_incompatible_heartbeat.test
@@ -0,0 +1,44 @@
+# ==== Purpose ====
+#
+# Test verifies that slave IO thread can process heartbeat events with log_pos
+# values higher than UINT32_MAX.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - Stop slave threads. Configure a small master_heartbeat_period.
+# 1 - Using debug points, simulate a huge binlog offset higher than
+# UINT32_MAX on master.
+# 2 - Start the slave and observe that slave IO thread is able to process
+# the offset received through heartbeat event.
+#
+# ==== References ====
+#
+# MDEV-16146: MariaDB slave stops with incompatible heartbeat
+#
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed.inc
+# Test simulates binarylog offsets higher than UINT32_MAX
+--source include/have_64bit.inc
+--source include/master-slave.inc
+
+--connection master
+SET @saved_dbug = @@GLOBAL.debug_dbug;
+SET @@global.debug_dbug= 'd,simulate_pos_4G';
+
+--connection slave
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.001;
+--source include/start_slave.inc
+
+--connection master
+sleep 1;
+SET @@GLOBAL.debug_dbug = @saved_dbug;
+--sync_slave_with_master
+
+--connection master
+CREATE TABLE t (f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+DROP TABLE t;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mark_optimize_tbl_ddl.test b/mysql-test/suite/rpl/t/rpl_mark_optimize_tbl_ddl.test
new file mode 100644
index 00000000000..6d66e3fd088
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_mark_optimize_tbl_ddl.test
@@ -0,0 +1,142 @@
+# ==== Purpose ====
+#
+# Test verifies that there is no deadlock or assertion in
+# slave_parallel_mode=optimistic configuration while applying admin command
+# like 'OPTIMIZE TABLE', 'REPAIR TABLE' and 'ANALYZE TABLE'.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - Create a table, execute OPTIMIZE TABLE command on the table followed
+# by some DMLS.
+# 1 - No assert should happen on slave server.
+# 2 - Assert that 'OPTIMIZE TABLE', 'REPAIR TABLE' and 'ANALYZE TABLE' are
+# marked as 'DDL' in the binary log.
+#
+# ==== References ====
+#
+# MDEV-17515: GTID Replication in optimistic mode deadlock
+#
+--source include/have_partition.inc
+--source include/have_innodb.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+--connection server_1
+FLUSH TABLES;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+
+--connection server_2
+SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
+SET @save_slave_parallel_mode= @@GLOBAL.slave_parallel_mode;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=2;
+SET GLOBAL slave_parallel_mode=optimistic;
+--source include/start_slave.inc
+
+--connection server_1
+CREATE TABLE t1(a INT) ENGINE=INNODB;
+OPTIMIZE TABLE t1;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 SELECT 1+a FROM t1;
+INSERT INTO t1 SELECT 2+a FROM t1;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+--echo #
+--echo # Verify that following admin commands are marked as ddl
+--echo # 'OPTIMIZE TABLE', 'REPAIR TABLE' and 'ANALYZE TABLE'
+--echo #
+--connection server_1
+
+OPTIMIZE TABLE t1;
+--let optimize_gtid= `SELECT @@GLOBAL.gtid_binlog_pos`
+
+REPAIR TABLE t1;
+--let repair_gtid= `SELECT @@GLOBAL.gtid_binlog_pos`
+
+ANALYZE TABLE t1;
+--let analyze_gtid= `SELECT @@GLOBAL.gtid_binlog_pos`
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+FLUSH LOGS;
+
+--let $MYSQLD_DATADIR= `select @@datadir`
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+
+--let SEARCH_PATTERN= GTID $optimize_gtid ddl
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_PATTERN= GTID $repair_gtid ddl
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_PATTERN= GTID $analyze_gtid ddl
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+--source include/search_pattern_in_file.inc
+
+--echo #
+--echo # Clean up
+--echo #
+DROP TABLE t1;
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+FLUSH LOGS;
+
+--echo #
+--echo # Check that ALTER TABLE commands with ANALYZE, OPTIMIZE and REPAIR on
+--echo # partitions will be marked as DDL in binary log.
+--echo #
+--connection server_1
+CREATE TABLE t1(id INT) PARTITION BY RANGE (id) (PARTITION p0 VALUES LESS THAN (100),
+ PARTITION pmax VALUES LESS THAN (MAXVALUE));
+INSERT INTO t1 VALUES (1), (10), (100), (1000);
+
+ALTER TABLE t1 ANALYZE PARTITION p0;
+--let analyze_gtid= `SELECT @@GLOBAL.gtid_binlog_pos`
+
+ALTER TABLE t1 OPTIMIZE PARTITION p0;
+--let optimize_gtid= `SELECT @@GLOBAL.gtid_binlog_pos`
+
+ALTER TABLE t1 REPAIR PARTITION p0;
+--let repair_gtid= `SELECT @@GLOBAL.gtid_binlog_pos`
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+FLUSH LOGS;
+
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+
+--let SEARCH_PATTERN= GTID $analyze_gtid ddl
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_PATTERN= GTID $optimize_gtid ddl
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+--source include/search_pattern_in_file.inc
+
+--let SEARCH_PATTERN= GTID $repair_gtid ddl
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+--source include/search_pattern_in_file.inc
+
+--echo #
+--echo # Clean up
+--echo #
+DROP TABLE t1;
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads= @save_slave_parallel_threads;
+SET GLOBAL slave_parallel_mode= @save_slave_parallel_mode;
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_reset_slave_all_clears_filters.test b/mysql-test/suite/rpl/t/rpl_reset_slave_all_clears_filters.test
new file mode 100644
index 00000000000..7c01ce16586
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_reset_slave_all_clears_filters.test
@@ -0,0 +1,72 @@
+#
+# Purpose:
+# This test validates that after issuing the `SLAVE RESET ALL` command,
+# any corresponding IGNORE_DOMAIN_IDS/DO_DOMAIN_IDS and IGNORE_SERVER_IDS
+# values are cleared.
+#
+#
+# Methodology:
+# To ensure the filtering variables are properly cleared after issuing
+# SLAVE RESET ALL, we categorize different combinations of allowable input
+# into three different options, and ensure that the variables are cleared for
+# each category. The categories are as follows:
+# Category 1) DO_DOMAIN_IDS and IGNORE_SERVER_IDS specified together
+# Category 2) IGNORE_DOMAIN_IDS and IGNORE_SERVER_IDS specified together
+# Category 3) Null check - edge case with all empty lists to ensure a lack
+# of specification doesn't break anything
+#
+# To specify the values, the variables are set in `CHANGE MASTER TO`. To
+# ensure the slave state is correct, we test the domain/server id filtering
+# variable values at the following times while testing each category.
+#
+# Before CHANGE MASTER TO the filtering variables are tested to all be
+# empty.
+#
+# After CHANGE MASTER TO the variables are tested to ensure they reflect
+# those set in the CHANGE MASTER command.
+#
+# After RESET SLAVE ALL the filtering variables are tested to all be
+# empty.
+#
+
+--source include/master-slave.inc
+--source include/have_debug.inc
+
+--connection slave
+--source include/stop_slave.inc
+
+--echo #
+--echo # Category 1) DO_DOMAIN_IDS and IGNORE_SERVER_IDS specified together
+--echo #
+--let $_do_domain_ids= (1)
+--let $_ignore_domain_ids= ()
+--let $_ignore_server_ids= (3)
+--source include/rpl_reset_slave_all_check.inc
+
+--echo #
+--echo # Category 2) IGNORE_DOMAIN_IDS and IGNORE_SERVER_IDS specified together
+--echo #
+--let $_do_domain_ids= ()
+--let $_ignore_domain_ids= (2)
+--let $_ignore_server_ids= (3)
+--source include/rpl_reset_slave_all_check.inc
+
+--echo #
+--echo # Category 3) Null check - edge case with all empty lists to ensure a
+--echo # lack of specification doesn't break anything
+--echo #
+--let $_do_domain_ids= ()
+--let $_ignore_domain_ids= ()
+--let $_ignore_server_ids= ()
+--source include/rpl_reset_slave_all_check.inc
+
+
+--echo ############################
+--echo # Cleanup
+--echo ############################
+--connection slave
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval change master to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
index 5bdd1ff8b6b..a594b7c2a61 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
@@ -329,7 +329,7 @@ while($ntables)
-- echo ### detect failure. Before the patch mysqlbinlog would find
-- echo ### a corrupted event, thence would fail.
-- let $MYSQLD_DATADIR= `SELECT @@datadir`
--- exec $MYSQL_BINLOG -v --hex $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog
+-- exec $MYSQL_BINLOG -v --hexdump $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog
## clean up
## For debugging purposes you might want not to remove these
diff --git a/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.cnf b/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.cnf
new file mode 100644
index 00000000000..1e7cdee510b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.cnf
@@ -0,0 +1,19 @@
+!include suite/rpl/rpl_1slave_base.cnf
+!include include/default_client.cnf
+
+[mysqld.1]
+log-slave-updates
+gtid-domain-id=1
+
+[mysqld.2]
+log-slave-updates
+gtid-domain-id=2
+
+[mysqld.3]
+log-slave-updates
+gtid-domain-id=3
+slave_parallel_threads=2
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
diff --git a/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test b/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test
new file mode 100644
index 00000000000..6f73de984d3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test
@@ -0,0 +1,171 @@
+# MDEV-20821 parallel slave server shutdown hang
+#
+# Test the bug condition of a parallel slave server shutdown
+# hang when the parallel workers were idle.
+# The bug reported scenario is extented to cover the multi-sources case as well as
+# checking is done for both the idle and busy workers cases.
+#
+# MDEV-25336 Parallel replication causes failed assert while restarting
+# Since this test case involves slave restart this will help in testing
+# Mdev-25336 too.
+
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed.inc
+--let $rpl_topology= 1->3
+--source include/rpl_init.inc
+
+#
+# A. idle workers.
+#
+--connection server_3
+set default_master_connection = '';
+--source include/start_slave.inc
+
+set default_master_connection = 'm2';
+--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
+eval change master to master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+select @@global.slave_parallel_workers as two;
+
+# At this point worker threads have no assignement.
+# Shutdown must not hang.
+# In 10.2/10.3 there should not be any assert failure `prev != 0 && next != 0'
+--connection server_3
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+wait
+EOF
+--send SHUTDOWN
+--reap
+--source include/wait_until_disconnected.inc
+
+--connection server_3
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+restart
+EOF
+
+# No hang is *proved* to occur when this point is reached.
+--connection server_3
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+#
+# B. resting workers after some busy time
+#
+--connection server_1
+create table t1 (i int primary key) engine=Innodb;
+
+--connection server_2
+create table t2 (i int primary key) engine=Innodb;
+
+--connection server_3
+set default_master_connection = '';
+--source include/start_slave.inc
+
+set default_master_connection = 'm2';
+--source include/start_slave.inc
+
+--connection server_2
+insert into t2 values (1);
+--save_master_pos
+
+--connection server_3
+--sync_with_master 0,'m2'
+
+--connection server_1
+insert into t1 values (1);
+--save_master_pos
+
+--connection server_3
+--sync_with_master 0,''
+
+# In 10.2/10.3 there should not be any assert failure `prev != 0 && next != 0'
+# At this point worker threads have no assignement.
+# Shutdown must not hang.
+
+--connection server_3
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+wait
+EOF
+--send SHUTDOWN
+--reap
+--source include/wait_until_disconnected.inc
+
+--connection server_3
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+restart
+EOF
+
+# No hang is *proved* to occur when this point is reached.
+--connection server_3
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+#
+# C. busy workers
+#
+--connection server_3
+set default_master_connection = '';
+--source include/start_slave.inc
+
+set default_master_connection = 'm2';
+--source include/start_slave.inc
+
+--connect (conn_block_server3, 127.0.0.1, root,, test, $SERVER_MYPORT_3,)
+begin;
+ insert into t1 values (2);
+ insert into t2 values (2);
+
+--connection server_1
+insert into t1 values (2);
+--connection server_2
+insert into t2 values (2);
+
+
+# In 10.2/10.3 there should not be any assert failure `prev != 0 && next != 0'
+# At this point there's a good chance the worker threads are busy.
+# SHUTDOWN must proceed without any delay as above.
+--connection server_3
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+wait
+EOF
+--send SHUTDOWN
+--reap
+--source include/wait_until_disconnected.inc
+
+--connection server_3
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+restart
+EOF
+
+# No hang is *proved* to occur when this point is reached.
+--connection server_3
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+
+# Cleanup
+
+--connection server_3
+set default_master_connection = '';
+--source include/start_slave.inc
+
+set default_master_connection = 'm2';
+--source include/start_slave.inc
+
+--connection server_1
+drop table t1;
+
+--connection server_2
+drop table t2;
+--save_master_pos
+
+# (!) The following block is critical to avoid check-mysqld_3.reject by mtr:
+--connection server_3
+--sync_with_master 0,'m2'
+set default_master_connection = 'm2';
+--source include/stop_slave.inc
+RESET SLAVE ALL;
+set default_master_connection = '';
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/insert_id_func.result b/mysql-test/suite/sys_vars/r/insert_id_func.result
index 6a5746e130d..e4486cd5acf 100644
--- a/mysql-test/suite/sys_vars/r/insert_id_func.result
+++ b/mysql-test/suite/sys_vars/r/insert_id_func.result
@@ -69,3 +69,28 @@ id name
drop table t1;
disconnect test_con1;
disconnect test_con2;
+connection default;
+CREATE TABLE t1(id int primary key auto_increment);
+SET SESSION insert_id=123;
+SET SESSION insert_id=0;
+INSERT INTO t1 VALUES ();
+SET SESSION insert_id=123;
+SET SESSION insert_id=default;
+INSERT INTO t1 VALUES ();
+SET SESSION insert_id=123;
+SET SESSION insert_id=-1;
+Warnings:
+Warning 1292 Truncated incorrect insert_id value: '-1'
+INSERT INTO t1 VALUES ();
+SET SESSION insert_id=123;
+SET SESSION insert_id=-10;
+Warnings:
+Warning 1292 Truncated incorrect insert_id value: '-10'
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1;
+id
+1
+2
+3
+4
+DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 440efc6a9cd..ecc5e9b50bb 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -654,6 +654,18 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DEBUG_SYNC
+SESSION_VALUE NULL
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT debug_sync for innodb purge threads. Use it to set up sync points for all purge threads at once. The commands will be applied sequentially at the beginning of purging the next undo record.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_DEFAULT_ENCRYPTION_KEY_ID
SESSION_VALUE 1
DEFAULT_VALUE 1
diff --git a/mysql-test/suite/sys_vars/t/insert_id_func.test b/mysql-test/suite/sys_vars/t/insert_id_func.test
index a710afbb0cc..feb510c091b 100644
--- a/mysql-test/suite/sys_vars/t/insert_id_func.test
+++ b/mysql-test/suite/sys_vars/t/insert_id_func.test
@@ -103,3 +103,23 @@ drop table t1;
disconnect test_con1;
disconnect test_con2;
+
+# MDEV-22711 Assertion `nr != 0' failed in handler::update_auto_increment.
+#
+connection default;
+CREATE TABLE t1(id int primary key auto_increment);
+SET SESSION insert_id=123;
+SET SESSION insert_id=0;
+INSERT INTO t1 VALUES ();
+SET SESSION insert_id=123;
+SET SESSION insert_id=default;
+INSERT INTO t1 VALUES ();
+SET SESSION insert_id=123;
+SET SESSION insert_id=-1;
+INSERT INTO t1 VALUES ();
+SET SESSION insert_id=123;
+SET SESSION insert_id=-10;
+INSERT INTO t1 VALUES ();
+SELECT * FROM t1;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/unit/suite.pm b/mysql-test/suite/unit/suite.pm
index c8180c59240..6cd0dfd4bfd 100644
--- a/mysql-test/suite/unit/suite.pm
+++ b/mysql-test/suite/unit/suite.pm
@@ -40,7 +40,7 @@ sub start_test {
my $bin=$ENV{MTR_BINDIR} || '..';
return "Not run for embedded server" if $::opt_embedded_server;
return "Not configured to run ctest" unless -f "$bin/CTestTestfile.cmake";
- my ($ctest_vs)= $::opt_vs_config ? "-C ".substr($::opt_vs_config,1) : "";
+ my ($ctest_vs)= $::multiconfig ? "-C ".substr($::multiconfig,1) : "";
my (@ctest_list)= `cd "$bin" && ctest $ctest_vs --show-only --verbose`;
return "No ctest" if $?;
diff --git a/mysql-test/suite/vcol/r/binlog.result b/mysql-test/suite/vcol/r/binlog.result
index 83382d47511..463928b97b8 100644
--- a/mysql-test/suite/vcol/r/binlog.result
+++ b/mysql-test/suite/vcol/r/binlog.result
@@ -67,4 +67,31 @@ connection master;
DROP VIEW v1;
set @@binlog_row_image=default;
DROP TABLE t1;
+SET SQL_MODE=default;
+CREATE TABLE t1 (pk INT, a VARCHAR(3), b VARCHAR(1) AS (a) VIRTUAL, PRIMARY KEY (pk));
+INSERT IGNORE INTO t1 (pk, a) VALUES (1,'foo'),(2,'bar');
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 2
+REPLACE INTO t1 (pk) VALUES (2);
+ERROR 22001: Data too long for column 'b' at row 1
+UPDATE IGNORE t1 SET a = NULL;
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 2
+DROP TABLE t1;
+#
+# MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+#
+SET SESSION binlog_row_image= noblob;
+CREATE TEMPORARY TABLE t1 SELECT UUID();
+show create table t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `UUID()` varchar(36) CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 (a INT PRIMARY KEY, b TEXT, c INT GENERATED ALWAYS AS(b));
+INSERT INTO t2 (a,b) VALUES (1,1);
+SET SESSION binlog_row_image= default;
+DROP TABLE t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/vcol/r/partition.result b/mysql-test/suite/vcol/r/partition.result
index bd1353fa145..d7c5052b72a 100644
--- a/mysql-test/suite/vcol/r/partition.result
+++ b/mysql-test/suite/vcol/r/partition.result
@@ -28,3 +28,76 @@ set statement sql_mode= '' for update t1 set i= 1, v= 2;
Warnings:
Warning 1906 The value specified for generated column 'v' in table 't1' has been ignored
drop table t1;
+#
+# MDEV-18734 ASAN heap-use-after-free in my_strnxfrm_simple_internal upon update on versioned partitioned table
+#
+# Cover queue_fix() in ha_partition::handle_ordered_index_scan()
+create or replace table t1 (
+x int auto_increment primary key,
+b text, v mediumtext as (b) virtual,
+index (v(10))
+) partition by range columns (x) (
+partition p1 values less than (3),
+partition p2 values less than (6),
+partition p3 values less than (9),
+partition p4 values less than (12),
+partition p5 values less than (15),
+partition p6 values less than (17),
+partition p7 values less than (19),
+partition p8 values less than (21),
+partition p9 values less than (23),
+partition p10 values less than (25),
+partition p11 values less than (27),
+partition p12 values less than (29),
+partition p13 values less than (31),
+partition p14 values less than (33),
+partition p15 values less than (35),
+partition pn values less than (maxvalue));
+insert into t1 (b) values
+(repeat('q', 8192)), (repeat('z', 8192)), (repeat('a', 8192)), (repeat('b', 8192)),
+(repeat('x', 8192)), (repeat('y', 8192));
+insert t1 (b) select b from t1;
+insert t1 (b) select b from t1;
+insert t1 (b) select b from t1;
+insert t1 (b) select b from t1;
+select x, left(b, 10), left(v, 10) from t1 where x > 30 and x < 60 order by v;
+x left(b, 10) left(v, 10)
+33 aaaaaaaaaa aaaaaaaaaa
+39 aaaaaaaaaa aaaaaaaaaa
+45 aaaaaaaaaa aaaaaaaaaa
+51 aaaaaaaaaa aaaaaaaaaa
+57 aaaaaaaaaa aaaaaaaaaa
+34 bbbbbbbbbb bbbbbbbbbb
+40 bbbbbbbbbb bbbbbbbbbb
+46 bbbbbbbbbb bbbbbbbbbb
+52 bbbbbbbbbb bbbbbbbbbb
+58 bbbbbbbbbb bbbbbbbbbb
+31 qqqqqqqqqq qqqqqqqqqq
+37 qqqqqqqqqq qqqqqqqqqq
+43 qqqqqqqqqq qqqqqqqqqq
+49 qqqqqqqqqq qqqqqqqqqq
+55 qqqqqqqqqq qqqqqqqqqq
+35 xxxxxxxxxx xxxxxxxxxx
+41 xxxxxxxxxx xxxxxxxxxx
+47 xxxxxxxxxx xxxxxxxxxx
+53 xxxxxxxxxx xxxxxxxxxx
+59 xxxxxxxxxx xxxxxxxxxx
+36 yyyyyyyyyy yyyyyyyyyy
+42 yyyyyyyyyy yyyyyyyyyy
+48 yyyyyyyyyy yyyyyyyyyy
+54 yyyyyyyyyy yyyyyyyyyy
+32 zzzzzzzzzz zzzzzzzzzz
+38 zzzzzzzzzz zzzzzzzzzz
+44 zzzzzzzzzz zzzzzzzzzz
+50 zzzzzzzzzz zzzzzzzzzz
+56 zzzzzzzzzz zzzzzzzzzz
+update t1 set b= 'bar' where v > 'a' limit 20;
+drop table t1;
+# Cover return_top_record() in ha_partition::handle_ordered_index_scan()
+create table t1 (x int primary key, b tinytext, v text as (b) virtual)
+partition by range columns (x) (
+partition p1 values less than (4),
+partition pn values less than (maxvalue));
+insert into t1 (x, b) values (1, ''), (2, ''), (3, 'a'), (4, 'b');
+update t1 set b= 'bar' where x > 0 order by v limit 2;
+drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_syntax.result b/mysql-test/suite/vcol/r/vcol_syntax.result
index 16e30e57230..0063f38ea36 100644
--- a/mysql-test/suite/vcol/r/vcol_syntax.result
+++ b/mysql-test/suite/vcol/r/vcol_syntax.result
@@ -1,4 +1,3 @@
-drop table if exists t1;
set @OLD_SQL_MODE=@@SESSION.SQL_MODE;
create table t1 (a int, b int generated always as (a+1));
show create table t1;
@@ -50,3 +49,51 @@ t1 CREATE TABLE "t1" (
)
drop table t1;
set session sql_mode=@OLD_SQL_MODE;
+#
+# MDEV-25091 CREATE TABLE: field references qualified by a wrong table name succeed
+#
+create table t2 (x int);
+create table t1 (x int, y int generated always as (t2.x));
+ERROR 42S22: Unknown column '`t2`.`x`' in 'GENERATED ALWAYS'
+create table t1 (x int, y int check (y > t2.x));
+ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK'
+create table t1 (x int, y int default t2.x);
+ERROR 42S22: Unknown column '`t2`.`x`' in 'DEFAULT'
+create table t1 (x int, check (t2.x > 0));
+ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK'
+create table t1 (x int);
+alter table t1 add column y int generated always as (t2.x);
+ERROR 42S22: Unknown column '`t2`.`x`' in 'GENERATED ALWAYS'
+alter table t1 add column y int check (z > t2.x);
+ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK'
+alter table t1 add column y int default t2.x;
+ERROR 42S22: Unknown column '`t2`.`x`' in 'DEFAULT'
+alter table t1 add constraint check (t2.x > 0);
+ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK'
+create or replace table t1 (x int, y int generated always as (t1.x));
+create or replace table t1 (x int, y int check (y > t1.x));
+create or replace table t1 (x int, y int default t1.x);
+create or replace table t1 (x int, check (t1.x > 0));
+create or replace table t1 (x int, y int generated always as (test.t1.x));
+create or replace table t1 (x int, y int check (y > test.t1.x));
+create or replace table t1 (x int, y int default test.t1.x);
+create or replace table t1 (x int, check (test.t1.x > 0));
+drop tables t1, t2;
+create table t1 (x int, y int generated always as (test2.t1.x));
+ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'GENERATED ALWAYS'
+create table t1 (x int, y int check (y > test2.t1.x));
+ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'CHECK'
+create table t1 (x int, y int default test2.t1.x);
+ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'DEFAULT'
+create table t1 (x int, check (test2.t1.x > 0));
+ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'CHECK'
+#
+# MDEV-25672 table alias from previous statement interferes later commands
+#
+create table t1 (a int, v_a int generated always as (a));
+update t1 as x set a = 1;
+alter table t1 force;
+drop table t1;
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/suite/vcol/t/binlog.test b/mysql-test/suite/vcol/t/binlog.test
index 95bb4df4cc5..edf0a8957b9 100644
--- a/mysql-test/suite/vcol/t/binlog.test
+++ b/mysql-test/suite/vcol/t/binlog.test
@@ -51,5 +51,33 @@ DROP VIEW v1;
set @@binlog_row_image=default;
DROP TABLE t1;
+SET SQL_MODE=default;
+
+# MDEV-24782
+# ASAN use-after-poison in Field::pack_int / THD::binlog_update_row
+
+CREATE TABLE t1 (pk INT, a VARCHAR(3), b VARCHAR(1) AS (a) VIRTUAL, PRIMARY KEY (pk));
+INSERT IGNORE INTO t1 (pk, a) VALUES (1,'foo'),(2,'bar');
+--error ER_DATA_TOO_LONG
+REPLACE INTO t1 (pk) VALUES (2);
+UPDATE IGNORE t1 SET a = NULL;
+
+# Cleanup
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
+--echo #
+
+SET SESSION binlog_row_image= noblob;
+CREATE TEMPORARY TABLE t1 SELECT UUID();
+show create table t1;
+CREATE TABLE t2 (a INT PRIMARY KEY, b TEXT, c INT GENERATED ALWAYS AS(b));
+INSERT INTO t2 (a,b) VALUES (1,1);
+
+SET SESSION binlog_row_image= default;
+DROP TABLE t2;
+
--source include/rpl_end.inc
diff --git a/mysql-test/suite/vcol/t/partition.test b/mysql-test/suite/vcol/t/partition.test
index 889724fb1c5..408990b20a6 100644
--- a/mysql-test/suite/vcol/t/partition.test
+++ b/mysql-test/suite/vcol/t/partition.test
@@ -30,3 +30,51 @@ subpartition by hash(v) subpartitions 3 (
insert t1 set i= 0;
set statement sql_mode= '' for update t1 set i= 1, v= 2;
drop table t1;
+
+--echo #
+--echo # MDEV-18734 ASAN heap-use-after-free in my_strnxfrm_simple_internal upon update on versioned partitioned table
+--echo #
+--echo # Cover queue_fix() in ha_partition::handle_ordered_index_scan()
+create or replace table t1 (
+ x int auto_increment primary key,
+ b text, v mediumtext as (b) virtual,
+ index (v(10))
+) partition by range columns (x) (
+ partition p1 values less than (3),
+ partition p2 values less than (6),
+ partition p3 values less than (9),
+ partition p4 values less than (12),
+ partition p5 values less than (15),
+ partition p6 values less than (17),
+ partition p7 values less than (19),
+ partition p8 values less than (21),
+ partition p9 values less than (23),
+ partition p10 values less than (25),
+ partition p11 values less than (27),
+ partition p12 values less than (29),
+ partition p13 values less than (31),
+ partition p14 values less than (33),
+ partition p15 values less than (35),
+ partition pn values less than (maxvalue));
+insert into t1 (b) values
+(repeat('q', 8192)), (repeat('z', 8192)), (repeat('a', 8192)), (repeat('b', 8192)),
+(repeat('x', 8192)), (repeat('y', 8192));
+
+insert t1 (b) select b from t1;
+insert t1 (b) select b from t1;
+insert t1 (b) select b from t1;
+insert t1 (b) select b from t1;
+
+select x, left(b, 10), left(v, 10) from t1 where x > 30 and x < 60 order by v;
+update t1 set b= 'bar' where v > 'a' limit 20;
+
+drop table t1;
+
+--echo # Cover return_top_record() in ha_partition::handle_ordered_index_scan()
+create table t1 (x int primary key, b tinytext, v text as (b) virtual)
+partition by range columns (x) (
+ partition p1 values less than (4),
+ partition pn values less than (maxvalue));
+insert into t1 (x, b) values (1, ''), (2, ''), (3, 'a'), (4, 'b');
+update t1 set b= 'bar' where x > 0 order by v limit 2;
+drop table t1;
diff --git a/mysql-test/suite/vcol/t/vcol_syntax.test b/mysql-test/suite/vcol/t/vcol_syntax.test
index 6dc3cf43317..3c8a50a7f36 100644
--- a/mysql-test/suite/vcol/t/vcol_syntax.test
+++ b/mysql-test/suite/vcol/t/vcol_syntax.test
@@ -1,10 +1,6 @@
#
# test syntax
#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
set @OLD_SQL_MODE=@@SESSION.SQL_MODE;
create table t1 (a int, b int generated always as (a+1));
show create table t1;
@@ -28,3 +24,60 @@ show create table t1;
drop table t1;
set session sql_mode=@OLD_SQL_MODE;
+--echo #
+--echo # MDEV-25091 CREATE TABLE: field references qualified by a wrong table name succeed
+--echo #
+create table t2 (x int);
+
+--error ER_BAD_FIELD_ERROR
+create table t1 (x int, y int generated always as (t2.x));
+--error ER_BAD_FIELD_ERROR
+create table t1 (x int, y int check (y > t2.x));
+--error ER_BAD_FIELD_ERROR
+create table t1 (x int, y int default t2.x);
+--error ER_BAD_FIELD_ERROR
+create table t1 (x int, check (t2.x > 0));
+
+create table t1 (x int);
+--error ER_BAD_FIELD_ERROR
+alter table t1 add column y int generated always as (t2.x);
+--error ER_BAD_FIELD_ERROR
+alter table t1 add column y int check (z > t2.x);
+--error ER_BAD_FIELD_ERROR
+alter table t1 add column y int default t2.x;
+--error ER_BAD_FIELD_ERROR
+alter table t1 add constraint check (t2.x > 0);
+
+create or replace table t1 (x int, y int generated always as (t1.x));
+create or replace table t1 (x int, y int check (y > t1.x));
+create or replace table t1 (x int, y int default t1.x);
+create or replace table t1 (x int, check (t1.x > 0));
+
+create or replace table t1 (x int, y int generated always as (test.t1.x));
+create or replace table t1 (x int, y int check (y > test.t1.x));
+create or replace table t1 (x int, y int default test.t1.x);
+create or replace table t1 (x int, check (test.t1.x > 0));
+
+drop tables t1, t2;
+
+--error ER_BAD_FIELD_ERROR
+create table t1 (x int, y int generated always as (test2.t1.x));
+--error ER_BAD_FIELD_ERROR
+create table t1 (x int, y int check (y > test2.t1.x));
+--error ER_BAD_FIELD_ERROR
+create table t1 (x int, y int default test2.t1.x);
+--error ER_BAD_FIELD_ERROR
+create table t1 (x int, check (test2.t1.x > 0));
+
+--echo #
+--echo # MDEV-25672 table alias from previous statement interferes later commands
+--echo #
+create table t1 (a int, v_a int generated always as (a));
+update t1 as x set a = 1;
+alter table t1 force;
+drop table t1;
+
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 2f1a40cbacd..7b03ead3739 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -2045,5 +2045,17 @@ ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1);
DROP TABLE t1,t2;
--echo #
+--echo # MDEV-25403 ALTER TABLE wrongly checks for field's default value if AFTER is used
+--echo #
+create table t1(t int, d date not null);
+insert into t1 values (1,'2001-1-1');
+set sql_mode = "no_zero_date";
+alter table t1 change d d date not null after t, add i int;
+show create table t1;
+--error ER_TRUNCATED_WRONG_VALUE
+alter table t1 add x date not null;
+drop table t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/auth_named_pipe.test b/mysql-test/t/auth_named_pipe.test
index 00577fbef05..4685b13143c 100644
--- a/mysql-test/t/auth_named_pipe.test
+++ b/mysql-test/t/auth_named_pipe.test
@@ -1,5 +1,10 @@
--source include/windows.inc
+if (!$AUTH_NAMED_PIPE_SO)
+{
+ skip No auth_named_pipe plugin;
+}
+
INSTALL SONAME 'auth_named_pipe';
--replace_result $USERNAME USERNAME
diff --git a/mysql-test/t/create_or_replace.test b/mysql-test/t/create_or_replace.test
index 4b167663742..ba32f4b7603 100644
--- a/mysql-test/t/create_or_replace.test
+++ b/mysql-test/t/create_or_replace.test
@@ -251,6 +251,25 @@ create table t1 (i int);
drop table t1;
drop database mysqltest2;
+
+--echo #
+--echo # MDEV-23391 Server crash in close_thread_table or assertion, upon CREATE OR REPLACE TABLE under lock
+--echo #
+create table t1 (i int);
+lock table t1 write;
+--replace_column 1 #
+--sorted_result
+select * from information_schema.metadata_lock_info;
+--error ER_DATA_TOO_LONG
+create or replace table t1 (a char(1)) engine=Innodb select 'foo' as a;
+show tables;
+--replace_column 1 #
+--sorted_result
+select * from information_schema.metadata_lock_info;
+create table t1 (i int);
+drop table t1;
+
+
--echo #
--echo # Testing CREATE .. LIKE
--echo #
diff --git a/mysql-test/t/cte_nonrecursive.test b/mysql-test/t/cte_nonrecursive.test
index c2ebc92c858..c20a0dc1d39 100644
--- a/mysql-test/t/cte_nonrecursive.test
+++ b/mysql-test/t/cte_nonrecursive.test
@@ -1261,4 +1261,285 @@ select a, c from cte as r2 where a > 4;
drop table t1;
+--echo #
+--echo # MDEV-23886: Stored Function returning the result of a query
+--echo # that uses CTE over a table twice
+--echo #
+
+create table t1 (c1 int);
+insert into t1 values (1),(2),(6);
+
+create function f1() returns int return
+( with cte1 as (select c1 from t1)
+ select sum(c1) from
+ (select * from cte1 union all select * from cte1) dt
+);
+select f1();
+
+create function f2() returns int return
+( with cte1 as (select c1 from t1)
+ select sum(s.c1) from cte1 as s, cte1 as t where s.c1=t.c1
+);
+select f2();
+
+create function f3() returns int return
+( with cte1 as (select c1 from t1)
+ select
+ case
+ when exists(select 1 from cte1 where c1 between 1 and 2) then 1
+ when exists(select 1 from cte1 where c1 between 5 and 6) then 2
+ else 0
+ end
+);
+select f3();
+
+create view v1 as (select c1 from t1);
+
+create function f4() returns int return
+( select sum(c1) from
+ (select * from v1 union all select * from v1) dt
+);
+select f4();
+
+create function f5() returns int return
+( select sum(s.c1) from v1 as s, v1 as t where s.c1=t.c1
+);
+select f5();
+
+create view v2(s) as
+with cte1 as (select c1 from t1)
+select sum(c1) from (select * from cte1 union all select * from cte1) dt;
+
+create function f6() returns int return
+(select s from v2);
+select f6();
+
+create function f7() returns int return
+( select r.s from v2 as r, v2 as t where r.s=t.s
+);
+select f7();
+
+select f5() + f6();
+
+prepare stmt from "select f5() + f6();";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+drop function f1;
+drop function f2;
+drop function f3;
+drop function f4;
+drop function f5;
+drop function f6;
+drop function f7;
+
+drop view v1;
+drop view v2;
+
+create table t2 (a int, b int);
+
+insert into t2
+with cte1 as (select c1 from t1)
+select * from cte1 as s, cte1 as t where s.c1=t.c1 and s.c1 > 5;
+
+select * from t2;
+
+delimiter |;
+
+create procedure p1()
+begin
+insert into t2
+with cte1 as (select c1 from t1)
+select * from cte1 as s, cte1 as t where s.c1=t.c1 and s.c1 <= 2 and t.c1 >= 2;
+end |
+
+delimiter ;|
+
+call p1();
+select * from t2;
+
+drop procedure p1;
+
+--echo # checking CTE resolution for queries with hanging CTEs
+
+with
+cte1(a) as (select * from t1 where c1 <= 2),
+cte2(b) as (select * from cte1 where a >= 2),
+cte3 as (select * from cte1,cte2 where cte1.a < cte2.b)
+select * from cte3;
+
+select * from t2;
+
+with
+cte1(a) as (select * from t1 where c1 <= 2),
+cte2(b) as (select * from cte1 where a >= 2),
+cte3 as (select * from cte1,cte2 where cte1.a < cte2.b)
+select * from t2;
+
+--error ER_BAD_FIELD_ERROR
+with
+cte1(a) as (select * from t1 where c1 <= 2),
+cte2(b) as (select * from cte1 where c1 >= 2),
+cte3 as (select * from cte1,cte2 where cte1.a < cte2.b)
+select * from t2;
+
+--error ER_BAD_FIELD_ERROR
+with
+cte1(a) as (select * from t1 where c1 <= 2),
+cte2(b) as (select * from cte1 where a >= 2),
+cte3 as (select * from cte1,cte2 where cte1.a < cte2.c1)
+select * from t2;
+
+with
+cte1 as (select * from t1 where c1 <= 2),
+cte2(a,b) as (select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+select * from cte2;
+
+with
+cte1 as (select * from t1 where c1 <= 2),
+cte2(a,b) as (select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+select * from t2;
+
+--error ER_NON_UNIQ_ERROR
+with
+cte1 as (select * from t1 where c1 <= 2),
+cte2(a,b) as (select * from cte1 as s1, cte1 as s2 where s1.c1=c1)
+select * from t2;
+
+with cte3 as
+( with cte2(a,b) as
+ ( with cte1 as (select * from t1 where c1 <= 2)
+ select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+ select r1.a,r2.b from cte2 as r1, cte2 as r2)
+select * from cte3;
+
+with cte3 as
+( with cte2(a,b) as
+ ( with cte1 as (select * from t1 where c1 <= 2)
+ select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+ select r1.a,r2.b from cte2 as r1, cte2 as r2)
+select * from t2;
+
+--error ER_BAD_FIELD_ERROR
+with cte3 as
+( with cte2(a,b) as
+ ( with cte1 as (select * from t1 where c1 <= 2)
+ select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1)
+ select r1.c1,r2.c1 from cte2 as r1, cte2 as r2)
+select * from t2;
+
+delimiter |;
+
+create procedure p1()
+begin
+insert into t2
+with cte1 as (select c1 from t1)
+select * from t1 as s, t1 as t where s.c1=t.c1 and s.c1 <= 2 and t.c1 >= 2;
+end |
+
+delimiter ;|
+
+call p1();
+select * from t2;
+
+drop procedure p1;
+
+delimiter |;
+
+create procedure p1()
+begin
+insert into t2
+with cte1 as (select a from t1)
+select * from t1 as s, t1 as t where s.c1=t.c1 and s.c1 <= 2 and t.c1 >= 2;
+end |
+
+delimiter ;|
+
+--error ER_BAD_FIELD_ERROR
+call p1();
+
+drop procedure p1;
+
+drop table t1,t2;
+
+
+--echo #
+--echo # MDEV-20411: SP containing only one SELECT with WITH clause
+--echo #
+
+create procedure sp1 ()
+with cte as (select 1 as a) select * from cte;
+call sp1();
+call sp1();
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (7), (1), (1), (3), (1), (5);
+
+create procedure sp2 ()
+with cte as (select * from t1) select * from cte;
+call sp2();
+call sp2();
+
+create procedure sp3 ()
+with cte as (select * from t1 group by a) select * from cte;
+call sp3();
+call sp3();
+
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+
+drop table t1;
+
+--echo #
+--echo # MDEV-26095: missing RECURSIVE for the recursive definition of CTE
+--echo # embedded into another CTE definition
+--echo #
+
+create table t1 (a int);
+insert into t1 values (5), (7);
+
+with cte_e as (
+ with recursive cte_r as (
+ select a from t1 union select a+1 as a from cte_r r where a < 10
+ ) select * from cte_r
+) select * from cte_e;
+
+--ERROR ER_NO_SUCH_TABLE
+with cte_e as (
+ with cte_r as (
+ select a from t1 union select a+1 as a from cte_r r where a < 10
+ ) select * from cte_r
+) select * from cte_e;
+
+drop table t1;
+
+--echo #
+--echo # MDEV-26025: query with two usage of a CTE executing via PS /SP
+--echo #
+
+create table t1 (a int, b int);
+insert into t1 value (1,3), (3,2), (1,3), (4,1);
+
+let $q=
+with
+ cte1 as ( select a,b from t1 where a = 1 AND b = 3 ),
+ cte2 as ( select a,b from cte1 ),
+ cte3 as ( select a,b from cte2 )
+select * from cte3, cte2;
+
+eval prepare stmt from "$q";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+eval create procedure sp() $q;
+
+call sp();
+call sp();
+
+drop procedure sp;
+drop table t1;
+
--echo # End of 10.2 tests
diff --git a/mysql-test/t/cte_recursive.test b/mysql-test/t/cte_recursive.test
index 849e76b0436..3c845f9d0e3 100644
--- a/mysql-test/t/cte_recursive.test
+++ b/mysql-test/t/cte_recursive.test
@@ -2556,8 +2556,8 @@ insert into t2 values (1,1),(2,2);
explain
with recursive cte as
- ( select * from t1 union select s1.* from t1 as s1, cte where s1.i1 = cte.i2 )
-select * from t1 as t;
+ ( select * from t2 union select s1.* from t2 as s1, cte where s1.i1 = cte.i2 )
+select * from t2 as t;
drop table t1,t2;
@@ -2820,5 +2820,84 @@ drop table folks;
set big_tables=@save_big_tables;
--echo #
+--echo # MDEV-26135: execution of PS for query with hanging recursive CTE
+--echo #
+
+create table t1 (a int);
+insert into t1 values (5), (7);
+create table t2 (b int);
+insert into t2 values (3), (7), (1);
+
+let $q=
+with recursive r as (select a from t1 union select a+1 from r where a < 10)
+select * from t2;
+
+eval $q;
+eval prepare stmt from "$q";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-26189: Unknown column reference within hanging recursive CTE
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+
+let $q1=
+with recursive
+ r as (select * from t1 union select s1.* from t1 as s1, r where s1.a = r.b)
+select * from t1 as t;
+
+--ERROR ER_BAD_FIELD_ERROR
+eval $q1;
+--ERROR ER_BAD_FIELD_ERROR
+eval explain $q1;
+
+eval create procedure sp1() $q1;
+--ERROR ER_BAD_FIELD_ERROR
+call sp1();
+--ERROR ER_BAD_FIELD_ERROR
+call sp1();
+
+let $q2=
+with recursive
+ r as (select * from t1 union select s1.* from t1 as s1, r where s1.b = r.a)
+select * from t1 as t;
+
+--ERROR ER_BAD_FIELD_ERROR
+eval $q2;
+--ERROR ER_BAD_FIELD_ERROR
+eval explain $q2;
+
+eval create procedure sp2() $q2;
+--ERROR ER_BAD_FIELD_ERROR
+call sp2();
+--ERROR ER_BAD_FIELD_ERROR
+call sp2();
+
+drop procedure sp1;
+drop procedure sp2;
+
+drop table t1;
+
+--echo #
+--echo # MDEV-26202: Recursive CTE used indirectly twice
+--echo # (fixed by the patch forMDEV-26025)
+--echo #
+
+with recursive
+ rcte as ( SELECT 1 AS a
+ UNION ALL
+ SELECT cast(a + 1 as unsigned int) FROM rcte WHERE a < 3),
+ cte1 AS (SELECT a FROM rcte),
+ cte2 AS (SELECT a FROM cte1),
+ cte3 AS ( SELECT a FROM cte2)
+SELECT * FROM cte2, cte3;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/ctype_filename.test b/mysql-test/t/ctype_filename.test
index 7ec07293a2b..99735b33ddc 100644
--- a/mysql-test/t/ctype_filename.test
+++ b/mysql-test/t/ctype_filename.test
@@ -27,3 +27,29 @@ select convert(convert(',' using filename) using binary);
--echo #
SET NAMES utf8;
SELECT @a:=CONVERT('aя' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a), HEX(REVERSE(@a));
+
+--echo #
+--echo # Beginning of 10.2 test.
+--echo #
+--echo # MDEV-25462: Assertion `m_status == DA_ERROR || m_status == DA_OK ||
+--echo # m_status == DA_OK_BULK' failed in Diagnostics_area::message from
+--echo # get_schema_tables_record
+--echo #
+
+SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
+SET @old_character_set_client= @@character_set_client;
+SET @old_character_set_connection= @@character_set_connection;
+SET @old_character_set_results= @@character_set_results;
+--error ER_WRONG_VALUE_FOR_VAR
+SET NAMES 'filename';
+SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
+CREATE VIEW v2 AS SELECT 1;
+SHOW TABLE STATUS;
+DROP VIEW v2;
+SET @@character_set_client= @old_character_set_client;
+SET @@character_set_connection= @old_character_set_connection;
+SET @@character_set_results= @old_character_set_results;
+
+--echo #
+--echo # End of 10.2 test
+--echo #
diff --git a/mysql-test/t/ctype_utf16_def.test b/mysql-test/t/ctype_utf16_def.test
index 0829cd53285..c6de842f618 100644
--- a/mysql-test/t/ctype_utf16_def.test
+++ b/mysql-test/t/ctype_utf16_def.test
@@ -7,3 +7,10 @@ call mtr.add_suppression("'utf16' can not be used as client character set");
SHOW VARIABLES LIKE 'collation_server';
SHOW VARIABLES LIKE 'character_set_server';
SHOW VARIABLES LIKE 'ft_stopword_file';
+
+--echo #
+--echo # MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax
+--echo #
+
+SET GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
+SET GLOBAL ft_boolean_syntax=DEFAULT;
diff --git a/mysql-test/t/ctype_utf16le.test b/mysql-test/t/ctype_utf16le.test
index 204df136274..c0cac7f5d67 100644
--- a/mysql-test/t/ctype_utf16le.test
+++ b/mysql-test/t/ctype_utf16le.test
@@ -3,6 +3,7 @@
-- source include/have_utf32.inc
-- source include/have_utf8mb4.inc
+let $MYSQLD_DATADIR= `select @@datadir`;
SET TIME_ZONE='+03:00';
@@ -811,5 +812,41 @@ let $coll_pad='utf16le_bin';
--source include/ctype_pad_all_engines.inc
--echo #
+--echo # MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
+--echo #
+
+
+
+SET NAMES utf8;
+SET SESSION character_set_connection= utf16le;
+
+CREATE TABLE kv (v TEXT CHARACTER SET latin1);
+CREATE TABLE t (a INT);
+CREATE VIEW v AS SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v.frm' REPLACE INTO TABLE kv CHARACTER SET latin1;
+SELECT LOWER(v) FROM kv WHERE v LIKE _binary'query=%';
+TRUNCATE TABLE kv;
+SELECT * FROM v;
+LOCK TABLE t WRITE;
+UNLOCK TABLES;
+DROP VIEW v;
+DROP TABLE t;
+DROP TABLE kv;
+
+CREATE TABLE t (a INT);
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1');
+LOCK TABLE t WRITE;
+UNLOCK TABLES;
+DROP TABLE t;
+
+CREATE TABLE t (a INT);
+SELECT TABLE_NAME, HEX(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1');
+SELECT TABLE_NAME, TABLE_SCHEMA, HEX(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=CONCAT('test',0x00,'1');
+DROP TABLE t;
+
+SET NAMES utf8;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/ctype_utf32_def-master.opt b/mysql-test/t/ctype_utf32_def-master.opt
new file mode 100644
index 00000000000..3b0880cbff3
--- /dev/null
+++ b/mysql-test/t/ctype_utf32_def-master.opt
@@ -0,0 +1 @@
+--character-set-server=utf32,latin1 --collation-server=utf32_general_ci
diff --git a/mysql-test/t/ctype_utf32_def.test b/mysql-test/t/ctype_utf32_def.test
new file mode 100644
index 00000000000..e23f96052d3
--- /dev/null
+++ b/mysql-test/t/ctype_utf32_def.test
@@ -0,0 +1,9 @@
+--source include/have_utf32.inc
+call mtr.add_suppression("'utf32' can not be used as client character set");
+
+--echo #
+--echo # MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax
+--echo #
+
+SET GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
+SET GLOBAL ft_boolean_syntax=DEFAULT;
diff --git a/mysql-test/t/ctype_utf32_uca.test b/mysql-test/t/ctype_utf32_uca.test
index 334d8fd1d48..2969480b0ef 100644
--- a/mysql-test/t/ctype_utf32_uca.test
+++ b/mysql-test/t/ctype_utf32_uca.test
@@ -266,5 +266,31 @@ SET NAMES utf8;
--echo #
+--echo # MDEV-25402 Assertion `!str || str != Ptr' failed in String::copy
+--echo #
+
+SET @c:="SET SESSION collation_connection=utf32_spanish_ci";
+PREPARE s FROM @c;
+EXECUTE s;
+CREATE PROCEDURE p (IN i INT) EXECUTE s;
+SET SESSION character_set_connection=latin1;
+SET @c:="SET @b=get_format(DATE,'EUR')";
+PREPARE s FROM @c;
+EXECUTE s;
+CALL p (@a);
+DEALLOCATE PREPARE s;
+DROP PROCEDURE p;
+
+SET NAMES utf8;
+SET @c:="SET @b=get_format(DATE,'EUR')";
+PREPARE s FROM @c;
+EXECUTE s;
+SET collation_connection=utf32_spanish_ci;
+EXECUTE s;
+DEALLOCATE PREPARE s;
+SET NAMES utf8;
+
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 9a64821db66..b34de4175e9 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -2,6 +2,8 @@
# Tests with the utf8 character set
#
+let $MYSQLD_DATADIR= `select @@datadir`;
+
let collation=utf8_unicode_ci;
--source include/have_collation.inc
SET TIME_ZONE='+03:00';
@@ -2166,5 +2168,21 @@ let $coll_pad='utf8_bin';
--source include/ctype_pad_all_engines.inc
--echo #
+--echo # MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
+--echo #
+
+SET NAMES utf8;
+SET SESSION character_set_connection=latin1;
+CREATE VIEW v1 AS SELECT 'ä' AS c1;
+SELECT c1, HEX(c1) FROM v1;
+CREATE TABLE kv (v BLOB);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv;
+SELECT * FROM kv WHERE v LIKE _binary'query=%';
+DROP TABLE kv;
+DROP VIEW v1;
+SET NAMES utf8;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test
index 31cf589c487..a4fe74aefb5 100644
--- a/mysql-test/t/default.test
+++ b/mysql-test/t/default.test
@@ -2109,5 +2109,11 @@ CREATE OR REPLACE TABLE t1(i int);
ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`;
DROP TABLE t1;
+--echo #
+--echo # MDEV-18278 Misleading error message in error log upon failed table creation
+--echo #
+--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
+create table t1 (a int as (a));
+show warnings;
--echo # end of 10.2 test
diff --git a/mysql-test/t/delayed_blob-master.opt b/mysql-test/t/delayed_blob-master.opt
new file mode 100644
index 00000000000..e442a822046
--- /dev/null
+++ b/mysql-test/t/delayed_blob-master.opt
@@ -0,0 +1 @@
+--init_connect="set @a='something unique to have MTR start a dedicated mariadbd for this test and shutdown it after the test'"
diff --git a/mysql-test/t/delayed_blob.test b/mysql-test/t/delayed_blob.test
new file mode 100644
index 00000000000..bf3e01a8825
--- /dev/null
+++ b/mysql-test/t/delayed_blob.test
@@ -0,0 +1,21 @@
+--echo #
+--echo # MDEV-25925 Warning: Memory not freed: 32 on INSERT DELAYED
+--echo #
+
+SET sql_mode='TRADITIONAL';
+CREATE TABLE t1 (c BLOB) ENGINE=MyISAM;
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT DELAYED INTO t1 VALUES (''||'');
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+
+--echo #
+--echo # MDEV-24467 Memory not freed after failed INSERT DELAYED
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(1)) ENGINE=MyISAM;
+ALTER TABLE t1 ADD b BLOB DEFAULT 'x';
+--error ER_DATA_TOO_LONG
+INSERT DELAYED INTO t1 (a) VALUES ('foo');
+DROP TABLE t1;
diff --git a/mysql-test/t/derived_cond_pushdown.test b/mysql-test/t/derived_cond_pushdown.test
index 31b49047bf1..9b7658a725e 100644
--- a/mysql-test/t/derived_cond_pushdown.test
+++ b/mysql-test/t/derived_cond_pushdown.test
@@ -2212,4 +2212,99 @@ select * from v1 where m > 0;
drop view v1;
drop table t1;
+--echo #
+--echo # MDEV-25635: pushdown into grouping view using aggregate functions
+--echo # with constant arguments via a mergeable derived table
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (3), (7), (7), (3);
+
+create view v1 as select a, sum(1) as f, sum(1) as g from t1 group by a;
+select * from v1;
+let $q1=
+select * from (select * from v1) as dt where a=f and a=g;
+eval $q1;
+eval explain extended $q1;
+
+create view v2 as select a, min(1) as f, min(1) as g from t1 group by a;
+select * from v2;
+let $q2=
+select * from (select * from v2) as dt where a=f and a=g;
+eval $q2;
+eval explain extended $q2;
+
+drop view v1,v2;
+drop table t1;
+
+--echo #
+--echo # MDEV-25969: Condition pushdown into derived table doesn't work if select list uses SP
+--echo #
+create function f1(a int) returns int DETERMINISTIC return (a+1);
+
+create table t1 (
+ pk int primary key,
+ a int,
+ b int,
+ key(a)
+);
+
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t3(a int);
+insert into t3 select A.a + B.a* 10 + C.a * 100 from t2 A, t2 B, t2 C;
+
+insert into t1 select a,a,a from t3;
+
+create view v1 as
+select
+ t1.a as col1,
+ f1(t1.b) as col2
+from
+ t1;
+
+create view v2 as
+select
+ t1.a as col1,
+ f1(t1.b) as col2
+from
+ t1;
+create view v3 as
+select col2, col1 from v1
+union all
+select col2, col1 from v2;
+
+explain select * from v3 where col1=123;
+
+--echo # This must use ref accesses for reading table t1, not full scans:
+explain format=json
+select * from v3 where col1=123 and col2=321;
+
+drop function f1;
+drop view v1,v2,v3;
+drop table t1, t2,t3;
+
+--echo #
+--echo # Another testcase, with pushdown through GROUP BY
+--echo #
+create table t1 (a int, b int);
+insert into t1 values (1,1),(2,2),(3,3);
+
+create function f1(a int) returns int DETERMINISTIC return (a+1);
+
+create view v2(a, a2, s) as
+select a, f1(a), sum(b) from t1 group by a, f1(a);
+
+--echo # Here,
+--echo # "(s+1) > 10" will be pushed into HAVING
+--echo # "a > 1" will be pushed all the way to the table scan on t1
+--echo # "a2>123" will be pushed into HAVING (as it refers to an SP call which
+--echo # prevents pushing it to the WHERE)
+explain format=json
+select * from v2 where (s+1) > 10 AND a > 1 and a2>123;
+
+drop view v2;
+drop function f1;
+drop table t1;
--echo # End of 10.2 tests
diff --git a/mysql-test/t/derived_opt.test b/mysql-test/t/derived_opt.test
index aab95f69f26..305cac120a0 100644
--- a/mysql-test/t/derived_opt.test
+++ b/mysql-test/t/derived_opt.test
@@ -401,5 +401,38 @@ set join_cache_level=default;
DROP TABLE t1,t2;
+#
+# MDEV-25182: Complex query in Store procedure corrupts results
+#
+set @save_optimizer_switch= @@optimizer_switch;
+set optimizer_switch="derived_merge=on";
+
+CREATE TABLE t1 (id int, d2 datetime, id1 int) ;
+insert into t1 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',3);
+
+CREATE TABLE t2 (id int, d1 datetime, id1 int) ;
+insert into t2 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',2);
+
+prepare stmt from "
+SELECT * from
+ (SELECT min(d2) AS d2, min(d1) AS d1 FROM
+ (SELECT t1.d2 AS d2, (SELECT t2.d1
+ FROM t2 WHERE t1.id1 = t2.id1
+ ORDER BY t2.id DESC LIMIT 1) AS d1
+ FROM t1
+ ) dt2
+ ) ca
+ ORDER BY ca.d2;";
+
+execute stmt;
+execute stmt;
+
+set optimizer_switch= @save_optimizer_switch;
+DROP TABLE t1, t2;
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
+
# The following command must be the last one the file
set optimizer_switch=@exit_optimizer_switch;
diff --git a/mysql-test/t/derived_view.test b/mysql-test/t/derived_view.test
index 46d6a7805ca..89ada40e84c 100644
--- a/mysql-test/t/derived_view.test
+++ b/mysql-test/t/derived_view.test
@@ -2249,3 +2249,20 @@ eval explain extended $q;
drop view v1;
drop table t1,t2,t3;
+
+--echo #
+--echo # MDEV-25679: view / derived table defined as ordered select with LIMIT
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+
+create view v1 as (select a from t1 limit 2) order by a desc;
+(select a from t1 limit 2) order by a desc;
+select * from v1;
+select * from ((select a from t1 limit 2) order by a desc) dt;
+
+drop view v1;
+drop table t1;
+
+--echo # End of 10.2 tests
diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test
index 805e9954b81..e4e093225f8 100644
--- a/mysql-test/t/func_json.test
+++ b/mysql-test/t/func_json.test
@@ -555,5 +555,11 @@ SELECT
--echo #
+--echo # MDEV-24585 Assertion `je->s.cs == nice_js->charset()' failed in json_nice.
+--echo #
+
+SELECT JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' );
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 1a59946e97e..366aacb1945 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1932,3 +1932,19 @@ DROP TABLE t1;
--echo #
--echo # End of 10.1 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.2 tests
+--echo #
+
+--echo #
+--echo # MDEV-24742 Server crashes in Charset::numchars / String::numchars
+--echo #
+
+SELECT NULL IN (RIGHT(AES_ENCRYPT('foo','bar'), LAST_INSERT_ID()), 'qux');
+
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/t/gis-json.test b/mysql-test/t/gis-json.test
index a97e9411e5c..ff6298c50a6 100644
--- a/mysql-test/t/gis-json.test
+++ b/mysql-test/t/gis-json.test
@@ -46,6 +46,13 @@ SELECT st_astext(st_geomfromgeojson('{"type": "MultiPolygon","coordinates": []}'
SELECT ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }");
+#
+# MDEV-25461 Assertion `je->state == JST_KEY' failed in Geometry::create_from_json.
+#
+
+SELECT ST_ASTEXT (ST_GEOMFROMGEOJSON ('{ "type": "GEOMETRYCOLLECTION", "coordinates": [102.0, 0.0]}'));
+
+SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type": ["POINT"], "coINates": [0,0] }'));
--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/grant5.test b/mysql-test/t/grant5.test
index 944918e63ec..d8c62691a84 100644
--- a/mysql-test/t/grant5.test
+++ b/mysql-test/t/grant5.test
@@ -71,5 +71,28 @@ DROP USER test_user;
DROP ROLE test_role;
#
+# MDEV-26080 SHOW GRANTS does not quote role names properly for DEFAULT ROLE
+#
+
+CREATE ROLE 'test-role';
+CREATE USER 'test-user';
+GRANT 'test-role' TO 'test-user';
+SET DEFAULT ROLE 'test-role' FOR 'test-user';
+SHOW GRANTS FOR 'test-user';
+DROP ROLE 'test-role';
+SHOW GRANTS FOR 'test-user';
+SET DEFAULT ROLE NONE FOR 'test-user';
+SHOW GRANTS FOR 'test-user';
+CREATE ROLE `r``o'l"e`;
+select user from mysql.user where is_role='Y';
+GRANT `r``o'l"e` TO 'test-user';
+SET DEFAULT ROLE `r``o'l"e` FOR 'test-user';
+# it is expected that quotes won't be shown correctly
+SHOW GRANTS FOR 'test-user';
+DROP ROLE `r``o'l"e`;
+DROP USER 'test-user';
+
+
+#
# End of 10.1 tests
#
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 9ff94d2deb7..b7f4a7e4407 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1935,5 +1935,26 @@ SELECT * FROM v LIMIT ROWS EXAMINED 9;
DROP VIEW v;
--echo #
+--echo # MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
+--echo #
+
+# Expect empty sets if requested TABLE_NAME or TABLE_SCHEMA with zero bytes
+CREATE TABLE t (a INT);
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1');
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=CONCAT('test',0x00,'1');
+DROP TABLE t;
+
+# Make sure check_table_name() does not reject special characters
+CREATE TABLE `a/~.b` (a INT);
+SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='a/~.b';
+DROP TABLE `a/~.b`;
+
+# Make sure check_db_name() does not reject special characters
+CREATE DATABASE `a/~.b`;
+CREATE TABLE `a/~.b`.t1 (a INT);
+SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='a/~.b';
+DROP DATABASE `a/~.b`;
+
+--echo #
--echo # End of 10.2 Test
--echo #
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index c5b2c985ff7..9ad2c48bfca 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -2190,4 +2190,54 @@ DROP TABLE t1,t2,t3,t4;
--echo # end of 10.1 tests
+--echo #
+--echo # MDEV-25362: name resolution for subqueries in ON expressions
+--echo #
+
+create table t1 (a int, b int);
+create table t2 (c int, d int);
+create table t3 (e int, f int);
+create table t4 (g int, h int);
+
+--error ER_BAD_FIELD_ERROR
+explain
+select *
+from
+ t1 left join
+ (t2
+ join
+ t3 on
+ (t3.f=t1.a)
+ ) on (t2.c=t1.a );
+
+# This must produce an error:
+--error ER_BAD_FIELD_ERROR
+explain
+select *
+from
+ t1 left join
+ (t2
+ join
+ t3 on
+ (t3.f=(select max(g) from t4 where t4.h=t1.a))
+ ) on (t2.c=t1.a );
+
+drop table t1,t2,t3,t4;
+
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2 (b int);
+insert into t2 values (1),(2);
+create table t3 (c int);
+insert into t3 values (1),(2);
+
+--error ER_BAD_FIELD_ERROR
+select * from ( select * from t1 left join t2
+ on b in (select x from t3 as sq1)
+ ) as sq2;
+
+drop table t1,t2,t3;
+
+--echo # end of 10.2 tests
+
SET optimizer_switch=@org_optimizer_switch;
diff --git a/mysql-test/t/lock_multi_bug38499.test b/mysql-test/t/lock_multi_bug38499.test
index b812984e516..c489712e5d8 100644
--- a/mysql-test/t/lock_multi_bug38499.test
+++ b/mysql-test/t/lock_multi_bug38499.test
@@ -2,6 +2,9 @@
# MySQL >= 5.0
#
+# The test can take hours with valgrind
+--source include/not_valgrind.inc
+
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
diff --git a/mysql-test/t/lock_multi_bug38691.test b/mysql-test/t/lock_multi_bug38691.test
index 881a0d8e502..9760c1a873a 100644
--- a/mysql-test/t/lock_multi_bug38691.test
+++ b/mysql-test/t/lock_multi_bug38691.test
@@ -4,6 +4,8 @@
# MySQL >= 5.0
#
+# The test can take hours with valgrind
+--source include/not_valgrind.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
diff --git a/mysql-test/t/mdev-504.test b/mysql-test/t/mdev-504.test
deleted file mode 100644
index 551c21c37d0..00000000000
--- a/mysql-test/t/mdev-504.test
+++ /dev/null
@@ -1,80 +0,0 @@
---source include/not_valgrind.inc
---source include/no_protocol.inc
-
-SET GLOBAL net_write_timeout = 900;
-
-CREATE TABLE A (
- pk INTEGER AUTO_INCREMENT PRIMARY KEY,
- fdate DATE
-) ENGINE=MyISAM;
-
---delimiter |
-
-CREATE PROCEDURE p_analyze()
-BEGIN
- DECLARE attempts INTEGER DEFAULT 100;
- wl_loop: WHILE attempts > 0 DO
- ANALYZE TABLE A;
- SET attempts = attempts - 1;
- END WHILE wl_loop;
-END |
-
-CREATE FUNCTION rnd3() RETURNS INT
-BEGIN
- RETURN ROUND(3 * RAND() + 0.5);
-END |
-
---delimiter ;
-
-SET GLOBAL use_stat_tables = PREFERABLY;
-
---let $trial = 100
-
---disable_query_log
---disable_result_log
---disable_warnings
-while ($trial)
-{
-
- --connect (con1,localhost,root,,)
- --send CALL p_analyze()
-
- --connect (con2,localhost,root,,)
- --send CALL p_analyze()
-
- --let $run = 100
-
- while ($run)
- {
- --connect (con3,localhost,root,,)
-
- let $query = `SELECT CASE rnd3()
- WHEN 1 THEN 'INSERT INTO A (pk) VALUES (NULL)'
- WHEN 2 THEN 'DELETE FROM A LIMIT 1'
- ELSE 'UPDATE IGNORE A SET fdate = 2 LIMIT 1' END`;
- --eval $query
- --disconnect con3
- --dec $run
- }
-
- --connection con2
- --reap
- --disconnect con2
- --connection con1
- --reap
- --disconnect con1
-
- --dec $trial
-}
-
---enable_query_log
---enable_result_log
---enable_warnings
-
-# Cleanup
---connection default
-DROP TABLE A;
-DROP PROCEDURE p_analyze;
-DROP FUNCTION rnd3;
-SET GLOBAL use_stat_tables = DEFAULT;
-SET GLOBAL net_write_timeout = DEFAULT;
diff --git a/mysql-test/t/mdev19198.test b/mysql-test/t/mdev19198.test
new file mode 100644
index 00000000000..19b45ed7510
--- /dev/null
+++ b/mysql-test/t/mdev19198.test
@@ -0,0 +1,15 @@
+CREATE TABLE t1 (c INT);
+CREATE TABLE t2 (c INT);
+
+LOCK TABLES t1 WRITE, t2 READ;
+CREATE TABLE IF NOT EXISTS t1 LIKE t2;
+UNLOCK TABLES;
+
+LOCK TABLES t1 READ , t2 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+CREATE TABLE IF NOT EXISTS t1 LIKE t2;
+UNLOCK TABLES;
+
+CREATE TABLE IF NOT EXISTS t1 LIKE t2;
+
+DROP TABLES t1,t2;
diff --git a/mysql-test/t/mdev_22370.test b/mysql-test/t/mdev_22370.test
new file mode 100644
index 00000000000..86bc527ebc0
--- /dev/null
+++ b/mysql-test/t/mdev_22370.test
@@ -0,0 +1,17 @@
+#
+# MDEV-22370 safe_mutex: Trying to lock uninitialized mutex at
+# /data/src/10.4-bug/sql/rpl_parallel.cc, line 470 upon shutdown during FTWRL
+#
+# Purpose of this test case to test crash while FTWRL and shutdown is in race
+# condition
+# Shutdown can execute first and destroy the mutex making mutex_lock in pool_mark_busy
+# to crash
+
+--source include/have_debug.inc
+--connect (con1,localhost,root,,)
+SET DEBUG_DBUG='+d,mark_busy_mdev_22370';
+--send
+ FLUSH TABLES WITH READ LOCK;
+
+--connection default
+--source include/restart_mysqld.inc
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index b5328f74e70..dff3938d02f 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -1041,3 +1041,56 @@ drop function f1;
--echo #
--echo # end of 5.5 tests
--echo #
+
+--echo #
+--echo # MDEV-24823: Invalid multi-table update of view within SP
+--echo #
+
+create table t1 (id int) engine=myisam;
+insert into t1 values (1),(2),(1);
+create table t2 (pk int, c0 int) engine=myisam;
+insert into t2 values (1,1), (2,3);
+create view v2 as select * from t2;
+create view v3 as select * from t2 where c0 < 3;
+
+create procedure sp0() update t1, v2 set v2.pk = 1 where v2.c0 = t1.c1;
+--error ER_BAD_FIELD_ERROR
+call sp0();
+--error ER_BAD_FIELD_ERROR
+call sp0();
+
+create procedure sp1() update (t1 join v2 on v2.c0 = t1.c1) set v2.pk = 1;
+--error ER_BAD_FIELD_ERROR
+call sp1();
+--error ER_BAD_FIELD_ERROR
+call sp1();
+
+create procedure sp2() update (t1 join v3 on v3.c0 = t1.c1) set v3.pk = 1;
+--error ER_BAD_FIELD_ERROR
+call sp2();
+--error ER_BAD_FIELD_ERROR
+call sp2();
+
+create procedure sp3()
+update (t1 join v2 on v2.c0 = t1.id) set v2.c0 = v2.c0+1;
+select * from t2;
+call sp3();
+select * from t2;
+call sp3();
+select * from t2;
+
+create procedure sp4() delete t1 from t1 join v2 on v2.c0 = t1.c1;
+--error ER_BAD_FIELD_ERROR
+call sp4();
+--error ER_BAD_FIELD_ERROR
+call sp4();
+
+drop procedure sp0;
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop procedure sp4;
+drop view v2,v3;
+drop table t1,t2;
+
+--echo # End of 10.2 tests
diff --git a/mysql-test/t/mysql_binary_zero_insert.test b/mysql-test/t/mysql_binary_zero_insert.test
new file mode 100644
index 00000000000..b327c8a4d1e
--- /dev/null
+++ b/mysql-test/t/mysql_binary_zero_insert.test
@@ -0,0 +1,170 @@
+#
+# Purpose:
+# This test ensures that the mysql client is able to properly handle the
+# binary data sequence 0x5c00, i.e. the null-terminating character \0, in a
+# string when --binary-mode is enabled. Specifically, this sequence is valid to
+# appear anywhere within a binary data string, and it should not end the string
+# or SQL command. Additionally, \0 outside of a string should still end the
+# query.
+#
+# Methodology:
+# This test initially inserts data with binary strings containing \0. To
+# ensure the mysql client is able to process this data correctly, perl is used
+# to create a SQL file that contains \0 in strings, and this file is used as
+# input into the client. The row data is then validated by searching for binary
+# zeros in mysqldump output.
+#
+#
+# References:
+# MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog
+# outputs
+
+--echo # Note: This test assumes NO_BACKSLASH_ESCAPES is not set in SQL_MODE.
+
+--source include/have_log_bin.inc
+
+--echo ##############################
+--echo # Setup
+--echo ##############################
+
+--echo #
+--echo # Saving old state
+--echo #
+set @old_sql_mode= @@global.SQL_MODE;
+set @@global.SQL_MODE= "";
+
+--echo #
+--echo # Create table for data entry
+--echo #
+CREATE TABLE tb (`id` int(11) NOT NULL AUTO_INCREMENT,`cb` longblob DEFAULT NULL, PRIMARY KEY (`id`)) AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
+
+# Will replay binlog later and we don't want to recreate the table
+RESET MASTER;
+
+
+--echo ##############################
+--echo # Test Case
+--echo ##############################
+
+--echo #
+--echo # \0 (0x5c00 in binary) should be allowed in data strings if
+--echo # --binary-mode is enabled.
+--echo #
+--perl
+ my $dir= $ENV{'MYSQL_TMP_DIR'};
+ open (my $FILE, '>', "$dir/binary_zero_inserts.sql") or die "open(): $!";
+
+ print $FILE "TRUNCATE TABLE tb;\n";
+
+ # INSERT INTO tb(cb) VALUES(_binary '\0');
+ print $FILE "INSERT INTO tb(cb) VALUES (_binary '";
+ print $FILE pack "H*","5c00";
+ print $FILE "');\n";
+
+ # INSERT INTO tb(cb) VALUES(_binary '\0A');
+ print $FILE "INSERT INTO tb(cb) VALUES (_binary '";
+ print $FILE pack "H*","5c0041";
+ print $FILE "');\n";
+
+ # INSERT INTO tb(cb) VALUES(_binary 'A\0');
+ print $FILE "INSERT INTO tb(cb) VALUES (_binary '";
+ print $FILE pack "H*","415c00";
+ print $FILE "');\n";
+
+ # INSERT INTO tb(cb) VALUES(_binary 'A\0B');
+ print $FILE "INSERT INTO tb(cb) VALUES (_binary '";
+ print $FILE pack "H*","415c0042";
+ print $FILE "');\n";
+
+ # INSERT INTO tb(cb) VALUES(_binary '\0A\0');
+ print $FILE "INSERT INTO tb(cb) VALUES (_binary '";
+ print $FILE pack "H*","5c00415c00";
+ print $FILE "');\n";
+
+ # INSERT INTO tb(cb) VALUES(_binary '\\\0');
+ print $FILE "INSERT INTO tb(cb) VALUES (_binary '";
+ print $FILE pack "H*","5c5c5c00";
+ print $FILE "');\n";
+
+ # INSERT INTO tb(cb) VALUES(_binary '\0\0');
+ print $FILE "INSERT INTO tb(cb) VALUES (_binary '";
+ print $FILE pack "H*","5c005c00";
+ print $FILE "');\n";
+
+ # INSERT INTO tb(cb) VALUES(_binary '\\0');
+ print $FILE "INSERT INTO tb(cb) VALUES (_binary '";
+ print $FILE pack "H*","5c5c00";
+ print $FILE "');\n";
+
+ close ($FILE);
+EOF
+--let SEARCH_PATTERN= \x5c\x00
+--let SEARCH_FILE= $MYSQL_TMP_DIR/binary_zero_inserts.sql
+--source include/search_pattern_in_file.inc
+--echo # MYSQL --binary-mode test < MYSQL_TMP_DIR/binary_zero_inserts.sql
+--exec $MYSQL --binary-mode test < $MYSQL_TMP_DIR/binary_zero_inserts.sql
+
+--echo #
+--echo # Ensure a row exists from each insert statement with a \0
+--echo #
+SELECT COUNT(*)=8 from tb;
+
+--echo #
+--echo # Ensure that the binary zero was parsed and exists in the row data
+--echo # Note: We only look for 00 because the 5c only served as an escape
+--echo # in parsing.
+--echo #
+--echo # MYSQL_DUMP test tb --hex-blob | grep INSERT > MYSQL_TMP_DIR/dump.sql
+--exec $MYSQL_DUMP test tb --hex-blob | grep INSERT > $MYSQL_TMP_DIR/dump.sql
+--let SEARCH_PATTERN= 00
+--let SEARCH_FILE= $MYSQL_TMP_DIR/dump.sql
+--source include/search_pattern_in_file.inc
+
+--echo #
+--echo # Ensure data consistency on mysqlbinlog replay
+--echo #
+--let $good_checksum= `CHECKSUM TABLE tb`
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+FLUSH LOGS;
+--echo # MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > MYSQL_TMP_DIR/binlog_zeros.sql
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file > $MYSQL_TMP_DIR/binlog_zeros.sql
+--let SEARCH_PATTERN= \x5c\x00
+--let SEARCH_FILE= $MYSQL_TMP_DIR/binlog_zeros.sql
+--source include/search_pattern_in_file.inc
+--echo # MYSQL --binary-mode test < MYSQL_TMP_DIR/binlog_zeros.sql
+--exec $MYSQL --binary-mode test < $MYSQL_TMP_DIR/binlog_zeros.sql
+if ($good_checksum != `CHECKSUM TABLE tb`)
+{
+ die "Blob with binary zero data changed after binary log replay";
+}
+--echo # Table checksum is equivalent before and after binlog replay
+
+--echo #
+--echo # A \0 should still be treated as end-of-query in binary mode.
+--echo #
+--perl
+ my $dir= $ENV{'MYSQL_TMP_DIR'};
+ open (my $FILE, '>', "$dir/binary_zero_eoq.sql") or die "open(): $!";
+
+ # INSERT INTO tb(cb) VALUES(_binary 'text')\0
+ print $FILE "INSERT INTO tb(cb) VALUES (_binary 'text')";
+ print $FILE pack "H*","5c00";
+
+ close ($FILE);
+EOF
+--echo # MYSQL --binary-mode -B test < MYSQL_TMP_DIR/binary_zero_eoq.sql
+--exec $MYSQL --binary-mode -B test < $MYSQL_TMP_DIR/binary_zero_eoq.sql
+
+
+--echo ##############################
+--echo # Cleanup
+--echo ##############################
+
+--remove_file $MYSQL_TMP_DIR/binary_zero_inserts.sql
+--remove_file $MYSQL_TMP_DIR/binary_zero_eoq.sql
+--remove_file $MYSQL_TMP_DIR/binlog_zeros.sql
+--remove_file $MYSQL_TMP_DIR/dump.sql
+SET @@global.sql_mode= @old_sql_mode;
+drop table tb;
+RESET MASTER;
diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test
index 8c2f5e2c32b..aa9b1d5a77c 100644
--- a/mysql-test/t/mysql_client_test.test
+++ b/mysql-test/t/mysql_client_test.test
@@ -35,6 +35,10 @@ echo ok;
--echo # ------------------------------------
--cat_file $MYSQL_TMP_DIR/test_wl4435.out.log
--echo # ------------------------------------
+--echo # cat MYSQL_TMP_DIR/test_mdev26145.out.log
+--echo # ------------------------------------
+--cat_file $MYSQL_TMP_DIR/test_mdev26145.out.log
+--echo # ------------------------------------
--echo
SET @@global.general_log= @old_general_log;
diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test
index 12834b6177b..bc5d357a543 100644
--- a/mysql-test/t/mysqld--help.test
+++ b/mysql-test/t/mysqld--help.test
@@ -11,7 +11,7 @@
# force symbolic-links=0 (valgrind build has a different default)
#
-exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;
+exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --log-bin=foo --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;
# The inline perl code below will copy $MYSQL_TMP_DIR/mysqld--help.txt
# to output, but filter away some variable stuff (e.g. paths).
diff --git a/mysql-test/t/mysqldump-nl.test b/mysql-test/t/mysqldump-nl.test
index 863c846b9a6..4451b0605c2 100644
--- a/mysql-test/t/mysqldump-nl.test
+++ b/mysql-test/t/mysqldump-nl.test
@@ -26,10 +26,10 @@ create procedure sp() select * from `v1
flush tables;
use test;
-exec $MYSQL_DUMP --compact --comment --routines --add-drop-database --databases 'mysqltest1
+exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases 'mysqltest1
1tsetlqsym';
-exec $MYSQL_DUMP --compact --comment --routines --add-drop-database --databases 'mysqltest1
+exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases 'mysqltest1
1tsetlqsym' | $MYSQL;
show tables from `mysqltest1
@@ -45,11 +45,11 @@ create database `test\``
show databases like 'test%';
-exec $MYSQL_DUMP --compact --comment --add-drop-database --databases 'test`' 'test\`
+exec $MYSQL_DUMP --compact --comments --add-drop-database --databases 'test`' 'test\`
\! ls
#';
-exec $MYSQL_DUMP --compact --comment --add-drop-database --databases 'test`' 'test\`
+exec $MYSQL_DUMP --compact --comments --add-drop-database --databases 'test`' 'test\`
\! ls
#' | $MYSQL;
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 36c25ed37fb..4e50fc5b3c6 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -2293,4 +2293,20 @@ SET max_sort_length= @save_max_sort_length;
SET sql_select_limit= @save_sql_select_limit;
DROP TABLE t1;
+--echo #
+--echo # MDEV-25682: EXPLAIN for SELECT with ORDER BY after [ORDER BY] LIMIT
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+explain (select a from t1 limit 2) order by a desc;
+(select a from t1 limit 2) order by a desc;
+
+create table t2 (a int, b int);
+insert into t2 values (3,70), (7,10), (1,40), (4,30);
+explain (select b,a from t2 order by a limit 3) order by b desc;
+(select b,a from t2 order by a limit 3) order by b desc;
+
+drop table t1,t2;
+
--echo # End of 10.2 tests
diff --git a/mysql-test/t/order_by_innodb.test b/mysql-test/t/order_by_innodb.test
index f4c738263ae..97c043b8dbc 100644
--- a/mysql-test/t/order_by_innodb.test
+++ b/mysql-test/t/order_by_innodb.test
@@ -135,4 +135,55 @@ set optimizer_switch= @save_optimizer_switch;
DROP TABLE t1,t2,t3;
+--echo #
+--echo # MDEV-25858: Query results are incorrect when indexes are added
+--echo #
+
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY) engine=innodb;
+insert into t1 values (1),(2),(3);
+
+CREATE TABLE t2 (
+ id int NOT NULL PRIMARY KEY,
+ id2 int NOT NULL,
+ d1 datetime,
+ d2 timestamp NOT NULL,
+ KEY id2 (id2)
+) engine=innodb;
+
+insert into t2 values
+ (1,2,'2019-03-05 00:00:00','2019-03-06 00:00:00'),
+ (2,3,'2019-03-05 00:00:00','2019-03-06 00:00:00'),
+ (3,3,'2019-03-06 00:00:00','2019-03-05 00:00:00');
+
+select
+ t1.id,t2.id
+from
+ t1 left join
+ t2 on t2.id2 = t1.id and
+ t2.id = (select dd.id
+ from t2 dd
+ where
+ dd.id2 = t1.id and
+ d1 > '2019-02-06 00:00:00'
+ order by
+ dd.d1 desc, dd.d2 desc, dd.id desc limit 1
+ );
+
+create index for_latest_sort on t2 (d1 desc, d2 desc, id desc);
+
+select
+ t1.id,t2.id
+from
+ t1 left join
+ t2 on t2.id2 = t1.id and
+ t2.id = (select dd.id
+ from t2 dd
+ where
+ dd.id2 = t1.id and
+ d1 > '2019-02-06 00:00:00'
+ order by
+ dd.d1 desc, dd.d2 desc, dd.id desc limit 1
+ );
+drop table t1,t2;
+
--echo # End of 10.2 tests
diff --git a/mysql-test/t/parser_not_embedded.test b/mysql-test/t/parser_not_embedded.test
index 3ebd23e888e..3af1260f4ad 100644
--- a/mysql-test/t/parser_not_embedded.test
+++ b/mysql-test/t/parser_not_embedded.test
@@ -21,7 +21,7 @@ select 7 as expected, /*!01000 1 + /*!01000 8 + /*!01000 error */ 16 + */ 2 + */
select 4 as expected, /* 1 + /*!01000 8 + */ 2 + */ 4;
EOF
---exec $MYSQL --comment --force --table test <$MYSQLTEST_VARDIR/tmp/bug39559.sql
+--exec $MYSQL --comments --force --table test <$MYSQLTEST_VARDIR/tmp/bug39559.sql
--remove_file $MYSQLTEST_VARDIR/tmp/bug39559.sql
--echo # Bug#46527 "COMMIT AND CHAIN RELEASE does not make sense"
diff --git a/mysql-test/t/plugin_vars.test b/mysql-test/t/plugin_vars.test
index 8ba8fe2ec0e..797dcbea727 100644
--- a/mysql-test/t/plugin_vars.test
+++ b/mysql-test/t/plugin_vars.test
@@ -1,3 +1,10 @@
+if (!$QUERY_RESPONSE_TIME_SO) {
+ skip Needs query_response_time loadable plugin;
+}
+if (!$HA_ARCHIVE_SO) {
+ skip Needs Archive loadable plugin;
+}
+
--echo #
--echo # MDEV-5345 - Deadlock between mysql_change_user(), SHOW VARIABLES and
--echo # INSTALL PLUGIN
@@ -54,3 +61,31 @@ disconnect con2;
USE test;
DROP PROCEDURE p_install;
DROP PROCEDURE p_show_vars;
+
+--echo #
+--echo # Bug#29363867: LOST CONNECTION TO MYSQL SERVER DURING QUERY
+--echo #
+
+--echo ## prepared SET with a plugin variable prevents uninstall
+install plugin query_response_time soname 'query_response_time';
+prepare s from 'set global query_response_time_range_base=16';
+select plugin_status from information_schema.plugins where plugin_name='query_response_time';
+uninstall plugin query_response_time;
+execute s;
+execute s;
+select plugin_status from information_schema.plugins where plugin_name='query_response_time';
+deallocate prepare s;
+select plugin_status from information_schema.plugins where plugin_name='query_response_time';
+
+--echo ## prepared SET mentioning a plugin otherwise does not prevent uninstall
+install plugin archive soname 'ha_archive';
+create table t1 (a int) engine=archive;
+insert t1 values (1),(2),(3);
+prepare s from 'set session auto_increment_increment=(select count(*) from t1)';
+flush tables;
+select plugin_status from information_schema.plugins where plugin_name='archive';
+uninstall plugin archive;
+select plugin_status from information_schema.plugins where plugin_name='archive';
+--error ER_UNKNOWN_STORAGE_ENGINE
+execute s;
+drop table t1;
diff --git a/mysql-test/t/processlist_notembedded.test b/mysql-test/t/processlist_notembedded.test
index 26021040c39..35cac36bb95 100644
--- a/mysql-test/t/processlist_notembedded.test
+++ b/mysql-test/t/processlist_notembedded.test
@@ -1,4 +1,3 @@
-source include/have_debug.inc;
source include/have_debug_sync.inc;
source include/not_embedded.inc;
source include/count_sessions.inc;
@@ -7,7 +6,7 @@ source include/count_sessions.inc;
--echo # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
--echo #
-connect (con1,localhost,root,,);
+connect con1,localhost,root;
connection con1;
@@ -37,24 +36,26 @@ connection default;
SET DEBUG_SYNC = 'RESET';
-source include/wait_until_count_sessions.inc;
-
---echo End of 5.5 tests
+--echo #
+--echo # End of 5.5 tests
+--echo #
--echo #
--echo # MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep
--echo #
---connect (con1,localhost,root,,)
+--connect con1,localhost,root
--let $con_id = `SELECT CONNECTION_ID()`
---send select sleep(100000);
+--send select sleep(100000)
--connection default
+let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist where state='User sleep';
+source include/wait_condition.inc;
+evalp SHOW EXPLAIN FOR $con_id;
+evalp KILL QUERY $con_id;
+disconnect con1;
+source include/wait_until_count_sessions.inc;
---replace_result $con_id con_id
-eval SHOW EXPLAIN FOR $con_id;
-
---replace_result $con_id con_id
-eval KILL QUERY $con_id;
-
+--echo #
--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index a267c8b0e42..2e7b43ad748 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -4927,5 +4927,39 @@ DEALLOCATE PREPARE stmt;
DROP TABLE t1;
--echo #
+--echo # MDEV-25108: Running of the EXPLAIN EXTENDED statement produces extra warning
+--echo # in case it is executed in PS (prepared statement) mode
+--echo #
+CREATE TABLE t1 (c int);
+CREATE TABLE t2 (d int);
+
+--echo # EXPLAIN EXTENDED in regular way (not PS mode)
+EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1;
+SHOW WARNINGS;
+
+--echo # Now run the same EXPLAIN EXTENDED in PS mode. Number of warnings
+--echo # and their content must be the same as in case running the statement
+--echo # in regular way
+PREPARE stmt FROM "EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1";
+EXECUTE stmt;
+SHOW WARNINGS;
+
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-25576: The statement EXPLAIN running as regular statement and
+--echo # as prepared statement produces different results for
+--echo # UPDATE with subquery
+--echo #
+CREATE TABLE t1 (c1 INT KEY) ENGINE=MyISAM;
+CREATE TABLE t2 (c2 INT) ENGINE=MyISAM;
+CREATE TABLE t3 (c3 INT) ENGINE=MyISAM;
+EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 );
+PREPARE stmt FROM "EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 )";
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2, t3;
+
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/selectivity_innodb.test b/mysql-test/t/selectivity_innodb.test
index 6c457e2848b..057a36fcf62 100644
--- a/mysql-test/t/selectivity_innodb.test
+++ b/mysql-test/t/selectivity_innodb.test
@@ -174,6 +174,61 @@ drop view v1;
--echo # End of 10.1 tests
--echo #
+--echo #
+--echo # MDEV-17783: AddressSanitizer: stack-buffer-overflow in table_cond_selectivity
+--echo #
+
+set
+ @tmp_jcl=@@join_cache_level,
+ @tmp_sel=@@optimizer_use_condition_selectivity;
+set
+ join_cache_level=3,
+ optimizer_use_condition_selectivity=2;
+
+CREATE TABLE t1 (
+ c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int,
+ c11 int, c12 int, c13 int, c14 int, c15 int, c16 int, c17 int, c18 int, c19 int,
+ c20 int, c21 int, c22 int, c23 int, c24 int, c25 int, c26 int, c27 int, c28 int,
+ c29 int, c30 int, c31 int, c32 int, c33 int, c34 int
+) ENGINE=InnoDB;
+
+SELECT * FROM t1
+WHERE
+ (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10,
+ c11, c12, c13, c14, c15, c16, c17, c18, c19,
+ c20, c21, c22, c23, c24, c25, c26, c27, c28, c29,
+ c30, c31, c32, c33, c34) IN (SELECT * FROM t1) ;
+
+set
+ join_cache_level=@tmp_jcl,
+ optimizer_use_condition_selectivity=@tmp_sel;
+drop table t1;
+
+--echo #
+--echo # MDEV-25013: SIGSEGV in best_extension_by_limited_search | SIGSEGV in restore_prev_nj_state
+--echo #
+
+SET join_cache_level=3;
+CREATE TABLE t1 (
+ TEXT1 TEXT, TEXT2 TEXT, TEXT3 TEXT, TEXT4 TEXT, TEXT5 TEXT,
+ TEXT6 TEXT, TEXT7 TEXT, TEXT8 TEXT, TEXT9 TEXT, TEXT10 TEXT,
+ TEXT11 TEXT, TEXT12 TEXT,TEXT13 TEXT,TEXT14 TEXT,TEXT15 TEXT,
+ TEXT16 TEXT,TEXT17 TEXT,TEXT18 TEXT,TEXT19 TEXT,TEXT20 TEXT,
+ TEXT21 TEXT,TEXT22 TEXT,TEXT23 TEXT,TEXT24 TEXT,TEXT25 TEXT,
+ TEXT26 TEXT,TEXT27 TEXT,TEXT28 TEXT,TEXT29 TEXT,TEXT30 TEXT,
+ TEXT31 TEXT,TEXT32 TEXT,TEXT33 TEXT,TEXT34 TEXT,TEXT35 TEXT,
+ TEXT36 TEXT,TEXT37 TEXT,TEXT38 TEXT,TEXT39 TEXT,TEXT40 TEXT,
+ TEXT41 TEXT,TEXT42 TEXT,TEXT43 TEXT,TEXT44 TEXT,TEXT45 TEXT,
+ TEXT46 TEXT,TEXT47 TEXT,TEXT48 TEXT,TEXT49 TEXT,TEXT50 TEXT
+) ENGINE=InnoDB;
+EXPLAIN SELECT 1 FROM t1 NATURAL JOIN t1 AS t2;
+
+set join_cache_level=@tmp_jcl;
+drop table t1;
+--echo #
+--echo # End of 10.1 tests
+--echo #
+
set use_stat_tables= @tmp_ust;
set optimizer_use_condition_selectivity= @tmp_oucs;
set @@global.histogram_size=@save_histogram_size;
diff --git a/mysql-test/t/selectivity_no_engine.test b/mysql-test/t/selectivity_no_engine.test
index 345b7bd1e8a..b5f52dd167d 100644
--- a/mysql-test/t/selectivity_no_engine.test
+++ b/mysql-test/t/selectivity_no_engine.test
@@ -228,6 +228,27 @@ SELECT * FROM t1 WHERE t1.d = 0 AND t1.p = '1' AND t1.i != '-1' AND t1.n = 'some
set optimizer_use_condition_selectivity= @tmp_mdev8779;
DROP TABLE t1;
+--echo #
+--echo # MDEV-23937: SIGSEGV in looped best_extension_by_limited_search from greedy_search
+--echo # (Testcase only)
+--echo #
+set
+ @tmp_jcl= @@join_cache_level,
+ @tmp_ucs= @@optimizer_use_condition_selectivity;
+set
+ join_cache_level=3,
+ optimizer_use_condition_selectivity=2;
+
+CREATE TABLE t1 AS SELECT * FROM mysql.user;
+CREATE TABLE t3 (b VARCHAR (1));
+CREATE TABLE t2 (c2 INT);
+INSERT INTO t2 VALUES (1);
+
+EXPLAIN
+SELECT * FROM t1 AS a NATURAL JOIN t1 AS b;
+
+DROP TABLE t1,t2,t3;
+
--echo #
--echo # End of the test file
--echo #
diff --git a/mysql-test/t/show.test b/mysql-test/t/show.test
index 3101f443264..f2f6efc4e45 100644
--- a/mysql-test/t/show.test
+++ b/mysql-test/t/show.test
@@ -1,8 +1,8 @@
-#
-# MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
-# MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
-# MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
-#
+--echo #
+--echo # MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
+--echo # MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
+--echo # MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
+--echo #
--error ER_PARSE_ERROR
show statistics;
--error ER_PARSE_ERROR
@@ -13,3 +13,27 @@ show system_variables;
show geometry_columns;
--error ER_PARSE_ERROR
show nonexistent;
+
+--echo #
+--echo # MDEV-21603 Crashing SHOW TABLES with derived table in WHERE condition
+--echo #
+create table t1 (nm varchar(32), a int);
+insert t1 values ('1',1),('2',2),('3',3);
+
+show tables
+ where tables_in_test in (select *
+ from (select nm from test.t1 group by nm) dt);
+show fields from test.t1
+ where field in (select * from (select nm from test.t1 group by nm) dt);
+insert t1 values ('nm',0);
+show fields from test.t1
+ where field in (select * from (select nm from test.t1 group by nm) dt);
+
+show fields from test.t1 where field in
+ (select * from (select column_name from information_schema.columns
+ where table_name='t1' group by column_name) dt);
+drop table t1;
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/t/show_explain.opt b/mysql-test/t/show_explain.opt
new file mode 100644
index 00000000000..3a3bab51225
--- /dev/null
+++ b/mysql-test/t/show_explain.opt
@@ -0,0 +1 @@
+--enable-plugin-innodb-lock-waits --enable-plugin-innodb-trx
diff --git a/mysql-test/t/show_explain.test b/mysql-test/t/show_explain.test
index 2a87d24cf6d..542701bc42b 100644
--- a/mysql-test/t/show_explain.test
+++ b/mysql-test/t/show_explain.test
@@ -861,7 +861,14 @@ select * from t1 where pk between 10 and 20 for update;
# run SHOW EXPLAIN on a frozen thread
connection default;
let $save_wait_condition= $wait_condition;
-let $wait_condition= select State='Sending data' from information_schema.processlist where id=$thr2;
+let $wait_condition=
+select 1
+from information_schema.INNODB_LOCK_WAITS
+where
+ requesting_trx_id=(select trx_id
+ from information_schema.INNODB_TRX
+ where trx_mysql_thread_id=$thr2);
+
let $thr_default=`select connection_id()`;
--source include/wait_condition.inc
--echo # do: send_eval show explain for thr2;
diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test
index b0c5118f970..0ff19092b82 100644
--- a/mysql-test/t/skip_name_resolve.test
+++ b/mysql-test/t/skip_name_resolve.test
@@ -50,4 +50,28 @@ SET @@LOCAL.skip_name_resolve=0;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.skip_name_resolve=0;
---echo End of 5.1 tests
+--echo #
+--echo # End of 5.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-26081 set role crashes when a hostname cannot be resolved
+--echo #
+
+create user u1@`%`;
+create role r1;
+create role r2;
+grant r2 to r1;
+grant r1 to u1@`%`;
+
+connect u1,127.0.0.1,u1,,,$MASTER_MYPORT;
+error ER_INVALID_ROLE;
+set role r2;
+disconnect u1;
+connection default;
+drop user u1@`%`;
+drop role r1, r2;
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test
index 129a68204ba..0f19627c78c 100644
--- a/mysql-test/t/sp-code.test
+++ b/mysql-test/t/sp-code.test
@@ -735,3 +735,27 @@ DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507;
--echo #END OF BUG#11763507 test.
+
+
+--echo #
+--echo # MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
+--echo #
+
+SET NAMES utf8;
+SET SESSION character_set_connection=latin1;
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE a VARCHAR(10) CHARACTER SET utf8;
+ SET a='ä';
+ SELECT a, 'ä' AS b;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1;
+DROP PROCEDURE p1;
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index f13b3fbc281..40a1e873ab9 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -1,3 +1,4 @@
+--source include/have_partition.inc
#
# Basic stored PROCEDURE tests
#
@@ -10025,4 +10026,23 @@ DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
+
+--echo #
+--echo # BUG#30366310: USING A FUNCTION TO ASSIGN DEFAULT VALUES TO
+--echo # 2 OR MORE VARIABLES CRASHES SERVER
+--echo #
+
+delimiter |;
+create function f1() returns bigint return now()-1|
+create procedure p1()
+begin
+ declare b, c bigint default f1();
+ select b-c;
+end|
+call p1()|
+drop procedure p1|
+drop function f1|
+delimiter ;|
+
+
--echo #End of 10.2 tests
diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test
index f19a654de64..bd1e20cb5d6 100644
--- a/mysql-test/t/subselect4.test
+++ b/mysql-test/t/subselect4.test
@@ -2236,4 +2236,74 @@ SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-22462: Item_in_subselect::create_single_in_to_exists_cond(JOIN *, Item **, Item **): Assertion `false' failed.
+--echo #
+
+select 1 from dual where 1 in (select 5 from dual where 1);
+
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+
+update t1 set a = 2 where a in (select a from dual where a = a);
+drop table t1;
+
+--echo #
+--echo # MDEV-24925: Server crashes in Item_subselect::init_expr_cache_tracker
+--echo #
+CREATE TABLE t1 (id INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1),(2);
+
+SELECT
+ 1 IN (
+ SELECT
+ (SELECT COUNT(id)
+ FROM t1
+ WHERE t1_outer.id <> id
+ ) AS f
+ FROM
+ t1 AS t1_outer
+ GROUP BY f
+ );
+
+SELECT
+ 1 IN (
+ SELECT
+ (SELECT COUNT(id)
+ FROM t1
+ WHERE t1_outer.id <> id
+ ) AS f
+ FROM
+ t1 AS t1_outer
+ GROUP BY 1
+ );
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-24898: Server crashes in st_select_lex::next_select / Item_subselect::is_expensive
+--echo # (Testcase)
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2); # Optional, fails either way
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4); # Optional, fails either way
+
+--error ER_SUBQUERY_NO_1_ROW
+SELECT 1 IN (SELECT (SELECT a FROM t1) AS x FROM t2 GROUP BY x);
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-25629: Crash in get_sort_by_table() in subquery with order by having outer ref
+--echo #
+CREATE TABLE t1 (i1 int);
+insert into t1 values (1),(2);
+
+--error ER_SUBQUERY_NO_1_ROW
+SELECT 1
+FROM (t1 JOIN t1 AS ref_t1 ON
+ (t1.i1 > (SELECT ref_t1.i1 AS c0 FROM t1 b ORDER BY -c0)));
+
+DROP TABLE t1;
+
--echo # End of 10.2 tests
diff --git a/mysql-test/t/subselect_exists2in.test b/mysql-test/t/subselect_exists2in.test
index e27ce57038b..e70d643138b 100644
--- a/mysql-test/t/subselect_exists2in.test
+++ b/mysql-test/t/subselect_exists2in.test
@@ -941,5 +941,28 @@ WHERE (
drop table t1,t2,t3;
+--echo #
+--echo # MDEV-25407: EXISTS subquery with correlation in ON expression crashes
+--echo #
+create table t10(a int primary key);
+insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t11(a int primary key);
+insert into t11 select a.a + b.a* 10 + c.a * 100 from t10 a, t10 b, t10 c;
+
+create table t1 (a int, b int);
+insert into t1 select a,a from t10;
+
+create table t2 (a int, b int);
+insert into t2 select a,a from t11;
+
+create table t3 as select * from t2;
+
+
+explain select * from t1 where exists (select t2.a from t2 left join t3 on (t3.b=t1.b) where t2.a=t1.a);
+
+drop table t1, t2, t3, t10, t11;
+
+
#restore defaults
set optimizer_switch=default;
diff --git a/mysql-test/t/truncate.test b/mysql-test/t/truncate.test
index c7a066cc203..248f2fe5b61 100644
--- a/mysql-test/t/truncate.test
+++ b/mysql-test/t/truncate.test
@@ -1,9 +1,6 @@
#
# Test of truncate
#
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
create table t1 (a integer, b integer,c1 CHAR(10));
insert into t1 (a) values (1),(2);
@@ -161,5 +158,6 @@ HANDLER t1 READ FIRST;
# Cleanup
DROP TABLE t1;
---echo # End of 6.0 tests
-
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/truncate_notembedded.test b/mysql-test/t/truncate_notembedded.test
new file mode 100644
index 00000000000..3addad2d975
--- /dev/null
+++ b/mysql-test/t/truncate_notembedded.test
@@ -0,0 +1,31 @@
+--source include/not_embedded.inc
+
+--echo #
+--echo # MDEV-23365: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+--echo # is_bulk_op())' failed upon killed TRUNCATE
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+LOCK TABLE t1 READ;
+
+--connect (con1,localhost,root,,test)
+SET SESSION max_session_mem_used= 45500;
+--send
+ LOCK TABLE t1 WRITE;
+
+--connection default
+SELECT * FROM t1;
+UNLOCK TABLES;
+
+--connection con1
+--reap
+--error ER_OPTION_PREVENTS_STATEMENT
+TRUNCATE TABLE t1;
+
+--disconnect con1
+--connection default
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test
index 07c7f599db7..199c0737dd1 100644
--- a/mysql-test/t/udf.test
+++ b/mysql-test/t/udf.test
@@ -562,4 +562,14 @@ select * from mysql.plugin WHERE name='unexisting_udf';
--error ER_SP_DOES_NOT_EXIST
DROP FUNCTION unexisting_udf;
+--echo #
+--echo # Bug #31674599: THE UDF_INIT() FUNCTION CAUSE SERVER CRASH
+--echo #
+call mtr.add_suppression('Invalid row in mysql.func table');
+insert mysql.func () values ();
+source include/restart_mysqld.inc;
+delete from mysql.func where name = '';
+
+--echo #
--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 8cb00f7a6f4..e6e6ccce8bd 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -6560,5 +6560,73 @@ DROP TABLE t1;
DROP VIEW v1;
--echo #
+--echo # MDEV-24454: Crash at change_item_tree
+--echo #
+
+CREATE TABLE t1(f0 INT);
+
+CREATE VIEW v1 AS
+SELECT
+ f0 AS f1
+FROM t1;
+
+CREATE VIEW v2 AS
+SELECT
+ (SELECT GROUP_CONCAT(v1.f1 SEPARATOR ', ')
+ FROM v1 n) AS f2,
+ GROUP_CONCAT('' SEPARATOR ', ') AS f3
+FROM v1;
+
+CREATE VIEW v3 AS
+SELECT 1 as f4 FROM v2;
+
+CREATE PROCEDURE p1()
+ SELECT * FROM v3;
+
+CALL p1();
+CALL p1();
+
+drop procedure p1;
+drop view v1,v2,v3;
+drop table t1;
+
+--echo #
+--echo # MDEV-25631: Crash in st_select_lex::mark_as_dependent with
+--echo # VIEW, aggregate and subquery
+--echo #
+
+CREATE TABLE t1 (i1 int);
+insert into t1 values (1),(2),(3); #not important
+CREATE VIEW v1 AS
+ SELECT t1.i1 FROM (t1 a JOIN t1 ON (t1.i1 = (SELECT t1.i1 FROM t1 b)));
+
+--error ER_SUBQUERY_NO_1_ROW
+SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ;
+delete from t1 where i1 > 1;
+SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ;
+
+drop view v1;
+drop table t1;
+
+
+--echo #
+--echo # MDEV-26299: Some views force server (and mysqldump) to generate
+--echo # invalid SQL for their definitions
+--echo #
+
+create view v1 as
+ select * from
+ (select
+ "12345678901234567890123456789012345678901234567890123456789012345") as t1;
+
+let $definition=`select VIEW_DEFINITION from information_schema.views where TABLE_NAME="v1"`;
+
+drop view v1;
+
+eval CREATE VIEW v1 AS $definition;
+
+drop view v1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test
index 57214ab0165..72e789dff3f 100644
--- a/mysql-test/t/win.test
+++ b/mysql-test/t/win.test
@@ -2543,5 +2543,166 @@ order by rn desc;
drop table t1;
--echo #
+--echo # MDEV-25630: Crash with window function in left expr of IN subquery
+--echo #
+
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT lag(i) over (ORDER BY i) IN ( SELECT 1 FROM t1 a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT sum(i) over () IN ( SELECT 1 FROM t1 a) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-25565: 2-nd call of SP with SELECT from view / derived table / CTE
+--echo # returning the result of calculation of 2 window
+--echo # functions that use the same window specification
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (7), (1), (1), (3), (1), (5);
+
+create view v2 as select a from t1 group by a;
+create view v1 as select * from v2;
+
+let $q1=
+select v1.a,
+ sum(v1.a) over (partition by v1.a order by v1.a) as k,
+ avg(v1.a) over (partition by v1.a order by v1.a) as m
+from v1;
+
+eval create procedure sp1() $q1;
+call sp1();
+call sp1();
+
+eval prepare stmt from "$q1";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+let $q2=
+select * from
+ ( select dt1.a,
+ sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+ avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+ from (select * from v2) as dt1
+ ) as dt;
+
+eval create procedure sp2() $q2;
+call sp2();
+call sp2();
+
+eval prepare stmt from "$q2";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+let $q3=
+select * from
+ ( select dt1.a,
+ sum(dt1.a) over (partition by dt1.a order by dt1.a) as k,
+ avg(dt1.a) over (partition by dt1.a order by dt1.a) as m
+ from ( select * from (select * from t1 group by a) as dt2 ) as dt1
+ ) as dt;
+
+eval create procedure sp3() $q3;
+call sp3();
+call sp3();
+
+eval prepare stmt from "$q3";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+let $q4=
+with cte1 as (select * from (select * from t1 group by a) as dt2),
+ cte as
+ ( select cte1.a,
+ sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+ avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+ from cte1 )
+select * from cte;
+
+eval create procedure sp4() $q4;
+call sp4();
+call sp4();
+
+eval prepare stmt from "$q4";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+let $q5=
+with cte1 as (select * from v2),
+ cte as
+ ( select cte1.a,
+ sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+ avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+ from cte1 )
+select * from cte;
+
+eval create procedure sp5() $q5;
+call sp5();
+call sp5();
+
+eval prepare stmt from "$q5";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+let $q6=
+with
+cte1 as (with cte2 as (select * from t1 group by a) select * from cte2),
+ cte as
+ ( select cte1.a,
+ sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+ avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+ from cte1 )
+select * from cte;
+
+eval create procedure sp6() $q6;
+call sp6();
+call sp6();
+
+eval prepare stmt from "$q6";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+let $q7=
+with
+ cte2 as (select * from v1),
+ cte1 as (select * from cte2),
+ cte as
+ ( select cte1.a,
+ sum(cte1.a) over (partition by cte1.a order by cte1.a) as k,
+ avg(cte1.a) over (partition by cte1.a order by cte1.a) as m
+ from cte1 )
+select * from cte;
+
+eval create procedure sp7() $q7;
+call sp7();
+call sp7();
+
+eval prepare stmt from "$q7";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop procedure sp4;
+drop procedure sp5;
+drop procedure sp6;
+drop procedure sp7;
+drop view v1,v2;
+drop table t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test
index ecce563b8c8..176b8c3189b 100644
--- a/mysql-test/t/xa.test
+++ b/mysql-test/t/xa.test
@@ -470,3 +470,38 @@ DROP TABLE t1;
connection default;
--source include/wait_until_count_sessions.inc
+
+--echo #
+--echo # XA states and SHOW commands
+--echo #
+create table t1 (pk int primary key) engine=innodb;
+xa start 'foo';
+insert t1 set pk=1;
+xa end 'foo';
+xa prepare 'foo';
+show status like 'foo';
+--query_vertical select table_name,table_comment from information_schema.tables where table_schema='test'
+--query_vertical select table_name,table_rows,table_comment from information_schema.tables where table_schema='test'
+xa commit 'foo';
+drop table t1;
+
+--echo #
+--echo # MDEV-22445 Crash on HANDLER READ NEXT after XA PREPARE
+--echo #
+
+CREATE TABLE t (a INT KEY) ENGINE=InnoDB;
+HANDLER t OPEN AS t;
+XA START '0';
+SELECT * FROM t;
+XA END '0';
+XA PREPARE '0';
+--error ER_XAER_RMFAIL
+HANDLER t READ NEXT;
+
+--echo # Cleanup
+XA COMMIT '0';
+DROP TABLE t;
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests
index 286c99cba14..7307a5ad3c9 100644
--- a/mysql-test/unstable-tests
+++ b/mysql-test/unstable-tests
@@ -77,7 +77,6 @@ main.lock_tables_lost_commit : MDEV-24624 - Timeout
main.lock_view : Modified in 10.2.37
main.log_slow : MDEV-13263 - Wrong result
main.log_tables-big : MDEV-13408 - wrong result
-main.mdev-504 : MDEV-15171 - warning
main.mdev375 : MDEV-10607 - sporadic "can't connect"
main.merge : MDEV-10607 - sporadic "can't connect"
main.myisam : Modified in 10.2.37
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index e09c7f930c8..0b19aaf9015 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -1384,7 +1384,7 @@ static void copy_to_read_buffer(IO_CACHE *write_cache,
static int _my_b_seq_read(IO_CACHE *info, uchar *Buffer, size_t Count)
{
- size_t length, diff_length, left_length= 0, save_count, max_length;
+ size_t length, diff_length, save_count, max_length;
my_off_t pos_in_file;
save_count=Count;
@@ -1435,7 +1435,6 @@ static int _my_b_seq_read(IO_CACHE *info, uchar *Buffer, size_t Count)
*/
goto read_append_buffer;
}
- left_length+=length;
diff_length=0;
}
@@ -1603,7 +1602,7 @@ int _my_b_async_read(IO_CACHE *info, uchar *Buffer, size_t Count)
Buffer+=length;
Count-=length;
left_length+=length;
- info->read_end=info->rc_pos+read_length;
+ info->read_end=info->read_pos+read_length;
info->read_pos+=length;
}
else
diff --git a/mysys/mf_qsort.c b/mysys/mf_qsort.c
index 3f91bb35354..b516639a341 100644
--- a/mysys/mf_qsort.c
+++ b/mysys/mf_qsort.c
@@ -114,7 +114,7 @@ qsort_t my_qsort(void *base_ptr, size_t count, size_t size, qsort_cmp cmp)
stack[0].low=stack[0].high=0;
#endif
pivot = (char *) my_alloca((int) size);
- ptr_cmp= size == sizeof(char*) && !((low - (char*) 0)& (sizeof(char*)-1));
+ ptr_cmp= size == sizeof(char*) && (intptr_t)low % sizeof(char*) == 0;
/* The following loop sorts elements between high and low */
do
diff --git a/mysys/my_context.c b/mysys/my_context.c
index cf10738bdbd..f3aef23e07a 100644
--- a/mysys/my_context.c
+++ b/mysys/my_context.c
@@ -29,6 +29,10 @@
#endif
#ifdef MY_CONTEXT_USE_UCONTEXT
+#ifdef __APPLE__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
/*
The makecontext() only allows to pass integers into the created context :-(
We want to pass pointers, so we do it this kinda hackish way.
@@ -154,6 +158,9 @@ my_context_destroy(struct my_context *c)
DBUG_FREE_CODE_STATE(&c->dbug_state);
}
+#ifdef __APPLE__
+#pragma GCC diagnostic pop
+#endif
#endif /* MY_CONTEXT_USE_UCONTEXT */
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index 4201c252715..6cdecef22f1 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -58,6 +58,7 @@ int my_delete(const char *name, myf MyFlags)
#if defined (_WIN32)
+
/*
Delete file.
@@ -65,15 +66,14 @@ int my_delete(const char *name, myf MyFlags)
where another program (or thread in the current program) has the the same file
open.
- We're using 2 tricks to prevent the errors.
+ We're using several tricks to prevent the errors, such as
+
+ - Windows 10 "posix semantics" delete
- 1. A usual Win32's DeleteFile() can with ERROR_SHARED_VIOLATION,
- because the file is opened in another application (often, antivirus or backup)
-
- We avoid the error by using CreateFile() with FILE_FLAG_DELETE_ON_CLOSE, instead
+ - Avoid the error by using CreateFile() with FILE_FLAG_DELETE_ON_CLOSE, instead
of DeleteFile()
- 2. If file which is deleted (delete on close) but has not entirely gone,
+ - If file which is deleted (delete on close) but has not entirely gone,
because it is still opened by some app, an attempt to trcreate file with the
same name would result in yet another error. The workaround here is renaming
a file to unique name.
@@ -116,6 +116,27 @@ static int my_win_unlink(const char *name)
DBUG_RETURN(0);
}
+ /*
+ Try Windows 10 method, delete with "posix semantics" (file is not visible, and creating
+ a file with the same name won't fail, even if it the fiile was open)
+ */
+ struct
+ {
+ DWORD _Flags;
+ } disp={0x3};
+ /* 0x3 = FILE_DISPOSITION_FLAG_DELETE | FILE_DISPOSITION_FLAG_POSIX_SEMANTICS */
+
+ handle= CreateFile(name, DELETE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL, OPEN_EXISTING, 0, NULL);
+ if (handle != INVALID_HANDLE_VALUE)
+ {
+ BOOL ok= SetFileInformationByHandle(handle,
+ (FILE_INFO_BY_HANDLE_CLASS) 21, &disp, sizeof(disp));
+ CloseHandle(handle);
+ if (ok)
+ DBUG_RETURN(0);
+ }
+
handle= CreateFile(name, DELETE, 0, NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, NULL);
if (handle != INVALID_HANDLE_VALUE)
{
diff --git a/mysys/psi_noop.c b/mysys/psi_noop.c
index 1cf544be0e1..b20aae84849 100644
--- a/mysys/psi_noop.c
+++ b/mysys/psi_noop.c
@@ -86,7 +86,7 @@ static void register_socket_noop(const char *category NNN,
}
static PSI_mutex*
-init_mutex_noop(PSI_mutex_key key NNN, const void *identity NNN)
+init_mutex_noop(PSI_mutex_key key NNN, void *identity NNN)
{
return NULL;
}
@@ -97,7 +97,7 @@ static void destroy_mutex_noop(PSI_mutex* mutex NNN)
}
static PSI_rwlock*
-init_rwlock_noop(PSI_rwlock_key key NNN, const void *identity NNN)
+init_rwlock_noop(PSI_rwlock_key key NNN, void *identity NNN)
{
return NULL;
}
@@ -108,7 +108,7 @@ static void destroy_rwlock_noop(PSI_rwlock* rwlock NNN)
}
static PSI_cond*
-init_cond_noop(PSI_cond_key key NNN, const void *identity NNN)
+init_cond_noop(PSI_cond_key key NNN, void *identity NNN)
{
return NULL;
}
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index 47ba8a0d920..58d4a13e9a6 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -352,9 +352,9 @@ static int sf_sanity()
if (count || irem)
{
warn("Error: Safemalloc link list destroyed");
- return 1;
+ flag= 1;
}
- return 0;
+ return flag;
}
/**
diff --git a/pcre/AUTHORS b/pcre/AUTHORS
index bb8b32835bd..b3398bbc477 100644
--- a/pcre/AUTHORS
+++ b/pcre/AUTHORS
@@ -2,13 +2,13 @@ THE MAIN PCRE LIBRARY
---------------------
Written by: Philip Hazel
-Email local part: ph10
-Email domain: cam.ac.uk
+Email local part: Philip.Hazel
+Email domain: gmail.com
University of Cambridge Computing Service,
Cambridge, England.
-Copyright (c) 1997-2020 University of Cambridge
+Copyright (c) 1997-2021 University of Cambridge
All rights reserved
@@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2010-2020 Zoltan Herczeg
+Copyright(c) 2010-2021 Zoltan Herczeg
All rights reserved.
@@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2009-2020 Zoltan Herczeg
+Copyright(c) 2009-2021 Zoltan Herczeg
All rights reserved.
diff --git a/pcre/CMakeLists.txt b/pcre/CMakeLists.txt
index 80e402e5713..807a8178a0f 100644
--- a/pcre/CMakeLists.txt
+++ b/pcre/CMakeLists.txt
@@ -67,10 +67,17 @@
# 2013-11-05 PH added support for PARENS_NEST_LIMIT
# 2016-03-01 PH applied Chris Wilson's patch for MSVC static build
# 2016-06-24 PH applied Chris Wilson's revised patch (adds a separate option)
+# 2021-06-14 PH changed CMAKE_MODULE_PATH definition to add, not replace
+# 2021-06-14 PH applied Wolfgang Stöggl's patch for generating pcre-config and
+# libpcre*.pc files (Bugzilla #2583)
PROJECT(PCRE C CXX)
-SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
+# For FindReadline.cmake. This was changed to allow setting CMAKE_MODULE_PATH
+# on the command line.
+# SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
+
+LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# Enable Unicode properties
OPTION(PCRE_SUPPORT_UNICODE_PROPERTIES "Unicode properties" ON)
@@ -83,6 +90,7 @@ INCLUDE(CheckIncludeFile)
INCLUDE(CheckIncludeFileCXX)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize)
+INCLUDE(GNUInstallDirs) # for CMAKE_INSTALL_LIBDIR
CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
@@ -255,7 +263,7 @@ foreach(configure_line ${configure_lines})
foreach(_substitution_variable ${SEARCHED_VARIABLES})
string(TOUPPER ${_substitution_variable} _substitution_variable_upper)
if (NOT ${_substitution_variable_upper})
- string(REGEX MATCH "m4_define\\(${_substitution_variable}, \\[(.*)\\]" MACTHED_STRING ${configure_line})
+ string(REGEX MATCH "m4_define\\(${_substitution_variable}, \\[(.*)\\]" MATCHED_STRING ${configure_line})
if (CMAKE_MATCH_1)
set(${_substitution_variable_upper} ${CMAKE_MATCH_1})
endif()
@@ -469,7 +477,6 @@ MARK_AS_ADVANCED(PCRE_POSIX_MALLOC_THRESHOLD)
MARK_AS_ADVANCED(PCRE_SUPPORT_BSR_ANYCRLF)
MARK_AS_ADVANCED(PCRE_SUPPORT_UNICODE_PROPERTIES)
-
IF(PCRE_SHOW_REPORT)
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype)
IF (CMAKE_C_FLAGS)
@@ -480,7 +487,7 @@ IF(PCRE_SHOW_REPORT)
ENDIF(CMAKE_CXX_FLAGS)
MESSAGE(STATUS "")
MESSAGE(STATUS "")
- MESSAGE(STATUS "PCRE configuration summary:")
+ MESSAGE(STATUS "PCRE-${PCRE_MAJOR}.${PCRE_MINOR} configuration summary:")
MESSAGE(STATUS "")
# MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}")
diff --git a/pcre/ChangeLog b/pcre/ChangeLog
index 04d1ef5b2c4..86acd7be68c 100644
--- a/pcre/ChangeLog
+++ b/pcre/ChangeLog
@@ -1,8 +1,25 @@
ChangeLog for PCRE
------------------
-Note that the PCRE 8.xx series (PCRE1) is now in a bugfix-only state. All
-development is happening in the PCRE2 10.xx series.
+Note that the PCRE 8.xx series (PCRE1) is now at end of life. All development
+is happening in the PCRE2 10.xx series.
+
+
+Version 8.45 15-June-2021
+-------------------------
+
+This is the final release of PCRE1. A few minor tidies are included.
+
+1. CMakeLists.txt has two user-supplied patches applied, one to allow for the
+setting of MODULE_PATH, and the other to support the generation of pcre-config
+file and libpcre*.pc files.
+
+2. There was a memory leak if a compile error occurred when there were more
+than 20 named groups (Bugzilla #2613).
+
+3. Fixed some typos in code and documentation.
+
+4. Fixed a small (*MARK) bug in the interpreter (Bugzilla #2771).
Version 8.44 12 February-2020
diff --git a/pcre/LICENCE b/pcre/LICENCE
index 57a544814c8..803b4119e50 100644
--- a/pcre/LICENCE
+++ b/pcre/LICENCE
@@ -19,13 +19,13 @@ THE BASIC LIBRARY FUNCTIONS
---------------------------
Written by: Philip Hazel
-Email local part: ph10
-Email domain: cam.ac.uk
+Email local part: Philip.Hazel
+Email domain: gmail.com
University of Cambridge Computing Service,
Cambridge, England.
-Copyright (c) 1997-2020 University of Cambridge
+Copyright (c) 1997-2021 University of Cambridge
All rights reserved.
@@ -36,7 +36,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Email domain: freemail.hu
-Copyright(c) 2010-2020 Zoltan Herczeg
+Copyright(c) 2010-2021 Zoltan Herczeg
All rights reserved.
@@ -47,7 +47,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Email domain: freemail.hu
-Copyright(c) 2009-2020 Zoltan Herczeg
+Copyright(c) 2009-2021 Zoltan Herczeg
All rights reserved.
diff --git a/pcre/NEWS b/pcre/NEWS
index 3d91b67dfa9..bec4d4b3d39 100644
--- a/pcre/NEWS
+++ b/pcre/NEWS
@@ -1,8 +1,14 @@
News about PCRE releases
------------------------
-Note that this library (now called PCRE1) is now being maintained for bug fixes
-only. New projects are advised to use the new PCRE2 libraries.
+Note that this library (now called PCRE1) is no longer being maintained. New
+projects are advised to use the PCRE2 libraries.
+
+
+Release 8.45 15-June-2021
+-----------------------------
+
+This is the final PCRE1 release. A very few small issues have been fixed.
Release 8.44 12-February-2020
diff --git a/pcre/NON-AUTOTOOLS-BUILD b/pcre/NON-AUTOTOOLS-BUILD
index 37f6164475b..23c4e64f84a 100644
--- a/pcre/NON-AUTOTOOLS-BUILD
+++ b/pcre/NON-AUTOTOOLS-BUILD
@@ -5,8 +5,8 @@ NOTE: This document relates to PCRE releases that use the original API, with
library names libpcre, libpcre16, and libpcre32. January 2015 saw the first
release of a new API, known as PCRE2, with release numbers starting at 10.00
and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old libraries
-(now called PCRE1) are still being maintained for bug fixes, but there will be
-no new development. New projects are advised to use the new PCRE2 libraries.
+(now called PCRE1) are now at end of life, and 8.45 is the final release. New
+projects are advised to use the new PCRE2 libraries.
This document contains the following sections:
@@ -768,6 +768,6 @@ Everything, source and executable, is in EBCDIC and native z/OS file formats.
However, this software is not maintained and will not be upgraded. If you are
new to PCRE you should be looking at PCRE2 (version 10.30 or later).
-===============================
-Last Updated: 13 September 2017
-===============================
+==========================
+Last Updated: 15 June 2021
+==========================
diff --git a/pcre/README b/pcre/README
index 334362b3e53..65f5e19ef69 100644
--- a/pcre/README
+++ b/pcre/README
@@ -5,9 +5,8 @@ NOTE: This set of files relates to PCRE releases that use the original API,
with library names libpcre, libpcre16, and libpcre32. January 2015 saw the
first release of a new API, known as PCRE2, with release numbers starting at
10.00 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old
-libraries (now called PCRE1) are still being maintained for bug fixes, but
-there will be no new development. New projects are advised to use the new PCRE2
-libraries.
+libraries (now called PCRE1) are now at end of life, and 8.45 is the final
+release. New projects are advised to use the new PCRE2 libraries.
The latest release of PCRE1 is always available in three alternative formats
@@ -998,6 +997,6 @@ pcre_xxx, one with the name pcre16_xx, and a third with the name pcre32_xxx.
RunTest.bat a script for running tests under Windows
Philip Hazel
-Email local part: ph10
-Email domain: cam.ac.uk
-Last updated: 12 February 2020
+Email local part: Philip.Hazel
+Email domain: gmail.com
+Last updated: 15 June 2021
diff --git a/pcre/configure.ac b/pcre/configure.ac
index 6a3e5f35d8e..4d2e2f37747 100644
--- a/pcre/configure.ac
+++ b/pcre/configure.ac
@@ -9,17 +9,17 @@ dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might
dnl be defined as -RC2, for example. For real releases, it should be empty.
m4_define(pcre_major, [8])
-m4_define(pcre_minor, [44])
+m4_define(pcre_minor, [45])
m4_define(pcre_prerelease, [])
-m4_define(pcre_date, [2020-02-12])
+m4_define(pcre_date, [2021-06-15])
# NOTE: The CMakeLists.txt file searches for the above variables in the first
# 50 lines of this file. Please update that if the variables above are moved.
# Libtool shared library interface versions (current:revision:age)
-m4_define(libpcre_version, [3:12:2])
-m4_define(libpcre16_version, [2:12:2])
-m4_define(libpcre32_version, [0:12:0])
+m4_define(libpcre_version, [3:13:2])
+m4_define(libpcre16_version, [2:13:2])
+m4_define(libpcre32_version, [0:13:0])
m4_define(libpcreposix_version, [0:7:0])
m4_define(libpcrecpp_version, [0:2:0])
diff --git a/pcre/doc/html/NON-AUTOTOOLS-BUILD.txt b/pcre/doc/html/NON-AUTOTOOLS-BUILD.txt
index 37f6164475b..23c4e64f84a 100644
--- a/pcre/doc/html/NON-AUTOTOOLS-BUILD.txt
+++ b/pcre/doc/html/NON-AUTOTOOLS-BUILD.txt
@@ -5,8 +5,8 @@ NOTE: This document relates to PCRE releases that use the original API, with
library names libpcre, libpcre16, and libpcre32. January 2015 saw the first
release of a new API, known as PCRE2, with release numbers starting at 10.00
and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old libraries
-(now called PCRE1) are still being maintained for bug fixes, but there will be
-no new development. New projects are advised to use the new PCRE2 libraries.
+(now called PCRE1) are now at end of life, and 8.45 is the final release. New
+projects are advised to use the new PCRE2 libraries.
This document contains the following sections:
@@ -768,6 +768,6 @@ Everything, source and executable, is in EBCDIC and native z/OS file formats.
However, this software is not maintained and will not be upgraded. If you are
new to PCRE you should be looking at PCRE2 (version 10.30 or later).
-===============================
-Last Updated: 13 September 2017
-===============================
+==========================
+Last Updated: 15 June 2021
+==========================
diff --git a/pcre/doc/html/README.txt b/pcre/doc/html/README.txt
index 334362b3e53..65f5e19ef69 100644
--- a/pcre/doc/html/README.txt
+++ b/pcre/doc/html/README.txt
@@ -5,9 +5,8 @@ NOTE: This set of files relates to PCRE releases that use the original API,
with library names libpcre, libpcre16, and libpcre32. January 2015 saw the
first release of a new API, known as PCRE2, with release numbers starting at
10.00 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old
-libraries (now called PCRE1) are still being maintained for bug fixes, but
-there will be no new development. New projects are advised to use the new PCRE2
-libraries.
+libraries (now called PCRE1) are now at end of life, and 8.45 is the final
+release. New projects are advised to use the new PCRE2 libraries.
The latest release of PCRE1 is always available in three alternative formats
@@ -998,6 +997,6 @@ pcre_xxx, one with the name pcre16_xx, and a third with the name pcre32_xxx.
RunTest.bat a script for running tests under Windows
Philip Hazel
-Email local part: ph10
-Email domain: cam.ac.uk
-Last updated: 12 February 2020
+Email local part: Philip.Hazel
+Email domain: gmail.com
+Last updated: 15 June 2021
diff --git a/pcre/doc/html/pcre.html b/pcre/doc/html/pcre.html
index 0db75e44892..31391f5c00a 100644
--- a/pcre/doc/html/pcre.html
+++ b/pcre/doc/html/pcre.html
@@ -22,13 +22,12 @@ man page, in case the conversion went wrong.
</ul>
<br><a name="SEC1" href="#TOC1">PLEASE TAKE NOTE</a><br>
<P>
-This document relates to PCRE releases that use the original API,
-with library names libpcre, libpcre16, and libpcre32. January 2015 saw the
-first release of a new API, known as PCRE2, with release numbers starting at
-10.00 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old
-libraries (now called PCRE1) are still being maintained for bug fixes, but
-there will be no new development. New projects are advised to use the new PCRE2
-libraries.
+This document relates to PCRE releases that use the original API, with library
+names libpcre, libpcre16, and libpcre32. January 2015 saw the first release of
+a new API, known as PCRE2, with release numbers starting at 10.00 and library
+names libpcre2-8, libpcre2-16, and libpcre2-32. The old libraries (now called
+PCRE1) are now at end of life, and 8.45 is the final release. New projects are
+advised to use the new PCRE2 libraries.
</P>
<br><a name="SEC2" href="#TOC1">INTRODUCTION</a><br>
<P>
@@ -215,9 +214,9 @@ two digits 10, at the domain cam.ac.uk.
</P>
<br><a name="SEC6" href="#TOC1">REVISION</a><br>
<P>
-Last updated: 10 February 2015
+Last updated: 14 June 2021
<br>
-Copyright &copy; 1997-2015 University of Cambridge.
+Copyright &copy; 1997-2021 University of Cambridge.
<br>
<p>
Return to the <a href="index.html">PCRE index page</a>.
diff --git a/pcre/doc/html/pcreapi.html b/pcre/doc/html/pcreapi.html
index 2fdfbff5ccf..2a0491f0f82 100644
--- a/pcre/doc/html/pcreapi.html
+++ b/pcre/doc/html/pcreapi.html
@@ -1718,7 +1718,7 @@ very long time, and so the <i>match_limit</i> value is also used in this case
<P>
The default value for the limit can be set when PCRE is built; the default
default is 10 million, which handles all but the most extreme cases. You can
-override the default by suppling <b>pcre_exec()</b> with a <b>pcre_extra</b>
+override the default by supplying <b>pcre_exec()</b> with a <b>pcre_extra</b>
block in which <i>match_limit</i> is set, and PCRE_EXTRA_MATCH_LIMIT is set in
the <i>flags</i> field. If the limit is exceeded, <b>pcre_exec()</b> returns
PCRE_ERROR_MATCHLIMIT.
@@ -1749,7 +1749,7 @@ and is ignored, when matching is done using JIT compiled code.
<P>
The default value for <i>match_limit_recursion</i> can be set when PCRE is
built; the default default is the same value as the default for
-<i>match_limit</i>. You can override the default by suppling <b>pcre_exec()</b>
+<i>match_limit</i>. You can override the default by supplying <b>pcre_exec()</b>
with a <b>pcre_extra</b> block in which <i>match_limit_recursion</i> is set, and
PCRE_EXTRA_MATCH_LIMIT_RECURSION is set in the <i>flags</i> field. If the limit
is exceeded, <b>pcre_exec()</b> returns PCRE_ERROR_RECURSIONLIMIT.
@@ -2063,10 +2063,10 @@ lookbehind. For example, consider the pattern
</pre>
which finds occurrences of "iss" in the middle of words. (\B matches only if
the current position in the subject is not a word boundary.) When applied to
-the string "Mississipi" the first call to <b>pcre_exec()</b> finds the first
+the string "Mississippi" the first call to <b>pcre_exec()</b> finds the first
occurrence. If <b>pcre_exec()</b> is called again with just the remainder of the
-subject, namely "issipi", it does not match, because \B is always false at the
-start of the subject, which is deemed to be a word boundary. However, if
+subject, namely "issippi", it does not match, because \B is always false at
+the start of the subject, which is deemed to be a word boundary. However, if
<b>pcre_exec()</b> is passed the entire string again, but with <i>startoffset</i>
set to 4, it finds the second occurrence of "iss" because it is able to look
behind the starting point to discover that it is preceded by a letter.
diff --git a/pcre/doc/html/pcredemo.html b/pcre/doc/html/pcredemo.html
index 894a9308261..d84c5c8c99c 100644
--- a/pcre/doc/html/pcredemo.html
+++ b/pcre/doc/html/pcredemo.html
@@ -161,7 +161,7 @@ if (rc &lt; 0)
return 1;
}
-/* Match succeded */
+/* Match succeeded */
printf("\nMatch succeeded at offset %d\n", ovector[0]);
@@ -379,7 +379,7 @@ for (;;)
return 1;
}
- /* Match succeded */
+ /* Match succeeded */
printf("\nMatch succeeded again at offset %d\n", ovector[0]);
diff --git a/pcre/doc/html/pcrejit.html b/pcre/doc/html/pcrejit.html
index abb342522f9..c1e0310defc 100644
--- a/pcre/doc/html/pcrejit.html
+++ b/pcre/doc/html/pcrejit.html
@@ -299,7 +299,7 @@ recommended.
This is a suggestion for how a multithreaded program that needs to set up
non-default JIT stacks might operate:
<pre>
- During thread initalization
+ During thread initialization
thread_local_var = pcre_jit_stack_alloc(...)
During thread exit
diff --git a/pcre/doc/html/pcrepattern.html b/pcre/doc/html/pcrepattern.html
index 96fc72986f6..2e3e6263e49 100644
--- a/pcre/doc/html/pcrepattern.html
+++ b/pcre/doc/html/pcrepattern.html
@@ -655,7 +655,7 @@ recognized.
<P>
It is possible to restrict \R to match only CR, LF, or CRLF (instead of the
complete set of Unicode line endings) by setting the option PCRE_BSR_ANYCRLF
-either at compile time or when the pattern is matched. (BSR is an abbrevation
+either at compile time or when the pattern is matched. (BSR is an abbreviation
for "backslash R".) This can be made the default when PCRE is built; if this is
the case, the other behaviour can be requested via the PCRE_BSR_UNICODE option.
It is also possible to specify these settings by starting a pattern string with
@@ -972,7 +972,7 @@ additional characters according to the following rules for ending a cluster:
3. Do not break Hangul (a Korean script) syllable sequences. Hangul characters
are of five types: L, V, T, LV, and LVT. An L character may be followed by an
L, V, LV, or LVT character; an LV or V character may be followed by a V or T
-character; an LVT or T character may be follwed only by a T character.
+character; an LVT or T character may be followed only by a T character.
</P>
<P>
4. Do not end before extending characters or spacing marks. Characters with
@@ -3080,7 +3080,7 @@ successful match. Consider:
</pre>
If the subject is "aaaac...", after the first match attempt fails (starting at
the first character in the string), the starting point skips on to start the
-next attempt at "c". Note that a possessive quantifer does not have the same
+next attempt at "c". Note that a possessive quantifier does not have the same
effect as this example; although it would suppress backtracking during the
first match attempt, the second attempt would start at the second character
instead of skipping on to "c".
diff --git a/pcre/doc/html/pcresyntax.html b/pcre/doc/html/pcresyntax.html
index 5896b9e0688..2946ab32872 100644
--- a/pcre/doc/html/pcresyntax.html
+++ b/pcre/doc/html/pcresyntax.html
@@ -157,7 +157,7 @@ is changed to use Unicode properties and they match many more characters.
Xan Alphanumeric: union of properties L and N
Xps POSIX space: property Z or tab, NL, VT, FF, CR
Xsp Perl space: property Z or tab, NL, VT, FF, CR
- Xuc Univerally-named character: one that can be
+ Xuc Universally-named character: one that can be
represented by a Universal Character Name
Xwd Perl word: property Xan or underscore
</pre>
diff --git a/pcre/doc/pcre.3 b/pcre/doc/pcre.3
index 716d58044c7..afd0830fab9 100644
--- a/pcre/doc/pcre.3
+++ b/pcre/doc/pcre.3
@@ -1,16 +1,15 @@
-.TH PCRE 3 "10 February 2015" "PCRE 8.37"
+.TH PCRE 3 "14 June 2021" "PCRE 8.45"
.SH NAME
PCRE - Perl-compatible regular expressions (original API)
.SH "PLEASE TAKE NOTE"
.rs
.sp
-This document relates to PCRE releases that use the original API,
-with library names libpcre, libpcre16, and libpcre32. January 2015 saw the
-first release of a new API, known as PCRE2, with release numbers starting at
-10.00 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old
-libraries (now called PCRE1) are still being maintained for bug fixes, but
-there will be no new development. New projects are advised to use the new PCRE2
-libraries.
+This document relates to PCRE releases that use the original API, with library
+names libpcre, libpcre16, and libpcre32. January 2015 saw the first release of
+a new API, known as PCRE2, with release numbers starting at 10.00 and library
+names libpcre2-8, libpcre2-16, and libpcre2-32. The old libraries (now called
+PCRE1) are now at end of life, and 8.45 is the final release. New projects are
+advised to use the new PCRE2 libraries.
.
.
.SH INTRODUCTION
@@ -225,6 +224,6 @@ two digits 10, at the domain cam.ac.uk.
.rs
.sp
.nf
-Last updated: 10 February 2015
-Copyright (c) 1997-2015 University of Cambridge.
+Last updated: 14 June 2021
+Copyright (c) 1997-2021 University of Cambridge.
.fi
diff --git a/pcre/doc/pcre.txt b/pcre/doc/pcre.txt
index 8ffc90234ac..f71526961f7 100644
--- a/pcre/doc/pcre.txt
+++ b/pcre/doc/pcre.txt
@@ -21,9 +21,9 @@ PLEASE TAKE NOTE
library names libpcre, libpcre16, and libpcre32. January 2015 saw the
first release of a new API, known as PCRE2, with release numbers start-
ing at 10.00 and library names libpcre2-8, libpcre2-16, and
- libpcre2-32. The old libraries (now called PCRE1) are still being main-
- tained for bug fixes, but there will be no new development. New
- projects are advised to use the new PCRE2 libraries.
+ libpcre2-32. The old libraries (now called PCRE1) are now at end of
+ life, and 8.45 is the final release. New projects are advised to use
+ the new PCRE2 libraries.
INTRODUCTION
@@ -190,8 +190,8 @@ AUTHOR
REVISION
- Last updated: 10 February 2015
- Copyright (c) 1997-2015 University of Cambridge.
+ Last updated: 14 June 2021
+ Copyright (c) 1997-2021 University of Cambridge.
------------------------------------------------------------------------------
@@ -3155,7 +3155,7 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
The default value for the limit can be set when PCRE is built; the de-
fault default is 10 million, which handles all but the most extreme
- cases. You can override the default by suppling pcre_exec() with a
+ cases. You can override the default by supplying pcre_exec() with a
pcre_extra block in which match_limit is set, and PCRE_EX-
TRA_MATCH_LIMIT is set in the flags field. If the limit is exceeded,
pcre_exec() returns PCRE_ERROR_MATCHLIMIT.
@@ -3183,7 +3183,7 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
The default value for match_limit_recursion can be set when PCRE is
built; the default default is the same value as the default for
- match_limit. You can override the default by suppling pcre_exec() with
+ match_limit. You can override the default by supplying pcre_exec() with
a pcre_extra block in which match_limit_recursion is set, and PCRE_EX-
TRA_MATCH_LIMIT_RECURSION is set in the flags field. If the limit is
exceeded, pcre_exec() returns PCRE_ERROR_RECURSIONLIMIT.
@@ -3475,9 +3475,9 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
which finds occurrences of "iss" in the middle of words. (\B matches
only if the current position in the subject is not a word boundary.)
- When applied to the string "Mississipi" the first call to pcre_exec()
+ When applied to the string "Mississippi" the first call to pcre_exec()
finds the first occurrence. If pcre_exec() is called again with just
- the remainder of the subject, namely "issipi", it does not match, be-
+ the remainder of the subject, namely "issippi", it does not match, be-
cause \B is always false at the start of the subject, which is deemed
to be a word boundary. However, if pcre_exec() is passed the entire
string again, but with startoffset set to 4, it finds the second occur-
@@ -5292,11 +5292,11 @@ BACKSLASH
It is possible to restrict \R to match only CR, LF, or CRLF (instead of
the complete set of Unicode line endings) by setting the option
PCRE_BSR_ANYCRLF either at compile time or when the pattern is matched.
- (BSR is an abbrevation for "backslash R".) This can be made the default
- when PCRE is built; if this is the case, the other behaviour can be re-
- quested via the PCRE_BSR_UNICODE option. It is also possible to spec-
- ify these settings by starting a pattern string with one of the follow-
- ing sequences:
+ (BSR is an abbreviation for "backslash R".) This can be made the de-
+ fault when PCRE is built; if this is the case, the other behaviour can
+ be requested via the PCRE_BSR_UNICODE option. It is also possible to
+ specify these settings by starting a pattern string with one of the
+ following sequences:
(*BSR_ANYCRLF) CR, LF, or CRLF only
(*BSR_UNICODE) any Unicode newline sequence
@@ -5488,8 +5488,8 @@ BACKSLASH
3. Do not break Hangul (a Korean script) syllable sequences. Hangul
characters are of five types: L, V, T, LV, and LVT. An L character may
be followed by an L, V, LV, or LVT character; an LV or V character may
- be followed by a V or T character; an LVT or T character may be follwed
- only by a T character.
+ be followed by a V or T character; an LVT or T character may be fol-
+ lowed only by a T character.
4. Do not end before extending characters or spacing marks. Characters
with the "mark" property always have the "extend" grapheme breaking
@@ -7494,7 +7494,7 @@ BACKTRACKING CONTROL
If the subject is "aaaac...", after the first match attempt fails
(starting at the first character in the string), the starting point
skips on to start the next attempt at "c". Note that a possessive quan-
- tifer does not have the same effect as this example; although it would
+ tifier does not have the same effect as this example; although it would
suppress backtracking during the first match attempt, the second at-
tempt would start at the second character instead of skipping on to
"c".
@@ -7793,7 +7793,7 @@ PCRE SPECIAL CATEGORY PROPERTIES FOR \p and \P
Xan Alphanumeric: union of properties L and N
Xps POSIX space: property Z or tab, NL, VT, FF, CR
Xsp Perl space: property Z or tab, NL, VT, FF, CR
- Xuc Univerally-named character: one that can be
+ Xuc Universally-named character: one that can be
represented by a Universal Character Name
Xwd Perl word: property Xan or underscore
@@ -8571,7 +8571,7 @@ CONTROLLING THE JIT STACK
This is a suggestion for how a multithreaded program that needs to set
up non-default JIT stacks might operate:
- During thread initalization
+ During thread initialization
thread_local_var = pcre_jit_stack_alloc(...)
During thread exit
diff --git a/pcre/doc/pcreapi.3 b/pcre/doc/pcreapi.3
index d79217818a6..685672a3cef 100644
--- a/pcre/doc/pcreapi.3
+++ b/pcre/doc/pcreapi.3
@@ -1699,7 +1699,7 @@ very long time, and so the \fImatch_limit\fP value is also used in this case
.P
The default value for the limit can be set when PCRE is built; the default
default is 10 million, which handles all but the most extreme cases. You can
-override the default by suppling \fBpcre_exec()\fP with a \fBpcre_extra\fP
+override the default by supplying \fBpcre_exec()\fP with a \fBpcre_extra\fP
block in which \fImatch_limit\fP is set, and PCRE_EXTRA_MATCH_LIMIT is set in
the \fIflags\fP field. If the limit is exceeded, \fBpcre_exec()\fP returns
PCRE_ERROR_MATCHLIMIT.
@@ -1726,7 +1726,7 @@ and is ignored, when matching is done using JIT compiled code.
.P
The default value for \fImatch_limit_recursion\fP can be set when PCRE is
built; the default default is the same value as the default for
-\fImatch_limit\fP. You can override the default by suppling \fBpcre_exec()\fP
+\fImatch_limit\fP. You can override the default by supplying \fBpcre_exec()\fP
with a \fBpcre_extra\fP block in which \fImatch_limit_recursion\fP is set, and
PCRE_EXTRA_MATCH_LIMIT_RECURSION is set in the \fIflags\fP field. If the limit
is exceeded, \fBpcre_exec()\fP returns PCRE_ERROR_RECURSIONLIMIT.
@@ -2044,10 +2044,10 @@ lookbehind. For example, consider the pattern
.sp
which finds occurrences of "iss" in the middle of words. (\eB matches only if
the current position in the subject is not a word boundary.) When applied to
-the string "Mississipi" the first call to \fBpcre_exec()\fP finds the first
+the string "Mississippi" the first call to \fBpcre_exec()\fP finds the first
occurrence. If \fBpcre_exec()\fP is called again with just the remainder of the
-subject, namely "issipi", it does not match, because \eB is always false at the
-start of the subject, which is deemed to be a word boundary. However, if
+subject, namely "issippi", it does not match, because \eB is always false at
+the start of the subject, which is deemed to be a word boundary. However, if
\fBpcre_exec()\fP is passed the entire string again, but with \fIstartoffset\fP
set to 4, it finds the second occurrence of "iss" because it is able to look
behind the starting point to discover that it is preceded by a letter.
diff --git a/pcre/doc/pcredemo.3 b/pcre/doc/pcredemo.3
index 194629b1fac..4115ef1e36e 100644
--- a/pcre/doc/pcredemo.3
+++ b/pcre/doc/pcredemo.3
@@ -161,7 +161,7 @@ if (rc < 0)
return 1;
}
-/* Match succeded */
+/* Match succeeded */
printf("\enMatch succeeded at offset %d\en", ovector[0]);
@@ -379,7 +379,7 @@ for (;;)
return 1;
}
- /* Match succeded */
+ /* Match succeeded */
printf("\enMatch succeeded again at offset %d\en", ovector[0]);
diff --git a/pcre/doc/pcrejit.3 b/pcre/doc/pcrejit.3
index 3b785f0f631..fe42db56170 100644
--- a/pcre/doc/pcrejit.3
+++ b/pcre/doc/pcrejit.3
@@ -285,7 +285,7 @@ recommended.
This is a suggestion for how a multithreaded program that needs to set up
non-default JIT stacks might operate:
.sp
- During thread initalization
+ During thread initialization
thread_local_var = pcre_jit_stack_alloc(...)
.sp
During thread exit
diff --git a/pcre/doc/pcrepattern.3 b/pcre/doc/pcrepattern.3
index 97df217fdb2..2f501a6503b 100644
--- a/pcre/doc/pcrepattern.3
+++ b/pcre/doc/pcrepattern.3
@@ -656,7 +656,7 @@ recognized.
.P
It is possible to restrict \eR to match only CR, LF, or CRLF (instead of the
complete set of Unicode line endings) by setting the option PCRE_BSR_ANYCRLF
-either at compile time or when the pattern is matched. (BSR is an abbrevation
+either at compile time or when the pattern is matched. (BSR is an abbreviation
for "backslash R".) This can be made the default when PCRE is built; if this is
the case, the other behaviour can be requested via the PCRE_BSR_UNICODE option.
It is also possible to specify these settings by starting a pattern string with
@@ -968,7 +968,7 @@ additional characters according to the following rules for ending a cluster:
3. Do not break Hangul (a Korean script) syllable sequences. Hangul characters
are of five types: L, V, T, LV, and LVT. An L character may be followed by an
L, V, LV, or LVT character; an LV or V character may be followed by a V or T
-character; an LVT or T character may be follwed only by a T character.
+character; an LVT or T character may be followed only by a T character.
.P
4. Do not end before extending characters or spacing marks. Characters with
the "mark" property always have the "extend" grapheme breaking property.
@@ -3115,7 +3115,7 @@ successful match. Consider:
.sp
If the subject is "aaaac...", after the first match attempt fails (starting at
the first character in the string), the starting point skips on to start the
-next attempt at "c". Note that a possessive quantifer does not have the same
+next attempt at "c". Note that a possessive quantifier does not have the same
effect as this example; although it would suppress backtracking during the
first match attempt, the second attempt would start at the second character
instead of skipping on to "c".
diff --git a/pcre/doc/pcresyntax.3 b/pcre/doc/pcresyntax.3
index 0850369f7aa..b77a8664ed9 100644
--- a/pcre/doc/pcresyntax.3
+++ b/pcre/doc/pcresyntax.3
@@ -123,7 +123,7 @@ is changed to use Unicode properties and they match many more characters.
Xan Alphanumeric: union of properties L and N
Xps POSIX space: property Z or tab, NL, VT, FF, CR
Xsp Perl space: property Z or tab, NL, VT, FF, CR
- Xuc Univerally-named character: one that can be
+ Xuc Universally-named character: one that can be
represented by a Universal Character Name
Xwd Perl word: property Xan or underscore
.sp
diff --git a/pcre/pcre_compile.c b/pcre/pcre_compile.c
index cc174044545..c5e9bd38e7e 100644
--- a/pcre/pcre_compile.c
+++ b/pcre/pcre_compile.c
@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
- Copyright (c) 1997-2020 University of Cambridge
+ Copyright (c) 1997-2021 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -9102,6 +9102,8 @@ pcre_uchar cworkspace[COMPILE_WORK_SIZE];
similar way to cworkspace, it can be expanded using malloc() if necessary. */
named_group named_groups[NAMED_GROUP_LIST_SIZE];
+cd->named_groups = named_groups;
+cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;
/* Set this early so that early errors get offset 0. */
@@ -9375,8 +9377,6 @@ cd->hwm = cworkspace;
cd->iscondassert = FALSE;
cd->start_workspace = cworkspace;
cd->workspace_size = COMPILE_WORK_SIZE;
-cd->named_groups = named_groups;
-cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;
cd->start_pattern = (const pcre_uchar *)pattern;
cd->end_pattern = (const pcre_uchar *)(pattern + STRLEN_UC((const pcre_uchar *)pattern));
cd->req_varyopt = 0;
@@ -9487,6 +9487,7 @@ if (cd->names_found > 0)
add_name(cd, ng->name, ng->length, ng->number);
if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
(PUBL(free))((void *)cd->named_groups);
+ cd->named_group_list_size = 0; /* So we don't free it twice */
}
/* Set up a starting, non-extracting bracket, then compile the expression. On
@@ -9637,6 +9638,8 @@ if (errorcode != 0)
{
(PUBL(free))(re);
PCRE_EARLY_ERROR_RETURN:
+ if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
+ (PUBL(free))((void *)cd->named_groups);
*erroroffset = (int)(ptr - (const pcre_uchar *)pattern);
PCRE_EARLY_ERROR_RETURN2:
*errorptr = find_error_text(errorcode);
diff --git a/pcre/pcre_exec.c b/pcre/pcre_exec.c
index 88a9a79e489..c30d90acfc7 100644
--- a/pcre/pcre_exec.c
+++ b/pcre/pcre_exec.c
@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
- Copyright (c) 1997-2018 University of Cambridge
+ Copyright (c) 1997-2021 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -764,7 +764,7 @@ for (;;)
md->mark = NULL; /* In case previously set by assertion */
RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
eptrb, RM55);
- if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
+ if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT || rrc == MATCH_KETRPOS) &&
md->mark == NULL) md->mark = ecode + 2;
/* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an
diff --git a/pcre/pcredemo.c b/pcre/pcredemo.c
index 946aba45cdc..1ca77f1537a 100644
--- a/pcre/pcredemo.c
+++ b/pcre/pcredemo.c
@@ -144,7 +144,7 @@ if (rc < 0)
return 1;
}
-/* Match succeded */
+/* Match succeeded */
printf("\nMatch succeeded at offset %d\n", ovector[0]);
@@ -362,7 +362,7 @@ for (;;)
return 1;
}
- /* Match succeded */
+ /* Match succeeded */
printf("\nMatch succeeded again at offset %d\n", ovector[0]);
diff --git a/pcre/testdata/testinput1 b/pcre/testdata/testinput1
index 02e4f4825fc..54bc79c6271 100644
--- a/pcre/testdata/testinput1
+++ b/pcre/testdata/testinput1
@@ -5757,4 +5757,7 @@ AbcdCBefgBhiBqz
/(?&word)* \. (?<word> \w+ )/xi
pokus.hokus
+/(?:A(*:X))*+/K
+ A
+
/-- End of testinput1 --/
diff --git a/pcre/testdata/testoutput1 b/pcre/testdata/testoutput1
index e6147e60b95..212dafaae58 100644
--- a/pcre/testdata/testoutput1
+++ b/pcre/testdata/testoutput1
@@ -9470,4 +9470,9 @@ No match
0: pokus.hokus
1: hokus
+/(?:A(*:X))*+/K
+ A
+ 0: A
+MK: X
+
/-- End of testinput1 --/
diff --git a/plugin/auth_ed25519/server_ed25519.c b/plugin/auth_ed25519/server_ed25519.c
index 81fc3e66755..e9678450042 100644
--- a/plugin/auth_ed25519/server_ed25519.c
+++ b/plugin/auth_ed25519/server_ed25519.c
@@ -41,17 +41,17 @@ static int auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
/* prepare the pk */
if (info->auth_string_length != PASSWORD_LEN)
- return CR_AUTH_USER_CREDENTIALS;
+ return CR_ERROR; // bad password in the user table
memcpy(pw, info->auth_string, PASSWORD_LEN);
pw[PASSWORD_LEN]= '=';
if (my_base64_decode(pw, PASSWORD_LEN_BUF, pk, NULL, 0) != CRYPTO_PUBLICKEYBYTES)
- return CR_AUTH_USER_CREDENTIALS;
+ return CR_ERROR; // bad password in the user table
info->password_used= PASSWORD_USED_YES;
/* prepare random nonce */
if (my_random_bytes((unsigned char *)nonce, (int)sizeof(nonce)))
- return CR_AUTH_USER_CREDENTIALS;
+ return CR_ERROR; // eh? OpenSSL error
/* send it */
if (vio->write_packet(vio, reply + CRYPTO_BYTES, NONCE_BYTES))
@@ -63,7 +63,7 @@ static int auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
memcpy(reply, pkt, CRYPTO_BYTES);
if (crypto_sign_open(reply, CRYPTO_BYTES + NONCE_BYTES, pk))
- return CR_ERROR;
+ return CR_AUTH_USER_CREDENTIALS; // wrong password provided by the user
return CR_OK;
}
diff --git a/plugin/auth_gssapi/CMakeLists.txt b/plugin/auth_gssapi/CMakeLists.txt
index 4d3718dd471..11063df0884 100644
--- a/plugin/auth_gssapi/CMakeLists.txt
+++ b/plugin/auth_gssapi/CMakeLists.txt
@@ -11,6 +11,7 @@ IF(USE_SSPI)
ELSE()
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
FIND_PACKAGE(GSSAPI)
+ SET_PACKAGE_PROPERTIES(GSSAPI PROPERTIES TYPE OPTIONAL)
IF(GSSAPI_FOUND)
INCLUDE_DIRECTORIES(${GSSAPI_INCS})
ADD_DEFINITIONS(-DPLUGIN_GSSAPI)
diff --git a/plugin/aws_key_management/CMakeLists.txt b/plugin/aws_key_management/CMakeLists.txt
index e9e1b49d5f2..5389ad34bbd 100644
--- a/plugin/aws_key_management/CMakeLists.txt
+++ b/plugin/aws_key_management/CMakeLists.txt
@@ -13,6 +13,7 @@
# or if plugin is explicitly requested to build. Then bail out.
MACRO(SKIP_AWS_PLUGIN msg)
MESSAGE_ONCE(SKIP_AWS_PLUGIN "Skip aws_key_management - ${msg}")
+ ADD_FEATURE_INFO(AWS_KEY_MANAGEMENT "OFF" "AWS Encryption Key Management Plugin")
RETURN()
ENDMACRO()
SET(CMAKE_CXX_STANDARD 11)
@@ -76,6 +77,7 @@ ELSE()
INCLUDE(ExternalProject)
IF(UNIX)
FIND_PACKAGE(CURL)
+ SET_PACKAGE_PROPERTIES(CURL PROPERTIES TYPE REQUIRED)
IF(NOT CURL_FOUND)
SKIP_AWS_PLUGIN("AWS C++ SDK requires libcurl development package")
ENDIF()
@@ -86,10 +88,12 @@ ELSE()
ENDIF()
IF(NOT APPLE)
FIND_LIBRARY(UUID_LIBRARIES uuid)
+ SET_PACKAGE_PROPERTIES(UUID_LIBRARIES PROPERTIES TYPE REQUIRED)
IF(NOT UUID_LIBRARIES)
SKIP_AWS_PLUGIN("AWS C++ SDK requires uuid development package")
ENDIF()
FIND_PACKAGE(OpenSSL)
+ SET_PACKAGE_PROPERTIES(OpenSSL PROPERTIES TYPE REQUIRED)
IF(NOT OPENSSL_FOUND)
SKIP_AWS_PLUGIN("AWS C++ SDK requires openssl development package")
ENDIF()
@@ -170,5 +174,7 @@ MYSQL_ADD_PLUGIN(aws_key_management aws_key_management_plugin.cc
COMPONENT aws-key-management)
IF (TARGET aws_key_management)
- SET(NON_DISTRIBUTABLE_WARNING "Apache 2.0" PARENT_SCOPE)
+ SET(NON_DISTRIBUTABLE_WARNING "Apache 2.0" PARENT_SCOPE)
ENDIF()
+
+ADD_FEATURE_INFO(AWS_KEY_MANAGEMENT "ON" "AWS Encryption Key Management Plugin")
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index c76828efa2b..3f6cc9dddbc 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -92,16 +92,18 @@ static COND * const OOM= (COND*)1;
static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter)
{
Item_cond_or *res= NULL;
- Name_resolution_context nrc;
+ /* A reference to this context will be stored in Item_field */
+ Name_resolution_context *nrc= new (thd->mem_root) Name_resolution_context;
const char *db= tables->db, *table= tables->alias,
*field= tables->table->field[0]->field_name;
CHARSET_INFO *cs= &my_charset_latin1;
- if (!filter->str)
+ if (!filter->str || !nrc)
return 0;
- nrc.init();
- nrc.resolve_in_table_list_only(tables);
+ nrc->init();
+ nrc->resolve_in_table_list_only(tables);
+ nrc->select_lex= tables->select_lex;
res= new (thd->mem_root) Item_cond_or(thd);
if (!res)
@@ -109,7 +111,7 @@ static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter)
for (; filter->str; filter++)
{
- Item_field *fld= new (thd->mem_root) Item_field(thd, &nrc, db, table,
+ Item_field *fld= new (thd->mem_root) Item_field(thd, nrc, db, table,
field);
Item_string *pattern= new (thd->mem_root) Item_string(thd, filter->str,
(uint) filter->length, cs);
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index 666c928d7cc..14f5b2f98b4 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -301,8 +301,6 @@ static char logging;
static volatile int internal_stop_logging= 0;
static char incl_user_buffer[1024];
static char excl_user_buffer[1024];
-static char *big_buffer= NULL;
-static size_t big_buffer_alloced= 0;
static unsigned int query_log_limit= 0;
static char servhost[256];
@@ -555,20 +553,16 @@ static struct st_mysql_show_var audit_status[]=
/* These belong to the service initialization */
static PSI_mutex_key key_LOCK_operations;
static PSI_mutex_key key_LOCK_atomic;
-static PSI_mutex_key key_LOCK_bigbuffer;
static PSI_mutex_info mutex_key_list[]=
{
{ &key_LOCK_operations, "SERVER_AUDIT_plugin::lock_operations",
PSI_FLAG_GLOBAL},
{ &key_LOCK_atomic, "SERVER_AUDIT_plugin::lock_atomic",
PSI_FLAG_GLOBAL},
- { &key_LOCK_bigbuffer, "SERVER_AUDIT_plugin::lock_bigbuffer",
- PSI_FLAG_GLOBAL}
};
#endif
static mysql_mutex_t lock_operations;
static mysql_mutex_t lock_atomic;
-static mysql_mutex_t lock_bigbuffer;
/* The Percona server and partly MySQL don't support */
/* launching client errors in the 'update_variable' methods. */
@@ -1700,7 +1694,7 @@ static int log_statement_ex(const struct connection_info *cn,
int error_code, const char *type, int take_lock)
{
size_t csize;
- char message_loc[1024];
+ char message_loc[2048];
char *message= message_loc;
size_t message_size= sizeof(message_loc);
char *uh_buffer;
@@ -1709,6 +1703,7 @@ static int log_statement_ex(const struct connection_info *cn,
unsigned int db_length;
long long query_id;
int result;
+ char *big_buffer= NULL;
if ((db= cn->db))
db_length= cn->db_length;
@@ -1791,17 +1786,9 @@ do_log_query:
if (query_len > (message_size - csize)/2)
{
- flogger_mutex_lock(&lock_bigbuffer);
- if (big_buffer_alloced < (query_len * 2 + csize))
- {
- big_buffer_alloced= (query_len * 2 + csize + 4095) & ~4095L;
- big_buffer= realloc(big_buffer, big_buffer_alloced);
- if (big_buffer == NULL)
- {
- big_buffer_alloced= 0;
- return 0;
- }
- }
+ size_t big_buffer_alloced= (query_len * 2 + csize + 4095) & ~4095L;
+ if(!(big_buffer= malloc(big_buffer_alloced)))
+ return 0;
memcpy(big_buffer, message, csize);
message= big_buffer;
@@ -1846,8 +1833,8 @@ do_log_query:
"\',%d", error_code);
message[csize]= '\n';
result= write_log(message, csize + 1, take_lock);
- if (message == big_buffer)
- flogger_mutex_unlock(&lock_bigbuffer);
+ if (big_buffer)
+ free(big_buffer);
return result;
}
@@ -2496,7 +2483,6 @@ static int server_audit_init(void *p __attribute__((unused)))
#endif
flogger_mutex_init(key_LOCK_operations, &lock_operations, MY_MUTEX_INIT_FAST);
flogger_mutex_init(key_LOCK_operations, &lock_atomic, MY_MUTEX_INIT_FAST);
- flogger_mutex_init(key_LOCK_operations, &lock_bigbuffer, MY_MUTEX_INIT_FAST);
coll_init(&incl_user_coll);
coll_init(&excl_user_coll);
@@ -2581,10 +2567,8 @@ static int server_audit_deinit(void *p __attribute__((unused)))
else if (output_type == OUTPUT_SYSLOG)
closelog();
- (void) free(big_buffer);
flogger_mutex_destroy(&lock_operations);
flogger_mutex_destroy(&lock_atomic);
- flogger_mutex_destroy(&lock_bigbuffer);
error_header();
fprintf(stderr, "STOPPED\n");
diff --git a/plugin/win_auth_client/CMakeLists.txt b/plugin/win_auth_client/CMakeLists.txt
index 435c5b8966a..c0932b04e45 100644
--- a/plugin/win_auth_client/CMakeLists.txt
+++ b/plugin/win_auth_client/CMakeLists.txt
@@ -29,7 +29,7 @@ IF(WIN32)
MYSQL_ADD_PLUGIN(authentication_windows_client ${PLUGIN_SOURCES} ${HEADERS}
LINK_LIBRARIES Secur32
- MODULE_ONLY COMPONENT ClientPlugins)
+ MODULE_ONLY COMPONENT ClientPlugins CLIENT)
#IF(MSVC)
# INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug)
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 0326d4fcd7d..c6129659151 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -556,12 +556,8 @@ then
echo
echo
echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !"
- echo "To do so, start the server, then issue the following commands:"
+ echo "To do so, start the server, then issue the following command:"
echo
- echo "'$bindir/mysqladmin' -u root password 'new-password'"
- echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'"
- echo
- echo "Alternatively you can run:"
echo "'$bindir/mysql_secure_installation'"
echo
echo "which will also give you the option of removing the test"
diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh
index 71462d28622..7c0ef575db7 100644
--- a/scripts/mysql_setpermission.sh
+++ b/scripts/mysql_setpermission.sh
@@ -52,6 +52,7 @@ use strict;
use vars qw($dbh $sth $hostname $opt_user $opt_password $opt_help $opt_host
$opt_socket $opt_port $host $version);
+my $sqlport = "";
my $sqlhost = "";
my $user = "";
@@ -84,9 +85,13 @@ if ($opt_password eq '')
print "\n";
}
+# Using port argument with 'localhost' will cause an error
+if ($sqlhost ne "localhost") {
+ $sqlport = ":port=$opt_port";
+}
# make the connection to MariaDB
-$dbh= DBI->connect("DBI:mysql:mysql:host=$sqlhost:port=$opt_port:mysql_socket=$opt_socket",$opt_user,$opt_password, {PrintError => 0}) ||
+$dbh= DBI->connect("DBI:mysql:mysql:host=$sqlhost$sqlport:mysql_socket=$opt_socket",$opt_user,$opt_password, {PrintError => 0}) ||
die("Can't make a connection to the mysql server.\n The error: $DBI::errstr");
# the start of the program
@@ -278,7 +283,6 @@ sub addall {
$sth = $dbh->do("REVOKE ALL ON $db.* FROM \'$user\'\@\'$host\'") || die $dbh->errstr;
}
}
- $dbh->do("FLUSH PRIVILEGES") || print STDERR "Can't flush privileges\n";
print "Everything is inserted and mysql privileges have been reloaded.\n\n";
}
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index dc2c0db8e40..9f539bf875d 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -73,12 +73,14 @@ usage () {
cat <<EOF
Usage: $0 [OPTIONS]
--no-defaults Don't read the system defaults file
- --core-file-size=LIMIT Limit core files to the specified size
--defaults-file=FILE Use the specified defaults file
--defaults-extra-file=FILE Also use defaults from the specified file
+ --defaults-group-suffix=X Additionally read default groups with X appended
+ as a suffix
--ledir=DIRECTORY Look for mysqld in the specified directory
--open-files-limit=LIMIT Limit the number of open files
--crash-script=FILE Script to call when mysqld crashes
+ --core-file-size=LIMIT Limit core files to the specified size
--timezone=TZ Set the system timezone
--malloc-lib=LIB Preload shared library LIB if available
--mysqld=FILE Use the specified file as mysqld
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index 443cb26ab64..a1293fcb749 100644
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -1,3 +1,4 @@
+# Copyright (C) 2017-2021 MariaDB
# Copyright (C) 2012-2015 Codership Oy
#
# This program is free software; you can redistribute it and/or modify
@@ -21,93 +22,104 @@ set -u
WSREP_SST_OPT_BYPASS=0
WSREP_SST_OPT_BINLOG=""
WSREP_SST_OPT_BINLOG_INDEX=""
+WSREP_SST_OPT_LOG_BASENAME=""
WSREP_SST_OPT_DATA=""
-WSREP_SST_OPT_AUTH=${WSREP_SST_OPT_AUTH:-}
-WSREP_SST_OPT_USER=${WSREP_SST_OPT_USER:-}
-WSREP_SST_OPT_PSWD=${WSREP_SST_OPT_PSWD:-}
+WSREP_SST_OPT_AUTH="${WSREP_SST_OPT_AUTH:-}"
+WSREP_SST_OPT_USER="${WSREP_SST_OPT_USER:-}"
+WSREP_SST_OPT_PSWD="${WSREP_SST_OPT_PSWD:-}"
+WSREP_SST_OPT_REMOTE_AUTH="${WSREP_SST_OPT_REMOTE_AUTH:-}"
WSREP_SST_OPT_DEFAULT=""
+WSREP_SST_OPT_DEFAULTS=""
WSREP_SST_OPT_EXTRA_DEFAULT=""
+WSREP_SST_OPT_EXTRA_DEFAULTS=""
WSREP_SST_OPT_SUFFIX_DEFAULT=""
WSREP_SST_OPT_SUFFIX_VALUE=""
WSREP_SST_OPT_MYSQLD=""
-INNODB_DATA_HOME_DIR_ARG=""
-INNODB_LOG_GROUP_HOME_ARG=""
-INNODB_UNDO_DIR_ARG=""
-LOG_BIN_ARG=""
+WSREP_SST_OPT_PORT=""
+WSREP_SST_OPT_ADDR=""
+WSREP_SST_OPT_ADDR_PORT=""
+WSREP_SST_OPT_HOST=""
+WSREP_SST_OPT_HOST_UNESCAPED=""
+WSREP_SST_OPT_HOST_ESCAPED=""
+INNODB_DATA_HOME_DIR="${INNODB_DATA_HOME_DIR:-}"
+INNODB_LOG_GROUP_HOME="${INNODB_LOG_GROUP_HOME:-}"
+INNODB_UNDO_DIR="${INNODB_UNDO_DIR:-}"
+INNOEXTRA=""
while [ $# -gt 0 ]; do
case "$1" in
'--address')
- readonly WSREP_SST_OPT_ADDR="$2"
+ WSREP_SST_OPT_ADDR="$2"
#
# Break address string into host:port/path parts
#
- case "${WSREP_SST_OPT_ADDR}" in
+ case "$WSREP_SST_OPT_ADDR" in
\[*)
# IPv6
# Remove the starting and ending square brackets, if present:
- addr_no_bracket=${WSREP_SST_OPT_ADDR#\[}
- readonly WSREP_SST_OPT_HOST_UNESCAPED=${addr_no_bracket%%\]*}
- # Square brackets are needed in most cases:
- readonly WSREP_SST_OPT_HOST="[${WSREP_SST_OPT_HOST_UNESCAPED}]"
+ addr_no_bracket="${WSREP_SST_OPT_ADDR#\[}"
# Some utilities and subsequent code require an address
# without square brackets:
+ readonly WSREP_SST_OPT_HOST_UNESCAPED="${addr_no_bracket%%\]*}"
+ # Square brackets are needed in most cases:
+ readonly WSREP_SST_OPT_HOST="[${WSREP_SST_OPT_HOST_UNESCAPED}]"
readonly WSREP_SST_OPT_HOST_ESCAPED="\\[${WSREP_SST_OPT_HOST_UNESCAPED}\\]"
+ # Mark this address as IPv6:
readonly WSREP_SST_OPT_HOST_IPv6=1
;;
*)
- readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*}
- readonly WSREP_SST_OPT_HOST_UNESCAPED=$WSREP_SST_OPT_HOST
- readonly WSREP_SST_OPT_HOST_ESCAPED=$WSREP_SST_OPT_HOST
+ readonly WSREP_SST_OPT_HOST="${WSREP_SST_OPT_ADDR%%[:/]*}"
+ readonly WSREP_SST_OPT_HOST_UNESCAPED="$WSREP_SST_OPT_HOST"
+ readonly WSREP_SST_OPT_HOST_ESCAPED="$WSREP_SST_OPT_HOST"
readonly WSREP_SST_OPT_HOST_IPv6=0
;;
esac
# Let's remove the leading part that contains the host address:
- remain=${WSREP_SST_OPT_ADDR#${WSREP_SST_OPT_HOST_ESCAPED}}
+ remain="${WSREP_SST_OPT_ADDR#$WSREP_SST_OPT_HOST_ESCAPED}"
# Let's remove the ":" character that separates the port number
# from the hostname:
- remain=${remain#:}
+ remain="${remain#:}"
# Extract the port number from the address - all characters
# up to "/" (if present):
- readonly WSREP_SST_OPT_ADDR_PORT=${remain%%/*}
+ WSREP_SST_OPT_ADDR_PORT="${remain%%/*}"
# If the "/" character is present, then the path is not empty:
- if [ "${remain#*/}" != "${remain}" ]; then
+ if [ "${remain#*/}" != "$remain" ]; then
# This operation removes everything up to the "/" character,
# effectively removing the port number from the string:
- readonly WSREP_SST_OPT_PATH=${remain#*/}
+ readonly WSREP_SST_OPT_PATH="${remain#*/}"
else
readonly WSREP_SST_OPT_PATH=""
fi
# The rest of the string is the same as the path (for now):
- remain=${WSREP_SST_OPT_PATH}
+ remain="$WSREP_SST_OPT_PATH"
# If there is one more "/" in the string, then everything before
# it will be the module name, otherwise the module name is empty:
- if [ "${remain%%/*}" != "${remain}" ]; then
+ if [ "${remain%%/*}" != "$remain" ]; then
# This operation removes the tail after the very first
# occurrence of the "/" character (inclusively):
- readonly WSREP_SST_OPT_MODULE=${remain%%/*}
+ readonly WSREP_SST_OPT_MODULE="${remain%%/*}"
else
readonly WSREP_SST_OPT_MODULE=""
fi
# Remove the module name part from the string, which ends with "/":
- remain=${WSREP_SST_OPT_PATH#*/}
+ remain="${WSREP_SST_OPT_PATH#*/}"
# If the rest of the string does not match the original, then there
# was something else besides the module name:
- if [ "$remain" != "${WSREP_SST_OPT_PATH}" ]; then
+ if [ "$remain" != "$WSREP_SST_OPT_PATH" ]; then
# Extract the part that matches the LSN by removing all
# characters starting from the very first "/":
- readonly WSREP_SST_OPT_LSN=${remain%%/*}
+ readonly WSREP_SST_OPT_LSN="${remain%%/*}"
# Exctract everything after the first occurrence of
# the "/" character in the string:
- remain=${remain#*/}
+ remain="${remain#*/}"
# If the remainder does not match the original string,
# then there is something else (the version number in
# our case):
- if [ "$remain" != "${WSREP_SST_OPT_LSN}" ]; then
+ if [ "$remain" != "$WSREP_SST_OPT_LSN" ]; then
# Let's extract the version number by removing the tail
# after the very first occurence of the "/" character
# (inclusively):
- readonly WSREP_SST_OPT_SST_VER=${remain%%/*}
+ readonly WSREP_SST_OPT_SST_VER="${remain%%/*}"
else
readonly WSREP_SST_OPT_SST_VER=""
fi
@@ -121,31 +133,33 @@ case "$1" in
WSREP_SST_OPT_BYPASS=1
;;
'--datadir')
- readonly WSREP_SST_OPT_DATA="$2"
+ # Let's remove the trailing slash:
+ readonly WSREP_SST_OPT_DATA="${2%/}"
shift
;;
'--innodb-data-home-dir')
- readonly INNODB_DATA_HOME_DIR_ARG="$2"
+ # Let's remove the trailing slash:
+ readonly INNODB_DATA_HOME_DIR="${2%/}"
shift
;;
'--innodb-log-group-home-dir')
- readonly INNODB_LOG_GROUP_HOME_ARG="$2"
+ # Let's remove the trailing slash:
+ readonly INNODB_LOG_GROUP_HOME="${2%/}"
shift
;;
'--innodb-undo-directory')
- readonly INNODB_UNDO_DIR_ARG="$2"
- shift
- ;;
- '--log-bin')
- readonly LOG_BIN_ARG="$2"
+ # Let's remove the trailing slash:
+ readonly INNODB_UNDO_DIR="${2%/}"
shift
;;
'--defaults-file')
readonly WSREP_SST_OPT_DEFAULT="$1=$2"
+ readonly WSREP_SST_OPT_DEFAULTS="$1='$2'"
shift
;;
'--defaults-extra-file')
readonly WSREP_SST_OPT_EXTRA_DEFAULT="$1=$2"
+ readonly WSREP_SST_OPT_EXTRA_DEFAULTS="$1='$2'"
shift
;;
'--defaults-group-suffix')
@@ -154,7 +168,28 @@ case "$1" in
shift
;;
'--host')
- readonly WSREP_SST_OPT_HOST="$2"
+ case "$2" in
+ \[*)
+ # IPv6
+ # Remove the starting and ending square brackets, if present:
+ addr_no_bracket="${2#\[}"
+ # Some utilities and subsequent code require an address
+ # without square brackets:
+ readonly WSREP_SST_OPT_HOST_UNESCAPED="${addr_no_bracket%%\]*}"
+ # Square brackets are needed in most cases:
+ readonly WSREP_SST_OPT_HOST="[${WSREP_SST_OPT_HOST_UNESCAPED}]"
+ readonly WSREP_SST_OPT_HOST_ESCAPED="\\[${WSREP_SST_OPT_HOST_UNESCAPED}\\]"
+ # Mark this address as IPv6:
+ readonly WSREP_SST_OPT_HOST_IPv6=1
+ ;;
+ *)
+ readonly WSREP_SST_OPT_HOST="$2"
+ readonly WSREP_SST_OPT_HOST_UNESCAPED="$2"
+ readonly WSREP_SST_OPT_HOST_ESCAPED="$2"
+ readonly WSREP_SST_OPT_HOST_IPv6=0
+ ;;
+ esac
+ WSREP_SST_OPT_ADDR="$WSREP_SST_OPT_HOST"
shift
;;
'--local-port')
@@ -189,14 +224,18 @@ case "$1" in
readonly WSREP_SST_OPT_GTID="$2"
shift
;;
- '--binlog')
- WSREP_SST_OPT_BINLOG="$2"
+ '--binlog'|'--log-bin')
+ readonly WSREP_SST_OPT_BINLOG="$2"
+ shift
+ ;;
+ '--binlog-index'|'--log-bin-index')
+ readonly WSREP_SST_OPT_BINLOG_INDEX="$2"
+ shift
+ ;;
+ '--log-basename')
+ readonly WSREP_SST_OPT_LOG_BASENAME="$2"
shift
;;
- '--binlog-index')
- WSREP_SST_OPT_BINLOG_INDEX="$2"
- shift
- ;;
'--gtid-domain-id')
readonly WSREP_SST_OPT_GTID_DOMAIN_ID="$2"
shift
@@ -205,212 +244,1050 @@ case "$1" in
original_cmd=""
shift
while [ $# -gt 0 ]; do
- option=${1%%=*}
- if [[ "$option" != "--defaults-file" && \
- "$option" != "--defaults-extra-file" && \
- "$option" != "--defaults-group-suffix" && \
- "$option" != "--port" && \
- "$option" != "--socket" ]]; then
- value=${1#*=}
- if [ "$value" == "$1" ]; then
- value=""
- fi
- case "$option" in
- '--innodb-data-home-dir')
- if [ -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
- readonly INNODB_DATA_HOME_DIR_ARG="$value"
- fi
- ;;
- '--innodb-log-group-home-dir')
- if [ -z "$INNODB_LOG_GROUP_HOME_ARG" ]; then
- readonly INNODB_LOG_GROUP_HOME_ARG="$value"
- fi
- ;;
- '--innodb-undo-directory')
- if [ -z "$INNODB_UNDO_DIR_ARG" ]; then
- readonly INNODB_UNDO_DIR_ARG="$value"
- fi
- ;;
- '--log-bin')
- if [ -z "$LOG_BIN_ARG" ]; then
- readonly LOG_BIN_ARG="$value"
- fi
- ;;
- esac
- if [ -z "$original_cmd" ]; then
- original_cmd="$1"
- else
- original_cmd="$original_cmd $1"
- fi
+ lname="${1#--}"
+ # "--" is interpreted as the end of the list of options:
+ if [ -z "$lname" ]; then
+ shift
+ if [ $# -gt 0 ]; then
+ # copy "--" to the output string:
+ original_cmd="$original_cmd --"
+ # All other arguments must be copied unchanged:
+ while [ $# -gt 0 ]; do
+ original_cmd="$original_cmd '$1'"
+ shift
+ done
+ fi
+ break;
+ fi
+ # Make sure the argument does not start with "--", otherwise it
+ # is a long option, which is processed after this "if":
+ if [ "$lname" = "$1" ]; then
+ # Check if the argument is the short option or the short
+ # options list, starting with "-":
+ options="${1#-}"
+ if [ "$options" != "$1" -a -n "$options" ]; then
+ slist=""
+ while [ -n "$options" ]; do
+ # Let's separate the first character as the current
+ # option name:
+ if [ -n "$BASH_VERSION" ]; then
+ option="${options:0:1}"
+ else
+ # If it's not bash, then we need to use slow
+ # external utilities:
+ option=$(echo "$options" | cut -c1-1)
+ fi
+ # And the subsequent characters consider option value:
+ value=""
+ if [ ${#options} -gt 0 ]; then
+ value="${options#?}"
+ fi
+ # Check for options without argument:
+ if [ "$option" != '?' -a \
+ "$option" != 'a' -a \
+ "$option" != 's' -a \
+ "$option" != 'v' ]
+ then
+ # If the option value is absent, then check
+ # the following argument:
+ if [ -z "$value" -a $# -gt 1 ]; then
+ # if the next argument does not start with
+ # the "-" character, then next argument is
+ # the current option value:
+ if [ "${2#-}" = "$2" ]; then
+ shift
+ value="$1"
+ fi
+ fi
+ if [ $option = 'h' ]; then
+ if [ -z "$WSREP_SST_OPT_DATA" ]; then
+ MYSQLD_OPT_DATADIR="${value%/}"
+ fi
+ elif [ $option != 'u' -a \
+ $option != 'P' ]
+ then
+ if [ -z "$value" ]; then
+ slist="$slist$option"
+ elif [ -z "$slist" ]; then
+ slist="$option '$value'"
+ else
+ slist="$slist -$option '$value'"
+ fi
+ fi
+ break
+
+ else
+ slist="$slist$option"
+ fi
+ options="$value"
+ done
+ if [ -n "$slist" ]; then
+ original_cmd="$original_cmd -$slist"
+ fi
+ elif [ -z "$options" ]; then
+ # We found an equal sign without any characters after it:
+ original_cmd="$original_cmd -"
+ else
+ # We found a value that does not start with a minus -
+ # it is a positional argument or the value of previous
+ # option. Copy it to output string (as is):
+ original_cmd="$original_cmd '$1'"
+ fi
+ shift
+ continue;
+ fi
+ # Now we are sure that we are working with an option
+ # that has a "long" name, so remove all characters after
+ # the first equal sign:
+ option="${1%%=*}"
+ # The "--loose-" prefix should not affect the recognition
+ # of the option name:
+ if [ "${option#--loose-}" != "$option" ]; then
+ option="--${option#--loose-}"
+ fi
+ # Some options just need to be removed from the list:
+ if [ "$option" != '--defaults-file' -a \
+ "$option" != '--defaults-extra-file' -a \
+ "$option" != '--defaults-group-suffix' -a \
+ "$option" != '--user' -a \
+ "$option" != '--port' -a \
+ "$option" != '--socket' ]; then
+ value="${1#*=}"
+ if [ "$value" = "$1" ]; then
+ value=""
+ fi
+ # Let's fill in the variables containing important paths
+ # that might not have been passed through explicit parameters
+ # (+ removing the trailing slash in these paths). Many of these
+ # options are processed internally within scripts or passed
+ # explicitly to other programs, so we need to remove them
+ # from mysqld's argument list:
+ skip_mysqld_arg=0
+ case "$option" in
+ '--innodb-data-home-dir')
+ if [ -z "$INNODB_DATA_HOME_DIR" ]; then
+ MYSQLD_OPT_INNODB_DATA_HOME_DIR="${value%/}"
+ fi
+ skip_mysqld_arg=1
+ ;;
+ '--innodb-log-group-home-dir')
+ if [ -z "$INNODB_LOG_GROUP_HOME" ]; then
+ MYSQLD_OPT_INNODB_LOG_GROUP_HOME="${value%/}"
+ fi
+ skip_mysqld_arg=1
+ ;;
+ '--innodb-undo-directory')
+ if [ -z "$INNODB_UNDO_DIR" ]; then
+ MYSQLD_OPT_INNODB_UNDO_DIR="${value%/}"
+ fi
+ skip_mysqld_arg=1
+ ;;
+ '--log-bin')
+ if [ -z "$WSREP_SST_OPT_BINLOG" ]; then
+ MYSQLD_OPT_LOG_BIN="$value"
+ fi
+ skip_mysqld_arg=1
+ ;;
+ '--log-bin-index')
+ if [ -z "$WSREP_SST_OPT_BINLOG_INDEX" ]; then
+ MYSQLD_OPT_LOG_BIN_INDEX="$value"
+ fi
+ skip_mysqld_arg=1
+ ;;
+ '--log-basename')
+ if [ -z "$WSREP_SST_OPT_LOG_BASENAME" ]; then
+ MYSQLD_OPT_LOG_BASENAME="$value"
+ fi
+ skip_mysqld_arg=1
+ ;;
+ '--datadir')
+ if [ -z "$WSREP_SST_OPT_DATA" ]; then
+ MYSQLD_OPT_DATADIR="${value%/}"
+ fi
+ skip_mysqld_arg=1
+ ;;
+ esac
+ if [ $skip_mysqld_arg -eq 0 ]; then
+ original_cmd="$original_cmd '$1'"
+ fi
fi
shift
done
- readonly WSREP_SST_OPT_MYSQLD="$original_cmd"
+ WSREP_SST_OPT_MYSQLD="${original_cmd# *}"
break
;;
- *) # must be command
- # usage
- # exit 1
- ;;
+ *) # Must be command usage
+ # exit 1
+ ;;
esac
shift
done
readonly WSREP_SST_OPT_BYPASS
-readonly WSREP_SST_OPT_BINLOG
-readonly WSREP_SST_OPT_BINLOG_INDEX
-
-if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then
- if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then
- if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
- echo "WSREP_SST: [ERROR] port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" >&2
- exit 2
- fi
- else
- readonly WSREP_SST_OPT_PORT="$WSREP_SST_OPT_ADDR_PORT"
- fi
+
+# The same argument can be present on the command line several
+# times, in this case we must take its last value:
+if [ -n "${MYSQLD_OPT_INNODB_DATA_HOME_DIR:-}" -a \
+ -z "$INNODB_DATA_HOME_DIR" ]; then
+ readonly INNODB_DATA_HOME_DIR="$MYSQLD_OPT_INNODB_DATA_HOME_DIR"
+fi
+if [ -n "${MYSQLD_OPT_INNODB_LOG_GROUP_HOME:-}" -a \
+ -z "$INNODB_LOG_GROUP_HOME" ]; then
+ readonly INNODB_LOG_GROUP_HOME="$MYSQLD_OPT_INNODB_LOG_GROUP_HOME"
+fi
+if [ -n "${MYSQLD_OPT_INNODB_UNDO_DIR:-}" -a \
+ -z "$INNODB_UNDO_DIR" ]; then
+ readonly INNODB_UNDO_DIR="$MYSQLD_OPT_INNODB_UNDO_DIR"
+fi
+if [ -n "${MYSQLD_OPT_LOG_BIN:-}" -a \
+ -z "$WSREP_SST_OPT_BINLOG" ]; then
+ readonly WSREP_SST_OPT_BINLOG="$MYSQLD_OPT_LOG_BIN"
+fi
+if [ -n "${MYSQLD_OPT_LOG_BIN_INDEX:-}" -a \
+ -z "$WSREP_SST_OPT_BINLOG_INDEX" ]; then
+ readonly WSREP_SST_OPT_BINLOG_INDEX="$MYSQLD_OPT_LOG_BIN_INDEX"
+fi
+if [ -n "${MYSQLD_OPT_DATADIR:-}" -a \
+ -z "$WSREP_SST_OPT_DATA" ]; then
+ readonly WSREP_SST_OPT_DATA="$MYSQLD_OPT_DATADIR"
+fi
+if [ -n "${MYSQLD_OPT_LOG_BASENAME:-}" -a \
+ -z "$WSREP_SST_OPT_LOG_BASENAME" ]; then
+ readonly WSREP_SST_OPT_LOG_BASENAME="$MYSQLD_OPT_LOG_BASENAME"
+fi
+
+# If the --log-bin option is present without a value, then
+# set WSREP_SST_OPT_BINLOG value using other arguments:
+if [ -z "$WSREP_SST_OPT_BINLOG" -a -n "${MYSQLD_OPT_LOG_BIN+x}" ]; then
+ if [ -n "$WSREP_SST_OPT_LOG_BASENAME" ]; then
+ # If the WSREP_SST_OPT_BINLOG variable is not set, but
+ # --log-basename is present among the arguments to mysqld,
+ # then set WSREP_SST_OPT_BINLOG equal to the base name with
+ # the "-bin" suffix:
+ readonly WSREP_SST_OPT_BINLOG="$WSREP_SST_OPT_LOG_BASENAME-bin"
+ else
+ # Take the default name:
+ readonly WSREP_SST_OPT_BINLOG='mysql-bin'
+ fi
+fi
+
+# Reconstructing the command line arguments that control the innodb
+# and binlog options:
+if [ -n "$WSREP_SST_OPT_LOG_BASENAME" ]; then
+ if [ -n "$WSREP_SST_OPT_MYSQLD" ]; then
+ WSREP_SST_OPT_MYSQLD="--log-basename='$WSREP_SST_OPT_LOG_BASENAME' $WSREP_SST_OPT_MYSQLD"
+ else
+ WSREP_SST_OPT_MYSQLD="--log-basename='$WSREP_SST_OPT_LOG_BASENAME'"
+ fi
+fi
+if [ -n "$INNODB_DATA_HOME_DIR" ]; then
+ INNOEXTRA="$INNOEXTRA --innodb-data-home-dir='$INNODB_DATA_HOME_DIR'"
+fi
+if [ -n "$INNODB_LOG_GROUP_HOME" ]; then
+ INNOEXTRA="$INNOEXTRA --innodb-log-group-home-dir='$INNODB_LOG_GROUP_HOME'"
+fi
+if [ -n "$INNODB_UNDO_DIR" ]; then
+ INNOEXTRA="$INNOEXTRA --innodb-undo-directory='$INNODB_UNDO_DIR'"
+fi
+if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
+ INNOEXTRA="$INNOEXTRA --log-bin='$WSREP_SST_OPT_BINLOG'"
+ if [ -n "$WSREP_SST_OPT_BINLOG_INDEX" ]; then
+ if [ -n "$WSREP_SST_OPT_MYSQLD" ]; then
+ WSREP_SST_OPT_MYSQLD="--log-bin-index='$WSREP_SST_OPT_BINLOG_INDEX' $WSREP_SST_OPT_MYSQLD"
+ else
+ WSREP_SST_OPT_MYSQLD="--log-bin-index='$WSREP_SST_OPT_BINLOG_INDEX'"
+ fi
+ fi
+fi
+
+readonly WSREP_SST_OPT_MYSQLD
+
+get_binlog()
+{
+ # if no command line argument and WSREP_SST_OPT_BINLOG is not set,
+ # try to get it from my.cnf:
+ if [ -z "$WSREP_SST_OPT_BINLOG" ]; then
+ WSREP_SST_OPT_BINLOG=$(parse_cnf '--mysqld' 'log-bin')
+ fi
+ # if no command line argument and WSREP_SST_OPT_BINLOG_INDEX is not set,
+ # try to get it from my.cnf:
+ if [ -z "$WSREP_SST_OPT_BINLOG_INDEX" ]; then
+ WSREP_SST_OPT_BINLOG_INDEX=$(parse_cnf '--mysqld' 'log-bin-index')
+ fi
+ # if no command line argument and WSREP_SST_OPT_LOG_BASENAME is not set,
+ # try to get it from my.cnf:
+ if [ -z "$WSREP_SST_OPT_LOG_BASENAME" ]; then
+ WSREP_SST_OPT_LOG_BASENAME=$(parse_cnf '--mysqld' 'log-basename')
+ fi
+ if [ -z "$WSREP_SST_OPT_BINLOG" ]; then
+ # If the --log-bin option is specified without a parameter,
+ # then we need to build the name of the index file according
+ # to the rules described in the server documentation:
+ if [ -n "${MYSQLD_OPT_LOG_BIN+x}" -o \
+ $(in_config '--mysqld' 'log-bin') -eq 1 ]
+ then
+ if [ -n "$WSREP_SST_OPT_LOG_BASENAME" ]; then
+ # If the WSREP_SST_OPT_BINLOG variable is not set, but
+ # --log-basename is present among the arguments of mysqld,
+ # then set WSREP_SST_OPT_BINLOG equal to the base name with
+ # the "-bin" suffix:
+ readonly WSREP_SST_OPT_BINLOG="$WSREP_SST_OPT_LOG_BASENAME-bin"
+ else
+ # If the --log-bin option is present without a value, then
+ # we take the default name:
+ readonly WSREP_SST_OPT_BINLOG='mysql-bin'
+ fi
+ fi
+ fi
+ if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
+ # If the name of the index file is not specified, then we will build
+ # it according to the specifications for the server:
+ if [ -z "$WSREP_SST_OPT_BINLOG_INDEX" ]; then
+ if [ -n "$WSREP_SST_OPT_LOG_BASENAME" ]; then
+ # If the WSREP_SST_OPT_BINLOG variable is not set, but
+ # --log-basename is present among the arguments of mysqld,
+ # then set WSREP_SST_OPT_BINLOG equal to the base name with
+ # the "-bin" suffix:
+ readonly WSREP_SST_OPT_BINLOG_INDEX="$WSREP_SST_OPT_LOG_BASENAME-bin.index"
+ else
+ # the default name (note that base of this name
+ # is already defined above):
+ readonly WSREP_SST_OPT_BINLOG_INDEX="$WSREP_SST_OPT_BINLOG.index"
+ fi
+ fi
+ fi
+}
+
+# Check the presence of the port value and, if necessary, transfer
+# the port number from the address to the WSREP_SST_OPT_PORT variable
+# or vice versa, and also, if necessary, substitute the missing port
+# value into the address value:
+if [ -n "$WSREP_SST_OPT_ADDR_PORT" ]; then
+ if [ -n "$WSREP_SST_OPT_PORT" ]; then
+ if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
+ echo "WSREP_SST: [ERROR] port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" >&2
+ exit 2
+ fi
+ else
+ # If the address contains a port number, assign it to
+ # the corresponding variable:
+ readonly WSREP_SST_OPT_PORT="$WSREP_SST_OPT_ADDR_PORT"
+ fi
+elif [ -n "$WSREP_SST_OPT_ADDR" ]; then
+ # If the port is missing, take the default port:
+ if [ -z "$WSREP_SST_OPT_PORT" ]; then
+ readonly WSREP_SST_OPT_PORT=4444
+ fi
+ WSREP_SST_OPT_ADDR_PORT="$WSREP_SST_OPT_PORT"
+ # Let's remove the leading part that contains the host address:
+ remain="${WSREP_SST_OPT_ADDR#$WSREP_SST_OPT_HOST_ESCAPED}"
+ # Let's remove the ":" character that separates the port number
+ # from the hostname:
+ remain="${remain#:}"
+ # Let's remove all characters upto first "/" character that
+ # separates the hostname with port number from the path:
+ remain="${remain#/}"
+ # Let's construct a new value for the address with the port:
+ WSREP_SST_OPT_ADDR="$WSREP_SST_OPT_HOST:$WSREP_SST_OPT_PORT"
+ if [ -n "$remain" ]; then
+ WSREP_SST_OPT_ADDR="$WSREP_SST_OPT_ADDR/$remain"
+ fi
fi
+readonly WSREP_SST_OPT_ADDR
+readonly WSREP_SST_OPT_ADDR_PORT
+
# try to use my_print_defaults, mysql and mysqldump that come with the sources
# (for MTR suite)
-SCRIPTS_DIR="$(cd $(dirname "$0"); pwd -P)"
+script_binary=$(dirname "$0")
+SCRIPTS_DIR=$(cd "$script_binary"; pwd -P)
EXTRA_DIR="$SCRIPTS_DIR/../extra"
CLIENT_DIR="$SCRIPTS_DIR/../client"
if [ -x "$CLIENT_DIR/mysql" ]; then
MYSQL_CLIENT="$CLIENT_DIR/mysql"
else
- MYSQL_CLIENT=$(which mysql)
+ MYSQL_CLIENT="$(command -v mysql)"
fi
if [ -x "$CLIENT_DIR/mysqldump" ]; then
MYSQLDUMP="$CLIENT_DIR/mysqldump"
else
- MYSQLDUMP=$(which mysqldump)
+ MYSQLDUMP="$(command -v mysqldump)"
fi
+wsrep_log()
+{
+ # echo everything to stderr so that it gets into common error log
+ # deliberately made to look different from the rest of the log
+ local readonly tst="$(date +%Y%m%d\ %H:%M:%S.%N | cut -b -21)"
+ echo "WSREP_SST: $* ($tst)" >&2
+}
+
+wsrep_log_error()
+{
+ wsrep_log "[ERROR] $*"
+}
+
+wsrep_log_warning()
+{
+ wsrep_log "[WARNING] $*"
+}
+
+wsrep_log_info()
+{
+ wsrep_log "[INFO] $*"
+}
+
if [ -x "$SCRIPTS_DIR/my_print_defaults" ]; then
MY_PRINT_DEFAULTS="$SCRIPTS_DIR/my_print_defaults"
elif [ -x "$EXTRA_DIR/my_print_defaults" ]; then
MY_PRINT_DEFAULTS="$EXTRA_DIR/my_print_defaults"
else
- MY_PRINT_DEFAULTS=$(which my_print_defaults)
+ MY_PRINT_DEFAULTS="$(command -v my_print_defaults)"
+ if [ -z "$MY_PRINT_DEFAULTS" ]; then
+ wsrep_log_error "my_print_defaults not found in path"
+ exit 2
+ fi
fi
+readonly MY_PRINT_DEFAULTS
+
+wsrep_defaults="$WSREP_SST_OPT_DEFAULTS"
+wsrep_defaults="$wsrep_defaults${wsrep_defaults:+ }$WSREP_SST_OPT_EXTRA_DEFAULTS"
+wsrep_defaults="$wsrep_defaults${wsrep_defaults:+ }$WSREP_SST_OPT_SUFFIX_DEFAULT"
+
+readonly WSREP_SST_OPT_CONF="$wsrep_defaults"
+
wsrep_defaults="$WSREP_SST_OPT_DEFAULT"
-if [ -n "$wsrep_defaults" ]; then
- wsrep_defaults="$wsrep_defaults "
-fi
-wsrep_defaults="$wsrep_defaults$WSREP_SST_OPT_EXTRA_DEFAULT"
-if [ -n "$wsrep_defaults" ]; then
- wsrep_defaults="$wsrep_defaults "
-fi
-readonly WSREP_SST_OPT_CONF="$wsrep_defaults$WSREP_SST_OPT_SUFFIX_DEFAULT"
-readonly MY_PRINT_DEFAULTS="$MY_PRINT_DEFAULTS $WSREP_SST_OPT_CONF"
+wsrep_defaults="$wsrep_defaults${wsrep_defaults:+ }$WSREP_SST_OPT_EXTRA_DEFAULT"
+wsrep_defaults="$wsrep_defaults${wsrep_defaults:+ }$WSREP_SST_OPT_SUFFIX_DEFAULT"
+
+readonly WSREP_SST_OPT_CONF_UNQUOTED="$wsrep_defaults"
+
+#
+# User can specify mariabackup specific settings that will be used during sst
+# process like encryption, etc. Parse such configuration option.
+#
+# 1st parameter: group (config file section like sst) or
+# my_print_defaults argument (like --mysqld)
+# 2nd parameter: var : name of the variable in the section, e.g. server-id
+# 3rd parameter: default value for the parameter
+#
+parse_cnf()
+{
+ local groups="$1"
+ local var="$2"
+ local reval=""
+
+ # normalize the variable names specified in the .cnf file
+ # (user can use '_' or '-', for example, log-bin or log_bin),
+ # then search for the last instance of the desired variable
+ # and finally get the value of that variable (if the variable
+ # was specified several times - we use only its last instance):
+
+ local pattern='BEGIN {OFS=FS="="} {sub(/^--loose/,"-",$0); gsub(/_/,"-",$1); if ($1=="--'"$var"'") lastval=substr($0,length($1)+2)} END {print lastval}'
+
+ while [ -n "$groups" ]; do
+ # Remove the largest suffix starting with the '|' character:
+ local group="${groups%%\|*}"
+ # Remove the remainder (the group name) from the rest
+ # of the groups list (as if it were a prefix):
+ groups="${groups#$group}"
+ groups="${groups#\|}"
+ # If the group name is the same as the "mysqld" without "--" prefix,
+ # then try to use it together with the group suffix:
+ if [ "$group" = 'mysqld' -a -n "$WSREP_SST_OPT_SUFFIX_VALUE" ]; then
+ reval=$("$MY_PRINT_DEFAULTS" \
+ ${WSREP_SST_OPT_DEFAULT:+"$WSREP_SST_OPT_DEFAULT"} \
+ ${WSREP_SST_OPT_EXTRA_DEFAULT:+"$WSREP_SST_OPT_EXTRA_DEFAULT"} \
+ ${WSREP_SST_OPT_SUFFIX_DEFAULT:+"$WSREP_SST_OPT_SUFFIX_DEFAULT"} \
+ "mysqld$WSREP_SST_OPT_SUFFIX_VALUE" | awk "$pattern")
+ if [ -n "$reval" ]; then
+ break
+ fi
+ fi
+ # Let's try to use the group name as it is:
+ reval=$("$MY_PRINT_DEFAULTS" \
+ ${WSREP_SST_OPT_DEFAULT:+"$WSREP_SST_OPT_DEFAULT"} \
+ ${WSREP_SST_OPT_EXTRA_DEFAULT:+"$WSREP_SST_OPT_EXTRA_DEFAULT"} \
+ ${WSREP_SST_OPT_SUFFIX_DEFAULT:+"$WSREP_SST_OPT_SUFFIX_DEFAULT"} \
+ "$group" | awk "$pattern")
+ if [ -n "$reval" ]; then
+ break
+ fi
+ done
+
+ # Use default if we haven't found a value:
+ if [ -z "$reval" ]; then
+ [ -n "${3:-}" ] && reval="$3"
+ fi
+ echo "$reval"
+}
+
+#
+# This function simply checks for the presence of the parameter
+# in the config file, but does not return its value. It returns "1"
+# (true) even if the parameter is present in the configuration file
+# without a value:
+#
+in_config()
+{
+ local groups="$1"
+ local var="$2"
+ local found=0
+
+ # normalize the variable names specified in the .cnf file
+ # (user can use '_' or '-', for example, log-bin or log_bin),
+ # then search for the last instance(s) of the desired variable:
+
+ local pattern='BEGIN {OFS=FS="="; found=0} {sub(/^--loose/,"-",$0); gsub(/_/,"-",$1); if ($1=="--'"$var"'") found=1} END {print found}'
+
+ while [ -n "$groups" ]; do
+ # Remove the largest suffix starting with the '|' character:
+ local group="${groups%%\|*}"
+ # Remove the remainder (the group name) from the rest
+ # of the groups list (as if it were a prefix):
+ groups="${groups#$group}"
+ groups="${groups#\|}"
+ # If the group name is the same as the "mysqld" without "--" prefix,
+ # then try to use it together with the group suffix:
+ if [ "$group" = 'mysqld' -a -n "$WSREP_SST_OPT_SUFFIX_VALUE" ]; then
+ found=$("$MY_PRINT_DEFAULTS" \
+ ${WSREP_SST_OPT_DEFAULT:+"$WSREP_SST_OPT_DEFAULT"} \
+ ${WSREP_SST_OPT_EXTRA_DEFAULT:+"$WSREP_SST_OPT_EXTRA_DEFAULT"} \
+ ${WSREP_SST_OPT_SUFFIX_DEFAULT:+"$WSREP_SST_OPT_SUFFIX_DEFAULT"} \
+ "mysqld$WSREP_SST_OPT_SUFFIX_VALUE" | awk "$pattern")
+ if [ $found -ne 0 ]; then
+ break
+ fi
+ fi
+ # Let's try to use the group name as it is:
+ found=$($MY_PRINT_DEFAULTS \
+ ${WSREP_SST_OPT_DEFAULT:+"$WSREP_SST_OPT_DEFAULT"} \
+ ${WSREP_SST_OPT_EXTRA_DEFAULT:+"$WSREP_SST_OPT_EXTRA_DEFAULT"} \
+ ${WSREP_SST_OPT_SUFFIX_DEFAULT:+"$WSREP_SST_OPT_SUFFIX_DEFAULT"} \
+ "$group" | awk "$pattern")
+ if [ $found -ne 0 ]; then
+ break
+ fi
+ done
+ echo $found
+}
wsrep_auth_not_set()
{
- [ -z "$WSREP_SST_OPT_AUTH" -o "$WSREP_SST_OPT_AUTH" = "(null)" ]
+ [ -z "$WSREP_SST_OPT_AUTH" ]
}
-# State Snapshot Transfer authentication password was displayed in the ps output. Bug fixed #1200727.
-if $MY_PRINT_DEFAULTS sst | grep -q "wsrep_sst_auth"; then
- if wsrep_auth_not_set; then
- WSREP_SST_OPT_AUTH=$($MY_PRINT_DEFAULTS sst | grep -- "--wsrep_sst_auth" | cut -d= -f2)
- fi
+# Get rid of incorrect values resulting from substitution
+# in programs external to the script:
+if [ "$WSREP_SST_OPT_USER" = '(null)' ]; then
+ WSREP_SST_OPT_USER=""
+fi
+if [ "$WSREP_SST_OPT_PSWD" = '(null)' ]; then
+ WSREP_SST_OPT_PSWD=""
+fi
+if [ "$WSREP_SST_OPT_AUTH" = '(null)' ]; then
+ WSREP_SST_OPT_AUTH=""
fi
-readonly WSREP_SST_OPT_AUTH
-# Splitting AUTH into potential user:password pair
+# Let's read the value of the authentication string from the
+# configuration file so that it does not go to the command line
+# and does not appear in the ps output:
+if wsrep_auth_not_set; then
+ WSREP_SST_OPT_AUTH=$(parse_cnf 'sst' 'wsrep-sst-auth')
+fi
+
+# Splitting WSREP_SST_OPT_AUTH as "user:password" pair:
if ! wsrep_auth_not_set
then
- WSREP_SST_OPT_USER="${WSREP_SST_OPT_AUTH%%:*}"
- WSREP_SST_OPT_PSWD="${WSREP_SST_OPT_AUTH##*:}"
+ # Extract username as shortest prefix up to first ':' character:
+ WSREP_SST_OPT_AUTH_USER="${WSREP_SST_OPT_AUTH%%:*}"
+ if [ -z "$WSREP_SST_OPT_USER" ]; then
+ # if the username is not in the command line arguments,
+ # set the username and password using WSREP_SST_OPT_AUTH
+ # from the environment:
+ WSREP_SST_OPT_USER="$WSREP_SST_OPT_AUTH_USER"
+ WSREP_SST_OPT_PSWD="${WSREP_SST_OPT_AUTH#*:}"
+ elif [ "$WSREP_SST_OPT_USER" = "$WSREP_SST_OPT_AUTH_USER" ]; then
+ # If the username in the command line arguments and in
+ # the environment variable are the same, set the password
+ # if it was not specified in the command line:
+ if [ -z "$WSREP_SST_OPT_PSWD" ]; then
+ WSREP_SST_OPT_PSWD="${WSREP_SST_OPT_AUTH#*:}"
+ fi
+ else
+ # The username is passed through the command line and does
+ # not match the username in the environment variable - ignore
+ # the environment and rebuild the authentication parameters:
+ WSREP_SST_OPT_AUTH="$WSREP_SST_OPT_USER:$WSREP_SST_OPT_PSWD"
+ fi
fi
+
readonly WSREP_SST_OPT_USER
readonly WSREP_SST_OPT_PSWD
+readonly WSREP_SST_OPT_AUTH
-if [ -n "${WSREP_SST_OPT_DATA:-}" ]
+if [ -n "$WSREP_SST_OPT_REMOTE_AUTH" ]
+then
+ # Split auth string at the last ':'
+ readonly WSREP_SST_OPT_REMOTE_USER="${WSREP_SST_OPT_REMOTE_AUTH%%:*}"
+ readonly WSREP_SST_OPT_REMOTE_PSWD="${WSREP_SST_OPT_REMOTE_AUTH#*:}"
+else
+ readonly WSREP_SST_OPT_REMOTE_USER=
+ readonly WSREP_SST_OPT_REMOTE_PSWD=
+fi
+
+readonly WSREP_SST_OPT_REMOTE_AUTH
+
+if [ -n "$WSREP_SST_OPT_DATA" ]
then
SST_PROGRESS_FILE="$WSREP_SST_OPT_DATA/sst_in_progress"
else
SST_PROGRESS_FILE=""
fi
-wsrep_log()
+wsrep_cleanup_progress_file()
{
- # echo everything to stderr so that it gets into common error log
- # deliberately made to look different from the rest of the log
- local readonly tst="$(date +%Y%m%d\ %H:%M:%S.%N | cut -b -21)"
- echo "WSREP_SST: $* ($tst)" >&2
+ [ -n "$SST_PROGRESS_FILE" -a \
+ -f "$SST_PROGRESS_FILE" ] && rm -f "$SST_PROGRESS_FILE" 2>/dev/null || true
}
-wsrep_log_error()
+wsrep_check_program()
{
- wsrep_log "[ERROR] $*"
+ local prog="$1"
+ local cmd=$(command -v "$prog")
+ if [ -z "$cmd" ]; then
+ echo "'$prog' not found in PATH"
+ return 2 # no such file or directory
+ fi
}
-wsrep_log_warning()
+wsrep_check_programs()
{
- wsrep_log "[WARNING] $*"
+ local ret=0
+
+ while [ $# -gt 0 ]
+ do
+ wsrep_check_program "$1" || ret=$?
+ shift
+ done
+
+ return $ret
}
-wsrep_log_info()
+wsrep_check_datadir()
{
- wsrep_log "[INFO] $*"
+ if [ -z "$WSREP_SST_OPT_DATA" ]
+ then
+ wsrep_log_error "The '--datadir' parameter must be passed to the SST script"
+ exit 2
+ fi
}
-wsrep_cleanup_progress_file()
+get_openssl()
{
- [ -n "${SST_PROGRESS_FILE:-}" ] && rm -f "$SST_PROGRESS_FILE" 2>/dev/null || true
+ # If the OPENSSL_BINARY variable is already defined, just return:
+ if [ -n "${OPENSSL_BINARY+x}" ]; then
+ return
+ fi
+ # Let's look for openssl:
+ OPENSSL_BINARY="$(command -v openssl)"
+ if [ -z "$OPENSSL_BINARY" ]; then
+ OPENSSL_BINARY='/usr/bin/openssl'
+ if [ -z "$OPENSSL_BINARY" ]; then
+ OPENSSL_BINARY=""
+ fi
+ fi
+ readonly OPENSSL_BINARY
}
-wsrep_check_program()
+#
+# Generate a string equivalent to 16 random bytes
+#
+wsrep_gen_secret()
+{
+ get_openssl
+ if [ -n "$OPENSSL_BINARY" ]
+ then
+ echo $("$OPENSSL_BINARY" rand -hex 16)
+ else
+ printf "%04x%04x%04x%04x%04x%04x%04x%04x" \
+ $RANDOM $RANDOM $RANDOM $RANDOM \
+ $RANDOM $RANDOM $RANDOM $RANDOM
+ fi
+}
+
+#
+# Checking if the address passed to us is local.
+# If the second parameter is nonzero, then this function
+# does not check for matches with local domain names:
+#
+is_local_ip()
+{
+ # Rapid recognition of the most common cases:
+ [ "$1" = '127.0.0.1' -o \
+ "$1" = '127.0.0.2' -o \
+ "$1" = 'localhost' -o \
+ "$1" = '[::1]' ] && return 0
+ # If the address starts with "127." this is probably a local
+ # address, but we need to clarify what follows this prefix:
+ if [ "${1#127.}" != "$1" ]; then
+ # All 127.0.0.0/8 addresses are local:
+ if echo "$1" | grep -q -E '^127\.[0-9]+\.[0-9]+\.[0-9]+$'; then
+ return 0
+ fi
+ fi
+ # If the second parameter is nonzero, then we will skip
+ # the domain name check:
+ if [ "${2:-0}" -eq 0 ]; then
+ # We consider all the names of a given host to be local addresses:
+ [ "$1" = "$(hostname -s)" -o \
+ "$1" = "$(hostname -f)" -o \
+ "$1" = "$(hostname -d)" ] && return 0
+ fi
+ # Now let's check if the given address is assigned to
+ # one of the network cards:
+ local ip_util="$(command -v ip)"
+ if [ -n "$ip_util" ]; then
+ # ip address show ouput format is " inet[6] <address>/<mask>":
+ "$ip_util" address show \
+ | grep -E "^[[:space:]]*inet.? [^[:space:]]+/" -o \
+ | grep -F " $1/" >/dev/null && return 0
+ else
+ local ifconfig_util="$(command -v ifconfig)"
+ if [ -n "$ifconfig_util" ]; then
+ # ifconfig output format is " inet[6] <address> ...":
+ "$ifconfig_util" \
+ | grep -E "^[[:space:]]*inet.? [^[:space:]]+ " -o \
+ | grep -F " $1 " >/dev/null && return 0
+ fi
+ fi
+ return 1
+}
+
+check_sockets_utils()
{
- local prog=$1
+ lsof_available=0
+ sockstat_available=0
+ ss_available=0
+
+ [ -n "$(command -v lsof)" ] && lsof_available=1
+ [ -n "$(command -v sockstat)" ] && sockstat_available=1
+ [ -n "$(command -v ss)" ] && ss_available=1
- if ! which $prog >/dev/null
+ if [ $lsof_available -eq 0 -a \
+ $sockstat_available -eq 0 -a \
+ $ss_available -eq 0 ]
then
- echo "'$prog' not found in PATH"
- return 2 # no such file or directory
+ wsrep_log_error "Neither lsof, nor sockstat or ss tool was found in " \
+ "the PATH. Make sure you have it installed."
+ exit 2 # ENOENT
fi
}
-wsrep_check_programs()
+#
+# Check if the port is in the "listen" state.
+# The first parameter is the PID of the process that should
+# listen on the port - if it is not known, you can specify
+# an empty string or zero.
+# The second parameter is the port number.
+# The third parameter is a list of the names of utilities
+# (via "|") that can listen on this port during the state
+# transfer.
+#
+check_port()
{
- local ret=0
+ local pid="$1"
+ local port="$2"
+ local utils="$3"
- while [ $# -gt 0 ]
- do
- wsrep_check_program $1 || ret=$?
- shift
- done
+ [ -z "$pid" ] || [ $pid -eq 0 ] && pid='[0-9]+'
- return $ret
+ local rc=1
+
+ if [ $lsof_available -ne 0 ]; then
+ lsof -Pnl -i ":$port" 2>/dev/null | \
+ grep -q -E "^($utils)[^[:space:]]*[[:space:]]+$pid[[:space:]].*\\(LISTEN\\)" && rc=0
+ elif [ $sockstat_available -ne 0 ]; then
+ local opts='-p'
+ if [ "$OS" = 'FreeBSD' ]; then
+ # sockstat on FreeBSD requires the "-s" option
+ # to display the connection state:
+ opts='-sp'
+ fi
+ sockstat "$opts" "$port" 2>/dev/null | \
+ grep -q -E "[[:space:]]+($utils)[^[:space:]]*[[:space:]]+$pid[[:space:]].*[[:space:]]LISTEN" && rc=0
+ elif [ $ss_available -ne 0 ]; then
+ ss -nlpH "( sport = :$port )" 2>/dev/null | \
+ grep -q -E "users:\\(.*\\(\"($utils)[^[:space:]]*\"[^)]*,pid=$pid(,[^)]*)?\\)" && rc=0
+ else
+ wsrep_log_error "unknown sockets utility"
+ exit 2 # ENOENT
+ fi
+
+ return $rc
}
#
-# user can specify mariabackup specific settings that will be used during sst
-# process like encryption, etc.....
-# parse such configuration option. (group for xb settings is [sst] in my.cnf
+# If the ssl_dhparams variable is already set, uses that as a source
+# of dh parameters for OpenSSL. Otherwise, looks for dhparams.pem in
+# the datadir, and creates it there if it can't find the file.
#
-# 1st param: group (config file section like sst) or my_print_defaults argument (like --mysqld)
-# 2nd param: var : name of the variable in the section, e.g. server-id
-# 3rd param: - : default value for the param
-parse_cnf()
+check_for_dhparams()
{
- local group=$1
- local var=$2
- local reval=""
+ ssl_dhparams="$DATA/dhparams.pem"
+ if [ ! -r "$ssl_dhparams" ]; then
+ get_openssl
+ if [ -n "$OPENSSL_BINARY" ]; then
+ wsrep_log_info "Could not find dhparams file, creating $ssl_dhparams"
+ if ! "$OPENSSL_BINARY" dhparam -out "$ssl_dhparams" 2048 >/dev/null 2>&1
+ then
+ wsrep_log_error "******** ERROR *****************************************"
+ wsrep_log_error "* Could not create the dhparams.pem file with OpenSSL. *"
+ wsrep_log_error "********************************************************"
+ ssl_dhparams=""
+ fi
+ else
+ # Rollback: if openssl is not installed, then use
+ # the default parameters:
+ ssl_dhparams=""
+ fi
+ fi
+}
- # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin)
- # then search for needed variable
- # finally get the variable value (if variables has been specified multiple time use the last value only)
+#
+# Verifies that the CA file verifies the certificate.
+# Doing this here lets us generate better error messages.
+#
+# 1st param: path to the CA file.
+# 2nd param: path to the certificate.
+#
+verify_ca_matches_cert()
+{
+ local ca="$1"
+ local cert="$2"
+ local path=${3:-0}
- reval=$($MY_PRINT_DEFAULTS "${group}" | awk -v var="${var}" 'BEGIN { OFS=FS="=" } { gsub(/_/,"-",$1); if ( $1=="--"var) lastval=substr($0,length($1)+2) } END { print lastval}')
+ # If the openssl utility is not installed, then
+ # we will not do this certificate check:
+ get_openssl
+ if [ -z "$OPENSSL_BINARY" ]; then
+ return
+ fi
- # use default if we haven't found a value
- if [ -z "$reval" ]; then
- [ -n "$3" ] && reval=$3
+ local not_match=0
+
+ if [ $path -eq 0 ]; then
+ "$OPENSSL_BINARY" verify -verbose -CAfile "$ca" "$cert" >/dev/null 2>&1 || not_match=1
+ else
+ "$OPENSSL_BINARY" verify -verbose -CApath "$ca" "$cert" >/dev/null 2>&1 || not_match=1
+ fi
+
+ if [ $not_match -eq 1 ]; then
+ wsrep_log_error "******** FATAL ERROR ********************************************"
+ wsrep_log_error "* The certifcate and CA (certificate authority) do not match. *"
+ wsrep_log_error "* It does not appear that the certificate was issued by the CA. *"
+ wsrep_log_error "* Please check your certificate and CA files. *"
+ wsrep_log_error "*****************************************************************"
+ exit 22
+ fi
+}
+
+#
+# Verifies that the certificate matches the private key.
+# Doing this will save us having to wait for a timeout that would
+# otherwise occur.
+#
+# 1st param: path to the certificate.
+# 2nd param: path to the private key.
+#
+verify_cert_matches_key()
+{
+ local cert_path="$1"
+ local key_path="$2"
+
+ # If the diff utility is not installed, then
+ # we will not do this certificate check:
+ if [ -z "$(command -v diff)" ]; then
+ return
+ fi
+
+ # If the openssl utility is not installed, then
+ # we will not do this certificate check:
+ get_openssl
+ if [ -z "$OPENSSL_BINARY" ]; then
+ return
+ fi
+
+ # Generate the public key from the cert and the key.
+ # They should match (otherwise we can't create an SSL connection).
+ if ! diff <("$OPENSSL_BINARY" x509 -in "$cert_path" -pubkey -noout 2>/dev/null) \
+ <("$OPENSSL_BINARY" pkey -in "$key_path" -pubout 2>/dev/null) >/dev/null 2>&1
+ then
+ wsrep_log_error "******************* FATAL ERROR ****************"
+ wsrep_log_error "* The certifcate and private key do not match. *"
+ wsrep_log_error "* Please check your certificate and key files. *"
+ wsrep_log_error "************************************************"
+ exit 22
+ fi
+}
+
+#
+# Compares two version strings.
+# The first parameter is the version to be checked;
+# The second parameter is the minimum version required;
+# Returns 1 (failure) if $1 >= $2, 0 (success) otherwise.
+#
+check_for_version()
+{
+ y1="${1#*.}"
+ [ "$y1" = "$1" ] && y1=""
+ z1=${y1#*.}
+ [ "$z1" = "$y1" ] && z1=""
+ x1="${1%%.*}"
+ y1="${y1%%.*}"
+ z1="${z1%%.*}"
+ [ -z "$y1" ] && y1=0
+ [ -z "$z1" ] && z1=0
+ y2="${2#*.}"
+ [ "$y2" = "$2" ] && y2=""
+ z2="${y2#*.}"
+ [ "$z2" = "$y2" ] && z2=""
+ x2="${2%%.*}"
+ y2="${y2%%.*}"
+ z2="${z2%%.*}"
+ [ -z "$y2" ] && y2=0
+ [ -z "$z2" ] && z2=0
+ [ $x1 -lt $x2 ] && return 1
+ [ $x1 -gt $x2 ] && return 0
+ [ $y1 -lt $y2 ] && return 1
+ [ $y1 -gt $y2 ] && return 0
+ [ $z1 -lt $z2 ] && return 1
+ return 0
+}
+
+trim_string()
+{
+ if [ -n "$BASH_VERSION" ]; then
+ local pattern="[![:space:]${2:-}]"
+ local x="${1#*$pattern}"
+ local z=${#1}
+ x=${#x}
+ if [ $x -ne $z ]; then
+ local y="${1%$pattern*}"
+ y=${#y}
+ x=$(( z-x-1 ))
+ y=$(( y-x+1 ))
+ printf '%s' "${1:$x:$y}"
+ else
+ printf ''
+ fi
+ else
+ local pattern="[[:space:]${2:-}]"
+ echo "$1" | sed -E "s/^$pattern+|$pattern+\$//g"
+ fi
+}
+
+#
+# Check whether process is still running.
+# The first parameter contains the name of the PID file.
+# The second parameter is the flag of the need to delete
+# the PID file.
+# If the second parameter is not zero and not empty,
+# then if the process terminates, the corresponding
+# PID file will be deleted.
+# This function also sets the CHECK_PID variable to zero
+# if the process has already exited, or writes the PID
+# of the process there if it is still running.
+#
+check_pid()
+{
+ local pid_file="$1"
+ if [ -r "$pid_file" ]; then
+ local pid=$(cat "$pid_file" 2>/dev/null)
+ if [ -n "$pid" ]; then
+ if [ $pid -ne 0 ]; then
+ if ps -p "$pid" >/dev/null 2>&1; then
+ CHECK_PID=$pid
+ return 0
+ fi
+ fi
+ fi
+ local remove=${2:-0}
+ if [ $remove -eq 1 ]; then
+ rm -f "$pid_file"
+ fi
+ fi
+ CHECK_PID=0
+ return 1
+}
+
+#
+# Checking that the process with the specified PID is still
+# running and killing it in this case by sending SIGTERM
+# (using the "kill" operation).
+# The first parameter contains PID of the process.
+# The second and third parameters (both optional) are the names
+# of the PID and the configuration files, which should be removed
+# after the process ends.
+# If the first parameter (PID of the process) is zero, then
+# the function immediately deletes the PID and the configuration
+# files (if specified), without any additional checks.
+#
+cleanup_pid()
+{
+ local pid=$1
+ local pid_file="${2:-}"
+ local config="${3:-}"
+
+ if [ $pid -ne 0 ]; then
+ if ps -p $pid >/dev/null 2>&1; then
+ if kill $pid >/dev/null 2>&1; then
+ sleep 0.5
+ local round=0
+ local force=0
+ while ps -p $pid >/dev/null 2>&1; do
+ sleep 1
+ round=$(( round+1 ))
+ if [ $round -eq 16 ]; then
+ if [ $force -eq 0 ]; then
+ round=8
+ force=1
+ kill -9 $pid >/dev/null 2>&1
+ sleep 0.5
+ else
+ return 1
+ fi
+ fi
+ done
+ elif ps -p $pid >/dev/null 2>&1; then
+ wsrep_log_warning "Unable to kill PID=$pid ($pid_file)"
+ return 1
+ fi
+ fi
+ fi
+
+ [ -n "$pid_file" ] && [ -f "$pid_file" ] && rm -f "$pid_file"
+ [ -n "$config" ] && [ -f "$config" ] && rm -f "$config"
+
+ return 0
+}
+
+nproc=""
+
+get_proc()
+{
+ if [ -z "$nproc" ]; then
+ set +e
+ if [ "$OS" = 'Linux' ]; then
+ nproc=$(grep -c processor /proc/cpuinfo 2>/dev/null)
+ elif [ "$OS" = 'Darwin' -o "$OS" = 'FreeBSD' ]; then
+ nproc=$(sysctl -n hw.ncpu)
+ fi
+ if [ -z "$nproc" ] || [ $nproc -eq 0 ]; then
+ nproc=1
+ fi
+ set -e
fi
- echo $reval
}
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 4354e341ca5..3fe3bf5c206 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -1,6 +1,6 @@
#!/bin/bash -ue
+# Copyright (C) 2017-2021 MariaDB
# Copyright (C) 2013 Percona Inc
-# Copyright (C) 2017-2020 MariaDB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,26 +17,27 @@
# MA 02110-1335 USA.
# Documentation:
-# http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
+# https://mariadb.com/kb/en/mariabackup-overview/
# Make sure to read that before proceeding!
-. $(dirname $0)/wsrep_sst_common
+. $(dirname "$0")/wsrep_sst_common
+wsrep_check_datadir
-OS=$(uname)
+OS="$(uname)"
ealgo=""
+eformat=""
ekey=""
ekeyfile=""
encrypt=0
-nproc=1
ecode=0
ssyslog=""
ssystag=""
-XTRABACKUP_PID=""
-SST_PORT=""
-REMOTEIP=""
+BACKUP_PID=""
tcert=""
+tpath=0
tpem=""
tkey=""
+tmode="DISABLED"
sockopt=""
progress=""
ttime=0
@@ -45,22 +46,20 @@ lsn=""
ecmd=""
rlimit=""
# Initially
-stagemsg="${WSREP_SST_OPT_ROLE}"
+stagemsg="$WSREP_SST_OPT_ROLE"
cpat=""
speciald=1
ib_home_dir=""
ib_log_dir=""
ib_undo_dir=""
-sfmt="tar"
+sfmt=""
strmcmd=""
tfmt=""
tcmd=""
-rebuild=0
-rebuildcmd=""
payload=0
-pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' "
-pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE "
+pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p'"
+pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE"
STATDIR=""
uextra=0
disver=""
@@ -72,46 +71,55 @@ xtmpdir=""
scomp=""
sdecomp=""
+ssl_dhparams=""
+
+compress='none'
+compress_chunk=""
+compress_threads=""
+
+backup_threads=""
+
+encrypt_threads=""
+encrypt_chunk=""
+
+readonly SECRET_TAG="secret"
+
# Required for backup locks
# For backup locks it is 1 sent by joiner
-# 5.6.21 PXC and later can't donate to an older joiner
sst_ver=1
-if pv --help 2>/dev/null | grep -q FORMAT;then
- pvopts+=$pvformat
+if [ -n "$(command -v pv)" ] && pv --help | grep -qw -- '-F'; then
+ pvopts="$pvopts $pvformat"
fi
pcmd="pv $pvopts"
declare -a RC
-set +e
-INNOBACKUPEX_BIN=$(which mariabackup)
-if test -z $INNOBACKUPEX_BIN
-then
- wsrep_log_error 'mariabackup binary not found in $PATH'
- exit 42
+BACKUP_BIN="$(command -v mariabackup)"
+if [ ! -x "$BACKUP_BIN" ]; then
+ wsrep_log_error 'mariabackup binary not found in path'
+ exit 42
fi
-set -e
-XBSTREAM_BIN=mbstream
-XBCRYPT_BIN=xbcrypt # Not available in MariaBackup
-DATA="${WSREP_SST_OPT_DATA}"
+DATA="$WSREP_SST_OPT_DATA"
INFO_FILE="xtrabackup_galera_info"
IST_FILE="xtrabackup_ist"
-MAGIC_FILE="${DATA}/${INFO_FILE}"
-INNOAPPLYLOG="${DATA}/mariabackup.prepare.log"
-INNOMOVELOG="${DATA}/mariabackup.move.log"
-INNOBACKUPLOG="${DATA}/mariabackup.backup.log"
+MAGIC_FILE="$DATA/$INFO_FILE"
+
+INNOAPPLYLOG="$DATA/mariabackup.prepare.log"
+INNOMOVELOG="$DATA/mariabackup.move.log"
+INNOBACKUPLOG="$DATA/mariabackup.backup.log"
# Setting the path for ss and ip
export PATH="/usr/sbin:/sbin:$PATH"
-timeit(){
- local stage=$1
+timeit()
+{
+ local stage="$1"
shift
local cmd="$@"
local x1 x2 took extcode
- if [[ $ttime -eq 1 ]];then
+ if [ $ttime -eq 1 ]; then
x1=$(date +%s)
wsrep_log_info "Evaluating $cmd"
eval "$cmd"
@@ -120,7 +128,7 @@ timeit(){
took=$(( x2-x1 ))
wsrep_log_info "NOTE: $stage took $took seconds"
totime=$(( totime+took ))
- else
+ else
wsrep_log_info "Evaluating $cmd"
eval "$cmd"
extcode=$?
@@ -131,78 +139,113 @@ timeit(){
get_keys()
{
# $encrypt -eq 1 is for internal purposes only
- if [[ $encrypt -ge 2 || $encrypt -eq -1 ]];then
- return
+ if [ $encrypt -ge 2 -o $encrypt -eq -1 ]; then
+ return
fi
- if [[ $encrypt -eq 0 ]];then
- if $MY_PRINT_DEFAULTS xtrabackup | grep -q encrypt;then
- wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html"
+ if [ $encrypt -eq 0 ]; then
+ if [ -n "$ealgo" -o -n "$ekey" -o -n "$ekeyfile" ]; then
+ wsrep_log_error "Options for encryption are specified, " \
+ "but encryption itself is disabled. SST may fail."
fi
return
fi
- if [[ $sfmt == 'tar' ]];then
- wsrep_log_info "NOTE: Xtrabackup-based encryption - encrypt=1 - cannot be enabled with tar format"
+ if [ $sfmt = 'tar' ]; then
+ wsrep_log_info "NOTE: key-based encryption (encrypt=1) " \
+ "cannot be enabled with tar format"
encrypt=-1
return
fi
- wsrep_log_info "Xtrabackup based encryption enabled in my.cnf - Supported only from Xtrabackup 2.1.4"
+ wsrep_log_info "Key based encryption enabled in my.cnf"
- if [[ -z $ealgo ]];then
+ if [ -z "$ealgo" ]; then
wsrep_log_error "FATAL: Encryption algorithm empty from my.cnf, bailing out"
exit 3
fi
- if [[ -z $ekey && ! -r $ekeyfile ]];then
- wsrep_log_error "FATAL: Either key or keyfile must be readable"
+ if [ -z "$ekey" -a ! -r "$ekeyfile" ]; then
+ wsrep_log_error "FATAL: Either key must be specified " \
+ "or keyfile must be readable"
exit 3
fi
- if [[ -z $ekey ]];then
- ecmd="${XBCRYPT_BIN} --encrypt-algo=$ealgo --encrypt-key-file=$ekeyfile"
+ if [ "$eformat" = 'openssl' ]; then
+ get_openssl
+ if [ -z "$OPENSSL_BINARY" ]; then
+ wsrep_log_error "If encryption using the openssl is enabled, " \
+ "then you need to install openssl"
+ exit 2
+ fi
+ ecmd="'$OPENSSL_BINARY' enc -$ealgo"
+ if "$OPENSSL_BINARY" enc -help 2>&1 | grep -qw -- '-pbkdf2'; then
+ ecmd="$ecmd -pbkdf2"
+ elif "$OPENSSL_BINARY" enc -help 2>&1 | grep -qw -- '-iter'; then
+ ecmd="$ecmd -iter 1"
+ elif "$OPENSSL_BINARY" enc -help 2>&1 | grep -qw -- '-md'; then
+ ecmd="$ecmd -md sha256"
+ fi
+ if [ -z "$ekey" ]; then
+ ecmd="$ecmd -kfile '$ekeyfile'"
+ else
+ ecmd="$ecmd -k '$ekey'"
+ fi
+ elif [ "$eformat" = 'xbcrypt' ]; then
+ if [ -z "$(command -v xbcrypt)" ]; then
+ wsrep_log_error "If encryption using the xbcrypt is enabled, " \
+ "then you need to install xbcrypt"
+ exit 2
+ fi
+ wsrep_log_info "NOTE: xbcrypt-based encryption, " \
+ "supported only from Xtrabackup 2.1.4"
+ if [ -z "$ekey" ]; then
+ ecmd="xbcrypt --encrypt-algo='$ealgo' --encrypt-key-file='$ekeyfile'"
+ else
+ ecmd="xbcrypt --encrypt-algo='$ealgo' --encrypt-key='$ekey'"
+ fi
+ if [ -n "$encrypt_threads" ]; then
+ ecmd="$ecmd --encrypt-threads=$encrypt_threads"
+ fi
+ if [ -n "$encrypt_chunk" ]; then
+ ecmd="$ecmd --encrypt-chunk-size=$encrypt_chunk"
+ fi
else
- ecmd="${XBCRYPT_BIN} --encrypt-algo=$ealgo --encrypt-key=$ekey"
+ wsrep_log_error "Unknown encryption format='$eformat'"
+ exit 2
fi
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- ecmd+=" -d"
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ ecmd="$ecmd -d"
fi
- stagemsg+="-XB-Encrypted"
+ stagemsg="$stagemsg-XB-Encrypted"
}
get_transfer()
{
- if [[ -z $SST_PORT ]];then
- TSST_PORT=4444
- else
- TSST_PORT=$SST_PORT
- fi
-
- if [[ $tfmt == 'nc' ]];then
- wsrep_check_programs nc
-
+ if [ $tfmt = 'nc' ]; then
wsrep_log_info "Using netcat as streamer"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- if nc -h 2>&1 | grep -q ncat;then
- # Ncat
- tcmd="nc -l ${TSST_PORT}"
- elif nc -h 2>&1 | grep -qw -- '-d\>';then
- # Debian netcat
- if [ $WSREP_SST_OPT_HOST_IPv6 -eq 1 ];then
+ wsrep_check_programs nc
+ tcmd="nc"
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ if nc -h 2>&1 | grep -q 'ncat'; then
+ wsrep_log_info "Using Ncat as streamer"
+ tcmd="$tcmd -l"
+ elif nc -h 2>&1 | grep -qw -- '-d'; then
+ wsrep_log_info "Using Debian netcat as streamer"
+ tcmd="$tcmd -dl"
+ if [ $WSREP_SST_OPT_HOST_IPv6 -eq 1 ]; then
# When host is not explicitly specified (when only the port
# is specified) netcat can only bind to an IPv4 address if
# the "-6" option is not explicitly specified:
- tcmd="nc -dl -6 ${TSST_PORT}"
- else
- tcmd="nc -dl ${TSST_PORT}"
+ tcmd="$tcmd -6"
fi
else
- # traditional netcat
- tcmd="nc -l -p ${TSST_PORT}"
+ wsrep_log_info "Using traditional netcat as streamer"
+ tcmd="$tcmd -l -p"
fi
+ tcmd="$tcmd $SST_PORT"
else
# Check to see if netcat supports the '-N' flag.
# -N Shutdown the network socket after EOF on stdin
@@ -211,121 +254,191 @@ get_transfer()
# transfer and cause the command to timeout.
# Older versions of netcat did not need this flag and will
# return an error if the flag is used.
- #
- tcmd_extra=""
- if nc -h 2>&1 | grep -qw -- -N; then
- tcmd_extra+="-N"
- wsrep_log_info "Using nc -N"
+ if nc -h 2>&1 | grep -qw -- '-N'; then
+ tcmd="$tcmd -N"
+ wsrep_log_info "Using nc -N"
fi
-
# netcat doesn't understand [] around IPv6 address
- if nc -h 2>&1 | grep -q ncat;then
- # Ncat
+ if nc -h 2>&1 | grep -q ncat; then
wsrep_log_info "Using Ncat as streamer"
- tcmd="nc ${tcmd_extra} ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
- elif nc -h 2>&1 | grep -qw -- '-d\>';then
- # Debian netcat
+ elif nc -h 2>&1 | grep -qw -- '-d'; then
wsrep_log_info "Using Debian netcat as streamer"
- tcmd="nc ${tcmd_extra} ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
else
- # traditional netcat
wsrep_log_info "Using traditional netcat as streamer"
- tcmd="nc -q0 ${tcmd_extra} ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
+ tcmd="$tcmd -q0"
fi
+ tcmd="$tcmd $WSREP_SST_OPT_HOST_UNESCAPED $SST_PORT"
fi
else
tfmt='socat'
- wsrep_check_programs socat
+
wsrep_log_info "Using socat as streamer"
+ wsrep_check_programs socat
+
+ if [ -n "$sockopt" ]; then
+ sockopt=$(trim_string "$sockopt" ',')
+ if [ -n "$sockopt" ]; then
+ sockopt=",$sockopt"
+ fi
+ fi
+
+ # Add an option for ipv6 if needed:
+ if [ $WSREP_SST_OPT_HOST_IPv6 -eq 1 ]; then
+ # If sockopt contains 'pf=ip6' somewhere in the middle,
+ # this will not interfere with socat, but exclude the trivial
+ # cases when sockopt contains 'pf=ip6' as prefix or suffix:
+ if [ "$sockopt" = "${sockopt#,pf=ip6}" -a \
+ "$sockopt" = "${sockopt%,pf=ip6}" ]
+ then
+ sockopt=",pf=ip6$sockopt"
+ fi
+ fi
- if [[ $encrypt -eq 2 || $encrypt -eq 3 ]] && ! socat -V | grep -q "WITH_OPENSSL 1";then
- wsrep_log_error "Encryption requested, but socat is not OpenSSL enabled (encrypt=$encrypt)"
+ if [ $encrypt -lt 2 ]; then
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ tcmd="socat -u TCP-LISTEN:$SST_PORT,reuseaddr$sockopt stdio"
+ else
+ tcmd="socat -u stdio TCP:$REMOTEIP:$SST_PORT$sockopt"
+ fi
+ return
+ fi
+
+ if ! socat -V | grep -q -F 'WITH_OPENSSL 1'; then
+ wsrep_log_error "******** FATAL ERROR ************************************************ "
+ wsrep_log_error "* Encryption requested, but socat is not OpenSSL enabled (encrypt=$encrypt) *"
+ wsrep_log_error "********************************************************************* "
exit 2
fi
- if [[ $encrypt -eq 2 ]];then
+ local action='Decrypting'
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ tcmd="socat -u openssl-listen:$SST_PORT,reuseaddr"
+ else
+ tcmd="socat -u stdio openssl-connect:$REMOTEIP:$SST_PORT"
+ action='Encrypting'
+ fi
+
+ if [ "${sockopt#*,dhparam=}" != "$sockopt" ]; then
+ if [ -z "$ssl_dhparams" ]; then
+ # Determine the socat version
+ SOCAT_VERSION=$(socat -V 2>&1 | grep -m1 -oe '[0-9]\.[0-9][\.0-9]*')
+ if [ -z "$SOCAT_VERSION" ]; then
+ wsrep_log_error "******** FATAL ERROR ******************"
+ wsrep_log_error "* Cannot determine the socat version. *"
+ wsrep_log_error "***************************************"
+ exit 2
+ fi
+ if ! check_for_version "$SOCAT_VERSION" '1.7.3'; then
+ # socat versions < 1.7.3 will have 512-bit dhparams (too small)
+ # so create 2048-bit dhparams and send that as a parameter:
+ check_for_dhparams
+ fi
+ fi
+ if [ -n "$ssl_dhparams" ]; then
+ tcmd="$tcmd,dhparam='$ssl_dhparams'"
+ fi
+ fi
+
+ CN_option=",commonname=''"
+
+ if [ $encrypt -eq 2 ]; then
wsrep_log_info "Using openssl based encryption with socat: with crt and pem"
- if [[ -z $tpem || -z $tcert ]];then
- wsrep_log_error "Both PEM and CRT files required"
+ if [ -z "$tpem" -o -z "$tcert" ]; then
+ wsrep_log_error \
+ "Both PEM file and CRT file (or path) are required"
exit 22
fi
- stagemsg+="-OpenSSL-Encrypted-2"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- wsrep_log_info "Decrypting with cert=${tpem}, cafile=${tcert}"
- tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tpem},cafile=${tcert}${sockopt} stdio"
+ if [ ! -r "$tpem" -o ! -r "$tcert" ]; then
+ wsrep_log_error \
+ "Both PEM file and CRT file (or path) must be readable"
+ exit 22
+ fi
+ verify_ca_matches_cert "$tcert" "$tpem" $tpath
+ if [ $tpath -eq 0 ]; then
+ tcmd="$tcmd,cert='$tpem',cafile='$tcert'"
else
- wsrep_log_info "Encrypting with cert=${tpem}, cafile=${tcert}"
- tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},cafile=${tcert}${sockopt}"
+ tcmd="$tcmd,cert='$tpem',capath='$tcert'"
fi
- elif [[ $encrypt -eq 3 ]];then
+ stagemsg="$stagemsg-OpenSSL-Encrypted-2"
+ wsrep_log_info "$action with cert=$tpem, ca=$tcert"
+ elif [ $encrypt -eq 3 -o $encrypt -eq 4 ]; then
wsrep_log_info "Using openssl based encryption with socat: with key and crt"
- if [[ -z $tpem || -z $tkey ]];then
- wsrep_log_error "Both certificate and key files required"
+ if [ -z "$tpem" -o -z "$tkey" ]; then
+ wsrep_log_error "Both certificate file (or path) " \
+ "and key file are required"
exit 22
fi
- stagemsg+="-OpenSSL-Encrypted-3"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- if [[ -z $tcert ]];then
- wsrep_log_info "Decrypting with cert=${tpem}, key=${tkey}, verify=0"
- tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tpem},key=${tkey},verify=0${sockopt} stdio"
- else
- wsrep_log_info "Decrypting with cert=${tpem}, key=${tkey}, cafile=${tcert}"
- tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tpem},key=${tkey},cafile=${tcert}${sockopt} stdio"
+ if [ ! -r "$tpem" -o ! -r "$tkey" ]; then
+ wsrep_log_error "Both certificate file (or path) " \
+ "and key file must be readable"
+ exit 22
+ fi
+ verify_cert_matches_key "$tpem" "$tkey"
+ stagemsg="$stagemsg-OpenSSL-Encrypted-3"
+ if [ -z "$tcert" ]; then
+ if [ $encrypt -eq 4 ]; then
+ wsrep_log_error \
+ "Peer certificate file (or path) required if encrypt=4"
+ exit 22
fi
+ # no verification
+ CN_option=""
+ tcmd="$tcmd,cert='$tpem',key='$tkey',verify=0"
+ wsrep_log_info "$action with cert=$tpem, key=$tkey, verify=0"
else
- if [[ -z $tcert ]];then
- wsrep_log_info "Encrypting with cert=${tpem}, key=${tkey}, verify=0"
- tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},key=${tkey},verify=0${sockopt}"
+ # CA verification
+ if [ ! -r "$tcert" ]; then
+ wsrep_log_error "Certificate file or path must be readable"
+ exit 22
+ fi
+ verify_ca_matches_cert "$tcert" "$tpem" $tpath
+ if [ -n "$WSREP_SST_OPT_REMOTE_USER" ]; then
+ CN_option=",commonname='$WSREP_SST_OPT_REMOTE_USER'"
+ elif [ "$WSREP_SST_OPT_ROLE" = 'joiner' -o $encrypt -eq 4 ]
+ then
+ CN_option=",commonname=''"
+ elif is_local_ip "$WSREP_SST_OPT_HOST_UNESCAPED"; then
+ CN_option=',commonname=localhost'
else
- wsrep_log_info "Encrypting with cert=${tpem}, key=${tkey}, cafile=${tcert}"
- tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},key=${tkey},cafile=${tcert}${sockopt}"
+ CN_option=",commonname='$WSREP_SST_OPT_HOST_UNESCAPED'"
fi
+ if [ $tpath -eq 0 ]; then
+ tcmd="$tcmd,cert='$tpem',key='$tkey',cafile='$tcert'"
+ else
+ tcmd="$tcmd,cert='$tpem',key='$tkey',capath='$tcert'"
+ fi
+ wsrep_log_info "$action with cert=$tpem, key=$tkey, ca=$tcert"
fi
-
- else
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio"
- else
- tcmd="socat -u stdio TCP:${REMOTEIP}:${TSST_PORT}${sockopt}"
- fi
+ else
+ wsrep_log_info "Unknown encryption mode: encrypt=$encrypt"
+ exit 22
fi
- fi
-}
+ tcmd="$tcmd$CN_option$sockopt"
-parse_cnf()
-{
- local group=$1
- local var=$2
- # print the default settings for given group using my_print_default.
- # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin)
- # then grep for needed variable
- # finally get the variable value (if variables has been specified multiple time use the last value only)
- reval=$($MY_PRINT_DEFAULTS $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
- if [[ -z $reval ]];then
- [[ -n $3 ]] && reval=$3
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ tcmd="$tcmd stdio"
+ fi
fi
- echo $reval
}
get_footprint()
{
- pushd $WSREP_SST_OPT_DATA 1>/dev/null
- payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c | awk 'END { print $1 }')
- if $MY_PRINT_DEFAULTS xtrabackup | grep -q -- "--compress";then
+ pushd "$WSREP_SST_OPT_DATA" 1>/dev/null
+ payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c -s | awk 'END { print $1 }')
+ if [ "$compress" != 'none' ]; then
# QuickLZ has around 50% compression ratio
# When compression/compaction used, the progress is only an approximate.
payload=$(( payload*1/2 ))
fi
popd 1>/dev/null
- pcmd+=" -s $payload"
+ pcmd="$pcmd -s $payload"
adjust_progress
}
adjust_progress()
{
-
- if ! command -v pv >/dev/null;then
+ if [ -z "$(command -v pv)" ]; then
wsrep_log_error "pv not found in path: $PATH"
wsrep_log_error "Disabling all progress/rate-limiting"
pcmd=""
@@ -334,50 +447,106 @@ adjust_progress()
return
fi
- if [[ -n $progress && $progress != '1' ]];then
- if [[ -e $progress ]];then
- pcmd+=" 2>>$progress"
- else
- pcmd+=" 2>$progress"
+ if [ -n "$progress" -a "$progress" != '1' ]; then
+ if [ -e "$progress" ]; then
+ pcmd="$pcmd 2>>'$progress'"
+ else
+ pcmd="$pcmd 2>'$progress'"
fi
- elif [[ -z $progress && -n $rlimit ]];then
+ elif [ -z "$progress" -a -n "$rlimit" ]; then
# When rlimit is non-zero
pcmd="pv -q"
- fi
+ fi
- if [[ -n $rlimit && "$WSREP_SST_OPT_ROLE" == "donor" ]];then
+ if [ -n "$rlimit" -a "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
wsrep_log_info "Rate-limiting SST to $rlimit"
- pcmd+=" -L \$rlimit"
+ pcmd="$pcmd -L \$rlimit"
+ fi
+}
+
+encgroups='--mysqld|sst|xtrabackup'
+
+check_server_ssl_config()
+{
+ # backward-compatible behavior:
+ tcert=$(parse_cnf 'sst' 'tca')
+ tpem=$(parse_cnf 'sst' 'tcert')
+ tkey=$(parse_cnf 'sst' 'tkey')
+ # reading new ssl configuration options:
+ local tcert2=$(parse_cnf "$encgroups" 'ssl-ca')
+ local tpem2=$(parse_cnf "$encgroups" 'ssl-cert')
+ local tkey2=$(parse_cnf "$encgroups" 'ssl-key')
+ # if there are no old options, then we take new ones:
+ if [ -z "$tcert" -a -z "$tpem" -a -z "$tkey" ]; then
+ tcert="$tcert2"
+ tpem="$tpem2"
+ tkey="$tkey2"
+ # checking for presence of the new-style SSL configuration:
+ elif [ -n "$tcert2" -o -n "$tpem2" -o -n "$tkey2" ]; then
+ if [ "$tcert" != "$tcert2" -o \
+ "$tpem" != "$tpem2" -o \
+ "$tkey" != "$tkey2" ]
+ then
+ wsrep_log_info "new ssl configuration options (ssl-ca, ssl-cert " \
+ "and ssl-key) are ignored by SST due to presence " \
+ "of the tca, tcert and/or tkey in the [sst] section"
+ fi
+ fi
+ if [ -n "$tcert" ]; then
+ tcert=$(trim_string "$tcert")
+ if [ "${tcert%/}" != "$tcert" ]; then
+ tpath=1
+ fi
fi
}
read_cnf()
{
- sfmt=$(parse_cnf sst streamfmt "xbstream")
- tfmt=$(parse_cnf sst transferfmt "socat")
- tcert=$(parse_cnf sst tca "")
- tpem=$(parse_cnf sst tcert "")
- tkey=$(parse_cnf sst tkey "")
- encrypt=$(parse_cnf sst encrypt 0)
+ sfmt=$(parse_cnf sst streamfmt 'mbstream')
+ tfmt=$(parse_cnf sst transferfmt 'socat')
+
+ encrypt=$(parse_cnf "$encgroups" 'encrypt' 0)
+ tmode=$(parse_cnf "$encgroups" 'ssl-mode' 'DISABLED' | tr [:lower:] [:upper:])
+
+ if [ $encrypt -eq 0 -o $encrypt -ge 2 ]
+ then
+ if [ "$tmode" != 'DISABLED' -o $encrypt -ge 2 ]; then
+ check_server_ssl_config
+ fi
+ if [ "$tmode" != 'DISABLED' ]; then
+ if [ 0 -eq $encrypt -a -n "$tpem" -a -n "$tkey" ]
+ then
+ encrypt=3 # enable cert/key SSL encyption
+
+ # avoid CA verification if not set explicitly:
+ # nodes may happen to have different CA if self-generated
+ # zeroing up tcert does the trick
+ [ "${tmode#VERIFY}" != "$tmode" ] || tcert=""
+ fi
+ fi
+ elif [ $encrypt -eq 1 ]; then
+ ealgo=$(parse_cnf "$encgroups" 'encrypt-algo')
+ eformat=$(parse_cnf "$encgroups" 'encrypt-format' 'openssl')
+ ekey=$(parse_cnf "$encgroups" 'encrypt-key')
+ # The keyfile should be read only when the key
+ # is not specified or empty:
+ if [ -z "$ekey" ]; then
+ ekeyfile=$(parse_cnf "$encgroups" 'encrypt-key-file')
+ fi
+ fi
+
+ wsrep_log_info "SSL configuration: CA='$tcert', CERT='$tpem'," \
+ "KEY='$tkey', MODE='$tmode', encrypt='$encrypt'"
+
sockopt=$(parse_cnf sst sockopt "")
progress=$(parse_cnf sst progress "")
- rebuild=$(parse_cnf sst rebuild 0)
ttime=$(parse_cnf sst time 0)
- cpat=$(parse_cnf sst cpat '.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$')
- [[ $OS == "FreeBSD" ]] && cpat=$(parse_cnf sst cpat '.*galera\.cache$|.*sst_in_progress$|.*\.sst$|.*gvwstate\.dat$|.*grastate\.dat$|.*\.err$|.*\.log$|.*RPM_UPGRADE_MARKER$|.*RPM_UPGRADE_HISTORY$')
- ealgo=$(parse_cnf xtrabackup encrypt "")
- ekey=$(parse_cnf xtrabackup encrypt-key "")
- ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "")
+ cpat='.*\.pem$\|.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$'
+ [ "$OS" = 'FreeBSD' ] && cpat=$(echo "$cpat" | sed 's/\\|/|/g')
+ cpat=$(parse_cnf sst cpat "$cpat")
scomp=$(parse_cnf sst compressor "")
sdecomp=$(parse_cnf sst decompressor "")
- # Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
- if [[ -z $ealgo ]];then
- ealgo=$(parse_cnf sst encrypt-algo "")
- ekey=$(parse_cnf sst encrypt-key "")
- ekeyfile=$(parse_cnf sst encrypt-key-file "")
- fi
-
rlimit=$(parse_cnf sst rlimit "")
uextra=$(parse_cnf sst use-extra 0)
speciald=$(parse_cnf sst sst-special-dirs 1)
@@ -387,293 +556,265 @@ read_cnf()
stimeout=$(parse_cnf sst sst-initial-timeout 300)
ssyslog=$(parse_cnf sst sst-syslog 0)
ssystag=$(parse_cnf mysqld_safe syslog-tag "${SST_SYSLOG_TAG:-}")
- ssystag+="-"
+ ssystag="$ssystag-"
sstlogarchive=$(parse_cnf sst sst-log-archive 1)
- sstlogarchivedir=$(parse_cnf sst sst-log-archive-dir "/tmp/sst_log_archive")
+ sstlogarchivedir=$(parse_cnf sst sst-log-archive-dir '/tmp/sst_log_archive')
- if [[ $speciald -eq 0 ]];then
+ if [ $speciald -eq 0 ]; then
wsrep_log_error "sst-special-dirs equal to 0 is not supported, falling back to 1"
speciald=1
- fi
+ fi
- if [[ $ssyslog -ne -1 ]];then
- if $MY_PRINT_DEFAULTS mysqld_safe | tr '_' '-' | grep -q -- "--syslog";then
- ssyslog=1
+ if [ $ssyslog -ne -1 ]; then
+ ssyslog=$(in_config 'mysqld_safe' 'syslog')
+ fi
+
+ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
+ compress=$(parse_cnf "$encgroups" 'compress' 'none')
+ if [ "$compress" != 'none' ]; then
+ compress_chunk=$(parse_cnf "$encgroups" 'compress-chunk-size')
+ compress_threads=$(parse_cnf "$encgroups" 'compress-threads')
fi
fi
- if [[ $encrypt -eq 1 ]]; then
- wsrep_log_error "Xtrabackup-based encryption is currently not" \
- "supported with MariaBackup"
- exit 2
+ backup_threads=$(parse_cnf "$encgroups" 'backup-threads')
+
+ if [ "$eformat" = 'xbcrypt' ]; then
+ encrypt_threads=$(parse_cnf "$encgroups" 'encrypt-threads')
+ encrypt_chunk=$(parse_cnf "$encgroups" 'encrypt-chunk-size')
fi
}
get_stream()
{
- if [[ $sfmt == 'mbstream' || $sfmt == 'xbstream' ]];then
- wsrep_log_info "Streaming with ${sfmt}"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- strmcmd="${XBSTREAM_BIN} -x"
+ if [ "$sfmt" = 'mbstream' -o "$sfmt" = 'xbstream' ]; then
+ sfmt='mbstream'
+ STREAM_BIN="$(command -v mbstream)"
+ if [ -z "$STREAM_BIN" ]; then
+ wsrep_log_error "Streaming with $sfmt, but $sfmt not found in path"
+ exit 42
+ fi
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ strmcmd="'$STREAM_BIN' -x"
else
- strmcmd="${XBSTREAM_BIN} -c \${INFO_FILE}"
+ strmcmd="'$STREAM_BIN' -c '$INFO_FILE'"
fi
else
- sfmt="tar"
- wsrep_log_info "Streaming with tar"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- strmcmd="tar xfi - "
+ sfmt='tar'
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ strmcmd='tar xfi -'
else
- strmcmd="tar cf - \${INFO_FILE} "
+ strmcmd="tar cf - '$INFO_FILE'"
fi
-
fi
-}
-
-get_proc()
-{
- set +e
- nproc=$(grep -c processor /proc/cpuinfo)
- [[ -z $nproc || $nproc -eq 0 ]] && nproc=1
- set -e
+ wsrep_log_info "Streaming with $sfmt"
}
sig_joiner_cleanup()
{
wsrep_log_error "Removing $MAGIC_FILE file due to signal"
- rm -f "$MAGIC_FILE"
-}
-
-cleanup_joiner()
-{
- # Since this is invoked just after exit NNN
- local estatus=$?
- if [[ $estatus -ne 0 ]];then
- wsrep_log_error "Cleanup after exit with status:$estatus"
- elif [ "${WSREP_SST_OPT_ROLE}" = "joiner" ];then
- wsrep_log_info "Removing the sst_in_progress file"
- wsrep_cleanup_progress_file
- fi
- if [[ -n $progress && -p $progress ]];then
- wsrep_log_info "Cleaning up fifo file $progress"
- rm $progress
- fi
- if [[ -n ${STATDIR:-} ]];then
- [[ -d $STATDIR ]] && rm -rf $STATDIR
- fi
-
- # Final cleanup
- pgid=$(ps -o pgid= $$ | grep -o '[0-9]*')
-
- # This means no setsid done in mysqld.
- # We don't want to kill mysqld here otherwise.
- if [[ $$ -eq $pgid ]];then
-
- # This means a signal was delivered to the process.
- # So, more cleanup.
- if [[ $estatus -ge 128 ]];then
- kill -KILL -$$ || true
- fi
-
- fi
-
- exit $estatus
-}
-
-check_pid()
-{
- local pid_file="$1"
- [ -r "$pid_file" ] && ps -p $(cat "$pid_file") >/dev/null 2>&1
+ [ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
}
-cleanup_donor()
+cleanup_at_exit()
{
# Since this is invoked just after exit NNN
local estatus=$?
- if [[ $estatus -ne 0 ]];then
+ if [ $estatus -ne 0 ]; then
wsrep_log_error "Cleanup after exit with status:$estatus"
fi
- if [[ -n ${XTRABACKUP_PID:-} ]];then
- if check_pid $XTRABACKUP_PID
- then
- wsrep_log_error "xtrabackup process is still running. Killing..."
- kill_xtrabackup
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ wsrep_log_info "Removing the sst_in_progress file"
+ wsrep_cleanup_progress_file
+ else
+ if [ -n "$BACKUP_PID" ]; then
+ if check_pid "$BACKUP_PID" 1; then
+ wsrep_log_error "mariabackup process is still running. Killing..."
+ cleanup_pid $CHECK_PID "$BACKUP_PID"
+ fi
fi
-
+ [ -f "$DATA/$IST_FILE" ] && rm -f "$DATA/$IST_FILE"
fi
- rm -f ${DATA}/${IST_FILE} || true
- if [[ -n $progress && -p $progress ]];then
+ if [ -n "$progress" -a -p "$progress" ]; then
wsrep_log_info "Cleaning up fifo file $progress"
- rm -f $progress || true
+ rm -f "$progress" || true
fi
wsrep_log_info "Cleaning up temporary directories"
- if [[ -n $xtmpdir ]];then
- [[ -d $xtmpdir ]] && rm -rf $xtmpdir || true
- fi
-
- if [[ -n $itmpdir ]];then
- [[ -d $itmpdir ]] && rm -rf $itmpdir || true
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ if [ -n "$STATDIR" ]; then
+ [ -d "$STATDIR" ] && rm -rf "$STATDIR"
+ fi
+ else
+ [ -n "$xtmpdir" -a -d "$xtmpdir" ] && rm -rf "$xtmpdir" || true
+ [ -n "$itmpdir" -a -d "$itmpdir" ] && rm -rf "$itmpdir" || true
fi
- # Final cleanup
+ # Final cleanup
pgid=$(ps -o pgid= $$ | grep -o '[0-9]*')
# This means no setsid done in mysqld.
# We don't want to kill mysqld here otherwise.
- if [[ $$ -eq $pgid ]];then
-
+ if [ $$ -eq $pgid ]; then
# This means a signal was delivered to the process.
- # So, more cleanup.
- if [[ $estatus -ge 128 ]];then
- kill -KILL -$$ || true
+ # So, more cleanup.
+ if [ $estatus -ge 128 ]; then
+ kill -KILL -- -$$ || true
fi
-
fi
exit $estatus
-
-}
-
-kill_xtrabackup()
-{
- local PID=$(cat $XTRABACKUP_PID)
- [ -n "$PID" -a "0" != "$PID" ] && kill $PID && (kill $PID && kill -9 $PID) || :
- wsrep_log_info "Removing xtrabackup pid file $XTRABACKUP_PID"
- rm -f "$XTRABACKUP_PID" || true
}
setup_ports()
{
- SST_PORT=${WSREP_SST_OPT_ADDR_PORT}
- if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then
- REMOTEIP=${WSREP_SST_OPT_HOST}
- lsn=${WSREP_SST_OPT_LSN}
- sst_ver=${WSREP_SST_OPT_SST_VER}
+ SST_PORT="$WSREP_SST_OPT_PORT"
+ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
+ REMOTEIP="$WSREP_SST_OPT_HOST"
+ lsn="$WSREP_SST_OPT_LSN"
+ sst_ver="$WSREP_SST_OPT_SST_VER"
fi
}
-# waits ~10 seconds for nc to open the port and then reports ready
-# (regardless of timeout)
+#
+# Waits ~30 seconds for socat or nc to open the port and
+# then reports ready, regardless of timeout.
+#
wait_for_listen()
{
- local PORT=$1
- local ADDR=$2
- local MODULE=$3
- for i in {1..50}
- do
- if [ "$OS" = "FreeBSD" ];then
- sockstat -46lp $PORT | grep -qE "^[^ ]* *(socat|nc) *[^ ]* *[^ ]* *[^ ]* *[^ ]*:$PORT" && break
- else
- ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break
+ local PORT="$1"
+ local ADDR="$2"
+ local MODULE="$3"
+ for i in {1..150}; do
+ if check_port "" "$PORT" 'socat|nc'; then
+ break
fi
sleep 0.2
done
- echo "ready ${ADDR}/${MODULE}//$sst_ver"
+ echo "ready $ADDR/$MODULE//$sst_ver"
}
check_extra()
{
local use_socket=1
- if [[ $uextra -eq 1 ]];then
- if $MY_PRINT_DEFAULTS --mysqld | tr '_' '-' | grep -- "--thread-handling=" | grep -q 'pool-of-threads';then
- local eport=$($MY_PRINT_DEFAULTS --mysqld | tr '_' '-' | grep -- "--extra-port=" | cut -d= -f2)
- if [[ -n $eport ]];then
- # Xtrabackup works only locally.
- # Hence, setting host to 127.0.0.1 unconditionally.
+ if [ $uextra -eq 1 ]; then
+ local thread_handling=$(parse_cnf '--mysqld' 'thread-handling')
+ if [ "$thread_handling" = 'pool-of-threads' ]; then
+ local eport=$(parse_cnf '--mysqld' 'extra-port')
+ if [ -n "$eport" ]; then
+ # mariabackup works only locally.
+ # Hence, setting host to 127.0.0.1 unconditionally:
wsrep_log_info "SST through extra_port $eport"
- INNOEXTRA+=" --host=127.0.0.1 --port=$eport"
+ INNOEXTRA="$INNOEXTRA --host=127.0.0.1 --port=$eport"
use_socket=0
- else
+ else
wsrep_log_error "Extra port $eport null, failing"
exit 1
fi
- else
+ else
wsrep_log_info "Thread pool not set, ignore the option use_extra"
fi
fi
- if [[ $use_socket -eq 1 ]] && [[ -n "$WSREP_SST_OPT_SOCKET" ]];then
- INNOEXTRA+=" --socket=$WSREP_SST_OPT_SOCKET"
+ if [ $use_socket -eq 1 -a -n "$WSREP_SST_OPT_SOCKET" ]; then
+ INNOEXTRA="$INNOEXTRA --socket='$WSREP_SST_OPT_SOCKET'"
fi
}
recv_joiner()
{
- local dir=$1
- local msg=$2
+ local dir="$1"
+ local msg="$2"
local tmt=$3
local checkf=$4
- local ltcmd
+ local wait=$5
- if [[ ! -d ${dir} ]];then
+ if [ ! -d "$dir" ]; then
# This indicates that IST is in progress
return
fi
- pushd ${dir} 1>/dev/null
+ local ltcmd="$tcmd"
+ if [ $tmt -gt 0 ]; then
+ if [ -n "$(command -v timeout)" ]; then
+ if timeout --help | grep -qw -- '-k'; then
+ ltcmd="timeout -k $(( tmt+10 )) $tmt $tcmd"
+ else
+ ltcmd="timeout -s9 $tmt $tcmd"
+ fi
+ fi
+ fi
+
+ pushd "$dir" 1>/dev/null
set +e
- if [[ $tmt -gt 0 ]] && command -v timeout >/dev/null;then
- if timeout --help | grep -q -- '-k';then
- ltcmd="timeout -k $(( tmt+10 )) $tmt $tcmd"
- else
- ltcmd="timeout -s9 $tmt $tcmd"
- fi
- timeit "$msg" "$ltcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )"
- else
- timeit "$msg" "$tcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )"
+ if [ $wait -ne 0 ]; then
+ wait_for_listen "$SST_PORT" "$ADDR" "$MODULE" &
fi
+ timeit "$msg" "$ltcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )"
+
set -e
- popd 1>/dev/null
+ popd 1>/dev/null
- if [[ ${RC[0]} -eq 124 ]];then
- wsrep_log_error "Possible timeout in receiving first data from "
- "donor in gtid stage: exit codes: ${RC[@]}"
+ if [ ${RC[0]} -eq 124 ]; then
+ wsrep_log_error "Possible timeout in receiving first data from " \
+ "donor in gtid stage: exit codes: ${RC[@]}"
exit 32
fi
- for ecode in "${RC[@]}";do
- if [[ $ecode -ne 0 ]];then
+ for ecode in "${RC[@]}"; do
+ if [ $ecode -ne 0 ]; then
wsrep_log_error "Error while getting data from donor node: " \
"exit codes: ${RC[@]}"
exit 32
fi
done
- if [[ $checkf -eq 1 && ! -r "${MAGIC_FILE}" ]];then
- # this message should cause joiner to abort
- wsrep_log_error "xtrabackup process ended without creating '${MAGIC_FILE}'"
- wsrep_log_info "Contents of datadir"
- wsrep_log_info "$(ls -l ${dir}/*)"
- exit 32
+ if [ $checkf -eq 1 ]; then
+ if [ ! -r "$MAGIC_FILE" ]; then
+ # this message should cause joiner to abort
+ wsrep_log_error "receiving process ended without creating " \
+ "'$MAGIC_FILE'"
+ wsrep_log_info "Contents of datadir"
+ wsrep_log_info $(ls -l "$dir/"*)
+ exit 32
+ fi
+
+ # check donor supplied secret
+ SECRET=$(grep -F -- "$SECRET_TAG " "$MAGIC_FILE" 2>/dev/null | cut -d ' ' -f 2)
+ if [ "$SECRET" != "$MY_SECRET" ]; then
+ wsrep_log_error "Donor does not know my secret!"
+ wsrep_log_info "Donor:'$SECRET', my:'$MY_SECRET'"
+ exit 32
+ fi
+
+ # remove secret from the magic file
+ grep -v -F -- "$SECRET_TAG " "$MAGIC_FILE" > "$MAGIC_FILE.new"
+ mv "$MAGIC_FILE.new" "$MAGIC_FILE"
fi
}
-
send_donor()
{
- local dir=$1
- local msg=$2
+ local dir="$1"
+ local msg="$2"
- pushd ${dir} 1>/dev/null
+ pushd "$dir" 1>/dev/null
set +e
timeit "$msg" "$strmcmd | $tcmd; RC=( "\${PIPESTATUS[@]}" )"
set -e
- popd 1>/dev/null
-
+ popd 1>/dev/null
- for ecode in "${RC[@]}";do
- if [[ $ecode -ne 0 ]];then
- wsrep_log_error "Error while getting data from donor node: " \
+ for ecode in "${RC[@]}"; do
+ if [ $ecode -ne 0 ]; then
+ wsrep_log_error "Error while sending data to joiner node: " \
"exit codes: ${RC[@]}"
exit 32
fi
done
-
}
monitor_process()
@@ -681,235 +822,216 @@ monitor_process()
local sst_stream_pid=$1
while true ; do
-
- if ! ps -p "${WSREP_SST_OPT_PARENT}" &>/dev/null; then
- wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
+ if ! ps -p "$WSREP_SST_OPT_PARENT" >/dev/null 2>&1; then
+ wsrep_log_error "Parent mysqld process (PID: $WSREP_SST_OPT_PARENT) terminated unexpectedly."
+ kill -- -"$WSREP_SST_OPT_PARENT"
exit 32
fi
-
- if ! ps -p "${sst_stream_pid}" &>/dev/null; then
+ if ! ps -p "$sst_stream_pid" >/dev/null 2>&1; then
break
fi
-
sleep 0.1
-
done
}
-wsrep_check_programs "$INNOBACKUPEX_BIN"
+[ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
-rm -f "${MAGIC_FILE}"
-
-if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then
- wsrep_log_error "Invalid role ${WSREP_SST_OPT_ROLE}"
+if [ "$WSREP_SST_OPT_ROLE" != 'joiner' -a "$WSREP_SST_OPT_ROLE" != 'donor' ]; then
+ wsrep_log_error "Invalid role '$WSREP_SST_OPT_ROLE'"
exit 22
fi
read_cnf
setup_ports
-if ${INNOBACKUPEX_BIN} /tmp --help 2>/dev/null | grep -q -- '--version-check'; then
- disver="--no-version-check"
+if "$BACKUP_BIN" --help 2>/dev/null | grep -qw -- '--version-check'; then
+ disver='--no-version-check'
fi
-iopts+=" --databases-exclude=\"lost+found\""
-
-if [[ ${FORCE_FTWRL:-0} -eq 1 ]];then
- wsrep_log_info "Forcing FTWRL due to environment variable FORCE_FTWRL equal to $FORCE_FTWRL"
- iopts+=" --no-backup-locks"
-fi
-
-INNOEXTRA=$WSREP_SST_OPT_MYSQLD
-
-INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""}
-# Try to set INNODB_DATA_HOME_DIR from the command line:
-if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
- INNODB_DATA_HOME_DIR=$INNODB_DATA_HOME_DIR_ARG
-fi
-# if no command line arg and INNODB_DATA_HOME_DIR environment variable
+# if no command line argument and INNODB_DATA_HOME_DIR environment variable
# is not set, try to get it from my.cnf:
if [ -z "$INNODB_DATA_HOME_DIR" ]; then
- INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
-fi
-if [ -z "$INNODB_DATA_HOME_DIR" ]; then
- INNODB_DATA_HOME_DIR=$(parse_cnf --mysqld innodb-data-home-dir '')
-fi
-if [ ! -z "$INNODB_DATA_HOME_DIR" ]; then
- INNOEXTRA+=" --innodb-data-home-dir=$INNODB_DATA_HOME_DIR"
+ INNODB_DATA_HOME_DIR=$(parse_cnf '--mysqld' 'innodb-data-home-dir')
fi
+OLD_PWD="$(pwd)"
+
+cd "$WSREP_SST_OPT_DATA"
if [ -n "$INNODB_DATA_HOME_DIR" ]; then
# handle both relative and absolute paths
- INNODB_DATA_HOME_DIR=$(cd $DATA; mkdir -p "$INNODB_DATA_HOME_DIR"; cd $INNODB_DATA_HOME_DIR; pwd -P)
-else
- # default to datadir
- INNODB_DATA_HOME_DIR=$(cd $DATA; pwd -P)
+ [ ! -d "$INNODB_DATA_HOME_DIR" ] && mkdir -p "$INNODB_DATA_HOME_DIR"
+ cd "$INNODB_DATA_HOME_DIR"
fi
+INNODB_DATA_HOME_DIR=$(pwd -P)
-if [[ $ssyslog -eq 1 ]];then
-
- if ! command -v logger >/dev/null;then
- wsrep_log_error "logger not in path: $PATH. Ignoring"
- else
+cd "$OLD_PWD"
- wsrep_log_info "Logging all stderr of SST/Innobackupex to syslog"
+if [ $ssyslog -eq 1 ]; then
+ if [ -n "$(command -v logger)" ]; then
+ wsrep_log_info "Logging all stderr of SST/mariabackup to syslog"
exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE)
wsrep_log_error()
{
- logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
+ logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
}
wsrep_log_info()
{
- logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
+ logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
}
-
- INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply"
- INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move"
- INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
+ else
+ wsrep_log_error "logger not in path: $PATH. Ignoring"
fi
-
+ INNOAPPLY="2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply"
+ INNOMOVE="2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move"
+ INNOBACKUP="2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
else
-
-if [[ "$sstlogarchive" -eq 1 ]]
-then
- ARCHIVETIMESTAMP=$(date "+%Y.%m.%d-%H.%M.%S.%N")
- newfile=""
-
- if [[ ! -z "$sstlogarchivedir" ]]
+ if [ $sstlogarchive -eq 1 ]
then
- if [[ ! -d "$sstlogarchivedir" ]]
- then
- mkdir -p "$sstlogarchivedir"
+ ARCHIVETIMESTAMP=$(date "+%Y.%m.%d-%H.%M.%S.%N")
+
+ if [ -n "$sstlogarchivedir" ]; then
+ if [ ! -d "$sstlogarchivedir" ]; then
+ mkdir -p "$sstlogarchivedir"
+ fi
fi
- fi
- if [ -e "${INNOAPPLYLOG}" ]
- then
- if [[ ! -z "$sstlogarchivedir" ]]
+ if [ -e "$INNOAPPLYLOG" ]
then
- newfile=$sstlogarchivedir/$(basename "${INNOAPPLYLOG}").${ARCHIVETIMESTAMP}
- else
- newfile=${INNOAPPLYLOG}.${ARCHIVETIMESTAMP}
+ if [ -n "$sstlogarchivedir" ]
+ then
+ newfile=$(basename "$INNOAPPLYLOG")
+ newfile="$sstlogarchivedir/$newfile.$ARCHIVETIMESTAMP"
+ else
+ newfile="$INNOAPPLYLOG.$ARCHIVETIMESTAMP"
+ fi
+ wsrep_log_info "Moving '$INNOAPPLYLOG' to '$newfile'"
+ mv "$INNOAPPLYLOG" "$newfile"
+ gzip "$newfile"
fi
-
- wsrep_log_info "Moving ${INNOAPPLYLOG} to ${newfile}"
- mv "${INNOAPPLYLOG}" "${newfile}"
- gzip "${newfile}"
- fi
- if [ -e "${INNOMOVELOG}" ]
- then
- if [[ ! -z "$sstlogarchivedir" ]]
+ if [ -e "$INNOMOVELOG" ]
then
- newfile=$sstlogarchivedir/$(basename "${INNOMOVELOG}").${ARCHIVETIMESTAMP}
- else
- newfile=${INNOMOVELOG}.${ARCHIVETIMESTAMP}
+ if [ -n "$sstlogarchivedir" ]
+ then
+ newfile=$(basename "$INNOMOVELOG")
+ newfile="$sstlogarchivedir/$newfile.$ARCHIVETIMESTAMP"
+ else
+ newfile="$INNOMOVELOG.$ARCHIVETIMESTAMP"
+ fi
+ wsrep_log_info "Moving '$INNOMOVELOG' to '$newfile'"
+ mv "$INNOMOVELOG" "$newfile"
+ gzip "$newfile"
fi
- wsrep_log_info "Moving ${INNOMOVELOG} to ${newfile}"
- mv "${INNOMOVELOG}" "${newfile}"
- gzip "${newfile}"
- fi
-
- if [ -e "${INNOBACKUPLOG}" ]
- then
- if [[ ! -z "$sstlogarchivedir" ]]
+ if [ -e "$INNOBACKUPLOG" ]
then
- newfile=$sstlogarchivedir/$(basename "${INNOBACKUPLOG}").${ARCHIVETIMESTAMP}
- else
- newfile=${INNOBACKUPLOG}.${ARCHIVETIMESTAMP}
+ if [ -n "$sstlogarchivedir" ]
+ then
+ newfile=$(basename "$INNOBACKUPLOG")
+ newfile="$sstlogarchivedir/$newfile.$ARCHIVETIMESTAMP"
+ else
+ newfile="$INNOBACKUPLOG.$ARCHIVETIMESTAMP"
+ fi
+ wsrep_log_info "Moving '$INNOBACKUPLOG' to '$newfile'"
+ mv "$INNOBACKUPLOG" "$newfile"
+ gzip "$newfile"
fi
-
- wsrep_log_info "Moving ${INNOBACKUPLOG} to ${newfile}"
- mv "${INNOBACKUPLOG}" "${newfile}"
- gzip "${newfile}"
fi
-
-fi
-
- INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} &> ${INNOAPPLYLOG}"
- INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} &> ${INNOMOVELOG}"
- INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> ${INNOBACKUPLOG}"
+ INNOAPPLY="> '$INNOAPPLYLOG' 2>&1"
+ INNOMOVE="> '$INNOMOVELOG' 2>&1"
+ INNOBACKUP="2> '$INNOBACKUPLOG'"
fi
+setup_commands()
+{
+ local mysqld_args=""
+ if [ -n "$WSREP_SST_OPT_MYSQLD" ]; then
+ mysqld_args="--mysqld-args $WSREP_SST_OPT_MYSQLD"
+ fi
+ INNOAPPLY="$BACKUP_BIN --prepare $disver $iapts $INNOEXTRA --target-dir='$DATA' --datadir='$DATA' $mysqld_args $INNOAPPLY"
+ INNOMOVE="$BACKUP_BIN $WSREP_SST_OPT_CONF --move-back $disver $impts --force-non-empty-directories --target-dir='$DATA' --datadir='${TDATA:-$DATA}' $INNOMOVE"
+ INNOBACKUP="$BACKUP_BIN $WSREP_SST_OPT_CONF --backup $disver $iopts $tmpopts $INNOEXTRA --galera-info --stream=$sfmt --target-dir='$itmpdir' --datadir='$DATA' $mysqld_args $INNOBACKUP"
+}
+
get_stream
get_transfer
-if [ "$WSREP_SST_OPT_ROLE" = "donor" ]
+if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]
then
- trap cleanup_donor EXIT
+ trap cleanup_at_exit EXIT
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]
then
- usrst=0
- if [[ -z $sst_ver ]];then
+ if [ -z "$sst_ver" ]; then
wsrep_log_error "Upgrade joiner to 5.6.21 or higher for backup locks support"
wsrep_log_error "The joiner is not supported for this version of donor"
exit 93
fi
- if [[ -z $(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE tmpdir "") && \
- -z $(parse_cnf --mysqld tmpdir "") && \
- -z $(parse_cnf xtrabackup tmpdir "") ]]; then
- xtmpdir=$(mktemp -d)
- tmpopts=" --tmpdir=$xtmpdir"
- wsrep_log_info "Using $xtmpdir as xtrabackup temporary directory"
+ tmpdir=$(parse_cnf "$encgroups" 'tmpdir')
+ if [ -z "$tmpdir" ]; then
+ xtmpdir="$(mktemp -d)"
+ elif [ "$OS" = 'Linux' ]; then
+ xtmpdir=$(mktemp '-d' "--tmpdir=$tmpdir")
+ else
+ xtmpdir=$(TMPDIR="$tmpdir"; mktemp '-d')
fi
- itmpdir=$(mktemp -d)
- wsrep_log_info "Using $itmpdir as innobackupex temporary directory"
+ wsrep_log_info "Using '$xtmpdir' as mariabackup temporary directory"
+ tmpopts="--tmpdir='$xtmpdir'"
- if [[ -n "${WSREP_SST_OPT_USER:-}" && "$WSREP_SST_OPT_USER" != "(null)" ]]; then
- INNOEXTRA+=" --user=$WSREP_SST_OPT_USER"
+ itmpdir="$(mktemp -d)"
+ wsrep_log_info "Using '$itmpdir' as mariabackup working directory"
+
+ usrst=0
+ if [ -n "$WSREP_SST_OPT_USER" ]; then
+ INNOEXTRA="$INNOEXTRA --user='$WSREP_SST_OPT_USER'"
usrst=1
fi
- if [ -n "${WSREP_SST_OPT_PSWD:-}" ]; then
- export MYSQL_PWD=$WSREP_SST_OPT_PSWD
- elif [[ $usrst -eq 1 ]];then
+ if [ -n "$WSREP_SST_OPT_PSWD" ]; then
+ export MYSQL_PWD="$WSREP_SST_OPT_PSWD"
+ elif [ $usrst -eq 1 ]; then
# Empty password, used for testing, debugging etc.
unset MYSQL_PWD
fi
- get_keys
- if [[ $encrypt -eq 1 ]];then
- if [[ -n $ekey ]];then
- INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey"
- else
- INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile"
- fi
- fi
-
check_extra
wsrep_log_info "Streaming GTID file before SST"
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
# (separated by a space).
- echo "${WSREP_SST_OPT_GTID} ${WSREP_SST_OPT_GTID_DOMAIN_ID}" > "${MAGIC_FILE}"
+ echo "$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID" > "$MAGIC_FILE"
+
+ if [ -n "$WSREP_SST_OPT_REMOTE_PSWD" ]; then
+ # Let joiner know that we know its secret
+ echo "$SECRET_TAG $WSREP_SST_OPT_REMOTE_PSWD" >> "$MAGIC_FILE"
+ fi
ttcmd="$tcmd"
- if [[ $encrypt -eq 1 ]];then
- if [[ -n $scomp ]];then
- tcmd=" $ecmd | $scomp | $tcmd "
- else
- tcmd=" $ecmd | $tcmd "
- fi
- elif [[ -n $scomp ]];then
- tcmd=" $scomp | $tcmd "
+ if [ -n "$scomp" ]; then
+ tcmd="$scomp | $tcmd"
fi
- send_donor $DATA "${stagemsg}-gtid"
+ get_keys
+ if [ $encrypt -eq 1 ]; then
+ tcmd="$ecmd | $tcmd"
+ fi
+ send_donor "$DATA" "$stagemsg-gtid"
+
+ # Restore the transport commmand to its original state
tcmd="$ttcmd"
- if [[ -n $progress ]];then
+
+ if [ -n "$progress" ]; then
get_footprint
tcmd="$pcmd | $tcmd"
- elif [[ -n $rlimit ]];then
+ elif [ -n "$rlimit" ]; then
adjust_progress
tcmd="$pcmd | $tcmd"
fi
@@ -917,28 +1039,57 @@ then
wsrep_log_info "Sleeping before data transfer for SST"
sleep 10
- wsrep_log_info "Streaming the backup to joiner at ${REMOTEIP} ${SST_PORT:-4444}"
+ wsrep_log_info "Streaming the backup to joiner at $REMOTEIP:$SST_PORT"
- if [[ -n $scomp ]];then
+ # Add compression to the head of the stream (if specified)
+ if [ -n "$scomp" ]; then
tcmd="$scomp | $tcmd"
fi
+ # Add encryption to the head of the stream (if specified)
+ if [ $encrypt -eq 1 ]; then
+ tcmd="$ecmd | $tcmd"
+ fi
+
+ iopts="--databases-exclude='lost+found' $iopts"
+
+ if [ ${FORCE_FTWRL:-0} -eq 1 ]; then
+ wsrep_log_info "Forcing FTWRL due to environment variable FORCE_FTWRL equal to $FORCE_FTWRL"
+ iopts="--no-backup-locks $iopts"
+ fi
+
+ # if compression is enabled for backup files, then add the
+ # appropriate options to the mariabackup command line:
+ if [ "$compress" != 'none' ]; then
+ iopts="--compress${compress:+=$compress} $iopts"
+ if [ -n "$compress_threads" ]; then
+ iopts="--compress-threads=$compress_threads $iopts"
+ fi
+ if [ -n "$compress_chunk" ]; then
+ iopts="--compress-chunk-size=$compress_chunk $iopts"
+ fi
+ fi
+
+ if [ -n "$backup_threads" ]; then
+ iopts="--parallel=$backup_threads $iopts"
+ fi
+
+ setup_commands
set +e
- timeit "${stagemsg}-SST" "$INNOBACKUP | $tcmd; RC=( "\${PIPESTATUS[@]}" )"
+ timeit "$stagemsg-SST" "$INNOBACKUP | $tcmd; RC=( "\${PIPESTATUS[@]}" )"
set -e
if [ ${RC[0]} -ne 0 ]; then
- wsrep_log_error "${INNOBACKUPEX_BIN} finished with error: ${RC[0]}. " \
- "Check syslog or ${INNOBACKUPLOG} for details"
- exit 22
- elif [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then
- wsrep_log_error "$tcmd finished with error: ${RC[1]}"
- exit 22
+ wsrep_log_error "mariabackup finished with error: ${RC[0]}. " \
+ "Check syslog or '$INNOBACKUPLOG' for details"
+ exit 22
+ elif [ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]; then
+ wsrep_log_error "$tcmd finished with error: ${RC[1]}"
+ exit 22
fi
- # innobackupex implicitly writes PID to fixed location in $xtmpdir
- XTRABACKUP_PID="$xtmpdir/xtrabackup_pid"
-
+ # mariabackup implicitly writes PID to fixed location in $xtmpdir
+ BACKUP_PID="$xtmpdir/xtrabackup_pid"
else # BYPASS FOR IST
@@ -947,216 +1098,211 @@ then
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
# (separated by a space).
- echo "${WSREP_SST_OPT_GTID} ${WSREP_SST_OPT_GTID_DOMAIN_ID}" > "${MAGIC_FILE}"
- echo "1" > "${DATA}/${IST_FILE}"
+ echo "$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID" > "$MAGIC_FILE"
+ echo "1" > "$DATA/$IST_FILE"
+
+ if [ -n "$scomp" ]; then
+ tcmd="$scomp | $tcmd"
+ fi
+
get_keys
- if [[ $encrypt -eq 1 ]];then
- if [[ -n $scomp ]];then
- tcmd=" $ecmd | $scomp | $tcmd "
- else
- tcmd=" $ecmd | $tcmd "
- fi
- elif [[ -n $scomp ]];then
- tcmd=" $scomp | $tcmd "
+ if [ $encrypt -eq 1 ]; then
+ tcmd="$ecmd | $tcmd"
fi
- strmcmd+=" \${IST_FILE}"
- send_donor $DATA "${stagemsg}-IST"
+ strmcmd="$strmcmd '$IST_FILE'"
+
+ send_donor "$DATA" "$stagemsg-IST"
fi
- echo "done ${WSREP_SST_OPT_GTID}"
+ echo "done $WSREP_SST_OPT_GTID"
wsrep_log_info "Total time on donor: $totime seconds"
-elif [ "${WSREP_SST_OPT_ROLE}" = "joiner" ]
+elif [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]
then
- [[ -e $SST_PROGRESS_FILE ]] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE"
- [[ -n $SST_PROGRESS_FILE ]] && touch $SST_PROGRESS_FILE
+ [ -e "$SST_PROGRESS_FILE" ] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE"
+ [ -n "$SST_PROGRESS_FILE" ] && touch "$SST_PROGRESS_FILE"
- ib_home_dir=$INNODB_DATA_HOME_DIR
+ ib_home_dir="$INNODB_DATA_HOME_DIR"
- WSREP_LOG_DIR=${WSREP_LOG_DIR:-""}
- # Try to set WSREP_LOG_DIR from the command line:
- if [ ! -z "$INNODB_LOG_GROUP_HOME_ARG" ]; then
- WSREP_LOG_DIR=$INNODB_LOG_GROUP_HOME_ARG
- fi
- # if no command line arg and WSREP_LOG_DIR is not set,
+ # if no command line argument and INNODB_LOG_GROUP_HOME is not set,
# try to get it from my.cnf:
- if [ -z "$WSREP_LOG_DIR" ]; then
- WSREP_LOG_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-log-group-home-dir '')
- fi
- if [ -z "$WSREP_LOG_DIR" ]; then
- WSREP_LOG_DIR=$(parse_cnf --mysqld innodb-log-group-home-dir '')
+ if [ -z "$INNODB_LOG_GROUP_HOME" ]; then
+ INNODB_LOG_GROUP_HOME=$(parse_cnf '--mysqld' 'innodb-log-group-home-dir')
fi
- ib_log_dir=$WSREP_LOG_DIR
+ ib_log_dir="$INNODB_LOG_GROUP_HOME"
- # Try to set ib_undo_dir from the command line:
- ib_undo_dir=${INNODB_UNDO_DIR_ARG:-""}
- # if no command line arg then try to get it from my.cnf:
- if [ -z "$ib_undo_dir" ]; then
- ib_undo_dir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-undo-directory "")
- fi
- if [ -z "$ib_undo_dir" ]; then
- ib_undo_dir=$(parse_cnf --mysqld innodb-undo-directory "")
+ # if no command line argument then try to get it from my.cnf:
+ if [ -z "$INNODB_UNDO_DIR" ]; then
+ INNODB_UNDO_DIR=$(parse_cnf '--mysqld' 'innodb-undo-directory')
fi
- stagemsg="Joiner-Recv"
+ ib_undo_dir="$INNODB_UNDO_DIR"
+
+ if [ -n "$backup_threads" ]; then
+ impts="--parallel=$backup_threads $impts"
+ fi
+ stagemsg='Joiner-Recv'
sencrypted=1
nthreads=1
MODULE="xtrabackup_sst"
- rm -f "${DATA}/${IST_FILE}"
+ [ -f "$DATA/$IST_FILE" ] && rm -f "$DATA/$IST_FILE"
# May need xtrabackup_checkpoints later on
- rm -f ${DATA}/xtrabackup_binary ${DATA}/xtrabackup_galera_info ${DATA}/ib_logfile0
+ [ -f "$DATA/xtrabackup_binary" ] && rm -f "$DATA/xtrabackup_binary"
+ [ -f "$DATA/xtrabackup_galera_info" ] && rm -f "$DATA/xtrabackup_galera_info"
+ [ -f "$DATA/ib_logfile0" ] && rm -f "$DATA/ib_logfile0"
- ADDR=${WSREP_SST_OPT_ADDR}
- if [ -z "${SST_PORT}" ]
- then
- SST_PORT=4444
- if [ "${ADDR#\[}" != "$ADDR" ]; then
- ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $1 }')]:${SST_PORT}"
- else
- ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}"
+ ADDR="$WSREP_SST_OPT_ADDR"
+
+ if [ "${tmode#VERIFY}" != "$tmode" ]
+ then # backward-incompatible behavior
+ CN=""
+ if [ -n "$tpem" ]
+ then
+ # find out my Common Name
+ get_openssl
+ if [ -z "$OPENSSL_BINARY" ]; then
+ wsrep_log_error 'openssl not found but it is required for authentication'
+ exit 42
+ fi
+ CN=$("$OPENSSL_BINARY" x509 -noout -subject -in "$tpem" | \
+ tr "," "\n" | grep -F 'CN =' | cut -d= -f2 | sed s/^\ // | \
+ sed s/\ %//)
fi
+ MY_SECRET="$(wsrep_gen_secret)"
+ # Add authentication data to address
+ ADDR="$CN:$MY_SECRET@$ADDR"
+ else
+ MY_SECRET="" # for check down in recv_joiner()
fi
- wait_for_listen ${SST_PORT} ${ADDR} ${MODULE} &
-
trap sig_joiner_cleanup HUP PIPE INT TERM
- trap cleanup_joiner EXIT
+ trap cleanup_at_exit EXIT
- if [[ -n $progress ]];then
+ if [ -n "$progress" ]; then
adjust_progress
- tcmd+=" | $pcmd"
+ tcmd="$tcmd | $pcmd"
fi
get_keys
- if [[ $encrypt -eq 1 && $sencrypted -eq 1 ]];then
- if [[ -n $sdecomp ]];then
- strmcmd=" $sdecomp | $ecmd | $strmcmd"
- else
- strmcmd=" $ecmd | $strmcmd"
- fi
- elif [[ -n $sdecomp ]];then
- strmcmd=" $sdecomp | $strmcmd"
+ if [ $encrypt -eq 1 -a $sencrypted -eq 1 ]; then
+ strmcmd="$ecmd | $strmcmd"
+ fi
+
+ if [ -n "$sdecomp" ]; then
+ strmcmd="$sdecomp | $strmcmd"
fi
- STATDIR=$(mktemp -d)
- MAGIC_FILE="${STATDIR}/${INFO_FILE}"
- recv_joiner $STATDIR "${stagemsg}-gtid" $stimeout 1
+ check_sockets_utils
+ STATDIR="$(mktemp -d)"
+ MAGIC_FILE="$STATDIR/$INFO_FILE"
- if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null
+ recv_joiner "$STATDIR" "$stagemsg-gtid" $stimeout 1 1
+
+ if ! ps -p "$WSREP_SST_OPT_PARENT" >/dev/null 2>&1
then
- wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
+ wsrep_log_error "Parent mysqld process (PID: $WSREP_SST_OPT_PARENT) terminated unexpectedly."
exit 32
fi
- if [ ! -r "${STATDIR}/${IST_FILE}" ]
+ if [ ! -r "$STATDIR/$IST_FILE" ]
then
- if [[ -d ${DATA}/.sst ]];then
- wsrep_log_info "WARNING: Stale temporary SST directory: ${DATA}/.sst from previous state transfer. Removing"
- rm -rf ${DATA}/.sst
+ if [ -d "$DATA/.sst" ]; then
+ wsrep_log_info "WARNING: Stale temporary SST directory: '$DATA/.sst' from previous state transfer. Removing"
+ rm -rf "$DATA/.sst"
fi
- mkdir -p ${DATA}/.sst
- (recv_joiner $DATA/.sst "${stagemsg}-SST" 0 0) &
+ mkdir -p "$DATA/.sst"
+ (recv_joiner "$DATA/.sst" "$stagemsg-SST" 0 0 0) &
jpid=$!
wsrep_log_info "Proceeding with SST"
wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories"
- if [ "${OS}" = "FreeBSD" ]; then
- find -E $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+
+ if [ "$OS" = 'FreeBSD' ]; then
+ find -E ${ib_home_dir:+"$ib_home_dir"} \
+ ${ib_undo_dir:+"$ib_undo_dir"} \
+ ${ib_log_dir:+"$ib_log_dir"} \
+ "$DATA" -mindepth 1 -prune -regex "$cpat" -o -exec rm -rfv {} 1>&2 \+
else
- find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+
- fi
-
- tempdir=$LOG_BIN_ARG
- if [ -z "$tempdir" ]; then
- tempdir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE log-bin "")
- fi
- if [ -z "$tempdir" ]; then
- tempdir=$(parse_cnf --mysqld log-bin "")
- fi
- if [[ -n ${tempdir:-} ]];then
- binlog_dir=$(dirname $tempdir)
- binlog_file=$(basename $tempdir)
- if [[ -n ${binlog_dir:-} && $binlog_dir != '.' && $binlog_dir != $DATA ]];then
- pattern="$binlog_dir/$binlog_file\.[0-9]+$"
- wsrep_log_info "Cleaning the binlog directory $binlog_dir as well"
- find $binlog_dir -maxdepth 1 -type f -regex $pattern -exec rm -fv {} 1>&2 \+ || true
- rm $binlog_dir/*.index || true
- fi
+ find ${ib_home_dir:+"$ib_home_dir"} \
+ ${ib_undo_dir:+"$ib_undo_dir"} \
+ ${ib_log_dir:+"$ib_log_dir"} \
+ "$DATA" -mindepth 1 -prune -regex "$cpat" -o -exec rm -rfv {} 1>&2 \+
fi
+ get_binlog
+ if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
+ binlog_dir=$(dirname "$WSREP_SST_OPT_BINLOG")
+ cd "$binlog_dir"
+ wsrep_log_info "Cleaning the binlog directory $binlog_dir as well"
+ rm -fv "$WSREP_SST_OPT_BINLOG".[0-9]* 1>&2 \+ || true
+ binlog_index="${WSREP_SST_OPT_BINLOG_INDEX%.index}.index"
+ [ -f "$binlog_index" ] && rm -fv "$binlog_index" 1>&2 \+ || true
+ cd "$OLD_PWD"
+ fi
- TDATA=${DATA}
- DATA="${DATA}/.sst"
-
+ TDATA="$DATA"
+ DATA="$DATA/.sst"
- MAGIC_FILE="${DATA}/${INFO_FILE}"
+ MAGIC_FILE="$DATA/$INFO_FILE"
wsrep_log_info "Waiting for SST streaming to complete!"
monitor_process $jpid
- get_proc
-
- if [[ ! -s ${DATA}/xtrabackup_checkpoints ]];then
- wsrep_log_error "xtrabackup_checkpoints missing, failed innobackupex/SST on donor"
+ if [ ! -s "$DATA/xtrabackup_checkpoints" ]; then
+ wsrep_log_error "xtrabackup_checkpoints missing, failed mariabackup/SST on donor"
exit 2
fi
- # Rebuild indexes for compact backups
- if grep -q 'compact = 1' ${DATA}/xtrabackup_checkpoints;then
+ # Compact backups are not supported by mariabackup
+ if grep -q -F 'compact = 1' "$DATA/xtrabackup_checkpoints"; then
wsrep_log_info "Index compaction detected"
- rebuild=1
- fi
-
- if [[ $rebuild -eq 1 ]];then
- nthreads=$(parse_cnf xtrabackup rebuild-threads $nproc)
- wsrep_log_info "Rebuilding during prepare with $nthreads threads"
- rebuildcmd="--rebuild-indexes --rebuild-threads=$nthreads"
+ wsrel_log_error "Compact backups are not supported by mariabackup"
+ exit 2
fi
- if test -n "$(find ${DATA} -maxdepth 1 -type f -name '*.qp' -print -quit)";then
-
+ qpfiles=$(find "$DATA" -maxdepth 1 -type f -name '*.qp' -print -quit)
+ if [ -n "$qpfiles" ]; then
wsrep_log_info "Compressed qpress files found"
- if ! command -v qpress >/dev/null;then
- wsrep_log_error "qpress not found in path: $PATH"
+ if [ -z "$(command -v qpress)" ]; then
+ wsrep_log_error "qpress utility not found in the path"
exit 22
fi
- if [[ -n $progress ]] && pv --help | grep -q 'line-mode';then
- count=$(find ${DATA} -type f -name '*.qp' | wc -l)
+ get_proc
+
+ dcmd="xargs -n 2 qpress -dT$nproc"
+
+ if [ -n "$progress" ] && pv --help | grep -qw -- '--line-mode'; then
+ count=$(find "$DATA" -type f -name '*.qp' | wc -l)
count=$(( count*2 ))
- if pv --help | grep -q FORMAT;then
- pvopts="-f -s $count -l -N Decompression -F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'"
- else
- pvopts="-f -s $count -l -N Decompression"
+ pvopts="-f -s $count -l -N Decompression"
+ if pv --help | grep -qw -- '-F'; then
+ pvopts="$pvopts -F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'"
fi
pcmd="pv $pvopts"
adjust_progress
- dcmd="$pcmd | xargs -n 2 qpress -T${nproc}d"
- else
- dcmd="xargs -n 2 qpress -T${nproc}d"
+ dcmd="$pcmd | $dcmd"
fi
-
- # Decompress the qpress files
+ # Decompress the qpress files
wsrep_log_info "Decompression with $nproc threads"
- timeit "Joiner-Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
+ timeit "Joiner-Decompression" "find '$DATA' -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
extcode=$?
- if [[ $extcode -eq 0 ]];then
+ if [ $extcode -eq 0 ]; then
wsrep_log_info "Removing qpress files after decompression"
- find ${DATA} -type f -name '*.qp' -delete
- if [[ $? -ne 0 ]];then
+ find "$DATA" -type f -name '*.qp' -delete
+ if [ $? -ne 0 ]; then
wsrep_log_error "Something went wrong with deletion of qpress files. Investigate"
fi
else
@@ -1165,58 +1311,60 @@ then
fi
fi
+ if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
- if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then
-
- BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
- BINLOG_FILENAME=$(basename $WSREP_SST_OPT_BINLOG)
+ BINLOG_DIRNAME=$(dirname "$WSREP_SST_OPT_BINLOG")
+ BINLOG_FILENAME=$(basename "$WSREP_SST_OPT_BINLOG")
- # To avoid comparing data directory and BINLOG_DIRNAME
- mv $DATA/${BINLOG_FILENAME}.* $BINLOG_DIRNAME/ 2>/dev/null || true
+ # To avoid comparing data directory and BINLOG_DIRNAME
+ mv "$DATA/$BINLOG_FILENAME".* "$BINLOG_DIRNAME/" 2>/dev/null || true
- pushd $BINLOG_DIRNAME &>/dev/null
- for bfiles in $(ls -1 ${BINLOG_FILENAME}.[0-9]*);do
- echo ${BINLOG_DIRNAME}/${bfiles} >> ${BINLOG_FILENAME}.index
+ cd "$BINLOG_DIRNAME"
+ for bfile in $(ls -1 "$BINLOG_FILENAME".[0-9]*); do
+ echo "$BINLOG_DIRNAME/$bfile" >> "${WSREP_SST_OPT_BINLOG_INDEX%.index}.index"
done
- popd &> /dev/null
+ cd "$OLD_PWD"
fi
- wsrep_log_info "Preparing the backup at ${DATA}"
- timeit "Xtrabackup prepare stage" "$INNOAPPLY"
+ wsrep_log_info "Preparing the backup at $DATA"
+ setup_commands
+ timeit "mariabackup prepare stage" "$INNOAPPLY"
- if [ $? -ne 0 ];
- then
- wsrep_log_error "${INNOBACKUPEX_BIN} apply finished with errors. Check syslog or ${INNOAPPLYLOG} for details"
+ if [ $? -ne 0 ]; then
+ wsrep_log_error "mariabackup apply finished with errors. Check syslog or '$INNOAPPLYLOG' for details"
exit 22
fi
- MAGIC_FILE="${TDATA}/${INFO_FILE}"
- set +e
- set -e
- wsrep_log_info "Moving the backup to ${TDATA}"
- timeit "Xtrabackup move stage" "$INNOMOVE"
- if [[ $? -eq 0 ]];then
- wsrep_log_info "Move successful, removing ${DATA}"
- rm -rf $DATA
- DATA=${TDATA}
- else
- wsrep_log_error "Move failed, keeping ${DATA} for further diagnosis"
- wsrep_log_error "Check syslog or ${INNOMOVELOG} for details"
+ MAGIC_FILE="$TDATA/$INFO_FILE"
+
+ wsrep_log_info "Moving the backup to $TDATA"
+ timeit "mariabackup move stage" "$INNOMOVE"
+ if [ $? -eq 0 ]; then
+ wsrep_log_info "Move successful, removing $DATA"
+ rm -rf "$DATA"
+ DATA="$TDATA"
+ else
+ wsrep_log_error "Move failed, keeping '$DATA' for further diagnosis"
+ wsrep_log_error "Check syslog or '$INNOMOVELOG' for details"
exit 22
fi
+ else
+
+ wsrep_log_info "'$IST_FILE' received from donor: Running IST"
- else
- wsrep_log_info "${IST_FILE} received from donor: Running IST"
fi
- if [[ ! -r ${MAGIC_FILE} ]];then
- wsrep_log_error "SST magic file ${MAGIC_FILE} not found/readable"
+ if [ ! -r "$MAGIC_FILE" ]; then
+ wsrep_log_error "SST magic file '$MAGIC_FILE' not found/readable"
exit 2
fi
- wsrep_log_info "Galera co-ords from recovery: $(cat ${MAGIC_FILE})"
- cat "${MAGIC_FILE}" # Output : UUID:seqno wsrep_gtid_domain_id
+
+ coords=$(cat "$MAGIC_FILE")
+ wsrep_log_info "Galera co-ords from recovery: $coords"
+ cat "$MAGIC_FILE" # Output : UUID:seqno wsrep_gtid_domain_id
+
wsrep_log_info "Total time on joiner: $totime seconds"
fi
diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh
index 664fd2c04f9..798bee1ac10 100644
--- a/scripts/wsrep_sst_mysqldump.sh
+++ b/scripts/wsrep_sst_mysqldump.sh
@@ -1,5 +1,6 @@
#!/bin/bash -ue
# Copyright (C) 2009-2015 Codership Oy
+# Copyright (C) 2017-2021 MariaDB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,34 +18,18 @@
# This is a reference script for mysqldump-based state snapshot tansfer
-. $(dirname $0)/wsrep_sst_common
+. $(dirname "$0")/wsrep_sst_common
PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin
EINVAL=22
-local_ip()
-{
- [ "$1" = "127.0.0.1" ] && return 0
- [ "$1" = "localhost" ] && return 0
- [ "$1" = "[::1]" ] && return 0
- [ "$1" = "$(hostname -s)" ] && return 0
- [ "$1" = "$(hostname -f)" ] && return 0
- [ "$1" = "$(hostname -d)" ] && return 0
-
- # Now if ip program is not found in the path, we can't return 0 since
- # it would block any address. Thankfully grep should fail in this case
- ip route get "$1" | grep local >/dev/null && return 0
-
- return 1
-}
-
if test -z "$WSREP_SST_OPT_HOST"; then wsrep_log_error "HOST cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_PORT"; then wsrep_log_error "PORT cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_LPORT"; then wsrep_log_error "LPORT cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_SOCKET";then wsrep_log_error "SOCKET cannot be nil";exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_GTID"; then wsrep_log_error "GTID cannot be nil"; exit $EINVAL; fi
-if local_ip $WSREP_SST_OPT_HOST && \
+if is_local_ip "$WSREP_SST_OPT_HOST_UNESCAPED" && \
[ "$WSREP_SST_OPT_PORT" = "$WSREP_SST_OPT_LPORT" ]
then
wsrep_log_error \
@@ -60,7 +45,12 @@ then
exit $EINVAL
fi
-[ -n "$WSREP_SST_OPT_USER" ] && AUTH="-u$WSREP_SST_OPT_USER" || AUTH=
+AUTH=""
+usrst=0
+if [ -n "$WSREP_SST_OPT_USER" ]; then
+ AUTH="-u$WSREP_SST_OPT_USER"
+ usrst=1
+fi
# Refs https://github.com/codership/mysql-wsrep/issues/141
# Passing password in MYSQL_PWD environment variable is considered
@@ -71,9 +61,14 @@ fi
# whereas (at least on Linux) unprivileged user can't see process environment
# that he does not own. So while it may be not secure in the NSA sense of the
# word, it is arguably more secure than passing password on the command line.
-[ -n "$WSREP_SST_OPT_PSWD" ] && export MYSQL_PWD="$WSREP_SST_OPT_PSWD"
+if [ -n "$WSREP_SST_OPT_PSWD" ]; then
+ export MYSQL_PWD="$WSREP_SST_OPT_PSWD"
+elif [ $usrst -eq 1 ]; then
+ # Empty password, used for testing, debugging etc.
+ unset MYSQL_PWD
+fi
-STOP_WSREP="SET wsrep_on=OFF;"
+STOP_WSREP='SET wsrep_on=OFF;'
# mysqldump cannot restore CSV tables, fix this issue
CSV_TABLES_FIX="
@@ -83,13 +78,13 @@ USE mysql;
SET @cond = (SELECT (SUPPORT = 'YES' or SUPPORT = 'DEFAULT') FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE = 'csv');
-SET @stmt = IF (@cond = '1', 'CREATE TABLE IF NOT EXISTS general_log ( event_time timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), user_host mediumtext NOT NULL, thread_id bigint(21) unsigned NOT NULL, server_id int(10) unsigned NOT NULL, command_type varchar(64) NOT NULL, argument mediumtext NOT NULL) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT=\"General log\"', 'SET @dummy = 0');
+SET @stmt = IF (@cond = '1', 'CREATE TABLE IF NOT EXISTS general_log ( event_time timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), user_host mediumtext NOT NULL, thread_id bigint(21) unsigned NOT NULL, server_id int(10) unsigned NOT NULL, command_type varchar(64) NOT NULL, argument mediumtext NOT NULL) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COMMENT=\"General log\"', 'SET @dummy = 0');
PREPARE stmt FROM @stmt;
EXECUTE stmt;
DROP PREPARE stmt;
-SET @stmt = IF (@cond = '1', 'CREATE TABLE IF NOT EXISTS slow_log ( start_time timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), user_host mediumtext NOT NULL, query_time time(6) NOT NULL, lock_time time(6) NOT NULL, rows_sent int(11) NOT NULL, rows_examined int(11) NOT NULL, db varchar(512) NOT NULL, last_insert_id int(11) NOT NULL, insert_id int(11) NOT NULL, server_id int(10) unsigned NOT NULL, sql_text mediumtext NOT NULL, thread_id bigint(21) unsigned NOT NULL) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT=\"Slow log\"', 'SET @dummy = 0');
+SET @stmt = IF (@cond = '1', 'CREATE TABLE IF NOT EXISTS slow_log ( start_time timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), user_host mediumtext NOT NULL, query_time time(6) NOT NULL, lock_time time(6) NOT NULL, rows_sent int(11) NOT NULL, rows_examined int(11) NOT NULL, db varchar(512) NOT NULL, last_insert_id int(11) NOT NULL, insert_id int(11) NOT NULL, server_id int(10) unsigned NOT NULL, sql_text mediumtext NOT NULL, thread_id bigint(21) unsigned NOT NULL) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COMMENT=\"Slow log\"', 'SET @dummy = 0');
PREPARE stmt FROM @stmt;
EXECUTE stmt;
@@ -100,29 +95,29 @@ SET_START_POSITION="SET GLOBAL wsrep_start_position='$WSREP_SST_OPT_GTID';"
SET_WSREP_GTID_DOMAIN_ID=""
if [ -n $WSREP_SST_OPT_GTID_DOMAIN_ID ]
then
- SET_WSREP_GTID_DOMAIN_ID="
- SET @val = (SELECT GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME = 'WSREP_GTID_STRICT_MODE' AND GLOBAL_VALUE > 0);
- SET @stmt = IF (@val IS NOT NULL, 'SET GLOBAL WSREP_GTID_DOMAIN_ID=$WSREP_SST_OPT_GTID_DOMAIN_ID', 'SET @dummy = 0');
- PREPARE stmt FROM @stmt;
- EXECUTE stmt;
- DROP PREPARE stmt;"
+ SET_WSREP_GTID_DOMAIN_ID="
+ SET @val = (SELECT GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME = 'WSREP_GTID_STRICT_MODE' AND GLOBAL_VALUE > 0);
+ SET @stmt = IF (@val IS NOT NULL, 'SET GLOBAL WSREP_GTID_DOMAIN_ID=$WSREP_SST_OPT_GTID_DOMAIN_ID', 'SET @dummy = 0');
+ PREPARE stmt FROM @stmt;
+ EXECUTE stmt;
+ DROP PREPARE stmt;"
fi
-MYSQL="$MYSQL_CLIENT $WSREP_SST_OPT_CONF "\
-"$AUTH -h${WSREP_SST_OPT_HOST_UNESCAPED} "\
+MYSQL="$MYSQL_CLIENT $WSREP_SST_OPT_CONF_UNQUOTED "\
+"$AUTH -h$WSREP_SST_OPT_HOST_UNESCAPED "\
"-P$WSREP_SST_OPT_PORT --disable-reconnect --connect_timeout=10"
# Check if binary logging is enabled on the joiner node.
# Note: SELECT cannot be used at this point.
-LOG_BIN=$(echo "set statement wsrep_sync_wait=0 for SHOW VARIABLES LIKE 'log_bin'" | $MYSQL |\
+LOG_BIN=$(echo "set statement wsrep_sync_wait=0 for SHOW VARIABLES LIKE 'log_bin'" | $MYSQL | \
tail -1 | awk -F ' ' '{ print $2 }')
# Check the joiner node's server version.
-SERVER_VERSION=$(echo "set statement wsrep_sync_wait=0 for SHOW VARIABLES LIKE 'version'" | $MYSQL |\
+SERVER_VERSION=$(echo "set statement wsrep_sync_wait=0 for SHOW VARIABLES LIKE 'version'" | $MYSQL | \
tail -1 | awk -F ' ' '{ print $2 }')
# Retrieve the donor's @@global.gtid_binlog_state.
-GTID_BINLOG_STATE=$(echo "SHOW GLOBAL VARIABLES LIKE 'gtid_binlog_state'" | $MYSQL |\
+GTID_BINLOG_STATE=$(echo "SHOW GLOBAL VARIABLES LIKE 'gtid_binlog_state'" | $MYSQL | \
tail -1 | awk -F ' ' '{ print $2 }')
RESET_MASTER=""
@@ -130,50 +125,49 @@ SET_GTID_BINLOG_STATE=""
SQL_LOG_BIN_OFF=""
# Safety check
-if [ "${SERVER_VERSION%%.*}" != '5' ]
+if [ ${SERVER_VERSION%%.*} -gt 5 ]
then
- # If binary logging is enabled on the joiner node, we need to copy donor's
- # gtid_binlog_state to joiner. In order to do that, a RESET MASTER must be
- # executed to erase binary logs (if any). Binary logging should also be
- # turned off for the session so that gtid state does not get altered while
- # the dump gets replayed on joiner.
- if [[ "$LOG_BIN" == 'ON' ]]; then
- RESET_MASTER="RESET MASTER;"
- SET_GTID_BINLOG_STATE="SET @@global.gtid_binlog_state='$GTID_BINLOG_STATE';"
- SQL_LOG_BIN_OFF="SET @@session.sql_log_bin=OFF;"
- fi
+ # If binary logging is enabled on the joiner node, we need to copy donor's
+ # gtid_binlog_state to joiner. In order to do that, a RESET MASTER must be
+ # executed to erase binary logs (if any). Binary logging should also be
+ # turned off for the session so that gtid state does not get altered while
+ # the dump gets replayed on joiner.
+ if [ "$LOG_BIN" = 'ON' ]; then
+ RESET_MASTER="SET GLOBAL wsrep_on=OFF; RESET MASTER; SET GLOBAL wsrep_on=ON;"
+ SET_GTID_BINLOG_STATE="SET GLOBAL wsrep_on=OFF; SET @@global.gtid_binlog_state='$GTID_BINLOG_STATE'; SET GLOBAL wsrep_on=ON;"
+ SQL_LOG_BIN_OFF="SET @@session.sql_log_bin=OFF;"
+ fi
fi
# NOTE: we don't use --routines here because we're dumping mysql.proc table
-MYSQLDUMP="$MYSQLDUMP $WSREP_SST_OPT_CONF $AUTH -S$WSREP_SST_OPT_SOCKET \
+MYSQLDUMP="$MYSQLDUMP $WSREP_SST_OPT_CONF_UNQUOTED $AUTH -S$WSREP_SST_OPT_SOCKET \
--add-drop-database --add-drop-table --skip-add-locks --create-options \
--disable-keys --extended-insert --skip-lock-tables --quick --set-charset \
--skip-comments --flush-privileges --all-databases --events"
-# need to disable logging when loading the dump
-# reason is that dump contains ALTER TABLE for log tables, and
-# this causes an error if logging is enabled
-GENERAL_LOG_OPT=`$MYSQL --skip-column-names -e "$STOP_WSREP SELECT @@GENERAL_LOG"`
-SLOW_LOG_OPT=`$MYSQL --skip-column-names -e "$STOP_WSREP SELECT @@SLOW_QUERY_LOG"`
-$MYSQL -e "$STOP_WSREP SET GLOBAL GENERAL_LOG=OFF"
-$MYSQL -e "$STOP_WSREP SET GLOBAL SLOW_QUERY_LOG=OFF"
-
-# commands to restore log settings
-RESTORE_GENERAL_LOG="SET GLOBAL GENERAL_LOG=$GENERAL_LOG_OPT;"
-RESTORE_SLOW_QUERY_LOG="SET GLOBAL SLOW_QUERY_LOG=$SLOW_LOG_OPT;"
-
-
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]
then
- (echo $STOP_WSREP && echo $RESET_MASTER && \
- echo $SET_GTID_BINLOG_STATE && echo $SQL_LOG_BIN_OFF && \
- echo $STOP_WSREP && $MYSQLDUMP && echo $CSV_TABLES_FIX && \
- echo $RESTORE_GENERAL_LOG && echo $RESTORE_SLOW_QUERY_LOG && \
- echo $SET_START_POSITION && echo $SET_WSREP_GTID_DOMAIN_ID \
+ # need to disable logging when loading the dump
+ # reason is that dump contains ALTER TABLE for log tables, and
+ # this causes an error if logging is enabled
+ GENERAL_LOG_OPT=$($MYSQL --skip-column-names -e "$STOP_WSREP SELECT @@GENERAL_LOG")
+ SLOW_LOG_OPT=$($MYSQL --skip-column-names -e "$STOP_WSREP SELECT @@SLOW_QUERY_LOG")
+
+ LOG_OFF="SET GLOBAL GENERAL_LOG=OFF; SET GLOBAL SLOW_QUERY_LOG=OFF;"
+
+ # commands to restore log settings
+ RESTORE_GENERAL_LOG="SET GLOBAL GENERAL_LOG=$GENERAL_LOG_OPT;"
+ RESTORE_SLOW_QUERY_LOG="SET GLOBAL SLOW_QUERY_LOG=$SLOW_LOG_OPT;"
+
+ (echo "$STOP_WSREP" && echo "$LOG_OFF" && echo "$RESET_MASTER" && \
+ echo "$SET_GTID_BINLOG_STATE" && echo "$SQL_LOG_BIN_OFF" && \
+ echo "$STOP_WSREP" && $MYSQLDUMP && echo "$CSV_TABLES_FIX" && \
+ echo "$RESTORE_GENERAL_LOG" && echo "$RESTORE_SLOW_QUERY_LOG" && \
+ echo "$SET_START_POSITION" && echo "$SET_WSREP_GTID_DOMAIN_ID" \
|| echo "SST failed to complete;") | $MYSQL
else
wsrep_log_info "Bypassing state dump."
- echo $SET_START_POSITION | $MYSQL
+ echo "$SET_START_POSITION" | $MYSQL
fi
#
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index 7e3f7b73301..ad9688011e1 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -1,5 +1,6 @@
#!/bin/bash -ue
+# Copyright (C) 2017-2021 MariaDB
# Copyright (C) 2010-2014 Codership Oy
#
# This program is free software; you can redistribute it and/or modify
@@ -18,179 +19,185 @@
# This is a reference script for rsync-based state snapshot tansfer
-RSYNC_PID= # rsync pid file
-RSYNC_CONF= # rsync configuration file
-RSYNC_REAL_PID= # rsync process id
+RSYNC_REAL_PID=0 # rsync process id
+STUNNEL_REAL_PID=0 # stunnel process id
-OS=$(uname)
-[ "$OS" = "Darwin" ] && export -n LD_LIBRARY_PATH
+OS="$(uname)"
+[ "$OS" = 'Darwin' ] && export -n LD_LIBRARY_PATH
# Setting the path for lsof on CentOS
export PATH="/usr/sbin:/sbin:$PATH"
-. $(dirname $0)/wsrep_sst_common
+. $(dirname "$0")/wsrep_sst_common
+wsrep_check_datadir
wsrep_check_programs rsync
cleanup_joiner()
{
- wsrep_log_info "Joiner cleanup. rsync PID: $RSYNC_REAL_PID"
- [ "0" != "$RSYNC_REAL_PID" ] && \
- kill $RSYNC_REAL_PID && \
- sleep 0.5 && \
- kill -9 $RSYNC_REAL_PID >/dev/null 2>&1 || \
- :
- rm -rf "$RSYNC_CONF"
- rm -f "$STUNNEL_CONF"
- rm -f "$STUNNEL_PID"
- rm -rf "$MAGIC_FILE"
- rm -rf "$RSYNC_PID"
+ local failure=0
+
+ wsrep_log_info "Joiner cleanup: rsync PID=$RSYNC_REAL_PID, stunnel PID=$STUNNEL_REAL_PID"
+
+ if [ -n "$STUNNEL" ]; then
+ if cleanup_pid $STUNNEL_REAL_PID "$STUNNEL_PID" "$STUNNEL_CONF"; then
+ if [ $RSYNC_REAL_PID -eq 0 ]; then
+ if [ -r "$RSYNC_PID" ]; then
+ RSYNC_REAL_PID=$(cat "$RSYNC_PID" 2>/dev/null)
+ if [ -z "$RSYNC_REAL_PID" ]; then
+ RSYNC_REAL_PID=0
+ fi
+ fi
+ fi
+ else
+ wsrep_log_warning "stunnel cleanup failed."
+ failure=1
+ fi
+ fi
+
+ if [ $failure -eq 0 ]; then
+ if cleanup_pid $RSYNC_REAL_PID "$RSYNC_PID" "$RSYNC_CONF"; then
+ [ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
+ else
+ wsrep_log_warning "rsync cleanup failed."
+ fi
+ fi
+
wsrep_log_info "Joiner cleanup done."
- if [ "${WSREP_SST_OPT_ROLE}" = "joiner" ];then
+
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
wsrep_cleanup_progress_file
fi
-}
-# Check whether rsync process is still running.
-check_pid()
-{
- local pid_file=$1
- [ -r "$pid_file" ] && ps -p $(cat $pid_file) >/dev/null 2>&1
+ [ -f "$SST_PID" ] && rm -f "$SST_PID"
}
check_pid_and_port()
{
- local pid_file=$1
- local rsync_pid=$2
- local rsync_addr=$3
- local rsync_port=$4
-
- case $OS in
- FreeBSD)
- local port_info="$(sockstat -46lp ${rsync_port} 2>/dev/null | \
- grep ":${rsync_port}")"
- local is_rsync="$(echo $port_info | \
- grep -E '[[:space:]]+(rsync|stunnel)[[:space:]]+'"$rsync_pid" 2>/dev/null)"
- ;;
- *)
- if ! which lsof > /dev/null; then
- wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed."
- exit 2 # ENOENT
+ local pid_file="$1"
+ local pid=$2
+ local addr="$3"
+ local port="$4"
+
+ local utils='rsync|stunnel'
+
+ if ! check_port "$pid" "$port" "$utils"; then
+ local port_info
+ local busy=0
+
+ if [ $lsof_available -ne 0 ]; then
+ port_info=$(lsof -Pnl -i ":$port" 2>/dev/null | \
+ grep -F '(LISTEN)')
+ echo "$port_info" | \
+ grep -q -E "[[:space:]](\\*|\\[?::\\]?):$port[[:space:]]" && busy=1
+ else
+ local filter='([^[:space:]]+[[:space:]]+){4}[^[:space:]]+'
+ if [ $sockstat_available -eq 1 ]; then
+ local opts='-p'
+ if [ "$OS" = 'FreeBSD' ]; then
+ # sockstat on FreeBSD requires the "-s" option
+ # to display the connection state:
+ opts='-sp'
+ # in addition, sockstat produces an additional column:
+ filter='([^[:space:]]+[[:space:]]+){5}[^[:space:]]+'
+ fi
+ port_info=$(sockstat "$opts" "$port" 2>/dev/null | \
+ grep -E '[[:space:]]LISTEN' | grep -o -E "$filter")
+ else
+ port_info=$(ss -nlpH "( sport = :$port )" 2>/dev/null | \
+ grep -F 'users:(' | grep -o -E "$filter")
+ fi
+ echo "$port_info" | \
+ grep -q -E "[[:space:]](\\*|\\[?::\\]?):$port\$" && busy=1
fi
- local port_info="$(lsof -i :$rsync_port -Pn 2>/dev/null | \
- grep "(LISTEN)")"
- local is_rsync="$(echo $port_info | \
- grep -E '^(rsync|stunnel)[[:space:]]+'"$rsync_pid" 2>/dev/null)"
- ;;
- esac
+ if [ $busy -eq 0 ]; then
+ if echo "$port_info" | grep -qw -F "[$addr]:$port" || \
+ echo "$port_info" | grep -qw -F -- "$addr:$port"
+ then
+ busy=1
+ fi
+ fi
- local is_listening_all="$(echo $port_info | \
- grep "*:$rsync_port" 2>/dev/null)"
- local is_listening_addr="$(echo $port_info | \
- grep -F "$rsync_addr:$rsync_port" 2>/dev/null)"
+ if [ $busy -eq 0 ]; then
+ return 1
+ fi
- if [ ! -z "$is_listening_all" -o ! -z "$is_listening_addr" ]; then
- if [ -z "$is_rsync" ]; then
- wsrep_log_error "rsync daemon port '$rsync_port' has been taken"
+ if ! check_port "$pid" "$port" "$utils"; then
+ wsrep_log_error "rsync or stunnel daemon port '$port' " \
+ "has been taken by another program"
exit 16 # EBUSY
fi
fi
- check_pid $pid_file && \
- [ -n "$port_info" ] && [ -n "$is_rsync" ] && \
- [ $(cat $pid_file) -eq $rsync_pid ]
-}
-is_local_ip()
-{
- local address="$1"
- local get_addr_bin=`which ifconfig`
- if [ -z "$get_addr_bin" ]
- then
- get_addr_bin=`which ip`
- get_addr_bin="$get_addr_bin address show"
- # Add an slash at the end, so we don't get false positive : 172.18.0.4 matches 172.18.0.41
- # ip output format is "X.X.X.X/mask"
- address="${address}/"
- else
- # Add an space at the end, so we don't get false positive : 172.18.0.4 matches 172.18.0.41
- # ifconfig output format is "X.X.X.X "
- address="$address "
- fi
-
- $get_addr_bin | grep -F "$address" > /dev/null
+ check_pid "$pid_file" && [ $CHECK_PID -eq $pid ]
}
STUNNEL_CONF="$WSREP_SST_OPT_DATA/stunnel.conf"
-rm -f "$STUNNEL_CONF"
-
STUNNEL_PID="$WSREP_SST_OPT_DATA/stunnel.pid"
-rm -f "$STUNNEL_PID"
MAGIC_FILE="$WSREP_SST_OPT_DATA/rsync_sst_complete"
-rm -rf "$MAGIC_FILE"
BINLOG_TAR_FILE="$WSREP_SST_OPT_DATA/wsrep_sst_binlog.tar"
BINLOG_N_FILES=1
-rm -f "$BINLOG_TAR_FILE" || :
-if ! [ -z $WSREP_SST_OPT_BINLOG ]
-then
- BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
- BINLOG_FILENAME=$(basename $WSREP_SST_OPT_BINLOG)
- BINLOG_INDEX_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
- BINLOG_INDEX_FILENAME=$(basename $WSREP_SST_OPT_BINLOG)
-fi
+get_binlog
-if ! [ -z $WSREP_SST_OPT_BINLOG_INDEX ]
-then
- BINLOG_INDEX_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG_INDEX)
- BINLOG_INDEX_FILENAME=$(basename $WSREP_SST_OPT_BINLOG_INDEX)
+if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
+ BINLOG_DIRNAME=$(dirname "$WSREP_SST_OPT_BINLOG")
+ BINLOG_FILENAME=$(basename "$WSREP_SST_OPT_BINLOG")
fi
-WSREP_LOG_DIR=${WSREP_LOG_DIR:-""}
-# Try to set WSREP_LOG_DIR from the command line:
-if [ ! -z "$INNODB_LOG_GROUP_HOME_ARG" ]; then
- WSREP_LOG_DIR=$INNODB_LOG_GROUP_HOME_ARG
-fi
-# if no command line arg and WSREP_LOG_DIR is not set,
+# if no command line argument and INNODB_LOG_GROUP_HOME is not set,
# try to get it from my.cnf:
-if [ -z "$WSREP_LOG_DIR" ]; then
- WSREP_LOG_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-log-group-home-dir '')
-fi
-if [ -z "$WSREP_LOG_DIR" ]; then
- WSREP_LOG_DIR=$(parse_cnf --mysqld innodb-log-group-home-dir '')
+if [ -z "$INNODB_LOG_GROUP_HOME" ]; then
+ INNODB_LOG_GROUP_HOME=$(parse_cnf '--mysqld' 'innodb-log-group-home-dir')
fi
+OLD_PWD="$(pwd)"
+
+WSREP_LOG_DIR="$INNODB_LOG_GROUP_HOME"
+
+cd "$WSREP_SST_OPT_DATA"
if [ -n "$WSREP_LOG_DIR" ]; then
# handle both relative and absolute paths
- WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; mkdir -p "$WSREP_LOG_DIR"; cd $WSREP_LOG_DIR; pwd -P)
-else
- # default to datadir
- WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P)
+ [ ! -d "$WSREP_LOG_DIR" ] && mkdir -p "$WSREP_LOG_DIR"
+ cd "$WSREP_LOG_DIR"
fi
+WSREP_LOG_DIR=$(pwd -P)
-INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""}
-# Try to set INNODB_DATA_HOME_DIR from the command line:
-if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
- INNODB_DATA_HOME_DIR=$INNODB_DATA_HOME_DIR_ARG
-fi
-# if no command line arg and INNODB_DATA_HOME_DIR environment variable
+cd "$OLD_PWD"
+
+# if no command line argument and INNODB_DATA_HOME_DIR environment variable
# is not set, try to get it from my.cnf:
if [ -z "$INNODB_DATA_HOME_DIR" ]; then
- INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
-fi
-if [ -z "$INNODB_DATA_HOME_DIR" ]; then
- INNODB_DATA_HOME_DIR=$(parse_cnf --mysqld innodb-data-home-dir '')
+ INNODB_DATA_HOME_DIR=$(parse_cnf '--mysqld' 'innodb-data-home-dir')
fi
+cd "$WSREP_SST_OPT_DATA"
if [ -n "$INNODB_DATA_HOME_DIR" ]; then
# handle both relative and absolute paths
- INNODB_DATA_HOME_DIR=$(cd $WSREP_SST_OPT_DATA; mkdir -p "$INNODB_DATA_HOME_DIR"; cd $INNODB_DATA_HOME_DIR; pwd -P)
-else
- # default to datadir
- INNODB_DATA_HOME_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P)
+ [ ! -d "$INNODB_DATA_HOME_DIR" ] && mkdir -p "$INNODB_DATA_HOME_DIR"
+ cd "$INNODB_DATA_HOME_DIR"
+fi
+INNODB_DATA_HOME_DIR=$(pwd -P)
+
+cd "$OLD_PWD"
+
+# if no command line argument then try to get it from my.cnf:
+if [ -z "$INNODB_UNDO_DIR" ]; then
+ INNODB_UNDO_DIR=$(parse_cnf '--mysqld' 'innodb-undo-directory')
+fi
+
+cd "$WSREP_SST_OPT_DATA"
+if [ -n "$INNODB_UNDO_DIR" ]; then
+ # handle both relative and absolute paths
+ [ ! -d "$INNODB_UNDO_DIR" ] && mkdir -p "$INNODB_UNDO_DIR"
+ cd "$INNODB_UNDO_DIR"
fi
+INNODB_UNDO_DIR=$(pwd -P)
+
+cd "$OLD_PWD"
# Old filter - include everything except selected
# FILTER=(--exclude '*.err' --exclude '*.pid' --exclude '*.sock' \
@@ -203,34 +210,149 @@ FILTER="-f '- /lost+found'
-f '- /.zfs'
-f '- /.fseventsd'
-f '- /.Trashes'
+ -f '- /.pid'
+ -f '- /.conf'
-f '+ /wsrep_sst_binlog.tar'
-f '- $INNODB_DATA_HOME_DIR/ib_lru_dump'
-f '- $INNODB_DATA_HOME_DIR/ibdata*'
- -f '+ /undo*'
+ -f '+ $INNODB_UNDO_DIR/undo*'
-f '+ /*/'
-f '- /*'"
-SSTKEY=$(parse_cnf sst tkey "")
-SSTCERT=$(parse_cnf sst tcert "")
-STUNNEL=""
-if [ -f "$SSTKEY" ] && [ -f "$SSTCERT" ] && wsrep_check_programs stunnel
+# old-style SSL config
+SSTKEY=$(parse_cnf 'sst' 'tkey')
+SSTCERT=$(parse_cnf 'sst' 'tcert')
+SSTCA=$(parse_cnf 'sst' 'tca')
+
+SST_SECTIONS="--mysqld|sst"
+
+check_server_ssl_config()
+{
+ SSTKEY=$(parse_cnf "$SST_SECTIONS" 'ssl-key')
+ SSTCERT=$(parse_cnf "$SST_SECTIONS" 'ssl-cert')
+ SSTCA=$(parse_cnf "$SST_SECTIONS" 'ssl-ca')
+}
+
+SSLMODE=$(parse_cnf "$SST_SECTIONS" 'ssl-mode' | tr [:lower:] [:upper:])
+
+# no old-style SSL config in [sst], check for new one:
+if [ -z "$SSTKEY" -a -z "$SSTCERT" -a -z "$SSTCA" ]; then
+ check_server_ssl_config
+fi
+
+SSTPATH=0
+if [ -n "$SSTCA" ]; then
+ SSTCA=$(trim_string "$SSTCA")
+ if [ "${SSTCA%/}" != "$SSTCA" ]; then
+ SSTPATH=1
+ fi
+fi
+
+if [ -z "$SSLMODE" ]; then
+ # Implicit verification if CA is set and the SSL mode
+ # is not specified by user:
+ if [ -n "$SSTCA" ]; then
+ if [ -n "$(command -v stunnel)" ]; then
+ SSLMODE='VERIFY_CA'
+ fi
+ # Require SSL by default if SSL key and cert are present:
+ elif [ -n "$SSTKEY" -a -n "$SSTCERT" ]; then
+ SSLMODE='REQUIRED'
+ fi
+fi
+
+if [ -n "$SSTCERT" -a -n "$SSTKEY" ]; then
+ verify_cert_matches_key "$SSTCERT" "$SSTKEY"
+fi
+
+if [ -n "$SSTCA" ]; then
+ if [ $SSTPATH -eq 0 ]; then
+ CAFILE_OPT="CAfile = $SSTCA"
+ else
+ CAFILE_OPT="CApath = $SSTCA"
+ fi
+ if [ -n "$SSTCERT" ]; then
+ verify_ca_matches_cert "$SSTCA" "$SSTCERT" $SSTPATH
+ fi
+else
+ CAFILE_OPT=""
+fi
+
+VERIFY_OPT=""
+CHECK_OPT=""
+CHECK_OPT_LOCAL=""
+if [ "${SSLMODE#VERIFY}" != "$SSLMODE" ]
then
- STUNNEL="stunnel ${STUNNEL_CONF}"
+ case "$SSLMODE" in
+ 'VERIFY_IDENTITY')
+ VERIFY_OPT='verifyPeer = yes'
+ ;;
+ 'VERIFY_CA')
+ VERIFY_OPT='verifyChain = yes'
+ ;;
+ *)
+ wsrep_log_error "Unrecognized ssl-mode option: '$SSLMODE'"
+ exit 22 # EINVAL
+ ;;
+ esac
+ if [ -z "$SSTCA" ]; then
+ wsrep_log_error "Can't have ssl-mode='$SSLMODE' without CA file or path"
+ exit 22 # EINVAL
+ fi
+ if [ -n "$WSREP_SST_OPT_REMOTE_USER" ]; then
+ CHECK_OPT="checkHost = $WSREP_SST_OPT_REMOTE_USER"
+ elif [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
+ # check if the address is an ip-address (v4 or v6):
+ if echo "$WSREP_SST_OPT_HOST_UNESCAPED" | \
+ grep -q -E '^([0-9]+(\.[0-9]+){3}|[0-9a-fA-F]*(\:[0-9a-fA-F]*)+)$'
+ then
+ CHECK_OPT="checkIP = $WSREP_SST_OPT_HOST_UNESCAPED"
+ else
+ CHECK_OPT="checkHost = $WSREP_SST_OPT_HOST"
+ fi
+ if is_local_ip "$WSREP_SST_OPT_HOST_UNESCAPED"; then
+ CHECK_OPT_LOCAL="checkHost = localhost"
+ fi
+ fi
+fi
+
+STUNNEL=""
+if [ -n "$SSLMODE" -a "$SSLMODE" != 'DISABLED' ]; then
+ STUNNEL_BIN="$(command -v stunnel)"
+ if [ -n "$STUNNEL_BIN" ]; then
+ wsrep_log_info "Using stunnel for SSL encryption: CA: '$SSTCA', ssl-mode='$SSLMODE'"
+ STUNNEL="$STUNNEL_BIN $STUNNEL_CONF"
+ fi
fi
-if [ "$WSREP_SST_OPT_ROLE" = "donor" ]
+readonly SECRET_TAG="secret"
+
+if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]
then
-cat << EOF > "$STUNNEL_CONF"
-CApath = ${SSTCERT%/*}
+ [ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
+ [ -f "$BINLOG_TAR_FILE" ] && rm -f "$BINLOG_TAR_FILE"
+ [ -f "$STUNNEL_PID" ] && rm -f "$STUNNEL_PID"
+
+ if [ -n "$STUNNEL" ]
+ then
+ cat << EOF > "$STUNNEL_CONF"
+key = $SSTKEY
+cert = $SSTCERT
+${CAFILE_OPT}
foreground = yes
pid = $STUNNEL_PID
debug = warning
client = yes
-connect = ${WSREP_SST_OPT_ADDR%/*}
+connect = $WSREP_SST_OPT_HOST_UNESCAPED:$WSREP_SST_OPT_PORT
TIMEOUTclose = 0
-verifyPeer = yes
+${VERIFY_OPT}
+${CHECK_OPT}
+${CHECK_OPT_LOCAL}
EOF
+ else
+ [ -f "$STUNNEL_CONF" ] && rm -f "$STUNNEL_CONF"
+ fi
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]
then
@@ -238,13 +360,8 @@ EOF
FLUSHED="$WSREP_SST_OPT_DATA/tables_flushed"
ERROR="$WSREP_SST_OPT_DATA/sst_error"
- rm -rf "$FLUSHED"
- rm -rf "$ERROR"
-
- # Use deltaxfer only for WAN
- inv=$(basename $0)
- [ "$inv" = "wsrep_sst_rsync_wan" ] && WHOLE_FILE_OPT="" \
- || WHOLE_FILE_OPT="--whole-file"
+ [ -f "$FLUSHED" ] && rm -f "$FLUSHED"
+ [ -f "$ERROR" ] && rm -f "$ERROR"
echo "flush tables"
@@ -253,63 +370,63 @@ EOF
# (b) Cluster state ID & wsrep_gtid_domain_id to be written to the file, OR
# (c) ERROR file, in case flush tables operation failed.
- while [ ! -r "$FLUSHED" ] && ! grep -q ':' "$FLUSHED" >/dev/null 2>&1
+ while [ ! -r "$FLUSHED" ] && ! grep -q -F ':' "$FLUSHED" >/dev/null 2>&1
do
# Check whether ERROR file exists.
if [ -f "$ERROR" ]
then
# Flush tables operation failed.
- rm -rf "$ERROR"
+ rm -f "$ERROR"
exit 255
fi
-
sleep 0.2
done
- STATE="$(cat $FLUSHED)"
- rm -rf "$FLUSHED"
+ STATE=$(cat "$FLUSHED")
+ rm -f "$FLUSHED"
sync
- if ! [ -z $WSREP_SST_OPT_BINLOG ]
+ if [ -n "$WSREP_SST_OPT_BINLOG" ]
then
# Prepare binlog files
- OLD_PWD="$(pwd)"
- cd $BINLOG_DIRNAME
+ cd "$BINLOG_DIRNAME"
- if ! [ -z $WSREP_SST_OPT_BINLOG_INDEX ]
- binlog_files_full=$(tail -n $BINLOG_N_FILES ${BINLOG_FILENAME}.index)
- then
- cd $BINLOG_INDEX_DIRNAME
- binlog_files_full=$(tail -n $BINLOG_N_FILES ${BINLOG_INDEX_FILENAME}.index)
- fi
+ binlog_files_full=$(tail -n $BINLOG_N_FILES "${WSREP_SST_OPT_BINLOG_INDEX%.index}.index")
- cd $BINLOG_DIRNAME
binlog_files=""
for ii in $binlog_files_full
do
- binlog_files="$binlog_files $(basename $ii)"
+ binlog_file=$(basename "$ii")
+ binlog_files="$binlog_files $binlog_file"
done
- if ! [ -z "$binlog_files" ]
+ if [ -n "$binlog_files" ]
then
wsrep_log_info "Preparing binlog files for transfer:"
- tar -cvf $BINLOG_TAR_FILE $binlog_files >&2
+ tar -cvf "$BINLOG_TAR_FILE" $binlog_files >&2
fi
+
cd "$OLD_PWD"
fi
+ # Use deltaxfer only for WAN
+ inv=$(basename "$0")
+ WHOLE_FILE_OPT=""
+ if [ "${inv%wsrep_sst_rsync_wan*}" = "$inv" ]; then
+ WHOLE_FILE_OPT="--whole-file"
+ fi
+
# first, the normal directories, so that we can detect incompatible protocol
RC=0
- eval rsync ${STUNNEL:+--rsh="$STUNNEL"} \
+ eval rsync ${STUNNEL:+"'--rsh=$STUNNEL'"} \
--owner --group --perms --links --specials \
--ignore-times --inplace --dirs --delete --quiet \
- $WHOLE_FILE_OPT ${FILTER} "$WSREP_SST_OPT_DATA/" \
- rsync://$WSREP_SST_OPT_ADDR >&2 || RC=$?
+ $WHOLE_FILE_OPT $FILTER "'$WSREP_SST_OPT_DATA/'" \
+ "'rsync://$WSREP_SST_OPT_ADDR'" >&2 || RC=$?
- if [ "$RC" -ne 0 ]; then
+ if [ $RC -ne 0 ]; then
wsrep_log_error "rsync returned code $RC:"
-
case $RC in
12) RC=71 # EPROTO
wsrep_log_error \
@@ -330,40 +447,45 @@ EOF
--ignore-times --inplace --dirs --delete --quiet \
$WHOLE_FILE_OPT -f '+ /ibdata*' -f '+ /ib_lru_dump' \
-f '- **' "$INNODB_DATA_HOME_DIR/" \
- rsync://$WSREP_SST_OPT_ADDR-data_dir >&2 || RC=$?
+ "rsync://$WSREP_SST_OPT_ADDR-data_dir" >&2 || RC=$?
if [ $RC -ne 0 ]; then
wsrep_log_error "rsync innodb_data_home_dir returned code $RC:"
exit 255 # unknown error
fi
- # second, we transfer InnoDB log files
+ # second, we transfer InnoDB and Aria log files
rsync ${STUNNEL:+--rsh="$STUNNEL"} \
--owner --group --perms --links --specials \
--ignore-times --inplace --dirs --delete --quiet \
- $WHOLE_FILE_OPT -f '+ /ib_logfile[0-9]*' -f '- **' "$WSREP_LOG_DIR/" \
- rsync://$WSREP_SST_OPT_ADDR-log_dir >&2 || RC=$?
+ $WHOLE_FILE_OPT -f '+ /ib_logfile[0-9]*' -f '+ /aria_log.*' \
+ -f '+ /aria_log_control' -f '- **' "$WSREP_LOG_DIR/" \
+ "rsync://$WSREP_SST_OPT_ADDR-log_dir" >&2 || RC=$?
if [ $RC -ne 0 ]; then
wsrep_log_error "rsync innodb_log_group_home_dir returned code $RC:"
exit 255 # unknown error
fi
- # then, we parallelize the transfer of database directories, use . so that pathconcatenation works
- OLD_PWD="$(pwd)"
- cd $WSREP_SST_OPT_DATA
+ # then, we parallelize the transfer of database directories,
+ # use '.' so that path concatenation works:
- count=1
- [ "$OS" = "Linux" ] && count=$(grep -c processor /proc/cpuinfo)
- [ "$OS" = "Darwin" -o "$OS" = "FreeBSD" ] && count=$(sysctl -n hw.ncpu)
+ cd "$WSREP_SST_OPT_DATA"
+
+ backup_threads=$(parse_cnf "--mysqld|sst" 'backup-threads')
+ if [ -z "$backup_threads" ]; then
+ get_proc
+ backup_threads=$nproc
+ fi
- find . -maxdepth 1 -mindepth 1 -type d -not -name "lost+found" -not -name ".zfs" \
- -print0 | xargs -I{} -0 -P $count \
+ find . -maxdepth 1 -mindepth 1 -type d -not -name 'lost+found' \
+ -not -name '.zfs' -print0 | xargs -I{} -0 -P $backup_threads \
rsync ${STUNNEL:+--rsh="$STUNNEL"} \
--owner --group --perms --links --specials \
--ignore-times --inplace --recursive --delete --quiet \
- $WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \
- rsync://$WSREP_SST_OPT_ADDR/{} >&2 || RC=$?
+ $WHOLE_FILE_OPT --exclude '*/ib_logfile*' --exclude '*/aria_log.*' \
+ --exclude '*/aria_log_control' "$WSREP_SST_OPT_DATA/{}/" \
+ "rsync://$WSREP_SST_OPT_ADDR/{}" >&2 || RC=$?
cd "$OLD_PWD"
@@ -373,68 +495,102 @@ EOF
fi
else # BYPASS
+
wsrep_log_info "Bypassing state dump."
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
# (separated by a space).
STATE="$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID"
+
fi
- echo "continue" # now server can resume updating data
+ echo 'continue' # now server can resume updating data
echo "$STATE" > "$MAGIC_FILE"
+
+ if [ -n "$WSREP_SST_OPT_REMOTE_PSWD" ]; then
+ # Let joiner know that we know its secret
+ echo "$SECRET_TAG $WSREP_SST_OPT_REMOTE_PSWD" >> "$MAGIC_FILE"
+ fi
+
rsync ${STUNNEL:+--rsh="$STUNNEL"} \
- --archive --quiet --checksum "$MAGIC_FILE" rsync://$WSREP_SST_OPT_ADDR
+ --archive --quiet --checksum "$MAGIC_FILE" "rsync://$WSREP_SST_OPT_ADDR"
echo "done $STATE"
-elif [ "$WSREP_SST_OPT_ROLE" = "joiner" ]
+ if [ -n "$STUNNEL" ]; then
+ [ -f "$STUNNEL_CONF" ] && rm -f "$STUNNEL_CONF"
+ [ -f "$STUNNEL_PID" ] && rm -f "$STUNNEL_PID"
+ fi
+
+elif [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]
then
- wsrep_check_programs lsof
+ check_sockets_utils
- touch $SST_PROGRESS_FILE
- MYSQLD_PID=$WSREP_SST_OPT_PARENT
+ SST_PID="$WSREP_SST_OPT_DATA/wsrep_rsync_sst.pid"
- MODULE="rsync_sst"
+ # give some time for previous SST to complete:
+ check_round=0
+ while check_pid "$SST_PID" 0
+ do
+ wsrep_log_info "previous SST is not completed, waiting for it to exit"
+ check_round=$(( check_round + 1 ))
+ if [ $check_round -eq 10 ]; then
+ wsrep_log_error "previous SST script still running."
+ exit 114 # EALREADY
+ fi
+ sleep 1
+ done
+ # give some time for stunnel from the previous SST to complete:
+ check_round=0
+ while check_pid "$STUNNEL_PID" 1
+ do
+ wsrep_log_info "lingering stunnel daemon found at startup, waiting for it to exit"
+ check_round=$(( check_round + 1 ))
+ if [ $check_round -eq 10 ]; then
+ wsrep_log_error "stunnel daemon already running."
+ exit 114 # EALREADY
+ fi
+ sleep 1
+ done
+
+ MODULE="rsync_sst"
RSYNC_PID="$WSREP_SST_OPT_DATA/$MODULE.pid"
- # give some time for lingering rsync from previous SST to complete
+ RSYNC_CONF="$WSREP_SST_OPT_DATA/$MODULE.conf"
+
+ # give some time for rsync from the previous SST to complete:
check_round=0
- while check_pid $RSYNC_PID && [ $check_round -lt 10 ]
+ while check_pid "$RSYNC_PID" 1
do
wsrep_log_info "lingering rsync daemon found at startup, waiting for it to exit"
check_round=$(( check_round + 1 ))
+ if [ $check_round -eq 10 ]; then
+ wsrep_log_error "rsync daemon already running."
+ exit 114 # EALREADY
+ fi
sleep 1
done
- if check_pid $RSYNC_PID
- then
- wsrep_log_error "rsync daemon already running."
- exit 114 # EALREADY
- fi
- rm -rf "$RSYNC_PID"
+ [ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
+ [ -f "$BINLOG_TAR_FILE" ] && rm -f "$BINLOG_TAR_FILE"
- ADDR=$WSREP_SST_OPT_ADDR
- if [ "${ADDR#\[}" != "$ADDR" ]; then
- RSYNC_PORT=$(echo $ADDR | awk -F '\\]:' '{ print $2 }')
- RSYNC_ADDR=$(echo $ADDR | awk -F '\\]:' '{ print $1 }')"]"
- else
- RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }')
- RSYNC_ADDR=$(echo $ADDR | awk -F ':' '{ print $1 }')
- fi
- if [ -z "$RSYNC_PORT" ]
- then
- RSYNC_PORT=4444
- ADDR="$RSYNC_ADDR:$RSYNC_PORT"
+ if [ -z "$STUNNEL" ]; then
+ [ -f "$STUNNEL_CONF" ] && rm -f "$STUNNEL_CONF"
fi
+ ADDR="$WSREP_SST_OPT_ADDR"
+ RSYNC_PORT="$WSREP_SST_OPT_PORT"
+ RSYNC_ADDR="$WSREP_SST_OPT_HOST"
+ RSYNC_ADDR_UNESCAPED="$WSREP_SST_OPT_HOST_UNESCAPED"
+
trap "exit 32" HUP PIPE
trap "exit 3" INT TERM ABRT
trap cleanup_joiner EXIT
- RSYNC_CONF="$WSREP_SST_OPT_DATA/$MODULE.conf"
+ touch "$SST_PROGRESS_FILE"
- if [ -n "${MYSQL_TMP_DIR:-}" ] ; then
+ if [ -n "${MYSQL_TMP_DIR:-}" ]; then
SILENT="log file = $MYSQL_TMP_DIR/rsyncd.log"
else
SILENT=""
@@ -455,106 +611,188 @@ $SILENT
path = $INNODB_DATA_HOME_DIR
EOF
-# rm -rf "$DATA"/ib_logfile* # we don't want old logs around
+# rm -rf "$DATA/ib_logfile"* # we don't want old logs around
- readonly RSYNC_PORT=${WSREP_SST_OPT_PORT:-4444}
- # If the IP is local listen only in it
- if is_local_ip "$RSYNC_ADDR"
+ # If the IP is local, listen only on it:
+ if is_local_ip "$RSYNC_ADDR_UNESCAPED"
then
- RSYNC_EXTRA_ARGS="--address $RSYNC_ADDR"
- STUNNEL_ACCEPT="$RSYNC_ADDR:$RSYNC_PORT"
+ RSYNC_EXTRA_ARGS="--address $RSYNC_ADDR_UNESCAPED"
+ STUNNEL_ACCEPT="$RSYNC_ADDR_UNESCAPED:$RSYNC_PORT"
else
- # Not local, possibly a NAT, listen on all interfaces
- RSYNC_EXTRA_ARGS=""
- STUNNEL_ACCEPT="$RSYNC_PORT"
- # Overwrite address with all
- RSYNC_ADDR="*"
+ # Not local, possibly a NAT, listen on all interfaces:
+ RSYNC_EXTRA_ARGS=""
+ STUNNEL_ACCEPT="$RSYNC_PORT"
+ # Overwrite address with all:
+ RSYNC_ADDR="*"
fi
+ echo $$ > "$SST_PID"
+
if [ -z "$STUNNEL" ]
then
- rsync --daemon --no-detach --port "$RSYNC_PORT" --config "$RSYNC_CONF" ${RSYNC_EXTRA_ARGS} &
- RSYNC_REAL_PID=$!
+ rsync --daemon --no-detach --port "$RSYNC_PORT" --config "$RSYNC_CONF" $RSYNC_EXTRA_ARGS &
+ RSYNC_REAL_PID=$!
+ TRANSFER_REAL_PID=$RSYNC_REAL_PID
+ TRANSFER_PID="$RSYNC_PID"
else
- cat << EOF > "$STUNNEL_CONF"
+ # Let's check if the path to the config file contains a space?
+ if [ "${RSYNC_CONF#* }" = "$RSYNC_CONF" ]; then
+ cat << EOF > "$STUNNEL_CONF"
key = $SSTKEY
cert = $SSTCERT
+${CAFILE_OPT}
foreground = yes
pid = $STUNNEL_PID
debug = warning
client = no
+${VERIFY_OPT}
+${CHECK_OPT}
+${CHECK_OPT_LOCAL}
[rsync]
accept = $STUNNEL_ACCEPT
-exec = $(which rsync)
+exec = $(command -v rsync)
execargs = rsync --server --daemon --config=$RSYNC_CONF .
EOF
- stunnel "$STUNNEL_CONF" &
- RSYNC_REAL_PID=$!
- RSYNC_PID=$STUNNEL_PID
+ else
+ # The path contains a space, so we will run it via
+ # shell with "eval" command:
+ export RSYNC_CMD="eval $(command -v rsync) --server --daemon --config='$RSYNC_CONF' ."
+ cat << EOF > "$STUNNEL_CONF"
+key = $SSTKEY
+cert = $SSTCERT
+${CAFILE_OPT}
+foreground = yes
+pid = $STUNNEL_PID
+debug = warning
+client = no
+${VERIFY_OPT}
+${CHECK_OPT}
+${CHECK_OPT_LOCAL}
+[rsync]
+accept = $STUNNEL_ACCEPT
+exec = $SHELL
+execargs = $SHELL -c \$RSYNC_CMD
+EOF
+ fi
+ stunnel "$STUNNEL_CONF" &
+ STUNNEL_REAL_PID=$!
+ TRANSFER_REAL_PID=$STUNNEL_REAL_PID
+ TRANSFER_PID="$STUNNEL_PID"
+ fi
+
+ if [ "${SSLMODE#VERIFY}" != "$SSLMODE" ]
+ then # backward-incompatible behavior
+ CN=""
+ if [ -n "$SSTCERT" ]
+ then
+ # find out my Common Name
+ get_openssl
+ if [ -z "$OPENSSL_BINARY" ]; then
+ wsrep_log_error 'openssl not found but it is required for authentication'
+ exit 42
+ fi
+ CN=$("$OPENSSL_BINARY" x509 -noout -subject -in "$SSTCERT" | \
+ tr "," "\n" | grep -F 'CN =' | cut -d= -f2 | sed s/^\ // | \
+ sed s/\ %//)
+ fi
+ MY_SECRET="$(wsrep_gen_secret)"
+ # Add authentication data to address
+ ADDR="$CN:$MY_SECRET@$WSREP_SST_OPT_HOST"
+ else
+ MY_SECRET="" # for check down in recv_joiner()
+ ADDR="$WSREP_SST_OPT_HOST"
fi
- until check_pid_and_port "$RSYNC_PID" "$RSYNC_REAL_PID" "$RSYNC_ADDR" "$RSYNC_PORT"
+ until check_pid_and_port "$TRANSFER_PID" $TRANSFER_REAL_PID "$RSYNC_ADDR_UNESCAPED" "$RSYNC_PORT"
do
sleep 0.2
done
- echo "ready $WSREP_SST_OPT_HOST:$RSYNC_PORT/$MODULE"
+ echo "ready $ADDR:$RSYNC_PORT/$MODULE"
+
+ MYSQLD_PID="$WSREP_SST_OPT_PARENT"
# wait for SST to complete by monitoring magic file
- while [ ! -r "$MAGIC_FILE" ] && check_pid "$RSYNC_PID" && \
- ps -p $MYSQLD_PID >/dev/null
+ while [ ! -r "$MAGIC_FILE" ] && check_pid "$TRANSFER_PID" && \
+ ps -p $MYSQLD_PID >/dev/null 2>&1
do
sleep 1
done
- if ! ps -p $MYSQLD_PID >/dev/null
+ if ! ps -p $MYSQLD_PID >/dev/null 2>&1
then
wsrep_log_error \
- "Parent mysqld process (PID:$MYSQLD_PID) terminated unexpectedly."
- kill -- -"${MYSQLD_PID}"
+ "Parent mysqld process (PID: $MYSQLD_PID) terminated unexpectedly."
+ kill -- -$MYSQLD_PID
sleep 1
exit 32
fi
- if ! [ -z $WSREP_SST_OPT_BINLOG ]
- then
+ if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
+ if [ -f "$BINLOG_TAR_FILE" ]; then
+ cd "$BINLOG_DIRNAME"
- OLD_PWD="$(pwd)"
- cd $BINLOG_DIRNAME
+ binlog_index="${WSREP_SST_OPT_BINLOG_INDEX%.index}.index"
- if [ -f $BINLOG_TAR_FILE ]
- then
# Clean up old binlog files first
- rm -f ${BINLOG_FILENAME}.*
+ rm -f "$BINLOG_FILENAME".[0-9]*
+ [ -f "$binlog_index" ] && rm -f "$binlog_index"
+
+ # Create a temporary file:
+ tmpdir=$(parse_cnf '--mysqld|sst' 'tmpdir')
+ if [ -z "$tmpdir" ]; then
+ tmpfile="$(mktemp)"
+ elif [ "$OS" = 'Linux' ]; then
+ tmpfile=$(mktemp "--tmpdir=$tmpdir")
+ else
+ tmpfile=$(TMPDIR="$tmpdir"; mktemp '-d')
+ fi
+
wsrep_log_info "Extracting binlog files:"
- tar -xvf $BINLOG_TAR_FILE >&2
- for ii in $(ls -1 ${BINLOG_FILENAME}.*)
- do
- if ! [ -z $WSREP_SST_OPT_BINLOG_INDEX ]
- echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_FILENAME}.index
- then
- echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_INDEX_DIRNAME}/${BINLOG_INDEX_FILENAME}.index
- fi
- done
- fi
- cd "$OLD_PWD"
+ if ! tar -xvf "$BINLOG_TAR_FILE" > "$tmpfile"; then
+ wsrep_log_error "Error unpacking tar file with binlog files"
+ rm -f "$tmpfile"
+ exit 32
+ fi
+
+ # Rebuild binlog index:
+ while read bin_file; do
+ echo "$BINLOG_DIRNAME/$bin_file" >> "$binlog_index"
+ done < "$tmpfile"
+ rm -f "$tmpfile"
+ cd "$OLD_PWD"
+ fi
fi
- if [ -r "$MAGIC_FILE" ]
- then
- # UUID:seqno & wsrep_gtid_domain_id is received here.
- cat "$MAGIC_FILE" # Output : UUID:seqno wsrep_gtid_domain_id
+
+ if [ -r "$MAGIC_FILE" ]; then
+ if [ -n "$MY_SECRET" ]; then
+ # check donor supplied secret
+ SECRET=$(grep -F -- "$SECRET_TAG " "$MAGIC_FILE" 2>/dev/null | cut -d ' ' -f 2)
+ if [ "$SECRET" != "$MY_SECRET" ]; then
+ wsrep_log_error "Donor does not know my secret!"
+ wsrep_log_info "Donor:'$SECRET', my:'$MY_SECRET'"
+ exit 32
+ fi
+ # remove secret from the magic file, and output
+ # the UUID:seqno & wsrep_gtid_domain_id:
+ grep -v -F -- "$SECRET_TAG " "$MAGIC_FILE"
+ else
+ # Output the UUID:seqno and wsrep_gtid_domain_id:
+ cat "$MAGIC_FILE"
+ fi
else
# this message should cause joiner to abort
echo "rsync process ended without creating '$MAGIC_FILE'"
fi
- wsrep_cleanup_progress_file
-# cleanup_joiner
+
+# wsrep_cleanup_progress_file
+# cleanup_joiner
else
wsrep_log_error "Unrecognized role: '$WSREP_SST_OPT_ROLE'"
exit 22 # EINVAL
fi
-rm -f $BINLOG_TAR_FILE || :
+[ -f "$BINLOG_TAR_FILE" ] && rm -f "$BINLOG_TAR_FILE"
exit 0
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh
index 8c8af9a0219..7cc05185ce3 100644
--- a/scripts/wsrep_sst_xtrabackup-v2.sh
+++ b/scripts/wsrep_sst_xtrabackup-v2.sh
@@ -1,4 +1,5 @@
#!/bin/bash -ue
+# Copyright (C) 2017-2021 MariaDB
# Copyright (C) 2013 Percona Inc
#
# This program is free software; you can redistribute it and/or modify
@@ -15,48 +16,52 @@
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA 02110-1335 USA.
-# Documentation: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
+# Documentation:
+# http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
# Make sure to read that before proceeding!
+. $(dirname "$0")/wsrep_sst_common
+wsrep_check_datadir
-
-
-. $(dirname $0)/wsrep_sst_common
-
+OS="$(uname)"
ealgo=""
+eformat=""
ekey=""
ekeyfile=""
encrypt=0
-nproc=1
ecode=0
ssyslog=""
ssystag=""
-XTRABACKUP_PID=""
-tca=""
+BACKUP_PID=""
tcert=""
+tpath=0
+tpem=""
tkey=""
+tmode="DISABLED"
sockopt=""
progress=""
ttime=0
totime=0
+lsn=""
ecmd=""
rlimit=""
# Initially
-stagemsg="${WSREP_SST_OPT_ROLE}"
+stagemsg="$WSREP_SST_OPT_ROLE"
cpat=""
+speciald=1
ib_home_dir=""
ib_log_dir=""
ib_undo_dir=""
-sfmt="tar"
+sfmt=""
strmcmd=""
tfmt=""
tcmd=""
rebuild=0
rebuildcmd=""
payload=0
-pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' "
-pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE "
+pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p'"
+pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE"
STATDIR=""
uextra=0
disver=""
@@ -67,41 +72,54 @@ xtmpdir=""
scomp=""
sdecomp=""
+
ssl_dhparams=""
-ssl_cert=""
-ssl_ca=""
-ssl_key=""
+compress='none'
+compress_chunk=""
+compress_threads=""
+
+backup_threads=""
+
+encrypt_threads=""
+encrypt_chunk=""
-if which pv &>/dev/null && pv --help | grep -q FORMAT;then
- pvopts+=$pvformat
+readonly SECRET_TAG="secret"
+
+sst_ver=-1
+
+if [ -n "$(command -v pv)" ] && pv --help | grep -qw -- '-F'; then
+ pvopts="$pvopts $pvformat"
fi
pcmd="pv $pvopts"
declare -a RC
-INNOBACKUPEX_BIN=innobackupex
-DATA="${WSREP_SST_OPT_DATA}"
+BACKUP_BIN="$(command -v innobackupex)"
+if [ ! -x "$BACKUP_BIN" ]; then
+ wsrep_log_error 'innobackupex binary not found in path'
+ exit 42
+fi
+
+DATA="$WSREP_SST_OPT_DATA"
INFO_FILE="xtrabackup_galera_info"
IST_FILE="xtrabackup_ist"
-MAGIC_FILE="${DATA}/${INFO_FILE}"
+MAGIC_FILE="$DATA/$INFO_FILE"
+
+INNOAPPLYLOG="$DATA/innobackupex.prepare.log"
+INNOMOVELOG="$DATA/innobackupex.move.log"
+INNOBACKUPLOG="$DATA/innobackupex.backup.log"
# Setting the path for ss and ip
export PATH="/usr/sbin:/sbin:$PATH"
-OS=$(uname)
-
-if ! which lsof > /dev/null; then
- wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed."
- exit 2 # ENOENT
-fi
-
-timeit(){
- local stage=$1
+timeit()
+{
+ local stage="$1"
shift
local cmd="$@"
local x1 x2 took extcode
- if [[ $ttime -eq 1 ]];then
+ if [ $ttime -eq 1 ]; then
x1=$(date +%s)
wsrep_log_info "Evaluating $cmd"
eval "$cmd"
@@ -110,7 +128,7 @@ timeit(){
took=$(( x2-x1 ))
wsrep_log_info "NOTE: $stage took $took seconds"
totime=$(( totime+took ))
- else
+ else
wsrep_log_info "Evaluating $cmd"
eval "$cmd"
extcode=$?
@@ -121,307 +139,310 @@ timeit(){
get_keys()
{
# $encrypt -eq 1 is for internal purposes only
- if [[ $encrypt -ge 2 || $encrypt -eq -1 ]];then
- return
+ if [ $encrypt -ge 2 -o $encrypt -eq -1 ]; then
+ return
fi
- if [[ $encrypt -eq 0 ]];then
- if $MY_PRINT_DEFAULTS xtrabackup | grep -q encrypt;then
- wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html "
+ if [ $encrypt -eq 0 ]; then
+ if [ -n "$ealgo" -o -n "$ekey" -o -n "$ekeyfile" ]; then
+ wsrep_log_error "Options for encryption are specified, " \
+ "but encryption itself is disabled. SST may fail."
fi
return
fi
- if [[ $sfmt == 'tar' ]];then
- wsrep_log_info "NOTE: Xtrabackup-based encryption - encrypt=1 - cannot be enabled with tar format"
+ if [ $sfmt = 'tar' ]; then
+ wsrep_log_info "NOTE: key-based encryption (encrypt=1) " \
+ "cannot be enabled with tar format"
encrypt=-1
return
fi
- wsrep_log_info "Xtrabackup based encryption enabled in my.cnf - Supported only from Xtrabackup 2.1.4"
+ wsrep_log_info "Key based encryption enabled in my.cnf - supported only from Xtrabackup 2.1.4"
- if [[ -z $ealgo ]];then
+ if [ -z "$ealgo" ]; then
wsrep_log_error "FATAL: Encryption algorithm empty from my.cnf, bailing out"
exit 3
fi
- if [[ -z $ekey && ! -r $ekeyfile ]];then
- wsrep_log_error "FATAL: Either key or keyfile must be readable"
+ if [ -z "$ekey" -a ! -r "$ekeyfile" ]; then
+ wsrep_log_error "FATAL: Either key must be specified " \
+ "or keyfile must be readable"
exit 3
fi
- if [[ -z $ekey ]];then
- ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key-file=$ekeyfile"
- else
- wsrep_log_warning "Using the 'encrypt-key' option causes the encryption key"
- wsrep_log_warning "to be set via the command-line and is considered insecure."
- wsrep_log_warning "It is recommended to use the 'encrypt-key-file' option instead."
-
- ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key=$ekey"
- fi
-
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- ecmd+=" -d"
- fi
-
- stagemsg+="-XB-Encrypted"
-}
-
-#
-# If the ssl_dhparams variable is already set, uses that as a source
-# of dh parameters for OpenSSL. Otherwise, looks for dhparams.pem in the
-# datadir, and creates it there if it can't find the file.
-# No input parameters
-#
-check_for_dhparams()
-{
- if [[ -z "$ssl_dhparams" ]]; then
- if ! [[ -r "$DATA/dhparams.pem" ]]; then
- wsrep_check_programs openssl
- wsrep_log_info "Could not find dhparams file, creating $DATA/dhparams.pem"
-
- if ! openssl dhparam -out "$DATA/dhparams.pem" 2048 >/dev/null 2>&1
- then
- wsrep_log_error "******** FATAL ERROR ********************************* "
- wsrep_log_error "* Could not create the dhparams.pem file with OpenSSL. "
- wsrep_log_error "****************************************************** "
- exit 22
- fi
+ if [ "$eformat" = 'openssl' ]; then
+ get_openssl
+ if [ -z "$OPENSSL_BINARY" ]; then
+ wsrep_log_error "If encryption using the openssl is enabled, " \
+ "then you need to install openssl"
+ exit 2
+ fi
+ ecmd="'$OPENSSL_BINARY' enc -$ealgo"
+ if "$OPENSSL_BINARY" enc -help 2>&1 | grep -qw -- '-pbkdf2'; then
+ ecmd="$ecmd -pbkdf2"
+ elif "$OPENSSL_BINARY" enc -help 2>&1 | grep -qw -- '-iter'; then
+ ecmd="$ecmd -iter 1"
+ elif "$OPENSSL_BINARY" enc -help 2>&1 | grep -qw -- '-md'; then
+ ecmd="$ecmd -md sha256"
fi
- ssl_dhparams="$DATA/dhparams.pem"
+ if [ -z "$ekey" ]; then
+ ecmd="$ecmd -kfile '$ekeyfile'"
+ else
+ ecmd="$ecmd -k '$ekey'"
+ fi
+ elif [ "$eformat" = 'xbcrypt' ]; then
+ if [ -z "$(command -v xbcrypt)" ]; then
+ wsrep_log_error "If encryption using the xbcrypt is enabled, " \
+ "then you need to install xbcrypt"
+ exit 2
+ fi
+ wsrep_log_info "NOTE: xbcrypt-based encryption, " \
+ "supported only from Xtrabackup 2.1.4"
+ if [ -z "$ekey" ]; then
+ ecmd="xbcrypt --encrypt-algo='$ealgo' --encrypt-key-file='$ekeyfile'"
+ else
+ wsrep_log_warning \
+ "Using the 'encrypt-key' option causes the encryption key " \
+ "to be set via the command-line and is considered insecure. " \
+ "It is recommended to use the 'encrypt-key-file' option instead."
+ ecmd="xbcrypt --encrypt-algo='$ealgo' --encrypt-key='$ekey'"
+ fi
+ if [ -n "$encrypt_threads" ]; then
+ ecmd="$ecmd --encrypt-threads=$encrypt_threads"
+ fi
+ if [ -n "$encrypt_chunk" ]; then
+ ecmd="$ecmd --encrypt-chunk-size=$encrypt_chunk"
+ fi
+ else
+ wsrep_log_error "Unknown encryption format='$eformat'"
+ exit 2
fi
-}
-
-#
-# verifies that the certificate matches the private key
-# doing this will save us having to wait for a timeout that would
-# otherwise occur.
-#
-# 1st param: path to the cert
-# 2nd param: path to the private key
-#
-verify_cert_matches_key()
-{
- local cert_path=$1
- local key_path=$2
-
- wsrep_check_programs openssl diff
- # generate the public key from the cert and the key
- # they should match (otherwise we can't create an SSL connection)
- if ! diff <(openssl x509 -in "$cert_path" -pubkey -noout) <(openssl rsa -in "$key_path" -pubout 2>/dev/null) >/dev/null 2>&1
- then
- wsrep_log_error "******** FATAL ERROR ************************* "
- wsrep_log_error "* The certifcate and private key do not match. "
- wsrep_log_error "* Please check your certificate and key files. "
- wsrep_log_error "********************************************** "
- exit 22
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ ecmd="$ecmd -d"
fi
-}
-
-# Checks to see if the file exists
-# If the file does not exist (or cannot be read), issues an error
-# and exits
-#
-# 1st param: file name to be checked (for read access)
-# 2nd param: 1st error message (header)
-# 3rd param: 2nd error message (footer, optional)
-#
-verify_file_exists()
-{
- local file_path=$1
- local error_message1=$2
- local error_message2=$3
-
- if ! [[ -r "$file_path" ]]; then
- wsrep_log_error "******** FATAL ERROR ************************* "
- wsrep_log_error "* $error_message1 "
- wsrep_log_error "* Could not find/access : $file_path "
- if ! [[ -z "$error_message2" ]]; then
- wsrep_log_error "* $error_message2 "
- fi
-
- wsrep_log_error "********************************************** "
- exit 22
- fi
+ stagemsg="$stagemsg-XB-Encrypted"
}
get_transfer()
{
- TSST_PORT=${WSREP_SST_OPT_PORT:-4444}
-
- if [[ $tfmt == 'nc' ]];then
- if [[ ! -x `which nc` ]];then
- wsrep_log_error "nc(netcat) not found in path: $PATH"
- exit 2
- fi
-
- if [[ $encrypt -eq 2 || $encrypt -eq 3 || $encrypt -eq 4 ]]; then
- wsrep_log_error "******** FATAL ERROR *********************** "
- wsrep_log_error "* Using SSL encryption (encrypt= 2, 3, or 4) "
- wsrep_log_error "* is not supported when using nc(netcat). "
- wsrep_log_error "******************************************** "
- exit 22
- fi
-
+ if [ $tfmt = 'nc' ]; then
wsrep_log_info "Using netcat as streamer"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- if nc -h 2>&1 | grep -q ncat; then
- # Ncat
- tcmd="nc $sockopt -l ${TSST_PORT}"
- elif nc -h 2>&1 | grep -q -- '-d\>';then
- # Debian netcat
- tcmd="nc $sockopt -dl ${TSST_PORT}"
+ wsrep_check_programs nc
+ tcmd="nc"
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ if nc -h 2>&1 | grep -q 'ncat'; then
+ wsrep_log_info "Using Ncat as streamer"
+ tcmd="$tcmd -l"
+ elif nc -h 2>&1 | grep -qw -- '-d'; then
+ wsrep_log_info "Using Debian netcat as streamer"
+ tcmd="$tcmd -dl"
+ if [ $WSREP_SST_OPT_HOST_IPv6 -eq 1 ]; then
+ # When host is not explicitly specified (when only the port
+ # is specified) netcat can only bind to an IPv4 address if
+ # the "-6" option is not explicitly specified:
+ tcmd="$tcmd -6"
+ fi
else
- # traditional netcat
- tcmd="nc $sockopt -l -p ${TSST_PORT}"
+ wsrep_log_info "Using traditional netcat as streamer"
+ tcmd="$tcmd -l -p"
fi
+ tcmd="$tcmd $SST_PORT"
else
- if nc -h 2>&1 | grep -q ncat;then
- # Ncat
- tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
- elif nc -h 2>&1 | grep -q -- '-d\>';then
- # Debian netcat
- tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
+ # Check to see if netcat supports the '-N' flag.
+ # -N Shutdown the network socket after EOF on stdin
+ # If it supports the '-N' flag, then we need to use the '-N'
+ # flag, otherwise the transfer will stay open after the file
+ # transfer and cause the command to timeout.
+ # Older versions of netcat did not need this flag and will
+ # return an error if the flag is used.
+ if nc -h 2>&1 | grep -qw -- '-N'; then
+ tcmd="$tcmd -N"
+ wsrep_log_info "Using nc -N"
+ fi
+ # netcat doesn't understand [] around IPv6 address
+ if nc -h 2>&1 | grep -q ncat; then
+ wsrep_log_info "Using Ncat as streamer"
+ elif nc -h 2>&1 | grep -qw -- '-d'; then
+ wsrep_log_info "Using Debian netcat as streamer"
else
- # traditional netcat
- tcmd="nc -q0 ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
+ wsrep_log_info "Using traditional netcat as streamer"
+ tcmd="$tcmd -q0"
fi
+ tcmd="$tcmd $WSREP_SST_OPT_HOST_UNESCAPED $SST_PORT"
fi
else
tfmt='socat'
+
wsrep_log_info "Using socat as streamer"
- if [[ ! -x `which socat` ]];then
- wsrep_log_error "socat not found in path: $PATH"
- exit 2
+ wsrep_check_programs socat
+
+ if [ -n "$sockopt" ]; then
+ sockopt=$(trim_string "$sockopt" ',')
+ if [ -n "$sockopt" ]; then
+ sockopt=",$sockopt"
+ fi
fi
- donor_extra=""
- joiner_extra=""
- if [[ $encrypt -eq 2 || $encrypt -eq 3 || $encrypt -eq 4 ]]; then
- if ! socat -V | grep -q WITH_OPENSSL; then
- wsrep_log_error "******** FATAL ERROR ****************** "
- wsrep_log_error "* socat is not openssl enabled. "
- wsrep_log_error "* Unable to encrypt SST communications. "
- wsrep_log_error "*************************************** "
- exit 2
+ # Add an option for ipv6 if needed:
+ if [ $WSREP_SST_OPT_HOST_IPv6 -eq 1 ]; then
+ # If sockopt contains 'pf=ip6' somewhere in the middle,
+ # this will not interfere with socat, but exclude the trivial
+ # cases when sockopt contains 'pf=ip6' as prefix or suffix:
+ if [ "$sockopt" = "${sockopt#,pf=ip6}" -a \
+ "$sockopt" = "${sockopt%,pf=ip6}" ]
+ then
+ sockopt=",pf=ip6$sockopt"
fi
+ fi
- # Determine the socat version
- SOCAT_VERSION=`socat -V 2>&1 | grep -oe '[0-9]\.[0-9][\.0-9]*' | head -n1`
- if [[ -z "$SOCAT_VERSION" ]]; then
- wsrep_log_error "******** FATAL ERROR **************** "
- wsrep_log_error "* Cannot determine the socat version. "
- wsrep_log_error "************************************* "
- exit 2
+ if [ $encrypt -lt 2 ]; then
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ tcmd="socat -u TCP-LISTEN:$SST_PORT,reuseaddr$sockopt stdio"
+ else
+ tcmd="socat -u stdio TCP:$REMOTEIP:$SST_PORT$sockopt"
fi
+ return
+ fi
- # socat versions < 1.7.3 will have 512-bit dhparams (too small)
- # so create 2048-bit dhparams and send that as a parameter
- # socat version >= 1.7.3, checks to see if the peername matches the hostname
- # set commonname="" to disable the peername checks
- #
- if ! check_for_version "$SOCAT_VERSION" "1.7.3"; then
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]]; then
- # dhparams check (will create ssl_dhparams if needed)
+ if ! socat -V | grep -q -F 'WITH_OPENSSL 1'; then
+ wsrep_log_error "******** FATAL ERROR ************************************************ "
+ wsrep_log_error "* Encryption requested, but socat is not OpenSSL enabled (encrypt=$encrypt) *"
+ wsrep_log_error "********************************************************************* "
+ exit 2
+ fi
+
+ local action='Decrypting'
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ tcmd="socat -u openssl-listen:$SST_PORT,reuseaddr"
+ else
+ tcmd="socat -u stdio openssl-connect:$REMOTEIP:$SST_PORT"
+ action='Encrypting'
+ fi
+
+ if [ "${sockopt#*,dhparam=}" != "$sockopt" ]; then
+ if [ -z "$ssl_dhparams" ]; then
+ # Determine the socat version
+ SOCAT_VERSION=$(socat -V 2>&1 | grep -m1 -oe '[0-9]\.[0-9][\.0-9]*')
+ if [ -z "$SOCAT_VERSION" ]; then
+ wsrep_log_error "******** FATAL ERROR ******************"
+ wsrep_log_error "* Cannot determine the socat version. *"
+ wsrep_log_error "***************************************"
+ exit 2
+ fi
+ if ! check_for_version "$SOCAT_VERSION" '1.7.3'; then
+ # socat versions < 1.7.3 will have 512-bit dhparams (too small)
+ # so create 2048-bit dhparams and send that as a parameter:
check_for_dhparams
- joiner_extra=",dhparam=$ssl_dhparams"
fi
fi
- if check_for_version "$SOCAT_VERSION" "1.7.3"; then
- donor_extra=',commonname=""'
+ if [ -n "$ssl_dhparams" ]; then
+ tcmd="$tcmd,dhparam='$ssl_dhparams'"
fi
fi
- if [[ $encrypt -eq 2 ]]; then
- wsrep_log_warning "**** WARNING **** encrypt=2 is deprecated and will be removed in a future release"
- wsrep_log_info "Using openssl based encryption with socat: with crt and ca"
+ CN_option=",commonname=''"
- verify_file_exists "$tcert" "Both certificate and CA files are required." \
- "Please check the 'tcert' option. "
- verify_file_exists "$tca" "Both certificate and CA files are required." \
- "Please check the 'tca' option. "
-
- stagemsg+="-OpenSSL-Encrypted-2"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- wsrep_log_info "Decrypting with CERT: $tcert, CA: $tca"
- tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tcert},cafile=${tca}${joiner_extra}${sockopt} stdio"
+ if [ $encrypt -eq 2 ]; then
+ wsrep_log_info "Using openssl based encryption with socat: with crt and pem"
+ if [ -z "$tpem" -o -z "$tcert" ]; then
+ wsrep_log_error \
+ "Both PEM file and CRT file (or path) are required"
+ exit 22
+ fi
+ if [ ! -r "$tpem" -o ! -r "$tcert" ]; then
+ wsrep_log_error \
+ "Both PEM file and CRT file (or path) must be readable"
+ exit 22
+ fi
+ verify_ca_matches_cert "$tcert" "$tpem" $tpath
+ if [ $tpath -eq 0 ]; then
+ tcmd="$tcmd,cert='$tpem',cafile='$tcert'"
else
- wsrep_log_info "Encrypting with CERT: $tcert, CA: $tca"
- tcmd="socat -u stdio openssl-connect:${WSREP_SST_OPT_HOST}:${TSST_PORT},cert=${tcert},cafile=${tca}${donor_extra}${sockopt}"
+ tcmd="$tcmd,cert='$tpem',capath='$tcert'"
fi
- elif [[ $encrypt -eq 3 ]];then
- wsrep_log_warning "**** WARNING **** encrypt=3 is deprecated and will be removed in a future release"
+ stagemsg="$stagemsg-OpenSSL-Encrypted-2"
+ wsrep_log_info "$action with cert=$tpem, ca=$tcert"
+ elif [ $encrypt -eq 3 -o $encrypt -eq 4 ]; then
wsrep_log_info "Using openssl based encryption with socat: with key and crt"
-
- verify_file_exists "$tcert" "Both certificate and key files are required." \
- "Please check the 'tcert' option. "
- verify_file_exists "$tkey" "Both certificate and key files are required." \
- "Please check the 'tkey' option. "
-
- stagemsg+="-OpenSSL-Encrypted-3"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- wsrep_log_info "Decrypting with CERT: $tcert, KEY: $tkey"
- tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tcert},key=${tkey},verify=0${joiner_extra}${sockopt} stdio"
- else
- wsrep_log_info "Encrypting with CERT: $tcert, KEY: $tkey"
- tcmd="socat -u stdio openssl-connect:${WSREP_SST_OPT_HOST}:${TSST_PORT},cert=${tcert},key=${tkey},verify=0${sockopt}"
+ if [ -z "$tpem" -o -z "$tkey" ]; then
+ wsrep_log_error "Both certificate file (or path) " \
+ "and key file are required"
+ exit 22
+ fi
+ if [ ! -r "$tpem" -o ! -r "$tkey" ]; then
+ wsrep_log_error "Both certificate file (or path) " \
+ "and key file must be readable"
+ exit 22
fi
- elif [[ $encrypt -eq 4 ]]; then
- wsrep_log_info "Using openssl based encryption with socat: with key, crt, and ca"
-
- verify_file_exists "$ssl_ca" "CA, certificate, and key files are required." \
- "Please check the 'ssl-ca' option. "
- verify_file_exists "$ssl_cert" "CA, certificate, and key files are required." \
- "Please check the 'ssl-cert' option. "
- verify_file_exists "$ssl_key" "CA, certificate, and key files are required." \
- "Please check the 'ssl-key' option. "
-
- # Check to see that the key matches the cert
- verify_cert_matches_key $ssl_cert $ssl_key
-
- stagemsg+="-OpenSSL-Encrypted-4"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]]; then
- wsrep_log_info "Decrypting with CERT: $ssl_cert, KEY: $ssl_key, CA: $ssl_ca"
- tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${ssl_cert},key=${ssl_key},cafile=${ssl_ca},verify=1${joiner_extra}${sockopt} stdio"
+ verify_cert_matches_key "$tpem" "$tkey"
+ stagemsg="$stagemsg-OpenSSL-Encrypted-3"
+ if [ -z "$tcert" ]; then
+ if [ $encrypt -eq 4 ]; then
+ wsrep_log_error \
+ "Peer certificate file (or path) required if encrypt=4"
+ exit 22
+ fi
+ # no verification
+ CN_option=""
+ tcmd="$tcmd,cert='$tpem',key='$tkey',verify=0"
+ wsrep_log_info "$action with cert=$tpem, key=$tkey, verify=0"
else
- wsrep_log_info "Encrypting with CERT: $ssl_cert, KEY: $ssl_key, CA: $ssl_ca"
- tcmd="socat -u stdio openssl-connect:${WSREP_SST_OPT_HOST}:${TSST_PORT},cert=${ssl_cert},key=${ssl_key},cafile=${ssl_ca},verify=1${donor_extra}${sockopt}"
+ # CA verification
+ if [ ! -r "$tcert" ]; then
+ wsrep_log_error "Certificate file or path must be readable"
+ exit 22
+ fi
+ verify_ca_matches_cert "$tcert" "$tpem" $tpath
+ if [ -n "$WSREP_SST_OPT_REMOTE_USER" ]; then
+ CN_option=",commonname='$WSREP_SST_OPT_REMOTE_USER'"
+ elif [ "$WSREP_SST_OPT_ROLE" = 'joiner' -o $encrypt -eq 4 ]
+ then
+ CN_option=",commonname=''"
+ elif is_local_ip "$WSREP_SST_OPT_HOST_UNESCAPED"; then
+ CN_option=',commonname=localhost'
+ else
+ CN_option=",commonname='$WSREP_SST_OPT_HOST_UNESCAPED'"
+ fi
+ if [ $tpath -eq 0 ]; then
+ tcmd="$tcmd,cert='$tpem',key='$tkey',cafile='$tcert'"
+ else
+ tcmd="$tcmd,cert='$tpem',key='$tkey',capath='$tcert'"
+ fi
+ wsrep_log_info "$action with cert=$tpem, key=$tkey, ca=$tcert"
fi
-
else
- if [[ $encrypt -eq 1 ]]; then
- wsrep_log_warning "**** WARNING **** encrypt=1 is deprecated and will be removed in a future release"
- fi
+ wsrep_log_info "Unknown encryption mode: encrypt=$encrypt"
+ exit 22
+ fi
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]]; then
- tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio"
- else
- tcmd="socat -u stdio TCP:${WSREP_SST_OPT_HOST}:${TSST_PORT}${sockopt}"
- fi
+ tcmd="$tcmd$CN_option$sockopt"
+
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ tcmd="$tcmd stdio"
fi
fi
}
get_footprint()
{
- pushd $WSREP_SST_OPT_DATA 1>/dev/null
+ pushd "$WSREP_SST_OPT_DATA" 1>/dev/null
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c -s | awk 'END { print $1 }')
- if $MY_PRINT_DEFAULTS xtrabackup | grep -q -- "--compress";then
+ if [ "$compress" != 'none' ]; then
# QuickLZ has around 50% compression ratio
# When compression/compaction used, the progress is only an approximate.
payload=$(( payload*1/2 ))
fi
popd 1>/dev/null
- pcmd+=" -s $payload"
+ pcmd="$pcmd -s $payload"
adjust_progress
}
adjust_progress()
{
-
- if [[ ! -x `which pv` ]];then
+ if [ -z "$(command -v pv)" ]; then
wsrep_log_error "pv not found in path: $PATH"
wsrep_log_error "Disabling all progress/rate-limiting"
pcmd=""
@@ -430,375 +451,381 @@ adjust_progress()
return
fi
- if [[ -n $progress && $progress != '1' ]];then
- if [[ -e $progress ]];then
- pcmd+=" 2>>$progress"
- else
- pcmd+=" 2>$progress"
+ if [ -n "$progress" -a "$progress" != '1' ]; then
+ if [ -e "$progress" ]; then
+ pcmd="$pcmd 2>>'$progress'"
+ else
+ pcmd="$pcmd 2>'$progress'"
fi
- elif [[ -z $progress && -n $rlimit ]];then
+ elif [ -z "$progress" -a -n "$rlimit" ]; then
# When rlimit is non-zero
pcmd="pv -q"
- fi
+ fi
- if [[ -n $rlimit && "$WSREP_SST_OPT_ROLE" == "donor" ]];then
+ if [ -n "$rlimit" -a "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
wsrep_log_info "Rate-limiting SST to $rlimit"
- pcmd+=" -L \$rlimit"
+ pcmd="$pcmd -L \$rlimit"
+ fi
+}
+
+encgroups='--mysqld|sst|xtrabackup'
+
+check_server_ssl_config()
+{
+ # backward-compatible behavior:
+ tcert=$(parse_cnf 'sst' 'tca')
+ tpem=$(parse_cnf 'sst' 'tcert')
+ tkey=$(parse_cnf 'sst' 'tkey')
+ # reading new ssl configuration options:
+ local tcert2=$(parse_cnf "$encgroups" 'ssl-ca')
+ local tpem2=$(parse_cnf "$encgroups" 'ssl-cert')
+ local tkey2=$(parse_cnf "$encgroups" 'ssl-key')
+ # if there are no old options, then we take new ones:
+ if [ -z "$tcert" -a -z "$tpem" -a -z "$tkey" ]; then
+ tcert="$tcert2"
+ tpem="$tpem2"
+ tkey="$tkey2"
+ # checking for presence of the new-style SSL configuration:
+ elif [ -n "$tcert2" -o -n "$tpem2" -o -n "$tkey2" ]; then
+ if [ "$tcert" != "$tcert2" -o \
+ "$tpem" != "$tpem2" -o \
+ "$tkey" != "$tkey2" ]
+ then
+ wsrep_log_info "new ssl configuration options (ssl-ca, ssl-cert " \
+ "and ssl-key) are ignored by SST due to presence " \
+ "of the tca, tcert and/or tkey in the [sst] section"
+ fi
+ fi
+ if [ -n "$tcert" ]; then
+ tcert=$(trim_string "$tcert")
+ if [ "${tcert%/}" != "$tcert" ]; then
+ tpath=1
+ fi
fi
}
read_cnf()
{
- sfmt=$(parse_cnf sst streamfmt "xbstream")
- tfmt=$(parse_cnf sst transferfmt "socat")
- tca=$(parse_cnf sst tca "")
- tcert=$(parse_cnf sst tcert "")
- tkey=$(parse_cnf sst tkey "")
- encrypt=$(parse_cnf sst encrypt 0)
+ sfmt=$(parse_cnf sst streamfmt 'xbstream')
+ tfmt=$(parse_cnf sst transferfmt 'socat')
+
+ encrypt=$(parse_cnf "$encgroups" 'encrypt' 0)
+ tmode=$(parse_cnf "$encgroups" 'ssl-mode' 'DISABLED' | tr [:lower:] [:upper:])
+
+ if [ $encrypt -eq 0 -o $encrypt -ge 2 ]
+ then
+ if [ "$tmode" != 'DISABLED' -o $encrypt -ge 2 ]; then
+ check_server_ssl_config
+ fi
+ if [ "$tmode" != 'DISABLED' ]; then
+ if [ 0 -eq $encrypt -a -n "$tpem" -a -n "$tkey" ]
+ then
+ encrypt=3 # enable cert/key SSL encyption
+
+ # avoid CA verification if not set explicitly:
+ # nodes may happen to have different CA if self-generated
+ # zeroing up tcert does the trick
+ [ "${tmode#VERIFY}" != "$tmode" ] || tcert=""
+ fi
+ fi
+ elif [ $encrypt -eq 1 ]; then
+ ealgo=$(parse_cnf "$encgroups" 'encrypt-algo')
+ eformat=$(parse_cnf "$encgroups" 'encrypt-format' 'xbcrypt')
+ ekey=$(parse_cnf "$encgroups" 'encrypt-key')
+ # The keyfile should be read only when the key
+ # is not specified or empty:
+ if [ -z "$ekey" ]; then
+ ekeyfile=$(parse_cnf "$encgroups" 'encrypt-key-file')
+ fi
+ fi
+
+ wsrep_log_info "SSL configuration: CA='$tcert', CERT='$tpem'," \
+ "KEY='$tkey', MODE='$tmode', encrypt='$encrypt'"
+
sockopt=$(parse_cnf sst sockopt "")
progress=$(parse_cnf sst progress "")
rebuild=$(parse_cnf sst rebuild 0)
ttime=$(parse_cnf sst time 0)
- if [ "${OS}" = "FreeBSD" ]; then
- cpat=$(parse_cnf sst cpat '.*\.pem$|.*init\.ok$|.*galera\.cache$|.*sst_in_progress$|.*\.sst$|.*gvwstate\.dat$|.*grastate\.dat$|.*\.err$|.*\.log$|.*RPM_UPGRADE_MARKER$|.*RPM_UPGRADE_HISTORY$')
- else
- cpat=$(parse_cnf sst cpat '.*\.pem$\|.*init\.ok$\|.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$')
- fi
- ealgo=$(parse_cnf xtrabackup encrypt "")
- ekey=$(parse_cnf xtrabackup encrypt-key "")
- ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "")
+ cpat='.*\.pem$\|.*init\.ok$\|.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$'
+ [ "$OS" = 'FreeBSD' ] && cpat=$(echo "$cpat" | sed 's/\\|/|/g')
+ cpat=$(parse_cnf sst cpat "$cpat")
scomp=$(parse_cnf sst compressor "")
sdecomp=$(parse_cnf sst decompressor "")
-
- # Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
- if [[ -z $ealgo ]];then
- ealgo=$(parse_cnf sst encrypt-algo "")
- ekey=$(parse_cnf sst encrypt-key "")
- ekeyfile=$(parse_cnf sst encrypt-key-file "")
- fi
-
- # Pull the parameters needed for encrypt=4
- ssl_ca=$(parse_cnf sst ssl-ca "")
- if [[ -z "$ssl_ca" ]]; then
- ssl_ca=$(parse_cnf --mysqld ssl-ca "")
- fi
- ssl_cert=$(parse_cnf sst ssl-cert "")
- if [[ -z "$ssl_cert" ]]; then
- ssl_cert=$(parse_cnf --mysqld ssl-cert "")
- fi
- ssl_key=$(parse_cnf sst ssl-key "")
- if [[ -z "$ssl_key" ]]; then
- ssl_key=$(parse_cnf --mysqld ssl-key "")
- fi
-
rlimit=$(parse_cnf sst rlimit "")
uextra=$(parse_cnf sst use-extra 0)
+ speciald=$(parse_cnf sst sst-special-dirs 1)
iopts=$(parse_cnf sst inno-backup-opts "")
iapts=$(parse_cnf sst inno-apply-opts "")
impts=$(parse_cnf sst inno-move-opts "")
- stimeout=$(parse_cnf sst sst-initial-timeout 100)
+ stimeout=$(parse_cnf sst sst-initial-timeout 300)
ssyslog=$(parse_cnf sst sst-syslog 0)
ssystag=$(parse_cnf mysqld_safe syslog-tag "${SST_SYSLOG_TAG:-}")
- ssystag+="-"
+ ssystag="$ssystag-"
+ sstlogarchive=$(parse_cnf sst sst-log-archive 1)
+ sstlogarchivedir=$(parse_cnf sst sst-log-archive-dir '/tmp/sst_log_archive')
+
+ if [ $speciald -eq 0 ]; then
+ wsrep_log_error "sst-special-dirs equal to 0 is not supported, falling back to 1"
+ speciald=1
+ fi
+
+ if [ $ssyslog -ne -1 ]; then
+ ssyslog=$(in_config 'mysqld_safe' 'syslog')
+ fi
- if [[ $ssyslog -ne -1 ]];then
- if $MY_PRINT_DEFAULTS mysqld_safe | grep -q -- "--syslog";then
- ssyslog=1
+ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
+ compress=$(parse_cnf "$encgroups" 'compress' 'none')
+ if [ "$compress" != 'none' ]; then
+ compress_chunk=$(parse_cnf "$encgroups" 'compress-chunk-size')
+ compress_threads=$(parse_cnf "$encgroups" 'compress-threads')
fi
fi
+
+ backup_threads=$(parse_cnf "$encgroups" 'backup-threads')
+
+ if [ "$eformat" = 'xbcrypt' ]; then
+ encrypt_threads=$(parse_cnf "$encgroups" 'encrypt-threads')
+ encrypt_chunk=$(parse_cnf "$encgroups" 'encrypt-chunk-size')
+ fi
}
get_stream()
{
- if [[ $sfmt == 'xbstream' ]];then
- wsrep_log_info "Streaming with xbstream"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- strmcmd="xbstream -x"
+ if [ "$sfmt" = 'mbstream' -o "$sfmt" = 'xbstream' ]; then
+ STREAM_BIN=$(command -v "$sfmt")
+ if [ -z "$STREAM_BIN" ]; then
+ if [ "$sfmt" = 'xbstream' ]; then
+ STREAM_BIN="$(command -v mbstream)"
+ else
+ STREAM_BIN="$(command -v xbstream)"
+ fi
+ fi
+ if [ -z "$STREAM_BIN" ]; then
+ wsrep_log_error "Streaming with $sfmt, but $sfmt not found in path"
+ exit 42
+ fi
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ strmcmd="'$STREAM_BIN' -x"
else
- strmcmd="xbstream -c \${INFO_FILE}"
+ strmcmd="'$STREAM_BIN' -c '$INFO_FILE'"
fi
else
- sfmt="tar"
- wsrep_log_info "Streaming with tar"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- strmcmd="tar xfi - "
+ sfmt='tar'
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ strmcmd='tar xfi -'
else
- strmcmd="tar cf - \${INFO_FILE} "
+ strmcmd="tar cf - '$INFO_FILE'"
fi
-
fi
-}
-
-get_proc()
-{
- set +e
- nproc=$(grep -c processor /proc/cpuinfo)
- [[ -z $nproc || $nproc -eq 0 ]] && nproc=1
- set -e
+ wsrep_log_info "Streaming with $sfmt"
}
sig_joiner_cleanup()
{
wsrep_log_error "Removing $MAGIC_FILE file due to signal"
- rm -f "$MAGIC_FILE"
+ [ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
}
-cleanup_joiner()
+cleanup_at_exit()
{
# Since this is invoked just after exit NNN
local estatus=$?
- if [[ $estatus -ne 0 ]];then
+ if [ $estatus -ne 0 ]; then
wsrep_log_error "Cleanup after exit with status:$estatus"
- elif [ "${WSREP_SST_OPT_ROLE}" = "joiner" ];then
- wsrep_log_info "Removing the sst_in_progress file"
- wsrep_cleanup_progress_file
- fi
- if [[ -n $progress && -p $progress ]];then
- wsrep_log_info "Cleaning up fifo file $progress"
- rm $progress
- fi
- if [[ -n ${STATDIR:-} ]];then
- [[ -d $STATDIR ]] && rm -rf $STATDIR
- fi
-
- # Final cleanup
- pgid=$(ps -o pgid= $$ | grep -o '[0-9]*')
-
- # This means no setsid done in mysqld.
- # We don't want to kill mysqld here otherwise.
- if [[ $$ -eq $pgid ]];then
-
- # This means a signal was delivered to the process.
- # So, more cleanup.
- if [[ $estatus -ge 128 ]];then
- kill -KILL -$$ || true
- fi
-
fi
- exit $estatus
-}
-
-check_pid()
-{
- local pid_file="$1"
- [ -r "$pid_file" ] && ps -p $(cat "$pid_file") >/dev/null 2>&1
-}
-
-cleanup_donor()
-{
- # Since this is invoked just after exit NNN
- local estatus=$?
- if [[ $estatus -ne 0 ]];then
- wsrep_log_error "Cleanup after exit with status:$estatus"
- fi
-
- if [[ -n ${XTRABACKUP_PID:-} ]];then
- if check_pid $XTRABACKUP_PID
- then
- wsrep_log_error "xtrabackup process is still running. Killing... "
- kill_xtrabackup
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ wsrep_log_info "Removing the sst_in_progress file"
+ wsrep_cleanup_progress_file
+ else
+ if [ -n "$BACKUP_PID" ]; then
+ if check_pid "$BACKUP_PID" 1; then
+ wsrep_log_error "xtrabackup process is still running. Killing..."
+ cleanup_pid $CHECK_PID "$BACKUP_PID"
+ fi
fi
-
+ [ -f "$DATA/$IST_FILE" ] && rm -f "$DATA/$IST_FILE"
fi
- rm -f ${DATA}/${IST_FILE} || true
- if [[ -n $progress && -p $progress ]];then
+ if [ -n "$progress" -a -p "$progress" ]; then
wsrep_log_info "Cleaning up fifo file $progress"
- rm -f $progress || true
+ rm -f "$progress" || true
fi
wsrep_log_info "Cleaning up temporary directories"
- if [[ -n $xtmpdir ]];then
- [[ -d $xtmpdir ]] && rm -rf $xtmpdir || true
- fi
-
- if [[ -n $itmpdir ]];then
- [[ -d $itmpdir ]] && rm -rf $itmpdir || true
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ if [ -n "$STATDIR" ]; then
+ [ -d "$STATDIR" ] && rm -rf "$STATDIR"
+ fi
+ else
+ [ -n "$xtmpdir" -a -d "$xtmpdir" ] && rm -rf "$xtmpdir" || true
+ [ -n "$itmpdir" -a -d "$itmpdir" ] && rm -rf "$itmpdir" || true
fi
- # Final cleanup
+ # Final cleanup
pgid=$(ps -o pgid= $$ | grep -o '[0-9]*')
# This means no setsid done in mysqld.
# We don't want to kill mysqld here otherwise.
- if [[ $$ -eq $pgid ]];then
-
+ if [ $$ -eq $pgid ]; then
# This means a signal was delivered to the process.
- # So, more cleanup.
- if [[ $estatus -ge 128 ]];then
- kill -KILL -$$ || true
+ # So, more cleanup.
+ if [ $estatus -ge 128 ]; then
+ kill -KILL -- -$$ || true
fi
-
fi
exit $estatus
-
}
-kill_xtrabackup()
+setup_ports()
{
- local PID=$(cat $XTRABACKUP_PID)
- [ -n "$PID" -a "0" != "$PID" ] && kill $PID && (kill $PID && kill -9 $PID) || :
- wsrep_log_info "Removing xtrabackup pid file $XTRABACKUP_PID"
- rm -f "$XTRABACKUP_PID" || true
+ SST_PORT="$WSREP_SST_OPT_PORT"
+ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
+ REMOTEIP="$WSREP_SST_OPT_HOST"
+ lsn="$WSREP_SST_OPT_LSN"
+ sst_ver="$WSREP_SST_OPT_SST_VER"
+ fi
}
-# waits ~1 minute for nc/socat to open the port and then reports ready
-# (regardless of timeout)
+#
+# Waits ~30 seconds for socat or nc to open the port and
+# then reports ready, regardless of timeout.
+#
wait_for_listen()
{
- local HOST=$1
- local PORT=$2
- local MODULE=$3
- local LSOF_OUT
-
- for i in {1..300}
- do
- LSOF_OUT=$(lsof -sTCP:LISTEN -i TCP:${PORT} -a -c nc -c socat -F c 2> /dev/null || :)
- [ -n "${LSOF_OUT}" ] && break
+ local PORT="$1"
+ local ADDR="$2"
+ local MODULE="$3"
+ for i in {1..150}; do
+ if check_port "" "$PORT" 'socat|nc'; then
+ break
+ fi
sleep 0.2
done
-
- echo "ready ${HOST}:${PORT}/${MODULE}//${WSREP_SST_OPT_SST_VER:-1}"
+ echo "ready $ADDR/$MODULE//$sst_ver"
}
check_extra()
{
local use_socket=1
- if [[ $uextra -eq 1 ]];then
- if [ $(parse_cnf --mysqld thread-handling) = 'pool-of-threads'];then
- local eport=$(parse_cnf --mysqld extra-port)
- if [[ -n $eport ]];then
+ if [ $uextra -eq 1 ]; then
+ local thread_handling=$(parse_cnf '--mysqld' 'thread-handling')
+ if [ "$thread_handling" = 'pool-of-threads' ]; then
+ local eport=$(parse_cnf '--mysqld' 'extra-port')
+ if [ -n "$eport" ]; then
# Xtrabackup works only locally.
- # Hence, setting host to 127.0.0.1 unconditionally.
+ # Hence, setting host to 127.0.0.1 unconditionally:
wsrep_log_info "SST through extra_port $eport"
- INNOEXTRA+=" --host=127.0.0.1 --port=$eport"
+ INNOEXTRA="$INNOEXTRA --host=127.0.0.1 --port=$eport"
use_socket=0
- else
+ else
wsrep_log_error "Extra port $eport null, failing"
exit 1
fi
- else
+ else
wsrep_log_info "Thread pool not set, ignore the option use_extra"
fi
fi
- if [[ $use_socket -eq 1 ]] && [[ -n "$WSREP_SST_OPT_SOCKET" ]];then
- INNOEXTRA+=" --socket=$WSREP_SST_OPT_SOCKET"
+ if [ $use_socket -eq 1 -a -n "$WSREP_SST_OPT_SOCKET" ]; then
+ INNOEXTRA="$INNOEXTRA --socket='$WSREP_SST_OPT_SOCKET'"
fi
}
recv_joiner()
{
- local dir=$1
- local msg=$2
+ local dir="$1"
+ local msg="$2"
local tmt=$3
local checkf=$4
- local ltcmd
+ local wait=$5
- if [[ ! -d ${dir} ]];then
+ if [ ! -d "$dir" ]; then
# This indicates that IST is in progress
return
fi
- pushd ${dir} 1>/dev/null
+ local ltcmd="$tcmd"
+ if [ $tmt -gt 0 ]; then
+ if [ -n "$(command -v timeout)" ]; then
+ if timeout --help | grep -qw -- '-k'; then
+ ltcmd="timeout -k $(( tmt+10 )) $tmt $tcmd"
+ else
+ ltcmd="timeout -s9 $tmt $tcmd"
+ fi
+ fi
+ fi
+
+ pushd "$dir" 1>/dev/null
set +e
- if [[ $tmt -gt 0 && -x `which timeout` ]];then
- if timeout --help | grep -q -- '-k';then
- ltcmd="timeout -k $(( tmt+10 )) $tmt $tcmd"
- else
- ltcmd="timeout -s9 $tmt $tcmd"
- fi
- timeit "$msg" "$ltcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )"
- else
- timeit "$msg" "$tcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )"
+ if [ $wait -ne 0 ]; then
+ wait_for_listen "$SST_PORT" "$ADDR" "$MODULE" &
fi
+ timeit "$msg" "$ltcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )"
+
set -e
- popd 1>/dev/null
+ popd 1>/dev/null
- if [[ ${RC[0]} -eq 124 ]];then
- wsrep_log_error "Possible timeout in receving first data from donor in gtid stage"
+ if [ ${RC[0]} -eq 124 ]; then
+ wsrep_log_error "Possible timeout in receiving first data from " \
+ "donor in gtid stage: exit codes: ${RC[@]}"
exit 32
fi
- for ecode in "${RC[@]}";do
- if [[ $ecode -ne 0 ]];then
+ for ecode in "${RC[@]}"; do
+ if [ $ecode -ne 0 ]; then
wsrep_log_error "Error while getting data from donor node: " \
"exit codes: ${RC[@]}"
exit 32
fi
done
- if [[ $checkf -eq 1 && ! -r "${MAGIC_FILE}" ]];then
- # this message should cause joiner to abort
- wsrep_log_error "xtrabackup process ended without creating '${MAGIC_FILE}'"
- wsrep_log_info "Contents of datadir"
- wsrep_log_info "$(ls -l ${dir}/*)"
- exit 32
+ if [ $checkf -eq 1 ]; then
+ if [ ! -r "$MAGIC_FILE" ]; then
+ # this message should cause joiner to abort
+ wsrep_log_error "receiving process ended without creating " \
+ "'$MAGIC_FILE'"
+ wsrep_log_info "Contents of datadir"
+ wsrep_log_info $(ls -l "$dir/"*)
+ exit 32
+ fi
+
+ # check donor supplied secret
+ SECRET=$(grep -F -- "$SECRET_TAG " "$MAGIC_FILE" 2>/dev/null | cut -d ' ' -f 2)
+ if [ "$SECRET" != "$MY_SECRET" ]; then
+ wsrep_log_error "Donor does not know my secret!"
+ wsrep_log_info "Donor:'$SECRET', my:'$MY_SECRET'"
+ exit 32
+ fi
+
+ # remove secret from the magic file
+ grep -v -F -- "$SECRET_TAG " "$MAGIC_FILE" > "$MAGIC_FILE.new"
+ mv "$MAGIC_FILE.new" "$MAGIC_FILE"
fi
}
-
send_donor()
{
- local dir=$1
- local msg=$2
+ local dir="$1"
+ local msg="$2"
- pushd ${dir} 1>/dev/null
+ pushd "$dir" 1>/dev/null
set +e
timeit "$msg" "$strmcmd | $tcmd; RC=( "\${PIPESTATUS[@]}" )"
set -e
- popd 1>/dev/null
-
+ popd 1>/dev/null
- for ecode in "${RC[@]}";do
- if [[ $ecode -ne 0 ]];then
- wsrep_log_error "Error while getting data from donor node: " \
+ for ecode in "${RC[@]}"; do
+ if [ $ecode -ne 0 ]; then
+ wsrep_log_error "Error while sending data to joiner node: " \
"exit codes: ${RC[@]}"
exit 32
fi
done
-
-}
-
-# Returns the version string in a standardized format
-# Input "1.2.3" => echoes "010203"
-# Wrongly formatted values => echoes "000000"
-normalize_version()
-{
- local major=0
- local minor=0
- local patch=0
-
- # Only parses purely numeric version numbers, 1.2.3
- # Everything after the first three values are ignored
- if [[ $1 =~ ^([0-9]+)\.([0-9]+)\.?([0-9]*)([\.0-9])*$ ]]; then
- major=${BASH_REMATCH[1]}
- minor=${BASH_REMATCH[2]}
- patch=${BASH_REMATCH[3]}
- fi
-
- printf %02d%02d%02d $major $minor $patch
-}
-
-# Compares two version strings
-# The first parameter is the version to be checked
-# The second parameter is the minimum version required
-# Returns 1 (failure) if $1 >= $2, 0 (success) otherwise
-check_for_version()
-{
- local local_version_str="$( normalize_version $1 )"
- local required_version_str="$( normalize_version $2 )"
-
- if [[ "$local_version_str" < "$required_version_str" ]]; then
- return 1
- else
- return 0
- fi
}
monitor_process()
@@ -806,193 +833,231 @@ monitor_process()
local sst_stream_pid=$1
while true ; do
-
- if ! ps --pid "${WSREP_SST_OPT_PARENT}" &>/dev/null; then
- wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
- kill -- -"${WSREP_SST_OPT_PARENT}"
+ if ! ps -p "$WSREP_SST_OPT_PARENT" >/dev/null 2>&1; then
+ wsrep_log_error "Parent mysqld process (PID: $WSREP_SST_OPT_PARENT) terminated unexpectedly."
+ kill -- -"$WSREP_SST_OPT_PARENT"
exit 32
fi
-
- if ! ps --pid "${sst_stream_pid}" &>/dev/null; then
+ if ! ps -p "$sst_stream_pid" >/dev/null 2>&1; then
break
fi
-
sleep 0.1
-
done
}
-
-if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then
- wsrep_log_error "innobackupex not in path: $PATH"
- exit 2
-fi
-
# check the version, we require XB-2.4 to ensure that we can pass the
# datadir via the command-line option
XB_REQUIRED_VERSION="2.3.5"
-XB_VERSION=`$INNOBACKUPEX_BIN --version 2>&1 | grep -oe '[0-9]\.[0-9][\.0-9]*' | head -n1`
-if [[ -z $XB_VERSION ]]; then
- wsrep_log_error "FATAL: Cannot determine the $INNOBACKUPEX_BIN version. Needs xtrabackup-$XB_REQUIRED_VERSION or higher to perform SST"
+XB_VERSION=`$BACKUP_BIN --version 2>&1 | grep -oe '[0-9]\.[0-9][\.0-9]*' | head -n1`
+if [[ -z "$XB_VERSION" ]]; then
+ wsrep_log_error "FATAL: Cannot determine the $BACKUP_BIN version. Needs xtrabackup-$XB_REQUIRED_VERSION or higher to perform SST"
exit 2
fi
-if ! check_for_version $XB_VERSION $XB_REQUIRED_VERSION; then
- wsrep_log_error "FATAL: The $INNOBACKUPEX_BIN version is $XB_VERSION. Needs xtrabackup-$XB_REQUIRED_VERSION or higher to perform SST"
+if ! check_for_version "$XB_VERSION" "$XB_REQUIRED_VERSION"; then
+ wsrep_log_error "FATAL: The $BACKUP_BIN version is $XB_VERSION. Needs xtrabackup-$XB_REQUIRED_VERSION or higher to perform SST"
exit 2
fi
+[ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
-rm -f "${MAGIC_FILE}"
-
-if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then
- wsrep_log_error "Invalid role ${WSREP_SST_OPT_ROLE}"
+if [ "$WSREP_SST_OPT_ROLE" != 'joiner' -a "$WSREP_SST_OPT_ROLE" != 'donor' ]; then
+ wsrep_log_error "Invalid role '$WSREP_SST_OPT_ROLE'"
exit 22
fi
read_cnf
+setup_ports
-if ${INNOBACKUPEX_BIN} /tmp --help 2>/dev/null | grep -q -- '--version-check'; then
- disver="--no-version-check"
+if "$BACKUP_BIN" --help 2>/dev/null | grep -qw -- '--version-check'; then
+ disver='--no-version-check'
fi
-if [[ ${FORCE_FTWRL:-0} -eq 1 ]];then
- wsrep_log_info "Forcing FTWRL due to environment variable FORCE_FTWRL equal to $FORCE_FTWRL"
- iopts+=" --no-backup-locks "
+# if no command line argument and INNODB_DATA_HOME_DIR environment variable
+# is not set, try to get it from my.cnf:
+if [ -z "$INNODB_DATA_HOME_DIR" ]; then
+ INNODB_DATA_HOME_DIR=$(parse_cnf '--mysqld' 'innodb-data-home-dir')
fi
+OLD_PWD="$(pwd)"
-INNOEXTRA=""
-
-if [[ $ssyslog -eq 1 ]];then
+cd "$WSREP_SST_OPT_DATA"
+if [ -n "$INNODB_DATA_HOME_DIR" ]; then
+ # handle both relative and absolute paths
+ [ ! -d "$INNODB_DATA_HOME_DIR" ] && mkdir -p "$INNODB_DATA_HOME_DIR"
+ cd "$INNODB_DATA_HOME_DIR"
+fi
+INNODB_DATA_HOME_DIR=$(pwd -P)
- if [[ ! -x `which logger` ]];then
- wsrep_log_error "logger not in path: $PATH. Ignoring"
- else
+cd "$OLD_PWD"
- wsrep_log_info "Logging all stderr of SST/Innobackupex to syslog"
+if [ $ssyslog -eq 1 ]; then
+ if [ -n "$(command -v logger)" ]; then
+ wsrep_log_info "Logging all stderr of SST/xtrabackup to syslog"
exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE)
wsrep_log_error()
{
- logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
+ logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
}
wsrep_log_info()
{
- logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
+ logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
}
-
- INNOAPPLY="2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply "
- INNOMOVE="2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move "
- INNOBACKUP="2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
+ else
+ wsrep_log_error "logger not in path: $PATH. Ignoring"
fi
+ INNOAPPLY="2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply"
+ INNOMOVE="2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move"
+ INNOBACKUP="2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
+else
+ if [ $sstlogarchive -eq 1 ]
+ then
+ ARCHIVETIMESTAMP=$(date "+%Y.%m.%d-%H.%M.%S.%N")
-else
- INNOAPPLY="&>\${DATA}/innobackup.prepare.log"
- INNOMOVE="&>\${DATA}/innobackup.move.log"
- INNOBACKUP="2>\${DATA}/innobackup.backup.log"
-fi
+ if [ -n "$sstlogarchivedir" ]; then
+ if [ ! -d "$sstlogarchivedir" ]; then
+ mkdir -p "$sstlogarchivedir"
+ fi
+ fi
-get_stream
-get_transfer
+ if [ -e "$INNOAPPLYLOG" ]
+ then
+ if [ -n "$sstlogarchivedir" ]
+ then
+ newfile=$(basename "$INNOAPPLYLOG")
+ newfile="$sstlogarchivedir/$newfile.$ARCHIVETIMESTAMP"
+ else
+ newfile="$INNOAPPLYLOG.$ARCHIVETIMESTAMP"
+ fi
+ wsrep_log_info "Moving '$INNOAPPLYLOG' to '$newfile'"
+ mv "$INNOAPPLYLOG" "$newfile"
+ gzip "$newfile"
+ fi
-INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""}
-# Try to set INNODB_DATA_HOME_DIR from the command line:
-if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
- INNODB_DATA_HOME_DIR=$INNODB_DATA_HOME_DIR_ARG
-fi
-# if no command line arg and INNODB_DATA_HOME_DIR environment variable
-# is not set, try to get it from my.cnf:
-if [ -z "$INNODB_DATA_HOME_DIR" ]; then
- INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
-fi
-if [ -z "$INNODB_DATA_HOME_DIR" ]; then
- INNODB_DATA_HOME_DIR=$(parse_cnf --mysqld innodb-data-home-dir '')
-fi
-if [ ! -z "$INNODB_DATA_HOME_DIR" ]; then
- INNOEXTRA+=" --innodb-data-home-dir=$INNODB_DATA_HOME_DIR"
-fi
+ if [ -e "$INNOMOVELOG" ]
+ then
+ if [ -n "$sstlogarchivedir" ]
+ then
+ newfile=$(basename "$INNOMOVELOG")
+ newfile="$sstlogarchivedir/$newfile.$ARCHIVETIMESTAMP"
+ else
+ newfile="$INNOMOVELOG.$ARCHIVETIMESTAMP"
+ fi
+ wsrep_log_info "Moving '$INNOMOVELOG' to '$newfile'"
+ mv "$INNOMOVELOG" "$newfile"
+ gzip "$newfile"
+ fi
-if [ -n "$INNODB_DATA_HOME_DIR" ]; then
- # handle both relative and absolute paths
- INNODB_DATA_HOME_DIR=$(cd $DATA; mkdir -p "$INNODB_DATA_HOME_DIR"; cd $INNODB_DATA_HOME_DIR; pwd -P)
-else
- # default to datadir
- INNODB_DATA_HOME_DIR=$(cd $DATA; pwd -P)
+ if [ -e "$INNOBACKUPLOG" ]
+ then
+ if [ -n "$sstlogarchivedir" ]
+ then
+ newfile=$(basename "$INNOBACKUPLOG")
+ newfile="$sstlogarchivedir/$newfile.$ARCHIVETIMESTAMP"
+ else
+ newfile="$INNOBACKUPLOG.$ARCHIVETIMESTAMP"
+ fi
+ wsrep_log_info "Moving '$INNOBACKUPLOG' to '$newfile'"
+ mv "$INNOBACKUPLOG" "$newfile"
+ gzip "$newfile"
+ fi
+ fi
+ INNOAPPLY="> '$INNOAPPLYLOG' 2>&1"
+ INNOMOVE="> '$INNOMOVELOG' 2>&1"
+ INNOBACKUP="2> '$INNOBACKUPLOG'"
fi
-INNOAPPLY="${INNOBACKUPEX_BIN} $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} ${INNOAPPLY}"
-INNOMOVE="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} ${INNOMOVE}"
-INNOBACKUP="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir ${INNOBACKUP}"
+setup_commands()
+{
+ INNOAPPLY="$BACKUP_BIN $disver $iapts $INNOEXTRA --apply-log $rebuildcmd '$DATA' $INNOAPPLY"
+ INNOMOVE="$BACKUP_BIN $WSREP_SST_OPT_CONF --move-back $disver $impts --force-non-empty-directories '$DATA' $INNOMOVE"
+ sfmt_work="$sfmt"
+ if [ "$sfmt" = 'mbstream' ]; then
+ sfmt_work='xbstream'
+ fi
+ INNOBACKUP="$BACKUP_BIN $WSREP_SST_OPT_CONF $disver $iopts $tmpopts $INNOEXTRA --galera-info --stream=$sfmt_work '$itmpdir' $INNOBACKUP"
+}
-if [ "$WSREP_SST_OPT_ROLE" = "donor" ]
+get_stream
+get_transfer
+
+if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]
then
- trap cleanup_donor EXIT
+ trap cleanup_at_exit EXIT
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]
then
- usrst=0
- if [[ -z $WSREP_SST_OPT_SST_VER ]];then
+ if [ -z "$sst_ver" ]; then
wsrep_log_error "Upgrade joiner to 5.6.21 or higher for backup locks support"
wsrep_log_error "The joiner is not supported for this version of donor"
exit 93
fi
- if [[ -z $(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE tmpdir "") && \
- -z $(parse_cnf --mysqld tmpdir "") && \
- -z $(parse_cnf xtrabackup tmpdir "") ]]; then
- xtmpdir=$(mktemp -d)
- tmpopts=" --tmpdir=$xtmpdir"
- wsrep_log_info "Using $xtmpdir as xtrabackup temporary directory"
+ tmpdir=$(parse_cnf "$encgroups" 'tmpdir')
+ if [ -z "$tmpdir" ]; then
+ xtmpdir="$(mktemp -d)"
+ elif [ "$OS" = 'Linux' ]; then
+ xtmpdir=$(mktemp '-d' "--tmpdir=$tmpdir")
+ else
+ xtmpdir=$(TMPDIR="$tmpdir"; mktemp '-d')
fi
- itmpdir=$(mktemp -d)
- wsrep_log_info "Using $itmpdir as innobackupex temporary directory"
+ wsrep_log_info "Using '$xtmpdir' as xtrabackup temporary directory"
+ tmpopts="--tmpdir='$xtmpdir'"
+
+ itmpdir="$(mktemp -d)"
+ wsrep_log_info "Using '$itmpdir' as xtrabackup working directory"
- if [[ -n "${WSREP_SST_OPT_USER:-}" && "$WSREP_SST_OPT_USER" != "(null)" ]]; then
- INNOEXTRA+=" --user=$WSREP_SST_OPT_USER"
+ usrst=0
+ if [ -n "$WSREP_SST_OPT_USER" ]; then
+ INNOEXTRA="$INNOEXTRA --user='$WSREP_SST_OPT_USER'"
usrst=1
fi
- if [ -n "${WSREP_SST_OPT_PSWD:-}" ]; then
- export MYSQL_PWD=$WSREP_SST_OPT_PSWD
- elif [[ $usrst -eq 1 ]];then
+ if [ -n "$WSREP_SST_OPT_PSWD" ]; then
+ INNOEXTRA="$INNOEXTRA --password='$WSREP_SST_OPT_PSWD'"
+ elif [ $usrst -eq 1 ]; then
# Empty password, used for testing, debugging etc.
- unset MYSQL_PWD
+ INNOEXTRA="$INNOEXTRA --password="
fi
- get_keys
check_extra
wsrep_log_info "Streaming GTID file before SST"
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
# (separated by a space).
- echo "${WSREP_SST_OPT_GTID} ${WSREP_SST_OPT_GTID_DOMAIN_ID}" > "${MAGIC_FILE}"
+ echo "$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID" > "$MAGIC_FILE"
+
+ if [ -n "$WSREP_SST_OPT_REMOTE_PSWD" ]; then
+ # Let joiner know that we know its secret
+ echo "$SECRET_TAG $WSREP_SST_OPT_REMOTE_PSWD" >> "$MAGIC_FILE"
+ fi
ttcmd="$tcmd"
- if [[ $encrypt -eq 1 ]];then
- if [[ -n $scomp ]];then
- tcmd=" \$ecmd | $scomp | $tcmd "
- else
- tcmd=" \$ecmd | $tcmd "
- fi
- elif [[ -n $scomp ]];then
- tcmd=" $scomp | $tcmd "
+ if [ -n "$scomp" ]; then
+ tcmd="$scomp | $tcmd"
fi
- send_donor $DATA "${stagemsg}-gtid"
+ get_keys
+ if [ $encrypt -eq 1 ]; then
+ tcmd="$ecmd | $tcmd"
+ fi
+
+ send_donor "$DATA" "$stagemsg-gtid"
# Restore the transport commmand to its original state
tcmd="$ttcmd"
- if [[ -n $progress ]];then
+
+ if [ -n "$progress" ]; then
get_footprint
tcmd="$pcmd | $tcmd"
- elif [[ -n $rlimit ]];then
+ elif [ -n "$rlimit" ]; then
adjust_progress
tcmd="$pcmd | $tcmd"
fi
@@ -1000,34 +1065,57 @@ then
wsrep_log_info "Sleeping before data transfer for SST"
sleep 10
- wsrep_log_info "Streaming the backup to joiner at ${WSREP_SST_OPT_HOST} ${WSREP_SST_OPT_PORT:-4444}"
+ wsrep_log_info "Streaming the backup to joiner at $REMOTEIP:$SST_PORT"
# Add compression to the head of the stream (if specified)
- if [[ -n $scomp ]]; then
+ if [ -n "$scomp" ]; then
tcmd="$scomp | $tcmd"
fi
# Add encryption to the head of the stream (if specified)
- if [[ $encrypt -eq 1 ]]; then
- tcmd=" \$ecmd | $tcmd "
+ if [ $encrypt -eq 1 ]; then
+ tcmd="$ecmd | $tcmd"
fi
+ iopts="--databases-exclude='lost+found' $iopts"
+
+ if [ ${FORCE_FTWRL:-0} -eq 1 ]; then
+ wsrep_log_info "Forcing FTWRL due to environment variable FORCE_FTWRL equal to $FORCE_FTWRL"
+ iopts="--no-backup-locks $iopts"
+ fi
+
+ # if compression is enabled for backup files, then add the
+ # appropriate options to the innobackupex command line:
+ if [ "$compress" != 'none' ]; then
+ iopts="--compress${compress:+=$compress} $iopts"
+ if [ -n "$compress_threads" ]; then
+ iopts="--compress-threads=$compress_threads $iopts"
+ fi
+ if [ -n "$compress_chunk" ]; then
+ iopts="--compress-chunk-size=$compress_chunk $iopts"
+ fi
+ fi
+
+ if [ -n "$backup_threads" ]; then
+ iopts="--parallel=$backup_threads $iopts"
+ fi
+
+ setup_commands
set +e
- timeit "${stagemsg}-SST" "$INNOBACKUP | $tcmd; RC=( "\${PIPESTATUS[@]}" )"
+ timeit "$stagemsg-SST" "$INNOBACKUP | $tcmd; RC=( "\${PIPESTATUS[@]}" )"
set -e
if [ ${RC[0]} -ne 0 ]; then
- wsrep_log_error "${INNOBACKUPEX_BIN} finished with error: ${RC[0]}. " \
- "Check ${DATA}/innobackup.backup.log"
- exit 22
- elif [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then
- wsrep_log_error "$tcmd finished with error: ${RC[1]}"
- exit 22
+ wsrep_log_error "innobackupex finished with error: ${RC[0]}. " \
+ "Check syslog or '$INNOBACKUPLOG' for details"
+ exit 22
+ elif [ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]; then
+ wsrep_log_error "$tcmd finished with error: ${RC[1]}"
+ exit 22
fi
# innobackupex implicitly writes PID to fixed location in $xtmpdir
- XTRABACKUP_PID="$xtmpdir/xtrabackup_pid"
-
+ BACKUP_PID="$xtmpdir/xtrabackup_pid"
else # BYPASS FOR IST
@@ -1036,197 +1124,213 @@ then
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
# (separated by a space).
- echo "${WSREP_SST_OPT_GTID} ${WSREP_SST_OPT_GTID_DOMAIN_ID}" > "${MAGIC_FILE}"
- echo "1" > "${DATA}/${IST_FILE}"
+ echo "$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID" > "$MAGIC_FILE"
+ echo "1" > "$DATA/$IST_FILE"
+
+ if [ -n "$scomp" ]; then
+ tcmd="$scomp | $tcmd"
+ fi
+
get_keys
- if [[ $encrypt -eq 1 ]];then
- if [[ -n $scomp ]];then
- tcmd=" \$ecmd | $scomp | $tcmd "
- else
- tcmd=" \$ecmd | $tcmd "
- fi
- elif [[ -n $scomp ]];then
- tcmd=" $scomp | $tcmd "
+ if [ $encrypt -eq 1 ]; then
+ tcmd="$ecmd | $tcmd"
fi
- strmcmd+=" \${IST_FILE}"
- send_donor $DATA "${stagemsg}-IST"
+ strmcmd="$strmcmd '$IST_FILE'"
+
+ send_donor "$DATA" "$stagemsg-IST"
fi
- echo "done ${WSREP_SST_OPT_GTID}"
+ echo "done $WSREP_SST_OPT_GTID"
wsrep_log_info "Total time on donor: $totime seconds"
-elif [ "${WSREP_SST_OPT_ROLE}" = "joiner" ]
+elif [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]
then
- [[ -e $SST_PROGRESS_FILE ]] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE"
- [[ -n $SST_PROGRESS_FILE ]] && touch $SST_PROGRESS_FILE
+ [ -e "$SST_PROGRESS_FILE" ] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE"
+ [ -n "$SST_PROGRESS_FILE" ] && touch "$SST_PROGRESS_FILE"
- ib_home_dir=$INNODB_DATA_HOME_DIR
+ ib_home_dir="$INNODB_DATA_HOME_DIR"
- # Try to set ib_log_dir from the command line:
- ib_log_dir=$INNODB_LOG_GROUP_HOME_ARG
- if [ -z "$ib_log_dir" ]; then
- ib_log_dir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-log-group-home-dir "")
- fi
- if [ -z "$ib_log_dir" ]; then
- ib_log_dir=$(parse_cnf --mysqld innodb-log-group-home-dir "")
+ # if no command line argument and INNODB_LOG_GROUP_HOME is not set,
+ # try to get it from my.cnf:
+ if [ -z "$INNODB_LOG_GROUP_HOME" ]; then
+ INNODB_LOG_GROUP_HOME=$(parse_cnf '--mysqld' 'innodb-log-group-home-dir')
fi
- # Try to set ib_undo_dir from the command line:
- ib_undo_dir=$INNODB_UNDO_DIR_ARG
- if [ -z "$ib_undo_dir" ]; then
- ib_undo_dir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-undo-directory "")
+ ib_log_dir="$INNODB_LOG_GROUP_HOME"
+
+ # if no command line argument then try to get it from my.cnf:
+ if [ -z "$INNODB_UNDO_DIR" ]; then
+ INNODB_UNDO_DIR=$(parse_cnf '--mysqld' 'innodb-undo-directory')
fi
- if [ -z "$ib_undo_dir" ]; then
- ib_undo_dir=$(parse_cnf --mysqld innodb-undo-directory "")
+
+ ib_undo_dir="$INNODB_UNDO_DIR"
+
+ if [ -n "$backup_threads" ]; then
+ impts="--parallel=$backup_threads $impts"
fi
- stagemsg="Joiner-Recv"
+ stagemsg='Joiner-Recv'
sencrypted=1
nthreads=1
MODULE="xtrabackup_sst"
- rm -f "${DATA}/${IST_FILE}"
+ [ -f "$DATA/$IST_FILE" ] && rm -f "$DATA/$IST_FILE"
# May need xtrabackup_checkpoints later on
- rm -f ${DATA}/xtrabackup_binary ${DATA}/xtrabackup_galera_info ${DATA}/xtrabackup_logfile
+ [ -f "$DATA/xtrabackup_binary" ] && rm -f "$DATA/xtrabackup_binary"
+ [ -f "$DATA/xtrabackup_galera_info" ] && rm -f "$DATA/xtrabackup_galera_info"
+ [ -f "$DATA/ib_logfile0" ] && rm -f "$DATA/ib_logfile0"
- wait_for_listen ${WSREP_SST_OPT_HOST} ${WSREP_SST_OPT_PORT:-4444} ${MODULE} &
+ ADDR="$WSREP_SST_OPT_ADDR"
+
+ if [ "${tmode#VERIFY}" != "$tmode" ]
+ then # backward-incompatible behavior
+ CN=""
+ if [ -n "$tpem" ]
+ then
+ # find out my Common Name
+ get_openssl
+ if [ -z "$OPENSSL_BINARY" ]; then
+ wsrep_log_error 'openssl not found but it is required for authentication'
+ exit 42
+ fi
+ CN=$("$OPENSSL_BINARY" x509 -noout -subject -in "$tpem" | \
+ tr "," "\n" | grep -F 'CN =' | cut -d= -f2 | sed s/^\ // | \
+ sed s/\ %//)
+ fi
+ MY_SECRET="$(wsrep_gen_secret)"
+ # Add authentication data to address
+ ADDR="$CN:$MY_SECRET@$ADDR"
+ else
+ MY_SECRET="" # for check down in recv_joiner()
+ fi
trap sig_joiner_cleanup HUP PIPE INT TERM
- trap cleanup_joiner EXIT
+ trap cleanup_at_exit EXIT
- if [[ -n $progress ]];then
+ if [ -n "$progress" ]; then
adjust_progress
- tcmd+=" | $pcmd"
+ tcmd="$tcmd | $pcmd"
fi
get_keys
- if [[ $encrypt -eq 1 && $sencrypted -eq 1 ]];then
- if [[ -n $sdecomp ]];then
- strmcmd=" $sdecomp | \$ecmd | $strmcmd"
- else
- strmcmd=" \$ecmd | $strmcmd"
- fi
- elif [[ -n $sdecomp ]];then
- strmcmd=" $sdecomp | $strmcmd"
+ if [ $encrypt -eq 1 -a $sencrypted -eq 1 ]; then
+ strmcmd="$ecmd | $strmcmd"
+ fi
+
+ if [ -n "$sdecomp" ]; then
+ strmcmd="$sdecomp | $strmcmd"
fi
- STATDIR=$(mktemp -d)
- MAGIC_FILE="${STATDIR}/${INFO_FILE}"
- recv_joiner $STATDIR "${stagemsg}-gtid" $stimeout 1
+ check_sockets_utils
+ STATDIR="$(mktemp -d)"
+ MAGIC_FILE="$STATDIR/$INFO_FILE"
- if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null
+ recv_joiner "$STATDIR" "$stagemsg-gtid" $stimeout 1 1
+
+ if ! ps -p "$WSREP_SST_OPT_PARENT" >/dev/null 2>&1
then
- wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
+ wsrep_log_error "Parent mysqld process (PID: $WSREP_SST_OPT_PARENT) terminated unexpectedly."
exit 32
fi
- if [ ! -r "${STATDIR}/${IST_FILE}" ]
+ if [ ! -r "$STATDIR/$IST_FILE" ]
then
- if [[ -d ${DATA}/.sst ]];then
- wsrep_log_info "WARNING: Stale temporary SST directory: ${DATA}/.sst from previous state transfer. Removing"
- rm -rf ${DATA}/.sst
+ if [ -d "$DATA/.sst" ]; then
+ wsrep_log_info "WARNING: Stale temporary SST directory: '$DATA/.sst' from previous state transfer. Removing"
+ rm -rf "$DATA/.sst"
fi
- mkdir -p ${DATA}/.sst
- (recv_joiner $DATA/.sst "${stagemsg}-SST" 0 0) &
+ mkdir -p "$DATA/.sst"
+ (recv_joiner "$DATA/.sst" "$stagemsg-SST" 0 0 0) &
jpid=$!
wsrep_log_info "Proceeding with SST"
-
wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories"
- if [ "${OS}" = "FreeBSD" ]; then
- find -E $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+
+ if [ "$OS" = 'FreeBSD' ]; then
+ find -E ${ib_home_dir:+"$ib_home_dir"} \
+ ${ib_undo_dir:+"$ib_undo_dir"} \
+ ${ib_log_dir:+"$ib_log_dir"} \
+ "$DATA" -mindepth 1 -prune -regex "$cpat" -o -exec rm -rfv {} 1>&2 \+
else
- find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+
+ find ${ib_home_dir:+"$ib_home_dir"} \
+ ${ib_undo_dir:+"$ib_undo_dir"} \
+ ${ib_log_dir:+"$ib_log_dir"} \
+ "$DATA" -mindepth 1 -prune -regex "$cpat" -o -exec rm -rfv {} 1>&2 \+
fi
- tempdir=$LOG_BIN_ARG
- if [ -z "$tempdir" ]; then
- tempdir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE log-bin "")
- fi
- if [ -z "$tempdir" ]; then
- tempdir=$(parse_cnf --mysqld log-bin "")
- fi
- if [[ -n ${tempdir:-} ]];then
- binlog_dir=$(dirname $tempdir)
- binlog_file=$(basename $tempdir)
- if [[ -n ${binlog_dir:-} && $binlog_dir != '.' && $binlog_dir != $DATA ]];then
- pattern="$binlog_dir/$binlog_file\.[0-9]+$"
- wsrep_log_info "Cleaning the binlog directory $binlog_dir as well"
- find $binlog_dir -maxdepth 1 -type f -regex $pattern -exec rm -fv {} 1>&2 \+ || true
- rm $binlog_dir/*.index || true
- fi
- fi
-
-
+ get_binlog
- TDATA=${DATA}
- DATA="${DATA}/.sst"
+ if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
+ binlog_dir=$(dirname "$WSREP_SST_OPT_BINLOG")
+ cd "$binlog_dir"
+ wsrep_log_info "Cleaning the binlog directory $binlog_dir as well"
+ rm -fv "$WSREP_SST_OPT_BINLOG".[0-9]* 1>&2 \+ || true
+ binlog_index="${WSREP_SST_OPT_BINLOG_INDEX%.index}.index"
+ [ -f "$binlog_index" ] && rm -fv "$binlog_index" 1>&2 \+ || true
+ cd "$OLD_PWD"
+ fi
+ TDATA="$DATA"
+ DATA="$DATA/.sst"
- MAGIC_FILE="${DATA}/${INFO_FILE}"
+ MAGIC_FILE="$DATA/$INFO_FILE"
wsrep_log_info "Waiting for SST streaming to complete!"
monitor_process $jpid
- get_proc
-
- if [[ ! -s ${DATA}/xtrabackup_checkpoints ]];then
- wsrep_log_error "xtrabackup_checkpoints missing, failed innobackupex/SST on donor"
+ if [ ! -s "$DATA/xtrabackup_checkpoints" ]; then
+ wsrep_log_error "xtrabackup_checkpoints missing, failed xtrabackup/SST on donor"
exit 2
fi
# Rebuild indexes for compact backups
- if grep -q 'compact = 1' ${DATA}/xtrabackup_checkpoints;then
+ if grep -q -F 'compact = 1' "$DATA/xtrabackup_checkpoints"; then
wsrep_log_info "Index compaction detected"
- rebuild=1
- fi
-
- if [[ $rebuild -eq 1 ]];then
- nthreads=$(parse_cnf xtrabackup rebuild-threads $nproc)
+ get_proc
+ nthreads=$(parse_cnf "$encgroups" 'rebuild-threads' $nproc)
wsrep_log_info "Rebuilding during prepare with $nthreads threads"
rebuildcmd="--rebuild-indexes --rebuild-threads=$nthreads"
fi
- if test -n "$(find ${DATA} -maxdepth 1 -type f -name '*.qp' -print -quit)";then
-
+ qpfiles=$(find "$DATA" -maxdepth 1 -type f -name '*.qp' -print -quit)
+ if [ -n "$qpfiles" ]; then
wsrep_log_info "Compressed qpress files found"
- if [[ ! -x `which qpress` ]];then
- wsrep_log_error "qpress not found in path: $PATH"
+ if [ -z "$(command -v qpress)" ]; then
+ wsrep_log_error "qpress utility not found in the path"
exit 22
fi
- if [[ -n $progress ]] && pv --help | grep -q 'line-mode';then
- count=$(find ${DATA} -type f -name '*.qp' | wc -l)
+ get_proc
+
+ dcmd="xargs -n 2 qpress -dT$nproc"
+
+ if [ -n "$progress" ] && pv --help | grep -qw -- '--line-mode'; then
+ count=$(find "$DATA" -type f -name '*.qp' | wc -l)
count=$(( count*2 ))
- if pv --help | grep -q FORMAT;then
- pvopts="-f -s $count -l -N Decompression -F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'"
- else
- pvopts="-f -s $count -l -N Decompression"
+ pvopts="-f -s $count -l -N Decompression"
+ if pv --help | grep -qw -- '-F'; then
+ pvopts="$pvopts -F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'"
fi
pcmd="pv $pvopts"
adjust_progress
- dcmd="$pcmd | xargs -n 2 qpress -T${nproc}d"
- else
- dcmd="xargs -n 2 qpress -T${nproc}d"
+ dcmd="$pcmd | $dcmd"
fi
-
- # Decompress the qpress files
+ # Decompress the qpress files
wsrep_log_info "Decompression with $nproc threads"
- timeit "Joiner-Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
+ timeit "Joiner-Decompression" "find '$DATA' -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
extcode=$?
- if [[ $extcode -eq 0 ]];then
+ if [ $extcode -eq 0 ]; then
wsrep_log_info "Removing qpress files after decompression"
- find ${DATA} -type f -name '*.qp' -delete
- if [[ $? -ne 0 ]];then
+ find "$DATA" -type f -name '*.qp' -delete
+ if [ $? -ne 0 ]; then
wsrep_log_error "Something went wrong with deletion of qpress files. Investigate"
fi
else
@@ -1235,59 +1339,62 @@ then
fi
fi
+ if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
- if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then
+ BINLOG_DIRNAME=$(dirname "$WSREP_SST_OPT_BINLOG")
+ BINLOG_FILENAME=$(basename "$WSREP_SST_OPT_BINLOG")
- BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
- BINLOG_FILENAME=$(basename $WSREP_SST_OPT_BINLOG)
+ # To avoid comparing data directory and BINLOG_DIRNAME
+ mv "$DATA/$BINLOG_FILENAME".* "$BINLOG_DIRNAME/" 2>/dev/null || true
- # To avoid comparing data directory and BINLOG_DIRNAME
- mv $DATA/${BINLOG_FILENAME}.* $BINLOG_DIRNAME/ 2>/dev/null || true
-
- pushd $BINLOG_DIRNAME &>/dev/null
- for bfiles in $(ls -1 ${BINLOG_FILENAME}.[0-9]*);do
- echo ${BINLOG_DIRNAME}/${bfiles} >> ${BINLOG_FILENAME}.index
+ cd "$BINLOG_DIRNAME"
+ for bfile in $(ls -1 "$BINLOG_FILENAME".[0-9]*); do
+ echo "$BINLOG_DIRNAME/$bfile" >> "${WSREP_SST_OPT_BINLOG_INDEX%.index}.index"
done
- popd &> /dev/null
+ cd "$OLD_PWD"
fi
- wsrep_log_info "Preparing the backup at ${DATA}"
+ wsrep_log_info "Preparing the backup at $DATA"
+ setup_commands
timeit "Xtrabackup prepare stage" "$INNOAPPLY"
- if [ $? -ne 0 ];
- then
- wsrep_log_error "${INNOBACKUPEX_BIN} apply finished with errors. Check ${DATA}/innobackup.prepare.log"
+ if [ $? -ne 0 ]; then
+ wsrep_log_error "xtrabackup apply finished with errors. Check '$INNOAPPLYLOG' for details"
exit 22
fi
- MAGIC_FILE="${TDATA}/${INFO_FILE}"
- set +e
- rm $TDATA/innobackup.prepare.log $TDATA/innobackup.move.log
- set -e
- wsrep_log_info "Moving the backup to ${TDATA}"
+ # [ -f "$INNOAPPLYLOG" ] && rm "$INNOAPPLYLOG"
+
+ MAGIC_FILE="$TDATA/$INFO_FILE"
+
+ wsrep_log_info "Moving the backup to $TDATA"
timeit "Xtrabackup move stage" "$INNOMOVE"
- if [[ $? -eq 0 ]];then
- wsrep_log_info "Move successful, removing ${DATA}"
- rm -rf $DATA
- DATA=${TDATA}
- else
- wsrep_log_error "Move failed, keeping ${DATA} for further diagnosis"
- wsrep_log_error "Check ${DATA}/innobackup.move.log for details"
+ if [ $? -eq 0 ]; then
+ wsrep_log_info "Move successful, removing $DATA"
+ rm -rf "$DATA"
+ DATA="$TDATA"
+ else
+ wsrep_log_error "Move failed, keeping '$DATA' for further diagnosis"
+ wsrep_log_error "Check syslog or '$INNOMOVELOG' for details"
exit 22
fi
+ else
+
+ wsrep_log_info "'$IST_FILE' received from donor: Running IST"
- else
- wsrep_log_info "${IST_FILE} received from donor: Running IST"
fi
- if [[ ! -r ${MAGIC_FILE} ]];then
- wsrep_log_error "SST magic file ${MAGIC_FILE} not found/readable"
+ if [ ! -r "$MAGIC_FILE" ]; then
+ wsrep_log_error "SST magic file '$MAGIC_FILE' not found/readable"
exit 2
fi
- wsrep_log_info "Galera co-ords from recovery: $(cat ${MAGIC_FILE})"
- cat "${MAGIC_FILE}" # Output : UUID:seqno wsrep_gtid_domain_id
+
+ coords=$(cat "$MAGIC_FILE")
+ wsrep_log_info "Galera co-ords from recovery: $coords"
+ cat "$MAGIC_FILE" # Output : UUID:seqno wsrep_gtid_domain_id
+
wsrep_log_info "Total time on joiner: $totime seconds"
fi
diff --git a/scripts/wsrep_sst_xtrabackup.sh b/scripts/wsrep_sst_xtrabackup.sh
index c4feac2a135..b84aca4866e 100644
--- a/scripts/wsrep_sst_xtrabackup.sh
+++ b/scripts/wsrep_sst_xtrabackup.sh
@@ -1,5 +1,6 @@
#!/bin/bash -ue
# Copyright (C) 2013 Percona Inc
+# Copyright (C) 2017-2021 MariaDB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,13 +16,12 @@
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA 02110-1335 USA.
-# Optional dependencies and options documented here: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
+# Optional dependencies and options documented here:
+# http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
# Make sure to read that before proceeding!
-
-
-
-. $(dirname $0)/wsrep_sst_common
+. $(dirname "$0")/wsrep_sst_common
+wsrep_check_datadir
ealgo=""
ekey=""
@@ -52,13 +52,13 @@ pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' "
pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE "
uextra=0
-if which pv &>/dev/null && pv --help | grep -q FORMAT;then
+if [ -n "$(command -v pv)" ] && pv --help | grep -qw -- '-F'; then
pvopts+=$pvformat
fi
pcmd="pv $pvopts"
declare -a RC
-INNOBACKUPEX_BIN=innobackupex
+INNOBACKUPEX_BIN='innobackupex'
DATA="${WSREP_SST_OPT_DATA}"
INFO_FILE="xtrabackup_galera_info"
IST_FILE="xtrabackup_ist"
@@ -68,12 +68,12 @@ MAGIC_FILE="${DATA}/${INFO_FILE}"
export PATH="/usr/sbin:/sbin:$PATH"
timeit(){
- local stage=$1
+ local stage="$1"
shift
local cmd="$@"
local x1 x2 took extcode
- if [[ $ttime -eq 1 ]];then
+ if [[ $ttime -eq 1 ]];then
x1=$(date +%s)
wsrep_log_info "Evaluating $cmd"
eval "$cmd"
@@ -82,7 +82,7 @@ timeit(){
took=$(( x2-x1 ))
wsrep_log_info "NOTE: $stage took $took seconds"
totime=$(( totime+took ))
- else
+ else
wsrep_log_info "Evaluating $cmd"
eval "$cmd"
extcode=$?
@@ -92,18 +92,19 @@ timeit(){
get_keys()
{
- if [[ $encrypt -eq 2 ]];then
- return
+ if [[ $encrypt -eq 2 ]];then
+ return
fi
- if [[ $encrypt -eq 0 ]];then
- if $MY_PRINT_DEFAULTS xtrabackup | grep -q encrypt;then
- wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html "
+ if [[ $encrypt -eq 0 ]];then
+ if [ -n "$ealgo" -o -n "$ekey" -o -n "$ekeyfile" ]; then
+ wsrep_log_error "Options for encryption are specified, " \
+ "but encryption itself is disabled. SST may fail."
fi
return
fi
- if [[ $sfmt == 'tar' ]];then
+ if [[ "$sfmt" == 'tar' ]];then
wsrep_log_info "NOTE: Xtrabackup-based encryption - encrypt=1 - cannot be enabled with tar format"
encrypt=0
return
@@ -111,17 +112,17 @@ get_keys()
wsrep_log_info "Xtrabackup based encryption enabled in my.cnf - Supported only from Xtrabackup 2.1.4"
- if [[ -z $ealgo ]];then
+ if [[ -z "$ealgo" ]];then
wsrep_log_error "FATAL: Encryption algorithm empty from my.cnf, bailing out"
exit 3
fi
- if [[ -z $ekey && ! -r $ekeyfile ]];then
+ if [[ -z "$ekey" && ! -r "$ekeyfile" ]];then
wsrep_log_error "FATAL: Either key or keyfile must be readable"
exit 3
fi
- if [[ -z $ekey ]];then
+ if [[ -z "$ekey" ]];then
ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key-file=$ekeyfile"
else
ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key=$ekey"
@@ -134,53 +135,66 @@ get_keys()
get_transfer()
{
- TSST_PORT=${WSREP_SST_OPT_PORT:-4444}
+ TSST_PORT=$WSREP_SST_OPT_PORT
if [[ $tfmt == 'nc' ]];then
- if [[ ! -x `which nc` ]];then
- wsrep_log_error "nc(netcat) not found in path: $PATH"
- exit 2
- fi
wsrep_log_info "Using netcat as streamer"
- if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
- if nc -h 2>&1 | grep -q ncat;then
- # Ncat
- tcmd="nc -l ${TSST_PORT}"
- elif nc -h 2>&1 | grep -q -- '-d\>';then
- # Debian netcat
- tcmd="nc -dl ${TSST_PORT}"
+ wsrep_check_programs nc
+ tcmd="nc"
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ if nc -h 2>&1 | grep -q 'ncat'; then
+ wsrep_log_info "Using Ncat as streamer"
+ tcmd="$tcmd -l"
+ elif nc -h 2>&1 | grep -qw -- '-d'; then
+ wsrep_log_info "Using Debian netcat as streamer"
+ tcmd="$tcmd -dl"
+ if [ $WSREP_SST_OPT_HOST_IPv6 -eq 1 ]; then
+ # When host is not explicitly specified (when only the port
+ # is specified) netcat can only bind to an IPv4 address if
+ # the "-6" option is not explicitly specified:
+ tcmd="$tcmd -6"
+ fi
else
- # traditional netcat
- tcmd="nc -l -p ${TSST_PORT}"
+ wsrep_log_info "Using traditional netcat as streamer"
+ tcmd="$tcmd -l -p"
fi
+ tcmd="$tcmd $TSST_PORT"
else
- if nc -h 2>&1 | grep -q ncat;then
- # Ncat
- tcmd="nc ${REMOTEIP} ${TSST_PORT}"
- elif nc -h 2>&1 | grep -q -- '-d\>';then
- # Debian netcat
- tcmd="nc ${REMOTEIP} ${TSST_PORT}"
+ # Check to see if netcat supports the '-N' flag.
+ # -N Shutdown the network socket after EOF on stdin
+ # If it supports the '-N' flag, then we need to use the '-N'
+ # flag, otherwise the transfer will stay open after the file
+ # transfer and cause the command to timeout.
+ # Older versions of netcat did not need this flag and will
+ # return an error if the flag is used.
+ if nc -h 2>&1 | grep -qw -- '-N'; then
+ tcmd="$tcmd -N"
+ wsrep_log_info "Using nc -N"
+ fi
+ # netcat doesn't understand [] around IPv6 address
+ if nc -h 2>&1 | grep -q ncat; then
+ wsrep_log_info "Using Ncat as streamer"
+ elif nc -h 2>&1 | grep -qw -- '-d'; then
+ wsrep_log_info "Using Debian netcat as streamer"
else
- # traditional netcat
- tcmd="nc -q0 ${REMOTEIP} ${TSST_PORT}"
+ wsrep_log_info "Using traditional netcat as streamer"
+ tcmd="$tcmd -q0"
fi
+ tcmd="$tcmd $WSREP_SST_OPT_HOST_UNESCAPED $TSST_PORT"
fi
else
tfmt='socat'
wsrep_log_info "Using socat as streamer"
- if [[ ! -x `which socat` ]];then
- wsrep_log_error "socat not found in path: $PATH"
- exit 2
- fi
+ wsrep_check_programs socat
- if [[ $encrypt -eq 2 ]] && ! socat -V | grep -q OPENSSL;then
+ if [ $encrypt -eq 2 ] && ! socat -V | grep -q -F 'OPENSSL';then
wsrep_log_info "NOTE: socat is not openssl enabled, falling back to plain transfer"
encrypt=0
fi
- if [[ $encrypt -eq 2 ]];then
+ if [[ $encrypt -eq 2 ]];then
wsrep_log_info "Using openssl based encryption with socat"
- if [[ -z $tpem || -z $tcert ]];then
+ if [[ -z $tpem || -z $tcert ]];then
wsrep_log_error "Both PEM and CRT files required"
exit 22
fi
@@ -191,7 +205,7 @@ get_transfer()
wsrep_log_info "Encrypting with PEM $tpem, CA: $tcert"
tcmd="socat -u stdio openssl-connect:${WSREP_SST_OPT_HOST}:${TSST_PORT},cert=$tpem,cafile=${tcert}${sockopt}"
fi
- else
+ else
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio"
else
@@ -199,14 +213,13 @@ get_transfer()
fi
fi
fi
-
}
get_footprint()
{
- pushd $WSREP_SST_OPT_DATA 1>/dev/null
+ pushd "$WSREP_SST_OPT_DATA" 1>/dev/null
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c -s | awk 'END { print $1 }')
- if $MY_PRINT_DEFAULTS xtrabackup | grep -q -- "--compress";then
+ if [ $(in_config 'xtrabackup' 'compress') -eq 1 ]; then
# QuickLZ has around 50% compression ratio
# When compression/compaction used, the progress is only an approximate.
payload=$(( payload*1/2 ))
@@ -218,18 +231,18 @@ get_footprint()
adjust_progress()
{
- if [[ -n $progress && $progress != '1' ]];then
- if [[ -e $progress ]];then
+ if [[ -n "$progress" && "$progress" != '1' ]];then
+ if [[ -e "$progress" ]];then
pcmd+=" 2>>$progress"
- else
+ else
pcmd+=" 2>$progress"
fi
- elif [[ -z $progress && -n $rlimit ]];then
+ elif [[ -z "$progress" && -n "$rlimit" ]];then
# When rlimit is non-zero
pcmd="pv -q"
- fi
+ fi
- if [[ -n $rlimit && "$WSREP_SST_OPT_ROLE" == "donor" ]];then
+ if [[ -n "$rlimit" && "$WSREP_SST_OPT_ROLE" == "donor" ]];then
wsrep_log_info "Rate-limiting SST to $rlimit"
pcmd+=" -L \$rlimit"
fi
@@ -251,7 +264,7 @@ read_cnf()
ekey=$(parse_cnf xtrabackup encrypt-key "")
ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "")
- # Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
+ # Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
if [[ -z $ealgo ]];then
ealgo=$(parse_cnf sst encrypt-algo "")
ekey=$(parse_cnf sst encrypt-key "")
@@ -263,7 +276,7 @@ read_cnf()
get_stream()
{
- if [[ $sfmt == 'xbstream' ]];then
+ if [[ $sfmt == 'xbstream' ]];then
wsrep_log_info "Streaming with xbstream"
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
strmcmd="xbstream -x"
@@ -278,7 +291,6 @@ get_stream()
else
strmcmd="tar cf - \${INFO_FILE} \${IST_FILE}"
fi
-
fi
}
@@ -300,57 +312,43 @@ cleanup_joiner()
{
# Since this is invoked just after exit NNN
local estatus=$?
- if [[ $estatus -ne 0 ]];then
+ if [[ $estatus -ne 0 ]];then
wsrep_log_error "Cleanup after exit with status:$estatus"
fi
if [ "${WSREP_SST_OPT_ROLE}" = "joiner" ];then
wsrep_log_info "Removing the sst_in_progress file"
wsrep_cleanup_progress_file
fi
- if [[ -n $progress && -p $progress ]];then
+ if [[ -n "$progress" && -p "$progress" ]];then
wsrep_log_info "Cleaning up fifo file $progress"
rm $progress
fi
}
-check_pid()
-{
- local pid_file="$1"
- [ -r "$pid_file" ] && ps -p $(cat "$pid_file") >/dev/null 2>&1
-}
-
cleanup_donor()
{
# Since this is invoked just after exit NNN
local estatus=$?
- if [[ $estatus -ne 0 ]];then
+ if [[ $estatus -ne 0 ]];then
wsrep_log_error "Cleanup after exit with status:$estatus"
fi
- if [[ -n $XTRABACKUP_PID ]];then
- if check_pid $XTRABACKUP_PID
+ if [[ -n "$XTRABACKUP_PID" ]];then
+ if check_pid "$XTRABACKUP_PID" 1
then
wsrep_log_error "xtrabackup process is still running. Killing... "
- kill_xtrabackup
+ cleanup_pid $CHECK_PID "$XTRABACKUP_PID"
fi
-
- rm -f $XTRABACKUP_PID
fi
- rm -f ${DATA}/${IST_FILE}
- if [[ -n $progress && -p $progress ]];then
+ rm -f "${DATA}/${IST_FILE}"
+
+ if [[ -n "$progress" && -p "$progress" ]];then
wsrep_log_info "Cleaning up fifo file $progress"
rm $progress
fi
}
-kill_xtrabackup()
-{
- local PID=$(cat $XTRABACKUP_PID)
- [ -n "$PID" -a "0" != "$PID" ] && kill $PID && (kill $PID && kill -9 $PID) || :
- rm -f "$XTRABACKUP_PID"
-}
-
# waits ~10 seconds for nc to open the port and then reports ready
# (regardless of timeout)
wait_for_listen()
@@ -363,9 +361,9 @@ wait_for_listen()
ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break
sleep 0.2
done
- if [[ $incremental -eq 1 ]];then
+ if [[ $incremental -eq 1 ]];then
echo "ready ${ADDR}/${MODULE}/$lsn"
- else
+ else
echo "ready ${ADDR}/${MODULE}"
fi
}
@@ -373,20 +371,21 @@ wait_for_listen()
check_extra()
{
local use_socket=1
- if [[ $uextra -eq 1 ]];then
- if [ $(parse_cnf --mysqld thread-handling) = 'pool-of-threads'];then
+ if [[ $uextra -eq 1 ]];then
+ local thread_handling=$(parse_cnf '--mysqld' 'thread-handling')
+ if [ "$thread_handling" = 'pool-of-threads' ]; then
local eport=$(parse_cnf --mysqld extra-port)
- if [[ -n $eport ]];then
+ if [[ -n $eport ]];then
# Xtrabackup works only locally.
- # Hence, setting host to 127.0.0.1 unconditionally.
+ # Hence, setting host to 127.0.0.1 unconditionally.
wsrep_log_info "SST through extra_port $eport"
INNOEXTRA+=" --host=127.0.0.1 --port=$eport"
use_socket=0
- else
+ else
wsrep_log_error "Extra port $eport null, failing"
exit 1
fi
- else
+ else
wsrep_log_info "Thread pool not set, ignore the option use_extra"
fi
fi
@@ -395,14 +394,14 @@ check_extra()
fi
}
-if [[ ! -x `which innobackupex` ]];then
+if [ ! -x "$(command -v innobackupex)" ]; then
wsrep_log_error "innobackupex not in path: $PATH"
exit 2
fi
rm -f "${MAGIC_FILE}"
-if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then
+if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then
wsrep_log_error "Invalid role ${WSREP_SST_OPT_ROLE}"
exit 22
fi
@@ -411,7 +410,6 @@ read_cnf
get_stream
get_transfer
-INNOEXTRA=""
INNOAPPLY="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log"
INNOBACKUP="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} \$INNOEXTRA --galera-info --stream=\$sfmt \${TMPDIR} 2>\${DATA}/innobackup.backup.log"
@@ -424,14 +422,14 @@ then
usrst=0
TMPDIR="${TMPDIR:-/tmp}"
- if [[ -n "${WSREP_SST_OPT_USER:-}" && "$WSREP_SST_OPT_USER" != "(null)" ]]; then
+ if [ -n "$WSREP_SST_OPT_USER" ]; then
INNOEXTRA+=" --user=$WSREP_SST_OPT_USER"
usrst=1
fi
- if [ -n "${WSREP_SST_OPT_PSWD:-}" ]; then
+ if [ -n "$WSREP_SST_OPT_PSWD" ]; then
INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
- elif [[ $usrst -eq 1 ]];then
+ elif [ $usrst -eq 1 ]; then
# Empty password, used for testing, debugging etc.
INNOEXTRA+=" --password="
fi
@@ -440,12 +438,12 @@ then
if [[ $encrypt -eq 1 ]];then
if [[ -n $ekey ]];then
INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey"
- else
+ else
INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile"
fi
fi
- if [[ -n $lsn ]];then
+ if [[ -n $lsn ]];then
INNOEXTRA+=" --incremental --incremental-lsn=$lsn"
fi
@@ -453,10 +451,10 @@ then
wsrep_log_info "Streaming the backup to joiner at ${WSREP_SST_OPT_HOST} ${WSREP_SST_OPT_PORT}"
- if [[ -n $progress ]];then
+ if [[ -n $progress ]];then
get_footprint
tcmd="$pcmd | $tcmd"
- elif [[ -n $rlimit ]];then
+ elif [[ -n $rlimit ]];then
adjust_progress
tcmd="$pcmd | $tcmd"
fi
@@ -469,7 +467,7 @@ then
wsrep_log_error "${INNOBACKUPEX_BIN} finished with error: ${RC[0]}. " \
"Check ${DATA}/innobackup.backup.log"
exit 22
- elif [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then
+ elif [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then
wsrep_log_error "$tcmd finished with error: ${RC[1]}"
exit 22
fi
@@ -496,13 +494,14 @@ then
set -e
popd 1>/dev/null
- for ecode in "${RC[@]}";do
- if [[ $ecode -ne 0 ]];then
+ for ecode in "${RC[@]}";do
+ if [[ $ecode -ne 0 ]];then
wsrep_log_error "Error while streaming data to joiner node: " \
"exit codes: ${RC[@]}"
exit 1
fi
done
+
fi
echo "done ${WSREP_SST_OPT_GTID}"
@@ -510,16 +509,15 @@ then
elif [ "${WSREP_SST_OPT_ROLE}" = "joiner" ]
then
- [[ -e $SST_PROGRESS_FILE ]] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE"
- touch $SST_PROGRESS_FILE
+ [[ -e "$SST_PROGRESS_FILE" ]] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE"
+ touch "$SST_PROGRESS_FILE"
- if [[ ! -e ${DATA}/ibdata1 ]];then
+ if [[ ! -e "${DATA}/ibdata1" ]];then
incremental=0
fi
- if [[ $incremental -eq 1 ]];then
+ if [[ $incremental -eq 1 ]];then
wsrep_log_info "Incremental SST enabled"
- #lsn=$(/pxc/bin/mysqld $WSREP_SST_OPT_CONF --basedir=/pxc --wsrep-recover 2>&1 | grep -o 'log sequence number .*' | cut -d " " -f 4 | head -1)
lsn=$(grep to_lsn xtrabackup_checkpoints | cut -d= -f2 | tr -d ' ')
wsrep_log_info "Recovered LSN: $lsn"
fi
@@ -530,41 +528,41 @@ then
MODULE="xtrabackup_sst"
# May need xtrabackup_checkpoints later on
- rm -f ${DATA}/xtrabackup_binary ${DATA}/xtrabackup_galera_info ${DATA}/xtrabackup_logfile
+ rm -f "${DATA}/xtrabackup_binary" "${DATA}/xtrabackup_galera_info" "${DATA}/xtrabackup_logfile"
- ADDR="${WSREP_SST_OPT_HOST}:${WSREP_SST_OPT_PORT:-4444}"
+ ADDR="${WSREP_SST_OPT_HOST}:${WSREP_SST_OPT_PORT}"
- wait_for_listen ${WSREP_SST_OPT_PORT:-4444} ${ADDR} ${MODULE} &
+ wait_for_listen "${WSREP_SST_OPT_PORT}" "${ADDR}" "${MODULE}" &
trap sig_joiner_cleanup HUP PIPE INT TERM
trap cleanup_joiner EXIT
- if [[ -n $progress ]];then
+ if [[ -n $progress ]];then
adjust_progress
tcmd+=" | $pcmd"
fi
- if [[ $incremental -eq 1 ]];then
+ if [[ $incremental -eq 1 ]];then
BDATA=$DATA
- DATA=$(mktemp -d)
+ DATA="$(mktemp -d)"
MAGIC_FILE="${DATA}/${INFO_FILE}"
fi
get_keys
set +e
if [[ $encrypt -eq 1 && $sencrypted -eq 1 ]];then
- strmcmd=" $ecmd | $strmcmd"
+ strmcmd="$ecmd | $strmcmd"
fi
pushd ${DATA} 1>/dev/null
timeit "Joiner-Recv-Unencrypted" "$tcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )"
- popd 1>/dev/null
+ popd 1>/dev/null
set -e
- if [[ $sfmt == 'xbstream' ]];then
+ if [[ $sfmt == 'xbstream' ]];then
# Special handling till lp:1193240 is fixed"
- if [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then
+ if [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then
wsrep_log_error "Xbstream failed"
wsrep_log_error "Data directory ${DATA} may not be empty: lp:1193240" \
"Manual intervention required in that case"
@@ -574,8 +572,8 @@ then
wait %% # join for wait_for_listen thread
- for ecode in "${RC[@]}";do
- if [[ $ecode -ne 0 ]];then
+ for ecode in "${RC[@]}";do
+ if [[ $ecode -ne 0 ]];then
wsrep_log_error "Error while getting data from donor node: " \
"exit codes: ${RC[@]}"
exit 32
@@ -586,77 +584,78 @@ then
then
# this message should cause joiner to abort
wsrep_log_error "xtrabackup process ended without creating '${MAGIC_FILE}'"
- wsrep_log_info "Contents of datadir"
- wsrep_log_info "$(ls -l ${DATA}/**/*)"
+ wsrep_log_info "Contents of datadir"
+ wsrep_log_info $(ls -l "${DATA}"/**/*)
exit 32
fi
if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null
then
- wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
+ wsrep_log_error "Parent mysqld process (PID: $WSREP_SST_OPT_PARENT) terminated unexpectedly."
exit 32
fi
if [ ! -r "${DATA}/${IST_FILE}" ]
then
wsrep_log_info "Proceeding with SST"
+
wsrep_log_info "Removing existing ib_logfile files"
- if [[ $incremental -ne 1 ]];then
- rm -f ${DATA}/ib_logfile*
+ if [[ $incremental -ne 1 ]];then
+ rm -f "${DATA}/ib_logfile"*
else
- rm -f ${BDATA}/ib_logfile*
+ rm -f "${BDATA}/ib_logfile"*
fi
get_proc
# Rebuild indexes for compact backups
- if grep -q 'compact = 1' ${DATA}/xtrabackup_checkpoints;then
+ if grep -q 'compact = 1' ${DATA}/xtrabackup_checkpoints;then
wsrep_log_info "Index compaction detected"
rebuild=1
fi
- if [[ $rebuild -eq 1 ]];then
+ if [[ $rebuild -eq 1 ]];then
nthreads=$(parse_cnf xtrabackup rebuild-threads $nproc)
wsrep_log_info "Rebuilding during prepare with $nthreads threads"
rebuildcmd="--rebuild-indexes --rebuild-threads=$nthreads"
fi
- if test -n "$(find ${DATA} -maxdepth 1 -type f -name '*.qp' -print -quit)";then
+ if test -n $(find "${DATA}" -maxdepth 1 -type f -name '*.qp' -print -quit); then
wsrep_log_info "Compressed qpress files found"
- if [[ ! -x `which qpress` ]];then
+ if [ -z "$(command -v qpress)" ]; then
wsrep_log_error "qpress not found in path: $PATH"
exit 22
fi
- if [[ -n $progress ]] && pv --help | grep -q 'line-mode';then
- count=$(find ${DATA} -type f -name '*.qp' | wc -l)
+ dcmd="xargs -n 2 qpress -dT$nproc"
+
+ if [[ -n $progress ]] && pv --help | grep -qw -- '--line-mode';then
+ count=$(find "${DATA}" -type f -name '*.qp' | wc -l)
count=$(( count*2 ))
- if pv --help | grep -q FORMAT;then
+ if pv --help | grep -qw -F '-F';then
pvopts="-f -s $count -l -N Decompression -F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'"
- else
+ else
pvopts="-f -s $count -l -N Decompression"
fi
pcmd="pv $pvopts"
adjust_progress
- dcmd="$pcmd | xargs -n 2 qpress -T${nproc}d"
- else
- dcmd="xargs -n 2 qpress -T${nproc}d"
+ dcmd="$pcmd | $dcmd"
fi
wsrep_log_info "Removing existing ibdata1 file"
- rm -f ${DATA}/ibdata1
+ rm -f "${DATA}/ibdata1"
- # Decompress the qpress files
+ # Decompress the qpress files
wsrep_log_info "Decompression with $nproc threads"
- timeit "Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
+ timeit "Decompression" "find '${DATA}' -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
extcode=$?
if [[ $extcode -eq 0 ]];then
wsrep_log_info "Removing qpress files after decompression"
- find ${DATA} -type f -name '*.qp' -delete
- if [[ $? -ne 0 ]];then
+ find ${DATA} -type f -name '*.qp' -delete
+ if [[ $? -ne 0 ]];then
wsrep_log_error "Something went wrong with deletion of qpress files. Investigate"
fi
else
@@ -665,7 +664,7 @@ then
fi
fi
- if [[ $incremental -eq 1 ]];then
+ if [[ $incremental -eq 1 ]];then
# Added --ibbackup=xtrabackup_55 because it fails otherwise citing connection issues.
INNOAPPLY="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} \
--ibbackup=xtrabackup_55 --apply-log $rebuildcmd --redo-only $BDATA --incremental-dir=${DATA} &>>${BDATA}/innobackup.prepare.log"
@@ -674,7 +673,7 @@ then
wsrep_log_info "Preparing the backup at ${DATA}"
timeit "Xtrabackup prepare stage" "$INNOAPPLY"
- if [[ $incremental -eq 1 ]];then
+ if [[ $incremental -eq 1 ]];then
wsrep_log_info "Cleaning up ${DATA} after incremental SST"
[[ -d ${DATA} ]] && rm -rf ${DATA}
DATA=$BDATA
@@ -682,10 +681,10 @@ then
if [ $? -ne 0 ];
then
- wsrep_log_error "${INNOBACKUPEX_BIN} finished with errors. Check ${DATA}/innobackup.prepare.log"
+ wsrep_log_error "${INNOBACKUPEX_BIN} finished with errors. Check ${DATA}/innobackup.prepare.log"
exit 22
fi
- else
+ else
wsrep_log_info "${IST_FILE} received from donor: Running IST"
fi
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index 4100a031c91..4e5137d3ee1 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -178,6 +178,7 @@ Event_queue_element_for_exec::init(LEX_STRING db, LEX_STRING n)
if (!(name.str= my_strndup(n.str, name.length= n.length, MYF(MY_WME))))
{
my_free(dbname.str);
+ dbname.str= NULL;
return TRUE;
}
return FALSE;
diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h
index 0acf301ef5a..8ed45d3699f 100644
--- a/sql/event_data_objects.h
+++ b/sql/event_data_objects.h
@@ -33,7 +33,11 @@ struct TABLE;
class Event_queue_element_for_exec
{
public:
- Event_queue_element_for_exec(){};
+ Event_queue_element_for_exec()
+ {
+ dbname.str= NULL; dbname.length= 0;
+ name.str= NULL; name.length= 0;
+ };
~Event_queue_element_for_exec();
bool
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index 904efe26f36..4398b650fd7 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -635,6 +635,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
if (!(*event_name= new Event_queue_element_for_exec()) ||
(*event_name)->init(top->dbname, top->name))
{
+ delete *event_name;
ret= TRUE;
break;
}
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index 2a5399fb94a..423f7e6ea2b 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -436,7 +436,7 @@ Event_scheduler::start(int *err_no)
scheduler_thd= NULL;
deinit_event_thread(new_thd);
- delete scheduler_param_value;
+ my_free(scheduler_param_value);
ret= true;
}
diff --git a/sql/field.cc b/sql/field.cc
index 652228beceb..4e6bc6b8341 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -6373,6 +6373,7 @@ bool Field_timef::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
{
ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ THD *thd= get_thd();
char *end;
int error;
longlong nr= cs->cset->strntoull10rnd(cs, from, len, 0, &end, &error);
@@ -6384,7 +6385,14 @@ int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1);
return 1;
}
- if (get_thd()->count_cuted_fields &&
+
+ if (!thd->count_cuted_fields && error == MY_ERRNO_EDOM)
+ {
+ *ptr= 0;
+ return 1;
+ }
+
+ if (thd->count_cuted_fields &&
(error= check_int(cs, from, len, end, error)))
{
if (error == 1) /* empty or incorrect string */
@@ -8310,6 +8318,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
copy_length= copier.well_formed_copy(field_charset,
(char*) value.ptr(), new_length,
cs, from, length);
+ value.length(copy_length);
Field_blob::store_length(copy_length);
bmove(ptr+packlength,(uchar*) &tmp,sizeof(char*));
diff --git a/sql/field.h b/sql/field.h
index 18e44f1d9d4..6d8e2aecd6e 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -972,8 +972,9 @@ public:
virtual void reset_fields() {}
const uchar *ptr_in_record(const uchar *record) const
{
- my_ptrdiff_t l_offset= (my_ptrdiff_t) (record - table->record[0]);
- return ptr + l_offset;
+ my_ptrdiff_t l_offset= (my_ptrdiff_t) (ptr - table->record[0]);
+ DBUG_ASSERT(l_offset >= 0 && table->s->rec_buff_length - l_offset > 0);
+ return record + l_offset;
}
virtual int set_default();
@@ -3464,6 +3465,12 @@ public:
uchar *new_ptr, uint32 length,
uchar *new_null_ptr, uint new_null_bit);
void sql_type(String &str) const;
+ /**
+ Copy blob buffer into internal storage "value" and update record pointer.
+
+ @retval true Memory allocation error
+ @retval false Success
+ */
inline bool copy()
{
uchar *tmp= get_ptr();
@@ -3476,6 +3483,33 @@ public:
memcpy(ptr+packlength, &tmp, sizeof(char*));
return 0;
}
+ void swap(String &inout, bool set_read_value)
+ {
+ if (set_read_value)
+ read_value.swap(inout);
+ else
+ value.swap(inout);
+ }
+ /**
+ Return pointer to blob cache or NULL if not cached.
+ */
+ String * cached(bool *set_read_value)
+ {
+ char *tmp= (char *) get_ptr();
+ if (!value.is_empty() && tmp == value.ptr())
+ {
+ *set_read_value= false;
+ return &value;
+ }
+
+ if (!read_value.is_empty() && tmp == read_value.ptr())
+ {
+ *set_read_value= true;
+ return &read_value;
+ }
+
+ return NULL;
+ }
/* store value for the duration of the current read record */
inline void swap_value_and_read_value()
{
diff --git a/sql/filesort.cc b/sql/filesort.cc
index d76c39c3bd4..8b019caf8f5 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -608,6 +608,15 @@ const char* dbug_print_table_row(TABLE *table)
}
+const char* dbug_print_row(TABLE *table, uchar *rec)
+{
+ table->move_fields(table->field, rec, table->record[0]);
+ const char* ret= dbug_print_table_row(table);
+ table->move_fields(table->field, table->record[0], rec);
+ return ret;
+}
+
+
/*
Print a text, SQL-like record representation into dbug trace.
diff --git a/sql/gen_win_tzname_data.ps1 b/sql/gen_win_tzname_data.ps1
index c0a37d21895..474ab889d25 100644
--- a/sql/gen_win_tzname_data.ps1
+++ b/sql/gen_win_tzname_data.ps1
@@ -4,6 +4,7 @@
write-output "/* This file was generated using gen_win_tzname_data.ps1 */"
$xdoc = new-object System.Xml.XmlDocument
+[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$xdoc.load("https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml")
$nodes = $xdoc.SelectNodes("//mapZone[@territory='001']") # use default territory (001)
foreach ($node in $nodes) {
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 523e76e511e..4345f9eb9ca 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2019, Oracle and/or its affiliates.
- Copyright (c) 2009, 2019, MariaDB
+ Copyright (c) 2009, 2021, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2244,25 +2244,6 @@ void ha_partition::change_table_ptr(TABLE *table_arg, TABLE_SHARE *share)
}
}
-/*
- Change comments specific to handler
-
- SYNOPSIS
- update_table_comment()
- comment Original comment
-
- RETURN VALUE
- new comment
-
- DESCRIPTION
- No comment changes so far
-*/
-
-char *ha_partition::update_table_comment(const char *comment)
-{
- return (char*) comment; /* Nothing to change */
-}
-
/**
Handle delete and rename table
@@ -5122,59 +5103,69 @@ bool ha_partition::init_record_priority_queue()
/*
Initialize the ordered record buffer.
*/
- if (!m_ordered_rec_buffer)
- {
- uint alloc_len;
- uint used_parts= bitmap_bits_set(&m_part_info->read_partitions);
- /* Allocate record buffer for each used partition. */
- m_priority_queue_rec_len= m_rec_length + PARTITION_BYTES_IN_POS;
- if (!m_using_extended_keys)
- m_priority_queue_rec_len += m_file[0]->ref_length;
- alloc_len= used_parts * m_priority_queue_rec_len;
- /* Allocate a key for temporary use when setting up the scan. */
- alloc_len+= table_share->max_key_length;
-
- if (!(m_ordered_rec_buffer= (uchar*)my_malloc(alloc_len, MYF(MY_WME))))
- DBUG_RETURN(true);
+ uint alloc_len;
+ uint used_parts= bitmap_bits_set(&m_part_info->read_partitions);
+ /* Allocate record buffer for each used partition. */
+ m_priority_queue_rec_len= m_rec_length + ORDERED_REC_OFFSET;
+ if (!m_using_extended_keys)
+ m_priority_queue_rec_len += m_file[0]->ref_length;
+ alloc_len= used_parts * m_priority_queue_rec_len;
+ /* Allocate a key for temporary use when setting up the scan. */
+ alloc_len+= table_share->max_key_length;
+ Ordered_blob_storage **blob_storage;
+ Ordered_blob_storage *objs;
+ const size_t n_all= used_parts * table->s->blob_fields;
+
+ if (!my_multi_malloc(MYF(MY_WME), &m_ordered_rec_buffer, alloc_len,
+ &blob_storage, n_all * sizeof(Ordered_blob_storage *),
+ &objs, n_all * sizeof(Ordered_blob_storage), NULL))
+ DBUG_RETURN(true);
- /*
- We set-up one record per partition and each record has 2 bytes in
- front where the partition id is written. This is used by ordered
- index_read.
- We also set-up a reference to the first record for temporary use in
- setting up the scan.
- */
- char *ptr= (char*) m_ordered_rec_buffer;
- uint i;
- for (i= bitmap_get_first_set(&m_part_info->read_partitions);
- i < m_tot_parts;
- i= bitmap_get_next_set(&m_part_info->read_partitions, i))
- {
- DBUG_PRINT("info", ("init rec-buf for part %u", i));
- int2store(ptr, i);
- ptr+= m_priority_queue_rec_len;
- }
- m_start_key.key= (const uchar*)ptr;
-
- /* Initialize priority queue, initialized to reading forward. */
- int (*cmp_func)(void *, uchar *, uchar *);
- void *cmp_arg;
- if (!m_using_extended_keys)
- {
- cmp_func= cmp_key_rowid_part_id;
- cmp_arg= (void*)this;
- }
- else
- {
- cmp_func= cmp_key_part_id;
- cmp_arg= (void*)m_curr_key_info;
- }
- if (init_queue(&m_queue, used_parts, 0, 0, cmp_func, cmp_arg, 0, 0))
+ /*
+ We set-up one record per partition and each record has 2 bytes in
+ front where the partition id is written. This is used by ordered
+ index_read.
+ We also set-up a reference to the first record for temporary use in
+ setting up the scan.
+ */
+ char *ptr= (char*) m_ordered_rec_buffer;
+ uint i;
+ for (i= bitmap_get_first_set(&m_part_info->read_partitions);
+ i < m_tot_parts;
+ i= bitmap_get_next_set(&m_part_info->read_partitions, i))
+ {
+ DBUG_PRINT("info", ("init rec-buf for part %u", i));
+ if (table->s->blob_fields)
{
- my_free(m_ordered_rec_buffer);
- m_ordered_rec_buffer= NULL;
- DBUG_RETURN(true);
+ for (uint j= 0; j < table->s->blob_fields; ++j, ++objs)
+ blob_storage[j]= new (objs) Ordered_blob_storage;
+ *((Ordered_blob_storage ***) ptr)= blob_storage;
+ blob_storage+= table->s->blob_fields;
}
+ int2store(ptr + sizeof(String **), i);
+ ptr+= m_priority_queue_rec_len;
+ }
+ m_start_key.key= (const uchar*)ptr;
+
+ /* Initialize priority queue, initialized to reading forward. */
+ int (*cmp_func)(void *, uchar *, uchar *);
+ void *cmp_arg;
+ if (!m_using_extended_keys)
+ {
+ cmp_func= cmp_key_rowid_part_id;
+ cmp_arg= (void*)this;
+ }
+ else
+ {
+ cmp_func= cmp_key_part_id;
+ cmp_arg= (void*)m_curr_key_info;
+ }
+ if (init_queue(&m_queue, used_parts, ORDERED_PART_NUM_OFFSET,
+ 0, cmp_func, cmp_arg, 0, 0))
+ {
+ my_free(m_ordered_rec_buffer);
+ m_ordered_rec_buffer= NULL;
+ DBUG_RETURN(true);
}
DBUG_RETURN(false);
}
@@ -5189,6 +5180,20 @@ void ha_partition::destroy_record_priority_queue()
DBUG_ENTER("ha_partition::destroy_record_priority_queue");
if (m_ordered_rec_buffer)
{
+ if (table->s->blob_fields)
+ {
+ char *ptr= (char *) m_ordered_rec_buffer;
+ for (uint i= bitmap_get_first_set(&m_part_info->read_partitions);
+ i < m_tot_parts;
+ i= bitmap_get_next_set(&m_part_info->read_partitions, i))
+ {
+ Ordered_blob_storage **blob_storage= *((Ordered_blob_storage ***) ptr);
+ for (uint b= 0; b < table->s->blob_fields; ++b)
+ blob_storage[b]->blob.free();
+ ptr+= m_priority_queue_rec_len;
+ }
+ }
+
delete_queue(&m_queue);
my_free(m_ordered_rec_buffer);
m_ordered_rec_buffer= NULL;
@@ -5274,8 +5279,7 @@ int ha_partition::index_init(uint inx, bool sorted)
do
{
for (i= 0; i < (*key_info)->user_defined_key_parts; i++)
- bitmap_set_bit(table->read_set,
- (*key_info)->key_part[i].field->field_index);
+ (*key_info)->key_part[i].field->register_field_in_read_map();
} while (*(++key_info));
}
for (i= bitmap_get_first_set(&m_part_info->read_partitions);
@@ -5414,7 +5418,7 @@ static int cmp_part_ids(uchar *ref1, uchar *ref2)
extern "C" int cmp_key_part_id(void *key_p, uchar *ref1, uchar *ref2)
{
int res;
- if ((res= key_rec_cmp(key_p, ref1 + PARTITION_BYTES_IN_POS,
+ if ((res= key_rec_cmp(key_p, ref1 + PARTITION_BYTES_IN_POS,
ref2 + PARTITION_BYTES_IN_POS)))
{
return res;
@@ -6153,8 +6157,8 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
{
DBUG_PRINT("info", ("reading from part %u (scan_type: %u)",
i, m_index_scan_type));
- DBUG_ASSERT(i == uint2korr(part_rec_buf_ptr));
- uchar *rec_buf_ptr= part_rec_buf_ptr + PARTITION_BYTES_IN_POS;
+ DBUG_ASSERT(i == uint2korr(part_rec_buf_ptr + ORDERED_PART_NUM_OFFSET));
+ uchar *rec_buf_ptr= part_rec_buf_ptr + ORDERED_REC_OFFSET;
int error;
handler *file= m_file[i];
@@ -6182,6 +6186,7 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
error= file->read_range_first(m_start_key.key? &m_start_key: NULL,
end_range, eq_range, TRUE);
memcpy(rec_buf_ptr, table->record[0], m_rec_length);
+
reverse_order= FALSE;
break;
}
@@ -6201,6 +6206,11 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
Initialize queue without order first, simply insert
*/
queue_element(&m_queue, j++)= part_rec_buf_ptr;
+ if (table->s->blob_fields)
+ {
+ Ordered_blob_storage **storage= *((Ordered_blob_storage ***) part_rec_buf_ptr);
+ swap_blobs(rec_buf_ptr, storage, false);
+ }
}
else if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
{
@@ -6249,10 +6259,15 @@ void ha_partition::return_top_record(uchar *buf)
{
uint part_id;
uchar *key_buffer= queue_top(&m_queue);
- uchar *rec_buffer= key_buffer + PARTITION_BYTES_IN_POS;
+ uchar *rec_buffer= key_buffer + ORDERED_REC_OFFSET;
- part_id= uint2korr(key_buffer);
+ part_id= uint2korr(key_buffer + ORDERED_PART_NUM_OFFSET);
memcpy(buf, rec_buffer, m_rec_length);
+ if (table->s->blob_fields)
+ {
+ Ordered_blob_storage **storage= *((Ordered_blob_storage ***) key_buffer);
+ swap_blobs(buf, storage, true);
+ }
m_last_part= part_id;
m_top_entry= part_id;
}
@@ -6288,7 +6303,7 @@ int ha_partition::handle_ordered_index_scan_key_not_found()
This partition is used and did return HA_ERR_KEY_NOT_FOUND
in index_read_map.
*/
- curr_rec_buf= part_buf + PARTITION_BYTES_IN_POS;
+ curr_rec_buf= part_buf + ORDERED_REC_OFFSET;
error= m_file[i]->ha_index_next(curr_rec_buf);
/* HA_ERR_KEY_NOT_FOUND is not allowed from index_next! */
DBUG_ASSERT(error != HA_ERR_KEY_NOT_FOUND);
@@ -6313,6 +6328,48 @@ int ha_partition::handle_ordered_index_scan_key_not_found()
}
+void ha_partition::swap_blobs(uchar * rec_buf, Ordered_blob_storage ** storage, bool restore)
+{
+ uint *ptr, *end;
+ uint blob_n= 0;
+ table->move_fields(table->field, rec_buf, table->record[0]);
+ for (ptr= table->s->blob_field, end= ptr + table->s->blob_fields;
+ ptr != end; ++ptr, ++blob_n)
+ {
+ DBUG_ASSERT(*ptr < table->s->fields);
+ Field_blob *blob= (Field_blob*) table->field[*ptr];
+ DBUG_ASSERT(blob->flags & BLOB_FLAG);
+ DBUG_ASSERT(blob->field_index == *ptr);
+ if (!bitmap_is_set(table->read_set, *ptr) || blob->is_null())
+ continue;
+
+ Ordered_blob_storage &s= *storage[blob_n];
+
+ if (restore)
+ {
+ /*
+ We protect only blob cache (value or read_value). If the cache was
+ empty that doesn't mean the blob was empty. Blobs allocated by a
+ storage engine should work just fine.
+ */
+ if (!s.blob.is_empty())
+ blob->swap(s.blob, s.set_read_value);
+ }
+ else
+ {
+ bool set_read_value;
+ String *cached= blob->cached(&set_read_value);
+ if (cached)
+ {
+ cached->swap(s.blob);
+ s.set_read_value= set_read_value;
+ }
+ }
+ }
+ table->move_fields(table->field, table->record[0], rec_buf);
+}
+
+
/*
Common routine to handle index_next with ordered results
@@ -6331,7 +6388,8 @@ int ha_partition::handle_ordered_next(uchar *buf, bool is_next_same)
{
int error;
uint part_id= m_top_entry;
- uchar *rec_buf= queue_top(&m_queue) + PARTITION_BYTES_IN_POS;
+ uchar *part_rec_buf_ptr= queue_top(&m_queue);
+ uchar *rec_buf= part_rec_buf_ptr + ORDERED_REC_OFFSET;
handler *file;
DBUG_ENTER("ha_partition::handle_ordered_next");
@@ -6374,7 +6432,15 @@ int ha_partition::handle_ordered_next(uchar *buf, bool is_next_same)
if (m_index_scan_type == partition_read_range)
{
error= file->read_range_next();
- memcpy(rec_buf, table->record[0], m_rec_length);
+ if (!error)
+ {
+ memcpy(rec_buf, table->record[0], m_rec_length);
+ if (table->s->blob_fields)
+ {
+ Ordered_blob_storage **storage= *((Ordered_blob_storage ***) part_rec_buf_ptr);
+ swap_blobs(rec_buf, storage, false);
+ }
+ }
}
else if (!is_next_same)
error= file->ha_index_next(rec_buf);
@@ -6430,7 +6496,7 @@ int ha_partition::handle_ordered_prev(uchar *buf)
{
int error;
uint part_id= m_top_entry;
- uchar *rec_buf= queue_top(&m_queue) + PARTITION_BYTES_IN_POS;
+ uchar *rec_buf= queue_top(&m_queue) + ORDERED_REC_OFFSET;
handler *file= m_file[part_id];
DBUG_ENTER("ha_partition::handle_ordered_prev");
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index a48aa639237..2fccc37ec1f 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -3,7 +3,7 @@
/*
Copyright (c) 2005, 2012, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013, Monty Program Ab & SkySQL Ab.
+ Copyright (c) 2009, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,17 @@
#include "sql_partition.h" /* part_id_range, partition_element */
#include "queues.h" /* QUEUE */
+struct Ordered_blob_storage
+{
+ String blob;
+ bool set_read_value;
+ Ordered_blob_storage() : set_read_value(false)
+ {}
+};
+
#define PARTITION_BYTES_IN_POS 2
+#define ORDERED_PART_NUM_OFFSET sizeof(Ordered_blob_storage **)
+#define ORDERED_REC_OFFSET (ORDERED_PART_NUM_OFFSET + PARTITION_BYTES_IN_POS)
/** Struct used for partition_name_hash */
@@ -314,10 +324,6 @@ public:
Meta data routines to CREATE, DROP, RENAME table and often used at
ALTER TABLE (update_create_info used from ALTER TABLE and SHOW ..).
- update_table_comment is used in SHOW TABLE commands to provide a
- chance for the handler to add any interesting comments to the table
- comments not provided by the users comment.
-
create_partitioning_metadata is called before opening a new handler object
with openfrm to call create. It is used to create any local handler
object needed in opening the object in openfrm
@@ -330,7 +336,6 @@ public:
virtual int create_partitioning_metadata(const char *name,
const char *old_name, int action_flag);
virtual void update_create_info(HA_CREATE_INFO *create_info);
- virtual char *update_table_comment(const char *comment);
virtual int change_partitions(HA_CREATE_INFO *create_info,
const char *path,
ulonglong * const copied,
@@ -635,6 +640,7 @@ private:
int handle_ordered_next(uchar * buf, bool next_same);
int handle_ordered_prev(uchar * buf);
void return_top_record(uchar * buf);
+ void swap_blobs(uchar* rec_buf, Ordered_blob_storage ** storage, bool restore);
public:
/*
-------------------------------------------------------------------------
diff --git a/sql/handler.h b/sql/handler.h
index e0e0604176d..542b91c570d 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -2,7 +2,7 @@
#define HANDLER_INCLUDED
/*
Copyright (c) 2000, 2019, Oracle and/or its affiliates.
- Copyright (c) 2009, 2019, MariaDB
+ Copyright (c) 2009, 2021, MariaDB
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -741,6 +741,7 @@ enum enum_schema_tables
SCH_FILES,
SCH_GLOBAL_STATUS,
SCH_GLOBAL_VARIABLES,
+ SCH_KEYWORDS,
SCH_KEY_CACHES,
SCH_KEY_COLUMN_USAGE,
SCH_OPEN_TABLES,
@@ -756,6 +757,7 @@ enum enum_schema_tables
SCH_SESSION_STATUS,
SCH_SESSION_VARIABLES,
SCH_STATISTICS,
+ SCH_SQL_FUNCTIONS,
SCH_SYSTEM_VARIABLES,
SCH_TABLES,
SCH_TABLESPACES,
@@ -1481,7 +1483,17 @@ struct THD_TRANS
static unsigned int const DROPPED_TEMP_TABLE= 0x04;
static unsigned int const DID_WAIT= 0x08;
static unsigned int const DID_DDL= 0x10;
+ static unsigned int const EXECUTED_TABLE_ADMIN_CMD= 0x20;
+ void mark_executed_table_admin_cmd()
+ {
+ DBUG_PRINT("debug", ("mark_executed_table_admin_cmd"));
+ m_unsafe_rollback_flags|= EXECUTED_TABLE_ADMIN_CMD;
+ }
+ bool trans_executed_admin_cmd()
+ {
+ return (m_unsafe_rollback_flags & EXECUTED_TABLE_ADMIN_CMD) != 0;
+ }
void mark_created_temp_table()
{
DBUG_PRINT("debug", ("mark_created_temp_table"));
@@ -3353,8 +3365,6 @@ public:
/* end of the list of admin commands */
virtual int indexes_are_disabled(void) {return 0;}
- virtual char *update_table_comment(const char * comment)
- { return (char*) comment;}
virtual void append_create_info(String *packet) {}
/**
If index == MAX_KEY then a check for table is made and if index <
diff --git a/sql/item.cc b/sql/item.cc
index 45f40874ddb..3ff0219c3b3 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -61,11 +61,12 @@ bool cmp_items(Item *a, Item *b)
/**
Set max_sum_func_level if it is needed
*/
-inline void set_max_sum_func_level(THD *thd, SELECT_LEX *select)
+inline void set_max_sum_func_level(SELECT_LEX *select)
{
- if (thd->lex->in_sum_func &&
- thd->lex->in_sum_func->nest_level >= select->nest_level)
- set_if_bigger(thd->lex->in_sum_func->max_sum_func_level,
+ LEX *lex_s= select->parent_lex;
+ if (lex_s->in_sum_func &&
+ lex_s->in_sum_func->nest_level >= select->nest_level)
+ set_if_bigger(lex_s->in_sum_func->max_sum_func_level,
select->nest_level - 1);
}
@@ -780,6 +781,7 @@ Item_ident::Item_ident(THD *thd, Name_resolution_context *context_arg,
{
name = (char*) field_name_arg;
name_length= name ? strlen(name) : 0;
+ DBUG_ASSERT(!context || context->select_lex);
}
@@ -794,6 +796,7 @@ Item_ident::Item_ident(THD *thd, TABLE_LIST *view_arg, const char *field_name_ar
{
name = (char*) field_name_arg;
name_length= name ? strlen(name) : 0;
+ DBUG_ASSERT(!context || context->select_lex);
}
@@ -815,7 +818,9 @@ Item_ident::Item_ident(THD *thd, Item_ident *item)
cached_table(item->cached_table),
depended_from(item->depended_from),
can_be_depended(item->can_be_depended)
-{}
+{
+ DBUG_ASSERT(!context || context->select_lex);
+}
void Item_ident::cleanup()
{
@@ -3333,8 +3338,48 @@ void Item_string::print(String *str, enum_query_type query_type)
}
else
{
- // Caller wants a result in the charset of str_value.
- str_value.print(str);
+ /*
+ We're restoring a parse-able statement from an Item tree.
+ Make sure to revert character set conversions that previously
+ happened in the parser when Item_string was created.
+ */
+ if (print_introducer)
+ {
+ /*
+ Print the string as is, without conversion:
+ Strings with introducers are not converted in the parser.
+ */
+ str_value.print(str);
+ }
+ else
+ {
+ /*
+ Print the string with conversion.
+ Strings without introducers are converted in the parser,
+ from character_set_client to character_set_connection.
+
+ When restoring a CREATE VIEW statement,
+ - str_value.charsets() contains parse time character_set_connection
+ - str->charset() contains parse time character_set_client
+ So we convert the string back from parse-time character_set_connection
+ to parse time character_set_client.
+
+ In some cases, e.g. SHOW PROCEDURE CODE, it's also possible
+ that str->charset() is "utf8mb3" instead of parse time
+ character_set_client. In these cases we convert
+ here from the parse-time character_set_connection to utf8mb3.
+
+ QQ: perhaps the code behind SHOW PROCEDURE CODE should
+ also request the result in the parse-time character_set_client
+ (like the code restoring CREATE VIEW statements does),
+ rather than in utf8mb3:
+ - utf8mb3 does not work well with non-BMP characters (e.g. emoji).
+ - Simply changing utf8mb3 to utf8mb4 will not fully help:
+ some character sets have unassigned characters,
+ they get lost during during cs->utf8mb4->cs round trip.
+ */
+ str_value.print_with_conversion(str, str->charset());
+ }
}
str->append('\'');
@@ -4668,13 +4713,19 @@ bool Item_ref_null_helper::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
@param resolved_item item which was resolved in outer SELECT(for warning)
@param mark_item item which should be marked (can be differ in case of
substitution)
+ @param suppress_warning_output flag specifying whether to suppress output of
+ a warning message
*/
static bool mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current,
Item_ident *resolved_item,
- Item_ident *mark_item)
+ Item_ident *mark_item,
+ bool suppress_warning_output)
{
DBUG_ENTER("mark_as_dependent");
+ DBUG_PRINT("info", ("current select: %d (%p) last: %d (%p)",
+ current->select_number, current,
+ (last ? last->select_number : 0), last));
/* store pointer on SELECT_LEX from which item is dependent */
if (mark_item && mark_item->can_be_depended)
@@ -4685,7 +4736,7 @@ static bool mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current,
if (current->mark_as_dependent(thd, last,
/** resolved_item psergey-thu **/ mark_item))
DBUG_RETURN(TRUE);
- if (thd->lex->describe & DESCRIBE_EXTENDED)
+ if ((thd->lex->describe & DESCRIBE_EXTENDED) && !suppress_warning_output)
{
const char *db_name= (resolved_item->db_name ?
resolved_item->db_name : "");
@@ -4714,6 +4765,8 @@ static bool mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current,
@param found_item Item which was found during resolving (if resolved
identifier belongs to VIEW)
@param resolved_item Identifier which was resolved
+ @param suppress_warning_output flag specifying whether to suppress output of
+ a warning message
@note
We have to mark all items between current_sel (including) and
@@ -4727,7 +4780,8 @@ void mark_select_range_as_dependent(THD *thd,
SELECT_LEX *last_select,
SELECT_LEX *current_sel,
Field *found_field, Item *found_item,
- Item_ident *resolved_item)
+ Item_ident *resolved_item,
+ bool suppress_warning_output)
{
/*
Go from current SELECT to SELECT where field was resolved (it
@@ -4762,7 +4816,7 @@ void mark_select_range_as_dependent(THD *thd,
found_field->table->map;
prev_subselect_item->const_item_cache= 0;
mark_as_dependent(thd, last_select, current_sel, resolved_item,
- dependent);
+ dependent, suppress_warning_output);
}
}
@@ -5108,7 +5162,14 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
*/
Name_resolution_context *last_checked_context= context;
Item **ref= (Item **) not_found_item;
- SELECT_LEX *current_sel= thd->lex->current_select;
+ /*
+ There are cases when name resolution context is absent (when we are not
+ doing name resolution), but here the name resolution context should
+ be present because we are doing name resolution
+ */
+ DBUG_ASSERT(context);
+ SELECT_LEX *current_sel= context->select_lex;
+ LEX *lex_s= context->select_lex->parent_lex;
Name_resolution_context *outer_context= 0;
SELECT_LEX *select= 0;
/* Currently derived tables cannot be correlated */
@@ -5209,18 +5270,18 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
return -1;
thd->change_item_tree(reference, rf);
select->inner_refs_list.push_back(rf, thd->mem_root);
- rf->in_sum_func= thd->lex->in_sum_func;
+ rf->in_sum_func= lex_s->in_sum_func;
}
/*
A reference is resolved to a nest level that's outer or the same as
the nest level of the enclosing set function : adjust the value of
max_arg_level for the function if it's needed.
*/
- if (thd->lex->in_sum_func &&
- thd->lex->in_sum_func->nest_level >= select->nest_level)
+ if (lex_s->in_sum_func &&
+ lex_s->in_sum_func->nest_level >= select->nest_level)
{
Item::Type ref_type= (*reference)->type();
- set_if_bigger(thd->lex->in_sum_func->max_arg_level,
+ set_if_bigger(lex_s->in_sum_func->max_arg_level,
select->nest_level);
set_field(*from_field);
fixed= 1;
@@ -5228,7 +5289,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
context->select_lex, this,
((ref_type == REF_ITEM ||
ref_type == FIELD_ITEM) ?
- (Item_ident*) (*reference) : 0));
+ (Item_ident*) (*reference) : 0), false);
return 0;
}
}
@@ -5240,11 +5301,11 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
context->select_lex, this,
((ref_type == REF_ITEM || ref_type == FIELD_ITEM) ?
(Item_ident*) (*reference) :
- 0));
- if (thd->lex->in_sum_func &&
- thd->lex->in_sum_func->nest_level >= select->nest_level)
+ 0), false);
+ if (lex_s->in_sum_func &&
+ lex_s->in_sum_func->nest_level >= select->nest_level)
{
- set_if_bigger(thd->lex->in_sum_func->max_arg_level,
+ set_if_bigger(lex_s->in_sum_func->max_arg_level,
select->nest_level);
}
/*
@@ -5336,7 +5397,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
{
outer_context->select_lex->inner_refs_list.push_back((Item_outer_ref*)rf,
thd->mem_root);
- ((Item_outer_ref*)rf)->in_sum_func= thd->lex->in_sum_func;
+ ((Item_outer_ref*)rf)->in_sum_func= lex_s->in_sum_func;
}
thd->change_item_tree(reference, rf);
/*
@@ -5351,10 +5412,10 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
We can not "move" aggregate function in the place where
its arguments are not defined.
*/
- set_max_sum_func_level(thd, select);
+ set_max_sum_func_level(select);
mark_as_dependent(thd, last_checked_context->select_lex,
context->select_lex, rf,
- rf);
+ rf, false);
return 0;
}
@@ -5364,10 +5425,10 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
We can not "move" aggregate function in the place where
its arguments are not defined.
*/
- set_max_sum_func_level(thd, select);
+ set_max_sum_func_level(select);
mark_as_dependent(thd, last_checked_context->select_lex,
context->select_lex,
- this, (Item_ident*)*reference);
+ this, (Item_ident*)*reference, false);
if (last_checked_context->select_lex->having_fix_field)
{
Item_ref *rf;
@@ -5441,7 +5502,20 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
DBUG_ASSERT(fixed == 0);
Field *from_field= (Field *)not_found_field;
bool outer_fixed= false;
- SELECT_LEX *select= thd->lex->current_select;
+ SELECT_LEX *select;
+ LEX *lex_s;
+ if (context)
+ {
+ select= context->select_lex;
+ lex_s= context->select_lex->parent_lex;
+ }
+ else
+ {
+ // No real name resolution, used somewhere in SP
+ DBUG_ASSERT(field);
+ select= NULL;
+ lex_s= NULL;
+ }
if (!field) // If field is not checked
{
@@ -5502,8 +5576,9 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
We can not "move" aggregate function in the place where
its arguments are not defined.
*/
- set_max_sum_func_level(thd, select);
+ set_max_sum_func_level(select);
set_field(new_field);
+ depended_from= (*((Item_field**)res))->depended_from;
return 0;
}
else
@@ -5530,7 +5605,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
We can not "move" aggregate function in the place where
its arguments are not defined.
*/
- set_max_sum_func_level(thd, select);
+ set_max_sum_func_level(select);
return FALSE;
}
}
@@ -5567,10 +5642,11 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
goto mark_non_agg_field;
}
- if (thd->lex->in_sum_func &&
- thd->lex->in_sum_func->nest_level ==
+ if (lex_s &&
+ lex_s->in_sum_func &&
+ lex_s->in_sum_func->nest_level ==
select->nest_level)
- set_if_bigger(thd->lex->in_sum_func->max_arg_level,
+ set_if_bigger(lex_s->in_sum_func->max_arg_level,
select->nest_level);
/*
if it is not expression from merged VIEW we will set this field.
@@ -5636,8 +5712,9 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
if (field->vcol_info)
fix_session_vcol_expr_for_read(thd, field, field->vcol_info);
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY &&
- !outer_fixed && !thd->lex->in_sum_func &&
+ !outer_fixed &&
select &&
+ !lex_s->in_sum_func &&
select->cur_pos_in_select_list != UNDEF_POS &&
select->join)
{
@@ -5672,13 +5749,13 @@ mark_non_agg_field:
*/
select_lex= context->select_lex;
}
- if (!thd->lex->in_sum_func)
+ if (!lex_s || !lex_s->in_sum_func)
select_lex->set_non_agg_field_used(true);
else
{
if (outer_fixed)
- thd->lex->in_sum_func->outer_fields.push_back(this, thd->mem_root);
- else if (thd->lex->in_sum_func->nest_level !=
+ lex_s->in_sum_func->outer_fields.push_back(this, thd->mem_root);
+ else if (lex_s->in_sum_func->nest_level !=
select->nest_level)
select_lex->set_non_agg_field_used(true);
}
@@ -7171,6 +7248,12 @@ Item *get_field_item_for_having(THD *thd, Item *item, st_select_lex *sel)
return NULL;
}
+Item *Item_ident::derived_field_transformer_for_having(THD *thd, uchar *arg)
+{
+ st_select_lex *sel= (st_select_lex *)arg;
+ context= &sel->context;
+ return this;
+}
Item *Item_field::derived_field_transformer_for_having(THD *thd, uchar *arg)
{
@@ -7190,12 +7273,13 @@ Item *Item_field::derived_field_transformer_for_having(THD *thd, uchar *arg)
Item *Item_direct_view_ref::derived_field_transformer_for_having(THD *thd,
uchar *arg)
{
+ st_select_lex *sel= (st_select_lex *)arg;
+ context= &sel->context;
if ((*ref)->marker & SUBSTITUTION_FL)
{
this->marker|= SUBSTITUTION_FL;
return this;
}
- st_select_lex *sel= (st_select_lex *)arg;
table_map tab_map= sel->master_unit()->derived->table->map;
if ((item_equal && !(item_equal->used_tables() & tab_map)) ||
!item_equal)
@@ -7401,7 +7485,7 @@ public:
if (tbl->table == item->field->table)
{
if (sel != current_select)
- mark_as_dependent(thd, sel, current_select, item, item);
+ mark_as_dependent(thd, sel, current_select, item, item, false);
return;
}
}
@@ -7491,7 +7575,9 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
{
enum_parsing_place place= NO_MATTER;
DBUG_ASSERT(fixed == 0);
- SELECT_LEX *current_sel= thd->lex->current_select;
+
+ SELECT_LEX *current_sel= context->select_lex;
+ LEX *lex_s= context->select_lex->parent_lex;
if (set_properties_only)
{
@@ -7596,7 +7682,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
((refer_type == REF_ITEM ||
refer_type == FIELD_ITEM) ?
(Item_ident*) (*reference) :
- 0));
+ 0), false);
/*
view reference found, we substituted it instead of this
Item, so can quit
@@ -7646,16 +7732,16 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
goto error;
thd->change_item_tree(reference, fld);
mark_as_dependent(thd, last_checked_context->select_lex,
- current_sel, fld, fld);
+ current_sel, fld, fld, false);
/*
A reference is resolved to a nest level that's outer or the same as
the nest level of the enclosing set function : adjust the value of
max_arg_level for the function if it's needed.
*/
- if (thd->lex->in_sum_func &&
- thd->lex->in_sum_func->nest_level >=
+ if (lex_s->in_sum_func &&
+ lex_s->in_sum_func->nest_level >=
last_checked_context->select_lex->nest_level)
- set_if_bigger(thd->lex->in_sum_func->max_arg_level,
+ set_if_bigger(lex_s->in_sum_func->max_arg_level,
last_checked_context->select_lex->nest_level);
return FALSE;
}
@@ -7669,16 +7755,16 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
/* Should be checked in resolve_ref_in_select_and_group(). */
DBUG_ASSERT(*ref && (*ref)->fixed);
mark_as_dependent(thd, last_checked_context->select_lex,
- context->select_lex, this, this);
+ context->select_lex, this, this, false);
/*
A reference is resolved to a nest level that's outer or the same as
the nest level of the enclosing set function : adjust the value of
max_arg_level for the function if it's needed.
*/
- if (thd->lex->in_sum_func &&
- thd->lex->in_sum_func->nest_level >=
+ if (lex_s->in_sum_func &&
+ lex_s->in_sum_func->nest_level >=
last_checked_context->select_lex->nest_level)
- set_if_bigger(thd->lex->in_sum_func->max_arg_level,
+ set_if_bigger(lex_s->in_sum_func->max_arg_level,
last_checked_context->select_lex->nest_level);
}
}
@@ -8193,6 +8279,7 @@ Item_cache_wrapper::Item_cache_wrapper(THD *thd, Item *item_arg):
name= item_arg->name;
name_length= item_arg->name_length;
with_subselect= orig_item->with_subselect;
+ with_window_func= orig_item->with_window_func;
if ((expr_value= Item_cache::get_cache(thd, orig_item)))
expr_value->setup(thd, orig_item);
@@ -8992,6 +9079,12 @@ error:
return TRUE;
}
+bool Item_default_value::enchant_default_with_arg_processor(void *proc_arg)
+{
+ if (!arg) arg= (Item *)proc_arg;
+ return 0;
+}
+
void Item_default_value::cleanup()
{
delete cached_field; // Free cached blob data
diff --git a/sql/item.h b/sql/item.h
index cb1e8519b27..35700129243 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1713,12 +1713,22 @@ public:
virtual bool limit_index_condition_pushdown_processor(void *arg) { return 0; }
virtual bool exists2in_processor(void *arg) { return 0; }
virtual bool find_selective_predicates_list_processor(void *arg) { return 0; }
+ virtual bool enchant_default_with_arg_processor(void *arg) { return 0; }
bool cleanup_is_expensive_cache_processor(void *arg)
{
is_expensive_cache= (int8)(-1);
return 0;
}
+ /**
+ Check db/table_name if they defined in item and match arg values
+
+ @param arg Pointer to Check_table_name_prm structure
+
+ @retval true Match failed
+ @retval false Match succeeded
+ */
+ virtual bool check_table_name_processor(void *arg) { return false; }
/*
TRUE if the expression depends only on the table indicated by tab_map
or can be converted to such an exression using equalities.
@@ -1850,6 +1860,15 @@ public:
bool collect;
};
+ struct Check_table_name_prm
+ {
+ LEX_CSTRING db;
+ LEX_CSTRING table_name;
+ String field;
+ Check_table_name_prm(LEX_CSTRING _db, LEX_CSTRING _table_name) :
+ db(_db), table_name(_table_name) {}
+ };
+
/*
For SP local variable returns pointer to Item representing its
current value and pointer to current Item otherwise.
@@ -2611,6 +2630,7 @@ public:
Collect outer references
*/
virtual bool collect_outer_ref_processor(void *arg);
+ Item *derived_field_transformer_for_having(THD *thd, uchar *arg);
friend bool insert_fields(THD *thd, Name_resolution_context *context,
const char *db_name,
const char *table_name, List_iterator<Item> *it,
@@ -2820,6 +2840,24 @@ public:
}
return mark_unsupported_function(field_name, arg, VCOL_FIELD_REF);
}
+ bool check_table_name_processor(void *arg)
+ {
+ Check_table_name_prm &p= *(Check_table_name_prm *) arg;
+ if (!field && p.table_name.length && table_name)
+ {
+ DBUG_ASSERT(p.db.length);
+ if ((db_name &&
+ my_strcasecmp(table_alias_charset, p.db.str, db_name)) ||
+ my_strcasecmp(table_alias_charset, p.table_name.str, table_name))
+ {
+ print(&p.field, (enum_query_type) (QT_ITEM_ORIGINAL_FUNC_NULLIF |
+ QT_NO_DATA_EXPANSION |
+ QT_TO_SYSTEM_CHARSET));
+ return true;
+ }
+ }
+ return false;
+ }
void cleanup();
Item_equal *get_item_equal() { return item_equal; }
void set_item_equal(Item_equal *item_eq) { item_equal= item_eq; }
@@ -4916,7 +4954,10 @@ public:
table_map used_tables() const;
void update_used_tables();
table_map not_null_tables() const;
- bool const_item() const { return used_tables() == 0; }
+ bool const_item() const
+ {
+ return (*ref)->const_item() && (null_ref_table == NO_NULL_TABLE);
+ }
TABLE *get_null_ref_table() const { return null_ref_table; }
bool walk(Item_processor processor, bool walk_subquery, void *arg)
{
@@ -5410,6 +5451,11 @@ public:
class Item_default_value : public Item_field
{
void calculate();
+protected:
+ Item_default_value(THD *thd, Name_resolution_context *context_arg, Item *a)
+ :Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
+ (const char *)NULL),
+ arg(a), cached_field(NULL) {}
public:
Item *arg;
Field *cached_field;
@@ -5417,16 +5463,12 @@ public:
:Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
(const char *)NULL),
arg(NULL), cached_field(NULL) {}
- Item_default_value(THD *thd, Name_resolution_context *context_arg, Item *a)
- :Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
- (const char *)NULL),
- arg(a), cached_field(NULL) {}
Item_default_value(THD *thd, Name_resolution_context *context_arg, Field *a)
:Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL,
(const char *)NULL),
arg(NULL),cached_field(NULL) {}
enum Type type() const { return DEFAULT_VALUE_ITEM; }
- bool vcol_assignment_allowed_value() const { return arg == NULL; }
+ bool vcol_assignment_allowed_value() const { return true; }
bool eq(const Item *item, bool binary_cmp) const;
bool fix_fields(THD *, Item **);
void cleanup();
@@ -5456,6 +5498,7 @@ public:
Item_field *field_for_view_update() { return 0; }
bool update_vcol_processor(void *arg) { return 0; }
bool check_func_default_processor(void *arg) { return true; }
+ bool enchant_default_with_arg_processor(void *arg);
bool walk(Item_processor processor, bool walk_subquery, void *args)
{
@@ -5466,6 +5509,15 @@ public:
Item *transform(THD *thd, Item_transformer transformer, uchar *args);
};
+class Item_default_value_arg: public Item_default_value
+{
+public:
+ Item_default_value_arg(THD *thd, Name_resolution_context *context, Item *a)
+ :Item_default_value(thd, context, a) {}
+
+ bool vcol_assignment_allowed_value() const { return arg == NULL; }
+};
+
/**
This class is used as bulk parameter INGNORE representation.
@@ -6088,7 +6140,8 @@ void mark_select_range_as_dependent(THD *thd,
st_select_lex *last_select,
st_select_lex *current_sel,
Field *found_field, Item *found_item,
- Item_ident *resolved_item);
+ Item_ident *resolved_item,
+ bool suppress_warning_output);
extern Cached_item *new_Cached_item(THD *thd, Item *item,
bool pass_through_ref);
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 7b7604053e3..8a2c532f621 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1416,6 +1416,9 @@ bool Item_in_optimizer::fix_fields(THD *thd, Item **ref)
maybe_null=1;
with_subselect= 1;
with_sum_func= with_sum_func || args[1]->with_sum_func;
+ with_window_func= args[0]->with_window_func;
+ // The subquery cannot have window functions aggregated in this select
+ DBUG_ASSERT(!args[1]->with_window_func);
with_field= with_field || args[1]->with_field;
with_param= args[0]->with_param || args[1]->with_param;
used_tables_and_const_cache_join(args[1]);
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 4bfb2615fbe..a3c51d1949e 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -6745,13 +6745,6 @@ Create_func_year_week::create_native(THD *thd, LEX_STRING name,
return func;
}
-
-struct Native_func_registry
-{
- LEX_STRING name;
- Create_func *builder;
-};
-
#define BUILDER(F) & F::s_singleton
#ifdef HAVE_SPATIAL
@@ -6771,7 +6764,7 @@ struct Native_func_registry
- keep 1 line per entry, it makes grep | sort easier
*/
-static Native_func_registry func_array[] =
+Native_func_registry func_array[] =
{
{ { C_STRING_WITH_LEN("ABS") }, BUILDER(Create_func_abs)},
{ { C_STRING_WITH_LEN("ACOS") }, BUILDER(Create_func_acos)},
@@ -7113,6 +7106,8 @@ static Native_func_registry func_array[] =
{ {0, 0}, NULL}
};
+size_t func_array_length= sizeof(func_array) / sizeof(Native_func_registry) - 1;
+
static HASH native_functions_hash;
extern "C" uchar*
diff --git a/sql/item_create.h b/sql/item_create.h
index 97dc594b11c..3ce731e2d69 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -183,6 +183,12 @@ Item *create_temporal_literal(THD *thd, const String *str,
type, send_error);
}
+struct Native_func_registry
+{
+ LEX_STRING name;
+ Create_func *builder;
+};
+
int item_create_init();
void item_create_cleanup();
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 7b39b7710fb..6b8025c9d0f 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2756,7 +2756,6 @@ bool Item_func_min_max::fix_length_and_dec()
max_length=0;
maybe_null=0;
Item_result tmp_cmp_type= args[0]->cmp_type();
- uint string_type_count= 0;
uint temporal_type_count= 0;
enum_field_types temporal_field_type= MYSQL_TYPE_DATETIME;
@@ -2769,7 +2768,6 @@ bool Item_func_min_max::fix_length_and_dec()
if (args[i]->maybe_null)
maybe_null= 1;
tmp_cmp_type= item_cmp_type(tmp_cmp_type, args[i]->cmp_type());
- string_type_count+= args[i]->cmp_type() == STRING_RESULT;
if (args[i]->cmp_type() == TIME_RESULT)
{
if (!temporal_type_count)
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index 7db1ae1ffaf..ea70fbeebdb 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -3534,6 +3534,7 @@ const char *Item_func_json_format::func_name() const
bool Item_func_json_format::fix_length_and_dec()
{
decimals= 0;
+ collation.set(args[0]->collation);
max_length= args[0]->max_length;
maybe_null= 1;
return FALSE;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index f5a8a649ac2..e5935178f10 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -338,6 +338,8 @@ String *Item_aes_crypt::val_str(String *str2)
rkey, AES_KEY_LENGTH / 8, 0, 0))
{
str2->length((uint) aes_length);
+ DBUG_ASSERT(collation.collation == &my_charset_bin);
+ str2->set_charset(&my_charset_bin);
return str2;
}
}
@@ -479,7 +481,7 @@ err:
const char *histogram_types[] =
{"SINGLE_PREC_HB", "DOUBLE_PREC_HB", 0};
-static TYPELIB hystorgam_types_typelib=
+static TYPELIB histogram_types_typelib=
{ array_elements(histogram_types),
"histogram_types",
histogram_types, NULL};
@@ -495,7 +497,7 @@ String *Item_func_decode_histogram::val_str(String *str)
tmp.length(0);
if (!(res= args[0]->val_str(&tmp)) ||
(type= find_type(res->c_ptr_safe(),
- &hystorgam_types_typelib, MYF(0))) <= 0)
+ &histogram_types_typelib, MYF(0))) <= 0)
{
null_value= 1;
return 0;
@@ -580,7 +582,7 @@ bool Item_func_concat::realloc_result(String *str, uint length) const
as str was initially set by args[0]->val_str(str).
So multiplication by 2 can overflow, if args[0] for some reasons
did not limit the result to max_alloced_packet. But it's not harmful,
- "str" will be realloced exactly to "length" bytes in case of overflow.
+ "str" will be reallocated exactly to "length" bytes in case of overflow.
*/
uint new_length= MY_MAX(str->alloced_length() * 2, length);
return str->realloc(new_length);
@@ -1456,7 +1458,7 @@ String *Item_func_insert::val_str(String *str)
length= res->length();
/*
- There is one exception not handled (intentionaly) by the character set
+ There is one exception not handled (intentionally) by the character set
aggregation code. If one string is strong side and is binary, and
another one is weak side and is a multi-byte character string,
then we need to operate on the second string in terms on bytes when
@@ -3204,7 +3206,7 @@ String *Item_func_rpad::val_str(String *str)
if ((ulonglong) count > INT_MAX32)
count= INT_MAX32;
/*
- There is one exception not handled (intentionaly) by the character set
+ There is one exception not handled (intentionally) by the character set
aggregation code. If one string is strong side and is binary, and
another one is weak side and is a multi-byte character string,
then we need to operate on the second string in terms on bytes when
@@ -3286,7 +3288,7 @@ String *Item_func_lpad::val_str(String *str)
count= INT_MAX32;
/*
- There is one exception not handled (intentionaly) by the character set
+ There is one exception not handled (intentionally) by the character set
aggregation code. If one string is strong side and is binary, and
another one is weak side and is a multi-byte character string,
then we need to operate on the second string in terms on bytes when
@@ -4131,7 +4133,7 @@ longlong Item_func_uncompressed_length::val_int()
5 bytes long.
res->c_ptr() is not used because:
- we do not need \0 terminated string to get first 4 bytes
- - c_ptr() tests simbol after string end (uninitialiozed memory) which
+ - c_ptr() tests simbol after string end (uninitialized memory) which
confuse valgrind
*/
return uint4korr(res->ptr()) & 0x3FFFFFFF;
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 4b8f118ca43..3f9a760ce09 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -664,6 +664,31 @@ bool Item_subselect::is_expensive()
}
+static
+int walk_items_for_table_list(Item_processor processor,
+ bool walk_subquery, void *argument,
+ List<TABLE_LIST>& join_list)
+{
+ List_iterator<TABLE_LIST> li(join_list);
+ int res;
+ while (TABLE_LIST *table= li++)
+ {
+ if (table->on_expr)
+ {
+ if ((res= table->on_expr->walk(processor, walk_subquery, argument)))
+ return res;
+ }
+ if (table->nested_join)
+ {
+ if ((res= walk_items_for_table_list(processor, walk_subquery, argument,
+ table->nested_join->join_list)))
+ return res;
+ }
+ }
+ return 0;
+}
+
+
bool Item_subselect::walk(Item_processor processor, bool walk_subquery,
void *argument)
{
@@ -695,7 +720,10 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery,
if (lex->having && (lex->having)->walk(processor, walk_subquery,
argument))
return 1;
- /* TODO: why does this walk WHERE/HAVING but not ON expressions of outer joins? */
+
+ if (walk_items_for_table_list(processor, walk_subquery, argument,
+ *lex->join_list))
+ return 1;
while ((item=li++))
{
@@ -1746,7 +1774,6 @@ double Item_in_subselect::val_real()
As far as Item_in_subselect called only from Item_in_optimizer this
method should not be used
*/
- DBUG_ASSERT(0);
DBUG_ASSERT(fixed == 1);
if (forced_const)
return value;
@@ -2221,7 +2248,8 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
*/
Item *item= (Item*) select_lex->item_list.head();
- if (select_lex->table_list.elements)
+ if (select_lex->table_list.elements ||
+ !(select_lex->master_unit()->is_union()))
{
Item *having= item;
Item *orig_item= item;
@@ -2269,31 +2297,28 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
}
else
{
- if (select_lex->master_unit()->is_union())
+ DBUG_ASSERT(select_lex->master_unit()->is_union());
+
+ Item *new_having=
+ func->create(thd, expr,
+ new (thd->mem_root) Item_ref_null_helper(thd,
+ &select_lex->context,
+ this,
+ &select_lex->ref_pointer_array[0],
+ (char *)"<no matter>",
+ (char *)"<result>"));
+ if (!abort_on_null && left_expr->maybe_null)
{
- Item *new_having=
- func->create(thd, expr,
- new (thd->mem_root) Item_ref_null_helper(thd,
- &select_lex->context,
- this,
- &select_lex->ref_pointer_array[0],
- (char *)"<no matter>",
- (char *)"<result>"));
- if (!abort_on_null && left_expr->maybe_null)
- {
- disable_cond_guard_for_const_null_left_expr(0);
- if (!(new_having= new (thd->mem_root) Item_func_trig_cond(thd, new_having,
- get_cond_guard(0))))
- DBUG_RETURN(true);
- }
-
- new_having->name= (char*) in_having_cond;
- if (fix_having(new_having, select_lex))
+ disable_cond_guard_for_const_null_left_expr(0);
+ if (!(new_having= new (thd->mem_root) Item_func_trig_cond(thd, new_having,
+ get_cond_guard(0))))
DBUG_RETURN(true);
- *having_item= new_having;
}
- else
- DBUG_ASSERT(false);
+
+ new_having->name= (char*) in_having_cond;
+ if (fix_having(new_having, select_lex))
+ DBUG_RETURN(true);
+ *having_item= new_having;
}
}
@@ -5165,8 +5190,9 @@ bool subselect_hash_sj_engine::make_semi_join_conds()
NULL, TL_READ);
tmp_table_ref->table= tmp_table;
- context= new Name_resolution_context;
+ context= new (thd->mem_root) Name_resolution_context;
context->init();
+ context->select_lex= item_in->unit->first_select();
context->first_name_resolution_table=
context->last_name_resolution_table= tmp_table_ref;
semi_join_conds_context= context;
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 130f90839e3..7b2078939f1 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -283,7 +283,8 @@ public:
friend bool Item_ref::fix_fields(THD *, Item **);
friend void mark_select_range_as_dependent(THD*,
st_select_lex*, st_select_lex*,
- Field*, Item*, Item_ident*);
+ Field*, Item*, Item_ident*,
+ bool);
friend bool convert_join_subqueries_to_semijoins(JOIN *join);
};
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index dd65f04a652..f20be3b5226 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -68,6 +68,7 @@ size_t Item_sum::ram_limitation(THD *thd)
bool Item_sum::init_sum_func_check(THD *thd)
{
SELECT_LEX *curr_sel= thd->lex->current_select;
+ LEX *lex_s= (curr_sel ? curr_sel->parent_lex : thd->lex);
if (curr_sel && !curr_sel->name_visibility_map)
{
for (SELECT_LEX *sl= curr_sel; sl; sl= sl->context.outer_select())
@@ -82,9 +83,9 @@ bool Item_sum::init_sum_func_check(THD *thd)
return TRUE;
}
/* Set a reference to the nesting set function if there is any */
- in_sum_func= thd->lex->in_sum_func;
+ in_sum_func= lex_s->in_sum_func;
/* Save a pointer to object to be used in items for nested set functions */
- thd->lex->in_sum_func= this;
+ lex_s->in_sum_func= this;
nest_level= thd->lex->current_select->nest_level;
ref_by= 0;
aggr_level= -1;
@@ -151,6 +152,7 @@ bool Item_sum::init_sum_func_check(THD *thd)
bool Item_sum::check_sum_func(THD *thd, Item **ref)
{
SELECT_LEX *curr_sel= thd->lex->current_select;
+ LEX *lex_s= curr_sel->parent_lex;
nesting_map allow_sum_func= (thd->lex->allow_sum_func &
curr_sel->name_visibility_map);
bool invalid= FALSE;
@@ -310,7 +312,7 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref)
}
aggr_sel->set_agg_func_used(true);
update_used_tables();
- thd->lex->in_sum_func= in_sum_func;
+ lex_s->in_sum_func= in_sum_func;
return FALSE;
}
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index a40c2e18b91..fd5ab057b8b 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2832,7 +2832,6 @@ bool Item_func_timediff::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
DBUG_ASSERT(fixed == 1);
int l_sign= 1;
MYSQL_TIME l_time1,l_time2,l_time3;
- ErrConvTime str(&l_time3);
/* the following may be true in, for example, date_add(timediff(...), ... */
if (fuzzy_date & TIME_NO_ZERO_IN_DATE)
diff --git a/sql/key.cc b/sql/key.cc
index 689b1e9c886..d0da75ae61b 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -465,7 +465,7 @@ void key_unpack(String *to, TABLE *table, KEY *key)
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields)
{
- table->mark_columns_used_by_index(idx, &table->tmp_set);
+ table->mark_index_columns(idx, &table->tmp_set);
return bitmap_is_overlapping(&table->tmp_set, fields);
}
diff --git a/sql/lex.h b/sql/lex.h
index ca7c6635329..c0cb9adc236 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -45,7 +45,7 @@ SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"};
lists
*/
-static SYMBOL symbols[] = {
+SYMBOL symbols[] = {
{ "&&", SYM(AND_AND_SYM)},
{ "<=", SYM(LE)},
{ "<>", SYM(NE)},
@@ -687,7 +687,7 @@ static SYMBOL symbols[] = {
};
-static SYMBOL sql_functions[] = {
+SYMBOL sql_functions[] = {
{ "ADDDATE", SYM(ADDDATE_SYM)},
{ "BIT_AND", SYM(BIT_AND)},
{ "BIT_OR", SYM(BIT_OR)},
@@ -732,4 +732,7 @@ static SYMBOL sql_functions[] = {
{ "VAR_SAMP", SYM(VAR_SAMP_SYM)},
};
+size_t symbols_length= sizeof(symbols) / sizeof(SYMBOL);
+size_t sql_functions_length= sizeof(sql_functions) / sizeof(SYMBOL);
+
#endif /* LEX_INCLUDED */
diff --git a/sql/log.cc b/sql/log.cc
index dc8df9c6fdb..1d9b4645421 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -6851,6 +6851,9 @@ int MYSQL_BIN_LOG::rotate_and_purge(bool force_rotate,
bool check_purge= false;
mysql_mutex_lock(&LOCK_log);
+
+ DEBUG_SYNC(current_thd, "rotate_after_acquire_LOCK_log");
+
prev_binlog_id= current_binlog_id;
if ((err_gtid= do_delete_gtid_domain(domain_drop_lex)))
@@ -6861,11 +6864,22 @@ int MYSQL_BIN_LOG::rotate_and_purge(bool force_rotate,
}
else if ((error= rotate(force_rotate, &check_purge)))
check_purge= false;
+
+ DEBUG_SYNC(current_thd, "rotate_after_rotate");
+
/*
NOTE: Run purge_logs wo/ holding LOCK_log because it does not need
the mutex. Otherwise causes various deadlocks.
+ Explicit binlog rotation must be synchronized with a concurrent
+ binlog ordered commit, in particular not let binlog
+ checkpoint notification request until early binlogged
+ concurrent commits have has been completed.
*/
+ mysql_mutex_lock(&LOCK_after_binlog_sync);
mysql_mutex_unlock(&LOCK_log);
+ mysql_mutex_lock(&LOCK_commit_ordered);
+ mysql_mutex_unlock(&LOCK_after_binlog_sync);
+ mysql_mutex_unlock(&LOCK_commit_ordered);
if (check_purge)
checkpoint_and_purge(prev_binlog_id);
@@ -8014,7 +8028,12 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
}
DEBUG_SYNC(leader->thd, "commit_before_get_LOCK_commit_ordered");
+
mysql_mutex_lock(&LOCK_commit_ordered);
+ DBUG_EXECUTE_IF("crash_before_engine_commit",
+ {
+ DBUG_SUICIDE();
+ });
last_commit_pos_offset= commit_offset;
/*
diff --git a/sql/log.h b/sql/log.h
index 0770861fe01..6896a4ff550 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -896,6 +896,20 @@ public:
void unlock_binlog_end_pos() { mysql_mutex_unlock(&LOCK_binlog_end_pos); }
mysql_mutex_t* get_binlog_end_pos_lock() { return &LOCK_binlog_end_pos; }
+ /*
+ Ensures the log's state is either LOG_OPEN or LOG_CLOSED. If something
+ failed along the desired path and left the log in invalid state, i.e.
+ LOG_TO_BE_OPENED, forces the state to be LOG_CLOSED.
+ */
+ void try_fix_log_state()
+ {
+ mysql_mutex_lock(get_log_lock());
+ /* Only change the log state if it is LOG_TO_BE_OPENED */
+ if (log_state == LOG_TO_BE_OPENED)
+ log_state= LOG_CLOSED;
+ mysql_mutex_unlock(get_log_lock());
+ }
+
int wait_for_update_binlog_end_pos(THD* thd, struct timespec * timeout);
/*
diff --git a/sql/log_event.cc b/sql/log_event.cc
index c32f31db1f6..9108b57fec1 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -7561,8 +7561,10 @@ Gtid_log_event::Gtid_log_event(THD *thd_arg, uint64 seq_no_arg,
flags2|= FL_WAITED;
if (thd_arg->transaction.stmt.trans_did_ddl() ||
thd_arg->transaction.stmt.has_created_dropped_temp_table() ||
+ thd_arg->transaction.stmt.trans_executed_admin_cmd() ||
thd_arg->transaction.all.trans_did_ddl() ||
- thd_arg->transaction.all.has_created_dropped_temp_table())
+ thd_arg->transaction.all.has_created_dropped_temp_table() ||
+ thd_arg->transaction.all.trans_executed_admin_cmd())
flags2|= FL_DDL;
else if (is_transactional && !is_tmp_table)
flags2|= FL_TRANSACTIONAL;
@@ -11206,12 +11208,17 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
}
#endif /* WITH_WSREP && HAVE_QUERY_CACHE */
- if (get_flags(STMT_END_F) && (error= rows_event_stmt_cleanup(rgi, thd)))
- slave_rows_error_report(ERROR_LEVEL,
- thd->is_error() ? 0 : error,
- rgi, thd, table,
- get_type_str(),
- RPL_LOG_NAME, (ulong) log_pos);
+ if (get_flags(STMT_END_F))
+ {
+ if ((error= rows_event_stmt_cleanup(rgi, thd)))
+ slave_rows_error_report(ERROR_LEVEL,
+ thd->is_error() ? 0 : error,
+ rgi, thd, table,
+ get_type_str(),
+ RPL_LOG_NAME, (ulong) log_pos);
+ if (thd->slave_thread)
+ free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC));
+ }
DBUG_RETURN(error);
err:
@@ -14324,14 +14331,23 @@ st_print_event_info::st_print_event_info()
#endif
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-Heartbeat_log_event::Heartbeat_log_event(const char* buf, uint event_len,
+Heartbeat_log_event::Heartbeat_log_event(const char* buf, ulong event_len,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
uint8 header_size= description_event->common_header_len;
- ident_len = event_len - header_size;
- set_if_smaller(ident_len,FN_REFLEN-1);
- log_ident= buf + header_size;
+ if (log_pos == 0)
+ {
+ log_pos= uint8korr(buf + header_size);
+ log_ident= buf + header_size + HB_SUB_HEADER_LEN;
+ ident_len= event_len - (header_size + HB_SUB_HEADER_LEN);
+ }
+ else
+ {
+ log_ident= buf + header_size;
+ ident_len = event_len - header_size;
+ }
+
}
#endif
diff --git a/sql/log_event.h b/sql/log_event.h
index 3fc44a9669f..bd40795a7fb 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -570,6 +570,14 @@ class String;
#define MARIA_SLAVE_CAPABILITY_MINE MARIA_SLAVE_CAPABILITY_GTID
+/*
+ When the size of 'log_pos' within Heartbeat_log_event exceeds UINT32_MAX it
+ cannot be accommodated in common_header, as 'log_pos' is of 4 bytes size. In
+ such cases, sub_header, of size 8 bytes will hold larger 'log_pos' value.
+*/
+#define HB_SUB_HEADER_LEN 8
+
+
/**
@enum Log_event_type
@@ -5160,12 +5168,13 @@ static inline bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache,
class Heartbeat_log_event: public Log_event
{
public:
- Heartbeat_log_event(const char* buf, uint event_len,
+ uint8 hb_flags;
+ Heartbeat_log_event(const char* buf, ulong event_len,
const Format_description_log_event* description_event);
Log_event_type get_type_code() { return HEARTBEAT_LOG_EVENT; }
bool is_valid() const
{
- return (log_ident != NULL &&
+ return (log_ident != NULL && ident_len <= FN_REFLEN-1 &&
log_pos >= BIN_LOG_HEADER_SIZE);
}
const char * get_log_ident() { return log_ident; }
diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc
index 8533c9037aa..e4dc3d44a38 100644
--- a/sql/mf_iocache.cc
+++ b/sql/mf_iocache.cc
@@ -26,7 +26,7 @@
Used instead of FILE when reading or writing whole files.
This will make mf_rec_cache obsolete.
One can change info->pos_in_file to a higher value to skip bytes in file if
- also info->rc_pos is set to info->rc_end.
+ also info->read_pos is set to info->read_end.
If called through open_cached_file(), then the temporary file will
only be created if a write exeeds the file buffer or if one calls
flush_io_cache().
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 48121ce2ea2..d723c36e4cb 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5324,7 +5324,7 @@ static int init_server_components()
}
}
- if (opt_bin_log)
+ if (!opt_help && opt_bin_log)
{
if (mysql_bin_log.open_index_file(opt_binlog_index_name, opt_bin_logname,
TRUE))
@@ -5333,7 +5333,7 @@ static int init_server_components()
}
}
- if (opt_bin_log)
+ if (!opt_help && opt_bin_log)
{
log_bin_basename=
rpl_make_log_name(opt_bin_logname, pidfile_name,
@@ -9666,7 +9666,9 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
if (global_system_variables.low_priority_updates)
thr_upgraded_concurrent_insert_lock= TL_WRITE_LOW_PRIORITY;
- if (ft_boolean_check_syntax_string((uchar*) ft_boolean_syntax))
+ if (ft_boolean_check_syntax_string((uchar*) ft_boolean_syntax,
+ strlen(ft_boolean_syntax),
+ system_charset_info))
{
sql_print_error("Invalid ft-boolean-syntax string: %s\n",
ft_boolean_syntax);
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 1bffcfb3bdb..613668b39a5 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -218,8 +218,6 @@ net_send_ok(THD *thd,
NET *net= &thd->net;
StringBuffer<MYSQL_ERRMSG_SIZE + 10> store;
- bool state_changed= false;
-
bool error= FALSE;
DBUG_ENTER("net_send_ok");
@@ -246,6 +244,11 @@ net_send_ok(THD *thd,
/* last insert id */
store.q_net_store_length(id);
+ /* if client has not session tracking capability, don't send state change flag*/
+ if (!(thd->client_capabilities & CLIENT_SESSION_TRACK)) {
+ server_status &= ~SERVER_SESSION_STATE_CHANGED;
+ }
+
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
{
DBUG_PRINT("info",
@@ -266,21 +269,17 @@ net_send_ok(THD *thd,
}
thd->get_stmt_da()->set_overwrite_status(true);
- state_changed=
- (thd->client_capabilities & CLIENT_SESSION_TRACK) &&
- (server_status & SERVER_SESSION_STATE_CHANGED);
-
- if (state_changed || (message && message[0]))
+ if ((server_status & SERVER_SESSION_STATE_CHANGED) || (message && message[0]))
{
DBUG_ASSERT(safe_strlen(message) <= MYSQL_ERRMSG_SIZE);
store.q_net_store_data((uchar*) safe_str(message), safe_strlen(message));
}
- if (unlikely(state_changed))
+ if (unlikely(server_status & SERVER_SESSION_STATE_CHANGED))
{
store.set_charset(thd->variables.collation_database);
-
thd->session_tracker.store(thd, &store);
+ thd->server_status&= ~SERVER_SESSION_STATE_CHANGED;
}
DBUG_ASSERT(store.length() <= MAX_PACKET_LENGTH);
@@ -289,8 +288,6 @@ net_send_ok(THD *thd,
if (!error && (!skip_flush || is_eof))
error= net_flush(net);
- thd->server_status&= ~SERVER_SESSION_STATE_CHANGED;
-
thd->get_stmt_da()->set_overwrite_status(false);
DBUG_PRINT("info", ("OK sent, so no more error sending allowed"));
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index a8f7641fce4..86de093b72a 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -1859,7 +1859,7 @@ rpl_binlog_state::drop_domain(DYNAMIC_ARRAY *ids,
push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
ER_BINLOG_CANT_DELETE_GTID_DOMAIN,
"The gtid domain being deleted ('%lu') is not in "
- "the current binlog state", *ptr_domain_id);
+ "the current binlog state", (unsigned long) *ptr_domain_id);
continue;
}
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 82a462d742b..8ed14962dd9 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -170,6 +170,8 @@ void Master_info::clear_in_memory_info(bool all)
{
port= MYSQL_PORT;
host[0] = 0; user[0] = 0; password[0] = 0;
+ domain_id_filter.clear_ids();
+ reset_dynamic(&ignore_server_ids);
}
}
@@ -1788,6 +1790,12 @@ void Domain_id_filter::reset_filter()
m_filter= false;
}
+void Domain_id_filter::clear_ids()
+{
+ reset_dynamic(&m_domain_ids[DO_DOMAIN_IDS]);
+ reset_dynamic(&m_domain_ids[IGNORE_DOMAIN_IDS]);
+}
+
/**
Update the do/ignore domain id filter lists.
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index 12574285de0..e80c14fc340 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -79,6 +79,11 @@ public:
void reset_filter();
/*
+ Clear do_ids and ignore_ids to disable domain id filtering
+ */
+ void clear_ids();
+
+ /*
Update the do/ignore domain id filter lists.
@param do_ids [IN] domain ids to be kept
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 869640fd46f..4503f6ed9be 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -455,6 +455,7 @@ pool_mark_busy(rpl_parallel_thread_pool *pool, THD *thd)
So we protect the infrequent operations of FLUSH TABLES WITH READ LOCK and
pool size changes with this condition wait.
*/
+ DBUG_EXECUTE_IF("mark_busy_mdev_22370",my_sleep(1000000););
mysql_mutex_lock(&pool->LOCK_rpl_thread_pool);
if (thd)
{
@@ -2002,9 +2003,23 @@ rpl_parallel_thread_pool::init(uint32 size)
void
rpl_parallel_thread_pool::destroy()
{
+ deactivate();
+ destroy_cond_mutex();
+}
+
+void
+rpl_parallel_thread_pool::deactivate()
+{
if (!inited)
return;
rpl_parallel_change_thread_count(this, 0, 1);
+}
+
+void
+rpl_parallel_thread_pool::destroy_cond_mutex()
+{
+ if (!inited)
+ return;
mysql_mutex_destroy(&LOCK_rpl_thread_pool);
mysql_cond_destroy(&COND_rpl_thread_pool);
inited= false;
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index a0faeae815c..fba4c7b3fd7 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -240,6 +240,8 @@ struct rpl_parallel_thread_pool {
rpl_parallel_thread_pool();
int init(uint32 size);
void destroy();
+ void deactivate();
+ void destroy_cond_mutex();
struct rpl_parallel_thread *get_thread(rpl_parallel_thread **owner,
rpl_parallel_entry *entry);
void release_thread(rpl_parallel_thread *rpt);
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 5273b33c728..3a882f6d416 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -203,8 +203,8 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
*/
sql_print_warning("Neither --relay-log nor --relay-log-index were used;"
" so replication "
- "may break when this MySQL server acts as a "
- "slave and has his hostname changed!! Please "
+ "may break when this MariaDB server acts as a "
+ "replica and has its hostname changed. Please "
"use '--log-basename=#' or '--relay-log=%s' to avoid "
"this problem.", ln);
name_warning_sent= 1;
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 4bb1ae951af..2d4e0562d8f 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -191,7 +191,7 @@ ER_DB_DROP_DELETE
hun "Adatbazis megszuntetesi hiba ('%-.192s' nem torolheto, hibakod: %M)"
ita "Errore durante la cancellazione del database (impossibile cancellare '%-.192s', errno: %M)"
jpn "データベース削除エラー ('%-.192s' を削除できません。エラー番号: %M)"
- kor "데이타베이스 제거 에러('%-.192s'를 삭제할 수 없읍니다, 에러번호: %M)"
+ kor "데이타베이스 제거 에러('%-.192s'를 삭제할 수 없습니다, 에러번호: %M)"
nor "Feil ved fjerning (drop) av databasen (kan ikke slette '%-.192s', feil %M)"
norwegian-ny "Feil ved fjerning (drop) av databasen (kan ikkje slette '%-.192s', feil %M)"
pol "Bł?d podczas usuwania bazy danych (nie można usun?ć '%-.192s', bł?d %M)"
@@ -216,7 +216,7 @@ ER_DB_DROP_RMDIR
hun "Adatbazis megszuntetesi hiba ('%-.192s' nem szuntetheto meg, hibakod: %M)"
ita "Errore durante la cancellazione del database (impossibile rmdir '%-.192s', errno: %M)"
jpn "データベース削除エラー (ディレクトリ '%-.192s' を削除できません。エラー番号: %M)"
- kor "데이타베이스 제거 에러(rmdir '%-.192s'를 할 수 없읍니다, 에러번호: %M)"
+ kor "데이타베이스 제거 에러(rmdir '%-.192s'를 할 수 없습니다, 에러번호: %M)"
nor "Feil ved sletting av database (kan ikke slette katalogen '%-.192s', feil %M)"
norwegian-ny "Feil ved sletting av database (kan ikkje slette katalogen '%-.192s', feil %M)"
pol "Bł?d podczas usuwania bazy danych (nie można wykonać rmdir '%-.192s', bł?d %M)"
@@ -516,7 +516,7 @@ ER_DUP_KEY 23000
hun "Irasi hiba, duplikalt kulcs a '%-.192s' tablaban"
ita "Scrittura impossibile: chiave duplicata nella tabella '%-.192s'"
jpn "書き込めません。表 '%-.192s' に重複するキーがあります。"
- kor "기록할 수 없읍니다., 테이블 '%-.192s'에서 중복 키"
+ kor "기록할 수 없습니다., 테이블 '%-.192s'에서 중복 키"
nor "Kan ikke skrive, flere like nøkler i tabellen '%-.192s'"
norwegian-ny "Kan ikkje skrive, flere like nyklar i tabellen '%-.192s'"
pol "Nie można zapisać, powtórzone klucze w tabeli '%-.192s'"
@@ -641,7 +641,7 @@ ER_FILE_USED
hun "'%-.192s' a valtoztatas ellen zarolva"
ita "'%-.192s' e` soggetto a lock contro i cambiamenti"
jpn "'%-.192s' はロックされています。"
- kor "'%-.192s'가 변경할 수 없도록 잠겨있읍니다."
+ kor "'%-.192s'가 변경할 수 없도록 잠겨있습니다."
nor "'%-.192s' er låst mot oppdateringer"
norwegian-ny "'%-.192s' er låst mot oppdateringar"
pol "'%-.192s' jest zablokowany na wypadek zmian"
@@ -691,7 +691,7 @@ ER_FORM_NOT_FOUND
hun "A(z) '%-.192s' nezet nem letezik a(z) '%-.192s'-hoz"
ita "La view '%-.192s' non esiste per '%-.192s'"
jpn "ビュー '%-.192s' は '%-.192s' に存在しません。"
- kor "뷰 '%-.192s'가 '%-.192s'에서는 존재하지 않읍니다."
+ kor "뷰 '%-.192s'가 '%-.192s'에서는 존재하지 않습니다."
nor "View '%-.192s' eksisterer ikke for '%-.192s'"
norwegian-ny "View '%-.192s' eksisterar ikkje for '%-.192s'"
pol "Widok '%-.192s' nie istnieje dla '%-.192s'"
@@ -739,7 +739,7 @@ ER_KEY_NOT_FOUND
hun "Nem talalhato a rekord '%-.192s'-ben"
ita "Impossibile trovare il record in '%-.192s'"
jpn "'%-.192s' にレコードが見つかりません。"
- kor "'%-.192s'에서 레코드를 찾을 수 없읍니다."
+ kor "'%-.192s'에서 레코드를 찾을 수 없습니다."
nor "Kan ikke finne posten i '%-.192s'"
norwegian-ny "Kan ikkje finne posten i '%-.192s'"
pol "Nie można znaleĽć rekordu w '%-.192s'"
@@ -985,7 +985,7 @@ ER_BAD_HOST_ERROR 08S01
hun "A gepnev nem allapithato meg a cimbol"
ita "Impossibile risalire al nome dell'host dall'indirizzo (risoluzione inversa)"
jpn "IPアドレスからホスト名を解決できません。"
- kor "당신의 컴퓨터의 호스트이름을 얻을 수 없읍니다."
+ kor "당신의 컴퓨터의 호스트이름을 얻을 수 없습니다."
nor "Kan ikke få tak i vertsnavn for din adresse"
norwegian-ny "Kan ikkje få tak i vertsnavn for di adresse"
pol "Nie można otrzymać nazwy hosta dla twojego adresu"
@@ -1533,7 +1533,7 @@ ER_PARSE_ERROR 42000 s1009
hun "A %s a '%-.80T'-hez kozeli a %d sorban"
ita "%s vicino a '%-.80T' linea %d"
jpn "%s : '%-.80T' 付近 %d 行目"
- kor "'%s' 에러 같읍니다. ('%-.80T' 명령어 라인 %d)"
+ kor "'%s' 에러 같습니다. ('%-.80T' 명령어 라인 %d)"
nor "%s nær '%-.80T' på linje %d"
norwegian-ny "%s attmed '%-.80T' på line %d"
pol "%s obok '%-.80T' w linii %d"
@@ -1658,7 +1658,7 @@ ER_TOO_MANY_KEYS 42000 S1009
hindi "बहुत सारी KEYS निर्दिष्ट हैं; अधिकतम %d KEYS की अनुमति है"
ita "Troppe chiavi. Sono ammesse max %d chiavi"
jpn "索引の数が多すぎます。最大 %d 個までです。"
- kor "너무 많은 키가 정의되어 있읍니다.. 최대 %d의 키가 가능함"
+ kor "너무 많은 키가 정의되어 있습니다.. 최대 %d의 키가 가능함"
nor "For mange nøkler spesifisert. Maks %d nøkler tillatt"
norwegian-ny "For mange nykler spesifisert. Maks %d nyklar tillatt"
pol "Okre?lono zbyt wiele kluczy. Dostępnych jest maksymalnie %d kluczy"
@@ -1683,7 +1683,7 @@ ER_TOO_MANY_KEY_PARTS 42000 S1009
hun "Tul sok kulcsdarabot definialt. Maximum %d resz engedelyezett"
ita "Troppe parti di chiave specificate. Sono ammesse max %d parti"
jpn "索引のキー列指定が多すぎます。最大 %d 個までです。"
- kor "너무 많은 키 부분(parts)들이 정의되어 있읍니다.. 최대 %d 부분이 가능함"
+ kor "너무 많은 키 부분(parts)들이 정의되어 있습니다.. 최대 %d 부분이 가능함"
nor "For mange nøkkeldeler spesifisert. Maks %d deler tillatt"
norwegian-ny "For mange nykkeldelar spesifisert. Maks %d delar tillatt"
pol "Okre?lono zbyt wiele czę?ci klucza. Dostępnych jest maksymalnie %d czę?ci"
@@ -2593,7 +2593,7 @@ ER_FIELD_SPECIFIED_TWICE 42000
hun "A(z) '%-.192s' mezot ketszer definialta"
ita "Campo '%-.192s' specificato 2 volte"
jpn "列 '%-.192s' は2回指定されています。"
- kor "칼럼 '%-.192s'는 두번 정의되어 있읍니다."
+ kor "칼럼 '%-.192s'는 두번 정의되어 있습니다."
nor "Feltet '%-.192s' er spesifisert to ganger"
norwegian-ny "Feltet '%-.192s' er spesifisert to gangar"
pol "Field '%-.192s' specified twice"
@@ -2774,7 +2774,7 @@ ER_TOO_BIG_ROWSIZE 42000
hun "Tul nagy sormeret. A maximalis sormeret (nem szamolva a blob objektumokat) %ld. Nehany mezot meg kell valtoztatnia"
ita "Riga troppo grande. La massima grandezza di una riga, non contando i BLOB, e` %ld. Devi cambiare alcuni campi in BLOB"
jpn "行サイズが大きすぎます。この表の最大行サイズは BLOB を含まずに %ld です。格納時のオーバーヘッドも含まれます(マニュアルを確認してください)。列をTEXTまたはBLOBに変更する必要があります。"
- kor "너무 큰 row 사이즈입니다. BLOB를 계산하지 않고 최대 row 사이즈는 %ld입니다. 얼마간의 필드들을 BLOB로 바꾸셔야 겠군요.."
+ kor "너무 큰 row 사이즈입니다. BLOB를 계산하지 않고 최대 row 사이즈는 %ld입니다. 일부열을 BLOB 또는 TEXT로 변경해야 합니다."
por "Tamanho de linha grande demais. O máximo tamanho de linha, não contando BLOBs, é %ld. Você tem que mudar alguns campos para BLOBs"
rum "Marimea liniei (row) prea mare. Marimea maxima a liniei, excluzind BLOB-urile este de %ld. Trebuie sa schimbati unele cimpuri in BLOB-uri"
rus "Слишком большой размер записи. Максимальный размер строки, исключая поля BLOB, - %ld. Возможно, вам следует изменить тип некоторых полей на BLOB"
@@ -3077,7 +3077,7 @@ ER_PASSWORD_NO_MATCH 28000
hun "Nincs megegyezo sor a user tablaban"
ita "Impossibile trovare la riga corrispondente nella tabella user"
jpn "ユーザーテーブルに該当するレコードが見つかりません。"
- kor "사용자 테이블에서 일치하는 것을 찾을 수 없읍니다."
+ kor "사용자 테이블에서 일치하는 것을 찾을 수 없습니다."
por "Não pode encontrar nenhuma linha que combine na tabela usuário (user table)"
rum "Nu pot gasi nici o linie corespunzatoare in tabela utilizatorului"
rus "Невозможно отыскать подходящую запись в таблице пользователей"
@@ -3219,7 +3219,7 @@ ER_MIX_OF_GROUP_FUNC_AND_FIELDS 42000
hun "A GROUP mezok (MIN(),MAX(),COUNT()...) kevert hasznalata nem lehetseges GROUP BY hivatkozas nelkul"
ita "Il mescolare funzioni di aggregazione (MIN(),MAX(),COUNT()...) e non e` illegale se non c'e` una clausula GROUP BY"
jpn "GROUP BY句が無い場合、集計関数(MIN(),MAX(),COUNT(),...)と通常の列を同時に使用できません。"
- kor "Mixing of GROUP 칼럼s (MIN(),MAX(),COUNT(),...) with no GROUP 칼럼s is illegal if there is no GROUP BY clause"
+ kor "GROUP BY 절 없이 혼합된 GROUP 함수 (MIN(),MAX(),COUNT(),...) 를 사용할 수 없습니다."
por "Mistura de colunas agrupadas (com MIN(), MAX(), COUNT(), ...) com colunas não agrupadas é ilegal, se não existir uma cláusula de agrupamento (cláusula GROUP BY)"
rum "Amestecarea de coloane GROUP (MIN(),MAX(),COUNT()...) fara coloane GROUP este ilegala daca nu exista o clauza GROUP BY"
rus "Одновременное использование сгруппированных (GROUP) столбцов (MIN(),MAX(),COUNT(),...) с несгруппированными столбцами является некорректным, если в выражении есть GROUP BY"
@@ -3668,6 +3668,7 @@ ER_TOO_LONG_STRING 42000
est "Tulemus on pikem kui lubatud 'max_allowed_packet' muutujaga"
fre "La chaîne résultat est plus grande que 'max_allowed_packet'"
ger "Ergebnis-String ist länger als 'max_allowed_packet' Bytes"
+ kor "결과 문자열이 설정된 max_allowed_packet 값보다 큽니다."
hindi "रिजल्ट स्ट्रिंग 'max_allowed_packet' से लंबा है"
hun "Ez eredmeny sztring nagyobb, mint a lehetseges maximum: 'max_allowed_packet'"
ita "La stringa di risposta e` piu` lunga di 'max_allowed_packet'"
@@ -3689,6 +3690,7 @@ ER_TABLE_CANT_HANDLE_BLOB 42000
ger "Der verwendete Tabellentyp (%s) unterstützt keine BLOB- und TEXT-Felder"
hindi "स्टोरेज इंजन %s BLOB/TEXT कॉलम्स को सपोर्ट नहीं करता"
hun "A hasznalt tabla tipus (%s) nem tamogatja a BLOB/TEXT mezoket"
+ kor "스토리지 엔진 (%s)는 BLOB/TEXT 컬럼을 지원하지 않습니다."
ita "Il tipo di tabella usata (%s) non supporta colonne di tipo BLOB/TEXT"
por "Tipo de tabela usado (%s) não permite colunas BLOB/TEXT"
rum "Tipul de tabela folosit (%s) nu suporta coloane de tip BLOB/TEXT"
@@ -3706,6 +3708,7 @@ ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 42000
fre "Ce type de table (%s) ne supporte pas les colonnes AUTO_INCREMENT"
ger "Der verwendete Tabellentyp (%s) unterstützt keine AUTO_INCREMENT-Felder"
hindi "स्टोरेज इंजन %s AUTO_INCREMENT कॉलम्स को सपोर्ट नहीं करता"
+ kor "스토리지 엔진 (%s)는 AUTO_INCREMENT를 지원하지 않습니다."
hun "A hasznalt tabla tipus (%s) nem tamogatja az AUTO_INCREMENT tipusu mezoket"
ita "Il tipo di tabella usata (%s) non supporta colonne di tipo AUTO_INCREMENT"
por "Tipo de tabela usado (%s) não permite colunas AUTO_INCREMENT"
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index 61c53e6b6e3..08ea696752a 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -31,7 +31,7 @@
#endif
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/sysctl.h>
#endif
@@ -56,7 +56,7 @@ extern const char *optimizer_switch_names[];
static inline void output_core_info()
{
/* proc is optional on some BSDs so it can't hurt to look */
-#if defined(HAVE_READLINK) && !defined(__APPLE__)
+#if defined(HAVE_READLINK) && !defined(__APPLE__) && !defined(__FreeBSD__)
char buff[PATH_MAX];
ssize_t len;
int fd;
@@ -82,7 +82,7 @@ static inline void output_core_info()
my_close(fd, MYF(0));
}
#endif
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__FreeBSD__)
char buff[PATH_MAX];
size_t len = sizeof(buff);
if (sysctlbyname("kern.corefile", buff, &len, NULL, 0) == 0)
diff --git a/sql/slave.cc b/sql/slave.cc
index 3124b2d10ab..761fdbe807a 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -975,6 +975,9 @@ void slave_prepare_for_shutdown()
mysql_mutex_lock(&LOCK_active_mi);
master_info_index->free_connections();
mysql_mutex_unlock(&LOCK_active_mi);
+ // It's safe to destruct worker pool now when
+ // all driver threads are gone.
+ global_rpl_thread_pool.deactivate();
}
/*
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index b205d253733..6a6bdf8fe09 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -3087,8 +3087,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
#endif
if (open_tables)
- res= check_dependencies_in_with_clauses(m_lex->with_clauses_list) ||
- instr->exec_open_and_lock_tables(thd, m_lex->query_tables);
+ res= instr->exec_open_and_lock_tables(thd, m_lex->query_tables);
if (!res)
{
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 711efa91394..8bd9acef18f 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2002, 2013, Oracle and/or its affiliates.
- Copyright (c) 2011, 2013, Monty Program Ab.
+ Copyright (c) 2011, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -539,7 +539,11 @@ Geometry *Geometry::create_from_json(Geometry_buffer *buffer,
goto handle_geometry_key;
feature_type_found= 1;
}
+ else /* can't understand the type. */
+ break;
}
+ else /* The "type" value can only be string. */
+ break;
}
else if (key_len == coord_keyname_len &&
memcmp(key_buf, coord_keyname, coord_keyname_len) == 0)
@@ -556,6 +560,8 @@ Geometry *Geometry::create_from_json(Geometry_buffer *buffer,
coord_start= je->value_begin;
if (ci && ci != &geometrycollection_class)
goto create_geom;
+ if (json_skip_level(je))
+ goto err_return;
}
}
else if (key_len == geometries_keyname_len &&
@@ -1050,7 +1056,7 @@ double Gis_point::calculate_haversine(const Geometry *g,
int *error)
{
DBUG_ASSERT(sphere_radius > 0);
- double x1r, x2r, y1r, y2r, dlong, dlat, res;
+ double x1r, x2r, y1r, y2r;
// This check is done only for optimization purposes where we know it will
// be one and only one point in Multipoint
@@ -1067,31 +1073,39 @@ double Gis_point::calculate_haversine(const Geometry *g,
Geometry *gg= Geometry::construct(&gbuff, point_temp, point_size-1);
DBUG_ASSERT(gg);
if (static_cast<Gis_point *>(gg)->get_xy_radian(&x2r, &y2r))
+ {
DBUG_ASSERT(0);
+ return -1;
+ }
}
else
{
if (static_cast<const Gis_point *>(g)->get_xy_radian(&x2r, &y2r))
+ {
DBUG_ASSERT(0);
+ return -1;
+ }
}
if (this->get_xy_radian(&x1r, &y1r))
+ {
DBUG_ASSERT(0);
+ return -1;
+ }
// Check boundary conditions: longitude[-180,180]
if (!((x2r >= -M_PI && x2r <= M_PI) && (x1r >= -M_PI && x1r <= M_PI)))
{
*error=1;
return -1;
}
- // Check boundary conditions: lattitude[-90,90]
+ // Check boundary conditions: latitude[-90,90]
if (!((y2r >= -M_PI/2 && y2r <= M_PI/2) && (y1r >= -M_PI/2 && y1r <= M_PI/2)))
{
*error=-1;
return -1;
}
- dlat= sin((y2r - y1r)/2)*sin((y2r - y1r)/2);
- dlong= sin((x2r - x1r)/2)*sin((x2r - x1r)/2);
- res= 2*sphere_radius*asin((sqrt(dlat + cos(y1r)*cos(y2r)*dlong)));
- return res;
+ double dlat= sin((y2r - y1r)/2)*sin((y2r - y1r)/2);
+ double dlong= sin((x2r - x1r)/2)*sin((x2r - x1r)/2);
+ return 2*sphere_radius*asin((sqrt(dlat + cos(y1r)*cos(y2r)*dlong)));
}
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index f1034986f22..f62dd5471eb 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1566,7 +1566,11 @@ static bool validate_password(LEX_USER *user, THD *thd)
else
{
if (!thd->slave_thread &&
- strict_password_validation && has_validation_plugins())
+ strict_password_validation && has_validation_plugins()
+#ifdef WITH_WSREP
+ && !thd->wsrep_applier
+#endif
+ )
{
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--strict-password-validation");
return true;
@@ -2728,7 +2732,6 @@ end:
my_error(ER_INVALID_ROLE, MYF(0), rolename);
break;
case 1:
- StringBuffer<1024> c_usr;
LEX_CSTRING role_lex;
/* First, check if current user can see mysql database. */
bool read_access= !check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 1);
@@ -2749,11 +2752,9 @@ end:
NULL) == -1))
{
/* Role is not granted but current user can see the role */
- c_usr.append(user, strlen(user));
- c_usr.append('@');
- c_usr.append(host, strlen(host));
- my_printf_error(ER_INVALID_ROLE, "User %`s has not been granted role %`s",
- MYF(0), c_usr.c_ptr(), rolename);
+ my_printf_error(ER_INVALID_ROLE, "User %`s@%`s has not been granted role %`s",
+ MYF(0), thd->security_ctx->priv_user,
+ thd->security_ctx->priv_host, rolename);
}
else
{
@@ -8846,9 +8847,9 @@ static bool show_default_role(THD *thd, ACL_USER *acl_entry,
{
String def_str(buff, buffsize, system_charset_info);
def_str.length(0);
- def_str.append(STRING_WITH_LEN("SET DEFAULT ROLE "));
+ def_str.append(STRING_WITH_LEN("SET DEFAULT ROLE '"));
def_str.append(&def_rolename);
- def_str.append(" FOR '");
+ def_str.append("' FOR '");
def_str.append(&acl_entry->user);
DBUG_ASSERT(!(acl_entry->flags & IS_ROLE));
def_str.append(STRING_WITH_LEN("'@'"));
@@ -8877,12 +8878,12 @@ static bool show_role_grants(THD *thd, const char *hostname,
for (counter= 0; counter < acl_entry->role_grants.elements; counter++)
{
grant.length(0);
- grant.append(STRING_WITH_LEN("GRANT "));
+ grant.append(STRING_WITH_LEN("GRANT '"));
ACL_ROLE *acl_role= *(dynamic_element(&acl_entry->role_grants, counter,
ACL_ROLE**));
grant.append(acl_role->user.str, acl_role->user.length,
system_charset_info);
- grant.append(STRING_WITH_LEN(" TO '"));
+ grant.append(STRING_WITH_LEN("' TO '"));
grant.append(acl_entry->user.str, acl_entry->user.length,
system_charset_info);
if (!(acl_entry->flags & IS_ROLE))
@@ -9644,8 +9645,8 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
LEX_USER *user_from, LEX_USER *user_to)
{
int result= 0;
- int idx;
int elements;
+ bool restart;
const char *UNINIT_VAR(user);
const char *UNINIT_VAR(host);
ACL_USER *acl_user= NULL;
@@ -9746,82 +9747,98 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
DBUG_RETURN(-1);
}
+
#ifdef EXTRA_DEBUG
DBUG_PRINT("loop",("scan struct: %u search user: '%s' host: '%s'",
struct_no, user_from->user.str, user_from->host.str));
#endif
- /* Loop over all elements *backwards* (see the comment below). */
- for (idx= elements - 1; idx >= 0; idx--)
- {
- /*
- Get a pointer to the element.
- */
- switch (struct_no) {
- case USER_ACL:
- acl_user= dynamic_element(&acl_users, idx, ACL_USER*);
- user= acl_user->user.str;
- host= acl_user->host.hostname;
- break;
+ /* Loop over elements backwards as it may reduce the number of mem-moves
+ for dynamic arrays.
- case DB_ACL:
- acl_db= &acl_dbs.at(idx);
- user= acl_db->user;
- host= acl_db->host.hostname;
+ We restart the loop, if we deleted or updated anything in a hash table
+ because calling my_hash_delete or my_hash_update shuffles elements indices
+ and we can miss some if we do only one scan.
+ */
+ do {
+ restart= false;
+ for (int idx= elements - 1; idx >= 0; idx--)
+ {
+ /*
+ Get a pointer to the element.
+ */
+ switch (struct_no) {
+ case USER_ACL:
+ acl_user= dynamic_element(&acl_users, idx, ACL_USER*);
+ user= acl_user->user.str;
+ host= acl_user->host.hostname;
break;
- case COLUMN_PRIVILEGES_HASH:
- case PROC_PRIVILEGES_HASH:
- case FUNC_PRIVILEGES_HASH:
- grant_name= (GRANT_NAME*) my_hash_element(grant_name_hash, idx);
- user= grant_name->user;
- host= grant_name->host.hostname;
- break;
+ case DB_ACL:
+ acl_db= &acl_dbs.at(idx);
+ user= acl_db->user;
+ host= acl_db->host.hostname;
+ break;
- case PROXY_USERS_ACL:
- acl_proxy_user= dynamic_element(&acl_proxy_users, idx, ACL_PROXY_USER*);
- user= acl_proxy_user->get_user();
- host= acl_proxy_user->get_host();
- break;
+ case COLUMN_PRIVILEGES_HASH:
+ case PROC_PRIVILEGES_HASH:
+ case FUNC_PRIVILEGES_HASH:
+ grant_name= (GRANT_NAME*) my_hash_element(grant_name_hash, idx);
+ user= grant_name->user;
+ host= grant_name->host.hostname;
+ break;
- case ROLES_MAPPINGS_HASH:
- role_grant_pair= (ROLE_GRANT_PAIR *) my_hash_element(roles_mappings_hash, idx);
- user= role_grant_pair->u_uname;
- host= role_grant_pair->u_hname;
- break;
+ case PROXY_USERS_ACL:
+ acl_proxy_user= dynamic_element(&acl_proxy_users, idx, ACL_PROXY_USER*);
+ user= acl_proxy_user->get_user();
+ host= acl_proxy_user->get_host();
+ break;
- default:
- DBUG_ASSERT(0);
- }
- if (! user)
- user= "";
- if (! host)
- host= "";
+ case ROLES_MAPPINGS_HASH:
+ role_grant_pair= (ROLE_GRANT_PAIR *) my_hash_element(roles_mappings_hash, idx);
+ user= role_grant_pair->u_uname;
+ host= role_grant_pair->u_hname;
+ break;
+
+ default:
+ DBUG_ASSERT(0);
+ }
+ if (! user)
+ user= "";
+ if (! host)
+ host= "";
#ifdef EXTRA_DEBUG
- DBUG_PRINT("loop",("scan struct: %u index: %u user: '%s' host: '%s'",
- struct_no, idx, user, host));
+ DBUG_PRINT("loop",("scan struct: %u index: %u user: '%s' host: '%s'",
+ struct_no, idx, user, host));
#endif
- if (struct_no == ROLES_MAPPINGS_HASH)
- {
- const char* role= role_grant_pair->r_uname? role_grant_pair->r_uname: "";
- if (user_from->is_role())
+ if (struct_no == ROLES_MAPPINGS_HASH)
{
- /* When searching for roles within the ROLES_MAPPINGS_HASH, we have
- to check both the user field as well as the role field for a match.
+ const char* role= role_grant_pair->r_uname? role_grant_pair->r_uname: "";
+ if (user_from->is_role())
+ {
+ /* When searching for roles within the ROLES_MAPPINGS_HASH, we have
+ to check both the user field as well as the role field for a match.
- It is possible to have a role granted to a role. If we are going
- to modify the mapping entry, it needs to be done on either on the
- "user" end (here represented by a role) or the "role" end. At least
- one part must match.
+ It is possible to have a role granted to a role. If we are going
+ to modify the mapping entry, it needs to be done on either on the
+ "user" end (here represented by a role) or the "role" end. At least
+ one part must match.
- If the "user" end has a not-empty host string, it can never match
- as we are searching for a role here. A role always has an empty host
- string.
- */
- if ((*host || strcmp(user_from->user.str, user)) &&
- strcmp(user_from->user.str, role))
- continue;
+ If the "user" end has a not-empty host string, it can never match
+ as we are searching for a role here. A role always has an empty host
+ string.
+ */
+ if ((*host || strcmp(user_from->user.str, user)) &&
+ strcmp(user_from->user.str, role))
+ continue;
+ }
+ else
+ {
+ if (strcmp(user_from->user.str, user) ||
+ my_strcasecmp(system_charset_info, user_from->host.str, host))
+ continue;
+ }
}
else
{
@@ -9829,154 +9846,131 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
my_strcasecmp(system_charset_info, user_from->host.str, host))
continue;
}
- }
- else
- {
- if (strcmp(user_from->user.str, user) ||
- my_strcasecmp(system_charset_info, user_from->host.str, host))
- continue;
- }
- result= 1; /* At least one element found. */
- if ( drop )
- {
- elements--;
- switch ( struct_no ) {
- case USER_ACL:
- free_acl_user(dynamic_element(&acl_users, idx, ACL_USER*));
- delete_dynamic_element(&acl_users, idx);
- break;
+ result= 1; /* At least one element found. */
+ if ( drop )
+ {
+ elements--;
+ switch ( struct_no ) {
+ case USER_ACL:
+ free_acl_user(dynamic_element(&acl_users, idx, ACL_USER*));
+ delete_dynamic_element(&acl_users, idx);
+ break;
- case DB_ACL:
- acl_dbs.del(idx);
- break;
+ case DB_ACL:
+ acl_dbs.del(idx);
+ break;
- case COLUMN_PRIVILEGES_HASH:
- case PROC_PRIVILEGES_HASH:
- case FUNC_PRIVILEGES_HASH:
- my_hash_delete(grant_name_hash, (uchar*) grant_name);
- /*
- In our HASH implementation on deletion one elements
- is moved into a place where a deleted element was,
- and the last element is moved into the empty space.
- Thus we need to re-examine the current element, but
- we don't have to restart the search from the beginning.
- */
- if (idx != elements)
- idx++;
- break;
+ case COLUMN_PRIVILEGES_HASH:
+ case PROC_PRIVILEGES_HASH:
+ case FUNC_PRIVILEGES_HASH:
+ my_hash_delete(grant_name_hash, (uchar*) grant_name);
+ restart= true;
+ break;
- case PROXY_USERS_ACL:
- delete_dynamic_element(&acl_proxy_users, idx);
- break;
+ case PROXY_USERS_ACL:
+ delete_dynamic_element(&acl_proxy_users, idx);
+ break;
- case ROLES_MAPPINGS_HASH:
- my_hash_delete(roles_mappings_hash, (uchar*) role_grant_pair);
- if (idx != elements)
- idx++;
- break;
+ case ROLES_MAPPINGS_HASH:
+ my_hash_delete(roles_mappings_hash, (uchar*) role_grant_pair);
+ restart= true;
+ break;
- default:
- DBUG_ASSERT(0);
- break;
+ default:
+ DBUG_ASSERT(0);
+ break;
+ }
}
- }
- else if ( user_to )
- {
- switch ( struct_no ) {
- case USER_ACL:
- acl_user->user.str= strdup_root(&acl_memroot, user_to->user.str);
- acl_user->user.length= user_to->user.length;
- update_hostname(&acl_user->host, strdup_root(&acl_memroot, user_to->host.str));
- acl_user->hostname_length= strlen(acl_user->host.hostname);
- break;
+ else if ( user_to )
+ {
+ switch ( struct_no ) {
+ case USER_ACL:
+ acl_user->user.str= strdup_root(&acl_memroot, user_to->user.str);
+ acl_user->user.length= user_to->user.length;
+ update_hostname(&acl_user->host, strdup_root(&acl_memroot, user_to->host.str));
+ acl_user->hostname_length= strlen(acl_user->host.hostname);
+ break;
- case DB_ACL:
- acl_db->user= strdup_root(&acl_memroot, user_to->user.str);
- update_hostname(&acl_db->host, strdup_root(&acl_memroot, user_to->host.str));
- break;
+ case DB_ACL:
+ acl_db->user= strdup_root(&acl_memroot, user_to->user.str);
+ update_hostname(&acl_db->host, strdup_root(&acl_memroot, user_to->host.str));
+ break;
- case COLUMN_PRIVILEGES_HASH:
- case PROC_PRIVILEGES_HASH:
- case FUNC_PRIVILEGES_HASH:
- {
- /*
- Save old hash key and its length to be able to properly update
- element position in hash.
- */
- char *old_key= grant_name->hash_key;
- size_t old_key_length= grant_name->key_length;
+ case COLUMN_PRIVILEGES_HASH:
+ case PROC_PRIVILEGES_HASH:
+ case FUNC_PRIVILEGES_HASH:
+ {
+ /*
+ Save old hash key and its length to be able to properly update
+ element position in hash.
+ */
+ char *old_key= grant_name->hash_key;
+ size_t old_key_length= grant_name->key_length;
+
+ /*
+ Update the grant structure with the new user name and host name.
+ */
+ grant_name->set_user_details(user_to->host.str, grant_name->db,
+ user_to->user.str, grant_name->tname,
+ TRUE);
+
+ /*
+ Since username is part of the hash key, when the user name
+ is renamed, the hash key is changed. Update the hash to
+ ensure that the position matches the new hash key value
+ */
+ my_hash_update(grant_name_hash, (uchar*) grant_name, (uchar*) old_key,
+ old_key_length);
+ restart= true;
+ break;
+ }
- /*
- Update the grant structure with the new user name and host name.
- */
- grant_name->set_user_details(user_to->host.str, grant_name->db,
- user_to->user.str, grant_name->tname,
- TRUE);
-
- /*
- Since username is part of the hash key, when the user name
- is renamed, the hash key is changed. Update the hash to
- ensure that the position matches the new hash key value
- */
- my_hash_update(grant_name_hash, (uchar*) grant_name, (uchar*) old_key,
- old_key_length);
- /*
- hash_update() operation could have moved element from the tail or
- the head of the hash to the current position. But it can never
- move an element from the head to the tail or from the tail to the
- head over the current element.
- So we need to examine the current element once again, but
- we don't need to restart the search from the beginning.
- */
- idx++;
+ case PROXY_USERS_ACL:
+ acl_proxy_user->set_user (&acl_memroot, user_to->user.str);
+ acl_proxy_user->set_host (&acl_memroot, user_to->host.str);
break;
- }
- case PROXY_USERS_ACL:
- acl_proxy_user->set_user (&acl_memroot, user_to->user.str);
- acl_proxy_user->set_host (&acl_memroot, user_to->host.str);
- break;
+ case ROLES_MAPPINGS_HASH:
+ {
+ /*
+ Save old hash key and its length to be able to properly update
+ element position in hash.
+ */
+ char *old_key= role_grant_pair->hashkey.str;
+ size_t old_key_length= role_grant_pair->hashkey.length;
+ bool oom;
+
+ if (user_to->is_role())
+ oom= role_grant_pair->init(&acl_memroot, role_grant_pair->u_uname,
+ role_grant_pair->u_hname,
+ user_to->user.str, false);
+ else
+ oom= role_grant_pair->init(&acl_memroot, user_to->user.str,
+ user_to->host.str,
+ role_grant_pair->r_uname, false);
+ if (oom)
+ DBUG_RETURN(-1);
+
+ my_hash_update(roles_mappings_hash, (uchar*) role_grant_pair,
+ (uchar*) old_key, old_key_length);
+ restart= true;
+ break;
+ }
- case ROLES_MAPPINGS_HASH:
- {
- /*
- Save old hash key and its length to be able to properly update
- element position in hash.
- */
- char *old_key= role_grant_pair->hashkey.str;
- size_t old_key_length= role_grant_pair->hashkey.length;
- bool oom;
-
- if (user_to->is_role())
- oom= role_grant_pair->init(&acl_memroot, role_grant_pair->u_uname,
- role_grant_pair->u_hname,
- user_to->user.str, false);
- else
- oom= role_grant_pair->init(&acl_memroot, user_to->user.str,
- user_to->host.str,
- role_grant_pair->r_uname, false);
- if (oom)
- DBUG_RETURN(-1);
-
- my_hash_update(roles_mappings_hash, (uchar*) role_grant_pair,
- (uchar*) old_key, old_key_length);
- idx++; // see the comment above
+ default:
+ DBUG_ASSERT(0);
break;
}
- default:
- DBUG_ASSERT(0);
+ }
+ else
+ {
+ /* If search is requested, we do not need to search further. */
break;
}
-
}
- else
- {
- /* If search is requested, we do not need to search further. */
- break;
- }
- }
+ } while (restart);
#ifdef EXTRA_DEBUG
DBUG_PRINT("loop",("scan struct: %u result %d", struct_no, result));
#endif
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 17eede61337..7942587cf02 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -434,7 +434,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
int (handler::*operator_func)(THD *,
HA_CHECK_OPT *),
int (view_operator_func)(THD *, TABLE_LIST*,
- HA_CHECK_OPT *))
+ HA_CHECK_OPT *),
+ bool is_cmd_replicated)
{
TABLE_LIST *table;
List<Item> field_list;
@@ -445,6 +446,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
int compl_result_code;
bool need_repair_or_alter= 0;
wait_for_commit* suspended_wfc;
+ bool is_table_modified= false;
DBUG_ENTER("mysql_admin_table");
DBUG_PRINT("enter", ("extra_open_options: %u", extra_open_options));
@@ -495,6 +497,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
bool open_for_modify= org_open_for_modify;
DBUG_PRINT("admin", ("table: '%s'.'%s'", table->db, table->table_name));
+ DEBUG_SYNC(thd, "admin_command_kill_before_modify");
+
strxmov(table_name, db, ".", table->table_name, NullS);
thd->open_options|= extra_open_options;
table->lock_type= lock_type;
@@ -509,6 +513,14 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
: lock_type >= TL_WRITE_ALLOW_WRITE
? MDL_SHARED_WRITE : MDL_SHARED_READ);
+ if (thd->check_killed())
+ {
+ open_error= false;
+ fatal_error= true;
+ result_code= HA_ADMIN_FAILED;
+ goto send_result;
+ }
+
/* open only one table from local list of command */
while (1)
{
@@ -826,7 +838,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
enum enum_field_types type= (*field_ptr)->type();
if (type < MYSQL_TYPE_MEDIUM_BLOB ||
type > MYSQL_TYPE_BLOB)
- bitmap_set_bit(tab->read_set, fields);
+ tab->field[fields]->register_field_in_read_map();
else
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_NO_EIS_FOR_FIELD,
@@ -854,7 +866,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
enum enum_field_types type= tab->field[pos]->type();
if (type < MYSQL_TYPE_MEDIUM_BLOB ||
type > MYSQL_TYPE_BLOB)
- bitmap_set_bit(tab->read_set, pos);
+ tab->field[pos]->register_field_in_read_map();
else
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_NO_EIS_FOR_FIELD,
@@ -1147,6 +1159,13 @@ send_result_message:
break;
}
}
+ /*
+ Admin commands acquire table locks and these locks are not detected by
+ parallel replication deadlock detection-and-handling mechanism. Hence
+ they must be marked as DDL so that they are not scheduled in parallel
+ with conflicting DMLs resulting in deadlock.
+ */
+ thd->transaction.stmt.mark_executed_table_admin_cmd();
if (table->table && !table->view)
{
if (table->table->s->tmp_table)
@@ -1182,10 +1201,10 @@ send_result_message:
}
else
{
- if (trans_commit_stmt(thd) ||
- (stmt_causes_implicit_commit(thd, CF_IMPLICIT_COMMIT_END) &&
- trans_commit_implicit(thd)))
+ if (trans_commit_stmt(thd))
goto err;
+ if (!is_table_modified)
+ is_table_modified= true;
}
close_thread_tables(thd);
thd->release_transactional_locks();
@@ -1208,6 +1227,12 @@ send_result_message:
if (protocol->write())
goto err;
+ DEBUG_SYNC(thd, "admin_command_kill_after_modify");
+ }
+ if (is_table_modified && is_cmd_replicated && !thd->lex->no_write_to_binlog)
+ {
+ if (write_bin_log(thd, TRUE, thd->query(), thd->query_length()))
+ goto err;
}
my_eof(thd);
@@ -1270,7 +1295,7 @@ bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables,
check_opt.key_cache= key_cache;
DBUG_RETURN(mysql_admin_table(thd, tables, &check_opt,
"assign_to_keycache", TL_READ_NO_INSERT, 0, 0,
- 0, 0, &handler::assign_to_keycache, 0));
+ 0, 0, &handler::assign_to_keycache, 0, false));
}
@@ -1297,7 +1322,7 @@ bool mysql_preload_keys(THD* thd, TABLE_LIST* tables)
*/
DBUG_RETURN(mysql_admin_table(thd, tables, 0,
"preload_keys", TL_READ_NO_INSERT, 0, 0, 0, 0,
- &handler::preload_keys, 0));
+ &handler::preload_keys, 0, false));
}
@@ -1315,15 +1340,7 @@ bool Sql_cmd_analyze_table::execute(THD *thd)
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
res= mysql_admin_table(thd, first_table, &m_lex->check_opt,
"analyze", lock_type, 1, 0, 0, 0,
- &handler::ha_analyze, 0);
- /* ! we write after unlocking the table */
- if (!res && !m_lex->no_write_to_binlog)
- {
- /*
- Presumably, ANALYZE and binlog writing doesn't require synchronization
- */
- res= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
- }
+ &handler::ha_analyze, 0, true);
m_lex->select_lex.table_list.first= first_table;
m_lex->query_tables= first_table;
@@ -1346,7 +1363,7 @@ bool Sql_cmd_check_table::execute(THD *thd)
goto error; /* purecov: inspected */
res= mysql_admin_table(thd, first_table, &m_lex->check_opt, "check",
lock_type, 0, 0, HA_OPEN_FOR_REPAIR, 0,
- &handler::ha_check, &view_check);
+ &handler::ha_check, &view_check, false);
m_lex->select_lex.table_list.first= first_table;
m_lex->query_tables= first_table;
@@ -1371,15 +1388,7 @@ bool Sql_cmd_optimize_table::execute(THD *thd)
mysql_recreate_table(thd, first_table, true) :
mysql_admin_table(thd, first_table, &m_lex->check_opt,
"optimize", TL_WRITE, 1, 0, 0, 0,
- &handler::ha_optimize, 0);
- /* ! we write after unlocking the table */
- if (!res && !m_lex->no_write_to_binlog)
- {
- /*
- Presumably, OPTIMIZE and binlog writing doesn't require synchronization
- */
- res= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
- }
+ &handler::ha_optimize, 0, true);
m_lex->select_lex.table_list.first= first_table;
m_lex->query_tables= first_table;
@@ -1404,16 +1413,8 @@ bool Sql_cmd_repair_table::execute(THD *thd)
TL_WRITE, 1,
MY_TEST(m_lex->check_opt.sql_flags & TT_USEFRM),
HA_OPEN_FOR_REPAIR, &prepare_for_repair,
- &handler::ha_repair, &view_repair);
+ &handler::ha_repair, &view_repair, true);
- /* ! we write after unlocking the table */
- if (!res && !m_lex->no_write_to_binlog)
- {
- /*
- Presumably, REPAIR and binlog writing doesn't require synchronization
- */
- res= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
- }
m_lex->select_lex.table_list.first= first_table;
m_lex->query_tables= first_table;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index b8d18abb50c..5173df260d5 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3406,7 +3406,11 @@ open_and_process_table(THD *thd, TABLE_LIST *tables, uint *counter, uint flags,
if (tables->derived)
{
if (!tables->view)
+ {
+ if (!tables->is_derived())
+ tables->set_derived();
goto end;
+ }
/*
We restore view's name and database wiped out by derived tables
processing and fall back to standard open process in order to
@@ -3418,35 +3422,6 @@ open_and_process_table(THD *thd, TABLE_LIST *tables, uint *counter, uint flags,
tables->table_name= tables->view_name.str;
tables->table_name_length= tables->view_name.length;
}
- else if (tables->select_lex)
- {
- /*
- Check whether 'tables' refers to a table defined in a with clause.
- If so set the reference to the definition in tables->with.
- */
- if (!tables->with)
- tables->with= tables->select_lex->find_table_def_in_with_clauses(tables);
- /*
- If 'tables' is defined in a with clause set the pointer to the
- specification from its definition in tables->derived.
- */
- if (tables->with)
- {
- if (tables->is_recursive_with_table() &&
- !tables->is_with_table_recursive_reference())
- {
- tables->with->rec_outer_references++;
- With_element *with_elem= tables->with;
- while ((with_elem= with_elem->get_next_mutually_recursive()) !=
- tables->with)
- with_elem->rec_outer_references++;
- }
- if (tables->set_as_with_table(thd, tables->with))
- DBUG_RETURN(1);
- else
- goto end;
- }
- }
if (!tables->derived &&
is_infoschema_db(tables->db, tables->db_length))
@@ -3985,13 +3960,19 @@ bool open_tables(THD *thd, const DDL_options_st &options,
bool has_prelocking_list;
DBUG_ENTER("open_tables");
- /* Accessing data in XA_IDLE or XA_PREPARED is not allowed. */
- enum xa_states xa_state= thd->transaction.xid_state.xa_state;
- if (*start && (xa_state == XA_IDLE || xa_state == XA_PREPARED))
- {
- my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]);
- DBUG_RETURN(true);
- }
+ /* Data access in XA transaction is only allowed when it is active. */
+ for (TABLE_LIST *table= *start; table; table= table->next_global)
+ if (!table->schema_table)
+ {
+ enum xa_states xa_state= thd->transaction.xid_state.xa_state;
+ if (xa_state == XA_IDLE || xa_state == XA_PREPARED)
+ {
+ my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]);
+ DBUG_RETURN(true);
+ }
+ else
+ break;
+ }
thd->current_tablenr= 0;
restart:
@@ -4939,7 +4920,6 @@ bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags,
uint counter;
MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("open_normal_and_derived_tables");
- DBUG_ASSERT(!thd->fill_derived_tables());
if (open_tables(thd, &tables, &counter, flags, &prelocking_strategy) ||
mysql_handle_derived(thd->lex, dt_phases))
goto end;
@@ -5859,7 +5839,7 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
{
TABLE *table= field_to_set->table;
if (thd->mark_used_columns == MARK_COLUMNS_READ)
- bitmap_set_bit(table->read_set, field_to_set->field_index);
+ field_to_set->register_field_in_read_map();
else
bitmap_set_bit(table->write_set, field_to_set->field_index);
}
@@ -6046,7 +6026,7 @@ find_field_in_tables(THD *thd, Item_ident *item,
if (!all_merged && current_sel != last_select)
{
mark_select_range_as_dependent(thd, last_select, current_sel,
- found, *ref, item);
+ found, *ref, item, true);
}
}
return found;
@@ -6460,6 +6440,7 @@ set_new_item_local_context(THD *thd, Item_ident *item, TABLE_LIST *table_ref)
if (!(context= new (thd->mem_root) Name_resolution_context))
return TRUE;
context->init();
+ context->select_lex= table_ref->select_lex;
context->first_name_resolution_table=
context->last_name_resolution_table= table_ref;
item->context= context;
@@ -7213,6 +7194,18 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
DBUG_RETURN(0);
}
+/** Transforms b= F(DEFAULT) -> b= F(DEFAULT(b)) */
+void setup_defaults(THD *thd, List<Item> &fields, List<Item> &values)
+{
+ List_iterator<Item> fit(fields);
+ List_iterator<Item> vit(values);
+
+ for (Item *value= vit++, *f_item= fit++; value; value= vit++, f_item= fit++)
+ {
+ value->walk(&Item::enchant_default_with_arg_processor, false, f_item);
+ }
+}
+
/****************************************************************************
** Check that all given fields exists and fill struct with current data
****************************************************************************/
@@ -7501,7 +7494,8 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
if (table_list->jtbm_subselect)
{
Item *item= table_list->jtbm_subselect->optimizer;
- if (table_list->jtbm_subselect->optimizer->fix_fields(thd, &item))
+ if (!table_list->jtbm_subselect->optimizer->fixed &&
+ table_list->jtbm_subselect->optimizer->fix_fields(thd, &item))
{
my_error(ER_TOO_MANY_TABLES,MYF(0), static_cast<int>(MAX_TABLES)); /* psergey-todo: WHY ER_TOO_MANY_TABLES ???*/
DBUG_RETURN(1);
@@ -8813,6 +8807,23 @@ int dynamic_column_error_message(enum_dyncol_func_result rc)
return rc;
}
+
+/**
+ Turn on the SELECT_DESCRIBE flag for the primary SELECT_LEX of the statement
+ being processed in case the statement is EXPLAIN UPDATE/DELETE.
+
+ @param lex current LEX
+*/
+
+void promote_select_describe_flag_if_needed(LEX *lex)
+{
+ if (lex->describe)
+ {
+ lex->select_lex.options |= SELECT_DESCRIBE;
+ }
+}
+
+
/**
@} (end of group Data_Dictionary)
*/
diff --git a/sql/sql_base.h b/sql/sql_base.h
index b67341bcbda..b3b0a11795d 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -172,6 +172,7 @@ bool setup_fields(THD *thd, Ref_ptr_array ref_pointer_array,
List<Item> &item, enum_mark_columns mark_used_columns,
List<Item> *sum_func_list, List<Item> *pre_fix,
bool allow_sum_func);
+void setup_defaults(THD *thd, List<Item> &fields, List<Item> &values);
void unfix_fields(List<Item> &items);
bool fill_record(THD * thd, TABLE *table_arg, List<Item> &fields,
List<Item> &values, bool ignore_errors, bool update);
@@ -516,6 +517,8 @@ bool extend_table_list(THD *thd, TABLE_LIST *tables,
Prelocking_strategy *prelocking_strategy,
bool has_prelocking_list);
+void promote_select_describe_flag_if_needed(LEX *lex);
+
/**
A context of open_tables() function, used to recover
from a failed open_table() or open_routine() attempt.
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 047d6517a4b..5ada018e540 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -2525,6 +2525,60 @@ void THD::close_active_vio()
#endif
+/*
+ @brief MySQL parser used for recursive invocations
+
+ @param old_lex The LEX structure in the state when this parser
+ is called recursively
+ @param lex The LEX structure used to parse a new SQL fragment
+ @param str The SQL fragment to parse
+ @param str_len The length of the SQL fragment to parse
+ @param stmt_prepare_mode true <=> when parsing a prepare statement
+
+ @details
+ This function is to be used when parsing of an SQL fragment is
+ needed within one of the grammar rules.
+
+ @notes
+ Currently the function is used only when the specification of a CTE
+ is parsed for the not first and not recursive references of the CTE.
+
+ @retval false On a successful parsing of the fragment
+ @retval true Otherwise
+*/
+
+bool THD::sql_parser(LEX *old_lex, LEX *lex,
+ char *str, uint str_len, bool stmt_prepare_mode)
+{
+ extern int MYSQLparse(THD * thd);
+
+ bool parse_status= false;
+ Parser_state parser_state;
+ Parser_state *old_parser_state= m_parser_state;
+
+ if (parser_state.init(this, str, str_len))
+ return true;
+
+ m_parser_state= &parser_state;
+ parser_state.m_lip.stmt_prepare_mode= stmt_prepare_mode;
+ parser_state.m_lip.multi_statements= false;
+ parser_state.m_lip.m_digest= NULL;
+
+ lex->param_list= old_lex->param_list;
+ lex->sphead= old_lex->sphead;
+ lex->spname= old_lex->spname;
+ lex->spcont= old_lex->spcont;
+ lex->sp_chistics= old_lex->sp_chistics;
+ lex->trg_chistics= old_lex->trg_chistics;
+
+ parse_status= MYSQLparse(this) != 0;
+
+ m_parser_state= old_parser_state;
+
+ return parse_status;
+}
+
+
struct Item_change_record: public ilink
{
Item **place;
@@ -4424,7 +4478,7 @@ TABLE *open_purge_table(THD *thd, const char *db, size_t dblen,
DBUG_ASSERT(thd->open_tables == NULL);
DBUG_ASSERT(thd->locked_tables_mode < LTM_PRELOCKED);
- Open_table_context ot_ctx(thd, 0);
+ Open_table_context ot_ctx(thd, MYSQL_OPEN_IGNORE_FLUSH);
TABLE_LIST *tl= (TABLE_LIST*)thd->alloc(sizeof(TABLE_LIST));
tl->init_one_table(db, dblen, tb, tblen, tb, TL_READ);
@@ -6627,8 +6681,8 @@ void THD::binlog_prepare_row_images(TABLE *table)
{
case BINLOG_ROW_IMAGE_MINIMAL:
/* MINIMAL: Mark only PK */
- table->mark_columns_used_by_index(table->s->primary_key,
- &table->tmp_set);
+ table->mark_index_columns(table->s->primary_key,
+ &table->tmp_set);
break;
case BINLOG_ROW_IMAGE_NOBLOB:
/**
diff --git a/sql/sql_class.h b/sql/sql_class.h
index c47ea9c9020..5f871f9caf6 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -921,7 +921,7 @@ mysqld_collation_get_by_name(const char *name,
static inline bool is_supported_parser_charset(CHARSET_INFO *cs)
{
- return MY_TEST(cs->mbminlen == 1);
+ return MY_TEST(cs->mbminlen == 1 && cs->number != 17 /* filename */);
}
#ifdef MYSQL_SERVER
@@ -3469,10 +3469,6 @@ public:
{
return server_status & SERVER_STATUS_IN_TRANS;
}
- inline bool fill_derived_tables()
- {
- return !stmt_arena->is_stmt_prepare() && !lex->only_view_structure();
- }
inline bool fill_information_schema_tables()
{
return !stmt_arena->is_stmt_prepare();
@@ -4006,14 +4002,9 @@ public:
to resolve all CTE names as we don't need this message to be thrown
for any CTE references.
*/
- if (!lex->with_clauses_list)
- {
+ if (!lex->with_cte_resolution)
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
- return TRUE;
- }
- /* This will allow to throw an error later for non-CTE references */
- *p_db= NULL;
- *p_db_length= 0;
+ return TRUE;
}
else
{
@@ -4534,7 +4525,8 @@ public:
transaction.all.m_unsafe_rollback_flags|=
(transaction.stmt.m_unsafe_rollback_flags &
(THD_TRANS::DID_WAIT | THD_TRANS::CREATED_TEMP_TABLE |
- THD_TRANS::DROPPED_TEMP_TABLE | THD_TRANS::DID_DDL));
+ THD_TRANS::DROPPED_TEMP_TABLE | THD_TRANS::DID_DDL |
+ THD_TRANS::EXECUTED_TABLE_ADMIN_CMD));
}
/*
Reset current_linfo
@@ -4548,6 +4540,10 @@ public:
current_linfo= 0;
mysql_mutex_unlock(&LOCK_thread_count);
}
+
+ bool sql_parser(LEX *old_lex, LEX *lex,
+ char *str, uint str_len, bool stmt_prepare_mode);
+
};
inline void add_to_active_threads(THD *thd)
@@ -5600,7 +5596,8 @@ public:
class multi_update :public select_result_interceptor
{
TABLE_LIST *all_tables; /* query/update command tables */
- List<TABLE_LIST> *leaves; /* list of leves of join table tree */
+ List<TABLE_LIST> *leaves; /* list of leaves of join table tree */
+ List<TABLE_LIST> updated_leaves; /* list of of updated leaves */
TABLE_LIST *update_tables, *table_being_updated;
TABLE **tmp_tables, *main_table, *table_to_update;
TMP_TABLE_PARAM *tmp_table_param;
@@ -5632,6 +5629,7 @@ public:
List<Item> *fields, List<Item> *values,
enum_duplicates handle_duplicates, bool ignore);
~multi_update();
+ bool init(THD *thd);
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
int send_data(List<Item> &items);
bool initialize_tables (JOIN *join);
diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc
index 3a2301a5730..22a99842f6a 100644
--- a/sql/sql_cte.cc
+++ b/sql/sql_cte.cc
@@ -58,7 +58,7 @@ bool With_clause::add_with_element(With_element *elem)
true on failure
*/
-bool check_dependencies_in_with_clauses(With_clause *with_clauses_list)
+bool LEX::check_dependencies_in_with_clauses()
{
for (With_clause *with_clause= with_clauses_list;
with_clause;
@@ -76,6 +76,200 @@ bool check_dependencies_in_with_clauses(With_clause *with_clauses_list)
/**
@brief
+ Resolve references to CTE in specification of hanging CTE
+
+ @details
+ A CTE to which there are no references in the query is called hanging CTE.
+ Although such CTE is not used for execution its specification must be
+ subject to context analysis. All errors concerning references to
+ non-existing tables or fields occurred in the specification must be
+ reported as well as all other errors caught at the prepare stage.
+ The specification of a hanging CTE might contain references to other
+ CTE outside of the specification and within it if the specification
+ contains a with clause. This function resolves all such references for
+ all hanging CTEs encountered in the processed query.
+
+ @retval
+ false on success
+ true on failure
+*/
+
+bool
+LEX::resolve_references_to_cte_in_hanging_cte()
+{
+ for (With_clause *with_clause= with_clauses_list;
+ with_clause; with_clause= with_clause->next_with_clause)
+ {
+ for (With_element *with_elem= with_clause->with_list.first;
+ with_elem; with_elem= with_elem->next)
+ {
+ if (!with_elem->is_referenced())
+ {
+ TABLE_LIST *first_tbl=
+ with_elem->spec->first_select()->table_list.first;
+ TABLE_LIST **with_elem_end_pos= with_elem->head->tables_pos.end_pos;
+ if (first_tbl && resolve_references_to_cte(first_tbl, with_elem_end_pos))
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+
+/**
+ @brief
+ Resolve table references to CTE from a sub-chain of table references
+
+ @param tables Points to the beginning of the sub-chain
+ @param tables_last Points to the address with the sub-chain barrier
+
+ @details
+ The method resolves tables references to CTE from the chain of
+ table references specified by the parameters 'tables' and 'tables_last'.
+ It resolves the references against the CTE definition occurred in a query
+ or the specification of a CTE whose parsing tree is represented by
+ this LEX structure. The method is always called right after the process
+ of parsing the query or of the specification of a CTE has been finished,
+ thus the chain of table references used in the parsed fragment has been
+ already built. It is assumed that parameters of the method specify a
+ a sub-chain of this chain.
+ If a table reference can be potentially a table reference to a CTE and it
+ has not been resolved yet then the method tries to find the definition
+ of the CTE against which the reference can be resolved. If it succeeds
+ it sets the field TABLE_LIST::with to point to the found definition.
+ It also sets the field TABLE_LIST::derived to point to the specification
+ of the found CTE and sets TABLE::db.str to empty_c_string. This will
+ allow to handle this table reference like a reference to a derived handle.
+ If another table reference has been already resolved against this CTE
+ and this CTE is not recursive then a clone of the CTE specification is
+ constructed using the function With_element::clone_parsed_spec() and
+ TABLE_LIST::derived is set to point to this clone rather than to the
+ original specification.
+ If the method does not find a matched CTE definition in the parsed fragment
+ then in the case when the flag this->only_cte_resolution is set to true
+ it just moves to the resolution of the next table reference from the
+ specified sub-chain while in the case when this->only_cte_resolution is set
+ to false the method additionally sets an mdl request for this table
+ reference.
+
+ @notes
+ The flag this->only_cte_resolution is set to true in the cases when
+ the failure to resolve a table reference as a CTE reference within
+ the fragment associated with this LEX structure does not imply that
+ this table reference cannot be resolved as such at all.
+
+ @retval false On success: no errors reported, no memory allocations failed
+ @retval true Otherwise
+*/
+
+bool LEX::resolve_references_to_cte(TABLE_LIST *tables,
+ TABLE_LIST **tables_last)
+{
+ With_element *with_elem= 0;
+
+ for (TABLE_LIST *tbl= tables; tbl != *tables_last; tbl= tbl->next_global)
+ {
+ if (tbl->derived)
+ continue;
+ if (!tbl->db && !tbl->with)
+ tbl->with= tbl->select_lex->find_table_def_in_with_clauses(tbl);
+ if (!tbl->with) // no CTE matches table reference tbl
+ {
+ if (only_cte_resolution)
+ continue;
+ if (!tbl->db) // no database specified in table reference tbl
+ {
+ if (!thd->db) // no default database is set
+ {
+ my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
+ return true;
+ }
+ if (copy_db_to(&tbl->db, &tbl->db_length))
+ return true;
+ if (!(tbl->table_options & TL_OPTION_ALIAS))
+ tbl->mdl_request.init(MDL_key::TABLE, tbl->db,
+ tbl->table_name,
+ tbl->mdl_type, MDL_TRANSACTION);
+ tbl->mdl_request.set_type((tbl->lock_type >= TL_WRITE_ALLOW_WRITE) ?
+ MDL_SHARED_WRITE : MDL_SHARED_READ);
+ }
+ continue;
+ }
+ with_elem= tbl->with;
+ if (tbl->is_recursive_with_table() &&
+ !tbl->is_with_table_recursive_reference())
+ {
+ tbl->with->rec_outer_references++;
+ while ((with_elem= with_elem->get_next_mutually_recursive()) !=
+ tbl->with)
+ with_elem->rec_outer_references++;
+ }
+ if (!with_elem->is_used_in_query || with_elem->is_recursive)
+ {
+ tbl->derived= with_elem->spec;
+ if (tbl->derived != tbl->select_lex->master_unit() &&
+ !with_elem->is_recursive &&
+ !tbl->is_with_table_recursive_reference())
+ {
+ tbl->derived->move_as_slave(tbl->select_lex);
+ }
+ with_elem->is_used_in_query= true;
+ }
+ else
+ {
+ if (!(tbl->derived= tbl->with->clone_parsed_spec(thd->lex, tbl)))
+ return true;
+ }
+ tbl->db= empty_c_string;
+ tbl->db_length= 0;
+ tbl->schema_table= 0;
+ if (tbl->derived)
+ {
+ tbl->derived->first_select()->linkage= DERIVED_TABLE_TYPE;
+ }
+ if (tbl->with->is_recursive && tbl->is_with_table_recursive_reference())
+ continue;
+ with_elem->inc_references();
+ }
+ return false;
+}
+
+
+/**
+ @brief
+ Find out dependencies between CTEs, resolve references to them
+
+ @details
+ The function can be called in two modes. With this->with_cte_resolution
+ set to false the function only finds out all dependencies between CTEs
+ used in a query expression with a WITH clause whose parsing has been
+ just finished. Based on these dependencies recursive CTEs are detected.
+ If this->with_cte_resolution is set to true the function additionally
+ resolves all references to CTE occurred in this query expression.
+
+ @retval
+ true on failure
+ false on success
+*/
+
+bool
+LEX::check_cte_dependencies_and_resolve_references()
+{
+ if (check_dependencies_in_with_clauses())
+ return true;
+ if (!with_cte_resolution)
+ return false;
+ if (resolve_references_to_cte(query_tables, query_tables_last))
+ return true;
+ if (resolve_references_to_cte_in_hanging_cte())
+ return true;
+ return false;
+}
+
+
+/**
+ @brief
Check dependencies between tables defined in this with clause
@details
@@ -112,10 +306,11 @@ bool With_clause::check_dependencies()
elem != with_elem;
elem= elem->next)
{
- if (my_strcasecmp(system_charset_info, with_elem->query_name->str,
- elem->query_name->str) == 0)
+ if (my_strcasecmp(system_charset_info, with_elem->get_name_str(),
+ elem->get_name_str()) == 0)
{
- my_error(ER_DUP_QUERY_NAME, MYF(0), with_elem->query_name->str);
+ my_error(ER_DUP_QUERY_NAME, MYF(0),
+ with_elem->get_name_str());
return true;
}
}
@@ -222,12 +417,12 @@ With_element *With_clause::find_table_def(TABLE_LIST *table,
with_elem != barrier;
with_elem= with_elem->next)
{
- if (my_strcasecmp(system_charset_info, with_elem->query_name->str,
- table->table_name) == 0 &&
+ if (my_strcasecmp(system_charset_info, with_elem->get_name_str(),
+ table->table_name) == 0 &&
!table->is_fqtn)
{
table->set_derived();
- table->db= empty_c_string;
+ with_elem->referenced= true;
return with_elem;
}
}
@@ -584,7 +779,7 @@ bool With_clause::check_anchors()
if (elem == with_elem)
{
my_error(ER_RECURSIVE_WITHOUT_ANCHORS, MYF(0),
- with_elem->query_name->str);
+ with_elem->get_name_str());
return true;
}
}
@@ -617,7 +812,7 @@ bool With_clause::check_anchors()
if (elem->work_dep_map & elem->get_elem_map())
{
my_error(ER_UNACCEPTABLE_MUTUAL_RECURSION, MYF(0),
- with_elem->query_name->str);
+ with_elem->get_name_str());
return true;
}
}
@@ -716,7 +911,8 @@ bool With_clause::prepare_unreferenced_elements(THD *thd)
with_elem;
with_elem= with_elem->next)
{
- if (!with_elem->is_referenced() && with_elem->prepare_unreferenced(thd))
+ if ((with_elem->is_hanging_recursive() || !with_elem->is_referenced()) &&
+ with_elem->prepare_unreferenced(thd))
return true;
}
@@ -771,7 +967,8 @@ bool With_element::set_unparsed_spec(THD *thd, char *spec_start, char *spec_end,
@brief
Create a clone of the specification for the given with table
- @param thd The context of the statement containing this with element
+ @param old_lex The LEX structure created for the query or CTE specification
+ where this With_element is defined
@param with_table The reference to the table defined in this element for which
the clone is created.
@@ -781,12 +978,13 @@ bool With_element::set_unparsed_spec(THD *thd, char *spec_start, char *spec_end,
this element.
The clone is created when the string with the specification saved in
unparsed_spec is fed into the parser as an input string. The parsing
- this string a unit object representing the specification is build.
+ this string a unit object representing the specification is built.
A chain of all table references occurred in the specification is also
formed.
The method includes the new unit and its sub-unit into hierarchy of
the units of the main query. I also insert the constructed chain of the
table references into the chain of all table references of the main query.
+ The method resolves all references to CTE in the clone.
@note
Clones is created only for not first references to tables defined in
@@ -802,115 +1000,134 @@ bool With_element::set_unparsed_spec(THD *thd, char *spec_start, char *spec_end,
NULL - otherwise
*/
-st_select_lex_unit *With_element::clone_parsed_spec(THD *thd,
+st_select_lex_unit *With_element::clone_parsed_spec(LEX *old_lex,
TABLE_LIST *with_table)
{
+ THD *thd= old_lex->thd;
LEX *lex;
- st_select_lex_unit *res= NULL;
- Query_arena backup;
- Query_arena *arena= thd->activate_stmt_arena_if_needed(&backup);
+ st_select_lex_unit *res= NULL;
if (!(lex= (LEX*) new(thd->mem_root) st_lex_local))
- {
- if (arena)
- thd->restore_active_arena(arena, &backup);
return res;
- }
- LEX *old_lex= thd->lex;
thd->lex= lex;
bool parse_status= false;
- Parser_state parser_state;
- TABLE_LIST *spec_tables;
- TABLE_LIST *spec_tables_tail;
st_select_lex *with_select;
+ st_select_lex *last_clone_select;
char save_end= unparsed_spec.str[unparsed_spec.length];
unparsed_spec.str[unparsed_spec.length]= '\0';
- if (parser_state.init(thd, unparsed_spec.str, unparsed_spec.length))
- goto err;
- parser_state.m_lip.stmt_prepare_mode= stmt_prepare_mode;
- parser_state.m_lip.multi_statements= false;
- parser_state.m_lip.m_digest= NULL;
lex_start(thd);
lex->clone_spec_offset= unparsed_spec_offset;
- lex->param_list= old_lex->param_list;
- lex->sphead= old_lex->sphead;
- lex->spname= old_lex->spname;
- lex->spcont= old_lex->spcont;
- lex->sp_chistics= old_lex->sp_chistics;
-
- lex->stmt_lex= old_lex;
- with_select= &lex->select_lex;
- with_select->select_number= ++thd->lex->stmt_lex->current_select_number;
- parse_status= parse_sql(thd, &parser_state, 0);
+ lex->with_cte_resolution= true;
+
+ /*
+ The specification of a CTE is to be parsed as a regular query.
+ At the very end of the parsing query the function
+ check_cte_dependencies_and_resolve_references() will be called.
+ It will check the dependencies between CTEs that are defined
+ within the query and will resolve CTE references in this query.
+ If a table reference is not resolved as a CTE reference within
+ this query it still can be resolved as a reference to a CTE defined
+ in the same clause as the CTE whose specification is to be parsed
+ or defined in an embedding CTE definition.
+
+ Example:
+ with
+ cte1 as ( ... ),
+ cte2 as ([WITH ...] select ... from cte1 ...)
+ select ... from cte2 as r, ..., cte2 as s ...
+
+ Here the specification of cte2 has be cloned for table reference
+ with alias s1. The specification contains a reference to cte1
+ that is defined outside this specification. If the reference to
+ cte1 cannot be resolved within the specification of cte2 it's
+ not necessarily has to be a reference to a non-CTE table. That's
+ why the flag lex->only_cte_resolution has to be set to true
+ before parsing of the specification of cte2 invoked by this
+ function starts. Otherwise an mdl_lock would be requested for s
+ and this would not be correct.
+ */
+
+ lex->only_cte_resolution= true;
+
+ lex->stmt_lex= old_lex->stmt_lex ? old_lex->stmt_lex : old_lex;
+
+ parse_status= thd->sql_parser(old_lex, lex,
+ (char*) unparsed_spec.str,
+ (unsigned int)unparsed_spec.length,
+ stmt_prepare_mode);
+
unparsed_spec.str[unparsed_spec.length]= save_end;
+ with_select= lex->unit.first_select();
+ with_select->select_number= ++lex->stmt_lex->current_select_number;
if (parse_status)
goto err;
- if (check_dependencies_in_with_clauses(lex->with_clauses_list))
- goto err;
-
- spec_tables= lex->query_tables;
- spec_tables_tail= 0;
- for (TABLE_LIST *tbl= spec_tables;
- tbl;
- tbl= tbl->next_global)
- {
- if (!tbl->derived && !tbl->schema_table &&
- thd->open_temporary_table(tbl))
- goto err;
- spec_tables_tail= tbl;
- }
- if (spec_tables)
+ /*
+ The global chain of TABLE_LIST objects created for the specification that
+ just has been parsed is added to such chain that contains the reference
+ to the CTE whose specification is parsed right after the TABLE_LIST object
+ created for the reference.
+ */
+ if (lex->query_tables)
{
- if (with_table->next_global)
+ head->tables_pos.set_start_pos(&with_table->next_global);
+ head->tables_pos.set_end_pos(lex->query_tables_last);
+ TABLE_LIST *next_tbl= with_table->next_global;
+ if (next_tbl)
{
- spec_tables_tail->next_global= with_table->next_global;
- with_table->next_global->prev_global= &spec_tables_tail->next_global;
+ *(lex->query_tables->prev_global= next_tbl->prev_global)=
+ lex->query_tables;
+ *(next_tbl->prev_global= lex->query_tables_last)= next_tbl;
}
else
{
- old_lex->query_tables_last= &spec_tables_tail->next_global;
+ *(lex->query_tables->prev_global= old_lex->query_tables_last)=
+ lex->query_tables;
+ old_lex->query_tables_last= lex->query_tables_last;
}
- spec_tables->prev_global= &with_table->next_global;
- with_table->next_global= spec_tables;
}
res= &lex->unit;
res->with_element= this;
+ /*
+ The unit of the specification that just has been parsed is included
+ as a slave of the select that contained in its from list the table
+ reference for which the unit has been created.
+ */
lex->unit.include_down(with_table->select_lex);
- lex->unit.set_slave(with_select);
- old_lex->all_selects_list=
- (st_select_lex*) (lex->all_selects_list->
- insert_chain_before(
- (st_select_lex_node **) &(old_lex->all_selects_list),
- with_select));
- if (check_dependencies_in_with_clauses(lex->with_clauses_list))
- res= NULL;
+ lex->unit.set_slave(with_select);
+ lex->unit.cloned_from= spec;
+
/*
- Resolve references to CTE from the spec_tables list that has not
- been resolved yet.
+ Now all references to the CTE defined outside of the cloned specification
+ has to be resolved. Additionally if old_lex->only_cte_resolution == false
+ for the table references that has not been resolved requests for mdl_locks
+ has to be set.
*/
- for (TABLE_LIST *tbl= spec_tables;
- tbl;
- tbl= tbl->next_global)
+ lex->only_cte_resolution= old_lex->only_cte_resolution;
+ if (lex->resolve_references_to_cte(lex->query_tables,
+ lex->query_tables_last))
{
- if (!tbl->with)
- tbl->with= with_select->find_table_def_in_with_clauses(tbl);
- if (tbl == spec_tables_tail)
- break;
- }
- if (check_table_access(thd, SELECT_ACL, spec_tables, FALSE, UINT_MAX, FALSE))
+ res= NULL;
goto err;
+ }
- lex->sphead= NULL; // in order not to delete lex->sphead
+ last_clone_select= lex->all_selects_list;
+ while (last_clone_select->next_select_in_list())
+ last_clone_select= last_clone_select->next_select_in_list();
+ old_lex->all_selects_list=
+ (st_select_lex*) (lex->all_selects_list->
+ insert_chain_before(
+ (st_select_lex_node **) &(old_lex->all_selects_list),
+ last_clone_select));
+
+ lex->sphead= NULL; // in order not to delete lex->sphead
lex_end(lex);
err:
- if (arena)
- thd->restore_active_arena(arena, &backup);
thd->lex= old_lex;
return res;
}
@@ -1045,6 +1262,7 @@ bool With_element::is_anchor(st_select_lex *sel)
With_element *st_select_lex::find_table_def_in_with_clauses(TABLE_LIST *table)
{
With_element *found= NULL;
+ With_clause *containing_with_clause= NULL;
st_select_lex_unit *master_unit;
st_select_lex *outer_sl;
for (st_select_lex *sl= this; sl; sl= outer_sl)
@@ -1057,6 +1275,7 @@ With_element *st_select_lex::find_table_def_in_with_clauses(TABLE_LIST *table)
*/
With_clause *attached_with_clause= sl->get_with_clause();
if (attached_with_clause &&
+ attached_with_clause != containing_with_clause &&
(found= attached_with_clause->find_table_def(table, NULL)))
break;
master_unit= sl->master_unit();
@@ -1064,7 +1283,7 @@ With_element *st_select_lex::find_table_def_in_with_clauses(TABLE_LIST *table)
With_element *with_elem= sl->get_with_element();
if (with_elem)
{
- With_clause *containing_with_clause= with_elem->get_owner();
+ containing_with_clause= with_elem->get_owner();
With_element *barrier= containing_with_clause->with_recursive ?
NULL : with_elem;
if ((found= containing_with_clause->find_table_def(table, barrier)))
@@ -1080,58 +1299,6 @@ With_element *st_select_lex::find_table_def_in_with_clauses(TABLE_LIST *table)
}
-/**
- @brief
- Set the specifying unit in this reference to a with table
-
- @details
- The method assumes that the given element with_elem defines the table T
- this table reference refers to.
- If this is the first reference to T the method just sets its specification
- in the field 'derived' as the unit that yields T. Otherwise the method
- first creates a clone specification and sets rather this clone in this field.
-
- @retval
- false on success
- true on failure
-*/
-
-bool TABLE_LIST::set_as_with_table(THD *thd, With_element *with_elem)
-{
- if (table)
- {
- /*
- This table was prematurely identified as a temporary table.
- We correct it here, but it's not a nice solution in the case
- when the temporary table with this name is not used anywhere
- else in the query.
- */
- thd->mark_tmp_table_as_free_for_reuse(table);
- table= 0;
- }
- with= with_elem;
- schema_table= NULL;
- if (!with_elem->is_referenced() || with_elem->is_recursive)
- {
- derived= with_elem->spec;
- if (derived != select_lex->master_unit() &&
- !with_elem->is_recursive &&
- !is_with_table_recursive_reference())
- {
- derived->move_as_slave(select_lex);
- }
- }
- else
- {
- if(!(derived= with_elem->clone_parsed_spec(thd, this)))
- return true;
- }
- derived->first_select()->linkage= DERIVED_TABLE_TYPE;
- with_elem->inc_references();
- return false;
-}
-
-
bool TABLE_LIST::is_recursive_with_table()
{
return with && with->is_recursive;
@@ -1231,7 +1398,7 @@ bool st_select_lex::check_unrestricted_recursive(bool only_standard_compliant)
if (only_standard_compliant && with_elem->is_unrestricted())
{
my_error(ER_NOT_STANDARD_COMPLIANT_RECURSIVE,
- MYF(0), with_elem->query_name->str);
+ MYF(0), with_elem->get_name_str());
return true;
}
@@ -1372,7 +1539,7 @@ bool st_select_lex::check_subqueries_with_recursive_references()
sl_master->derived && sl_master->derived->is_materialized_derived())
{
my_error(ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED,
- MYF(0), with_elem->query_name->str);
+ MYF(0), with_elem->get_name_str());
return true;
}
if (!sl_master->item)
@@ -1434,7 +1601,23 @@ void With_clause::print(String *str, enum_query_type query_type)
void With_element::print(String *str, enum_query_type query_type)
{
- str->append(query_name);
+ str->append(get_name());
+ if (column_list.elements)
+ {
+ List_iterator_fast<LEX_STRING> li(column_list);
+ str->append('(');
+ for (LEX_STRING *col_name= li++; ; )
+ {
+ str->append(col_name);
+ col_name= li++;
+ if (!col_name)
+ {
+ str->append(')');
+ break;
+ }
+ str->append(',');
+ }
+ }
str->append(STRING_WITH_LEN(" as "));
str->append('(');
spec->print(str, query_type);
diff --git a/sql/sql_cte.h b/sql/sql_cte.h
index 58f371d936b..d484dcf123e 100644
--- a/sql/sql_cte.h
+++ b/sql/sql_cte.h
@@ -9,6 +9,39 @@ struct st_unit_ctxt_elem;
/**
+ @class With_element_head
+ @brief Head of the definition of a CTE table
+
+ It contains the name of the CTE and it contains the position of the subchain
+ of table references used in the definition in the global chain of table
+ references used in the query where this definition is encountered.
+*/
+
+class With_element_head : public Sql_alloc
+{
+ /* The name of the defined CTE */
+ LEX_CSTRING *query_name;
+
+public:
+ /*
+ The structure describing the subchain of the table references used in
+ the specification of the defined CTE in the global chain of table
+ references used in the query. The structure is fully defined only
+ after the CTE definition has been parsed.
+ */
+ TABLE_CHAIN tables_pos;
+
+ With_element_head(LEX_CSTRING *name)
+ : query_name(name)
+ {
+ tables_pos.set_start_pos(0);
+ tables_pos.set_end_pos(0);
+ }
+ friend class With_element;
+};
+
+
+/**
@class With_element
@brief Definition of a CTE table
@@ -69,9 +102,22 @@ private:
subqueries and specifications of other with elements).
*/
uint references;
+
+ /*
+ true <=> this With_element is referred in the query in which the
+ element is defined
+ */
+ bool referenced;
+
+ /*
+ true <=> this With_element is needed for the execution of the query
+ in which the element is defined
+ */
+ bool is_used_in_query;
+
/*
Unparsed specification of the query that specifies this element.
- It used to build clones of the specification if they are needed.
+ It's used to build clones of the specification if they are needed.
*/
LEX_STRING unparsed_spec;
/* Offset of the specification in the input string */
@@ -85,10 +131,11 @@ private:
public:
/*
- The name of the table introduced by this with elememt. The name
- can be used in FROM lists of the queries in the scope of the element.
+ Contains the name of the defined With element and the position of
+ the subchain of the tables references used by its definition in the
+ global chain of TABLE_LIST objects created for the whole query.
*/
- LEX_STRING *query_name;
+ With_element_head *head;
/*
Optional list of column names to name the columns of the table introduced
by this with element. It is used in the case when the names are not
@@ -144,18 +191,27 @@ public:
/* List of Item_subselects containing recursive references to this CTE */
SQL_I_List<Item_subselect> sq_with_rec_ref;
- With_element(LEX_STRING *name,
+ With_element(With_element_head *h,
List <LEX_STRING> list,
st_select_lex_unit *unit)
: next(NULL), base_dep_map(0), derived_dep_map(0),
sq_dep_map(0), work_dep_map(0), mutually_recursive(0),
top_level_dep_map(0), sq_rec_ref(NULL),
next_mutually_recursive(NULL), references(0),
- query_name(name), column_list(list), spec(unit),
+ referenced(false), is_used_in_query(false),
+ head(h), column_list(list), spec(unit),
is_recursive(false), rec_outer_references(0), with_anchor(false),
level(0), rec_result(NULL)
{ unit->with_element= this; }
+ LEX_CSTRING *get_name() { return head->query_name; }
+ const char *get_name_str() { return get_name()->str; }
+
+ void set_tables_start_pos(TABLE_LIST **pos)
+ { head->tables_pos.set_start_pos(pos); }
+ void set_tables_end_pos(TABLE_LIST **pos)
+ { head->tables_pos.set_end_pos(pos); }
+
bool check_dependencies_in_spec();
void check_dependencies_in_select(st_select_lex *sl, st_unit_ctxt_elem *ctxt,
@@ -182,9 +238,11 @@ public:
bool set_unparsed_spec(THD *thd, char *spec_start, char *spec_end,
uint spec_offset);
- st_select_lex_unit *clone_parsed_spec(THD *thd, TABLE_LIST *with_table);
+ st_select_lex_unit *clone_parsed_spec(LEX *old_lex, TABLE_LIST *with_table);
+
+ bool is_referenced() { return referenced; }
- bool is_referenced() { return references != 0; }
+ bool is_hanging_recursive() { return is_recursive && !rec_outer_references; }
void inc_references() { references++; }
@@ -242,6 +300,12 @@ public:
void prepare_for_next_iteration();
friend class With_clause;
+
+ friend
+ bool LEX::resolve_references_to_cte(TABLE_LIST *tables,
+ TABLE_LIST **tables_last);
+ friend
+ bool LEX::resolve_references_to_cte_in_hanging_cte();
};
const uint max_number_of_elements_in_with_clause= sizeof(table_map)*8;
@@ -338,8 +402,10 @@ public:
friend class With_element;
friend
- bool
- check_dependencies_in_with_clauses(With_clause *with_clauses_list);
+ bool LEX::check_dependencies_in_with_clauses();
+
+ friend
+ bool LEX::resolve_references_to_cte_in_hanging_cte();
};
inline
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index e2d4cd47580..a26e15431a6 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -274,6 +274,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
query_plan.table= table;
query_plan.updating_a_view= MY_TEST(table_list->view);
+ promote_select_describe_flag_if_needed(thd->lex);
+
if (mysql_prepare_delete(thd, table_list, select_lex->with_wild,
select_lex->item_list, &conds))
DBUG_RETURN(TRUE);
@@ -841,14 +843,11 @@ int mysql_multi_delete_prepare(THD *thd)
DELETE_ACL, SELECT_ACL, FALSE))
DBUG_RETURN(TRUE);
- if (lex->select_lex.handle_derived(thd->lex, DT_MERGE))
- DBUG_RETURN(TRUE);
-
/*
Multi-delete can't be constructed over-union => we always have
single SELECT on top and have to check underlying SELECTs of it
*/
- lex->select_lex.exclude_from_table_unique_test= TRUE;
+ lex->select_lex.set_unique_exclude();
/* Fix tables-to-be-deleted-from list to point at opened tables */
for (target_tbl= (TABLE_LIST*) aux_tables;
target_tbl;
@@ -871,6 +870,12 @@ int mysql_multi_delete_prepare(THD *thd)
target_tbl->table_name, "DELETE");
DBUG_RETURN(TRUE);
}
+ }
+
+ for (target_tbl= (TABLE_LIST*) aux_tables;
+ target_tbl;
+ target_tbl= target_tbl->next_local)
+ {
/*
Check that table from which we delete is not used somewhere
inside subqueries/view.
@@ -915,12 +920,6 @@ multi_delete::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
unit= u;
do_delete= 1;
THD_STAGE_INFO(thd, stage_deleting_from_main_table);
- SELECT_LEX *select_lex= u->first_select();
- if (select_lex->first_cond_optimization)
- {
- if (select_lex->handle_derived(thd->lex, DT_MERGE))
- DBUG_RETURN(TRUE);
- }
DBUG_RETURN(0);
}
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index be5905da683..30bffeb7581 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -70,7 +70,6 @@ bool
mysql_handle_derived(LEX *lex, uint phases)
{
bool res= FALSE;
- THD *thd= lex->thd;
DBUG_ENTER("mysql_handle_derived");
DBUG_PRINT("enter", ("phases: 0x%x", phases));
if (!lex->derived_tables)
@@ -85,8 +84,6 @@ mysql_handle_derived(LEX *lex, uint phases)
break;
if (!(phases & phase_flag))
continue;
- if (phase_flag >= DT_CREATE && !thd->fill_derived_tables())
- break;
for (SELECT_LEX *sl= lex->all_selects_list;
sl && !res;
@@ -169,7 +166,6 @@ bool
mysql_handle_single_derived(LEX *lex, TABLE_LIST *derived, uint phases)
{
bool res= FALSE;
- THD *thd= lex->thd;
uint8 allowed_phases= (derived->is_merged_derived() ? DT_PHASES_MERGE :
DT_PHASES_MATERIALIZE);
DBUG_ENTER("mysql_handle_single_derived");
@@ -192,8 +188,6 @@ mysql_handle_single_derived(LEX *lex, TABLE_LIST *derived, uint phases)
if (phase_flag != DT_PREPARE &&
!(allowed_phases & phase_flag))
continue;
- if (phase_flag >= DT_CREATE && !thd->fill_derived_tables())
- break;
if ((res= (*processors[phase])(lex->thd, lex, derived)))
break;
@@ -354,10 +348,6 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
DBUG_RETURN(FALSE);
}
- if (thd->lex->sql_command == SQLCOM_UPDATE_MULTI ||
- thd->lex->sql_command == SQLCOM_DELETE_MULTI)
- thd->save_prep_leaf_list= TRUE;
-
arena= thd->activate_stmt_arena_if_needed(&backup); // For easier test
if (!derived->merged_for_insert ||
@@ -435,6 +425,7 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
derived->on_expr= expr;
derived->prep_on_expr= expr->copy_andor_structure(thd);
}
+ thd->where= "on clause";
if (derived->on_expr &&
((!derived->on_expr->fixed &&
derived->on_expr->fix_fields(thd, &derived->on_expr)) ||
@@ -563,6 +554,32 @@ bool mysql_derived_init(THD *thd, LEX *lex, TABLE_LIST *derived)
/*
+ @brief
+ Prevent name resolution out of context of ON expressions in derived tables
+
+ @param
+ join_list list of tables used in from list of a derived
+
+ @details
+ The function sets the Name_resolution_context::outer_context to NULL
+ for all ON expressions contexts in the given join list. It does this
+ recursively for all nested joins the list contains.
+*/
+
+static void nullify_outer_context_for_on_clauses(List<TABLE_LIST>& join_list)
+{
+ List_iterator<TABLE_LIST> li(join_list);
+ while (TABLE_LIST *table= li++)
+ {
+ if (table->on_context)
+ table->on_context->outer_context= NULL;
+ if (table->nested_join)
+ nullify_outer_context_for_on_clauses(table->nested_join->join_list);
+ }
+}
+
+
+/*
Create temporary table structure (but do not fill it)
@param thd Thread handle
@@ -695,7 +712,12 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
/* prevent name resolving out of derived table */
for (SELECT_LEX *sl= first_select; sl; sl= sl->next_select())
{
+ // Prevent it for the WHERE clause
sl->context.outer_context= 0;
+
+ // And for ON clauses, if there are any
+ nullify_outer_context_for_on_clauses(*sl->join_list);
+
if (!derived->is_with_table_recursive_reference() ||
(!derived->with->with_anchor &&
!derived->with->is_with_prepared_anchor()))
@@ -1069,7 +1091,7 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
res= derived->fill_recursive(thd);
}
}
- else if (unit->is_union())
+ else if (unit->is_union() || unit->fake_select_lex)
{
// execute union without clean up
res= unit->exec();
@@ -1170,6 +1192,68 @@ bool mysql_derived_reinit(THD *thd, LEX *lex, TABLE_LIST *derived)
}
+/*
+ @brief
+ Given condition cond and transformer+argument, try transforming as many
+ conjuncts as possible.
+
+ @detail
+ The motivation of this function is to convert the condition that's being
+ pushed into a WHERE clause with derived_field_transformer_for_where or
+ with derived_grouping_field_transformer_for_where.
+ The transformer may fail for some sub-condition, in this case we want to
+ convert the most restrictive part of the condition that can be pushed.
+
+ This function only does it for top-level AND: conjuncts that could not be
+ converted are dropped.
+
+ @return
+ Converted condition, or NULL if nothing could be converted
+*/
+
+static
+Item *transform_condition_or_part(THD *thd,
+ Item *cond,
+ Item_transformer transformer,
+ uchar *arg)
+{
+ if (cond->type() != Item::COND_ITEM ||
+ ((Item_cond*) cond)->functype() != Item_func::COND_AND_FUNC)
+ {
+ Item *new_item= cond->transform(thd, transformer, arg);
+ // Indicate that the condition is not pushable
+ if (!new_item)
+ cond->clear_extraction_flag();
+ return new_item;
+ }
+
+ List_iterator<Item> li(*((Item_cond*) cond)->argument_list());
+ Item *item;
+ while ((item=li++))
+ {
+ Item *new_item= item->transform(thd, transformer, arg);
+ if (!new_item)
+ {
+ // Indicate that the condition is not pushable
+ item->clear_extraction_flag();
+ li.remove();
+ }
+ else
+ li.replace(new_item);
+ }
+
+ switch (((Item_cond*) cond)->argument_list()->elements)
+ {
+ case 0:
+ return NULL;
+ case 1:
+ return ((Item_cond*) cond)->argument_list()->head();
+ default:
+ return cond;
+ }
+}
+
+
/**
@brief
Extract the condition depended on derived table/view and pushed it there
@@ -1265,9 +1349,11 @@ bool pushdown_cond_for_derived(THD *thd, Item *cond, TABLE_LIST *derived)
if (!sl->join->group_list && !sl->with_sum_func)
{
/* extracted_cond_copy is pushed into where of sl */
- extracted_cond_copy= extracted_cond_copy->transform(thd,
- &Item::derived_field_transformer_for_where,
- (uchar*) sl);
+ extracted_cond_copy=
+ transform_condition_or_part(thd,
+ extracted_cond_copy,
+ &Item::derived_field_transformer_for_where,
+ (uchar*)sl);
if (extracted_cond_copy)
{
extracted_cond_copy->walk(
@@ -1294,9 +1380,12 @@ bool pushdown_cond_for_derived(THD *thd, Item *cond, TABLE_LIST *derived)
pushed into the where clause of sl to make them usable in the new context
*/
if (cond_over_grouping_fields)
- cond_over_grouping_fields= cond_over_grouping_fields->transform(thd,
- &Item::derived_grouping_field_transformer_for_where,
- (uchar*) sl);
+ {
+ cond_over_grouping_fields=
+ transform_condition_or_part(thd, cond_over_grouping_fields,
+ &Item::derived_grouping_field_transformer_for_where,
+ (uchar*) sl);
+ }
if (cond_over_grouping_fields)
{
@@ -1348,4 +1437,3 @@ bool pushdown_cond_for_derived(THD *thd, Item *cond, TABLE_LIST *derived)
thd->lex->current_select= save_curr_select;
DBUG_RETURN(false);
}
-
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc
index ec58145bada..16d5daee5c7 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -1735,7 +1735,7 @@ void Explain_table_access::print_explain_json(Explain_query *query,
/*
- Elements in this array match members of enum Extra_tag, defined in
+ Elements in this array match members of enum explain_extra_tag, defined in
sql_explain.h
*/
diff --git a/sql/sql_explain.h b/sql/sql_explain.h
index 08af84b3562..852dc2df604 100644
--- a/sql/sql_explain.h
+++ b/sql/sql_explain.h
@@ -121,11 +121,13 @@ public:
*/
enum explain_connection_type connection_type;
+protected:
/*
A node may have children nodes. When a node's explain structure is
created, children nodes may not yet have QPFs. This is why we store ids.
*/
Dynamic_array<int> children;
+public:
void add_child(int select_no)
{
children.append(select_no);
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 7c2122b6a0a..ec3756eceba 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -697,6 +697,9 @@ retry:
if (!(handler= mysql_ha_find_handler(thd, tables->alias)))
goto err0;
+ if (thd->transaction.xid_state.check_has_uncommitted_xa())
+ goto err0;
+
table= handler->table;
tables->table= table; // This is used by fix_fields
table->pos_in_table_list= tables;
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index ec79ff6d688..13dbbaed539 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1257,7 +1257,18 @@ values_loop_end:
abort:
#ifndef EMBEDDED_LIBRARY
if (lock_type == TL_WRITE_DELAYED)
+ {
end_delayed_insert(thd);
+ /*
+ In case of an error (e.g. data truncation), the data type specific data
+ in fields (e.g. Field_blob::value) was not taken over
+ by the delayed writer thread. All fields in table_list->table
+ will be freed by free_root() soon. We need to free the specific
+ data before free_root() to avoid a memory leak.
+ */
+ for (Field **ptr= table_list->table->field ; *ptr ; ptr++)
+ (*ptr)->free();
+ }
#endif
if (table != NULL)
table->file->ha_release_auto_increment();
@@ -1753,9 +1764,10 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
in handler methods for the just read row in record[1].
*/
table->move_fields(table->field, table->record[1], table->record[0]);
- if (table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_REPLACE))
- goto err;
+ int verr = table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_REPLACE);
table->move_fields(table->field, table->record[0], table->record[1]);
+ if (verr)
+ goto err;
}
if (info->handle_duplicates == DUP_UPDATE)
{
@@ -4385,8 +4397,18 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
create_table,
alter_info, &values,
&extra_lock, hook_ptr)))
+ {
+ if (create_info->or_replace())
+ {
+ /* Original table was deleted. We have to log it */
+ log_drop_table(thd, create_table->db, create_table->db_length,
+ create_table->table_name, create_table->table_name_length,
+ thd->lex->tmp_table());
+ }
+
/* abort() deletes table */
DBUG_RETURN(-1);
+ }
if (create_info->tmp_table())
{
@@ -4686,12 +4708,6 @@ void select_create::abort_result_set()
/* possible error of writing binary log is ignored deliberately */
(void) thd->binlog_flush_pending_rows_event(TRUE, TRUE);
- if (create_info->table_was_deleted)
- {
- /* Unlock locked table that was dropped by CREATE */
- thd->locked_tables_list.unlock_locked_table(thd,
- create_info->mdl_ticket);
- }
if (table)
{
bool tmp_table= table->s->tmp_table;
@@ -4729,5 +4745,13 @@ void select_create::abort_result_set()
tmp_table);
}
}
+
+ if (create_info->table_was_deleted)
+ {
+ /* Unlock locked table that was dropped by CREATE. */
+ (void) trans_rollback_stmt(thd);
+ thd->locked_tables_list.unlock_locked_table(thd, create_info->mdl_ticket);
+ }
+
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 5059e4f656e..b7ed632ed12 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -704,6 +704,8 @@ void lex_start(THD *thd)
lex->subqueries= FALSE;
lex->context_analysis_only= 0;
lex->derived_tables= 0;
+ lex->with_cte_resolution= false;
+ lex->only_cte_resolution= false;
lex->safe_to_cache_query= 1;
lex->parsing_options.reset();
lex->empty_field_list_on_rset= 0;
@@ -765,15 +767,15 @@ void lex_end(LEX *lex)
DBUG_ENTER("lex_end");
DBUG_PRINT("enter", ("lex: %p", lex));
- lex_end_stage1(lex);
- lex_end_stage2(lex);
+ lex_unlock_plugins(lex);
+ lex_end_nops(lex);
DBUG_VOID_RETURN;
}
-void lex_end_stage1(LEX *lex)
+void lex_unlock_plugins(LEX *lex)
{
- DBUG_ENTER("lex_end_stage1");
+ DBUG_ENTER("lex_unlock_plugins");
/* release used plugins */
if (lex->plugins.elements) /* No function call and no mutex if no plugins. */
@@ -782,33 +784,23 @@ void lex_end_stage1(LEX *lex)
lex->plugins.elements);
}
reset_dynamic(&lex->plugins);
-
- if (lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_PREPARE)
- {
- /*
- Don't delete lex->sphead, it'll be needed for EXECUTE.
- Note that of all statements that populate lex->sphead
- only SQLCOM_COMPOUND can be PREPAREd
- */
- DBUG_ASSERT(lex->sphead == 0 || lex->sql_command == SQLCOM_COMPOUND);
- }
- else
- {
- sp_head::destroy(lex->sphead);
- lex->sphead= NULL;
- }
-
DBUG_VOID_RETURN;
}
/*
+ Don't delete lex->sphead, it'll be needed for EXECUTE.
+ Note that of all statements that populate lex->sphead
+ only SQLCOM_COMPOUND can be PREPAREd
+
MASTER INFO parameters (or state) is normally cleared towards the end
of a statement. But in case of PS, the state needs to be preserved during
its lifetime and should only be cleared on PS close or deallocation.
*/
-void lex_end_stage2(LEX *lex)
+void lex_end_nops(LEX *lex)
{
- DBUG_ENTER("lex_end_stage2");
+ DBUG_ENTER("lex_end_nops");
+ sp_head::destroy(lex->sphead);
+ lex->sphead= NULL;
/* Reset LEX_MASTER_INFO */
lex->mi.reset(lex->sql_command == SQLCOM_CHANGE_MASTER);
@@ -2099,6 +2091,7 @@ void st_select_lex_unit::init_query()
is_view= false;
with_clause= 0;
with_element= 0;
+ cloned_from= 0;
columns_are_renamed= false;
}
@@ -2470,7 +2463,7 @@ void st_select_lex_unit::exclude_tree()
*/
bool st_select_lex::mark_as_dependent(THD *thd, st_select_lex *last,
- Item *dependency)
+ Item_ident *dependency)
{
DBUG_ASSERT(this != last);
@@ -2478,10 +2471,14 @@ bool st_select_lex::mark_as_dependent(THD *thd, st_select_lex *last,
/*
Mark all selects from resolved to 1 before select where was
found table as depended (of select where was found table)
+
+ We move by name resolution context, bacause during merge can some select
+ be excleded from SELECT tree
*/
- SELECT_LEX *s= this;
+ Name_resolution_context *c= &this->context;
do
{
+ SELECT_LEX *s= c->select_lex;
if (!(s->uncacheable & UNCACHEABLE_DEPENDENT_GENERATED))
{
// Select is dependent of outer select
@@ -2503,7 +2500,7 @@ bool st_select_lex::mark_as_dependent(THD *thd, st_select_lex *last,
if (subquery_expr && subquery_expr->mark_as_dependent(thd, last,
dependency))
return TRUE;
- } while ((s= s->outer_select()) != last && s != 0);
+ } while ((c= c->outer_context) != NULL && (c->select_lex != last));
is_correlated= TRUE;
this->master_unit()->item->is_correlated= TRUE;
return FALSE;
@@ -2701,7 +2698,7 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
prepared statement
*/
Query_arena *arena= thd->stmt_arena;
- const uint n_elems= (n_sum_items +
+ const size_t n_elems= (n_sum_items +
n_child_sum_items +
item_list.elements +
select_n_reserved +
@@ -2709,7 +2706,8 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
select_n_where_fields +
order_group_num +
hidden_bit_fields +
- fields_in_window_functions) * 5;
+ fields_in_window_functions) * (size_t) 5;
+ DBUG_ASSERT(n_elems % 5 == 0);
if (!ref_pointer_array.is_null())
{
/*
@@ -4619,6 +4617,27 @@ bool st_select_lex::save_prep_leaf_tables(THD *thd)
}
+/**
+ Set exclude_from_table_unique_test for selects of this select and all selects
+ belonging to the underlying units of derived tables or views
+*/
+
+void st_select_lex::set_unique_exclude()
+{
+ exclude_from_table_unique_test= TRUE;
+ for (SELECT_LEX_UNIT *unit= first_inner_unit();
+ unit;
+ unit= unit->next_unit())
+ {
+ if (unit->derived && unit->derived->is_view_or_derived())
+ {
+ for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select())
+ sl->set_unique_exclude();
+ }
+ }
+}
+
+
/*
Return true if this select_lex has been converted into a semi-join nest
within 'ancestor'.
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index f733f783d0e..bdf52e8ef7b 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -666,6 +666,8 @@ public:
With_clause *with_clause;
/* With element where this unit is used as the specification (if any) */
With_element *with_element;
+ /* The unit used as a CTE specification from which this unit is cloned */
+ st_select_lex_unit *cloned_from;
/* thread handler */
THD *thd;
/*
@@ -1004,7 +1006,8 @@ public:
}
inline bool is_subquery_function() { return master_unit()->item != 0; }
- bool mark_as_dependent(THD *thd, st_select_lex *last, Item *dependency);
+ bool mark_as_dependent(THD *thd, st_select_lex *last,
+ Item_ident *dependency);
void set_braces(bool value)
{
@@ -1146,6 +1149,8 @@ public:
bool save_leaf_tables(THD *thd);
bool save_prep_leaf_tables(THD *thd);
+ void set_unique_exclude();
+
bool is_merged_child_of(st_select_lex *ancestor);
/*
@@ -1166,7 +1171,9 @@ public:
}
With_element *get_with_element()
{
- return master_unit()->with_element;
+ return master_unit()->cloned_from ?
+ master_unit()->cloned_from->with_element :
+ master_unit()->with_element;
}
With_element *find_table_def_in_with_clauses(TABLE_LIST *table);
bool check_unrestricted_recursive(bool only_standard_compliant);
@@ -2169,7 +2176,7 @@ public:
/** Get the token start position, in the raw buffer. */
const char *get_tok_start()
{
- return m_tok_start;
+ return lookahead_token >= 0 ? m_tok_start_prev : m_tok_start;
}
void set_cpp_tok_start(const char *pos)
@@ -2215,7 +2222,7 @@ public:
/** Get the token start position, in the pre-processed buffer. */
const char *get_cpp_tok_start()
{
- return m_cpp_tok_start;
+ return lookahead_token >= 0 ? m_cpp_tok_start_prev : m_cpp_tok_start;
}
/** Get the token end position, in the pre-processed buffer. */
@@ -2769,6 +2776,20 @@ public:
uint16 create_view_algorithm;
uint8 create_view_check;
uint8 context_analysis_only;
+ /*
+ true <=> The parsed fragment requires resolution of references to CTE
+ at the end of parsing. This name resolution process involves searching
+ for possible dependencies between CTE defined in the parsed fragment and
+ detecting possible recursive references.
+ The flag is set to true if the fragment contains CTE definitions.
+ */
+ bool with_cte_resolution;
+ /*
+ true <=> only resolution of references to CTE are required in the parsed
+ fragment, no checking of dependencies between CTE is required.
+ This flag is used only when parsing clones of CTE specifications.
+ */
+ bool only_cte_resolution;
bool local_file;
bool check_exists;
bool autocommit;
@@ -3204,6 +3225,30 @@ public:
}
return false;
}
+
+ bool create_like() const
+ {
+ DBUG_ASSERT(!create_info.like() || !select_lex.item_list.elements);
+ return create_info.like();
+ }
+
+ bool create_select() const
+ {
+ DBUG_ASSERT(!create_info.like() || !select_lex.item_list.elements);
+ return select_lex.item_list.elements;
+ }
+
+ bool create_simple() const
+ {
+ return !create_like() && !create_select();
+ }
+
+ bool check_dependencies_in_with_clauses();
+ bool resolve_references_to_cte_in_hanging_cte();
+ bool check_cte_dependencies_and_resolve_references();
+ bool resolve_references_to_cte(TABLE_LIST *tables,
+ TABLE_LIST **tables_last);
+
};
@@ -3392,8 +3437,8 @@ extern void lex_init(void);
extern void lex_free(void);
extern void lex_start(THD *thd);
extern void lex_end(LEX *lex);
-extern void lex_end_stage1(LEX *lex);
-extern void lex_end_stage2(LEX *lex);
+extern void lex_end_nops(LEX *lex);
+extern void lex_unlock_plugins(LEX *lex);
void end_lex_with_single_table(THD *thd, TABLE *table, LEX *old_lex);
int init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex);
extern int MYSQLlex(union YYSTYPE *yylval, THD *thd);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 573df24cb33..3e1f248b082 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3220,9 +3220,6 @@ mysql_execute_command(THD *thd)
thd->get_stmt_da()->opt_clear_warning_info(thd->query_id);
}
- if (check_dependencies_in_with_clauses(thd->lex->with_clauses_list))
- DBUG_RETURN(1);
-
#ifdef HAVE_REPLICATION
if (unlikely(thd->slave_thread))
{
@@ -7229,10 +7226,10 @@ bool check_stack_overrun(THD *thd, long margin,
#define MY_YACC_INIT 1000 // Start with big alloc
#define MY_YACC_MAX 32000 // Because of 'short'
-bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize)
+bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, size_t *yystacksize)
{
Yacc_state *state= & current_thd->m_parser_state->m_yacc;
- ulong old_info=0;
+ size_t old_info=0;
DBUG_ASSERT(state);
if ((uint) *yystacksize >= MY_YACC_MAX)
return 1;
@@ -7418,6 +7415,7 @@ mysql_new_select(LEX *lex, bool move_down)
DBUG_RETURN(1);
select_lex->select_number= ++thd->lex->stmt_lex->current_select_number;
select_lex->parent_lex= lex; /* Used in init_query. */
+ Name_resolution_context *curr_context= lex->context_stack.head();
select_lex->init_query();
select_lex->init_select();
lex->nest_level++;
@@ -7448,7 +7446,8 @@ mysql_new_select(LEX *lex, bool move_down)
By default we assume that it is usual subselect and we have outer name
resolution context, if no we will assign it to 0 later
*/
- select_lex->context.outer_context= &select_lex->outer_select()->context;
+
+ select_lex->context.outer_context= curr_context;
}
else
{
@@ -7978,7 +7977,8 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->db= table->db.str;
ptr->db_length= table->db.length;
}
- else if (lex->copy_db_to(&ptr->db, &ptr->db_length))
+ else if (!lex->with_cte_resolution &&
+ lex->copy_db_to(&ptr->db, &ptr->db_length))
DBUG_RETURN(0);
else
ptr->is_fqtn= FALSE;
@@ -7995,7 +7995,9 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->table_name=table->table.str;
ptr->table_name_length=table->table.length;
- ptr->lock_type= lock_type;
+ ptr->lock_type= lock_type;
+ ptr->mdl_type= mdl_type;
+ ptr->table_options= table_options;
ptr->updating= MY_TEST(table_options & TL_OPTION_UPDATING);
/* TODO: remove TL_OPTION_FORCE_INDEX as it looks like it's not used */
ptr->force_index= MY_TEST(table_options & TL_OPTION_FORCE_INDEX);
@@ -8674,8 +8676,10 @@ void st_select_lex::set_lock_for_tables(thr_lock_type lock_type, bool for_update
{
tables->lock_type= lock_type;
tables->updating= for_update;
- tables->mdl_request.set_type((lock_type >= TL_WRITE_ALLOW_WRITE) ?
- MDL_SHARED_WRITE : MDL_SHARED_READ);
+
+ if (tables->db && tables->db[0])
+ tables->mdl_request.set_type((lock_type >= TL_WRITE_ALLOW_WRITE) ?
+ MDL_SHARED_WRITE : MDL_SHARED_READ);
}
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index fa335465f02..9339cb925e5 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1659,7 +1659,7 @@ static int mysql_test_select(Prepared_statement *stmt,
}
if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL,
- DT_INIT | DT_PREPARE | DT_CREATE))
+ DT_INIT | DT_PREPARE))
goto error;
thd->lex->used_tables= 0; // Updated by setup_fields
@@ -1674,7 +1674,12 @@ static int mysql_test_select(Prepared_statement *stmt,
if (!lex->describe && !thd->lex->analyze_stmt && !stmt->is_sql_prepare())
{
/* Make copy of item list, as change_columns may change it */
- List<Item> fields(lex->select_lex.item_list);
+ SELECT_LEX_UNIT* master_unit= unit->first_select()->master_unit();
+ bool is_union_op=
+ master_unit->is_union() || master_unit->fake_select_lex;
+
+ List<Item> fields(is_union_op ? unit->item_list :
+ lex->select_lex.item_list);
/* Change columns if a procedure like analyse() */
if (unit->last_procedure && unit->last_procedure->change_columns(thd, fields))
@@ -1721,7 +1726,7 @@ static bool mysql_test_do_fields(Prepared_statement *stmt,
DBUG_RETURN(TRUE);
if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL,
- DT_INIT | DT_PREPARE | DT_CREATE))
+ DT_INIT | DT_PREPARE))
DBUG_RETURN(TRUE);
DBUG_RETURN(setup_fields(thd, Ref_ptr_array(),
*values, MARK_COLUMNS_NONE, 0, NULL, 0));
@@ -1753,7 +1758,7 @@ static bool mysql_test_set_fields(Prepared_statement *stmt,
if ((tables &&
check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE)) ||
open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL,
- DT_INIT | DT_PREPARE | DT_CREATE))
+ DT_INIT | DT_PREPARE))
goto error;
while ((var= it++))
@@ -1918,7 +1923,7 @@ static bool mysql_test_create_table(Prepared_statement *stmt)
if (open_normal_and_derived_tables(stmt->thd, lex->query_tables,
MYSQL_OPEN_FORCE_SHARED_MDL,
- DT_INIT | DT_PREPARE | DT_CREATE))
+ DT_INIT | DT_PREPARE))
DBUG_RETURN(TRUE);
select_lex->context.resolve_in_select_list= TRUE;
@@ -2413,9 +2418,6 @@ static bool check_prepared_statement(Prepared_statement *stmt)
if (tables)
thd->get_stmt_da()->opt_clear_warning_info(thd->query_id);
- if (check_dependencies_in_with_clauses(thd->lex->with_clauses_list))
- goto error;
-
if (sql_command_flags[sql_command] & CF_HA_CLOSE)
mysql_ha_rm_tables(thd, tables);
@@ -3058,6 +3060,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
}
for (; sl; sl= sl->next_select_in_list())
{
+ sl->parent_lex->in_sum_func= NULL;
if (sl->changed_elements & TOUCHED_SEL_COND)
{
/* remove option which was put by mysql_explain_union() */
@@ -3188,7 +3191,6 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
lex->result->set_thd(thd);
}
lex->allow_sum_func= 0;
- lex->in_sum_func= NULL;
DBUG_VOID_RETURN;
}
@@ -4307,8 +4309,10 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
thd->release_transactional_locks();
}
- /* Preserve CHANGE MASTER attributes */
- lex_end_stage1(lex);
+ /* Preserve locked plugins for SET */
+ if (lex->sql_command != SQLCOM_SET_OPTION)
+ lex_unlock_plugins(lex);
+
cleanup_stmt();
thd->restore_backup_statement(this, &stmt_backup);
thd->stmt_arena= old_stmt_arena;
@@ -5189,7 +5193,7 @@ void Prepared_statement::deallocate_immediate()
status_var_increment(thd->status_var.com_stmt_close);
/* It should now be safe to reset CHANGE MASTER parameters */
- lex_end_stage2(lex);
+ lex_end(lex);
}
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 59a3f686e45..d6d2dbc0d39 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -32,6 +32,7 @@
#include "debug_sync.h"
#include "log.h" // get_gtid_list_event
+
enum enum_gtid_until_state {
GTID_UNTIL_NOT_DONE,
GTID_UNTIL_STOP_AFTER_STANDALONE,
@@ -781,7 +782,7 @@ get_slave_until_gtid(THD *thd, String *out_str)
@param event_coordinates binlog file name and position of the last
real event master sent from binlog
- @note
+ @note
Among three essential pieces of heartbeat data Log_event::when
is computed locally.
The error to send is serious and should force terminating
@@ -795,6 +796,8 @@ static int send_heartbeat_event(binlog_send_info *info,
DBUG_ENTER("send_heartbeat_event");
ulong ev_offset;
+ char sub_header_buf[HB_SUB_HEADER_LEN];
+ bool sub_header_in_use=false;
if (reset_transmit_packet(info, info->flags, &ev_offset, &info->errmsg))
DBUG_RETURN(1);
@@ -815,18 +818,38 @@ static int send_heartbeat_event(binlog_send_info *info,
ulong event_len = ident_len + LOG_EVENT_HEADER_LEN +
(do_checksum ? BINLOG_CHECKSUM_LEN : 0);
int4store(header + SERVER_ID_OFFSET, global_system_variables.server_id);
+ DBUG_EXECUTE_IF("simulate_pos_4G",
+ {
+ const_cast<event_coordinates *>(coord)->pos= (UINT_MAX32 + (ulong)1);
+ DBUG_SET("-d, simulate_pos_4G");
+ };);
+ if (coord->pos <= UINT_MAX32)
+ {
+ int4store(header + LOG_POS_OFFSET, coord->pos); // log_pos
+ }
+ else
+ {
+ // Set common_header.log_pos=0 to indicate its overflow
+ int4store(header + LOG_POS_OFFSET, 0);
+ sub_header_in_use= true;
+ int8store(sub_header_buf, coord->pos);
+ event_len+= HB_SUB_HEADER_LEN;
+ }
+
int4store(header + EVENT_LEN_OFFSET, event_len);
int2store(header + FLAGS_OFFSET, 0);
- int4store(header + LOG_POS_OFFSET, coord->pos); // log_pos
-
packet->append(header, sizeof(header));
- packet->append(p, ident_len); // log_file_name
+ if (sub_header_in_use)
+ packet->append(sub_header_buf, sizeof(sub_header_buf));
+ packet->append(p, ident_len); // log_file_name
if (do_checksum)
{
char b[BINLOG_CHECKSUM_LEN];
ha_checksum crc= my_checksum(0, (uchar*) header, sizeof(header));
+ if (sub_header_in_use)
+ crc= my_checksum(crc, (uchar*) sub_header_buf, sizeof(sub_header_buf));
crc= my_checksum(crc, (uchar*) p, ident_len);
int4store(b, crc);
packet->append(b, sizeof(b));
@@ -3817,6 +3840,16 @@ err:
mi->unlock_slave_threads();
if (ret == FALSE)
my_ok(thd);
+ else
+ {
+ /*
+ Depending on where CHANGE MASTER failed, the logs may be waiting to be
+ reopened. This would break future log updates and CHANGE MASTER calls.
+ `try_fix_log_state()` allows the relay log to fix its state to no longer
+ expect to be reopened.
+ */
+ mi->rli.relay_log.try_fix_log_state();
+ }
DBUG_RETURN(ret);
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 7bfbf719017..54a2facfe9f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -585,7 +585,16 @@ void remove_redundant_subquery_clauses(st_select_lex *subq_select_lex)
{
for (ORDER *ord= subq_select_lex->group_list.first; ord; ord= ord->next)
{
- (*ord->item)->walk(&Item::eliminate_subselect_processor, FALSE, NULL);
+ /*
+ Do not remove the item if it is used in select list and then referred
+ from GROUP BY clause by its name or number. Example:
+
+ select (select ... ) as SUBQ ... group by SUBQ
+
+ Here SUBQ cannot be removed.
+ */
+ if (!ord->in_field_list)
+ (*ord->item)->walk(&Item::eliminate_subselect_processor, FALSE, NULL);
}
subq_select_lex->join->group_list= NULL;
subq_select_lex->group_list.empty();
@@ -1170,7 +1179,7 @@ int JOIN::init_join_caches()
if (table->file->keyread_enabled())
{
if (!(table->file->index_flags(table->file->keyread, 0, 1) & HA_CLUSTERED_INDEX))
- table->mark_columns_used_by_index(table->file->keyread, table->read_set);
+ table->mark_index_columns(table->file->keyread, table->read_set);
}
else if ((tab->read_first_record == join_read_first ||
tab->read_first_record == join_read_last) &&
@@ -3919,7 +3928,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
int error= 0;
TABLE *UNINIT_VAR(table); /* inited in all loops */
uint i,table_count,const_count,key;
- table_map found_const_table_map, all_table_map, found_ref, refs;
+ table_map found_const_table_map, all_table_map;
key_map const_ref, eq_part;
bool has_expensive_keyparts;
TABLE **table_vector;
@@ -4182,7 +4191,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
{
ref_changed = 0;
more_const_tables_found:
- found_ref=0;
/*
We only have to loop from stat_vector + const_count as
@@ -4271,7 +4279,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
key=keyuse->key;
s->keys.set_bit(key); // TODO: remove this ?
- refs=0;
const_ref.clear_all();
eq_part.clear_all();
has_expensive_keyparts= false;
@@ -4287,8 +4294,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
if (keyuse->val->is_expensive())
has_expensive_keyparts= true;
}
- else
- refs|=keyuse->used_tables;
eq_part.set_bit(keyuse->keypart);
}
keyuse++;
@@ -4339,8 +4344,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
found_const_table_map|= table->map;
break;
}
- else
- found_ref|= refs; // Table is const if all refs are const
}
else if (base_const_ref == base_eq_part)
s->const_keys.set_bit(key);
@@ -7940,7 +7943,9 @@ static
double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s,
table_map rem_tables)
{
- uint16 ref_keyuse_steps[MAX_REF_PARTS - 1];
+ uint16 ref_keyuse_steps_buf[MAX_REF_PARTS];
+ uint ref_keyuse_size= MAX_REF_PARTS;
+ uint16 *ref_keyuse_steps= ref_keyuse_steps_buf;
Field *field;
TABLE *table= s->table;
MY_BITMAP *read_set= table->read_set;
@@ -8087,6 +8092,29 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s,
}
if (keyparts > 1)
{
+ /*
+ Prepare to set ref_keyuse_steps[keyparts-2]: resize the array
+ if it is not large enough
+ */
+ if (keyparts - 2 >= ref_keyuse_size)
+ {
+ uint new_size= MY_MAX(ref_keyuse_size*2, keyparts);
+ void *new_buf;
+ if (!(new_buf= my_malloc(sizeof(*ref_keyuse_steps)*new_size,
+ MYF(0))))
+ {
+ sel= 1.0; // As if no selectivity was computed
+ goto exit;
+ }
+ memcpy(new_buf, ref_keyuse_steps,
+ sizeof(*ref_keyuse_steps)*ref_keyuse_size);
+ if (ref_keyuse_steps != ref_keyuse_steps_buf)
+ my_free(ref_keyuse_steps);
+
+ ref_keyuse_steps= (uint16*)new_buf;
+ ref_keyuse_size= new_size;
+ }
+
ref_keyuse_steps[keyparts-2]= (uint16)(keyuse - prev_ref_keyuse);
prev_ref_keyuse= keyuse;
}
@@ -8141,7 +8169,9 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s,
sel*= table_multi_eq_cond_selectivity(join, idx, s, rem_tables,
keyparts, ref_keyuse_steps);
-
+exit:
+ if (ref_keyuse_steps != ref_keyuse_steps_buf)
+ my_free(ref_keyuse_steps);
return sel;
}
@@ -12097,10 +12127,12 @@ ha_rows JOIN_TAB::get_examined_rows()
bool JOIN_TAB::preread_init()
{
TABLE_LIST *derived= table->pos_in_table_list;
+ DBUG_ENTER("JOIN_TAB::preread_init");
+
if (!derived || !derived->is_materialized_derived())
{
preread_init_done= TRUE;
- return FALSE;
+ DBUG_RETURN(FALSE);
}
/* Materialize derived table/view. */
@@ -12108,7 +12140,7 @@ bool JOIN_TAB::preread_init()
derived->is_recursive_with_table()) &&
mysql_handle_single_derived(join->thd->lex,
derived, DT_CREATE | DT_FILL))
- return TRUE;
+ DBUG_RETURN(TRUE);
preread_init_done= TRUE;
if (select && select->quick)
@@ -12125,7 +12157,7 @@ bool JOIN_TAB::preread_init()
if (table->fulltext_searched)
init_ftfuncs(join->thd, join->select_lex, MY_TEST(join->order));
- return FALSE;
+ DBUG_RETURN(FALSE);
}
@@ -19013,26 +19045,33 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
will be re-evaluated again. It could be fixed, but, probably,
it's not worth doing now.
*/
- if (tab->select_cond && !tab->select_cond->val_int())
+ if (tab->select_cond)
{
- /* The condition attached to table tab is false */
- if (tab == join_tab)
- {
- found= 0;
- if (not_exists_opt_is_applicable)
- DBUG_RETURN(NESTED_LOOP_NO_MORE_ROWS);
- }
- else
+ const longlong res= tab->select_cond->val_int();
+ if (join->thd->is_error())
+ DBUG_RETURN(NESTED_LOOP_ERROR);
+
+ if (!res)
{
- /*
- Set a return point if rejected predicate is attached
- not to the last table of the current nest level.
- */
- join->return_tab= tab;
- if (not_exists_opt_is_applicable)
- DBUG_RETURN(NESTED_LOOP_NO_MORE_ROWS);
+ /* The condition attached to table tab is false */
+ if (tab == join_tab)
+ {
+ found= 0;
+ if (not_exists_opt_is_applicable)
+ DBUG_RETURN(NESTED_LOOP_NO_MORE_ROWS);
+ }
else
- DBUG_RETURN(NESTED_LOOP_OK);
+ {
+ /*
+ Set a return point if rejected predicate is attached
+ not to the last table of the current nest level.
+ */
+ join->return_tab= tab;
+ if (not_exists_opt_is_applicable)
+ DBUG_RETURN(NESTED_LOOP_NO_MORE_ROWS);
+ else
+ DBUG_RETURN(NESTED_LOOP_OK);
+ }
}
}
}
@@ -21906,6 +21945,12 @@ check_reverse_order:
if (select->quick == save_quick)
save_quick= 0; // make_reverse() consumed it
select->set_quick(tmp);
+ /* Cancel "Range checked for each record" */
+ if (tab->use_quick == 2)
+ {
+ tab->use_quick= 1;
+ tab->read_first_record= join_init_read_record;
+ }
}
else if (tab->type != JT_NEXT && tab->type != JT_REF_OR_NULL &&
tab->ref.key >= 0 && tab->ref.key_parts <= used_key_parts)
@@ -21918,6 +21963,12 @@ check_reverse_order:
*/
tab->read_first_record= join_read_last_key;
tab->read_record.read_record= join_read_prev_same;
+ /* Cancel "Range checked for each record" */
+ if (tab->use_quick == 2)
+ {
+ tab->use_quick= 1;
+ tab->read_first_record= join_init_read_record;
+ }
/*
Cancel Pushed Index Condition, as it doesn't work for reverse scans.
*/
@@ -25232,8 +25283,10 @@ int JOIN::save_explain_data_intern(Explain_query *output,
if (!(tmp_unit->item && tmp_unit->item->eliminated) && // (1)
(!tmp_unit->derived ||
tmp_unit->derived->is_materialized_derived()) && // (2)
- !(tmp_unit->with_element &&
- (!tmp_unit->derived || !tmp_unit->derived->derived_result))) // (3)
+ (!tmp_unit->with_element ||
+ (tmp_unit->derived &&
+ tmp_unit->derived->derived_result &&
+ !tmp_unit->with_element->is_hanging_recursive()))) // (3)
{
explain->add_child(tmp_unit->first_select()->select_number);
}
@@ -25298,8 +25351,10 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
*/
if (!(unit->item && unit->item->eliminated) && // (1)
!(unit->derived && unit->derived->merged_for_insert) && // (2)
- !(unit->with_element &&
- (!unit->derived || !unit->derived->derived_result))) // (3)
+ (!unit->with_element ||
+ (unit->derived &&
+ unit->derived->derived_result &&
+ !unit->with_element->is_hanging_recursive()))) // (3)
{
if (mysql_explain_union(thd, unit, result))
DBUG_VOID_RETURN;
@@ -25321,7 +25376,7 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
sl->options|= SELECT_DESCRIBE;
}
- if (unit->is_union())
+ if (unit->is_union() || unit->fake_select_lex)
{
if (unit->union_needs_tmp_table() && unit->fake_select_lex)
{
@@ -25749,6 +25804,11 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
//Item List
bool first= 1;
+ /*
+ outer_select() can not be used here because it is for name resolution
+ and will return NULL at any end of name resolution chain (view/derived)
+ */
+ bool top_level= (get_master()->get_master() == 0);
List_iterator_fast<Item> it(item_list);
Item *item;
while ((item= it++))
@@ -25758,7 +25818,8 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
else
str->append(',');
- if (is_subquery_function() && item->is_autogenerated_name)
+ if ((is_subquery_function() && item->is_autogenerated_name) ||
+ !item->name)
{
/*
Do not print auto-generated aliases in subqueries. It has no purpose
@@ -25767,7 +25828,20 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
item->print(str, query_type);
}
else
- item->print_item_w_name(str, query_type);
+ {
+ /*
+ Do not print illegal names (if it is not top level SELECT).
+ Top level view checked (and correct name are assigned),
+ other cases of top level SELECT are not important, because
+ it is not "table field".
+ */
+ if (top_level ||
+ !item->is_autogenerated_name ||
+ !check_column_name(item->name))
+ item->print_item_w_name(str, query_type);
+ else
+ item->print(str, query_type);
+ }
}
/*
@@ -26179,7 +26253,6 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab,
*/
if (tab)
{
- key_part_map const_parts= 0;
key_part_map map= 1;
uint kp;
/* Find how many key parts would be used by ref(const) */
@@ -26187,7 +26260,6 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab,
{
if (!(table->const_key_parts[keynr] & map))
break;
- const_parts |= map;
}
if (kp > 0)
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 7023e5fe9ea..710c68d2551 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -62,6 +62,19 @@
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
#endif
+
+#include "lex_symbol.h"
+#define KEYWORD_SIZE 64
+
+extern SYMBOL symbols[];
+extern size_t symbols_length;
+
+extern SYMBOL sql_functions[];
+extern size_t sql_functions_length;
+
+extern Native_func_registry func_array[];
+extern size_t func_array_length;
+
enum enum_i_s_events_fields
{
ISE_EVENT_CATALOG= 0,
@@ -1528,7 +1541,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild)
if (open_normal_and_derived_tables(thd, table_list,
MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL,
- DT_INIT | DT_PREPARE | DT_CREATE))
+ DT_INIT | DT_PREPARE))
DBUG_VOID_RETURN;
table= table_list->table;
@@ -4214,7 +4227,9 @@ make_table_name_list(THD *thd, Dynamic_array<LEX_STRING*> *table_names,
if (!lookup_field_vals->wild_table_value &&
lookup_field_vals->table_value.str)
{
- if (lookup_field_vals->table_value.length > NAME_LEN)
+ if (check_table_name(lookup_field_vals->table_value.str,
+ lookup_field_vals->table_value.length,
+ false))
{
/*
Impossible value for a table name,
@@ -4251,6 +4266,9 @@ make_table_name_list(THD *thd, Dynamic_array<LEX_STRING*> *table_names,
return (schema_tables_add(thd, table_names,
lookup_field_vals->table_value.str));
+ if (check_db_name((LEX_STRING*)db_name))
+ return 0; // Impossible TABLE_SCHEMA name
+
find_files_result res= find_files(thd, table_names, db_name, path,
&lookup_field_vals->table_value);
if (res != FIND_FILES_OK)
@@ -4414,7 +4432,7 @@ fill_schema_table_by_open(THD *thd, bool is_show_fields_or_keys,
MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
(can_deadlock ?
MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)),
- DT_INIT | DT_PREPARE | DT_CREATE));
+ DT_INIT | DT_PREPARE));
/*
Restore old value of sql_command back as it is being looked at in
@@ -7556,6 +7574,60 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond)
DBUG_RETURN(res);
}
+int add_symbol_to_table(const char* name, TABLE* table){
+ DBUG_ENTER("add_symbol_to_table");
+
+ size_t length= strlen(name);
+
+ // If you've added a new SQL keyword longer than KEYWORD_SIZE,
+ // please increase the defined max length
+ DBUG_ASSERT(length < KEYWORD_SIZE);
+
+ restore_record(table, s->default_values);
+ table->field[0]->set_notnull();
+ table->field[0]->store(name, length,
+ system_charset_info);
+ if (schema_table_store_record(table->in_use, table))
+ DBUG_RETURN(1);
+
+ DBUG_RETURN(0);
+}
+
+int fill_i_s_keywords(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+ DBUG_ENTER("fill_i_s_keywords");
+
+ TABLE *table= tables->table;
+
+ for (uint i= 0; i < symbols_length; i++){
+ const char *name= symbols[i].name;
+ if (add_symbol_to_table(name, table))
+ DBUG_RETURN(1);
+ }
+
+ DBUG_RETURN(0);
+}
+
+int fill_i_s_sql_functions(THD *thd, TABLE_LIST *tables, COND *cond) {
+ DBUG_ENTER("fill_i_s_sql_functions");
+
+ TABLE *table= tables->table;
+
+ for (uint i= 0; i < sql_functions_length; i++){
+ const char *name= sql_functions[i].name;
+ if (add_symbol_to_table(name, table))
+ DBUG_RETURN(1);
+ }
+
+ for (uint i= 0; i < func_array_length; i++){
+ const char *name= func_array[i].name.str;
+ if (add_symbol_to_table(name, table))
+ DBUG_RETURN(1);
+ }
+
+ DBUG_RETURN(0);
+}
+
int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
{
@@ -8763,6 +8835,18 @@ ST_FIELD_INFO enabled_roles_fields_info[]=
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
+ST_FIELD_INFO keywords_field_info[]=
+{
+ {"WORD", KEYWORD_SIZE, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
+};
+
+ST_FIELD_INFO sql_functions_field_info[]=
+{
+ {"FUNCTION", KEYWORD_SIZE, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, 0, SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
+};
+
ST_FIELD_INFO engines_fields_info[]=
{
@@ -9465,6 +9549,8 @@ ST_SCHEMA_TABLE schema_tables[]=
fill_status, make_old_format, 0, 0, -1, 0, 0},
{"GLOBAL_VARIABLES", variables_fields_info, 0,
fill_variables, make_old_format, 0, 0, -1, 0, 0},
+ {"KEYWORDS", keywords_field_info, 0,
+ fill_i_s_keywords, 0, 0, -1, -1, 0, 0},
{"KEY_CACHES", keycache_fields_info, 0,
fill_key_cache_tables, 0, 0, -1,-1, 0, 0},
{"KEY_COLUMN_USAGE", key_column_usage_fields_info, 0,
@@ -9500,6 +9586,8 @@ ST_SCHEMA_TABLE schema_tables[]=
{"STATISTICS", stat_fields_info, 0,
get_all_tables, make_old_format, get_schema_stat_record, 1, 2, 0,
OPEN_TABLE_ONLY|OPTIMIZE_I_S_TABLE},
+ {"SQL_FUNCTIONS", sql_functions_field_info, 0,
+ fill_i_s_sql_functions, 0, 0, -1, -1, 0, 0},
{"SYSTEM_VARIABLES", sysvars_fields_info, 0,
fill_sysvars, make_old_format, 0, 0, -1, 0, 0},
{"TABLES", tables_fields_info, 0,
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 4e0c7aea84b..ff6b2163630 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -379,7 +379,7 @@ bool String::copy(const char *str, uint32 arg_length,
{
uint32 offset;
- DBUG_ASSERT(!str || str != Ptr);
+ DBUG_ASSERT(!str || str != Ptr || !alloced);
if (!needs_conversion(arg_length, from_cs, to_cs, &offset))
{
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index cb28c6adcec..9556cb9f136 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -76,7 +76,9 @@ static int copy_data_between_tables(THD *thd, TABLE *from,TABLE *to,
static bool prepare_blob_field(THD *thd, Column_definition *sql_field);
static int mysql_prepare_create_table(THD *, HA_CREATE_INFO *, Alter_info *,
- uint *, handler *, KEY **, uint *, int);
+ uint *, handler *, KEY **, uint *, int,
+ const LEX_CSTRING db,
+ const LEX_CSTRING table_name);
static uint blob_length_by_type(enum_field_types type);
static bool fix_constraints_names(THD *thd, List<Virtual_column_info>
*check_constraint_list);
@@ -1809,10 +1811,12 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
strxmov(shadow_frm_name, shadow_path, reg_ext, NullS);
if (flags & WFRM_WRITE_SHADOW)
{
+ LEX_CSTRING db= { lpt->db, strlen(lpt->db) };
+ LEX_CSTRING table_name= { lpt->table_name, strlen(lpt->table_name) };
if (mysql_prepare_create_table(lpt->thd, lpt->create_info, lpt->alter_info,
&lpt->db_options, lpt->table->file,
&lpt->key_info_buffer, &lpt->key_count,
- C_ALTER_TABLE))
+ C_ALTER_TABLE, db, table_name))
{
DBUG_RETURN(TRUE);
}
@@ -3231,7 +3235,8 @@ static int
mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
Alter_info *alter_info, uint *db_options,
handler *file, KEY **key_info_buffer,
- uint *key_count, int create_table_mode)
+ uint *key_count, int create_table_mode,
+ const LEX_CSTRING db, const LEX_CSTRING table_name)
{
const char *key_name;
Create_field *sql_field,*dup_field;
@@ -3246,6 +3251,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
uint total_uneven_bit_length= 0;
int select_field_count= C_CREATE_SELECT(create_table_mode);
bool tmp_table= create_table_mode == C_ALTER_TABLE;
+ const bool create_simple= thd->lex->create_simple();
DBUG_ENTER("mysql_prepare_create_table");
LEX_STRING* connect_string = &create_info->connect_string;
@@ -4138,6 +4144,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
create_info->null_bits= null_fields;
/* Check fields. */
+ Item::Check_table_name_prm walk_prm(db, table_name);
it.rewind();
while ((sql_field=it++))
{
@@ -4182,6 +4189,37 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name);
DBUG_RETURN(TRUE);
}
+
+ if (create_simple)
+ {
+ /*
+ NOTE: we cannot do this in check_vcol_func_processor() as there is already
+ no table name qualifier in expression.
+ */
+ if (sql_field->vcol_info &&
+ sql_field->vcol_info->expr->walk(&Item::check_table_name_processor,
+ false, (void *) &walk_prm))
+ {
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), walk_prm.field.c_ptr(), "GENERATED ALWAYS");
+ DBUG_RETURN(TRUE);
+ }
+
+ if (sql_field->default_value &&
+ sql_field->default_value->expr->walk(&Item::check_table_name_processor,
+ false, (void *) &walk_prm))
+ {
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), walk_prm.field.c_ptr(), "DEFAULT");
+ DBUG_RETURN(TRUE);
+ }
+
+ if (sql_field->check_constraint &&
+ sql_field->check_constraint->expr->walk(&Item::check_table_name_processor,
+ false, (void *) &walk_prm))
+ {
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), walk_prm.field.c_ptr(), "CHECK");
+ DBUG_RETURN(TRUE);
+ }
+ }
}
/* Check table level constraints */
@@ -4191,6 +4229,12 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
Virtual_column_info *check;
while ((check= c_it++))
{
+ if (create_simple && check->expr->walk(&Item::check_table_name_processor, false,
+ (void *) &walk_prm))
+ {
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), walk_prm.field.c_ptr(), "CHECK");
+ DBUG_RETURN(TRUE);
+ }
if (!check->name.length || check->automatic_name)
continue;
@@ -4477,6 +4521,8 @@ handler *mysql_create_frm_image(THD *thd,
{
uint db_options;
handler *file;
+ const LEX_CSTRING new_db= { db, strlen(db) };
+ const LEX_CSTRING new_table_name= { table_name, strlen(table_name) };
DBUG_ENTER("mysql_create_frm_image");
if (!alter_info->create_list.elements)
@@ -4700,7 +4746,7 @@ handler *mysql_create_frm_image(THD *thd,
if (mysql_prepare_create_table(thd, create_info, alter_info, &db_options,
file, key_info, key_count,
- create_table_mode))
+ create_table_mode, new_db, new_table_name))
goto err;
create_info->table_options=db_options;
@@ -5569,11 +5615,18 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
/*
Ensure that we have an exclusive lock on target table if we are creating
non-temporary table.
+ If we're creating non-temporary table, then either
+ - there is an exclusive lock on the table
+ or
+ - there was CREATE IF EXIST, and the table was not created
+ (it existed), and was previously locked
*/
DBUG_ASSERT((create_info->tmp_table()) ||
thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db,
table->table_name,
- MDL_EXCLUSIVE));
+ MDL_EXCLUSIVE) ||
+ (thd->locked_tables_mode && pos_in_locked_tables &&
+ create_info->if_not_exists()));
}
DEBUG_SYNC(thd, "create_table_like_before_binlog");
@@ -7024,13 +7077,15 @@ bool mysql_compare_tables(TABLE *table,
Alter_info tmp_alter_info(*alter_info, thd->mem_root);
uint db_options= 0; /* not used */
KEY *key_info_buffer= NULL;
+ LEX_CSTRING db= { table->s->db.str, table->s->db.length };
+ LEX_CSTRING table_name= { table->s->db.str, table->s->table_name.length };
/* Create the prepared information. */
int create_table_mode= table->s->tmp_table == NO_TMP_TABLE ?
C_ORDINARY_CREATE : C_ALTER_TABLE;
if (mysql_prepare_create_table(thd, create_info, &tmp_alter_info,
&db_options, table->file, &key_info_buffer,
- &key_count, create_table_mode))
+ &key_count, create_table_mode, db, table_name))
DBUG_RETURN(1);
/* Some very basic checks. */
@@ -7489,6 +7544,7 @@ static bool mysql_inplace_alter_table(THD *thd,
goto rollback;
}
+ DEBUG_SYNC(thd, "alter_table_inplace_after_commit");
close_all_tables_for_name(thd, table->s,
alter_ctx->is_table_renamed() ?
HA_EXTRA_PREPARE_FOR_RENAME :
@@ -7906,7 +7962,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
def->sql_type == MYSQL_TYPE_NEWDATE ||
def->sql_type == MYSQL_TYPE_DATETIME ||
def->sql_type == MYSQL_TYPE_DATETIME2) &&
- !alter_ctx->datetime_field &&
+ !alter_ctx->datetime_field && !def->field &&
!(~def->flags & (NO_DEFAULT_VALUE_FLAG | NOT_NULL_FLAG)) &&
thd->variables.sql_mode & MODE_NO_ZERO_DATE)
{
@@ -9624,9 +9680,17 @@ do_continue:;
if (use_inplace)
{
table->s->frm_image= &frm;
+ enum_check_fields save_count_cuted_fields= thd->count_cuted_fields;
+ /*
+ Set the truncated column values of thd as warning for alter table.
+ */
+ thd->count_cuted_fields= CHECK_FIELD_WARN;
int res= mysql_inplace_alter_table(thd, table_list, table, altered_table,
&ha_alter_info, inplace_supported,
&target_mdl_request, &alter_ctx);
+
+ thd->count_cuted_fields= save_count_cuted_fields;
+
my_free(const_cast<uchar*>(frm.str));
if (res)
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc
index 7d1f630b88c..e5165c5a855 100644
--- a/sql/sql_truncate.cc
+++ b/sql/sql_truncate.cc
@@ -426,8 +426,10 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref)
error= dd_recreate_table(thd, table_ref->db, table_ref->table_name);
if (thd->locked_tables_mode && thd->locked_tables_list.reopen_tables(thd, false))
+ {
thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0);
-
+ error= 1;
+ }
/* No need to binlog a failed truncate-by-recreate. */
binlog_stmt= !error;
}
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 2af12d94228..c026ef6b7ba 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -196,7 +196,7 @@ void udf_init()
DBUG_PRINT("info",("init udf record"));
LEX_STRING name;
name.str=get_field(&mem, table->field[0]);
- name.length = (uint) strlen(name.str);
+ name.length = (uint) safe_strlen(name.str);
char *dl_name= get_field(&mem, table->field[2]);
bool new_dl=0;
Item_udftype udftype=UDFTYPE_FUNCTION;
@@ -210,12 +210,12 @@ void udf_init()
On windows we must check both FN_LIBCHAR and '/'.
*/
- if (check_valid_path(dl_name, strlen(dl_name)) ||
+ if (!name.str || !dl_name || check_valid_path(dl_name, strlen(dl_name)) ||
check_string_char_length(&name, 0, NAME_CHAR_LEN,
system_charset_info, 1))
{
sql_print_error("Invalid row in mysql.func table for function '%.64s'",
- name.str);
+ safe_str(name.str));
continue;
}
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 7baedfb259c..8f7aca2a8ed 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -30,6 +30,7 @@
#include "filesort.h" // filesort_free_buffers
#include "sql_view.h"
#include "sql_cte.h"
+#include "item_windowfunc.h"
bool mysql_union(THD *thd, LEX *lex, select_result *result,
SELECT_LEX_UNIT *unit, ulong setup_tables_done_option)
@@ -1382,7 +1383,8 @@ bool st_select_lex_unit::cleanup()
{
DBUG_RETURN(FALSE);
}
- if (with_element && with_element->is_recursive && union_result)
+ if (with_element && with_element->is_recursive && union_result &&
+ with_element->rec_outer_references)
{
select_union_recursive *result= with_element->rec_result;
if (++result->cleanup_count == with_element->rec_outer_references)
@@ -1550,6 +1552,29 @@ static void cleanup_order(ORDER *order)
}
+static void cleanup_window_funcs(List<Item_window_func> &win_funcs)
+{
+ List_iterator_fast<Item_window_func> it(win_funcs);
+ Item_window_func *win_func;
+ while ((win_func= it++))
+ {
+ Window_spec *win_spec= win_func->window_spec;
+ if (!win_spec)
+ continue;
+ if (win_spec->save_partition_list)
+ {
+ win_spec->partition_list= win_spec->save_partition_list;
+ win_spec->save_partition_list= NULL;
+ }
+ if (win_spec->save_order_list)
+ {
+ win_spec->order_list= win_spec->save_order_list;
+ win_spec->save_order_list= NULL;
+ }
+ }
+}
+
+
bool st_select_lex::cleanup()
{
bool error= FALSE;
@@ -1558,6 +1583,8 @@ bool st_select_lex::cleanup()
cleanup_order(order_list.first);
cleanup_order(group_list.first);
+ cleanup_window_funcs(window_funcs);
+
if (join)
{
List_iterator<TABLE_LIST> ti(leaf_tables);
@@ -1584,7 +1611,8 @@ bool st_select_lex::cleanup()
for (SELECT_LEX_UNIT *lex_unit= first_inner_unit(); lex_unit ;
lex_unit= lex_unit->next_unit())
{
- if (lex_unit->with_element && lex_unit->with_element->is_recursive)
+ if (lex_unit->with_element && lex_unit->with_element->is_recursive &&
+ lex_unit->with_element->rec_outer_references)
continue;
error= (bool) ((uint) error | (uint) lex_unit->cleanup());
}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 01743a6751e..0344d8e0082 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -195,7 +195,7 @@ static void prepare_record_for_error_message(int error, TABLE *table)
/* Create unique_map with all fields used by that index. */
my_bitmap_init(&unique_map, unique_map_buf, table->s->fields, FALSE);
- table->mark_columns_used_by_index(keynr, &unique_map);
+ table->mark_index_columns(keynr, &unique_map);
/* Subtract read_set and write_set. */
bitmap_subtract(&unique_map, table->read_set);
@@ -342,6 +342,8 @@ int mysql_update(THD *thd,
want_privilege= (table_list->view ? UPDATE_ACL :
table_list->grant.want_privilege);
#endif
+ promote_select_describe_flag_if_needed(thd->lex);
+
if (mysql_prepare_update(thd, table_list, &conds, order_num, order))
DBUG_RETURN(1);
@@ -368,6 +370,8 @@ int mysql_update(THD *thd,
DBUG_RETURN(1);
}
+ setup_defaults(thd, fields, values);
+
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* Check values */
table_list->grant.want_privilege= table->grant.want_privilege=
@@ -1391,14 +1395,8 @@ bool Multiupdate_prelocking_strategy::handle_end(THD *thd)
*/
if (setup_tables_and_check_access(thd, &select_lex->context,
- &select_lex->top_join_list, table_list, select_lex->leaf_tables,
- FALSE, UPDATE_ACL, SELECT_ACL, FALSE))
- DBUG_RETURN(1);
-
- if (select_lex->handle_derived(thd->lex, DT_MERGE))
- DBUG_RETURN(1);
-
- if (thd->lex->save_prep_leaf_tables())
+ &select_lex->top_join_list, table_list, select_lex->leaf_tables,
+ FALSE, UPDATE_ACL, SELECT_ACL, TRUE))
DBUG_RETURN(1);
List<Item> *fields= &lex->select_lex.item_list;
@@ -1574,7 +1572,8 @@ int mysql_multi_update_prepare(THD *thd)
Check that we are not using table that we are updating, but we should
skip all tables of UPDATE SELECT itself
*/
- lex->select_lex.exclude_from_table_unique_test= TRUE;
+ lex->select_lex.set_unique_exclude();
+
/* We only need SELECT privilege for columns in the values list */
List_iterator<TABLE_LIST> ti(lex->select_lex.leaf_tables);
while ((tl= ti++))
@@ -1635,9 +1634,16 @@ bool mysql_multi_update(THD *thd, TABLE_LIST *table_list, List<Item> *fields,
DBUG_RETURN(TRUE);
}
+ if ((*result)->init(thd))
+ DBUG_RETURN(1);
+
thd->abort_on_warning= !ignore && thd->is_strict_mode();
List<Item> total_list;
+ if (setup_tables(thd, &select_lex->context, &select_lex->top_join_list,
+ table_list, select_lex->leaf_tables, FALSE, FALSE))
+ DBUG_RETURN(1);
+
res= mysql_select(thd,
table_list, select_lex->with_wild, total_list,
conds, 0, NULL, NULL, NULL, NULL,
@@ -1673,6 +1679,24 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list,
{}
+bool multi_update::init(THD *thd)
+{
+ table_map tables_to_update= get_table_map(fields);
+ List_iterator_fast<TABLE_LIST> li(*leaves);
+ TABLE_LIST *tbl;
+ while ((tbl =li++))
+ {
+ if (tbl->is_jtbm())
+ continue;
+ if (!(tbl->table->map & tables_to_update))
+ continue;
+ if (updated_leaves.push_back(tbl, thd->mem_root))
+ return true;
+ }
+ return false;
+}
+
+
/*
Connect fields with tables and create list of tables that are updated
*/
@@ -1689,7 +1713,7 @@ int multi_update::prepare(List<Item> &not_used_values,
List_iterator_fast<Item> value_it(*values);
uint i, max_fields;
uint leaf_table_count= 0;
- List_iterator<TABLE_LIST> ti(*leaves);
+ List_iterator<TABLE_LIST> ti(updated_leaves);
DBUG_ENTER("multi_update::prepare");
if (prepared)
@@ -1727,6 +1751,8 @@ int multi_update::prepare(List<Item> &not_used_values,
}
}
+ setup_defaults(thd, *fields, *values);
+
/*
We have to check values after setup_tables to get covering_keys right in
reference tables
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 0701c5233ac..39744fe5704 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -432,12 +432,6 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
lex->link_first_table_back(view, link_to_local);
view->open_type= OT_BASE_ONLY;
- if (check_dependencies_in_with_clauses(lex->with_clauses_list))
- {
- res= TRUE;
- goto err;
- }
-
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
/*
@@ -879,6 +873,13 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
LEX *lex= thd->lex;
/*
+ Ensure character set number != 17 (character set = filename) and mbminlen=1
+ because these character sets are not parser friendly, which can give weird
+ sequence in .frm file of view and later give parsing error.
+ */
+ DBUG_ASSERT(thd->charset()->mbminlen == 1 && thd->charset()->number != 17);
+
+ /*
View definition query -- a SELECT statement that fully defines view. It
is generated from the Item-tree built from the original (specified by
the user) query. The idea is that generated query should eliminates all
@@ -1399,9 +1400,6 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
TABLE_LIST *tbl;
Security_context *security_ctx= 0;
- if (check_dependencies_in_with_clauses(thd->lex->with_clauses_list))
- goto err;
-
/*
Check rights to run commands (ANALYZE SELECT, EXPLAIN SELECT &
SHOW CREATE) which show underlying tables.
diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index 612c6e692fe..3ef751bc5b9 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -479,9 +479,15 @@ int compare_window_funcs_by_window_specs(Item_window_func *win_func1,
Let's use only one of the lists.
*/
if (!win_spec1->name() && win_spec2->name())
+ {
+ win_spec1->save_partition_list= win_spec1->partition_list;
win_spec1->partition_list= win_spec2->partition_list;
+ }
else
+ {
+ win_spec2->save_partition_list= win_spec2->partition_list;
win_spec2->partition_list= win_spec1->partition_list;
+ }
cmp= compare_order_lists(win_spec1->order_list,
win_spec2->order_list);
@@ -494,9 +500,15 @@ int compare_window_funcs_by_window_specs(Item_window_func *win_func1,
Let's use only one of the lists.
*/
if (!win_spec1->name() && win_spec2->name())
+ {
+ win_spec1->save_order_list= win_spec2->order_list;
win_spec1->order_list= win_spec2->order_list;
+ }
else
+ {
+ win_spec1->save_order_list= win_spec2->order_list;
win_spec2->order_list= win_spec1->order_list;
+ }
cmp= compare_window_frames(win_spec1->window_frame,
win_spec2->window_frame);
diff --git a/sql/sql_window.h b/sql/sql_window.h
index e0c1563e5bb..417d0bca12c 100644
--- a/sql/sql_window.h
+++ b/sql/sql_window.h
@@ -99,8 +99,10 @@ class Window_spec : public Sql_alloc
LEX_STRING *window_ref;
SQL_I_List<ORDER> *partition_list;
+ SQL_I_List<ORDER> *save_partition_list;
SQL_I_List<ORDER> *order_list;
+ SQL_I_List<ORDER> *save_order_list;
Window_frame *window_frame;
@@ -111,7 +113,8 @@ class Window_spec : public Sql_alloc
SQL_I_List<ORDER> *ord_list,
Window_frame *win_frame)
: window_names_are_checked(false), window_ref(win_ref),
- partition_list(part_list), order_list(ord_list),
+ partition_list(part_list), save_partition_list(NULL),
+ order_list(ord_list), save_order_list(NULL),
window_frame(win_frame), referenced_win_spec(NULL) {}
virtual char *name() { return NULL; }
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 6eb47f1e49f..312ea682975 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -69,14 +69,18 @@
/* this is to get the bison compilation windows warnings out */
#ifdef _MSC_VER
/* warning C4065: switch statement contains 'default' but no 'case' labels */
-#pragma warning (disable : 4065)
+/* warning C4102: 'yyexhaustedlab': unreferenced label */
+#pragma warning (disable : 4065 4102)
+#endif
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wunused-label" /* yyexhaustedlab: */
#endif
int yylex(void *yylval, void *yythd);
#define yyoverflow(A,B,C,D,E,F) \
{ \
- ulong val= *(F); \
+ size_t val= *(F); \
if (my_yyoverflow((B), (D), &val)) \
{ \
yyerror(thd, (char*) (A)); \
@@ -981,6 +985,7 @@ Virtual_column_info *add_virtual_expression(THD *thd, Item *expr)
class sp_label *splabel;
class sp_name *spname;
class sp_variable *spvar;
+ class With_element_head *with_element_head;
class With_clause *with_clause;
class Virtual_column_info *virtual_column;
@@ -1023,7 +1028,7 @@ Virtual_column_info *add_virtual_expression(THD *thd, Item *expr)
}
%{
-bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
+bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%}
%pure-parser /* We have threads */
@@ -2067,7 +2072,7 @@ END_OF_INPUT
%type <with_clause> opt_with_clause with_clause
-%type <lex_str_ptr> query_name
+%type <with_element_head> with_element_head
%type <lex_str_list> opt_with_column_list
@@ -2959,7 +2964,11 @@ call:
lex->value_list.empty();
sp_add_used_routine(lex, thd, $2, TYPE_ENUM_PROCEDURE);
}
- opt_sp_cparam_list {}
+ opt_sp_cparam_list
+ {
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
+ }
;
/* CALL parameters */
@@ -3104,17 +3113,22 @@ sp_decl:
sp_pcontext *pctx= lex->spcont;
uint num_vars= pctx->context_var_count();
Item *dflt_value_item= $5;
+ const bool has_default_clause = (dflt_value_item != NULL);
Lex->set_last_field_type($4);
- if (!dflt_value_item)
+
+ if (!has_default_clause)
{
dflt_value_item= new (thd->mem_root) Item_null(thd);
if (dflt_value_item == NULL)
MYSQL_YYABORT;
/* QQ Set to the var_type with null_value? */
}
-
- for (uint i = num_vars-$2 ; i < num_vars ; i++)
+
+ sp_variable *first_spvar = NULL;
+ const uint first_var_num = num_vars - $2;
+
+ for (uint i = first_var_num ; i < num_vars ; i++)
{
uint var_idx= pctx->var_context2runtime(i);
sp_variable *spvar= pctx->find_variable(var_idx);
@@ -3126,9 +3140,24 @@ sp_decl:
if (!last)
spvar->field_def= *lex->last_field;
+ if (i == first_var_num) {
+ first_spvar = spvar;
+ } else if (has_default_clause) {
+ Item_splocal *item =
+ new (thd->mem_root)
+ Item_splocal(thd, first_spvar->name, first_spvar->offset,
+ first_spvar->sql_type(), 0, 0);
+ if (item == NULL)
+ MYSQL_YYABORT; // OOM
+#ifndef DBUG_OFF
+ item->m_sp = lex->sphead;
+#endif
+ dflt_value_item = item;
+ }
+
spvar->default_value= dflt_value_item;
spvar->field_def.field_name= spvar->name.str;
-
+
if (lex->sphead->fill_field_definition(thd, lex,
&spvar->field_def))
{
@@ -3785,6 +3814,8 @@ sp_proc_stmt_return:
{
LEX *lex= Lex;
sp_head *sp= lex->sphead;
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
if (sp->m_type != TYPE_ENUM_FUNCTION)
my_yyabort_error((ER_SP_BADRETURN, MYF(0)));
@@ -4846,12 +4877,16 @@ create_select_query_expression:
{
Select->set_braces(0);
Select->set_with_clause($1);
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
}
union_clause
| opt_with_clause SELECT_SYM create_select_part2
create_select_part3_union_not_ready create_select_part4
{
Select->set_with_clause($1);
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
}
| '(' create_select_query_specification ')'
| '(' create_select_query_specification ')'
@@ -5558,6 +5593,8 @@ create_select_query_specification:
create_select_part4
{
Select->set_with_clause($1);
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
}
;
@@ -8434,6 +8471,8 @@ select:
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
lex->current_select->set_with_clause($1);
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
}
;
@@ -9431,8 +9470,8 @@ column_default_non_parenthesized_expr:
Item_splocal *il= $3->get_item_splocal();
if (il)
my_yyabort_error((ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str));
- $$= new (thd->mem_root) Item_default_value(thd, Lex->current_context(),
- $3);
+ $$= new (thd->mem_root) Item_default_value_arg(thd, Lex->current_context(),
+ $3);
if ($$ == NULL)
MYSQL_YYABORT;
}
@@ -12141,6 +12180,8 @@ do:
expr_list
{
Lex->insert_list= $3;
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
}
;
@@ -12357,7 +12398,10 @@ insert:
Lex->current_select= &Lex->select_lex;
}
insert_field_spec opt_insert_update
- {}
+ {
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
+ }
;
replace:
@@ -12374,7 +12418,10 @@ replace:
Lex->current_select= &Lex->select_lex;
}
insert_field_spec
- {}
+ {
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
+ }
;
insert_lock_option:
@@ -12566,7 +12613,11 @@ update:
*/
slex->set_lock_for_tables($3, slex->table_list.elements == 1);
}
- opt_where_clause opt_order_clause delete_limit_clause {}
+ opt_where_clause opt_order_clause delete_limit_clause
+ {
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
+ }
;
update_list:
@@ -12655,6 +12706,8 @@ single_multi:
{
if (multi_delete_set_locks_and_link_aux_tables(Lex))
MYSQL_YYABORT;
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
}
;
@@ -13621,7 +13674,10 @@ load:
opt_xml_rows_identified_by
opt_field_term opt_line_term opt_ignore_lines opt_field_or_var_spec
opt_load_data_set_spec
- {}
+ {
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
+ }
;
data_or_xml:
@@ -14076,6 +14132,8 @@ with_clause:
if (with_clause == NULL)
MYSQL_YYABORT;
Lex->derived_tables|= DERIVED_WITH;
+ Lex->with_cte_resolution= true;
+ Lex->with_cte_resolution= true;
Lex->curr_with_clause= with_clause;
with_clause->add_to_list(Lex->with_clauses_list_last_next);
}
@@ -14100,7 +14158,7 @@ with_list:
with_list_element:
- query_name
+ with_element_head
opt_with_column_list
{
$2= new List<LEX_STRING> (Lex->with_column_list);
@@ -14120,6 +14178,7 @@ with_list_element:
if (elem->set_unparsed_spec(thd, spec_start, $8,
(uint) (spec_start - query_start)))
MYSQL_YYABORT;
+ elem->set_tables_end_pos(lex->query_tables_last);
}
;
@@ -14146,12 +14205,15 @@ with_column_list:
;
-query_name:
+with_element_head:
ident
{
- $$= (LEX_STRING *) thd->memdup(&$1, sizeof(LEX_STRING));
- if ($$ == NULL)
+ LEX_CSTRING *name=
+ (LEX_CSTRING *) thd->memdup(&$1, sizeof(LEX_CSTRING));
+ $$= new (thd->mem_root) With_element_head(name);
+ if (unlikely(name == NULL || $$ == NULL))
MYSQL_YYABORT;
+ $$->tables_pos.set_start_pos(Lex->query_tables_last);
}
;
@@ -15058,7 +15120,10 @@ set:
sp_create_assignment_lex(thd, yychar == YYEMPTY);
}
start_option_value_list
- {}
+ {
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
+ }
| SET STATEMENT_SYM
{
LEX *lex= Lex;
@@ -16671,6 +16736,9 @@ view_select:
&not_used);
lex->parsing_options.allows_variable= TRUE;
lex->current_select->set_with_clause($2);
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
+
}
;
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index e4de3d8d0aa..bd4b2fbb062 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1022,7 +1022,9 @@ static Sys_var_ulong Sys_flush_time(
static bool check_ftb_syntax(sys_var *self, THD *thd, set_var *var)
{
return ft_boolean_check_syntax_string((uchar*)
- (var->save_result.string_value.str));
+ (var->save_result.string_value.str),
+ var->save_result.string_value.length,
+ self->charset(thd));
}
static bool query_cache_flush(sys_var *self, THD *thd, enum_var_type type)
{
@@ -4062,12 +4064,16 @@ static Sys_var_session_special Sys_identity(
*/
static bool update_insert_id(THD *thd, set_var *var)
{
- if (!var->value)
- {
- my_error(ER_NO_DEFAULT, MYF(0), var->var->name.str);
- return true;
- }
- thd->force_one_auto_inc_interval(var->save_result.ulonglong_value);
+ /*
+ If we set the insert_id to the DEFAULT or 0
+ it means we 'reset' it so it's value doesn't
+ affect the INSERT.
+ */
+ if (!var->value ||
+ var->save_result.ulonglong_value == 0)
+ thd->auto_inc_intervals_forced.empty();
+ else
+ thd->force_one_auto_inc_interval(var->save_result.ulonglong_value);
return false;
}
@@ -4075,6 +4081,8 @@ static ulonglong read_insert_id(THD *thd)
{
return thd->auto_inc_intervals_forced.minimum();
}
+
+
static Sys_var_session_special Sys_insert_id(
"insert_id", "The value to be used by the following INSERT "
"or ALTER TABLE statement when inserting an AUTO_INCREMENT value",
diff --git a/sql/table.cc b/sql/table.cc
index 1004f583448..d4f8170e0af 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1157,7 +1157,10 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
if (check_vcol_forward_refs(field, field->vcol_info) ||
check_vcol_forward_refs(field, field->check_constraint) ||
check_vcol_forward_refs(field, field->default_value))
+ {
+ *error_reported= true;
goto end;
+ }
}
res=0;
@@ -3284,6 +3287,21 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share,
/* Update to use trigger fields */
switch_defaults_to_nullable_trigger_fields(outparam);
+
+ for (uint k= 0; k < share->keys; k++)
+ {
+ KEY &key_info= outparam->key_info[k];
+ uint parts = (share->use_ext_keys ? key_info.ext_key_parts :
+ key_info.user_defined_key_parts);
+ for (uint p= 0; p < parts; p++)
+ {
+ KEY_PART_INFO &kp= key_info.key_part[p];
+ if (kp.field != outparam->field[kp.fieldnr - 1])
+ {
+ kp.field->vcol_info = outparam->field[kp.fieldnr - 1]->vcol_info;
+ }
+ }
+ }
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -4165,6 +4183,21 @@ bool check_table_name(const char *name, size_t length, bool check_for_path_chars
if (check_for_path_chars &&
(*name == '/' || *name == '\\' || *name == '~' || *name == FN_EXTCHAR))
return 1;
+ /*
+ We don't allow zero byte in table/schema names:
+ - Some code still uses NULL-terminated strings.
+ Zero bytes will confuse this code.
+ - There is a little practical use of zero bytes in names anyway.
+ Note, if the string passed as "name" comes here
+ from the parser as an identifier, it does not contain zero bytes,
+ as the parser rejects zero bytes in identifiers.
+ But "name" can also come here from queries like this:
+ SELECT * FROM I_S.TABLES WHERE TABLE_NAME='str';
+ In this case "name" is a general string expression
+ and it can have any arbitrary bytes, including zero bytes.
+ */
+ if (*name == 0x00)
+ return 1;
name++;
name_length++;
}
@@ -6329,7 +6362,7 @@ void TABLE::prepare_for_position()
if ((file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
s->primary_key < MAX_KEY)
{
- mark_columns_used_by_index_no_reset(s->primary_key, read_set);
+ mark_index_columns_for_read(s->primary_key);
/* signal change */
file->column_bitmaps_signal();
}
@@ -6345,7 +6378,7 @@ MY_BITMAP *TABLE::prepare_for_keyread(uint index, MY_BITMAP *map)
file->ha_start_keyread(index);
if (map != read_set || !(file->index_flags(index, 0, 1) & HA_CLUSTERED_INDEX))
{
- mark_columns_used_by_index(index, map);
+ mark_index_columns(index, map);
column_bitmaps_set(map);
}
DBUG_RETURN(backup);
@@ -6356,12 +6389,12 @@ MY_BITMAP *TABLE::prepare_for_keyread(uint index, MY_BITMAP *map)
Mark that only fields from one key is used. Useful before keyread.
*/
-void TABLE::mark_columns_used_by_index(uint index, MY_BITMAP *bitmap)
+void TABLE::mark_index_columns(uint index, MY_BITMAP *bitmap)
{
- DBUG_ENTER("TABLE::mark_columns_used_by_index");
+ DBUG_ENTER("TABLE::mark_index_columns");
bitmap_clear_all(bitmap);
- mark_columns_used_by_index_no_reset(index, bitmap);
+ mark_index_columns_no_reset(index, bitmap);
DBUG_VOID_RETURN;
}
@@ -6385,23 +6418,36 @@ void TABLE::restore_column_maps_after_keyread(MY_BITMAP *backup)
DBUG_VOID_RETURN;
}
+static void do_mark_index_columns(TABLE *table, uint index,
+ MY_BITMAP *bitmap, bool read)
+{
+ KEY_PART_INFO *key_part= table->key_info[index].key_part;
+ uint key_parts= table->key_info[index].user_defined_key_parts;
+ for (uint k= 0; k < key_parts; k++)
+ if (read)
+ key_part[k].field->register_field_in_read_map();
+ else
+ bitmap_set_bit(bitmap, key_part[k].fieldnr-1);
+ if (table->file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX &&
+ table->s->primary_key != MAX_KEY && table->s->primary_key != index)
+ do_mark_index_columns(table, table->s->primary_key, bitmap, read);
+}
/*
mark columns used by key, but don't reset other fields
*/
-void TABLE::mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *bitmap)
+inline void TABLE::mark_index_columns_no_reset(uint index, MY_BITMAP *bitmap)
{
- KEY_PART_INFO *key_part= key_info[index].key_part;
- KEY_PART_INFO *key_part_end= (key_part + key_info[index].user_defined_key_parts);
- for (;key_part != key_part_end; key_part++)
- bitmap_set_bit(bitmap, key_part->fieldnr-1);
- if (file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX &&
- s->primary_key != MAX_KEY && s->primary_key != index)
- mark_columns_used_by_index_no_reset(s->primary_key, bitmap);
+ do_mark_index_columns(this, index, bitmap, false);
}
+inline void TABLE::mark_index_columns_for_read(uint index)
+{
+ do_mark_index_columns(this, index, read_set, true);
+}
+
/*
Mark auto-increment fields as used fields in both read and write maps
@@ -6420,7 +6466,7 @@ void TABLE::mark_auto_increment_column()
bitmap_set_bit(read_set, found_next_number_field->field_index);
bitmap_set_bit(write_set, found_next_number_field->field_index);
if (s->next_number_keypart)
- mark_columns_used_by_index_no_reset(s->next_number_index, read_set);
+ mark_index_columns_for_read(s->next_number_index);
file->column_bitmaps_signal();
}
@@ -6476,7 +6522,7 @@ void TABLE::mark_columns_needed_for_delete()
file->use_hidden_primary_key();
else
{
- mark_columns_used_by_index_no_reset(s->primary_key, read_set);
+ mark_index_columns_for_read(s->primary_key);
need_signal= true;
}
}
@@ -6566,7 +6612,7 @@ void TABLE::mark_columns_needed_for_update()
file->use_hidden_primary_key();
else
{
- mark_columns_used_by_index_no_reset(s->primary_key, read_set);
+ mark_index_columns_for_read(s->primary_key);
need_signal= true;
}
}
@@ -6717,7 +6763,7 @@ void TABLE::mark_columns_per_binlog_row_image()
if ((my_field->flags & PRI_KEY_FLAG) ||
(my_field->type() != MYSQL_TYPE_BLOB))
{
- bitmap_set_bit(read_set, my_field->field_index);
+ my_field->register_field_in_read_map();
bitmap_set_bit(rpl_write_set, my_field->field_index);
}
}
@@ -6729,7 +6775,7 @@ void TABLE::mark_columns_per_binlog_row_image()
We don't need to mark the primary key in the rpl_write_set as the
binary log will include all columns read anyway.
*/
- mark_columns_used_by_index_no_reset(s->primary_key, read_set);
+ mark_index_columns_for_read(s->primary_key);
/* Only write columns that have changed */
rpl_write_set= write_set;
break;
diff --git a/sql/table.h b/sql/table.h
index 83c72f76831..38b63d285c6 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1421,8 +1421,9 @@ public:
MY_BITMAP *prepare_for_keyread(uint index, MY_BITMAP *map);
MY_BITMAP *prepare_for_keyread(uint index)
{ return prepare_for_keyread(index, &tmp_set); }
- void mark_columns_used_by_index(uint index, MY_BITMAP *map);
- void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map);
+ void mark_index_columns(uint index, MY_BITMAP *bitmap);
+ void mark_index_columns_no_reset(uint index, MY_BITMAP *bitmap);
+ void mark_index_columns_for_read(uint index);
void restore_column_maps_after_keyread(MY_BITMAP *backup);
void mark_auto_increment_column(void);
void mark_columns_needed_for_update(void);
@@ -1860,6 +1861,29 @@ class Item_in_subselect;
struct LEX;
class Index_hint;
+
+/*
+ @struct TABLE_CHAIN
+ @brief Subchain of global chain of table references
+
+ The structure contains a pointer to the address of the next_global
+ pointer to the first TABLE_LIST objectof the subchain and the address
+ of the next_global pointer to the element right after the last
+ TABLE_LIST object of the subchain. For an empty subchain both pointers
+ have the same value.
+*/
+
+struct TABLE_CHAIN
+{
+ TABLE_CHAIN() {}
+
+ TABLE_LIST **start_pos;
+ TABLE_LIST ** end_pos;
+
+ void set_start_pos(TABLE_LIST **pos) { start_pos= pos; }
+ void set_end_pos(TABLE_LIST **pos) { end_pos= pos; }
+};
+
struct TABLE_LIST
{
TABLE_LIST() {} /* Remove gcc warning */
@@ -2166,6 +2190,20 @@ struct TABLE_LIST
/* call back function for asking handler about caching in query cache */
qc_engine_callback callback_func;
thr_lock_type lock_type;
+
+ /*
+ Two fields below are set during parsing this table reference in the cases
+ when the table reference can be potentially a reference to a CTE table.
+ In this cases the fact that the reference is a reference to a CTE or not
+ will be ascertained at the very end of parsing of the query when referencies
+ to CTE are resolved. For references to CTE and to derived tables no mdl
+ requests are needed while for other table references they are. If a request
+ is possibly postponed the info that allows to issue this request must be
+ saved in 'mdl_type' and 'table_options'.
+ */
+ enum_mdl_type mdl_type;
+ ulong table_options;
+
uint outer_join; /* Which join type */
uint shared; /* Used in multi-upd */
size_t db_length;
diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc
index 78b57340a6b..e84d96ace33 100644
--- a/sql/threadpool_generic.cc
+++ b/sql/threadpool_generic.cc
@@ -1793,9 +1793,9 @@ static void print_pool_blocked_message(bool max_threads_reached)
if (now > pool_block_start + BLOCK_MSG_DELAY && !msg_written)
{
if (max_threads_reached)
- sql_print_error(MAX_THREADS_REACHED_MSG);
+ sql_print_warning(MAX_THREADS_REACHED_MSG);
else
- sql_print_error(CREATE_THREAD_ERROR_MSG, my_errno);
+ sql_print_warning(CREATE_THREAD_ERROR_MSG, my_errno);
sql_print_information("Threadpool has been blocked for %u seconds\n",
(uint)((now- pool_block_start)/1000000));
diff --git a/sql/transaction.cc b/sql/transaction.cc
index 543e0b7ad38..d9d0d402ec7 100644
--- a/sql/transaction.cc
+++ b/sql/transaction.cc
@@ -1,4 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -696,32 +697,6 @@ bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name)
if (WSREP_ON)
wsrep_register_hton(thd, thd->in_multi_stmt_transaction_mode());
- /**
- Checking whether it is safe to release metadata locks acquired after
- savepoint, if rollback to savepoint is successful.
-
- Whether it is safe to release MDL after rollback to savepoint depends
- on storage engines participating in transaction:
-
- - InnoDB doesn't release any row-locks on rollback to savepoint so it
- is probably a bad idea to release MDL as well.
- - Binary log implementation in some cases (e.g when non-transactional
- tables involved) may choose not to remove events added after savepoint
- from transactional cache, but instead will write them to binary
- log accompanied with ROLLBACK TO SAVEPOINT statement. Since the real
- write happens at the end of transaction releasing MDL on tables
- mentioned in these events (i.e. acquired after savepoint and before
- rollback ot it) can break replication, as concurrent DROP TABLES
- statements will be able to drop these tables before events will get
- into binary log,
-
- For backward-compatibility reasons we always release MDL if binary
- logging is off.
- */
- bool mdl_can_safely_rollback_to_savepoint=
- (!(mysql_bin_log.is_open() && thd->variables.sql_log_bin) ||
- ha_rollback_to_savepoint_can_release_mdl(thd));
-
if (ha_rollback_to_savepoint(thd, sv))
res= TRUE;
else if (((thd->variables.option_bits & OPTION_KEEP_LOG) ||
@@ -733,7 +708,14 @@ bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name)
thd->transaction.savepoints= sv;
- if (!res && mdl_can_safely_rollback_to_savepoint)
+ if (res)
+ /* An error occurred during rollback; we cannot release any MDL */;
+ else if (thd->variables.sql_log_bin && mysql_bin_log.is_open())
+ /* In some cases (such as with non-transactional tables) we may
+ choose to preserve events that were added after the SAVEPOINT,
+ delimiting them by SAVEPOINT and ROLLBACK TO SAVEPOINT statements.
+ Prematurely releasing MDL on such objects would break replication. */;
+ else if (ha_rollback_to_savepoint_can_release_mdl(thd))
thd->mdl_context.rollback_to_savepoint(sv->mdl_savepoint);
DBUG_RETURN(MY_TEST(res));
diff --git a/sql/win_tzname_data.h b/sql/win_tzname_data.h
index 03197227f8e..792cdbc7a13 100644
--- a/sql/win_tzname_data.h
+++ b/sql/win_tzname_data.h
@@ -12,6 +12,7 @@
{L"US Mountain Standard Time","America/Phoenix"},
{L"Mountain Standard Time (Mexico)","America/Chihuahua"},
{L"Mountain Standard Time","America/Denver"},
+{L"Yukon Standard Time","America/Whitehorse"},
{L"Central America Standard Time","America/Guatemala"},
{L"Central Standard Time","America/Chicago"},
{L"Easter Island Standard Time","Pacific/Easter"},
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index f4092b9b8a7..2258a4d8f6d 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -637,51 +637,75 @@ err:
return NULL;
}
-#define WSREP_SST_AUTH_ENV "WSREP_SST_OPT_AUTH"
+#define WSREP_SST_AUTH_ENV "WSREP_SST_OPT_AUTH"
+#define WSREP_SST_REMOTE_AUTH_ENV "WSREP_SST_OPT_REMOTE_AUTH"
+#define DATA_HOME_DIR_ENV "INNODB_DATA_HOME_DIR"
-static int sst_append_auth_env(wsp::env& env, const char* sst_auth)
+static int sst_append_env_var(wsp::env& env,
+ const char* const var,
+ const char* const val)
{
- int const sst_auth_size= strlen(WSREP_SST_AUTH_ENV) + 1 /* = */
- + (sst_auth ? strlen(sst_auth) : 0) + 1 /* \0 */;
+ int const env_str_size= strlen(var) + 1 /* = */
+ + (val ? strlen(val) : 0) + 1 /* \0 */;
- wsp::string sst_auth_str(sst_auth_size); // for automatic cleanup on return
- if (!sst_auth_str()) return -ENOMEM;
+ wsp::string env_str(env_str_size); // for automatic cleanup on return
+ if (!env_str()) return -ENOMEM;
- int ret= snprintf(sst_auth_str(), sst_auth_size, "%s=%s",
- WSREP_SST_AUTH_ENV, sst_auth ? sst_auth : "");
+ int ret= snprintf(env_str(), env_str_size, "%s=%s", var, val ? val : "");
- if (ret < 0 || ret >= sst_auth_size)
+ if (ret < 0 || ret >= env_str_size)
{
- WSREP_ERROR("sst_append_auth_env(): snprintf() failed: %d", ret);
+ WSREP_ERROR("sst_append_env_var(): snprintf(%s=%s) failed: %d",
+ var, val, ret);
return (ret < 0 ? ret : -EMSGSIZE);
}
- env.append(sst_auth_str());
+ env.append(env_str());
return -env.error();
}
-#define DATA_HOME_DIR_ENV "INNODB_DATA_HOME_DIR"
-
-static int sst_append_data_dir(wsp::env& env, const char* data_dir)
-{
- int const data_dir_size= strlen(DATA_HOME_DIR_ENV) + 1 /* = */
- + (data_dir ? strlen(data_dir) : 0) + 1 /* \0 */;
-
- wsp::string data_dir_str(data_dir_size); // for automatic cleanup on return
- if (!data_dir_str()) return -ENOMEM;
-
- int ret= snprintf(data_dir_str(), data_dir_size, "%s=%s",
- DATA_HOME_DIR_ENV, data_dir ? data_dir : "");
-
- if (ret < 0 || ret >= data_dir_size)
- {
- WSREP_ERROR("sst_append_data_dir(): snprintf() failed: %d", ret);
- return (ret < 0 ? ret : -EMSGSIZE);
- }
-
- env.append(data_dir_str());
- return -env.error();
-}
+#ifdef __WIN__
+/*
+ Space, single quote, ampersand, backquote, I/O redirection
+ characters, caret, all brackets, plus, exclamation and comma
+ characters require text to be enclosed in double quotes:
+*/
+#define IS_SPECIAL(c) \
+ (isspace(c) || c == '\'' || c == '&' || c == '`' || c == '|' || \
+ c == '>' || c == '<' || c == ';' || c == '^' || \
+ c == '[' || c == ']' || c == '{' || c == '}' || \
+ c == '(' || c == ')' || c == '+' || c == '!' || \
+ c == ',')
+/*
+ Inside values, equals character are interpreted as special
+ character and requires quotation:
+*/
+#define IS_SPECIAL_V(c) (IS_SPECIAL(c) || c == '=')
+/*
+ Double quotation mark and percent characters require escaping:
+*/
+#define IS_REQ_ESCAPING(c) (c == '""' || c == '%')
+#else
+/*
+ Space, single quote, ampersand, backquote, and I/O redirection
+ characters require text to be enclosed in double quotes. The
+ semicolon is used to separate shell commands, so it must be
+ enclosed in double quotes as well:
+*/
+#define IS_SPECIAL(c) \
+ (isspace(c) || c == '\'' || c == '&' || c == '`' || c == '|' || \
+ c == '>' || c == '<' || c == ';')
+/*
+ Inside values, characters are interpreted as in parameter names:
+*/
+#define IS_SPECIAL_V(c) IS_SPECIAL(c)
+/*
+ Double quotation mark and backslash characters require
+ backslash prefixing, the dollar symbol is used to substitute
+ a variable value, therefore it also requires escaping:
+*/
+#define IS_REQ_ESCAPING(c) (c == '"' || c == '\\' || c == '$')
+#endif
static size_t estimate_cmd_len (bool* extra_args)
{
@@ -707,22 +731,16 @@ static size_t estimate_cmd_len (bool* extra_args)
char c;
while ((c = *arg++) != 0)
{
- /*
- Space, single quote, ampersand, and I/O redirection characters
- require text to be enclosed in double quotes:
- */
- if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
-#ifdef __WIN__
- c == '>' || c == '<')
-#else
- /*
- The semicolon is used to separate shell commands, so it must be
- enclosed in double quotes as well:
- */
- c == '>' || c == '<' || c == ';')
-#endif
+ if (IS_SPECIAL(c))
+ {
+ quotation= true;
+ }
+ else if (IS_REQ_ESCAPING(c))
{
+ cmd_len++;
+#ifdef __WIN__
quotation= true;
+#endif
}
/*
If the equals symbol is encountered, then we need to separately
@@ -742,58 +760,20 @@ static size_t estimate_cmd_len (bool* extra_args)
}
while ((c = *arg++) != 0)
{
- /*
- Space, single quote, ampersand, and I/O redirection characters
- require text to be enclosed in double quotes:
- */
- if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
-#ifdef __WIN__
- c == '>' || c == '<')
-#else
- /*
- The semicolon is used to separate shell commands, so it must be
- enclosed in double quotes as well:
- */
- c == '>' || c == '<' || c == ';')
-#endif
+ if (IS_SPECIAL_V(c))
{
quotation= true;
}
- /*
- Double quotation mark or backslash symbol requires backslash
- prefixing:
- */
-#ifdef __WIN__
- else if (c == '"' || c == '\\')
-#else
- /*
- The dollar symbol is used to substitute a variable, therefore
- it also requires escaping:
- */
- else if (c == '"' || c == '\\' || c == '$')
-#endif
+ else if (IS_REQ_ESCAPING(c))
{
cmd_len++;
+#ifdef __WIN__
+ quotation= true;
+#endif
}
}
break;
}
- /*
- Double quotation mark or backslash symbol requires backslash
- prefixing:
- */
-#ifdef __WIN__
- else if (c == '"' || c == '\\')
-#else
- /*
- The dollar symbol is used to substitute a variable, therefore
- it also requires escaping:
- */
- else if (c == '"' || c == '\\' || c == '$')
-#endif
- {
- cmd_len++;
- }
}
/* Perhaps we need to quote the entire argument or its right part: */
if (quotation)
@@ -836,23 +816,17 @@ static void copy_orig_argv (char* cmd_str)
char c;
while ((c = *arg_scan++) != 0)
{
- /*
- Space, single quote, ampersand, and I/O redirection characters
- require text to be enclosed in double quotes:
- */
- if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
-#ifdef __WIN__
- c == '>' || c == '<')
-#else
- /*
- The semicolon is used to separate shell commands, so it must be
- enclosed in double quotes as well:
- */
- c == '>' || c == '<' || c == ';')
-#endif
+ if (IS_SPECIAL(c))
{
quotation= true;
}
+ else if (IS_REQ_ESCAPING(c))
+ {
+ plain= false;
+#ifdef __WIN__
+ quotation= true;
+#endif
+ }
/*
If the equals symbol is encountered, then we need to separately
process the right side:
@@ -887,13 +861,13 @@ static void copy_orig_argv (char* cmd_str)
while (m)
{
c = *arg++;
+ if (IS_REQ_ESCAPING(c))
+ {
#ifdef __WIN__
- if (c == '"' || c == '\\')
+ *cmd_str++ = c;
#else
- if (c == '"' || c == '\\' || c == '$')
-#endif
- {
*cmd_str++ = '\\';
+#endif
}
*cmd_str++ = c;
m--;
@@ -922,58 +896,20 @@ static void copy_orig_argv (char* cmd_str)
/* Let's deal with the left side of the expression: */
while ((c = *arg_scan++) != 0)
{
- /*
- Space, single quote, ampersand, and I/O redirection characters
- require text to be enclosed in double quotes:
- */
- if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
-#ifdef __WIN__
- c == '>' || c == '<')
-#else
- /*
- The semicolon is used to separate shell commands, so it must be
- enclosed in double quotes as well:
- */
- c == '>' || c == '<' || c == ';')
-#endif
+ if (IS_SPECIAL_V(c))
{
quotation= true;
}
- /*
- Double quotation mark or backslash symbol requires backslash
- prefixing:
- */
-#ifdef __WIN__
- else if (c == '"' || c == '\\')
-#else
- /*
- The dollar symbol is used to substitute a variable, therefore
- it also requires escaping:
- */
- else if (c == '"' || c == '\\' || c == '$')
-#endif
+ else if (IS_REQ_ESCAPING(c))
{
plain= false;
+#ifdef __WIN__
+ quotation= true;
+#endif
}
}
break;
}
- /*
- Double quotation mark or backslash symbol requires backslash
- prefixing:
- */
-#ifdef __WIN__
- else if (c == '"' || c == '\\')
-#else
- /*
- The dollar symbol is used to substitute a variable, therefore
- it also requires escaping:
- */
- else if (c == '"' || c == '\\' || c == '$')
-#endif
- {
- plain= false;
- }
}
if (n)
{
@@ -996,13 +932,13 @@ static void copy_orig_argv (char* cmd_str)
{
while ((c = *arg++) != 0)
{
+ if (IS_REQ_ESCAPING(c))
+ {
#ifdef __WIN__
- if (c == '"' || c == '\\')
+ *cmd_str++ = c;
#else
- if (c == '"' || c == '\\' || c == '$')
-#endif
- {
*cmd_str++ = '\\';
+#endif
}
*cmd_str++ = c;
}
@@ -1054,6 +990,8 @@ static ssize_t sst_prepare_other (const char* method,
{
WSREP_ERROR("sst_prepare_other(): generate_binlog_index_opt_val() failed %d",
ret);
+ if (binlog_opt_val) my_free(binlog_opt_val);
+ return ret;
}
make_wsrep_defaults_file();
@@ -1071,6 +1009,7 @@ static ssize_t sst_prepare_other (const char* method,
wsrep_defaults_file,
(int)getpid(),
binlog_opt_val, binlog_index_opt_val);
+
my_free(binlog_opt_val);
my_free(binlog_index_opt_val);
@@ -1090,7 +1029,7 @@ static ssize_t sst_prepare_other (const char* method,
return -env.error();
}
- if ((ret= sst_append_auth_env(env, sst_auth)))
+ if ((ret= sst_append_env_var(env, WSREP_SST_AUTH_ENV, sst_auth)))
{
WSREP_ERROR("sst_prepare_other(): appending auth failed: %d", ret);
return ret;
@@ -1098,7 +1037,7 @@ static ssize_t sst_prepare_other (const char* method,
if (data_home_dir)
{
- if ((ret= sst_append_data_dir(env, data_home_dir)))
+ if ((ret= sst_append_env_var(env, DATA_HOME_DIR_ENV, data_home_dir)))
{
WSREP_ERROR("sst_prepare_other(): appending data "
"directory failed: %d", ret);
@@ -1275,12 +1214,12 @@ ssize_t wsrep_sst_prepare (void** msg)
*msg = malloc (msg_len);
if (NULL != *msg) {
- char* const method_ptr(reinterpret_cast<char*>(*msg));
+ char* const method_ptr(static_cast<char*>(*msg));
strcpy (method_ptr, wsrep_sst_method);
char* const addr_ptr(method_ptr + method_len + 1);
strcpy (addr_ptr, addr_out);
- WSREP_INFO ("Prepared SST request: %s|%s", method_ptr, addr_ptr);
+ WSREP_DEBUG("Prepared SST request: %s|%s", method_ptr, addr_ptr);
}
else {
WSREP_ERROR("Failed to allocate SST request of size %zu. Can't continue.",
@@ -1371,7 +1310,7 @@ static int sst_donate_mysqldump (const char* addr,
WSREP_SST_OPT_GTID " '%s:%lld' "
WSREP_SST_OPT_GTID_DOMAIN_ID " '%d'"
"%s",
- addr, port, mysqld_port, mysqld_unix_port,
+ addr, port, mysqld_port, mysqld_unix_port,
wsrep_defaults_file, uuid_str,
(long long)seqno, wsrep_gtid_domain_id,
bypass ? " " WSREP_SST_OPT_BYPASS : "");
@@ -1495,7 +1434,7 @@ static int sst_flush_tables(THD* thd)
WSREP_WARN("Current client character set is non-supported parser character set: %s", current_charset->csname);
thd->variables.character_set_client = &my_charset_latin1;
WSREP_WARN("For SST temporally setting character set to : %s",
- my_charset_latin1.csname);
+ my_charset_latin1.csname);
}
if (run_sql_command(thd, "FLUSH TABLES WITH READ LOCK"))
@@ -1563,7 +1502,7 @@ static void sst_disallow_writes (THD* thd, bool yes)
WSREP_WARN("Current client character set is non-supported parser character set: %s", current_charset->csname);
thd->variables.character_set_client = &my_charset_latin1;
WSREP_WARN("For SST temporally setting character set to : %s",
- my_charset_latin1.csname);
+ my_charset_latin1.csname);
}
snprintf (query_str, query_max, "SET GLOBAL innodb_disallow_writes=%d",
@@ -1719,6 +1658,7 @@ static int sst_donate_other (const char* method,
}
char* binlog_opt_val= NULL;
+ char* binlog_index_opt_val= NULL;
int ret;
if ((ret= generate_binlog_opt_val(&binlog_opt_val)))
@@ -1727,25 +1667,38 @@ static int sst_donate_other (const char* method,
return ret;
}
+ if ((ret= generate_binlog_index_opt_val(&binlog_index_opt_val)))
+ {
+ WSREP_ERROR("sst_prepare_other(): generate_binlog_index_opt_val() failed %d",
+ ret);
+ if (binlog_opt_val) my_free(binlog_opt_val);
+ return ret;
+ }
+
make_wsrep_defaults_file();
ret= snprintf (cmd_str(), cmd_len,
"wsrep_sst_%s "
WSREP_SST_OPT_ROLE " 'donor' "
WSREP_SST_OPT_ADDR " '%s' "
+ WSREP_SST_OPT_LPORT " '%u' "
WSREP_SST_OPT_SOCKET " '%s' "
WSREP_SST_OPT_DATA " '%s' "
"%s"
WSREP_SST_OPT_GTID " '%s:%lld' "
WSREP_SST_OPT_GTID_DOMAIN_ID " '%d'"
"%s"
+ "%s"
"%s",
- method, addr, mysqld_unix_port, mysql_real_data_home,
+ method, addr, mysqld_port, mysqld_unix_port,
+ mysql_real_data_home,
wsrep_defaults_file,
uuid, (long long) seqno, wsrep_gtid_domain_id,
- binlog_opt_val,
+ binlog_opt_val, binlog_index_opt_val,
bypass ? " " WSREP_SST_OPT_BYPASS : "");
+
my_free(binlog_opt_val);
+ my_free(binlog_index_opt_val);
if (ret < 0 || size_t(ret) >= cmd_len)
{
@@ -1820,7 +1773,21 @@ wsrep_cb_status_t wsrep_sst_donate_cb (void* app_ctx, void* recv_ctx,
const char* data = method + method_len + 1;
- if (check_request_str(data, address_char))
+ /* check for auth@addr separator */
+ const char* addr= strrchr(data, '@');
+ wsp::string remote_auth;
+ if (addr)
+ {
+ remote_auth.set(strndup(data, addr - data));
+ addr++;
+ }
+ else
+ {
+ // no auth part
+ addr= data;
+ }
+
+ if (check_request_str(addr, address_char))
{
WSREP_ERROR("Bad SST address string. SST canceled.");
return WSREP_CB_FAILURE;
@@ -1841,15 +1808,25 @@ wsrep_cb_status_t wsrep_sst_donate_cb (void* app_ctx, void* recv_ctx,
}
int ret;
- if ((ret= sst_append_auth_env(env, sst_auth_real)))
+ if ((ret= sst_append_env_var(env, WSREP_SST_AUTH_ENV, sst_auth_real)))
{
WSREP_ERROR("wsrep_sst_donate_cb(): appending auth env failed: %d", ret);
return WSREP_CB_FAILURE;
}
+ if (remote_auth())
+ {
+ if ((ret= sst_append_env_var(env, WSREP_SST_REMOTE_AUTH_ENV,remote_auth())))
+ {
+ WSREP_ERROR("wsrep_sst_donate_cb(): appending remote auth env failed: "
+ "%d", ret);
+ return WSREP_CB_FAILURE;
+ }
+ }
+
if (data_home_dir)
{
- if ((ret= sst_append_data_dir(env, data_home_dir)))
+ if ((ret= sst_append_env_var(env, DATA_HOME_DIR_ENV, data_home_dir)))
{
WSREP_ERROR("wsrep_sst_donate_cb(): appending data "
"directory failed: %d", ret);
@@ -1859,12 +1836,12 @@ wsrep_cb_status_t wsrep_sst_donate_cb (void* app_ctx, void* recv_ctx,
if (!strcmp (WSREP_SST_MYSQLDUMP, method))
{
- ret = sst_donate_mysqldump(data, &current_gtid->uuid, uuid_str,
+ ret = sst_donate_mysqldump(addr, &current_gtid->uuid, uuid_str,
current_gtid->seqno, bypass, env());
}
else
{
- ret = sst_donate_other(method, data, uuid_str,
+ ret = sst_donate_other(method, addr, uuid_str,
current_gtid->seqno, bypass, env());
}
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index d75c57a9b1b..f991726634d 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -13,6 +13,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
+IF(WITHOUT_DYNAMIC_PLUGINS OR WITH_NONE OR ("${PLUGIN_CONNECT}" STREQUAL "NO"))
+ RETURN()
+ENDIF()
+
SET(CONNECT_PLUGIN_STATIC "connect")
SET(CONNECT_PLUGIN_DYNAMIC "connect")
@@ -104,6 +108,7 @@ IF(CONNECT_WITH_VCT)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} filamvct.cpp tabvct.cpp filamvct.h tabvct.h)
add_definitions(-DVCT_SUPPORT)
ENDIF(CONNECT_WITH_VCT)
+ADD_FEATURE_INFO(CONNECT_VCT CONNECT_WITH_VCT "Support for VCT in the CONNECT storage engine")
#
@@ -129,6 +134,7 @@ IF(CONNECT_WITH_LIBXML2)
D:/libxml/lib)
ENDIF(WIN32)
FIND_PACKAGE(LibXml2)
+ SET_PACKAGE_PROPERTIES(LibXml2 PROPERTIES TYPE OPTIONAL)
IF (LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
@@ -136,6 +142,8 @@ IF(CONNECT_WITH_LIBXML2)
add_definitions(-DLIBXML2_SUPPORT)
ENDIF(LIBXML2_FOUND)
ENDIF(CONNECT_WITH_LIBXML2)
+ADD_FEATURE_INFO(CONNECT_LIBXML2 CONNECT_WITH_LIBXML2
+ "Support for LIBXML2 in the CONNECT storage engine")
IF(WIN32)
@@ -149,6 +157,8 @@ IF(WIN32)
SET(MSXML_FOUND 1)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp domdoc.h)
ENDIF(CONNECT_WITH_MSXML)
+ ADD_FEATURE_INFO(CONNECT_MSXML CONNECT_WITH_MSXML
+ "Support for MSXML in the CONNECT storage engine")
ENDIF(WIN32)
IF(LIBXML2_FOUND OR MSXML_FOUND)
@@ -249,6 +259,7 @@ int main() {
tabodbc.cpp tabodbc.h odbccat.h odbconn.cpp odbconn.h)
ENDIF(UNIX)
ENDIF(CONNECT_WITH_ODBC)
+ADD_FEATURE_INFO(CONNECT_ODBC ODBC_LIBRARY "Support for ODBC in the CONNECT storage engine")
#
# JDBC with MongoDB Java Driver included but disabled if without MONGO
@@ -258,7 +269,9 @@ OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON)
IF(CONNECT_WITH_JDBC)
FIND_PACKAGE(Java 1.6)
+ SET_PACKAGE_PROPERTIES(Java PROPERTIES TYPE OPTIONAL)
FIND_PACKAGE(JNI)
+ SET_PACKAGE_PROPERTIES(JNI PROPERTIES TYPE OPTIONAL)
IF (JAVA_FOUND AND JNI_FOUND)
INCLUDE(UseJava)
INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH})
@@ -272,15 +285,21 @@ IF(CONNECT_WITH_JDBC)
JdbcInterface.java ApacheInterface.java MariadbInterface.java
MysqlInterface.java OracleInterface.java PostgresqlInterface.java
Mongo2Interface.java Mongo3Interface.java
- JavaWrappers.jar)
+ mysql-test/connect/std_data/JavaWrappers.jar)
add_definitions(-DJAVA_SUPPORT)
+ ADD_FEATURE_INFO(CONNECT_JDBC "ON" "Support for JDBC in the CONNECT storage engine")
IF(CONNECT_WITH_MONGO)
- SET(CONNECT_SOURCES ${CONNECT_SOURCES} Mongo2.jar Mongo3.jar)
+ SET(CONNECT_SOURCES ${CONNECT_SOURCES}
+ mysql-test/connect/std_data/Mongo2.jar
+ mysql-test/connect/std_data/Mongo3.jar)
add_definitions(-DMONGO_SUPPORT)
ENDIF()
ELSE()
SET(JDBC_LIBRARY "")
+ ADD_FEATURE_INFO(CONNECT_JDBC "OFF" "Support for JDBC in the CONNECT storage engine")
ENDIF()
+ELSE(CONNECT_WITH_JDBC)
+ ADD_FEATURE_INFO(CONNECT_JDBC "OFF" "Support for JDBC in the CONNECT storage engine")
ENDIF(CONNECT_WITH_JDBC)
#
@@ -294,6 +313,7 @@ IF(CONNECT_WITH_ZIP)
filamzip.h tabzip.h ioapi.h unzip.h zip.h)
add_definitions(-DZIP_SUPPORT -DNOCRYPT)
ENDIF(CONNECT_WITH_ZIP)
+ADD_FEATURE_INFO(CONNECT_ZIP CONNECT_WITH_ZIP "Support for ZIP in the CONNECT storage engine")
#
# MONGO C Driver
@@ -310,6 +330,7 @@ IF(CONNECT_WITH_MONGO)
D:/mongo-c-driver/lib)
ENDIF(WIN32)
FIND_PACKAGE(libmongoc-1.0 1.7 QUIET)
+ SET_PACKAGE_PROPERTIES(libmongoc PROPERTIES TYPE OPTIONAL)
IF (libmongoc-1.0_FOUND)
INCLUDE_DIRECTORIES(${MONGOC_INCLUDE_DIRS})
SET(MONGOC_LIBRARY ${MONGOC_LIBRARIES})
@@ -317,14 +338,18 @@ IF(CONNECT_WITH_MONGO)
cmgoconn.cpp cmgfam.cpp tabcmg.cpp
cmgoconn.h cmgfam.h tabcmg.h)
add_definitions(-DCMGO_SUPPORT)
+ ADD_FEATURE_INFO(CONNECT_MONGODB "ON" "Support for MongoDB in the CONNECT storage engine")
IF (NOT JAVA_FOUND AND JNI_FOUND)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h)
add_definitions(-DMONGO_SUPPORT)
ENDIF (NOT JAVA_FOUND AND JNI_FOUND)
+ ELSE(libmongoc-1.0_FOUND)
+ ADD_FEATURE_INFO(CONNECT_MONGODB "OFF" "Support for MongoDB in the CONNECT storage engine")
ENDIF(libmongoc-1.0_FOUND)
+ELSE(CONNECT_WITH_MONGO)
+ ADD_FEATURE_INFO(CONNECT_MONGODB "OFF" "Support for MongoDB in the CONNECT storage engine")
ENDIF(CONNECT_WITH_MONGO)
-
#
# REST
#
@@ -356,6 +381,7 @@ IF(CONNECT_WITH_REST)
## MESSAGE(STATUS "=====> cpprestsdk package not found")
# ENDIF (cpprestsdk_FOUND)
ENDIF(CONNECT_WITH_REST)
+ADD_FEATURE_INFO(CONNECT_REST CONNECT_WITH_REST "Support for REST API in the CONNECT storage engine")
#
# XMAP
@@ -366,6 +392,7 @@ OPTION(CONNECT_WITH_XMAP "Compile CONNECT storage engine with index file mapping
IF(CONNECT_WITH_XMAP)
add_definitions(-DXMAP)
ENDIF(CONNECT_WITH_XMAP)
+ADD_FEATURE_INFO(CONNECT_XMAP CONNECT_WITH_XMAP "Support for index file mapping in the CONNECT storage engine")
#
# Plugin definition
@@ -408,14 +435,13 @@ IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
SET (JAVA_SOURCES JdbcInterface.java)
add_jar(JdbcInterface ${JAVA_SOURCES})
INSTALL(FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/JavaWrappers.jar
+ ${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/connect/std_data/JavaWrappers.jar
${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar
DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT connect-engine)
IF(CONNECT_WITH_MONGO)
INSTALL(FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/Mongo2.jar
- ${CMAKE_CURRENT_SOURCE_DIR}/Mongo3.jar
+ ${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/connect/std_data/Mongo2.jar
+ ${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/connect/std_data/Mongo3.jar
DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT connect-engine)
ENDIF()
ENDIF()
-
diff --git a/storage/connect/JavaWrappers.jar b/storage/connect/JavaWrappers.jar
deleted file mode 100644
index 33b29e7685b..00000000000
--- a/storage/connect/JavaWrappers.jar
+++ /dev/null
Binary files differ
diff --git a/storage/connect/Mongo2.jar b/storage/connect/Mongo2.jar
deleted file mode 100644
index d51cc5d2345..00000000000
--- a/storage/connect/Mongo2.jar
+++ /dev/null
Binary files differ
diff --git a/storage/connect/Mongo3.jar b/storage/connect/Mongo3.jar
deleted file mode 100644
index f84e089ef50..00000000000
--- a/storage/connect/Mongo3.jar
+++ /dev/null
Binary files differ
diff --git a/storage/connect/bsonudf.cpp b/storage/connect/bsonudf.cpp
index 783be52602a..ed795edb363 100644
--- a/storage/connect/bsonudf.cpp
+++ b/storage/connect/bsonudf.cpp
@@ -12,6 +12,7 @@
#include <mysql.h>
#include <sql_error.h>
#include <stdio.h>
+#include <cassert>
#include "bsonudf.h"
@@ -621,7 +622,7 @@ PVAL BJNX::GetCalcValue(PGLOBAL g, PBVAL bap, int n)
{
// For calculated arrays, a local Value must be used
int lng = 0;
- short type, prec = 0;
+ short type = 0, prec = 0;
bool b = n < Nod - 1;
PVAL valp;
PBVAL vlp, vp;
@@ -690,7 +691,7 @@ PVAL BJNX::GetCalcValue(PGLOBAL g, PBVAL bap, int n)
break;
default:
- break;
+ DBUG_ASSERT(!"Implement new op type support.");
} // endswitch Op
return valp = AllocateValue(g, type, lng, prec);
@@ -4978,7 +4979,7 @@ char *bbin_array_add(UDF_INIT *initid, UDF_ARGS *args, char *result,
uint n = 2;
int* x = GetIntArgPtr(g, args, n);
BJNX bnx(g, NULL, TYPE_STRING);
- PBVAL jarp, top, jvp = NULL;
+ PBVAL jarp = NULL, top = NULL, jvp = NULL;
PBVAL jsp = bnx.MakeValue(args, 0, true, &top);
if (bnx.CheckPath(g, args, jsp, jvp, 2))
@@ -5611,7 +5612,7 @@ char *bbin_object_values(UDF_INIT *initid, UDF_ARGS *args, char *result,
if (!bsp) {
if (!CheckMemory(g, initid, args, 1, true, true)) {
BJNX bnx(g);
- PBVAL top, jarp;
+ PBVAL top, jarp = NULL;
PBVAL jvp = bnx.MakeValue(args, 0, true, &top);
if (jvp->Type == TYPE_JOB) {
diff --git a/storage/connect/inihandl.cpp b/storage/connect/inihandl.cpp
index 8e79aeac7ef..7d8741ebfa3 100644
--- a/storage/connect/inihandl.cpp
+++ b/storage/connect/inihandl.cpp
@@ -193,17 +193,17 @@ static void PROFILE_Save( FILE *file, PROFILESECTION *section )
secno++;
}
- for (key = section->key; key; key = key->next)
- if (key->name && key->name[0]) {
+ for (key= section->key; key; key= key->next) {
+ if (key->name[0]) {
fprintf(file, "%s", SVP(key->name));
if (key->value)
fprintf(file, "=%s", SVP(key->value));
fprintf(file, "\n");
- } // endif key->name
-
- } // endfor section
+ } // endif key->name
+ }
+ } // endfor section
} // end of PROFILE_Save
diff --git a/storage/connect/javaconn.cpp b/storage/connect/javaconn.cpp
index 2b288e3cdc6..439986734b2 100644
--- a/storage/connect/javaconn.cpp
+++ b/storage/connect/javaconn.cpp
@@ -60,6 +60,7 @@ extern char *ClassPath; // The connect_class_path global variable value
char *GetPluginDir(void);
char *GetMessageDir(void);
char *GetJavaWrapper(void); // The connect_java_wrapper variable value
+extern MYSQL_PLUGIN_IMPORT char lc_messages_dir[FN_REFLEN];
/***********************************************************************/
/* Static JAVAConn objects. */
diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp
index c1df923f0b8..82492cab6ef 100644
--- a/storage/connect/jsonudf.cpp
+++ b/storage/connect/jsonudf.cpp
@@ -508,7 +508,7 @@ PVAL JSNX::GetCalcValue(PGLOBAL g, PJAR jap, int n)
{
// For calculated arrays, a local Value must be used
int lng = 0;
- short type, prec = 0;
+ short type= 0, prec= 0;
bool b = n < Nod - 1;
PVAL valp;
PJVAL vlp, vp;
diff --git a/storage/connect/mysql-test/connect/std_data/Mongo2.jar b/storage/connect/mysql-test/connect/std_data/Mongo2.jar
index ae485805d6a..d51cc5d2345 100644
--- a/storage/connect/mysql-test/connect/std_data/Mongo2.jar
+++ b/storage/connect/mysql-test/connect/std_data/Mongo2.jar
Binary files differ
diff --git a/storage/connect/mysql-test/connect/std_data/Mongo3.jar b/storage/connect/mysql-test/connect/std_data/Mongo3.jar
index 91dbc4acbeb..f84e089ef50 100644
--- a/storage/connect/mysql-test/connect/std_data/Mongo3.jar
+++ b/storage/connect/mysql-test/connect/std_data/Mongo3.jar
Binary files differ
diff --git a/storage/connect/tabbson.cpp b/storage/connect/tabbson.cpp
index 2df84e852eb..8569e39f678 100644
--- a/storage/connect/tabbson.cpp
+++ b/storage/connect/tabbson.cpp
@@ -871,7 +871,7 @@ PBVAL BCUTIL::MakeBson(PGLOBAL g, PBVAL jsp, int n)
/***********************************************************************/
PBVAL BCUTIL::GetRowValue(PGLOBAL g, PBVAL row, int i)
{
- int nod = Cp->Nod, n = nod - 1;
+ int nod = Cp->Nod;
JNODE *nodes = Cp->Nodes;
PBVAL arp;
PBVAL bvp = NULL;
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 08e8e3ff5ab..ff646e00f39 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -189,6 +189,6 @@ ENDIF()
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/extra/mariabackup ${CMAKE_BINARY_DIR}/extra/mariabackup)
-IF(TARGET innobase)
- ADD_DEPENDENCIES(innobase GenError)
+IF(WITH_UNIT_TESTS)
+ ADD_SUBDIRECTORY(unittest)
ENDIF()
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index f7fe4413086..a8ab25f12e9 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -3141,7 +3141,7 @@ func_exit:
@param[in,out] page page to remove
@param[in] index index tree
@param[in,out] mtr mini-transaction */
-void
+dberr_t
btr_level_list_remove_func(
ulint space,
const page_size_t& page_size,
@@ -3184,6 +3184,10 @@ btr_level_list_remove_func(
page_id_t(space, next_page_no), page_size,
RW_X_LATCH, index, mtr);
+ if (!next_block) {
+ return DB_ERROR;
+ }
+
page_t* next_page
= buf_block_get_frame(next_block);
#ifdef UNIV_BTR_DEBUG
@@ -3196,6 +3200,8 @@ btr_level_list_remove_func(
buf_block_get_page_zip(next_block),
prev_page_no, mtr);
}
+
+ return DB_SUCCESS;
}
/****************************************************************//**
@@ -3675,7 +3681,10 @@ retry:
btr_search_drop_page_hash_index(block);
/* Remove the page from the level list */
- btr_level_list_remove(space, page_size, page, index, mtr);
+ if (DB_SUCCESS != btr_level_list_remove(space, page_size,
+ page, index, mtr)) {
+ goto err_exit;
+ }
if (dict_index_is_spatial(index)) {
rec_t* my_rec = father_cursor.page_cur.rec;
@@ -3807,7 +3816,11 @@ retry:
#endif /* UNIV_BTR_DEBUG */
/* Remove the page from the level list */
- btr_level_list_remove(space, page_size, (page_t*)page, index, mtr);
+ if (DB_SUCCESS != btr_level_list_remove(space, page_size,
+ (page_t*)page,
+ index, mtr)) {
+ goto err_exit;
+ }
ut_ad(btr_node_ptr_get_child_page_no(
btr_cur_get_rec(&father_cursor), offsets)
@@ -4186,7 +4199,8 @@ btr_discard_page(
}
/* Remove the page from the level list */
- btr_level_list_remove(space, page_size, page, index, mtr);
+ ut_a(DB_SUCCESS == btr_level_list_remove(space, page_size, page,
+ index, mtr));
#ifdef UNIV_ZIP_DEBUG
{
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 8f2acdb35bd..8d0a34d07a1 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -344,10 +344,12 @@ btr_cur_latch_leaves(
page_size, RW_X_LATCH, cursor->index, mtr);
latch_leaves.blocks[2] = get_block;
#ifdef UNIV_BTR_DEBUG
- ut_a(page_is_comp(get_block->frame)
- == page_is_comp(page));
- ut_a(btr_page_get_prev(get_block->frame)
- == page_get_page_no(page));
+ if (get_block) {
+ ut_a(page_is_comp(get_block->frame)
+ == page_is_comp(page));
+ ut_a(btr_page_get_prev(get_block->frame)
+ == page_get_page_no(page));
+ }
#endif /* UNIV_BTR_DEBUG */
if (spatial) {
cursor->rtr_info->tree_blocks[
@@ -3242,7 +3244,8 @@ fail_err:
ut_ad(thr->graph->trx->id
== trx_read_trx_id(
static_cast<const byte*>(
- trx_id->data)));
+ trx_id->data))
+ || index->table->is_temporary());
}
}
#endif
@@ -3844,7 +3847,8 @@ btr_cur_update_in_place(
index = cursor->index;
ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
- ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG));
+ ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)
+ || index->table->is_temporary());
/* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index));
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
@@ -4017,7 +4021,8 @@ btr_cur_optimistic_update(
page = buf_block_get_frame(block);
rec = btr_cur_get_rec(cursor);
index = cursor->index;
- ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG));
+ ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)
+ || index->table->is_temporary());
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table));
/* This is intended only for leaf page updates */
@@ -4354,8 +4359,8 @@ btr_cur_pessimistic_update(
ut_ad(!page_zip || !dict_table_is_temporary(index->table));
/* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index));
- ut_ad(trx_id > 0
- || (flags & BTR_KEEP_SYS_FLAG));
+ ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)
+ || index->table->is_temporary());
ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG)
|| dict_index_is_clust(index));
ut_ad(thr_get_trx(thr)->id == trx_id
diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc
index 645334cbf4d..36dd9ab8470 100644
--- a/storage/innobase/btr/btr0defragment.cc
+++ b/storage/innobase/btr/btr0defragment.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (C) 2012, 2014 Facebook, Inc. All Rights Reserved.
-Copyright (C) 2014, 2019, MariaDB Corporation.
+Copyright (C) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -312,6 +312,7 @@ btr_defragment_save_defrag_stats_if_needed(
{
if (srv_defragment_stats_accuracy != 0 // stats tracking disabled
&& dict_index_get_space(index) != 0 // do not track system tables
+ && !index->table->is_temporary()
&& index->stat_defrag_modified_counter
>= srv_defragment_stats_accuracy) {
dict_stats_defrag_pool_add(index);
@@ -487,7 +488,8 @@ btr_defragment_merge_pages(
lock_update_merge_left(to_block, orig_pred,
from_block);
btr_search_drop_page_hash_index(from_block);
- btr_level_list_remove(space, page_size, (page_t*)from_page, index, mtr);
+ ut_a(DB_SUCCESS == btr_level_list_remove(space, page_size,
+ (page_t*)from_page, index, mtr));
btr_page_get_father(index, from_block, mtr, &parent);
btr_cur_node_ptr_delete(&parent, mtr);
/* btr_blob_dbg_remove(from_page, index,
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc
index 60d9c90c310..685e98909db 100644
--- a/storage/innobase/btr/btr0scrub.cc
+++ b/storage/innobase/btr/btr0scrub.cc
@@ -1,5 +1,5 @@
// Copyright (c) 2014, Google Inc.
-// Copyright (c) 2017, MariaDB Corporation.
+// Copyright (c) 2017, 2021, MariaDB Corporation.
/**************************************************//**
@file btr/btr0scrub.cc
@@ -835,20 +835,12 @@ btr_scrub_page(
/**************************************************************//**
Start iterating a space */
-UNIV_INTERN
-bool
-btr_scrub_start_space(
-/*===================*/
- ulint space, /*!< in: space */
- btr_scrub_t* scrub_data) /*!< in/out: scrub data */
+bool btr_scrub_start_space(const fil_space_t &space, btr_scrub_t *scrub_data)
{
- bool found;
- scrub_data->space = space;
+ scrub_data->space = space.id;
scrub_data->current_table = NULL;
scrub_data->current_index = NULL;
- const page_size_t page_size = fil_space_get_page_size(space, &found);
-
- scrub_data->compressed = page_size.is_compressed();
+ scrub_data->compressed = FSP_FLAGS_GET_ZIP_SSIZE(space.flags) != 0;
scrub_data->scrubbing = check_scrub_setting(scrub_data);
return scrub_data->scrubbing;
}
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index 7b80d22c778..0b8036c4fdf 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -253,6 +253,8 @@ ATTRIBUTE_COLD static void btr_search_lazy_free(dict_index_t *index)
{
ut_ad(index->freed());
dict_table_t *table= index->table;
+ mysql_mutex_lock(&table->autoinc_mutex);
+
/* Perform the skipped steps of dict_index_remove_from_cache_low(). */
UT_LIST_REMOVE(table->freed_indexes, index);
rw_lock_free(&index->lock);
@@ -261,9 +263,14 @@ ATTRIBUTE_COLD static void btr_search_lazy_free(dict_index_t *index)
if (!UT_LIST_GET_LEN(table->freed_indexes) &&
!UT_LIST_GET_LEN(table->indexes))
{
- ut_ad(table->id == 0);
+ ut_ad(!table->id);
+ mysql_mutex_unlock(&table->autoinc_mutex);
+ mysql_mutex_destroy(&table->autoinc_mutex);
dict_mem_table_free(table);
+ return;
}
+
+ mysql_mutex_unlock(&table->autoinc_mutex);
}
/** Clear the adaptive hash index on all pages in the buffer pool. */
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 9f3d743ada1..4c47c01bf63 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1,8 +1,8 @@
/*****************************************************************************
-Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2021, Oracle and/or its affiliates.
Copyright (c) 2008, Google Inc.
-Copyright (c) 2013, 2020, MariaDB Corporation.
+Copyright (c) 2013, 2021, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -776,8 +776,8 @@ buf_page_is_checksum_valid_crc32(
#ifdef UNIV_INNOCHECKSUM
if (log_file
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
- fprintf(log_file, "page::%llu;"
- " crc32 calculated = %u;"
+ fprintf(log_file, "page::" UINT32PF ";"
+ " crc32 calculated = " UINT32PF ";"
" recorded checksum field1 = " ULINTPF " recorded"
" checksum field2 =" ULINTPF "\n", cur_page_num,
crc32, checksum_field1, checksum_field2);
@@ -822,26 +822,26 @@ buf_page_is_checksum_valid_innodb(
#ifdef UNIV_INNOCHECKSUM
if (log_file
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_INNODB) {
- fprintf(log_file, "page::%llu;"
+ fprintf(log_file, "page::" UINT32PF ";"
" old style: calculated ="
" " ULINTPF "; recorded = " ULINTPF "\n",
cur_page_num, old_checksum,
checksum_field2);
- fprintf(log_file, "page::%llu;"
+ fprintf(log_file, "page::" UINT32PF ";"
" new style: calculated ="
- " " ULINTPF "; crc32 = %u; recorded = " ULINTPF "\n",
+ " " ULINTPF "; crc32 = " UINT32PF "; recorded = " ULINTPF "\n",
cur_page_num, new_checksum,
buf_calc_page_crc32(read_buf), checksum_field1);
}
if (log_file
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
- fprintf(log_file, "page::%llu;"
+ fprintf(log_file, "page::" UINT32PF ";"
" old style: calculated ="
" " ULINTPF "; recorded checksum = " ULINTPF "\n",
cur_page_num, old_checksum,
checksum_field2);
- fprintf(log_file, "page::%llu;"
+ fprintf(log_file, "page::" UINT32PF ";"
" new style: calculated ="
" " ULINTPF "; recorded checksum = " ULINTPF "\n",
cur_page_num, new_checksum,
@@ -909,7 +909,7 @@ buf_page_is_checksum_valid_none(
if (log_file
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_NONE) {
fprintf(log_file,
- "page::%llu; none checksum: calculated"
+ "page::" UINT32PF "; none checksum: calculated"
" = %lu; recorded checksum_field1 = " ULINTPF
" recorded checksum_field2 = " ULINTPF "\n",
cur_page_num, BUF_NO_CHECKSUM_MAGIC,
@@ -1110,15 +1110,15 @@ buf_page_is_corrupted(
checksum_field1, checksum_field2)) {
#ifdef UNIV_INNOCHECKSUM
if (log_file) {
- fprintf(log_file, "page::%llu;"
+ fprintf(log_file, "page::" UINT32PF ";"
" old style: calculated = %u;"
" recorded = " ULINTPF ";\n",
cur_page_num,
buf_calc_page_old_checksum(read_buf),
checksum_field2);
- fprintf(log_file, "page::%llu;"
- " new style: calculated = %u;"
- " crc32 = %u; recorded = " ULINTPF ";\n",
+ fprintf(log_file, "page::" UINT32PF ";"
+ " new style: calculated = " UINT32PF ";"
+ " crc32 = " UINT32PF "; recorded = " ULINTPF ";\n",
cur_page_num,
buf_calc_page_new_checksum(read_buf),
buf_calc_page_crc32(read_buf),
@@ -1864,6 +1864,10 @@ buf_pool_init_instance(
ut_free(buf_pool->chunks);
buf_pool_mutex_exit(buf_pool);
+ /* InnoDB should free the mutex which was
+ created so far before freeing the instance */
+ mutex_free(&buf_pool->mutex);
+ mutex_free(&buf_pool->zip_mutex);
return(DB_ERROR);
}
@@ -1892,8 +1896,6 @@ buf_pool_init_instance(
LATCH_ID_HASH_TABLE_RW_LOCK,
srv_n_page_hash_locks, MEM_HEAP_FOR_PAGE_HASH);
- buf_pool->page_hash_old = NULL;
-
buf_pool->zip_hash = hash_create(2 * buf_pool->curr_size);
buf_pool->last_printout_time = time(NULL);
@@ -2552,8 +2554,6 @@ buf_pool_resize_hash(
{
hash_table_t* new_hash_table;
- ut_ad(buf_pool->page_hash_old == NULL);
-
/* recreate page_hash */
new_hash_table = ib_recreate(
buf_pool->page_hash, 2 * buf_pool->curr_size);
@@ -2585,8 +2585,14 @@ buf_pool_resize_hash(
}
}
- buf_pool->page_hash_old = buf_pool->page_hash;
- buf_pool->page_hash = new_hash_table;
+ /* Concurrent threads may be accessing
+ buf_pool->page_hash->n_cells, n_sync_obj and try to latch
+ sync_obj[i] while we are resizing. Therefore we never
+ deallocate page_hash, instead we overwrite n_cells (and other
+ fields) with the new values. The n_sync_obj and sync_obj are
+ actually same in both. */
+ std::swap(*buf_pool->page_hash, *new_hash_table);
+ hash_table_free(new_hash_table);
/* recreate zip_hash */
new_hash_table = hash_create(2 * buf_pool->curr_size);
@@ -3027,11 +3033,6 @@ calc_buf_pool_size:
hash_unlock_x_all(buf_pool->page_hash);
buf_pool_mutex_exit(buf_pool);
-
- if (buf_pool->page_hash_old != NULL) {
- hash_table_free(buf_pool->page_hash_old);
- buf_pool->page_hash_old = NULL;
- }
}
UT_DELETE(chunk_map_old);
@@ -4359,6 +4360,10 @@ loop:
return (NULL);
}
+ if (local_err == DB_IO_ERROR) {
+ return NULL;
+ }
+
ib::fatal() << "Unable to read page " << page_id
<< " into the buffer pool after "
<< BUF_PAGE_READ_MAX_RETRIES
diff --git a/storage/innobase/buf/buf0mtflu.cc b/storage/innobase/buf/buf0mtflu.cc
index aae90e48168..ee52a11c394 100644
--- a/storage/innobase/buf/buf0mtflu.cc
+++ b/storage/innobase/buf/buf0mtflu.cc
@@ -367,14 +367,6 @@ DECLARE_THREAD(mtflush_io_thread)(void* arg)
mutex_exit(&(mtflush_io->thread_global_mtx));
while (TRUE) {
-
-#ifdef UNIV_MTFLUSH_DEBUG
- fprintf(stderr, "InnoDB: Note. Thread %lu work queue len %lu return queue len %lu\n",
- os_thread_get_curr_id(),
- ib_wqueue_len(mtflush_io->wq),
- ib_wqueue_len(mtflush_io->wr_cq));
-#endif /* UNIV_MTFLUSH_DEBUG */
-
mtflush_service_io(mtflush_io, this_thread_data);
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index ad583e577c4..c3f23df7509 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2020, MariaDB Corporation.
+Copyright (c) 2015, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -201,7 +201,8 @@ buf_read_page_low(
}
return(0);
} else if (IORequest::ignore_missing(type)
- || *err == DB_TABLESPACE_DELETED) {
+ || *err == DB_TABLESPACE_DELETED
+ || *err == DB_IO_ERROR) {
buf_read_page_handle_error(bpage);
return(0);
}
@@ -806,13 +807,18 @@ tablespace_deleted:
continue;
}
- if (UNIV_UNLIKELY(page_nos[i] >= space->size)) {
+ ulint size = space->size;
+ if (!size) {
+ size = fil_space_get_size(space->id);
+ }
+
+ if (UNIV_UNLIKELY(page_nos[i] >= size)) {
do {
ibuf_delete_recs(page_id_t(space_ids[i],
page_nos[i]));
} while (++i < n_stored
&& space_ids[i - 1] == space_ids[i]
- && page_nos[i] >= space->size);
+ && page_nos[i] >= size);
i--;
next:
fil_space_release(space);
diff --git a/storage/innobase/bzip2.cmake b/storage/innobase/bzip2.cmake
index 26fd703120e..91dd2bf0fcd 100644
--- a/storage/innobase/bzip2.cmake
+++ b/storage/innobase/bzip2.cmake
@@ -22,12 +22,15 @@ MACRO (MYSQL_CHECK_BZIP2)
CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffDecompress "" HAVE_BZLIB2_DECOMPRESS)
IF (HAVE_BZLIB2_COMPRESS AND HAVE_BZLIB2_DECOMPRESS AND HAVE_BZLIB2_H)
+ SET(HAVE_INNODB_BZLIB2 TRUE)
ADD_DEFINITIONS(-DHAVE_BZIP2=1)
LINK_LIBRARIES(bz2)
ELSE()
IF (WITH_INNODB_BZIP2 STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required bzip2 library is not found")
+ MESSAGE(FATAL_ERROR "Required bzip2 library is not found")
ENDIF()
ENDIF()
ENDIF()
+ ADD_FEATURE_INFO(INNODB_BZIP2 HAVE_INNODB_BZLIB2
+ "BZIP2 compression in the InnoDB storage engine")
ENDMACRO()
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 6f546dfbd94..d0f8185b927 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -2,7 +2,7 @@
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2020, MariaDB Corporation.
+Copyright (c) 2013, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -297,7 +297,7 @@ dict_table_try_drop_aborted(
&& !UT_LIST_GET_FIRST(table->locks)) {
/* Silence a debug assertion in row_merge_drop_indexes(). */
ut_d(table->acquire());
- row_merge_drop_indexes(trx, table, TRUE);
+ row_merge_drop_indexes(trx, table, true);
ut_d(table->release());
ut_ad(table->get_ref_count() == ref_count);
trx_commit_for_mysql(trx);
@@ -1258,6 +1258,7 @@ dict_index_t *dict_index_t::clone_if_needed()
return this;
dict_index_t *prev= UT_LIST_GET_PREV(indexes, this);
+ mysql_mutex_lock(&table->autoinc_mutex);
UT_LIST_REMOVE(table->indexes, this);
UT_LIST_ADD_LAST(table->freed_indexes, this);
dict_index_t *index= clone();
@@ -1266,6 +1267,7 @@ dict_index_t *dict_index_t::clone_if_needed()
UT_LIST_INSERT_AFTER(table->indexes, prev, index);
else
UT_LIST_ADD_FIRST(table->indexes, index);
+ mysql_mutex_unlock(&table->autoinc_mutex);
return index;
}
#endif /* BTR_CUR_HASH_ADAPT */
@@ -1960,21 +1962,27 @@ dict_table_remove_from_cache_low(
UT_DELETE(table->vc_templ);
}
- mysql_mutex_destroy(&table->autoinc_mutex);
#ifdef BTR_CUR_HASH_ADAPT
- if (UNIV_UNLIKELY(UT_LIST_GET_LEN(table->freed_indexes) != 0)) {
- if (table->fts) {
- fts_optimize_remove_table(table);
- fts_free(table);
- table->fts = NULL;
- }
+ if (table->fts) {
+ fts_optimize_remove_table(table);
+ fts_free(table);
+ table->fts = NULL;
+ }
+
+ mysql_mutex_lock(&table->autoinc_mutex);
+
+ ulint freed = UT_LIST_GET_LEN(table->freed_indexes);
- table->vc_templ = NULL;
- table->id = 0;
+ table->vc_templ = NULL;
+ table->id = 0;
+ mysql_mutex_unlock(&table->autoinc_mutex);
+
+ if (UNIV_UNLIKELY(freed != 0)) {
return;
}
#endif /* BTR_CUR_HASH_ADAPT */
+ mysql_mutex_destroy(&table->autoinc_mutex);
dict_mem_table_free(table);
}
@@ -2244,8 +2252,10 @@ dict_index_remove_from_cache_low(
zero. See also: dict_table_can_be_evicted() */
if (index->n_ahi_pages()) {
+ mysql_mutex_lock(&table->autoinc_mutex);
index->set_freed();
UT_LIST_ADD_LAST(table->freed_indexes, index);
+ mysql_mutex_unlock(&table->autoinc_mutex);
return;
}
#endif /* BTR_CUR_HASH_ADAPT */
@@ -6719,3 +6729,9 @@ dict_table_t::get_overflow_field_local_len() const
/* new-format table: do not store any BLOB prefix locally */
return BTR_EXTERN_FIELD_REF_SIZE;
}
+
+bool dict_table_t::is_stats_table() const
+{
+ return !strcmp(name.m_name, TABLE_STATS_NAME) ||
+ !strcmp(name.m_name, INDEX_STATS_NAME);
+}
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index efefa40e69f..1667e1a0b20 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -911,7 +911,7 @@ dict_mem_fill_vcol_from_v_indexes(
Later virtual column set will be
refreshed during loading of table. */
if (!dict_index_has_virtual(index)
- || index->has_new_v_col) {
+ || index->has_new_v_col()) {
continue;
}
diff --git a/storage/innobase/dict/dict0stats_bg.cc b/storage/innobase/dict/dict0stats_bg.cc
index 589f53dde38..a4619a6069b 100644
--- a/storage/innobase/dict/dict0stats_bg.cc
+++ b/storage/innobase/dict/dict0stats_bg.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2012, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -154,9 +154,24 @@ schedule new estimates for table and index statistics to be calculated.
void dict_stats_update_if_needed_func(dict_table_t *table)
#endif
{
- ut_ad(table->stat_initialized);
ut_ad(!mutex_own(&dict_sys->mutex));
+ if (UNIV_UNLIKELY(!table->stat_initialized)) {
+ /* The table may have been evicted from dict_sys
+ and reloaded internally by InnoDB for FOREIGN KEY
+ processing, but not reloaded by the SQL layer.
+
+ We can (re)compute the transient statistics when the
+ table is actually loaded by the SQL layer.
+
+ Note: If InnoDB persistent statistics are enabled,
+ we will skip the updates. We must do this, because
+ dict_table_get_n_rows() below assumes that the
+ statistics have been initialized. The DBA may have
+ to execute ANALYZE TABLE. */
+ return;
+ }
+
ulonglong counter = table->stat_modified_counter++;
ulonglong n_rows = dict_table_get_n_rows(table);
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 68a8a9be261..ff6294e85b7 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2014, 2020, MariaDB Corporation.
+Copyright (c) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -55,6 +55,9 @@ UNIV_INTERN uint srv_n_fil_crypt_threads_started = 0;
/** At this age or older a space/page will be rotated */
UNIV_INTERN uint srv_fil_crypt_rotate_key_age;
+/** Whether the encryption plugin does key rotation */
+static bool srv_encrypt_rotate;
+
/** Event to signal FROM the key rotation threads. */
static os_event_t fil_crypt_event;
@@ -136,6 +139,14 @@ fil_space_crypt_t::key_get_latest_version(void)
if (is_key_found()) {
key_version = encryption_key_get_latest_version(key_id);
+ /* InnoDB does dirty read of srv_fil_crypt_rotate_key_age.
+ It doesn't matter because srv_encrypt_rotate
+ can be set to true only once */
+ if (!srv_encrypt_rotate
+ && key_version > srv_fil_crypt_rotate_key_age) {
+ srv_encrypt_rotate = true;
+ }
+
srv_stats.n_key_requests.inc();
key_found = key_version;
}
@@ -1001,13 +1012,11 @@ static bool fil_crypt_start_encrypting_space(fil_space_t* space)
/* 4 - sync tablespace before publishing crypt data */
bool success = false;
- ulint sum_pages = 0;
do {
ulint n_pages = 0;
success = buf_flush_lists(ULINT_MAX, end_lsn, &n_pages);
buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST);
- sum_pages += n_pages;
} while (!success);
/* 5 - publish crypt data */
@@ -1083,6 +1092,33 @@ struct rotate_thread_t {
}
};
+/** Avoid the removal of the tablespace from
+default_encrypt_list only when
+1) Another active encryption thread working on tablespace
+2) Eligible for tablespace key rotation
+3) Tablespace is in flushing phase
+@return true if tablespace should be removed from
+default encrypt */
+static bool fil_crypt_must_remove(const fil_space_t &space)
+{
+ ut_ad(space.purpose == FIL_TYPE_TABLESPACE);
+ fil_space_crypt_t *crypt_data = space.crypt_data;
+ ut_ad(mutex_own(&fil_system->mutex));
+ const ulong encrypt_tables= srv_encrypt_tables;
+ if (!crypt_data)
+ return !encrypt_tables;
+ if (!crypt_data->is_key_found())
+ return true;
+
+ mutex_enter(&crypt_data->mutex);
+ const bool remove= (space.is_stopping() || crypt_data->not_encrypted()) &&
+ (!crypt_data->rotate_state.flushing &&
+ !encrypt_tables == !!crypt_data->min_key_version &&
+ !crypt_data->rotate_state.active_threads);
+ mutex_exit(&crypt_data->mutex);
+ return remove;
+}
+
/***********************************************************************
Check if space needs rotation given a key_state
@param[in,out] state Key rotation state
@@ -1164,7 +1200,7 @@ fil_crypt_space_needs_rotation(
key_state->rotate_key_age);
crypt_data->rotate_state.scrubbing.is_active =
- btr_scrub_start_space(space->id, &state->scrub_data);
+ btr_scrub_start_space(*space, &state->scrub_data);
time_t diff = time(0) - crypt_data->rotate_state.scrubbing.
last_scrub_completed;
@@ -1380,52 +1416,69 @@ fil_crypt_return_iops(
fil_crypt_update_total_stat(state);
}
-/** Return the next tablespace from rotation_list.
+bool fil_crypt_must_default_encrypt()
+{
+ return !srv_fil_crypt_rotate_key_age || !srv_encrypt_rotate;
+}
+
+/** Return the next tablespace from default_encrypt_tables.
@param space previous tablespace (NULL to start from the start)
@param recheck whether the removal condition needs to be rechecked after
the encryption parameters were changed
@param encrypt expected state of innodb_encrypt_tables
@return the next tablespace to process (n_pending_ops incremented)
@retval NULL if this was the last */
-inline fil_space_t *fil_system_t::keyrotate_next(fil_space_t *space,
- bool recheck, bool encrypt)
+inline fil_space_t *fil_system_t::default_encrypt_next(
+ fil_space_t *space, bool recheck, bool encrypt)
{
ut_ad(mutex_own(&mutex));
sized_ilist<fil_space_t, rotation_list_tag_t>::iterator it=
- space && space->is_in_rotation_list ? space : rotation_list.begin();
+ space && space->is_in_default_encrypt
+ ? space
+ : default_encrypt_tables.begin();
const sized_ilist<fil_space_t, rotation_list_tag_t>::iterator end=
- rotation_list.end();
+ default_encrypt_tables.end();
if (space)
{
const bool released= !--space->n_pending_ops;
- if (space->is_in_rotation_list)
+ if (space->is_in_default_encrypt)
{
while (++it != end &&
(!UT_LIST_GET_LEN(it->chain) || it->is_stopping()));
- /* If one of the encryption threads already started the encryption
- of the table then don't remove the unencrypted spaces from rotation list
+ /* If one of the encryption threads already started
+ the encryption of the table then don't remove the
+ unencrypted spaces from default encrypt list.
- If there is a change in innodb_encrypt_tables variables value then
- don't remove the last processed tablespace from the rotation list. */
- if (released && (!recheck || space->crypt_data) &&
- !encrypt == !srv_encrypt_tables)
+ If there is a change in innodb_encrypt_tables variables
+ value then don't remove the last processed tablespace
+ from the default encrypt list. */
+ if (released && !recheck && fil_crypt_must_remove(*space))
{
- ut_a(!rotation_list.empty());
- rotation_list.remove(*space);
- space->is_in_rotation_list= false;
+ ut_a(!default_encrypt_tables.empty());
+ default_encrypt_tables.remove(*space);
+ space->is_in_default_encrypt= false;
}
}
}
+ else while (it != end &&
+ (!UT_LIST_GET_LEN(it->chain) || it->is_stopping()))
+ {
+ /* Find the next suitable default encrypt table if
+ beginning of default_encrypt_tables list has been scheduled
+ to be deleted */
+ it++;
+ }
if (it == end)
return NULL;
space= &*it;
space->n_pending_ops++;
+ ut_ad(!space->is_stopping());
return space;
}
@@ -1442,8 +1495,8 @@ static fil_space_t *fil_space_next(fil_space_t *space, bool recheck,
mutex_enter(&fil_system->mutex);
ut_ad(!space || space->n_pending_ops);
- if (!srv_fil_crypt_rotate_key_age)
- space= fil_system->keyrotate_next(space, recheck, encrypt);
+ if (fil_crypt_must_default_encrypt())
+ space= fil_system->default_encrypt_next(space, recheck, encrypt);
else if (!space)
{
space= UT_LIST_GET_FIRST(fil_system->space_list);
@@ -2335,9 +2388,9 @@ fil_crypt_set_thread_cnt(
}
}
-/** Initialize the tablespace rotation_list
+/** Initialize the tablespace default_encrypt_tables
if innodb_encryption_rotate_key_age=0. */
-static void fil_crypt_rotation_list_fill()
+static void fil_crypt_default_encrypt_tables_fill()
{
ut_ad(mutex_own(&fil_system->mutex));
@@ -2345,7 +2398,7 @@ static void fil_crypt_rotation_list_fill()
space != NULL;
space = UT_LIST_GET_NEXT(space_list, space)) {
if (space->purpose != FIL_TYPE_TABLESPACE
- || space->is_in_rotation_list
+ || space->is_in_default_encrypt
|| space->is_stopping()
|| UT_LIST_GET_LEN(space->chain) == 0) {
continue;
@@ -2389,8 +2442,8 @@ static void fil_crypt_rotation_list_fill()
}
}
- fil_system->rotation_list.push_back(*space);
- space->is_in_rotation_list = true;
+ fil_system->default_encrypt_tables.push_back(*space);
+ space->is_in_default_encrypt = true;
}
}
@@ -2405,7 +2458,7 @@ fil_crypt_set_rotate_key_age(
mutex_enter(&fil_system->mutex);
srv_fil_crypt_rotate_key_age = val;
if (val == 0) {
- fil_crypt_rotation_list_fill();
+ fil_crypt_default_encrypt_tables_fill();
}
mutex_exit(&fil_system->mutex);
os_event_set(fil_crypt_threads_event);
@@ -2435,8 +2488,8 @@ fil_crypt_set_encrypt_tables(
srv_encrypt_tables = val;
- if (srv_fil_crypt_rotate_key_age == 0) {
- fil_crypt_rotation_list_fill();
+ if (fil_crypt_must_default_encrypt()) {
+ fil_crypt_default_encrypt_tables_fill();
}
mutex_exit(&fil_system->mutex);
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 659cfa26033..8075defac4c 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2020, MariaDB Corporation.
+Copyright (c) 1995, 2021, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -980,11 +980,16 @@ fil_space_extend_must_retry(
const page_size_t pageSize(space->flags);
const ulint page_size = pageSize.physical();
- /* fil_read_first_page() expects UNIV_PAGE_SIZE bytes.
- fil_node_open_file() expects at least 4 * UNIV_PAGE_SIZE bytes.*/
+ /* fil_read_first_page() expects innodb_page_size bytes.
+ fil_node_open_file() expects at least 4 * innodb_page_size bytes.
+ os_file_set_size() expects multiples of 4096 bytes.
+ For ROW_FORMAT=COMPRESSED tables using 1024-byte or 2048-byte
+ pages, we will preallocate up to an integer multiple of 4096 bytes,
+ and let normal writes append 1024, 2048, or 3072 bytes to the file. */
os_offset_t new_size = std::max(
- os_offset_t(size - file_start_page_no) * page_size,
- os_offset_t(FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE));
+ (os_offset_t(size - file_start_page_no) * page_size)
+ & ~os_offset_t(4095),
+ os_offset_t(FIL_IBD_FILE_INITIAL_SIZE << srv_page_size_shift));
*success = os_file_set_size(node->name, node->handle, new_size,
FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags));
@@ -1244,10 +1249,9 @@ fil_space_detach(
space->is_in_unflushed_spaces = false;
}
- if (space->is_in_rotation_list) {
-
- fil_system->rotation_list.remove(*space);
- space->is_in_rotation_list = false;
+ if (space->is_in_default_encrypt) {
+ fil_system->default_encrypt_tables.remove(*space);
+ space->is_in_default_encrypt = false;
}
UT_LIST_REMOVE(fil_system->space_list, space);
@@ -1465,22 +1469,28 @@ fil_space_create(
fil_system->max_assigned_id = id;
}
+ const bool rotate =
+ (purpose == FIL_TYPE_TABLESPACE
+ && (mode == FIL_ENCRYPTION_ON
+ || mode == FIL_ENCRYPTION_OFF || srv_encrypt_tables)
+ && fil_crypt_must_default_encrypt());
+
/* Inform key rotation that there could be something
to do */
- if (purpose == FIL_TYPE_TABLESPACE
- && !srv_fil_crypt_rotate_key_age && fil_crypt_threads_event &&
- (mode == FIL_ENCRYPTION_ON || mode == FIL_ENCRYPTION_OFF ||
- srv_encrypt_tables)) {
+ if (rotate) {
/* Key rotation is not enabled, need to inform background
encryption threads. */
- fil_system->rotation_list.push_back(*space);
- space->is_in_rotation_list = true;
+ fil_system->default_encrypt_tables.push_back(*space);
+ space->is_in_default_encrypt = true;
mutex_exit(&fil_system->mutex);
+ } else {
+ mutex_exit(&fil_system->mutex);
+ }
+
+ if (rotate && srv_n_fil_crypt_threads_started) {
mutex_enter(&fil_crypt_threads_mutex);
os_event_set(fil_crypt_threads_event);
mutex_exit(&fil_crypt_threads_mutex);
- } else {
- mutex_exit(&fil_system->mutex);
}
return(space);
@@ -3137,11 +3147,7 @@ fil_reinit_space_header_for_table(
row_mysql_unlock_data_dictionary(trx);
DEBUG_SYNC_C("buffer_pool_scan");
- /* Lock the search latch in shared mode to prevent user
- from disabling AHI during the scan */
- btr_search_s_lock_all();
buf_LRU_flush_or_remove_pages(id, NULL);
- btr_search_s_unlock_all();
row_mysql_lock_data_dictionary(trx);
@@ -4360,7 +4366,7 @@ fil_ibd_load(
space = fil_space_get_by_id(space_id);
mutex_exit(&fil_system->mutex);
- if (space != NULL) {
+ if (space) {
/* Compare the filename we are trying to open with the
filename from the first node of the tablespace we opened
previously. Fail if it is different. */
@@ -4372,8 +4378,8 @@ fil_ibd_load(
<< "' with space ID " << space->id
<< ". Another data file called " << node->name
<< " exists with the same space ID.";
- space = NULL;
- return(FIL_LOAD_ID_CHANGED);
+ space = NULL;
+ return(FIL_LOAD_ID_CHANGED);
}
return(FIL_LOAD_OK);
}
@@ -4410,13 +4416,6 @@ fil_ibd_load(
os_offset_t minimum_size;
case DB_SUCCESS:
if (file.space_id() != space_id) {
- ib::info()
- << "Ignoring data file '"
- << file.filepath()
- << "' with space ID " << file.space_id()
- << ", since the redo log references "
- << file.filepath() << " with space ID "
- << space_id << ".";
return(FIL_LOAD_ID_CHANGED);
}
/* Get and test the file size. */
@@ -4800,27 +4799,30 @@ fil_node_complete_io(fil_node_t* node, const IORequest& type)
}
}
-/** Report information about an invalid page access. */
-static
-void
-fil_report_invalid_page_access(
- ulint block_offset, /*!< in: block offset */
- ulint space_id, /*!< in: space id */
- const char* space_name, /*!< in: space name */
- ulint byte_offset, /*!< in: byte offset */
- ulint len, /*!< in: I/O length */
- bool is_read) /*!< in: I/O type */
+/** Compose error message about an invalid page access.
+@param[in] block_offset block offset
+@param[in] space_id space id
+@param[in] space_name space name
+@param[in] byte_offset byte offset
+@param[in] len I/O length
+@param[in] is_read I/O type
+@return std::string with error message */
+static std::string fil_invalid_page_access_msg(size_t block_offset,
+ size_t space_id,
+ const char *space_name,
+ size_t byte_offset, size_t len,
+ bool is_read)
{
- ib::fatal()
- << "Trying to " << (is_read ? "read" : "write")
- << " page number " << block_offset << " in"
- " space " << space_id << ", space name " << space_name << ","
- " which is outside the tablespace bounds. Byte offset "
- << byte_offset << ", len " << len <<
- (space_id == 0 && !srv_was_started
- ? "Please check that the configuration matches"
- " the InnoDB system tablespace location (ibdata files)"
- : "");
+ std::stringstream ss;
+ ss << "Trying to " << (is_read ? "read" : "write") << " page number "
+ << block_offset << " in space " << space_id << ", space name "
+ << space_name << ", which is outside the tablespace bounds. Byte offset "
+ << byte_offset << ", len " << len
+ << (space_id == 0 && !srv_was_started
+ ? "Please check that the configuration matches"
+ " the InnoDB system tablespace location (ibdata files)"
+ : "");
+ return ss.str();
}
/** Reads or writes data. This operation could be asynchronous (aio).
@@ -4957,7 +4959,17 @@ fil_io(
return(DB_ERROR);
}
- fil_report_invalid_page_access(
+ if (space->purpose == FIL_TYPE_IMPORT) {
+ mutex_exit(&fil_system->mutex);
+ ib::error() << fil_invalid_page_access_msg(
+ page_id.page_no(), page_id.space(),
+ space->name, byte_offset, len,
+ req_type.is_read());
+
+ return DB_IO_ERROR;
+ }
+
+ ib::fatal() << fil_invalid_page_access_msg(
page_id.page_no(), page_id.space(),
space->name, byte_offset, len,
req_type.is_read());
@@ -5038,7 +5050,7 @@ fil_io(
return(DB_ERROR);
}
- fil_report_invalid_page_access(
+ ib::fatal() << fil_invalid_page_access_msg(
page_id.page_no(), page_id.space(),
space->name, byte_offset, len, req_type.is_read());
}
diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc
index 58aa18ac323..064eb133ebc 100644
--- a/storage/innobase/fsp/fsp0fsp.cc
+++ b/storage/innobase/fsp/fsp0fsp.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -956,11 +956,13 @@ fsp_try_extend_data_file(fil_space_t* space, fsp_header_t* header, mtr_t* mtr)
return(0);
}
- /* We ignore any fragments of a full megabyte when storing the size
- to the space header */
+ /* For the system tablespace, we ignore any fragments of a
+ full megabyte when storing the size to the space header */
- space->size_in_header = ut_2pow_round(
- space->size, (1024 * 1024) / page_size.physical());
+ space->size_in_header = space->id
+ ? space->size
+ : ut_2pow_round(space->size,
+ (1024 * 1024) / page_size.physical());
mlog_write_ulint(
header + FSP_SIZE, space->size_in_header, MLOG_4BYTES, mtr);
@@ -1392,7 +1394,7 @@ fsp_alloc_free_page(
/* It must be that we are extending a single-table tablespace
whose size is still < 64 pages */
- ut_a(!is_system_tablespace(space_id));
+ ut_a(!is_predefined_tablespace(space_id));
if (page_no >= FSP_EXTENT_SIZE) {
ib::error() << "Trying to extend a single-table"
" tablespace " << space->name << " , by single"
@@ -2514,14 +2516,14 @@ take_hinted_page:
return(NULL);
}
- if (space->size <= ret_page && !is_system_tablespace(space_id)) {
+ if (space->size <= ret_page && !is_predefined_tablespace(space_id)) {
/* It must be that we are extending a single-table
tablespace whose size is still < 64 pages */
if (ret_page >= FSP_EXTENT_SIZE) {
- ib::error() << "Error (2): trying to extend"
- " a single-table tablespace " << space_id
- << " by single page(s) though the"
+ ib::error() << "Trying to extend '"
+ << space->chain.start->name
+ << "' by single page(s) though the"
<< " space size " << space->size
<< ". Page no " << ret_page << ".";
ut_ad(!has_done_reservation);
@@ -2719,7 +2721,6 @@ fsp_reserve_free_extents(
ulint n_free;
ulint n_free_up;
ulint reserve;
- size_t total_reserved = 0;
ut_ad(mtr);
*n_reserved = n_ext;
@@ -2800,8 +2801,7 @@ try_again:
return(true);
}
try_to_extend:
- if (ulint n = fsp_try_extend_data_file(space, space_header, mtr)) {
- total_reserved += n;
+ if (fsp_try_extend_data_file(space, space_header, mtr)) {
goto try_again;
}
diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc
index dc5a27e2f2c..1e2db8cc12f 100644
--- a/storage/innobase/fsp/fsp0sysspace.cc
+++ b/storage/innobase/fsp/fsp0sysspace.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -684,13 +685,18 @@ SysTablespace::file_not_found(
{
file.m_exists = false;
- if (srv_read_only_mode && !m_ignore_read_only) {
+ if (m_ignore_read_only) {
+ } else if (srv_read_only_mode) {
ib::error() << "Can't create file '" << file.filepath()
<< "' when --innodb-read-only is set";
-
return(DB_ERROR);
+ } else if (srv_force_recovery && space_id() == TRX_SYS_SPACE) {
+ ib::error() << "Can't create file '" << file.filepath()
+ << "' when --innodb-force-recovery is set";
+ return DB_ERROR;
+ }
- } else if (&file == &m_files.front()) {
+ if (&file == &m_files.front()) {
/* First data file. */
ut_a(!*create_new_db);
diff --git a/storage/innobase/fts/fts0config.cc b/storage/innobase/fts/fts0config.cc
index ed4340d818b..43471acdc19 100644
--- a/storage/innobase/fts/fts0config.cc
+++ b/storage/innobase/fts/fts0config.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -97,7 +97,7 @@ fts_config_get_value(
fts_table->suffix = "CONFIG";
fts_get_table_name(fts_table, table_name);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
graph = fts_parse_sql(
fts_table,
@@ -217,7 +217,7 @@ fts_config_set_value(
fts_table->suffix = "CONFIG";
fts_get_table_name(fts_table, table_name, dict_locked);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
graph = fts_parse_sql(
fts_table, info,
@@ -245,7 +245,7 @@ fts_config_set_value(
info, "value", value->f_str, value->f_len);
fts_get_table_name(fts_table, table_name, dict_locked);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
graph = fts_parse_sql(
fts_table, info,
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index 1bdfbddca04..f9c7bcd75c4 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2020, MariaDB Corporation.
+Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+Copyright (c) 2016, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -32,7 +32,7 @@ Full Text Search interface
#include "fts0priv.h"
#include "fts0types.h"
#include "fts0types.ic"
-#include "fts0vlc.ic"
+#include "fts0vlc.h"
#include "fts0plugin.h"
#include "dict0priv.h"
#include "dict0stats.h"
@@ -483,7 +483,7 @@ cleanup:
pars_info_t* info = pars_info_create();
- pars_info_bind_id(info, TRUE, "table_stopword", stopword_table_name);
+ pars_info_bind_id(info, "table_stopword", stopword_table_name);
pars_info_bind_function(info, "my_func", fts_read_stopword,
stopword_info);
@@ -580,6 +580,7 @@ fts_cache_init(
cache->sync_heap->arg = mem_heap_create(1024);
cache->total_size = 0;
+ cache->total_size_at_sync = 0;
mutex_enter((ib_mutex_t*) &cache->deleted_lock);
cache->deleted_doc_ids = ib_vector_create(
@@ -1247,7 +1248,7 @@ fts_cache_node_add_positions(
ulint enc_len;
ulint last_pos;
byte* ptr_start;
- ulint doc_id_delta;
+ doc_id_t doc_id_delta;
#ifdef UNIV_DEBUG
if (cache) {
@@ -1258,7 +1259,7 @@ fts_cache_node_add_positions(
ut_ad(doc_id >= node->last_doc_id);
/* Calculate the space required to store the ilist. */
- doc_id_delta = (ulint)(doc_id - node->last_doc_id);
+ doc_id_delta = doc_id - node->last_doc_id;
enc_len = fts_get_encoded_len(doc_id_delta);
last_pos = 0;
@@ -1299,19 +1300,22 @@ fts_cache_node_add_positions(
ptr = ilist + node->ilist_size;
node->ilist_size_alloc = new_size;
+ if (cache) {
+ cache->total_size += new_size;
+ }
}
ptr_start = ptr;
/* Encode the new fragment. */
- ptr += fts_encode_int(doc_id_delta, ptr);
+ ptr = fts_encode_int(doc_id_delta, ptr);
last_pos = 0;
for (i = 0; i < ib_vector_size(positions); i++) {
ulint pos = *(static_cast<ulint*>(
ib_vector_get(positions, i)));
- ptr += fts_encode_int(pos - last_pos, ptr);
+ ptr = fts_encode_int(pos - last_pos, ptr);
last_pos = pos;
}
@@ -1325,6 +1329,9 @@ fts_cache_node_add_positions(
if (node->ilist_size > 0) {
memcpy(ilist, node->ilist, node->ilist_size);
ut_free(node->ilist);
+ if (cache) {
+ cache->total_size -= node->ilist_size;
+ }
}
node->ilist = ilist;
@@ -1332,10 +1339,6 @@ fts_cache_node_add_positions(
node->ilist_size += enc_len;
- if (cache) {
- cache->total_size += enc_len;
- }
-
if (node->first_doc_id == FTS_NULL_DOC_ID) {
node->first_doc_id = doc_id;
}
@@ -1787,7 +1790,6 @@ fts_create_one_common_table(
error = row_create_table_for_mysql(new_table, trx,
FIL_ENCRYPTION_DEFAULT, FIL_DEFAULT_ENCRYPTION_KEY);
-
if (error == DB_SUCCESS) {
dict_index_t* index = dict_mem_index_create(
@@ -1808,17 +1810,22 @@ fts_create_one_common_table(
error = row_create_index_for_mysql(index, trx, NULL);
trx->dict_operation = op;
+ } else {
+err_exit:
+ new_table = NULL;
+ ib::warn() << "Failed to create FTS common table "
+ << fts_table_name;
+ trx->error_state = error;
+ return NULL;
}
if (error != DB_SUCCESS) {
dict_mem_table_free(new_table);
- new_table = NULL;
- ib::warn() << "Failed to create FTS common table "
- << fts_table_name;
trx->error_state = DB_SUCCESS;
row_drop_table_for_mysql(fts_table_name, trx, SQLCOM_DROP_DB);
- trx->error_state = error;
+ goto err_exit;
}
+
return(new_table);
}
@@ -1866,6 +1873,8 @@ fts_create_common_tables(
FTS_INIT_FTS_TABLE(&fts_table, NULL, FTS_COMMON_TABLE, table);
+ op = trx_get_dict_operation(trx);
+
error = fts_drop_common_tables(trx, &fts_table);
if (error != DB_SUCCESS) {
@@ -1882,6 +1891,7 @@ fts_create_common_tables(
trx, table, full_name[i], fts_table.suffix, heap);
if (common_table == NULL) {
+ trx->error_state = DB_SUCCESS;
error = DB_ERROR;
goto func_exit;
} else {
@@ -1903,7 +1913,7 @@ fts_create_common_tables(
fts_table.suffix = "CONFIG";
fts_get_table_name(&fts_table, fts_name, true);
- pars_info_bind_id(info, true, "config_table", fts_name);
+ pars_info_bind_id(info, "config_table", fts_name);
graph = fts_parse_sql_no_dict_lock(
&fts_table, info, fts_config_table_insert_values_sql);
@@ -1926,8 +1936,6 @@ fts_create_common_tables(
error = row_create_index_for_mysql(index, trx, NULL);
- trx->dict_operation = op;
-
func_exit:
if (error != DB_SUCCESS) {
for (it = common_tables.begin(); it != common_tables.end();
@@ -1937,6 +1945,8 @@ func_exit:
}
}
+ trx->dict_operation = op;
+
common_tables.clear();
mem_heap_free(heap);
@@ -2019,16 +2029,20 @@ fts_create_one_index_table(
error = row_create_index_for_mysql(index, trx, NULL);
trx->dict_operation = op;
+ } else {
+err_exit:
+ new_table = NULL;
+ ib::warn() << "Failed to create FTS index table "
+ << table_name;
+ trx->error_state = error;
+ return NULL;
}
if (error != DB_SUCCESS) {
dict_mem_table_free(new_table);
- new_table = NULL;
- ib::warn() << "Failed to create FTS index table "
- << table_name;
trx->error_state = DB_SUCCESS;
row_drop_table_for_mysql(table_name, trx, SQLCOM_DROP_DB);
- trx->error_state = error;
+ goto err_exit;
}
return(new_table);
@@ -2546,7 +2560,8 @@ fts_get_max_cache_size(
}
} else {
ib::error() << "(" << error << ") reading max"
- " cache config value from config table";
+ " cache config value from config table "
+ << fts_table->table->name;
}
ut_free(value.f_str);
@@ -2654,7 +2669,7 @@ retry:
info, "my_func", fts_fetch_store_doc_id, doc_id);
fts_get_table_name(&fts_table, table_name);
- pars_info_bind_id(info, true, "config_table", table_name);
+ pars_info_bind_id(info, "config_table", table_name);
graph = fts_parse_sql(
&fts_table, info,
@@ -2719,7 +2734,8 @@ func_exit:
} else {
*doc_id = 0;
- ib::error() << "(" << error << ") while getting next doc id.";
+ ib::error() << "(" << error << ") while getting next doc id "
+ "for table " << table->name;
fts_sql_rollback(trx);
if (error == DB_DEADLOCK) {
@@ -2781,7 +2797,7 @@ fts_update_sync_doc_id(
fts_get_table_name(&fts_table, fts_name,
table->fts->dict_locked);
- pars_info_bind_id(info, true, "table_name", fts_name);
+ pars_info_bind_id(info, "table_name", fts_name);
graph = fts_parse_sql(
&fts_table, info,
@@ -2799,7 +2815,8 @@ fts_update_sync_doc_id(
cache->synced_doc_id = doc_id;
} else {
ib::error() << "(" << error << ") while"
- " updating last doc id.";
+ " updating last doc id for table"
+ << table->name;
fts_sql_rollback(trx);
}
@@ -2923,7 +2940,7 @@ fts_delete(
fts_table.suffix = "DELETED";
fts_get_table_name(&fts_table, table_name);
- pars_info_bind_id(info, true, "deleted", table_name);
+ pars_info_bind_id(info, "deleted", table_name);
graph = fts_parse_sql(
&fts_table,
@@ -3555,11 +3572,14 @@ fts_add_doc_by_id(
get_doc->index_cache,
doc_id, doc.tokens);
- bool need_sync = false;
- if ((cache->total_size > fts_max_cache_size / 10
- || fts_need_sync)
- && !cache->sync->in_progress) {
- need_sync = true;
+ bool need_sync = !cache->sync->in_progress
+ && (fts_need_sync
+ || (cache->total_size
+ - cache->total_size_at_sync)
+ > fts_max_cache_size / 10);
+ if (need_sync) {
+ cache->total_size_at_sync =
+ cache->total_size;
}
rw_lock_x_unlock(&table->fts->cache->lock);
@@ -3748,7 +3768,7 @@ fts_doc_fetch_by_doc_id(
pars_info_bind_function(info, "my_func", callback, arg);
select_str = fts_get_select_columns_str(index, info, info->heap);
- pars_info_bind_id(info, TRUE, "table_name", index->table_name);
+ pars_info_bind_id(info, "table_name", index->table_name);
if (!get_doc || !get_doc->get_document_graph) {
if (option == FTS_FETCH_DOC_BY_ID_EQUAL) {
@@ -3855,7 +3875,7 @@ fts_write_node(
info = pars_info_create();
fts_get_table_name(fts_table, table_name);
- pars_info_bind_id(info, true, "index_table_name", table_name);
+ pars_info_bind_id(info, "index_table_name", table_name);
}
pars_info_bind_varchar_literal(info, "token", word->f_str, word->f_len);
@@ -3930,7 +3950,7 @@ fts_sync_add_deleted_cache(
&fts_table, "DELETED_CACHE", FTS_COMMON_TABLE, sync->table);
fts_get_table_name(&fts_table, table_name);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
graph = fts_parse_sql(
&fts_table,
@@ -4044,7 +4064,8 @@ fts_sync_write_words(
if (UNIV_UNLIKELY(error != DB_SUCCESS) && !print_error) {
ib::error() << "(" << error << ") writing"
- " word node to FTS auxiliary index table.";
+ " word node to FTS auxiliary index table "
+ << table->name;
print_error = TRUE;
}
}
@@ -4199,7 +4220,8 @@ fts_sync_commit(
fts_sql_commit(trx);
} else {
fts_sql_rollback(trx);
- ib::error() << "(" << error << ") during SYNC.";
+ ib::error() << "(" << error << ") during SYNC of "
+ "table " << sync->table->name;
}
if (UNIV_UNLIKELY(fts_enable_diag_print) && elapsed_time) {
@@ -4933,7 +4955,7 @@ fts_get_rows_count(
pars_info_bind_function(info, "my_func", fts_read_ulint, &count);
fts_get_table_name(fts_table, table_name);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
graph = fts_parse_sql(
fts_table,
@@ -4970,7 +4992,8 @@ fts_get_rows_count(
trx->error_state = DB_SUCCESS;
} else {
ib::error() << "(" << error
- << ") while reading FTS table.";
+ << ") while reading FTS table "
+ << table_name;
break; /* Exit the loop. */
}
diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc
index 3cabb64b851..13e01befe55 100644
--- a/storage/innobase/fts/fts0opt.cc
+++ b/storage/innobase/fts/fts0opt.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2020, MariaDB Corporation.
+Copyright (c) 2016, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -36,6 +36,7 @@ Completed 2011/7/10 Sunny and Jimmy Yang
#include "ut0list.h"
#include "zlib.h"
#include "fts0opt.h"
+#include "fts0vlc.h"
/** The FTS optimize thread's work queue. */
ib_wqueue_t* fts_optimize_wq;
@@ -492,7 +493,7 @@ fts_index_fetch_nodes(
fts_get_table_name(fts_table, table_name);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
}
pars_info_bind_function(info, "my_func", fetch->read_record, fetch);
@@ -821,7 +822,7 @@ fts_index_fetch_words(
info, "word", word->f_str, word->f_len);
fts_get_table_name(&optim->fts_index_table, table_name);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
graph = fts_parse_sql(
&optim->fts_index_table,
@@ -977,7 +978,7 @@ fts_table_fetch_doc_ids(
pars_info_bind_function(info, "my_func", fts_fetch_doc_ids, doc_ids);
fts_get_table_name(fts_table, table_name);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
graph = fts_parse_sql(
fts_table,
@@ -1116,7 +1117,7 @@ fts_optimize_encode_node(
ulint pos_enc_len;
doc_id_t doc_id_delta;
dberr_t error = DB_SUCCESS;
- byte* src = enc->src_ilist_ptr;
+ const byte* src = enc->src_ilist_ptr;
if (node->first_doc_id == 0) {
ut_a(node->last_doc_id == 0);
@@ -1173,7 +1174,7 @@ fts_optimize_encode_node(
/* Encode the doc id. Cast to ulint, the delta should be small and
therefore no loss of precision. */
- dst += fts_encode_int((ulint) doc_id_delta, dst);
+ dst = fts_encode_int(doc_id_delta, dst);
/* Copy the encoded pos array. */
memcpy(dst, src, pos_enc_len);
@@ -1220,7 +1221,8 @@ fts_optimize_node(
doc_id_t delta;
doc_id_t del_doc_id = FTS_NULL_DOC_ID;
- delta = fts_decode_vlc(&enc->src_ilist_ptr);
+ delta = fts_decode_vlc(
+ (const byte**)&enc->src_ilist_ptr);
test_again:
/* Check whether the doc id is in the delete list, if
@@ -1248,7 +1250,7 @@ test_again:
/* Skip the entries for this document. */
while (*enc->src_ilist_ptr) {
- fts_decode_vlc(&enc->src_ilist_ptr);
+ fts_decode_vlc((const byte**)&enc->src_ilist_ptr);
}
/* Skip the end of word position marker. */
@@ -1441,7 +1443,7 @@ fts_optimize_write_word(
fts_table->suffix = fts_get_suffix(selected);
fts_get_table_name(fts_table, table_name);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
graph = fts_parse_sql(
fts_table,
@@ -2032,11 +2034,11 @@ fts_optimize_purge_deleted_doc_ids(
used in the fts_delete_doc_ids_sql */
optim->fts_common_table.suffix = fts_common_tables[3];
fts_get_table_name(&optim->fts_common_table, deleted);
- pars_info_bind_id(info, true, fts_common_tables[3], deleted);
+ pars_info_bind_id(info, fts_common_tables[3], deleted);
optim->fts_common_table.suffix = fts_common_tables[4];
fts_get_table_name(&optim->fts_common_table, deleted_cache);
- pars_info_bind_id(info, true, fts_common_tables[4], deleted_cache);
+ pars_info_bind_id(info, fts_common_tables[4], deleted_cache);
graph = fts_parse_sql(NULL, info, fts_delete_doc_ids_sql);
@@ -2089,12 +2091,11 @@ fts_optimize_purge_deleted_doc_id_snapshot(
used in the fts_end_delete_sql */
optim->fts_common_table.suffix = fts_common_tables[0];
fts_get_table_name(&optim->fts_common_table, being_deleted);
- pars_info_bind_id(info, true, fts_common_tables[0], being_deleted);
+ pars_info_bind_id(info, fts_common_tables[0], being_deleted);
optim->fts_common_table.suffix = fts_common_tables[1];
fts_get_table_name(&optim->fts_common_table, being_deleted_cache);
- pars_info_bind_id(info, true, fts_common_tables[1],
- being_deleted_cache);
+ pars_info_bind_id(info, fts_common_tables[1], being_deleted_cache);
/* Delete the doc ids that were copied to delete pending state at
the start of optimize. */
@@ -2150,20 +2151,19 @@ fts_optimize_create_deleted_doc_id_snapshot(
used in the fts_init_delete_sql */
optim->fts_common_table.suffix = fts_common_tables[0];
fts_get_table_name(&optim->fts_common_table, being_deleted);
- pars_info_bind_id(info, true, fts_common_tables[0], being_deleted);
+ pars_info_bind_id(info, fts_common_tables[0], being_deleted);
optim->fts_common_table.suffix = fts_common_tables[3];
fts_get_table_name(&optim->fts_common_table, deleted);
- pars_info_bind_id(info, true, fts_common_tables[3], deleted);
+ pars_info_bind_id(info, fts_common_tables[3], deleted);
optim->fts_common_table.suffix = fts_common_tables[1];
fts_get_table_name(&optim->fts_common_table, being_deleted_cache);
- pars_info_bind_id(info, true, fts_common_tables[1],
- being_deleted_cache);
+ pars_info_bind_id(info, fts_common_tables[1], being_deleted_cache);
optim->fts_common_table.suffix = fts_common_tables[4];
fts_get_table_name(&optim->fts_common_table, deleted_cache);
- pars_info_bind_id(info, true, fts_common_tables[4], deleted_cache);
+ pars_info_bind_id(info, fts_common_tables[4], deleted_cache);
/* Move doc_ids that are to be deleted to state being deleted. */
graph = fts_parse_sql(NULL, info, fts_init_delete_sql);
@@ -2641,6 +2641,9 @@ fts_optimize_request_sync_table(
ib_wqueue_add(fts_optimize_wq, msg, msg->heap, true);
+ DBUG_EXECUTE_IF("fts_optimize_wq_count_check",
+ DBUG_ASSERT(fts_optimize_wq->length <= 1000););
+
mutex_exit(&fts_optimize_wq->mutex);
}
diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc
index df2b330fe4b..965c79bfaa5 100644
--- a/storage/innobase/fts/fts0que.cc
+++ b/storage/innobase/fts/fts0que.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2020, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -34,6 +34,7 @@ Completed 2011/7/10 Sunny and Jimmy Yang
#include "fts0pars.h"
#include "fts0types.h"
#include "fts0plugin.h"
+#include "fts0vlc.h"
#include <iomanip>
#include <vector>
@@ -2146,7 +2147,7 @@ fts_query_find_term(
query->fts_index_table.suffix = fts_get_suffix(selected);
fts_get_table_name(&query->fts_index_table, table_name);
- pars_info_bind_id(info, true, "index_table_name", table_name);
+ pars_info_bind_id(info, "index_table_name", table_name);
}
select.found = FALSE;
@@ -2286,7 +2287,7 @@ fts_query_total_docs_containing_term(
fts_get_table_name(&query->fts_index_table, table_name);
- pars_info_bind_id(info, true, "index_table_name", table_name);
+ pars_info_bind_id(info, "index_table_name", table_name);
graph = fts_parse_sql(
&query->fts_index_table,
@@ -2369,7 +2370,7 @@ fts_query_terms_in_document(
fts_get_table_name(&query->fts_index_table, table_name);
- pars_info_bind_id(info, true, "index_table_name", table_name);
+ pars_info_bind_id(info, "index_table_name", table_name);
graph = fts_parse_sql(
&query->fts_index_table,
@@ -3224,7 +3225,7 @@ fts_query_filter_doc_ids(
ulint len, /*!< in: doc id ilist size */
ibool calc_doc_count) /*!< in: whether to remember doc count */
{
- byte* ptr = static_cast<byte*>(data);
+ const byte* ptr = static_cast<byte*>(data);
doc_id_t doc_id = 0;
ulint decoded = 0;
ib_rbt_t* doc_freqs = word_freq->doc_freqs;
@@ -3234,8 +3235,8 @@ fts_query_filter_doc_ids(
ulint freq = 0;
fts_doc_freq_t* doc_freq;
fts_match_t* match = NULL;
- ulint last_pos = 0;
- ulint pos = fts_decode_vlc(&ptr);
+ doc_id_t last_pos = 0;
+ doc_id_t pos = fts_decode_vlc(&ptr);
/* Some sanity checks. */
if (doc_id == 0) {
diff --git a/storage/innobase/fts/fts0sql.cc b/storage/innobase/fts/fts0sql.cc
index e61f2118e70..edbfe484395 100644
--- a/storage/innobase/fts/fts0sql.cc
+++ b/storage/innobase/fts/fts0sql.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2019, MariaDB Corporation.
+Copyright (c) 2019, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -249,7 +249,7 @@ fts_get_select_columns_str(
sel_str = mem_heap_printf(heap, "sel%lu", (ulong) i);
/* Set copy_name to TRUE since it's dynamic. */
- pars_info_bind_id(info, TRUE, sel_str, field->name);
+ pars_info_bind_id(info, sel_str, field->name);
str = mem_heap_printf(
heap, "%s%s$%s", str, (*str) ? ", " : "", sel_str);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index fc876e6f753..37748cb497a 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4503,7 +4503,7 @@ innobase_commit_low(
if (trx_is_started(trx)) {
trx_commit_for_mysql(trx);
} else {
- trx->will_lock = 0;
+ trx->will_lock = false;
#ifdef WITH_WSREP
trx->wsrep = false;
#endif /* WITH_WSREP */
@@ -4860,7 +4860,7 @@ innobase_rollback_trx(
lock_unlock_table_autoinc(trx);
if (!trx->has_logged()) {
- trx->will_lock = 0;
+ trx->will_lock = false;
#ifdef WITH_WSREP
trx->wsrep = false;
#endif
@@ -5338,13 +5338,19 @@ ha_innobase::index_type(
{
dict_index_t* index = innobase_get_index(keynr);
- if (index && index->type & DICT_FTS) {
+ if (!index) {
+ return "Corrupted";
+ }
+
+ if (index->type & DICT_FTS) {
return("FULLTEXT");
- } else if (dict_index_is_spatial(index)) {
+ }
+
+ if (dict_index_is_spatial(index)) {
return("SPATIAL");
- } else {
- return("BTREE");
}
+
+ return("BTREE");
}
/****************************************************************//**
@@ -6261,13 +6267,6 @@ no_such_table:
innobase_copy_frm_flags_from_table_share(ib_table, table->s);
- /* No point to init any statistics if tablespace is still encrypted. */
- if (ib_table->is_readable()) {
- dict_stats_init(ib_table);
- } else {
- ib_table->stat_initialized = 1;
- }
-
MONITOR_INC(MONITOR_TABLE_OPEN);
bool no_tablespace = false;
@@ -6489,7 +6488,9 @@ no_such_table:
dict_table_get_format(m_prebuilt->table));
}
- if (m_prebuilt->table == NULL
+ const my_bool for_vc_purge = THDVAR(thd, background_thread);
+
+ if (for_vc_purge || m_prebuilt->table == NULL
|| dict_table_is_temporary(m_prebuilt->table)
|| m_prebuilt->table->persistent_autoinc
|| !m_prebuilt->table->is_readable()) {
@@ -6513,7 +6514,10 @@ no_such_table:
}
}
- info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
+ if (!for_vc_purge) {
+ info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
+ }
+
DBUG_RETURN(0);
}
@@ -6720,8 +6724,8 @@ wsrep_innobase_mysql_sort(
case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_VARCHAR:
{
- uchar *tmp_str;
- uint tmp_length;
+ uchar tmp_str[REC_VERSION_56_MAX_INDEX_COL_LEN] = {'\0'};
+ uint tmp_length = REC_VERSION_56_MAX_INDEX_COL_LEN;
/* Use the charset number to pick the right charset struct for
the comparison. Since the MySQL function get_charset may be
@@ -6744,11 +6748,7 @@ wsrep_innobase_mysql_sort(
}
}
- // Note that strnxfrm may change length of string
- tmp_length= charset->coll->strnxfrmlen(charset, str_length);
- tmp_length= ut_max(str_length, tmp_length) + 1;
- tmp_str= static_cast<uchar *>(ut_malloc_nokey(tmp_length));
- ut_ad(str_length <= tmp_length);
+ ut_a(str_length <= tmp_length);
memcpy(tmp_str, str, str_length);
tmp_length = charset->coll->strnxfrm(charset, str, str_length,
@@ -6772,7 +6772,6 @@ wsrep_innobase_mysql_sort(
ret_length = tmp_length;
}
- ut_free(tmp_str);
break;
}
case MYSQL_TYPE_DECIMAL :
@@ -7124,7 +7123,7 @@ wsrep_store_key_val_for_row(
THD* thd,
TABLE* table,
uint keynr, /*!< in: key number */
- uchar* buff, /*!< in/out: buffer for the key value (in MySQL
+ char* buff, /*!< in/out: buffer for the key value (in MySQL
format) */
uint buff_len,/*!< in: buffer length */
const uchar* record,
@@ -7133,7 +7132,7 @@ wsrep_store_key_val_for_row(
KEY* key_info = table->key_info + keynr;
KEY_PART_INFO* key_part = key_info->key_part;
KEY_PART_INFO* end = key_part + key_info->user_defined_key_parts;
- uchar* buff_start = buff;
+ char* buff_start = buff;
enum_field_types mysql_type;
Field* field;
uint buff_space = buff_len;
@@ -7145,8 +7144,7 @@ wsrep_store_key_val_for_row(
for (; key_part != end; key_part++) {
- uchar *sorted=NULL;
- uint max_len=0;
+ uchar sorted[REC_VERSION_56_MAX_INDEX_COL_LEN] = {'\0'};
ibool part_is_null = FALSE;
if (key_part->null_bit) {
@@ -7220,19 +7218,19 @@ wsrep_store_key_val_for_row(
/* In a column prefix index, we may need to truncate
the stored value: */
-
if (true_len > key_len) {
true_len = key_len;
}
+ /* cannot exceed max column lenght either, we may need to truncate
+ the stored value: */
+ if (true_len > sizeof(sorted)) {
+ true_len = sizeof(sorted);
+ }
- max_len= true_len;
- sorted= static_cast<uchar *>(ut_malloc_nokey(max_len+1));
memcpy(sorted, data, true_len);
true_len = wsrep_innobase_mysql_sort(
mysql_type, cs->number, sorted, true_len,
- max_len);
- ut_ad(true_len <= max_len);
-
+ REC_VERSION_56_MAX_INDEX_COL_LEN);
if (wsrep_protocol_version > 1) {
/* Note that we always reserve the maximum possible
length of the true VARCHAR in the key value, though
@@ -7240,8 +7238,8 @@ wsrep_store_key_val_for_row(
actual data. The rest of the space was reset to zero
in the bzero() call above. */
if (true_len > buff_space) {
- fprintf (stderr,
- "WSREP: key truncated: %s\n",
+ WSREP_DEBUG (
+ "write set key truncated for: %s\n",
wsrep_thd_query(thd));
true_len = buff_space;
}
@@ -7317,13 +7315,11 @@ wsrep_store_key_val_for_row(
true_len = key_len;
}
- max_len= true_len;
- sorted= static_cast<uchar *>(ut_malloc_nokey(max_len+1));
memcpy(sorted, blob_data, true_len);
true_len = wsrep_innobase_mysql_sort(
mysql_type, cs->number, sorted, true_len,
- max_len);
- ut_ad(true_len <= max_len);
+ REC_VERSION_56_MAX_INDEX_COL_LEN);
+
/* Note that we always reserve the maximum possible
length of the BLOB prefix in the key value. */
@@ -7399,14 +7395,10 @@ wsrep_store_key_val_for_row(
cs->mbmaxlen),
&error);
}
-
- max_len= true_len;
- sorted= static_cast<uchar *>(ut_malloc_nokey(max_len+1));
memcpy(sorted, src_start, true_len);
true_len = wsrep_innobase_mysql_sort(
mysql_type, cs->number, sorted, true_len,
- max_len);
- ut_ad(true_len <= max_len);
+ REC_VERSION_56_MAX_INDEX_COL_LEN);
if (true_len > buff_space) {
fprintf (stderr,
@@ -7421,11 +7413,6 @@ wsrep_store_key_val_for_row(
buff += true_len;
buff_space -= true_len;
}
-
- if (sorted) {
- ut_free(sorted);
- sorted= NULL;
- }
}
ut_a(buff <= buff_start + buff_len);
@@ -8172,20 +8159,12 @@ ha_innobase::write_row(
if (high_level_read_only) {
ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ERR_TABLE_READONLY);
- } else if (UNIV_UNLIKELY(m_prebuilt->trx != trx)) {
- ib::error() << "The transaction object for the table handle is"
- " at " << static_cast<const void*>(m_prebuilt->trx)
- << ", but for the current thread it is at "
- << static_cast<const void*>(trx);
-
- fputs("InnoDB: Dump of 200 bytes around m_prebuilt: ", stderr);
- ut_print_buf(stderr, ((const byte*) m_prebuilt) - 100, 200);
- fputs("\nInnoDB: Dump of 200 bytes around ha_data: ", stderr);
- ut_print_buf(stderr, ((const byte*) trx) - 100, 200);
- putc('\n', stderr);
- ut_error;
- } else if (!trx_is_started(trx)) {
- ++trx->will_lock;
+ }
+
+ ut_a(m_prebuilt->trx == trx);
+
+ if (!trx_is_started(trx)) {
+ trx->will_lock = true;
}
#ifdef WITH_WSREP
@@ -8564,8 +8543,7 @@ calc_row_difference(
&& prebuilt->table->fts
&& innobase_strcasecmp(
field->field_name, FTS_DOC_ID_COL_NAME) == 0) {
- doc_id = (doc_id_t) mach_read_from_n_little_endian(
- n_ptr, 8);
+ doc_id = mach_read_uint64_little_endian(n_ptr);
if (doc_id == 0) {
return(DB_FTS_INVALID_DOCID);
}
@@ -8808,16 +8786,6 @@ calc_row_difference(
<< innodb_table->name;
return(DB_FTS_INVALID_DOCID);
- } else if ((doc_id
- - prebuilt->table->fts->cache->next_doc_id)
- >= FTS_DOC_ID_MAX_STEP) {
-
- ib::warn() << "Doc ID " << doc_id << " is too"
- " big. Its difference with largest"
- " Doc ID used " << prebuilt->table->fts
- ->cache->next_doc_id - 1
- << " cannot exceed or equal to "
- << FTS_DOC_ID_MAX_STEP;
}
@@ -8960,7 +8928,7 @@ ha_innobase::update_row(
ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ERR_TABLE_READONLY);
} else if (!trx_is_started(trx)) {
- ++trx->will_lock;
+ trx->will_lock = true;
}
if (m_upd_buf == NULL) {
@@ -9106,7 +9074,7 @@ ha_innobase::delete_row(
ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ERR_TABLE_READONLY);
} else if (!trx_is_started(trx)) {
- ++trx->will_lock;
+ trx->will_lock = true;
}
if (!m_prebuilt->upd_node) {
@@ -9397,8 +9365,12 @@ ha_innobase::index_read(
/* For R-Tree index, we will always place the page lock to
pages being searched */
- if (dict_index_is_spatial(index)) {
- ++m_prebuilt->trx->will_lock;
+ if (index->is_spatial() && !m_prebuilt->trx->will_lock) {
+ if (trx_is_started(m_prebuilt->trx)) {
+ DBUG_RETURN(HA_ERR_READ_ONLY_TRANSACTION);
+ } else {
+ m_prebuilt->trx->will_lock = true;
+ }
}
/* Note that if the index for which the search template is built is not
@@ -9982,7 +9954,7 @@ ha_innobase::ft_init()
them as regular read only transactions for now. */
if (!trx_is_started(trx)) {
- ++trx->will_lock;
+ trx->will_lock = true;
}
DBUG_RETURN(rnd_init(false));
@@ -10048,7 +10020,7 @@ ha_innobase::ft_init_ext(
them as regular read only transactions for now. */
if (!trx_is_started(trx)) {
- ++trx->will_lock;
+ trx->will_lock = true;
}
dict_table_t* ft_table = m_prebuilt->table;
@@ -10506,7 +10478,7 @@ wsrep_append_key(
trx_t *trx,
TABLE_SHARE *table_share,
TABLE *table,
- const uchar* key,
+ const char* key,
uint16_t key_len,
wsrep_key_type key_type /*!< in: access type of this key
(shared, exclusive, semi...) */
@@ -10610,8 +10582,8 @@ ha_innobase::wsrep_append_keys(
if (wsrep_protocol_version == 0) {
uint len;
- uchar keyval[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
- uchar *key = &keyval[0];
+ char keyval[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
+ char *key = &keyval[0];
ibool is_null;
len = wsrep_store_key_val_for_row(
@@ -10643,18 +10615,18 @@ ha_innobase::wsrep_append_keys(
for (i=0; i<table->s->keys; ++i) {
uint len;
- uchar keyval0[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
- uchar keyval1[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
- uchar* key0 = &keyval0[1];
- uchar* key1 = &keyval1[1];
+ char keyval0[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
+ char keyval1[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
+ char* key0 = &keyval0[1];
+ char* key1 = &keyval1[1];
KEY* key_info = table->key_info + i;
ibool is_null;
dict_index_t* idx = innobase_get_index(i);
dict_table_t* tab = (idx) ? idx->table : NULL;
- keyval0[0] = (uchar)i;
- keyval1[0] = (uchar)i;
+ keyval0[0] = (char)i;
+ keyval1[0] = (char)i;
if (!tab) {
WSREP_WARN("MariaDB-InnoDB key mismatch %s %s",
@@ -10712,7 +10684,7 @@ ha_innobase::wsrep_append_keys(
wsrep_calc_row_hash(digest, record0, table, m_prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share, table,
- (const uchar*) digest, 16,
+ (const char*) digest, 16,
key_type))) {
DBUG_RETURN(rcode);
}
@@ -10722,7 +10694,7 @@ ha_innobase::wsrep_append_keys(
digest, record1, table, m_prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share,
table,
- (const uchar*) digest,
+ (const char*) digest,
16, key_type))) {
DBUG_RETURN(rcode);
}
@@ -12008,10 +11980,6 @@ bool create_table_info_t::innobase_table_flags()
modified by another thread while the table is being created. */
const ulint file_format_allowed = srv_file_format;
- /* Cache the value of innobase_compression_level, in case it is
- modified by another thread while the table is being created. */
- const ulint default_compression_level = page_zip_level;
-
ha_table_option_struct *options= m_form->s->option_struct;
m_flags = 0;
@@ -12216,13 +12184,23 @@ index_bad:
m_flags2 |= DICT_TF2_USE_FILE_PER_TABLE;
}
+ ulint level = ulint(options->page_compression_level);
+ if (!level) {
+ level = page_zip_level;
+ if (!level && options->page_compressed) {
+ push_warning_printf(
+ m_thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ "InnoDB: PAGE_COMPRESSED requires"
+ " PAGE_COMPRESSION_LEVEL or"
+ " innodb_compression_level > 0");
+ DBUG_RETURN(false);
+ }
+ }
+
/* Set the table flags */
dict_tf_set(&m_flags, innodb_row_format, zip_ssize,
- m_use_data_dir,
- options->page_compressed,
- options->page_compression_level == 0 ?
- default_compression_level : static_cast<ulint>(options->page_compression_level),
- 0);
+ m_use_data_dir, options->page_compressed, level, 0);
/* Set the flags2 when create table or alter tables */
m_flags2 |= DICT_TF2_FTS_AUX_HEX_NAME;
@@ -13016,7 +12994,6 @@ create_table_info_t::create_table_update_dict()
if (!innobase_fts_load_stopword(innobase_table, NULL, m_thd)) {
dict_table_close(innobase_table, FALSE, FALSE);
srv_active_wake_master_thread();
- trx_free_for_mysql(m_trx);
DBUG_RETURN(-1);
}
@@ -13074,7 +13051,7 @@ create_table_info_t::allocate_trx()
{
m_trx = innobase_trx_allocate(m_thd);
- m_trx->will_lock++;
+ m_trx->will_lock = true;
m_trx->ddl = true;
}
@@ -13148,10 +13125,6 @@ ha_innobase::create(
innobase_commit_low(trx);
row_mysql_unlock_data_dictionary(trx);
- if (own_trx) {
- trx_free_for_mysql(trx);
- }
-
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
with innodb_flush_log_at_trx_commit = 0 */
@@ -13161,6 +13134,10 @@ ha_innobase::create(
error = info.create_table_update_dict();
+ if (own_trx) {
+ trx_free_for_mysql(trx);
+ }
+
/* Tell the InnoDB server that there might be work for
utility threads: */
@@ -13365,13 +13342,7 @@ inline int ha_innobase::delete_table(const char* name, enum_sql_command sqlcom)
ut_a(name_len < 1000);
- /* Either the transaction is already flagged as a locking transaction
- or it hasn't been started yet. */
-
- ut_a(!trx_is_started(trx) || trx->will_lock > 0);
-
- /* We are doing a DDL operation. */
- ++trx->will_lock;
+ trx->will_lock = true;
/* Drop the table in InnoDB */
@@ -13548,14 +13519,7 @@ innobase_drop_database(
#endif /* _WIN32 */
trx_t* trx = innobase_trx_allocate(thd);
-
- /* Either the transaction is already flagged as a locking transaction
- or it hasn't been started yet. */
-
- ut_a(!trx_is_started(trx) || trx->will_lock > 0);
-
- /* We are doing a DDL operation. */
- ++trx->will_lock;
+ trx->will_lock = true;
ulint dummy;
@@ -13599,7 +13563,7 @@ inline dberr_t innobase_rename_table(trx_t *trx, const char *from,
DEBUG_SYNC_C("innodb_rename_table_ready");
trx_start_if_not_started(trx, true);
- ut_ad(trx->will_lock > 0);
+ ut_ad(trx->will_lock);
if (commit) {
/* Serialize data dictionary operations with dictionary mutex:
@@ -13644,7 +13608,7 @@ inline dberr_t innobase_rename_table(trx_t *trx, const char *from,
/* Transaction must be flagged as a locking transaction or it hasn't
been started yet. */
- ut_a(trx->will_lock > 0);
+ ut_a(trx->will_lock);
error = row_rename_table_for_mysql(norm_from, norm_to, trx, commit,
commit);
@@ -13730,7 +13694,7 @@ int ha_innobase::truncate()
if (!srv_safe_truncate) {
if (!trx_is_started(m_prebuilt->trx)) {
- ++m_prebuilt->trx->will_lock;
+ m_prebuilt->trx->will_lock = true;
}
dberr_t err = row_truncate_table_for_mysql(
@@ -13784,8 +13748,7 @@ int ha_innobase::truncate()
heap, ib_table->name.m_name, ib_table->id);
const char* name = mem_heap_strdup(heap, ib_table->name.m_name);
trx_t* trx = innobase_trx_allocate(m_user_thd);
-
- ++trx->will_lock;
+ trx->will_lock = true;
trx_set_dict_operation(trx, TRX_DICT_OP_TABLE);
row_mysql_lock_data_dictionary(trx);
dict_stats_wait_bg_to_stop_using_table(ib_table, trx);
@@ -13870,9 +13833,7 @@ ha_innobase::rename_table(
}
trx_t* trx = innobase_trx_allocate(thd);
-
- /* We are doing a DDL operation. */
- ++trx->will_lock;
+ trx->will_lock = true;
trx_set_dict_operation(trx, TRX_DICT_OP_INDEX);
dberr_t error = innobase_rename_table(trx, from, to, true);
@@ -14393,6 +14354,10 @@ ha_innobase::info_low(
ib_table = m_prebuilt->table;
DBUG_ASSERT(ib_table->get_ref_count() > 0);
+ if (!ib_table->is_readable()) {
+ ib_table->stat_initialized = true;
+ }
+
if (flag & HA_STATUS_TIME) {
if (is_analyze || innobase_stats_on_metadata) {
@@ -14443,6 +14408,8 @@ ha_innobase::info_low(
stats.update_time = (ulong) ib_table->update_time;
}
+ dict_stats_init(ib_table);
+
if (flag & HA_STATUS_VARIABLE) {
ulint stat_clustered_index_size;
@@ -15177,68 +15144,6 @@ ha_innobase::check(
DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
}
-/*************************************************************//**
-Adds information about free space in the InnoDB tablespace to a table comment
-which is printed out when a user calls SHOW TABLE STATUS. Adds also info on
-foreign keys.
-@return table comment + InnoDB free space + info on foreign keys */
-UNIV_INTERN
-char*
-ha_innobase::update_table_comment(
-/*==============================*/
- const char* comment)/*!< in: table comment defined by user */
-{
- uint length = (uint) strlen(comment);
- char* str=0;
- size_t flen;
- std::string fk_str;
-
- /* We do not know if MySQL can call this function before calling
- external_lock(). To be safe, update the thd of the current table
- handle. */
-
- if (length > 64000 - 3) {
- return((char*) comment); /* string too long */
- }
-
- update_thd(ha_thd());
-
- m_prebuilt->trx->op_info = "returning table comment";
-
-#define SSTR( x ) reinterpret_cast< std::ostringstream & >( \
- ( std::ostringstream() << std::dec << x ) ).str()
-
- fk_str.append("InnoDB free: ");
- fk_str.append(SSTR(fsp_get_available_space_in_free_extents(
- m_prebuilt->table->space)));
-
- fk_str.append(dict_print_info_on_foreign_keys(
- FALSE, m_prebuilt->trx,
- m_prebuilt->table));
-
- flen = fk_str.length();
-
- if (length + flen + 3 > 64000) {
- flen = 64000 - 3 - length;
- }
- /* allocate buffer for the full string */
- str = (char*) my_malloc(length + flen + 3, MYF(0));
- if (str) {
- char* pos = str + length;
- if (length) {
- memcpy(str, comment, length);
- *pos++ = ';';
- *pos++ = ' ';
- }
- memcpy(pos, fk_str.c_str(), flen);
- pos[flen] = 0;
- }
-
- m_prebuilt->trx->op_info = (char*)"";
-
- return(str ? str : (char*) comment);
-}
-
/*******************************************************************//**
Gets the foreign key create info for a table stored in InnoDB.
@return own: character string in the form which can be inserted to the
@@ -15929,7 +15834,7 @@ ha_innobase::start_stmt(
innobase_register_trx(ht, thd, trx);
if (!trx_is_started(trx)) {
- ++trx->will_lock;
+ trx->will_lock = true;
}
DBUG_RETURN(0);
@@ -16152,7 +16057,7 @@ ha_innobase::external_lock(
&& (m_prebuilt->select_lock_type != LOCK_NONE
|| m_prebuilt->stored_select_lock_type != LOCK_NONE)) {
- ++trx->will_lock;
+ trx->will_lock = true;
}
DBUG_RETURN(0);
@@ -16199,7 +16104,7 @@ ha_innobase::external_lock(
&& (m_prebuilt->select_lock_type != LOCK_NONE
|| m_prebuilt->stored_select_lock_type != LOCK_NONE)) {
- ++trx->will_lock;
+ trx->will_lock = true;
}
DBUG_RETURN(0);
@@ -16878,7 +16783,7 @@ ha_innobase::store_lock(
&& (m_prebuilt->select_lock_type != LOCK_NONE
|| m_prebuilt->stored_select_lock_type != LOCK_NONE)) {
- ++trx->will_lock;
+ trx->will_lock = true;
}
return(to);
@@ -19557,6 +19462,33 @@ innodb_log_checksums_update(
thd, *static_cast<const my_bool*>(save));
}
+#ifdef UNIV_DEBUG
+static
+void
+innobase_debug_sync_callback(srv_slot_t *slot, const void *value)
+{
+ const char *value_str = *static_cast<const char* const*>(value);
+ size_t len = strlen(value_str) + 1;
+
+
+ // One allocation for list node object and value.
+ void *buf = ut_malloc_nokey(sizeof(srv_slot_t::debug_sync_t) + len-1);
+ srv_slot_t::debug_sync_t *sync = new(buf) srv_slot_t::debug_sync_t();
+ strcpy(sync->str, value_str);
+
+ rw_lock_x_lock(&slot->debug_sync_lock);
+ UT_LIST_ADD_LAST(slot->debug_sync, sync);
+ rw_lock_x_unlock(&slot->debug_sync_lock);
+}
+static
+void
+innobase_debug_sync_set(THD *thd, st_mysql_sys_var*, void *, const void *value)
+{
+ srv_for_each_thread(SRV_WORKER, innobase_debug_sync_callback, value);
+ srv_for_each_thread(SRV_PURGE, innobase_debug_sync_callback, value);
+}
+#endif
+
static SHOW_VAR innodb_status_variables_export[]= {
{"Innodb", (char*) &show_innodb_vars, SHOW_FUNC},
{NullS, NullS, SHOW_LONG}
@@ -21203,6 +21135,16 @@ static MYSQL_SYSVAR_BOOL(debug_force_scrubbing,
0,
"Perform extra scrubbing to increase test exposure",
NULL, NULL, FALSE);
+
+char *innobase_debug_sync;
+static MYSQL_SYSVAR_STR(debug_sync, innobase_debug_sync,
+ PLUGIN_VAR_NOCMDARG,
+ "debug_sync for innodb purge threads. "
+ "Use it to set up sync points for all purge threads "
+ "at once. The commands will be applied sequentially at"
+ " the beginning of purging the next undo record.",
+ NULL,
+ innobase_debug_sync_set, NULL);
#endif /* UNIV_DEBUG */
static MYSQL_SYSVAR_BOOL(instrument_semaphores, innodb_instrument_semaphores,
@@ -21426,6 +21368,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(background_scrub_data_check_interval),
#ifdef UNIV_DEBUG
MYSQL_SYSVAR(debug_force_scrubbing),
+ MYSQL_SYSVAR(debug_sync),
#endif
MYSQL_SYSVAR(instrument_semaphores),
MYSQL_SYSVAR(buf_dump_status_frequency),
@@ -21852,48 +21795,6 @@ innobase_rename_vc_templ(
table->vc_templ->tb_name = t_tbname;
}
-/** Get the updated parent field value from the update vector for the
-given col_no.
-@param[in] foreign foreign key information
-@param[in] update updated parent vector.
-@param[in] col_no base column position of the child table to check
-@return updated field from the parent update vector, else NULL */
-static
-dfield_t*
-innobase_get_field_from_update_vector(
- dict_foreign_t* foreign,
- upd_t* update,
- ulint col_no)
-{
- dict_table_t* parent_table = foreign->referenced_table;
- dict_index_t* parent_index = foreign->referenced_index;
- ulint parent_field_no;
- ulint parent_col_no;
- ulint prefix_col_no;
-
- for (ulint i = 0; i < foreign->n_fields; i++) {
- if (dict_index_get_nth_col_no(foreign->foreign_index, i)
- != col_no) {
- continue;
- }
-
- parent_col_no = dict_index_get_nth_col_no(parent_index, i);
- parent_field_no = dict_table_get_nth_col_pos(
- parent_table, parent_col_no, &prefix_col_no);
-
- for (ulint j = 0; j < update->n_fields; j++) {
- upd_field_t* parent_ufield
- = &update->fields[j];
-
- if (parent_ufield->field_no == parent_field_no) {
- return(&parent_ufield->new_val);
- }
- }
- }
-
- return (NULL);
-}
-
/**
Allocate a heap and record for calculating virtual fields
@@ -21976,9 +21877,10 @@ void innobase_report_computed_value_failed(dtuple_t *row)
@param[in] ifield index field
@param[in] thd MySQL thread handle
@param[in,out] mysql_table mysql table object
+@param[in,out] mysql_rec MariaDB record buffer
@param[in] old_table during ALTER TABLE, this is the old table
or NULL.
-@param[in] parent_update update vector for the parent row
+@param[in] update update vector for the row, if any
@param[in] foreign foreign key information
@return the field filled with computed value, or NULL if just want
to store the value in passed in "my_rec" */
@@ -21994,8 +21896,7 @@ innobase_get_computed_value(
TABLE* mysql_table,
byte* mysql_rec,
const dict_table_t* old_table,
- upd_t* parent_update,
- dict_foreign_t* foreign)
+ const upd_t* update)
{
byte rec_buf2[REC_VERSION_56_MAX_INDEX_COL_LEN];
byte* buf;
@@ -22008,6 +21909,8 @@ innobase_get_computed_value(
ulint ret = 0;
+ dict_index_t *clust_index= dict_table_get_first_index(index->table);
+
ut_ad(index->table->vc_templ);
ut_ad(thd != NULL);
ut_ad(mysql_table);
@@ -22037,14 +21940,16 @@ innobase_get_computed_value(
= index->table->vc_templ->vtempl[col_no];
const byte* data;
- if (parent_update != NULL) {
- /** Get the updated field from update vector
- of the parent table. */
- row_field = innobase_get_field_from_update_vector(
- foreign, parent_update, col_no);
+ if (update) {
+ ulint clust_no = dict_col_get_clust_pos(base_col,
+ clust_index);
+ if (const upd_field_t *uf = upd_get_field_by_field_no(
+ update, clust_no, false)) {
+ row_field = &uf->new_val;
+ }
}
- if (row_field == NULL) {
+ if (!row_field) {
row_field = dtuple_get_nth_field(row, col_no);
}
@@ -22594,8 +22499,8 @@ ib_push_warning(
va_start(args, format);
buf = (char *)my_malloc(MAX_BUF_SIZE, MYF(MY_WME));
- vsprintf(buf,format, args);
-
+ buf[MAX_BUF_SIZE - 1] = 0;
+ vsnprintf(buf, MAX_BUF_SIZE - 1, format, args);
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
convert_error_code_to_mysql((dberr_t)error, 0, thd),
buf);
@@ -22626,7 +22531,8 @@ ib_push_warning(
if (thd) {
va_start(args, format);
buf = (char *)my_malloc(MAX_BUF_SIZE, MYF(MY_WME));
- vsprintf(buf,format, args);
+ buf[MAX_BUF_SIZE - 1] = 0;
+ vsnprintf(buf, MAX_BUF_SIZE - 1, format, args);
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
convert_error_code_to_mysql((dberr_t)error, 0, thd),
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 274c6761d4f..eab009f7ac2 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -221,7 +221,6 @@ public:
int rename_table(const char* from, const char* to);
inline int defragment_table(const char* name);
int check(THD* thd, HA_CHECK_OPT* check_opt);
- char* update_table_comment(const char* comment);
char* get_foreign_key_create_info();
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index e03621795ba..1bbe99ee34d 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -248,13 +248,6 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
@return whether the table will be rebuilt */
bool need_rebuild () const { return(old_table != new_table); }
- /** Clear uncommmitted added indexes after a failed operation. */
- void clear_added_indexes()
- {
- for (ulint i= 0; i < num_to_add_index; i++)
- add_index[i]->detach_columns(true);
- }
-
/** Share context between partitions.
@param[in] ctx context from another partition of the table */
void set_shared_data(const inplace_alter_handler_ctx& ctx)
@@ -272,6 +265,44 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
}
}
+ /** @return whether the given column is being added */
+ bool is_new_vcol(const dict_v_col_t &v_col) const
+ {
+ for (ulint i= 0; i < num_to_add_vcol; i++)
+ if (&add_vcol[i] == &v_col)
+ return true;
+ return false;
+ }
+
+ /** During rollback, make newly added indexes point to
+ newly added virtual columns. */
+ void clean_new_vcol_index()
+ {
+ ut_ad(old_table == new_table);
+ const dict_index_t *index= dict_table_get_first_index(old_table);
+ while ((index= dict_table_get_next_index(index)) != NULL)
+ {
+ if (!index->has_virtual() || index->is_committed())
+ continue;
+ ulint n_drop_new_vcol= index->get_new_n_vcol();
+ for (ulint i= 0; n_drop_new_vcol && i < index->n_fields; i++)
+ {
+ dict_col_t *col= index->fields[i].col;
+ /* Skip the non-virtual and old virtual columns */
+ if (!col->is_virtual())
+ continue;
+ dict_v_col_t *vcol= reinterpret_cast<dict_v_col_t*>(col);
+ if (!is_new_vcol(*vcol))
+ continue;
+
+ dict_v_col_t *drop_vcol= index->new_vcol_info->
+ add_drop_v_col(index->heap, vcol, --n_drop_new_vcol);
+ /* Re-assign the index field with newly stored virtual column */
+ index->fields[i].col= reinterpret_cast<dict_col_t*>(drop_vcol);
+ }
+ }
+ }
+
private:
// Disable copying
ha_innobase_inplace_ctx(const ha_innobase_inplace_ctx&);
@@ -936,7 +967,7 @@ ha_innobase::check_if_supported_inplace_alter(
}
}
- m_prebuilt->trx->will_lock++;
+ m_prebuilt->trx->will_lock = true;
if (!online) {
/* We already determined that only a non-locking
@@ -2404,9 +2435,11 @@ innobase_fts_check_doc_id_index(
for (index = dict_table_get_first_index(table);
index; index = dict_table_get_next_index(index)) {
+
/* Check if there exists a unique index with the name of
- FTS_DOC_ID_INDEX_NAME */
- if (innobase_strcasecmp(index->name, FTS_DOC_ID_INDEX_NAME)) {
+ FTS_DOC_ID_INDEX_NAME and ignore the corrupted index */
+ if (index->type & DICT_CORRUPT
+ || innobase_strcasecmp(index->name, FTS_DOC_ID_INDEX_NAME)) {
continue;
}
@@ -2720,7 +2753,7 @@ online_retry_drop_indexes_low(
ut_ad(table->get_ref_count() >= 1);
if (table->drop_aborted) {
- row_merge_drop_indexes(trx, table, TRUE);
+ row_merge_drop_indexes(trx, table, true);
}
}
@@ -5144,7 +5177,7 @@ error_handled:
online_retry_drop_indexes_with_trx(user_table, ctx->trx);
} else {
ut_ad(!ctx->need_rebuild());
- row_merge_drop_indexes(ctx->trx, user_table, TRUE);
+ row_merge_drop_indexes(ctx->trx, user_table, true);
trx_commit_for_mysql(ctx->trx);
}
@@ -5322,6 +5355,10 @@ alter_fill_stored_column(
}
}
+static bool alter_templ_needs_rebuild(const TABLE* altered_table,
+ const Alter_inplace_info* ha_alter_info,
+ const dict_table_t* table);
+
/** Allows InnoDB to update internal structures with concurrent
writes blocked (provided that check_if_supported_inplace_alter()
@@ -5354,7 +5391,6 @@ ha_innobase::prepare_inplace_alter_table(
mem_heap_t* heap;
const char** col_names;
int error;
- ulint max_col_len;
ulint add_autoinc_col_no = ULINT_UNDEFINED;
ulonglong autoinc_col_max_value = 0;
ulint fts_doc_col_no = ULINT_UNDEFINED;
@@ -5392,12 +5428,6 @@ ha_innobase::prepare_inplace_alter_table(
if (!(ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)) {
/* Nothing to do */
DBUG_ASSERT(m_prebuilt->trx->dict_operation_lock_mode == 0);
- if (ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE) {
-
- online_retry_drop_indexes(
- m_prebuilt->table, m_user_thd);
-
- }
DBUG_RETURN(false);
}
@@ -5480,11 +5510,7 @@ ha_innobase::prepare_inplace_alter_table(
ha_alter_info->key_count)) {
err_exit_no_heap:
DBUG_ASSERT(m_prebuilt->trx->dict_operation_lock_mode == 0);
- if (ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE) {
-
- online_retry_drop_indexes(
- m_prebuilt->table, m_user_thd);
- }
+ online_retry_drop_indexes(m_prebuilt->table, m_user_thd);
DBUG_RETURN(true);
}
@@ -5558,6 +5584,8 @@ check_if_ok_to_rename:
}
if (!info.innobase_table_flags()) {
+ my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
+ table_type(), "PAGE_COMPRESSED");
goto err_exit_no_heap;
}
@@ -5568,7 +5596,13 @@ check_if_ok_to_rename:
& 1U << DICT_TF_POS_DATA_DIR);
}
- max_col_len = DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(info.flags());
+
+ /* ALGORITHM=INPLACE without rebuild (10.3+ ALGORITHM=NOCOPY)
+ must use the current ROW_FORMAT of the table. */
+ const ulint max_col_len = DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(
+ innobase_need_rebuild(ha_alter_info, this->table)
+ ? info.flags()
+ : m_prebuilt->table->flags);
/* Check each index's column length to make sure they do not
exceed limit */
@@ -5923,9 +5957,9 @@ err_exit:
== Alter_inplace_info::CHANGE_CREATE_OPTION
&& !innobase_need_rebuild(ha_alter_info, table))) {
+ ha_innobase_inplace_ctx *ctx = NULL;
if (heap) {
- ha_alter_info->handler_ctx
- = new ha_innobase_inplace_ctx(
+ ctx = new ha_innobase_inplace_ctx(
m_prebuilt,
drop_index, n_drop_index,
rename_index, n_rename_index,
@@ -5934,15 +5968,11 @@ err_exit:
ha_alter_info->online,
heap, indexed_table,
col_names, ULINT_UNDEFINED, 0, 0, 0);
+ ha_alter_info->handler_ctx = ctx;
}
DBUG_ASSERT(m_prebuilt->trx->dict_operation_lock_mode == 0);
- if (ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE) {
-
- online_retry_drop_indexes(
- m_prebuilt->table, m_user_thd);
-
- }
+ online_retry_drop_indexes(m_prebuilt->table, m_user_thd);
if ((ha_alter_info->handler_flags
& Alter_inplace_info::DROP_VIRTUAL_COLUMN)
@@ -5958,6 +5988,24 @@ err_exit:
DBUG_RETURN(true);
}
+ if (!(ha_alter_info->handler_flags & INNOBASE_ALTER_DATA)
+ && alter_templ_needs_rebuild(altered_table, ha_alter_info,
+ ctx->new_table)
+ && ctx->new_table->n_v_cols > 0) {
+ /* Changing maria record structure may end up here only
+ if virtual columns were altered. In this case, however,
+ vc_templ should be rebuilt. Since we don't actually
+ change any stored data, we can just dispose vc_templ;
+ it will be recreated on next ha_innobase::open(). */
+
+ DBUG_ASSERT(ctx->new_table == ctx->old_table);
+
+ dict_free_vc_templ(ctx->new_table->vc_templ);
+ UT_DELETE(ctx->new_table->vc_templ);
+
+ ctx->new_table->vc_templ = NULL;
+ }
+
DBUG_RETURN(false);
}
@@ -6075,35 +6123,6 @@ found_col:
add_fts_doc_id_idx));
}
-/** Check that the column is part of a virtual index(index contains
-virtual column) in the table
-@param[in] table Table containing column
-@param[in] col column to be checked
-@return true if this column is indexed with other virtual columns */
-static
-bool
-dict_col_in_v_indexes(
- dict_table_t* table,
- dict_col_t* col)
-{
- for (dict_index_t* index = dict_table_get_next_index(
- dict_table_get_first_index(table)); index != NULL;
- index = dict_table_get_next_index(index)) {
- if (!dict_index_has_virtual(index)) {
- continue;
- }
- for (ulint k = 0; k < index->n_fields; k++) {
- dict_field_t* field
- = dict_index_get_nth_field(index, k);
- if (field->col->ind == col->ind) {
- return(true);
- }
- }
- }
-
- return(false);
-}
-
/* Check whether a columnn length change alter operation requires
to rebuild the template.
@param[in] altered_table TABLE object for new version of table.
@@ -6115,9 +6134,9 @@ to rebuild the template.
static
bool
alter_templ_needs_rebuild(
- TABLE* altered_table,
- Alter_inplace_info* ha_alter_info,
- dict_table_t* table)
+ const TABLE* altered_table,
+ const Alter_inplace_info* ha_alter_info,
+ const dict_table_t* table)
{
ulint i = 0;
List_iterator_fast<Create_field> cf_it(
@@ -6129,8 +6148,7 @@ alter_templ_needs_rebuild(
for (ulint j=0; j < table->n_cols; j++) {
dict_col_t* cols
= dict_table_get_nth_col(table, j);
- if (cf->length > cols->len
- && dict_col_in_v_indexes(table, cols)) {
+ if (cf->length > cols->len) {
return(true);
}
}
@@ -6386,7 +6404,6 @@ oom:
that we hold at most a shared lock on the table. */
m_prebuilt->trx->error_info = NULL;
ctx->trx->error_state = DB_SUCCESS;
- ctx->clear_added_indexes();
DBUG_RETURN(true);
}
@@ -6481,17 +6498,18 @@ temparary index prefix
@param table the TABLE
@param locked TRUE=table locked, FALSE=may need to do a lazy drop
@param trx the transaction
-*/
-static MY_ATTRIBUTE((nonnull))
+@param alter_trx transaction which takes S-lock on the table
+ while creating the index */
+static
void
innobase_rollback_sec_index(
-/*========================*/
- dict_table_t* user_table,
- const TABLE* table,
- ibool locked,
- trx_t* trx)
+ dict_table_t* user_table,
+ const TABLE* table,
+ bool locked,
+ trx_t* trx,
+ const trx_t* alter_trx=NULL)
{
- row_merge_drop_indexes(trx, user_table, locked);
+ row_merge_drop_indexes(trx, user_table, locked, alter_trx);
/* Free the table->fts only if there is no FTS_DOC_ID
in the table */
@@ -6585,7 +6603,12 @@ rollback_inplace_alter_table(
DBUG_ASSERT(ctx->new_table == prebuilt->table);
innobase_rollback_sec_index(
- prebuilt->table, table, FALSE, ctx->trx);
+ prebuilt->table, table,
+ (ha_alter_info->alter_info->requested_lock
+ == Alter_info::ALTER_TABLE_LOCK_EXCLUSIVE),
+ ctx->trx, prebuilt->trx);
+
+ ctx->clean_new_vcol_index();
}
trx_commit_for_mysql(ctx->trx);
@@ -8911,7 +8934,6 @@ foreign_fail:
m_prebuilt = ctx->prebuilt;
}
trx_start_if_not_started(user_trx, true);
- user_trx->will_lock++;
m_prebuilt->trx = user_trx;
}
DBUG_INJECT_CRASH("ib_commit_inplace_crash",
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 003760f80b1..1111d974ad0 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2020, MariaDB Corporation.
+Copyright (c) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -58,6 +58,7 @@ Modified Dec 29, 2014 Jan Lindström (Added sys_semaphore_waits)
#include "fil0fil.h"
#include "fil0crypt.h"
#include "dict0crea.h"
+#include "fts0vlc.h"
/** The latest successfully looked up innodb_fts_aux_table */
UNIV_INTERN table_id_t innodb_ft_aux_table_id;
@@ -302,218 +303,103 @@ field_store_ulint(
#endif
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
-static ST_FIELD_INFO innodb_trx_fields_info[] =
+static ST_FIELD_INFO innodb_trx_fields_info[]=
{
#define IDX_TRX_ID 0
- {STRUCT_FLD(field_name, "trx_id"),
- STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_id", TRX_ID_MAX_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_TRX_STATE 1
- {STRUCT_FLD(field_name, "trx_state"),
- STRUCT_FLD(field_length, TRX_QUE_STATE_STR_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_state", TRX_QUE_STATE_STR_MAX_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_TRX_STARTED 2
- {STRUCT_FLD(field_name, "trx_started"),
- STRUCT_FLD(field_length, 0),
- STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_started", 0, MYSQL_TYPE_DATETIME, 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_TRX_REQUESTED_LOCK_ID 3
- {STRUCT_FLD(field_name, "trx_requested_lock_id"),
- STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_requested_lock_id", TRX_I_S_LOCK_ID_MAX_LEN + 1, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_TRX_WAIT_STARTED 4
- {STRUCT_FLD(field_name, "trx_wait_started"),
- STRUCT_FLD(field_length, 0),
- STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_wait_started", 0, MYSQL_TYPE_DATETIME,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_TRX_WEIGHT 5
- {STRUCT_FLD(field_name, "trx_weight"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_weight",MY_INT64_NUM_DECIMAL_DIGITS,MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_TRX_MYSQL_THREAD_ID 6
- {STRUCT_FLD(field_name, "trx_mysql_thread_id"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_mysql_thread_id",MY_INT64_NUM_DECIMAL_DIGITS,MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_TRX_QUERY 7
- {STRUCT_FLD(field_name, "trx_query"),
- STRUCT_FLD(field_length, TRX_I_S_TRX_QUERY_MAX_LEN),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_query", TRX_I_S_TRX_QUERY_MAX_LEN, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_TRX_OPERATION_STATE 8
- {STRUCT_FLD(field_name, "trx_operation_state"),
- STRUCT_FLD(field_length, TRX_I_S_TRX_OP_STATE_MAX_LEN),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_operation_state", TRX_I_S_TRX_OP_STATE_MAX_LEN, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_TRX_TABLES_IN_USE 9
- {STRUCT_FLD(field_name, "trx_tables_in_use"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_tables_in_use", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_TRX_TABLES_LOCKED 10
- {STRUCT_FLD(field_name, "trx_tables_locked"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_tables_locked", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_TRX_LOCK_STRUCTS 11
- {STRUCT_FLD(field_name, "trx_lock_structs"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_lock_structs", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_TRX_LOCK_MEMORY_BYTES 12
- {STRUCT_FLD(field_name, "trx_lock_memory_bytes"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_lock_memory_bytes", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_TRX_ROWS_LOCKED 13
- {STRUCT_FLD(field_name, "trx_rows_locked"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_rows_locked", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_TRX_ROWS_MODIFIED 14
- {STRUCT_FLD(field_name, "trx_rows_modified"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_rows_modified", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_TRX_CONNCURRENCY_TICKETS 15
- {STRUCT_FLD(field_name, "trx_concurrency_tickets"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_concurrency_tickets", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_TRX_ISOLATION_LEVEL 16
- {STRUCT_FLD(field_name, "trx_isolation_level"),
- STRUCT_FLD(field_length, TRX_I_S_TRX_ISOLATION_LEVEL_MAX_LEN),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_isolation_level", TRX_I_S_TRX_ISOLATION_LEVEL_MAX_LEN,
+ MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_TRX_UNIQUE_CHECKS 17
- {STRUCT_FLD(field_name, "trx_unique_checks"),
- STRUCT_FLD(field_length, 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 1),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_unique_checks", 1, MYSQL_TYPE_LONG,
+ 1, 0, "", SKIP_OPEN_TABLE},
#define IDX_TRX_FOREIGN_KEY_CHECKS 18
- {STRUCT_FLD(field_name, "trx_foreign_key_checks"),
- STRUCT_FLD(field_length, 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 1),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_foreign_key_checks", 1, MYSQL_TYPE_LONG,
+ 1, 0, "", SKIP_OPEN_TABLE},
#define IDX_TRX_LAST_FOREIGN_KEY_ERROR 19
- {STRUCT_FLD(field_name, "trx_last_foreign_key_error"),
- STRUCT_FLD(field_length, TRX_I_S_TRX_FK_ERROR_MAX_LEN),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_last_foreign_key_error", TRX_I_S_TRX_FK_ERROR_MAX_LEN,
+ MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#ifdef BTR_CUR_HASH_ADAPT
#define IDX_TRX_ADAPTIVE_HASH_LATCHED 20
- {STRUCT_FLD(field_name, "trx_adaptive_hash_latched"),
- STRUCT_FLD(field_length, 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_adaptive_hash_latched", 1, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#endif /* BTR_CUR_HASH_ADAPT */
#define IDX_TRX_READ_ONLY 20 + I_S_AHI
- {STRUCT_FLD(field_name, "trx_is_read_only"),
- STRUCT_FLD(field_length, 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"trx_is_read_only", 1, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_TRX_AUTOCOMMIT_NON_LOCKING 21 + I_S_AHI
- {STRUCT_FLD(field_name, "trx_autocommit_non_locking"),
- STRUCT_FLD(field_length, 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"trx_autocommit_non_locking", 1, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
+
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -701,146 +587,97 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_trx =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_TRX"),
+ "INNODB_TRX",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB transactions"),
+ "InnoDB transactions",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_trx_init),
+ innodb_trx_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
-static ST_FIELD_INFO innodb_locks_fields_info[] =
+static ST_FIELD_INFO innodb_locks_fields_info[]=
{
#define IDX_LOCK_ID 0
- {STRUCT_FLD(field_name, "lock_id"),
- STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"lock_id", TRX_I_S_LOCK_ID_MAX_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_LOCK_TRX_ID 1
- {STRUCT_FLD(field_name, "lock_trx_id"),
- STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"lock_trx_id", TRX_ID_MAX_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_LOCK_MODE 2
- {STRUCT_FLD(field_name, "lock_mode"),
- /* S[,GAP] X[,GAP] IS[,GAP] IX[,GAP] AUTO_INC UNKNOWN */
- STRUCT_FLD(field_length, 32),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"lock_mode",
+ /* S[,GAP] X[,GAP] IS[,GAP] IX[,GAP] AUTO_INC UNKNOWN */
+ 32, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_LOCK_TYPE 3
- {STRUCT_FLD(field_name, "lock_type"),
- STRUCT_FLD(field_length, 32 /* RECORD|TABLE|UNKNOWN */),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"lock_type", 32 /* RECORD|TABLE|UNKNOWN */, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_LOCK_TABLE 4
- {STRUCT_FLD(field_name, "lock_table"),
- STRUCT_FLD(field_length, 1024),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"lock_table", 1024, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_LOCK_INDEX 5
- {STRUCT_FLD(field_name, "lock_index"),
- STRUCT_FLD(field_length, 1024),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"lock_index", 1024, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_LOCK_SPACE 6
- {STRUCT_FLD(field_name, "lock_space"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"lock_space", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_LOCK_PAGE 7
- {STRUCT_FLD(field_name, "lock_page"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"lock_page", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_LOCK_REC 8
- {STRUCT_FLD(field_name, "lock_rec"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"lock_rec", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_LOCK_DATA 9
- {STRUCT_FLD(field_name, "lock_data"),
- STRUCT_FLD(field_length, TRX_I_S_LOCK_DATA_MAX_LEN),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"lock_data", TRX_I_S_LOCK_DATA_MAX_LEN, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -956,91 +793,71 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_locks =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_LOCKS"),
+ "INNODB_LOCKS",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB conflicting locks"),
+ "InnoDB conflicting locks",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_locks_init),
+ innodb_locks_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
-static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
+static ST_FIELD_INFO innodb_lock_waits_fields_info[]=
{
#define IDX_REQUESTING_TRX_ID 0
- {STRUCT_FLD(field_name, "requesting_trx_id"),
- STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"requesting_trx_id", TRX_ID_MAX_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_REQUESTED_LOCK_ID 1
- {STRUCT_FLD(field_name, "requested_lock_id"),
- STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"requested_lock_id", TRX_I_S_LOCK_ID_MAX_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_BLOCKING_TRX_ID 2
- {STRUCT_FLD(field_name, "blocking_trx_id"),
- STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"blocking_trx_id", TRX_ID_MAX_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_BLOCKING_LOCK_ID 3
- {STRUCT_FLD(field_name, "blocking_lock_id"),
- STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"blocking_lock_id", TRX_I_S_LOCK_ID_MAX_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
+
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -1139,49 +956,49 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_lock_waits =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_LOCK_WAITS"),
+ "INNODB_LOCK_WAITS",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB which lock is blocking which"),
+ "InnoDB which lock is blocking which",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_lock_waits_init),
+ innodb_lock_waits_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/*******************************************************************//**
@@ -1284,60 +1101,21 @@ trx_i_s_common_fill_table(
}
/* Fields of the dynamic table information_schema.innodb_cmp. */
-static ST_FIELD_INFO i_s_cmp_fields_info[] =
-{
- {STRUCT_FLD(field_name, "page_size"),
- STRUCT_FLD(field_length, 5),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Compressed Page Size"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "compress_ops"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Total Number of Compressions"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "compress_ops_ok"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Total Number of"
- " Successful Compressions"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "compress_time"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Total Duration of Compressions,"
- " in Seconds"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "uncompress_ops"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Total Number of Decompressions"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "uncompress_time"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Total Duration of Decompressions,"
- " in Seconds"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+static ST_FIELD_INFO i_s_cmp_fields_info[]=
+{
+ {"page_size", 5, MYSQL_TYPE_LONG,
+ 0, 0, "Compressed Page Size", SKIP_OPEN_TABLE},
+ {"compress_ops", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "Total Number of Compressions", SKIP_OPEN_TABLE},
+ {"compress_ops_ok", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "Total Number of Successful Compressions", SKIP_OPEN_TABLE},
+ {"compress_time", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "Total Duration of Compressions, in Seconds", SKIP_OPEN_TABLE},
+ {"uncompress_ops", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "Total Number of Decompressions", SKIP_OPEN_TABLE},
+ {"uncompress_time", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "Total Duration of Decompressions, in Seconds", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
@@ -1467,179 +1245,139 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_CMP"),
+ "INNODB_CMP",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compression"),
+ "Statistics for the InnoDB compression",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmp_init),
+ i_s_cmp_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_CMP_RESET"),
+ "INNODB_CMP_RESET",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compression;"
- " reset cumulated counts"),
+ "Statistics for the InnoDB compression;"
+ " reset cumulated counts",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmp_reset_init),
+ i_s_cmp_reset_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic tables
information_schema.innodb_cmp_per_index and
information_schema.innodb_cmp_per_index_reset. */
-static ST_FIELD_INFO i_s_cmp_per_index_fields_info[] =
+static ST_FIELD_INFO i_s_cmp_per_index_fields_info[]=
{
#define IDX_DATABASE_NAME 0
- {STRUCT_FLD(field_name, "database_name"),
- STRUCT_FLD(field_length, 192),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"database_name", 192, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_TABLE_NAME 1
- {STRUCT_FLD(field_name, "table_name"),
- STRUCT_FLD(field_length, 192),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"table_name", 192, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_INDEX_NAME 2
- {STRUCT_FLD(field_name, "index_name"),
- STRUCT_FLD(field_length, 192),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"index_name", 192, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_COMPRESS_OPS 3
- {STRUCT_FLD(field_name, "compress_ops"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"compress_ops", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_COMPRESS_OPS_OK 4
- {STRUCT_FLD(field_name, "compress_ops_ok"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"compress_ops_ok", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_COMPRESS_TIME 5
- {STRUCT_FLD(field_name, "compress_time"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"compress_time", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_UNCOMPRESS_OPS 6
- {STRUCT_FLD(field_name, "uncompress_ops"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"uncompress_ops", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_UNCOMPRESS_TIME 7
- {STRUCT_FLD(field_name, "uncompress_time"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"uncompress_time", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
+
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -1817,154 +1555,117 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_CMP_PER_INDEX"),
+ "INNODB_CMP_PER_INDEX",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compression (per index)"),
+ "Statistics for the InnoDB compression (per index)",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmp_per_index_init),
+ i_s_cmp_per_index_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_CMP_PER_INDEX_RESET"),
+ "INNODB_CMP_PER_INDEX_RESET",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compression (per index);"
- " reset cumulated counts"),
+ "Statistics for the InnoDB compression (per index);"
+ " reset cumulated counts",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmp_per_index_reset_init),
+ i_s_cmp_per_index_reset_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
-static ST_FIELD_INFO i_s_cmpmem_fields_info[] =
-{
- {STRUCT_FLD(field_name, "page_size"),
- STRUCT_FLD(field_length, 5),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Buddy Block Size"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "buffer_pool_instance"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Buffer Pool Id"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "pages_used"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Currently in Use"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "pages_free"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Currently Available"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "relocation_ops"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Total Number of Relocations"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- {STRUCT_FLD(field_name, "relocation_time"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, "Total Duration of Relocations,"
- " in Seconds"),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+static ST_FIELD_INFO i_s_cmpmem_fields_info[]=
+{
+ {"page_size", 5, MYSQL_TYPE_LONG,
+ 0, 0, "Buddy Block Size", SKIP_OPEN_TABLE},
+ {"buffer_pool_instance", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "Buffer Pool Id", SKIP_OPEN_TABLE},
+ {"pages_used", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "Currently in Use", SKIP_OPEN_TABLE},
+ {"pages_free", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "Currently Available", SKIP_OPEN_TABLE},
+ {"relocation_ops", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, 0, "Total Number of Relocations", SKIP_OPEN_TABLE},
+ {"relocation_time", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "Total Duration of Relocations, in Seconds", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -2114,258 +1815,155 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_CMPMEM"),
+ "INNODB_CMPMEM",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool"),
+ "Statistics for the InnoDB compressed buffer pool",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmpmem_init),
+ i_s_cmpmem_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_CMPMEM_RESET"),
+ "INNODB_CMPMEM_RESET",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool;"
- " reset cumulated counts"),
+ "Statistics for the InnoDB compressed buffer pool;"
+ " reset cumulated counts",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmpmem_reset_init),
+ i_s_cmpmem_reset_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_metrics */
-static ST_FIELD_INFO innodb_metrics_fields_info[] =
+static ST_FIELD_INFO innodb_metrics_fields_info[]=
{
#define METRIC_NAME 0
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define METRIC_SUBSYS 1
- {STRUCT_FLD(field_name, "SUBSYSTEM"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SUBSYSTEM", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define METRIC_VALUE_START 2
- {STRUCT_FLD(field_name, "COUNT"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"COUNT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define METRIC_MAX_VALUE_START 3
- {STRUCT_FLD(field_name, "MAX_COUNT"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"MAX_COUNT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_MIN_VALUE_START 4
- {STRUCT_FLD(field_name, "MIN_COUNT"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"MIN_COUNT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_AVG_VALUE_START 5
- {STRUCT_FLD(field_name, "AVG_COUNT"),
- STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
- STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"AVG_COUNT", MAX_FLOAT_STR_LENGTH, MYSQL_TYPE_FLOAT,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_VALUE_RESET 6
- {STRUCT_FLD(field_name, "COUNT_RESET"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"COUNT_RESET", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define METRIC_MAX_VALUE_RESET 7
- {STRUCT_FLD(field_name, "MAX_COUNT_RESET"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"MAX_COUNT_RESET", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_MIN_VALUE_RESET 8
- {STRUCT_FLD(field_name, "MIN_COUNT_RESET"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"MIN_COUNT_RESET", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_AVG_VALUE_RESET 9
- {STRUCT_FLD(field_name, "AVG_COUNT_RESET"),
- STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
- STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"AVG_COUNT_RESET", MAX_FLOAT_STR_LENGTH, MYSQL_TYPE_FLOAT,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_START_TIME 10
- {STRUCT_FLD(field_name, "TIME_ENABLED"),
- STRUCT_FLD(field_length, 0),
- STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TIME_ENABLED", 0, MYSQL_TYPE_DATETIME,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_STOP_TIME 11
- {STRUCT_FLD(field_name, "TIME_DISABLED"),
- STRUCT_FLD(field_length, 0),
- STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TIME_DISABLED", 0, MYSQL_TYPE_DATETIME,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_TIME_ELAPSED 12
- {STRUCT_FLD(field_name, "TIME_ELAPSED"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TIME_ELAPSED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_RESET_TIME 13
- {STRUCT_FLD(field_name, "TIME_RESET"),
- STRUCT_FLD(field_length, 0),
- STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TIME_RESET", 0, MYSQL_TYPE_DATETIME,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define METRIC_STATUS 14
- {STRUCT_FLD(field_name, "STATUS"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"STATUS", NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define METRIC_TYPE 15
- {STRUCT_FLD(field_name, "TYPE"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TYPE", NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define METRIC_DESC 16
- {STRUCT_FLD(field_name, "COMMENT"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"COMMENT", NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
+
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -2689,63 +2287,56 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_metrics =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_METRICS"),
+ "INNODB_METRICS",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB Metrics Info"),
+ "InnoDB Metrics Info",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_metrics_init),
+ innodb_metrics_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_ft_default_stopword */
-static ST_FIELD_INFO i_s_stopword_fields_info[] =
+static ST_FIELD_INFO i_s_stopword_fields_info[]=
{
#define STOPWORD_VALUE 0
- {STRUCT_FLD(field_name, "value"),
- STRUCT_FLD(field_length, TRX_ID_MAX_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"value", TRX_ID_MAX_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -2802,65 +2393,59 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_default_stopword =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_FT_DEFAULT_STOPWORD"),
+ "INNODB_FT_DEFAULT_STOPWORD",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "Default stopword list for InnoDB Full Text Search"),
+ "Default stopword list for InnoDB Full Text Search",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_stopword_init),
+ i_s_stopword_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_DELETED
INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED */
-static ST_FIELD_INFO i_s_fts_doc_fields_info[] =
+static ST_FIELD_INFO i_s_fts_doc_fields_info[]=
{
#define I_S_FTS_DOC_ID 0
- {STRUCT_FLD(field_name, "DOC_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"DOC_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -2901,7 +2486,8 @@ i_s_fts_deleted_generic_fill(
if (!user_table) {
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
- } else if (!dict_table_has_fts_index(user_table)) {
+ } else if (!dict_table_has_fts_index(user_table)
+ || !user_table->is_readable()) {
dict_table_close(user_table, FALSE, FALSE);
rw_lock_s_unlock(&dict_operation_lock);
DBUG_RETURN(0);
@@ -2981,49 +2567,49 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_deleted =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_FT_DELETED"),
+ "INNODB_FT_DELETED",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "INNODB AUXILIARY FTS DELETED TABLE"),
+ "INNODB AUXILIARY FTS DELETED TABLE",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_fts_deleted_init),
+ i_s_fts_deleted_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/*******************************************************************//**
@@ -3064,110 +2650,74 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_being_deleted =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_FT_BEING_DELETED"),
+ "INNODB_FT_BEING_DELETED",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "INNODB AUXILIARY FTS BEING DELETED TABLE"),
+ "INNODB AUXILIARY FTS BEING DELETED TABLE",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_fts_being_deleted_init),
+ i_s_fts_being_deleted_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHED and
INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE */
-static ST_FIELD_INFO i_s_fts_index_fields_info[] =
+static ST_FIELD_INFO i_s_fts_index_fields_info[]=
{
#define I_S_FTS_WORD 0
- {STRUCT_FLD(field_name, "WORD"),
- STRUCT_FLD(field_length, FTS_MAX_WORD_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"WORD", FTS_MAX_WORD_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define I_S_FTS_FIRST_DOC_ID 1
- {STRUCT_FLD(field_name, "FIRST_DOC_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FIRST_DOC_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define I_S_FTS_LAST_DOC_ID 2
- {STRUCT_FLD(field_name, "LAST_DOC_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"LAST_DOC_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define I_S_FTS_DOC_COUNT 3
- {STRUCT_FLD(field_name, "DOC_COUNT"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"DOC_COUNT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define I_S_FTS_ILIST_DOC_ID 4
- {STRUCT_FLD(field_name, "DOC_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"DOC_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define I_S_FTS_ILIST_DOC_POS 5
- {STRUCT_FLD(field_name, "POSITION"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"POSITION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -3226,7 +2776,7 @@ i_s_fts_index_cache_fill_one_index(
/* Decrypt the ilist, and display Dod ID and word position */
for (ulint i = 0; i < ib_vector_size(word->nodes); i++) {
fts_node_t* node;
- byte* ptr;
+ const byte* ptr;
ulint decoded = 0;
doc_id_t doc_id = 0;
@@ -3236,13 +2786,11 @@ i_s_fts_index_cache_fill_one_index(
ptr = node->ilist;
while (decoded < node->ilist_size) {
- ulint pos = fts_decode_vlc(&ptr);
- doc_id += pos;
+ doc_id += fts_decode_vlc(&ptr);
/* Get position info */
while (*ptr) {
- pos = fts_decode_vlc(&ptr);
OK(field_store_string(
fields[I_S_FTS_WORD],
@@ -3263,7 +2811,7 @@ i_s_fts_index_cache_fill_one_index(
doc_id, true));
OK(fields[I_S_FTS_ILIST_DOC_POS]->store(
- pos, true));
+ fts_decode_vlc(&ptr), true));
OK(schema_table_store_record(
thd, table));
@@ -3368,49 +2916,49 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_index_cache =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_FT_INDEX_CACHE"),
+ "INNODB_FT_INDEX_CACHE",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "INNODB AUXILIARY FTS INDEX CACHED"),
+ "INNODB AUXILIARY FTS INDEX CACHED",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_fts_index_cache_init),
+ i_s_fts_index_cache_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/*******************************************************************//**
@@ -3455,7 +3003,7 @@ i_s_fts_index_table_fill_selected(
FTS_INIT_INDEX_TABLE(&fts_table, fts_get_suffix(selected),
FTS_INDEX_TABLE, index);
fts_get_table_name(&fts_table, table_name);
- pars_info_bind_id(info, true, "table_name", table_name);
+ pars_info_bind_id(info, "table_name", table_name);
graph = fts_parse_sql(
&fts_table, info,
@@ -3597,7 +3145,7 @@ i_s_fts_index_table_fill_one_fetch(
/* Decrypt the ilist, and display Dod ID and word position */
for (ulint i = 0; i < ib_vector_size(word->nodes); i++) {
fts_node_t* node;
- byte* ptr;
+ const byte* ptr;
ulint decoded = 0;
doc_id_t doc_id = 0;
@@ -3607,13 +3155,10 @@ i_s_fts_index_table_fill_one_fetch(
ptr = node->ilist;
while (decoded < node->ilist_size) {
- ulint pos = fts_decode_vlc(&ptr);
-
- doc_id += pos;
+ doc_id += fts_decode_vlc(&ptr);
/* Get position info */
while (*ptr) {
- pos = fts_decode_vlc(&ptr);
OK(field_store_string(
fields[I_S_FTS_WORD],
@@ -3632,7 +3177,7 @@ i_s_fts_index_table_fill_one_fetch(
longlong(doc_id), true));
OK(fields[I_S_FTS_ILIST_DOC_POS]->store(
- pos, true));
+ fts_decode_vlc(&ptr), true));
OK(schema_table_store_record(
thd, table));
@@ -3808,73 +3353,59 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_index_table =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_FT_INDEX_TABLE"),
+ "INNODB_FT_INDEX_TABLE",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "INNODB AUXILIARY FTS INDEX TABLE"),
+ "INNODB AUXILIARY FTS INDEX TABLE",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_fts_index_table_init),
+ i_s_fts_index_table_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_CONFIG */
-static ST_FIELD_INFO i_s_fts_config_fields_info[] =
+static ST_FIELD_INFO i_s_fts_config_fields_info[]=
{
#define FTS_CONFIG_KEY 0
- {STRUCT_FLD(field_name, "KEY"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"KEY", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define FTS_CONFIG_VALUE 1
- {STRUCT_FLD(field_name, "VALUE"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"VALUE", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
static const char* fts_config_key[] = {
@@ -4016,343 +3547,154 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_config =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_FT_CONFIG"),
+ "INNODB_FT_CONFIG",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "INNODB AUXILIARY FTS CONFIG TABLE"),
+ "INNODB AUXILIARY FTS CONFIG TABLE",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_fts_config_init),
+ i_s_fts_config_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table INNODB_BUFFER_POOL_STATS. */
-static ST_FIELD_INFO i_s_innodb_buffer_stats_fields_info[] =
+static ST_FIELD_INFO i_s_innodb_buffer_stats_fields_info[]=
{
#define IDX_BUF_STATS_POOL_ID 0
- {STRUCT_FLD(field_name, "POOL_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"POOL_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_POOL_SIZE 1
- {STRUCT_FLD(field_name, "POOL_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"POOL_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_FREE_BUFFERS 2
- {STRUCT_FLD(field_name, "FREE_BUFFERS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FREE_BUFFERS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_LRU_LEN 3
- {STRUCT_FLD(field_name, "DATABASE_PAGES"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"DATABASE_PAGES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_OLD_LRU_LEN 4
- {STRUCT_FLD(field_name, "OLD_DATABASE_PAGES"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"OLD_DATABASE_PAGES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_FLUSH_LIST_LEN 5
- {STRUCT_FLD(field_name, "MODIFIED_DATABASE_PAGES"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"MODIFIED_DATABASE_PAGES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PENDING_ZIP 6
- {STRUCT_FLD(field_name, "PENDING_DECOMPRESS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PENDING_DECOMPRESS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PENDING_READ 7
- {STRUCT_FLD(field_name, "PENDING_READS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PENDING_READS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_FLUSH_LRU 8
- {STRUCT_FLD(field_name, "PENDING_FLUSH_LRU"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PENDING_FLUSH_LRU", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_FLUSH_LIST 9
- {STRUCT_FLD(field_name, "PENDING_FLUSH_LIST"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PENDING_FLUSH_LIST", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_YOUNG 10
- {STRUCT_FLD(field_name, "PAGES_MADE_YOUNG"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGES_MADE_YOUNG", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_NOT_YOUNG 11
- {STRUCT_FLD(field_name, "PAGES_NOT_MADE_YOUNG"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGES_NOT_MADE_YOUNG", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_YOUNG_RATE 12
- {STRUCT_FLD(field_name, "PAGES_MADE_YOUNG_RATE"),
- STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
- STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGES_MADE_YOUNG_RATE", MAX_FLOAT_STR_LENGTH, MYSQL_TYPE_FLOAT,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_NOT_YOUNG_RATE 13
- {STRUCT_FLD(field_name, "PAGES_MADE_NOT_YOUNG_RATE"),
- STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
- STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGES_MADE_NOT_YOUNG_RATE", MAX_FLOAT_STR_LENGTH, MYSQL_TYPE_FLOAT,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_READ 14
- {STRUCT_FLD(field_name, "NUMBER_PAGES_READ"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NUMBER_PAGES_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_CREATED 15
- {STRUCT_FLD(field_name, "NUMBER_PAGES_CREATED"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NUMBER_PAGES_CREATED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_WRITTEN 16
- {STRUCT_FLD(field_name, "NUMBER_PAGES_WRITTEN"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NUMBER_PAGES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_READ_RATE 17
- {STRUCT_FLD(field_name, "PAGES_READ_RATE"),
- STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
- STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGES_READ_RATE", MAX_FLOAT_STR_LENGTH, MYSQL_TYPE_FLOAT,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_CREATE_RATE 18
- {STRUCT_FLD(field_name, "PAGES_CREATE_RATE"),
- STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
- STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGES_CREATE_RATE", MAX_FLOAT_STR_LENGTH, MYSQL_TYPE_FLOAT,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_PAGE_WRITTEN_RATE 19
- {STRUCT_FLD(field_name, "PAGES_WRITTEN_RATE"),
- STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
- STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGES_WRITTEN_RATE", MAX_FLOAT_STR_LENGTH, MYSQL_TYPE_FLOAT,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_GET 20
- {STRUCT_FLD(field_name, "NUMBER_PAGES_GET"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NUMBER_PAGES_GET", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_HIT_RATE 21
- {STRUCT_FLD(field_name, "HIT_RATE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"HIT_RATE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_MADE_YOUNG_PCT 22
- {STRUCT_FLD(field_name, "YOUNG_MAKE_PER_THOUSAND_GETS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"YOUNG_MAKE_PER_THOUSAND_GETS", MY_INT64_NUM_DECIMAL_DIGITS,
+ MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_NOT_MADE_YOUNG_PCT 23
- {STRUCT_FLD(field_name, "NOT_YOUNG_MAKE_PER_THOUSAND_GETS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NOT_YOUNG_MAKE_PER_THOUSAND_GETS", MY_INT64_NUM_DECIMAL_DIGITS,
+ MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_READ_AHREAD 24
- {STRUCT_FLD(field_name, "NUMBER_PAGES_READ_AHEAD"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NUMBER_PAGES_READ_AHEAD", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_READ_AHEAD_EVICTED 25
- {STRUCT_FLD(field_name, "NUMBER_READ_AHEAD_EVICTED"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NUMBER_READ_AHEAD_EVICTED", MY_INT64_NUM_DECIMAL_DIGITS,
+ MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_READ_AHEAD_RATE 26
- {STRUCT_FLD(field_name, "READ_AHEAD_RATE"),
- STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
- STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"READ_AHEAD_RATE", MAX_FLOAT_STR_LENGTH, MYSQL_TYPE_FLOAT,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_READ_AHEAD_EVICT_RATE 27
- {STRUCT_FLD(field_name, "READ_AHEAD_EVICTED_RATE"),
- STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
- STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"READ_AHEAD_EVICTED_RATE", MAX_FLOAT_STR_LENGTH, MYSQL_TYPE_FLOAT,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_LRU_IO_SUM 28
- {STRUCT_FLD(field_name, "LRU_IO_TOTAL"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"LRU_IO_TOTAL", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_LRU_IO_CUR 29
- {STRUCT_FLD(field_name, "LRU_IO_CURRENT"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"LRU_IO_CURRENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_UNZIP_SUM 30
- {STRUCT_FLD(field_name, "UNCOMPRESS_TOTAL"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"UNCOMPRESS_TOTAL", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_STATS_UNZIP_CUR 31
- {STRUCT_FLD(field_name, "UNCOMPRESS_CURRENT"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"UNCOMPRESS_CURRENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -4563,237 +3905,117 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_stats =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_BUFFER_POOL_STATS"),
+ "INNODB_BUFFER_POOL_STATS",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB Buffer Pool Statistics Information "),
+ "InnoDB Buffer Pool Statistics Information ",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_innodb_buffer_pool_stats_init),
+ i_s_innodb_buffer_pool_stats_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/* Fields of the dynamic table INNODB_BUFFER_POOL_PAGE. */
-static ST_FIELD_INFO i_s_innodb_buffer_page_fields_info[] =
+static ST_FIELD_INFO i_s_innodb_buffer_page_fields_info[]=
{
#define IDX_BUFFER_POOL_ID 0
- {STRUCT_FLD(field_name, "POOL_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"POOL_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_BLOCK_ID 1
- {STRUCT_FLD(field_name, "BLOCK_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"BLOCK_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_SPACE 2
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SPACE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_NUM 3
- {STRUCT_FLD(field_name, "PAGE_NUMBER"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGE_NUMBER", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_TYPE 4
- {STRUCT_FLD(field_name, "PAGE_TYPE"),
- STRUCT_FLD(field_length, 64),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGE_TYPE", 64, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_FLUSH_TYPE 5
- {STRUCT_FLD(field_name, "FLUSH_TYPE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FLUSH_TYPE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_FIX_COUNT 6
- {STRUCT_FLD(field_name, "FIX_COUNT"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FIX_COUNT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#ifdef BTR_CUR_HASH_ADAPT
-#define IDX_BUFFER_PAGE_HASHED 7
- {STRUCT_FLD(field_name, "IS_HASHED"),
- STRUCT_FLD(field_length, 3),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+# define IDX_BUFFER_PAGE_HASHED 7
+ {"IS_HASHED", 3, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#endif /* BTR_CUR_HASH_ADAPT */
-
#define IDX_BUFFER_PAGE_NEWEST_MOD 7 + I_S_AHI
- {STRUCT_FLD(field_name, "NEWEST_MODIFICATION"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NEWEST_MODIFICATION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_OLDEST_MOD 8 + I_S_AHI
- {STRUCT_FLD(field_name, "OLDEST_MODIFICATION"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"OLDEST_MODIFICATION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_ACCESS_TIME 9 + I_S_AHI
- {STRUCT_FLD(field_name, "ACCESS_TIME"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"ACCESS_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_TABLE_NAME 10 + I_S_AHI
- {STRUCT_FLD(field_name, "TABLE_NAME"),
- STRUCT_FLD(field_length, 1024),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TABLE_NAME", 1024, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_INDEX_NAME 11 + I_S_AHI
- {STRUCT_FLD(field_name, "INDEX_NAME"),
- STRUCT_FLD(field_length, 1024),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"INDEX_NAME", 1024, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_NUM_RECS 12 + I_S_AHI
- {STRUCT_FLD(field_name, "NUMBER_RECORDS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NUMBER_RECORDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_DATA_SIZE 13 + I_S_AHI
- {STRUCT_FLD(field_name, "DATA_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"DATA_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_ZIP_SIZE 14 + I_S_AHI
- {STRUCT_FLD(field_name, "COMPRESSED_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"COMPRESSED_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_STATE 15 + I_S_AHI
- {STRUCT_FLD(field_name, "PAGE_STATE"),
- STRUCT_FLD(field_length, 64),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGE_STATE", 64, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_IO_FIX 16 + I_S_AHI
- {STRUCT_FLD(field_name, "IO_FIX"),
- STRUCT_FLD(field_length, 64),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"IO_FIX", 64, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_IS_OLD 17 + I_S_AHI
- {STRUCT_FLD(field_name, "IS_OLD"),
- STRUCT_FLD(field_length, 3),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"IS_OLD", 3, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUFFER_PAGE_FREE_CLOCK 18 + I_S_AHI
- {STRUCT_FLD(field_name, "FREE_PAGE_CLOCK"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"FREE_PAGE_CLOCK", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -5292,236 +4514,116 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_BUFFER_PAGE"),
+ "INNODB_BUFFER_PAGE",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB Buffer Page Information"),
+ "InnoDB Buffer Page Information",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_innodb_buffer_page_init),
+ i_s_innodb_buffer_page_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
-static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[] =
+static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[]=
{
#define IDX_BUF_LRU_POOL_ID 0
- {STRUCT_FLD(field_name, "POOL_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"POOL_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_POS 1
- {STRUCT_FLD(field_name, "LRU_POSITION"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"LRU_POSITION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_SPACE 2
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SPACE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_NUM 3
- {STRUCT_FLD(field_name, "PAGE_NUMBER"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGE_NUMBER", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_TYPE 4
- {STRUCT_FLD(field_name, "PAGE_TYPE"),
- STRUCT_FLD(field_length, 64),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGE_TYPE", 64, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_FLUSH_TYPE 5
- {STRUCT_FLD(field_name, "FLUSH_TYPE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FLUSH_TYPE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_FIX_COUNT 6
- {STRUCT_FLD(field_name, "FIX_COUNT"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FIX_COUNT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#ifdef BTR_CUR_HASH_ADAPT
-#define IDX_BUF_LRU_PAGE_HASHED 7
- {STRUCT_FLD(field_name, "IS_HASHED"),
- STRUCT_FLD(field_length, 3),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+# define IDX_BUF_LRU_PAGE_HASHED 7
+ {"IS_HASHED", 3, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#endif /* BTR_CUR_HASH_ADAPT */
-
#define IDX_BUF_LRU_PAGE_NEWEST_MOD 7 + I_S_AHI
- {STRUCT_FLD(field_name, "NEWEST_MODIFICATION"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NEWEST_MODIFICATION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_OLDEST_MOD 8 + I_S_AHI
- {STRUCT_FLD(field_name, "OLDEST_MODIFICATION"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"OLDEST_MODIFICATION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_ACCESS_TIME 9 + I_S_AHI
- {STRUCT_FLD(field_name, "ACCESS_TIME"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"ACCESS_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_TABLE_NAME 10 + I_S_AHI
- {STRUCT_FLD(field_name, "TABLE_NAME"),
- STRUCT_FLD(field_length, 1024),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TABLE_NAME", 1024, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_INDEX_NAME 11 + I_S_AHI
- {STRUCT_FLD(field_name, "INDEX_NAME"),
- STRUCT_FLD(field_length, 1024),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"INDEX_NAME", 1024, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_NUM_RECS 12 + I_S_AHI
- {STRUCT_FLD(field_name, "NUMBER_RECORDS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NUMBER_RECORDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_DATA_SIZE 13 + I_S_AHI
- {STRUCT_FLD(field_name, "DATA_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"DATA_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_ZIP_SIZE 14 + I_S_AHI
- {STRUCT_FLD(field_name, "COMPRESSED_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"COMPRESSED_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_STATE 15 + I_S_AHI
- {STRUCT_FLD(field_name, "COMPRESSED"),
- STRUCT_FLD(field_length, 3),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"COMPRESSED", 3, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_IO_FIX 16 + I_S_AHI
- {STRUCT_FLD(field_name, "IO_FIX"),
- STRUCT_FLD(field_length, 64),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"IO_FIX", 64, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_IS_OLD 17 + I_S_AHI
- {STRUCT_FLD(field_name, "IS_OLD"),
- STRUCT_FLD(field_length, 3),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"IS_OLD", 3, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define IDX_BUF_LRU_PAGE_FREE_CLOCK 18 + I_S_AHI
- {STRUCT_FLD(field_name, "FREE_PAGE_CLOCK"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"FREE_PAGE_CLOCK", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -5843,49 +4945,49 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page_lru =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_BUFFER_PAGE_LRU"),
+ "INNODB_BUFFER_PAGE_LRU",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB Buffer Page in LRU"),
+ "InnoDB Buffer Page in LRU",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, i_s_innodb_buffer_page_lru_init),
+ i_s_innodb_buffer_page_lru_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/*******************************************************************//**
@@ -5906,90 +5008,36 @@ i_s_common_deinit(
/** SYS_TABLES ***************************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_TABLES */
-static ST_FIELD_INFO innodb_sys_tables_fields_info[] =
+static ST_FIELD_INFO innodb_sys_tables_fields_info[]=
{
#define SYS_TABLES_ID 0
- {STRUCT_FLD(field_name, "TABLE_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TABLE_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLES_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, MAX_FULL_NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NAME", MAX_FULL_NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_TABLES_FLAG 2
- {STRUCT_FLD(field_name, "FLAG"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FLAG", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_TABLES_NUM_COLUMN 3
- {STRUCT_FLD(field_name, "N_COLS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"N_COLS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_TABLES_SPACE 4
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SPACE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_TABLES_FILE_FORMAT 5
- {STRUCT_FLD(field_name, "FILE_FORMAT"),
- STRUCT_FLD(field_length, 10),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FILE_FORMAT", 10, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define SYS_TABLES_ROW_FORMAT 6
- {STRUCT_FLD(field_name, "ROW_FORMAT"),
- STRUCT_FLD(field_length, 12),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"ROW_FORMAT", 12, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define SYS_TABLES_ZIP_PAGE_SIZE 7
- {STRUCT_FLD(field_name, "ZIP_PAGE_SIZE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"ZIP_PAGE_SIZE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLES_SPACE_TYPE 8
- {STRUCT_FLD(field_name, "SPACE_TYPE"),
- STRUCT_FLD(field_length, 10),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"SPACE_TYPE", 10, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -6158,137 +5206,84 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tables =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_TABLES"),
+ "INNODB_SYS_TABLES",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_TABLES"),
+ "InnoDB SYS_TABLES",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_tables_init),
+ innodb_sys_tables_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_TABLESTATS ***********************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_TABLESTATS */
-static ST_FIELD_INFO innodb_sys_tablestats_fields_info[] =
+static ST_FIELD_INFO innodb_sys_tablestats_fields_info[]=
{
#define SYS_TABLESTATS_ID 0
- {STRUCT_FLD(field_name, "TABLE_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TABLE_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESTATS_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NAME", NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_TABLESTATS_INIT 2
- {STRUCT_FLD(field_name, "STATS_INITIALIZED"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"STATS_INITIALIZED", NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_TABLESTATS_NROW 3
- {STRUCT_FLD(field_name, "NUM_ROWS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NUM_ROWS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESTATS_CLUST_SIZE 4
- {STRUCT_FLD(field_name, "CLUST_INDEX_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"CLUST_INDEX_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESTATS_INDEX_SIZE 5
- {STRUCT_FLD(field_name, "OTHER_INDEX_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"OTHER_INDEX_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESTATS_MODIFIED 6
- {STRUCT_FLD(field_name, "MODIFIED_COUNTER"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"MODIFIED_COUNTER", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESTATS_AUTONINC 7
- {STRUCT_FLD(field_name, "AUTOINC"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"AUTOINC", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESTATS_TABLE_REF_COUNT 8
- {STRUCT_FLD(field_name, "REF_COUNT"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"REF_COUNT", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
+
+ END_OF_ST_FIELD_INFO
};
/** Populate information_schema.innodb_sys_tablestats table with information
@@ -6469,128 +5464,80 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablestats =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_TABLESTATS"),
+ "INNODB_SYS_TABLESTATS",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_TABLESTATS"),
+ "InnoDB SYS_TABLESTATS",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_tablestats_init),
+ innodb_sys_tablestats_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_INDEXES **************************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_INDEXES */
-static ST_FIELD_INFO innodb_sysindex_fields_info[] =
+static ST_FIELD_INFO innodb_sysindex_fields_info[]=
{
#define SYS_INDEX_ID 0
- {STRUCT_FLD(field_name, "INDEX_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"INDEX_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_INDEX_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NAME", NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_INDEX_TABLE_ID 2
- {STRUCT_FLD(field_name, "TABLE_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TABLE_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_INDEX_TYPE 3
- {STRUCT_FLD(field_name, "TYPE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TYPE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_INDEX_NUM_FIELDS 4
- {STRUCT_FLD(field_name, "N_FIELDS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"N_FIELDS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_INDEX_PAGE_NO 5
- {STRUCT_FLD(field_name, "PAGE_NO"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGE_NO", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_INDEX_SPACE 6
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SPACE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_INDEX_MERGE_THRESHOLD 7
- {STRUCT_FLD(field_name, "MERGE_THRESHOLD"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"MERGE_THRESHOLD", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -6740,110 +5687,74 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_indexes =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_INDEXES"),
+ "INNODB_SYS_INDEXES",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_INDEXES"),
+ "InnoDB SYS_INDEXES",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_indexes_init),
+ innodb_sys_indexes_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_COLUMNS **************************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_COLUMNS */
-static ST_FIELD_INFO innodb_sys_columns_fields_info[] =
+static ST_FIELD_INFO innodb_sys_columns_fields_info[]=
{
#define SYS_COLUMN_TABLE_ID 0
- {STRUCT_FLD(field_name, "TABLE_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TABLE_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_COLUMN_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NAME", NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_COLUMN_POSITION 2
- {STRUCT_FLD(field_name, "POS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"POS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_COLUMN_MTYPE 3
- {STRUCT_FLD(field_name, "MTYPE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"MTYPE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_COLUMN__PRTYPE 4
- {STRUCT_FLD(field_name, "PRTYPE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PRTYPE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_COLUMN_COLUMN_LEN 5
- {STRUCT_FLD(field_name, "LEN"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"LEN", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, 0, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -6986,83 +5897,65 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_columns =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_COLUMNS"),
+ "INNODB_SYS_COLUMNS",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_COLUMNS"),
+ "InnoDB SYS_COLUMNS",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_columns_init),
+ innodb_sys_columns_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_VIRTUAL **************************************************/
/** Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL */
-static ST_FIELD_INFO innodb_sys_virtual_fields_info[] =
+static ST_FIELD_INFO innodb_sys_virtual_fields_info[]=
{
#define SYS_VIRTUAL_TABLE_ID 0
- {STRUCT_FLD(field_name, "TABLE_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"TABLE_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_VIRTUAL_POS 1
- {STRUCT_FLD(field_name, "POS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"POS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_VIRTUAL_BASE_POS 2
- {STRUCT_FLD(field_name, "BASE_POS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"BASE_POS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/** Function to populate the information_schema.innodb_sys_virtual with
@@ -7194,82 +6087,64 @@ struct st_maria_plugin i_s_innodb_sys_virtual =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_VIRTUAL"),
+ "INNODB_SYS_VIRTUAL",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_VIRTUAL"),
+ "InnoDB SYS_VIRTUAL",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_virtual_init),
+ innodb_sys_virtual_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_FIELDS ***************************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_FIELDS */
-static ST_FIELD_INFO innodb_sys_fields_fields_info[] =
+static ST_FIELD_INFO innodb_sys_fields_fields_info[]=
{
#define SYS_FIELD_INDEX_ID 0
- {STRUCT_FLD(field_name, "INDEX_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"INDEX_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_FIELD_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NAME", NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_FIELD_POS 2
- {STRUCT_FLD(field_name, "POS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"POS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -7403,101 +6278,68 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_fields =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_FIELDS"),
+ "INNODB_SYS_FIELDS",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_FIELDS"),
+ "InnoDB SYS_FIELDS",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_fields_init),
+ innodb_sys_fields_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_FOREIGN ********************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_FOREIGN */
-static ST_FIELD_INFO innodb_sys_foreign_fields_info[] =
+static ST_FIELD_INFO innodb_sys_foreign_fields_info[]=
{
#define SYS_FOREIGN_ID 0
- {STRUCT_FLD(field_name, "ID"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"ID", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_FOREIGN_FOR_NAME 1
- {STRUCT_FLD(field_name, "FOR_NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FOR_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_FOREIGN_REF_NAME 2
- {STRUCT_FLD(field_name, "REF_NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"REF_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_FOREIGN_NUM_COL 3
- {STRUCT_FLD(field_name, "N_COLS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"N_COLS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_FOREIGN_TYPE 4
- {STRUCT_FLD(field_name, "TYPE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"TYPE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -7628,92 +6470,65 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_FOREIGN"),
+ "INNODB_SYS_FOREIGN",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_FOREIGN"),
+ "InnoDB SYS_FOREIGN",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_foreign_init),
+ innodb_sys_foreign_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_FOREIGN_COLS ********************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS */
-static ST_FIELD_INFO innodb_sys_foreign_cols_fields_info[] =
+static ST_FIELD_INFO innodb_sys_foreign_cols_fields_info[]=
{
#define SYS_FOREIGN_COL_ID 0
- {STRUCT_FLD(field_name, "ID"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"ID", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_FOREIGN_COL_FOR_NAME 1
- {STRUCT_FLD(field_name, "FOR_COL_NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FOR_COL_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_FOREIGN_COL_REF_NAME 2
- {STRUCT_FLD(field_name, "REF_COL_NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"REF_COL_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_FOREIGN_COL_POS 3
- {STRUCT_FLD(field_name, "POS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"POS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -7845,156 +6660,89 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign_cols =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_FOREIGN_COLS"),
+ "INNODB_SYS_FOREIGN_COLS",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_FOREIGN_COLS"),
+ "InnoDB SYS_FOREIGN_COLS",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_foreign_cols_init),
+ innodb_sys_foreign_cols_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_TABLESPACES ********************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES */
-static ST_FIELD_INFO innodb_sys_tablespaces_fields_info[] =
+static ST_FIELD_INFO innodb_sys_tablespaces_fields_info[]=
{
#define SYS_TABLESPACES_SPACE 0
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SPACE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, MAX_FULL_NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NAME", MAX_FULL_NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_FLAGS 2
- {STRUCT_FLD(field_name, "FLAG"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FLAG", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_FILE_FORMAT 3
- {STRUCT_FLD(field_name, "FILE_FORMAT"),
- STRUCT_FLD(field_length, 10),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FILE_FORMAT", 10, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_ROW_FORMAT 4
- {STRUCT_FLD(field_name, "ROW_FORMAT"),
- STRUCT_FLD(field_length, 22),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"ROW_FORMAT", 22, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_PAGE_SIZE 5
- {STRUCT_FLD(field_name, "PAGE_SIZE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"PAGE_SIZE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_ZIP_PAGE_SIZE 6
- {STRUCT_FLD(field_name, "ZIP_PAGE_SIZE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"ZIP_PAGE_SIZE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_SPACE_TYPE 7
- {STRUCT_FLD(field_name, "SPACE_TYPE"),
- STRUCT_FLD(field_length, 10),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SPACE_TYPE", 10, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_FS_BLOCK_SIZE 8
- {STRUCT_FLD(field_name, "FS_BLOCK_SIZE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FS_BLOCK_SIZE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_FILE_SIZE 9
- {STRUCT_FLD(field_name, "FILE_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"FILE_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_TABLESPACES_ALLOC_SIZE 10
- {STRUCT_FLD(field_name, "ALLOCATED_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
-
+ {"ALLOCATED_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -8214,74 +6962,61 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablespaces =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_TABLESPACES"),
+ "INNODB_SYS_TABLESPACES",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_TABLESPACES"),
+ "InnoDB SYS_TABLESPACES",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_tablespaces_init),
+ innodb_sys_tablespaces_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_DATAFILES ************************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_DATAFILES */
-static ST_FIELD_INFO innodb_sys_datafiles_fields_info[] =
+static ST_FIELD_INFO innodb_sys_datafiles_fields_info[]=
{
#define SYS_DATAFILES_SPACE 0
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SPACE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define SYS_DATAFILES_PATH 1
- {STRUCT_FLD(field_name, "PATH"),
- STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"PATH", OS_FILE_MAX_PATH, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -8403,146 +7138,88 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_datafiles =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_DATAFILES"),
+ "INNODB_SYS_DATAFILES",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_DATAFILES"),
+ "InnoDB SYS_DATAFILES",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_datafiles_init),
+ innodb_sys_datafiles_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** TABLESPACES_ENCRYPTION ********************************************/
/* Fields of the table INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION */
-static ST_FIELD_INFO innodb_tablespaces_encryption_fields_info[] =
+static ST_FIELD_INFO innodb_tablespaces_encryption_fields_info[]=
{
#define TABLESPACES_ENCRYPTION_SPACE 0
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SPACE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define TABLESPACES_ENCRYPTION_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, MAX_FULL_NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NAME", MAX_FULL_NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define TABLESPACES_ENCRYPTION_ENCRYPTION_SCHEME 2
- {STRUCT_FLD(field_name, "ENCRYPTION_SCHEME"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"ENCRYPTION_SCHEME", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define TABLESPACES_ENCRYPTION_KEYSERVER_REQUESTS 3
- {STRUCT_FLD(field_name, "KEYSERVER_REQUESTS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"KEYSERVER_REQUESTS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define TABLESPACES_ENCRYPTION_MIN_KEY_VERSION 4
- {STRUCT_FLD(field_name, "MIN_KEY_VERSION"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"MIN_KEY_VERSION", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define TABLESPACES_ENCRYPTION_CURRENT_KEY_VERSION 5
- {STRUCT_FLD(field_name, "CURRENT_KEY_VERSION"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"CURRENT_KEY_VERSION", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER 6
- {STRUCT_FLD(field_name, "KEY_ROTATION_PAGE_NUMBER"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"KEY_ROTATION_PAGE_NUMBER", MY_INT64_NUM_DECIMAL_DIGITS,
+ MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define TABLESPACES_ENCRYPTION_KEY_ROTATION_MAX_PAGE_NUMBER 7
- {STRUCT_FLD(field_name, "KEY_ROTATION_MAX_PAGE_NUMBER"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"KEY_ROTATION_MAX_PAGE_NUMBER", MY_INT64_NUM_DECIMAL_DIGITS,
+ MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define TABLESPACES_ENCRYPTION_CURRENT_KEY_ID 8
- {STRUCT_FLD(field_name, "CURRENT_KEY_ID"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"CURRENT_KEY_ID", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define TABLESPACES_ENCRYPTION_ROTATING_OR_FLUSHING 9
- {STRUCT_FLD(field_name, "ROTATING_OR_FLUSHING"),
- STRUCT_FLD(field_length, 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"ROTATING_OR_FLUSHING", 1, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -8677,128 +7354,83 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_tablespaces_encryption =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_TABLESPACES_ENCRYPTION"),
+ "INNODB_TABLESPACES_ENCRYPTION",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, "Google Inc"),
+ "Google Inc",
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB TABLESPACES_ENCRYPTION"),
+ "InnoDB TABLESPACES_ENCRYPTION",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_BSD),
+ PLUGIN_LICENSE_BSD,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_tablespaces_encryption_init),
+ innodb_tablespaces_encryption_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE
};
/** TABLESPACES_SCRUBBING ********************************************/
/* Fields of the table INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING */
-static ST_FIELD_INFO innodb_tablespaces_scrubbing_fields_info[] =
+static ST_FIELD_INFO innodb_tablespaces_scrubbing_fields_info[]=
{
#define TABLESPACES_SCRUBBING_SPACE 0
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"SPACE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define TABLESPACES_SCRUBBING_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, MAX_FULL_NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"NAME", MAX_FULL_NAME_LEN + 1, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define TABLESPACES_SCRUBBING_COMPRESSED 2
- {STRUCT_FLD(field_name, "COMPRESSED"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"COMPRESSED", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define TABLESPACES_SCRUBBING_LAST_SCRUB_COMPLETED 3
- {STRUCT_FLD(field_name, "LAST_SCRUB_COMPLETED"),
- STRUCT_FLD(field_length, 0),
- STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"LAST_SCRUB_COMPLETED", 0, MYSQL_TYPE_DATETIME,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define TABLESPACES_SCRUBBING_CURRENT_SCRUB_STARTED 4
- {STRUCT_FLD(field_name, "CURRENT_SCRUB_STARTED"),
- STRUCT_FLD(field_length, 0),
- STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"CURRENT_SCRUB_STARTED", 0, MYSQL_TYPE_DATETIME,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define TABLESPACES_SCRUBBING_CURRENT_SCRUB_ACTIVE_THREADS 5
- {STRUCT_FLD(field_name, "CURRENT_SCRUB_ACTIVE_THREADS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"CURRENT_SCRUB_ACTIVE_THREADS", MY_INT32_NUM_DECIMAL_DIGITS,
+ MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
#define TABLESPACES_SCRUBBING_CURRENT_SCRUB_PAGE_NUMBER 6
- {STRUCT_FLD(field_name, "CURRENT_SCRUB_PAGE_NUMBER"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
+ {"CURRENT_SCRUB_PAGE_NUMBER", MY_INT64_NUM_DECIMAL_DIGITS,
+ MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define TABLESPACES_SCRUBBING_CURRENT_SCRUB_MAX_PAGE_NUMBER 7
- {STRUCT_FLD(field_name, "CURRENT_SCRUB_MAX_PAGE_NUMBER"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"CURRENT_SCRUB_MAX_PAGE_NUMBER", MY_INT64_NUM_DECIMAL_DIGITS,
+ MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/**********************************************************************//**
@@ -8939,89 +7571,67 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_tablespaces_scrubbing =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_TABLESPACES_SCRUBBING"),
+ "INNODB_TABLESPACES_SCRUBBING",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, "Google Inc"),
+ "Google Inc",
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB TABLESPACES_SCRUBBING"),
+ "InnoDB TABLESPACES_SCRUBBING",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_BSD),
+ PLUGIN_LICENSE_BSD,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_tablespaces_scrubbing_init),
+ innodb_tablespaces_scrubbing_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE
};
/** INNODB_MUTEXES *********************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_MUTEXES */
-static ST_FIELD_INFO innodb_mutexes_fields_info[] =
+static ST_FIELD_INFO innodb_mutexes_fields_info[]=
{
#define MUTEXES_NAME 0
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"NAME", OS_FILE_MAX_PATH, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE},
#define MUTEXES_CREATE_FILE 1
- {STRUCT_FLD(field_name, "CREATE_FILE"),
- STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"CREATE_FILE", OS_FILE_MAX_PATH, MYSQL_TYPE_STRING,
+ 0, 0, "", SKIP_OPEN_TABLE},
#define MUTEXES_CREATE_LINE 2
- {STRUCT_FLD(field_name, "CREATE_LINE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+ {"CREATE_LINE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
#define MUTEXES_OS_WAITS 3
- {STRUCT_FLD(field_name, "OS_WAITS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+ {"OS_WAITS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
/*******************************************************************//**
@@ -9183,258 +7793,103 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_mutexes =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_MUTEXES"),
+ "INNODB_MUTEXES",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, plugin_author),
+ plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_DATAFILES"),
+ "InnoDB SYS_DATAFILES",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_mutexes_init),
+ innodb_mutexes_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
/** SYS_SEMAPHORE_WAITS ************************************************/
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS */
-static ST_FIELD_INFO innodb_sys_semaphore_waits_fields_info[] =
-{
- // SYS_SEMAPHORE_WAITS_THREAD_ID 0
- {STRUCT_FLD(field_name, "THREAD_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_OBJECT_NAME 1
- {STRUCT_FLD(field_name, "OBJECT_NAME"),
- STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_FILE 2
- {STRUCT_FLD(field_name, "FILE"),
- STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_LINE 3
- {STRUCT_FLD(field_name, "LINE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_WAIT_TIME 4
- {STRUCT_FLD(field_name, "WAIT_TIME"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_WAIT_OBJECT 5
- {STRUCT_FLD(field_name, "WAIT_OBJECT"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_WAIT_TYPE 6
- {STRUCT_FLD(field_name, "WAIT_TYPE"),
- STRUCT_FLD(field_length, 16),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_HOLDER_THREAD_ID 7
- {STRUCT_FLD(field_name, "HOLDER_THREAD_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_HOLDER_FILE 8
- {STRUCT_FLD(field_name, "HOLDER_FILE"),
- STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_HOLDER_LINE 9
- {STRUCT_FLD(field_name, "HOLDER_LINE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_CREATED_FILE 10
- {STRUCT_FLD(field_name, "CREATED_FILE"),
- STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_CREATED_LINE 11
- {STRUCT_FLD(field_name, "CREATED_LINE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_WRITER_THREAD 12
- {STRUCT_FLD(field_name, "WRITER_THREAD"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_RESERVATION_MODE 13
- {STRUCT_FLD(field_name, "RESERVATION_MODE"),
- STRUCT_FLD(field_length, 16),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_READERS 14
- {STRUCT_FLD(field_name, "READERS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_WAITERS_FLAG 15
- {STRUCT_FLD(field_name, "WAITERS_FLAG"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_LOCK_WORD 16
- {STRUCT_FLD(field_name, "LOCK_WORD"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_LAST_READER_FILE 17
- {STRUCT_FLD(field_name, "LAST_READER_FILE"),
- STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_LAST_READER_LINE 18
- {STRUCT_FLD(field_name, "LAST_READER_LINE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_LAST_WRITER_FILE 19
- {STRUCT_FLD(field_name, "LAST_WRITER_FILE"),
- STRUCT_FLD(field_length, OS_FILE_MAX_PATH),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE 20
- {STRUCT_FLD(field_name, "LAST_WRITER_LINE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- // SYS_SEMAPHORE_WAITS_OS_WAIT_COUNT 21
- {STRUCT_FLD(field_name, "OS_WAIT_COUNT"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
+static ST_FIELD_INFO innodb_sys_semaphore_waits_fields_info[]=
+{
+ {"THREAD_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"OBJECT_NAME", OS_FILE_MAX_PATH, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+ {"FILE", OS_FILE_MAX_PATH, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+ {"LINE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"WAIT_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"WAIT_OBJECT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"WAIT_TYPE", 16, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+ {"HOLDER_THREAD_ID", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"HOLDER_FILE", OS_FILE_MAX_PATH, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+ {"HOLDER_LINE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"CREATED_FILE", OS_FILE_MAX_PATH, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+ {"CREATED_LINE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"WRITER_THREAD", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"RESERVATION_MODE", 16, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+ {"READERS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"WAITERS_FLAG", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"LOCK_WORD", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"LAST_READER_FILE", OS_FILE_MAX_PATH, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+ {"LAST_READER_LINE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"LAST_WRITER_FILE", OS_FILE_MAX_PATH, MYSQL_TYPE_STRING,
+ 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE},
+ {"LAST_WRITER_LINE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ {"OS_WAIT_COUNT", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG,
+ 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE},
+ END_OF_ST_FIELD_INFO
};
-
/*******************************************************************//**
Bind the dynamic table INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS
@return 0 on success */
@@ -9460,47 +7915,47 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_semaphore_waits =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
/* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
/* pointer to type-specific plugin descriptor */
/* void* */
- STRUCT_FLD(info, &i_s_info),
+ &i_s_info,
/* plugin name */
/* const char* */
- STRUCT_FLD(name, "INNODB_SYS_SEMAPHORE_WAITS"),
+ "INNODB_SYS_SEMAPHORE_WAITS",
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, maria_plugin_author),
+ maria_plugin_author,
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_SEMAPHORE_WAITS"),
+ "InnoDB SYS_SEMAPHORE_WAITS",
/* the plugin license (PLUGIN_LICENSE_XXX) */
/* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ PLUGIN_LICENSE_GPL,
/* the function to invoke when plugin is loaded */
/* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_semaphore_waits_init),
+ innodb_sys_semaphore_waits_init,
/* the function to invoke when plugin is unloaded */
/* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
+ i_s_common_deinit,
/* plugin version (for SHOW PLUGINS) */
/* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
+ INNODB_VERSION_SHORT,
/* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
+ NULL,
/* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
+ NULL,
/* Maria extension */
- STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE),
+ INNODB_VERSION_STR,
+ MariaDB_PLUGIN_MATURITY_STABLE,
};
diff --git a/storage/innobase/handler/i_s.h b/storage/innobase/handler/i_s.h
index ed4165bdeeb..e83a0df332f 100644
--- a/storage/innobase/handler/i_s.h
+++ b/storage/innobase/handler/i_s.h
@@ -92,26 +92,9 @@ do { \
} \
} while (0)
-#if !defined __STRICT_ANSI__ && defined __GNUC__ && (__GNUC__) > 2 && !defined __INTEL_COMPILER && !defined __clang__
-#ifdef HAVE_C99_INITIALIZERS
-#define STRUCT_FLD(name, value) .name = value
-#else
-#define STRUCT_FLD(name, value) name: value
-#endif /* HAVE_C99_INITIALIZERS */
-#else
-#define STRUCT_FLD(name, value) value
-#endif
-
/* Don't use a static const variable here, as some C++ compilers (notably
HPUX aCC: HP ANSI C++ B3910B A.03.65) can't handle it. */
-#define END_OF_ST_FIELD_INFO \
- {STRUCT_FLD(field_name, NULL), \
- STRUCT_FLD(field_length, 0), \
- STRUCT_FLD(field_type, MYSQL_TYPE_NULL), \
- STRUCT_FLD(value, 0), \
- STRUCT_FLD(field_flags, 0), \
- STRUCT_FLD(old_name, ""), \
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)}
+#define END_OF_ST_FIELD_INFO {NULL,0,MYSQL_TYPE_NULL,0,0,"",SKIP_OPEN_TABLE}
/** Fields on INFORMATION_SCHEMA.SYS_SEMAMPHORE_WAITS table */
#define SYS_SEMAPHORE_WAITS_THREAD_ID 0
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h
index 29ece955702..04f2cd0f160 100644
--- a/storage/innobase/include/btr0btr.h
+++ b/storage/innobase/include/btr0btr.h
@@ -731,7 +731,7 @@ btr_validate_index(
/*************************************************************//**
Removes a page from the level list of pages. */
UNIV_INTERN
-void
+MY_ATTRIBUTE((warn_unused_result)) dberr_t
btr_level_list_remove_func(
/*=======================*/
ulint space, /*!< in: space where removed */
diff --git a/storage/innobase/include/btr0bulk.h b/storage/innobase/include/btr0bulk.h
index 854414d504d..911a2726422 100644
--- a/storage/innobase/include/btr0bulk.h
+++ b/storage/innobase/include/btr0bulk.h
@@ -326,6 +326,8 @@ public:
/** Re-latch all latches */
void latch();
+ table_name_t table_name() { return m_index->table->name; }
+
private:
/** Insert a tuple to a page in a level
@param[in] tuple tuple to insert
diff --git a/storage/innobase/include/btr0scrub.h b/storage/innobase/include/btr0scrub.h
index feaf61784d0..0f17467fb70 100644
--- a/storage/innobase/include/btr0scrub.h
+++ b/storage/innobase/include/btr0scrub.h
@@ -141,12 +141,7 @@ btr_scrub_skip_page(
/****************************************************************
Start iterating a space
* @return true if scrubbing is turned on */
-UNIV_INTERN
-bool
-btr_scrub_start_space(
-/*===================*/
- ulint space, /*!< in: space */
- btr_scrub_t* scrub_data); /*!< in/out: scrub data */
+bool btr_scrub_start_space(const fil_space_t &space, btr_scrub_t *scrub_data);
/** Complete iterating a space.
@param[in,out] scrub_data scrub data */
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index 40d2e6b2023..468e6be4def 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2020, MariaDB Corporation.
+Copyright (c) 1995, 2021, Oracle and/or its affiliates.
+Copyright (c) 2013, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -2037,8 +2037,6 @@ struct buf_pool_t{
page_hash mutex. Lookups can happen
while holding the buf_pool->mutex or
the relevant page_hash mutex. */
- hash_table_t* page_hash_old; /*!< old pointer to page_hash to be
- freed after resizing buffer pool */
hash_table_t* zip_hash; /*!< hash table of buf_block_t blocks
whose frames are allocated to the
zip buddy system,
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index a4defe4d92a..5fc0e3ebe15 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -2,7 +2,7 @@
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2020, MariaDB Corporation.
+Copyright (c) 2013, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -671,6 +671,35 @@ struct dict_v_col_t{
};
+/** Data structure for newly added virtual column in a index.
+It is used only during rollback_inplace_alter_table() of
+addition of index depending on newly added virtual columns
+and uses index heap. Should be freed when index is being
+removed from cache. */
+struct dict_add_v_col_info
+{
+ ulint n_v_col;
+ dict_v_col_t *v_col;
+
+ /** Add the newly added virtual column while rollbacking
+ the index which contains new virtual columns
+ @param col virtual column to be duplicated
+ @param offset offset where to duplicate virtual column */
+ dict_v_col_t* add_drop_v_col(mem_heap_t *heap, dict_v_col_t *col,
+ ulint offset)
+ {
+ ut_ad(n_v_col);
+ ut_ad(offset < n_v_col);
+ if (!v_col)
+ v_col= static_cast<dict_v_col_t*>
+ (mem_heap_alloc(heap, n_v_col * sizeof *v_col));
+ new (&v_col[offset]) dict_v_col_t();
+ v_col[offset].m_col= col->m_col;
+ v_col[offset].v_pos= col->v_pos;
+ return &v_col[offset];
+ }
+};
+
/** Data structure for newly added virtual column in a table */
struct dict_add_v_col_t{
/** number of new virtual column */
@@ -892,9 +921,13 @@ struct dict_index_t{
dict_field_t* fields; /*!< array of field descriptions */
st_mysql_ftparser*
parser; /*!< fulltext parser plugin */
- bool has_new_v_col;
- /*!< whether it has a newly added virtual
- column in ALTER */
+
+ /** It just indicates whether newly added virtual column
+ during alter. It stores column in case of alter failure.
+ It should use heap from dict_index_t. It should be freed
+ while removing the index from table. */
+ dict_add_v_col_info* new_vcol_info;
+
bool index_fts_syncing;/*!< Whether the fts index is
still syncing in the background;
FIXME: remove this and use MDL */
@@ -1003,6 +1036,21 @@ struct dict_index_t{
return DICT_CLUSTERED == (type & (DICT_CLUSTERED | DICT_IBUF));
}
+ /** @return whether this is a generated clustered index */
+ bool is_gen_clust() const { return type == DICT_CLUSTERED; }
+
+ /** @return whether this is a clustered index */
+ bool is_clust() const { return type & DICT_CLUSTERED; }
+
+ /** @return whether this is a unique index */
+ bool is_unique() const { return type & DICT_UNIQUE; }
+
+ /** @return whether this is a spatial index */
+ bool is_spatial() const { return UNIV_UNLIKELY(type & DICT_SPATIAL); }
+
+ /** @return whether this is the change buffer */
+ bool is_ibuf() const { return UNIV_UNLIKELY(type & DICT_IBUF); }
+
/** @return whether the index includes virtual columns */
bool has_virtual() const { return type & DICT_VIRTUAL; }
@@ -1028,9 +1076,8 @@ struct dict_index_t{
/** @return whether the index is corrupted */
inline bool is_corrupted() const;
- /** Detach the virtual columns from the index that is to be removed.
- @param whether to reset fields[].col */
- void detach_columns(bool clear= false)
+ /** Detach the virtual columns from the index that is to be removed. */
+ void detach_columns()
{
if (!has_virtual())
return;
@@ -1040,13 +1087,32 @@ struct dict_index_t{
if (!col || !col->is_virtual())
continue;
col->detach(*this);
- if (clear)
- fields[i].col= NULL;
}
}
- /** @return whether this is the change buffer */
- bool is_ibuf() const { return UNIV_UNLIKELY(type & DICT_IBUF); }
+ /** Assign the number of new column to be added as a part
+ of the index
+ @param n_vcol number of virtual columns to be added */
+ void assign_new_v_col(ulint n_vcol)
+ {
+ new_vcol_info= static_cast<dict_add_v_col_info*>(
+ mem_heap_zalloc(heap, sizeof *new_vcol_info));
+ new_vcol_info->n_v_col= n_vcol;
+ }
+
+ /* @return whether index has new virtual column */
+ bool has_new_v_col() const
+ {
+ return new_vcol_info != NULL;
+ }
+
+ /* @return number of newly added virtual column */
+ ulint get_new_n_vcol() const
+ {
+ if (new_vcol_info)
+ return new_vcol_info->n_v_col;
+ return 0;
+ }
#ifdef BTR_CUR_HASH_ADAPT
/** @return a clone of this */
@@ -1647,7 +1713,8 @@ struct dict_table_t {
UT_LIST_BASE_NODE_T(dict_index_t) indexes;
#ifdef BTR_CUR_HASH_ADAPT
/** List of detached indexes that are waiting to be freed along with
- the last adaptive hash index entry */
+ the last adaptive hash index entry.
+ Protected by autoinc_mutex (sic!) */
UT_LIST_BASE_NODE_T(dict_index_t) freed_indexes;
#endif /* BTR_CUR_HASH_ADAPT */
@@ -1814,7 +1881,7 @@ struct dict_table_t {
from a select. */
lock_t* autoinc_lock;
- /** Mutex protecting the autoincrement counter. */
+ /** Mutex protecting the autoinc counter and freed_indexes. */
mysql_mutex_t autoinc_mutex;
/** Autoinc counter value to give to the next inserted row. */
@@ -1846,7 +1913,6 @@ struct dict_table_t {
determine whether we can evict the table from the dictionary cache.
It is protected by lock_sys->mutex. */
ulint n_rec_locks;
-
private:
/** Count of how many handles are opened to this table. Dropping of the
table is NOT allowed until this count gets to zero. MySQL does NOT
@@ -1870,6 +1936,22 @@ public:
/** mysql_row_templ_t for base columns used for compute the virtual
columns */
dict_vcol_templ_t* vc_templ;
+
+ /* @return whether the table has any other transcation lock
+ other than the given transaction */
+ bool has_lock_other_than(const trx_t *trx) const
+ {
+ for (lock_t *lock= UT_LIST_GET_FIRST(locks); lock;
+ lock= UT_LIST_GET_NEXT(un_member.tab_lock.locks, lock))
+ if (lock->trx != trx)
+ return true;
+ return false;
+ }
+
+ /** Check whether the table name is same as mysql/innodb_stats_table
+ or mysql/innodb_index_stats.
+ @return true if the table name is same as stats table */
+ bool is_stats_table() const;
};
inline bool table_name_t::is_temporary() const
diff --git a/storage/innobase/include/fil0crypt.h b/storage/innobase/include/fil0crypt.h
index 3c56315ee9a..af6c930659b 100644
--- a/storage/innobase/include/fil0crypt.h
+++ b/storage/innobase/include/fil0crypt.h
@@ -499,4 +499,10 @@ bool
fil_space_verify_crypt_checksum(const byte* page, const page_size_t& page_size)
MY_ATTRIBUTE((warn_unused_result));
+/** Add the tablespace to the rotation list if
+innodb_encrypt_rotate_key_age is 0 or encryption plugin does
+not do key version rotation
+@return whether the tablespace should be added to rotation list */
+bool fil_crypt_must_default_encrypt();
+
#endif /* fil0crypt_h */
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 65457b414ca..7ce89f3be60 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -177,7 +177,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
bool is_in_unflushed_spaces;
/** Checks that this tablespace needs key rotation. */
- bool is_in_rotation_list;
+ bool is_in_default_encrypt;
/** True if the device this filespace is on supports atomic writes */
bool atomic_write_supported;
@@ -541,9 +541,9 @@ struct fil_system_t {
record has been written since
the latest redo log checkpoint.
Protected only by log_sys->mutex. */
- ilist<fil_space_t, rotation_list_tag_t> rotation_list;
- /*!< list of all file spaces needing
- key rotation.*/
+
+ /** List of all file spaces need key rotation */
+ ilist<fil_space_t, rotation_list_tag_t> default_encrypt_tables;
bool space_id_reuse_warned;
/* !< TRUE if fil_space_create()
@@ -556,15 +556,15 @@ struct fil_system_t {
@retval NULL if the tablespace does not exist or cannot be read */
fil_space_t* read_page0(ulint id);
- /** Return the next tablespace from rotation_list.
+ /** Return the next tablespace from default_encrypt_tables list.
@param space previous tablespace (NULL to start from the start)
@param recheck whether the removal condition needs to be rechecked after
the encryption parameters were changed
@param encrypt expected state of innodb_encrypt_tables
@return the next tablespace to process (n_pending_ops incremented)
@retval NULL if this was the last */
- inline fil_space_t* keyrotate_next(fil_space_t *space, bool recheck,
- bool encrypt);
+ inline fil_space_t* default_encrypt_next(
+ fil_space_t *space, bool recheck, bool encrypt);
};
/** The tablespace memory cache. This variable is NULL before the module is
diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h
index 84d8ccd26ef..dfac5117c17 100644
--- a/storage/innobase/include/fts0fts.h
+++ b/storage/innobase/include/fts0fts.h
@@ -96,10 +96,6 @@ those defined in mysql file ft_global.h */
/** Threshold where our optimize thread automatically kicks in */
#define FTS_OPTIMIZE_THRESHOLD 10000000
-/** Threshold to avoid exhausting of doc ids. Consecutive doc id difference
-should not exceed FTS_DOC_ID_MAX_STEP */
-#define FTS_DOC_ID_MAX_STEP 65535
-
/** Maximum possible Fulltext word length in bytes (assuming mbmaxlen=4) */
#define FTS_MAX_WORD_LEN (HA_FT_MAXCHARLEN * 4)
diff --git a/storage/innobase/include/fts0types.h b/storage/innobase/include/fts0types.h
index f5760a16c0e..d49bc7c0254 100644
--- a/storage/innobase/include/fts0types.h
+++ b/storage/innobase/include/fts0types.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -150,6 +150,9 @@ struct fts_cache_t {
size_t total_size; /*!< total size consumed by the ilist
field of all nodes. SYNC is run
whenever this gets too big */
+ /** total_size at the time of the previous SYNC request */
+ size_t total_size_at_sync;
+
fts_sync_t* sync; /*!< sync structure to sync data to
disk */
ib_alloc_t* sync_heap; /*!< The heap allocator, for indexes
@@ -315,16 +318,6 @@ int fts_doc_id_cmp(
const void* p2); /*!< in: id2 */
/******************************************************************//**
-Decode and return the integer that was encoded using our VLC scheme.*/
-UNIV_INLINE
-ulint
-fts_decode_vlc(
-/*===========*/
- /*!< out: value decoded */
- byte** ptr); /*!< in: ptr to decode from, this ptr is
- incremented by the number of bytes decoded */
-
-/******************************************************************//**
Duplicate a string. */
UNIV_INLINE
void
@@ -339,28 +332,6 @@ fts_string_dup(
mem_heap_t* heap); /*!< in: heap to use */
/******************************************************************//**
-Return length of val if it were encoded using our VLC scheme. */
-UNIV_INLINE
-ulint
-fts_get_encoded_len(
-/*================*/
- /*!< out: length of value
- encoded, in bytes */
- ulint val); /*!< in: value to encode */
-
-/******************************************************************//**
-Encode an integer using our VLC scheme and return the length in bytes. */
-UNIV_INLINE
-ulint
-fts_encode_int(
-/*===========*/
- /*!< out: length of value
- encoded, in bytes */
- ulint val, /*!< in: value to encode */
- byte* buf); /*!< in: buffer, must have
- enough space */
-
-/******************************************************************//**
Get the selected FTS aux INDEX suffix. */
UNIV_INLINE
const char*
@@ -381,6 +352,5 @@ fts_select_index(
ulint len);
#include "fts0types.ic"
-#include "fts0vlc.ic"
#endif /* INNOBASE_FTS0TYPES_H */
diff --git a/storage/innobase/include/fts0vlc.h b/storage/innobase/include/fts0vlc.h
new file mode 100644
index 00000000000..d6e6037777e
--- /dev/null
+++ b/storage/innobase/include/fts0vlc.h
@@ -0,0 +1,124 @@
+/**
+
+Copyright (c) 2021, MariaDB Corporation.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+**/
+/**
+@file include/fts0vlc.h
+Full text variable length integer encoding/decoding.
+
+Created 2021-10-19 Thirunarayanan Balathandayuthapani
+**/
+
+/** Return length of val if it were encoded using our VLC scheme.
+@param val value to encode
+@return length of value encoded, in bytes */
+inline size_t fts_get_encoded_len(doc_id_t val)
+{
+ if (val < static_cast<doc_id_t>(1) << 7)
+ return 1;
+ if (val < static_cast<doc_id_t>(1) << 14)
+ return 2;
+ if (val < static_cast<doc_id_t>(1) << 21)
+ return 3;
+ if (val < static_cast<doc_id_t>(1) << 28)
+ return 4;
+ if (val < static_cast<doc_id_t>(1) << 35)
+ return 5;
+ if (val < static_cast<doc_id_t>(1) << 42)
+ return 6;
+ if (val < static_cast<doc_id_t>(1) << 49)
+ return 7;
+ if (val < static_cast<doc_id_t>(1) << 56)
+ return 8;
+ if (val < static_cast<doc_id_t>(1) << 63)
+ return 9;
+ return 10;
+}
+
+/** Encode an integer using our VLC scheme and return the
+length in bytes.
+@param val value to encode
+@param buf buffer, must have enough space
+@return length of value encoded, in bytes */
+inline byte *fts_encode_int(doc_id_t val, byte *buf)
+{
+ if (val < static_cast<doc_id_t>(1) << 7)
+ goto add_1;
+ if (val < static_cast<doc_id_t>(1) << 14)
+ goto add_2;
+ if (val < static_cast<doc_id_t>(1) << 21)
+ goto add_3;
+ if (val < static_cast<doc_id_t>(1) << 28)
+ goto add_4;
+ if (val < static_cast<doc_id_t>(1) << 35)
+ goto add_5;
+ if (val < static_cast<doc_id_t>(1) << 42)
+ goto add_6;
+ if (val < static_cast<doc_id_t>(1) << 49)
+ goto add_7;
+ if (val < static_cast<doc_id_t>(1) << 56)
+ goto add_8;
+ if (val < static_cast<doc_id_t>(1) << 63)
+ goto add_9;
+
+ *buf++= static_cast<byte>(val >> 63);
+add_9:
+ *buf++= static_cast<byte>(val >> 56) & 0x7F;
+add_8:
+ *buf++= static_cast<byte>(val >> 49) & 0x7F;
+add_7:
+ *buf++= static_cast<byte>(val >> 42) & 0x7F;
+add_6:
+ *buf++= static_cast<byte>(val >> 35) & 0x7F;
+add_5:
+ *buf++= static_cast<byte>(val >> 28) & 0x7F;
+add_4:
+ *buf++= static_cast<byte>(val >> 21) & 0x7F;
+add_3:
+ *buf++= static_cast<byte>(val >> 14) & 0x7F;
+add_2:
+ *buf++= static_cast<byte>(val >> 7) & 0x7F;
+add_1:
+ *buf++= static_cast<byte>(val) | 0x80;
+ return buf;
+}
+
+/** Decode and return the integer that was encoded using
+our VLC scheme.
+@param ptr pointer to decode from, this ptr is
+ incremented by the number of bytes decoded
+@return value decoded */
+inline doc_id_t fts_decode_vlc(const byte **ptr)
+{
+ ut_d(const byte *const start= *ptr);
+ ut_ad(*start);
+
+ doc_id_t val= 0;
+ for (;;)
+ {
+ byte b= *(*ptr)++;
+ val|= (b & 0x7F);
+
+ /* High-bit on means "last byte in the encoded integer". */
+ if (b & 0x80)
+ break;
+ ut_ad(val < static_cast<doc_id_t>(1) << (64 - 7));
+ val <<= 7;
+ }
+
+ ut_ad(*ptr - start <= 10);
+
+ return(val);
+}
diff --git a/storage/innobase/include/fts0vlc.ic b/storage/innobase/include/fts0vlc.ic
deleted file mode 100644
index 75d8535057e..00000000000
--- a/storage/innobase/include/fts0vlc.ic
+++ /dev/null
@@ -1,142 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
-
-*****************************************************************************/
-
-/******************************************************************//**
-@file include/fts0vlc.ic
-Full text variable length integer encoding/decoding.
-
-Created 2007-03-27 Sunny Bains
-*******************************************************/
-
-#ifndef INNOBASE_FTS0VLC_IC
-#define INNOBASE_FTS0VLC_IC
-
-#include "fts0types.h"
-
-/******************************************************************//**
-Return length of val if it were encoded using our VLC scheme.
-FIXME: We will need to be able encode 8 bytes value
-@return length of value encoded, in bytes */
-UNIV_INLINE
-ulint
-fts_get_encoded_len(
-/*================*/
- ulint val) /* in: value to encode */
-{
- if (val <= 127) {
- return(1);
- } else if (val <= 16383) {
- return(2);
- } else if (val <= 2097151) {
- return(3);
- } else if (val <= 268435455) {
- return(4);
- } else {
- /* Possibly we should care that on 64-bit machines ulint can
- contain values that we can't encode in 5 bytes, but
- fts_encode_int doesn't handle them either so it doesn't much
- matter. */
-
- return(5);
- }
-}
-
-/******************************************************************//**
-Encode an integer using our VLC scheme and return the length in bytes.
-@return length of value encoded, in bytes */
-UNIV_INLINE
-ulint
-fts_encode_int(
-/*===========*/
- ulint val, /* in: value to encode */
- byte* buf) /* in: buffer, must have enough space */
-{
- ulint len;
-
- if (val <= 127) {
- *buf = (byte) val;
-
- len = 1;
- } else if (val <= 16383) {
- *buf++ = (byte)(val >> 7);
- *buf = (byte)(val & 0x7F);
-
- len = 2;
- } else if (val <= 2097151) {
- *buf++ = (byte)(val >> 14);
- *buf++ = (byte)((val >> 7) & 0x7F);
- *buf = (byte)(val & 0x7F);
-
- len = 3;
- } else if (val <= 268435455) {
- *buf++ = (byte)(val >> 21);
- *buf++ = (byte)((val >> 14) & 0x7F);
- *buf++ = (byte)((val >> 7) & 0x7F);
- *buf = (byte)(val & 0x7F);
-
- len = 4;
- } else {
- /* Best to keep the limitations of the 32/64 bit versions
- identical, at least for the time being. */
- ut_ad(val <= 4294967295u);
-
- *buf++ = (byte)(val >> 28);
- *buf++ = (byte)((val >> 21) & 0x7F);
- *buf++ = (byte)((val >> 14) & 0x7F);
- *buf++ = (byte)((val >> 7) & 0x7F);
- *buf = (byte)(val & 0x7F);
-
- len = 5;
- }
-
- /* High-bit on means "last byte in the encoded integer". */
- *buf |= 0x80;
-
- return(len);
-}
-
-/******************************************************************//**
-Decode and return the integer that was encoded using our VLC scheme.
-@return value decoded */
-UNIV_INLINE
-ulint
-fts_decode_vlc(
-/*===========*/
- byte** ptr) /* in: ptr to decode from, this ptr is
- incremented by the number of bytes decoded */
-{
- ulint val = 0;
-
- for (;;) {
- byte b = **ptr;
-
- ++*ptr;
- val |= (b & 0x7F);
-
- /* High-bit on means "last byte in the encoded integer". */
- if (b & 0x80) {
- break;
- } else {
- val <<= 7;
- }
- }
-
- return(val);
-}
-
-#endif
diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h
index 612a27976e7..c0b92fb7497 100644
--- a/storage/innobase/include/log0log.h
+++ b/storage/innobase/include/log0log.h
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2009, Google Inc.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -189,9 +189,15 @@ log_write_up_to(
/** write to the log file up to the last log entry.
@param[in] sync whether we want the written log
also to be flushed to disk. */
-void
-log_buffer_flush_to_disk(
- bool sync = true);
+void log_buffer_flush_to_disk(bool sync= true);
+
+
+/** Prepare to invoke log_write_and_flush(), before acquiring log_sys.mutex. */
+#define log_write_and_flush_prepare() log_write_mutex_enter()
+
+/** Durably write the log up to log_sys.lsn and release log_sys.mutex. */
+ATTRIBUTE_COLD void log_write_and_flush();
+
/****************************************************************//**
This functions writes the log buffer to the log file and if 'flush'
is set it forces a flush of the log file as well. This is meant to be
diff --git a/storage/innobase/include/mach0data.h b/storage/innobase/include/mach0data.h
index 8141c8a91e0..860ef20b8bd 100644
--- a/storage/innobase/include/mach0data.h
+++ b/storage/innobase/include/mach0data.h
@@ -316,6 +316,28 @@ mach_read_from_n_little_endian(
const byte* buf, /*!< in: from where to read */
ulint buf_size) /*!< in: from how many bytes to read */
MY_ATTRIBUTE((warn_unused_result));
+
+
+/** Reads a 64 bit stored in big endian format
+@param buf From where to read
+@return uint64_t */
+UNIV_INLINE
+uint64_t
+mach_read_uint64_little_endian(const byte* buf)
+{
+#ifdef WORDS_BIGENDIAN
+ return
+ uint64_t(buf[0]) | uint64_t(buf[1]) << 8 |
+ uint64_t(buf[2]) << 16 | uint64_t(buf[3]) << 24 |
+ uint64_t(buf[4]) << 32 | uint64_t(buf[5]) << 40 |
+ uint64_t(buf[6]) << 48 | uint64_t(buf[7]) << 56;
+#else
+ uint64_t n;
+ memcpy(&n, buf, sizeof(uint64_t));
+ return n;
+#endif
+}
+
/*********************************************************//**
Writes a ulint in the little-endian format. */
UNIV_INLINE
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h
index b57a38f8eab..6d729beab12 100644
--- a/storage/innobase/include/mtr0mtr.h
+++ b/storage/innobase/include/mtr0mtr.h
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2020, MariaDB Corporation.
+Copyright (c) 2013, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -161,6 +161,10 @@ struct mtr_t {
/** Commit the mini-transaction. */
void commit();
+ /** Commit a mini-transaction that is shrinking a tablespace.
+ @param space tablespace that is being shrunk */
+ ATTRIBUTE_COLD void commit_shrink(fil_space_t &space);
+
/** Commit a mini-transaction that did not modify any pages,
but generated some redo log on a higher level, such as
MLOG_FILE_NAME records and a MLOG_CHECKPOINT marker.
diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic
index a45d088d5d7..24477689db8 100644
--- a/storage/innobase/include/mtr0mtr.ic
+++ b/storage/innobase/include/mtr0mtr.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -53,8 +53,8 @@ mtr_t::memo_push(void* object, mtr_memo_type_t type)
/* If this mtr has x-fixed a clean page then we set
the made_dirty flag. This tells us if we need to
- grab log_flush_order_mutex at mtr_commit so that we
- can insert the dirtied page to the flush list. */
+ grab log_sys.flush_order_mutex at mtr_t::commit() so that we
+ can insert the dirtied page into the flush list. */
if ((type == MTR_MEMO_PAGE_X_FIX || type == MTR_MEMO_PAGE_SX_FIX)
&& !m_made_dirty) {
diff --git a/storage/innobase/include/pars0pars.h b/storage/innobase/include/pars0pars.h
index f54c50e5b85..626ff3aff0c 100644
--- a/storage/innobase/include/pars0pars.h
+++ b/storage/innobase/include/pars0pars.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -491,7 +491,6 @@ void
pars_info_bind_id(
/*=============*/
pars_info_t* info, /*!< in: info struct */
- ibool copy_name,/* in: make a copy of name if TRUE */
const char* name, /*!< in: name */
const char* id); /*!< in: id */
/****************************************************************//**
@@ -538,15 +537,6 @@ pars_info_bind_ull_literal(
MY_ATTRIBUTE((nonnull));
/****************************************************************//**
-Add bound id. */
-void
-pars_info_add_id(
-/*=============*/
- pars_info_t* info, /*!< in: info struct */
- const char* name, /*!< in: name */
- const char* id); /*!< in: id */
-
-/****************************************************************//**
Get bound literal with the given name.
@return bound literal, or NULL if not found */
pars_bound_lit_t*
diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h
index 0d48fbd2e8a..dfd1d9fb9fd 100644
--- a/storage/innobase/include/row0merge.h
+++ b/storage/innobase/include/row0merge.h
@@ -167,18 +167,20 @@ row_merge_drop_indexes_dict(
table_id_t table_id)/*!< in: table identifier */
MY_ATTRIBUTE((nonnull));
-/*********************************************************************//**
-Drop those indexes which were created before an error occurred.
+/** Drop indexes that were created before an error occurred.
The data dictionary must have been locked exclusively by the caller,
-because the transaction will not be committed. */
+because the transaction will not be committed.
+@param trx dictionary transaction
+@param table table containing the indexes
+@param locked True if table is locked,
+ false - may need to do lazy drop
+@param alter_trx Alter table transaction */
void
row_merge_drop_indexes(
-/*===================*/
- trx_t* trx, /*!< in/out: transaction */
- dict_table_t* table, /*!< in/out: table containing the indexes */
- ibool locked) /*!< in: TRUE=table locked,
- FALSE=may need to do a lazy drop */
- MY_ATTRIBUTE((nonnull));
+ trx_t* trx,
+ dict_table_t* table,
+ bool locked,
+ const trx_t* alter_trx=NULL);
/*********************************************************************//**
Drop all partially created indexes during crash recovery. */
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index 8738f991368..5faae86f5be 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -881,11 +881,12 @@ void innobase_report_computed_value_failed(dtuple_t *row);
@param[in,out] local_heap heap memory for processing large data etc.
@param[in,out] heap memory heap that copies the actual index row
@param[in] ifield index field
-@param[in] thd MySQL thread handle
-@param[in,out] mysql_table mysql table object
+@param[in] thd connection handle
+@param[in,out] mysql_table MariaDB table handle
+@param[in,out] mysql_rec MariaDB record buffer
@param[in] old_table during ALTER TABLE, this is the old table
or NULL.
-@param[in] parent_update update vector for the parent row
+@param[in] update update vector for the parent row
@param[in] foreign foreign key information
@return the field filled with computed value */
dfield_t*
@@ -900,8 +901,7 @@ innobase_get_computed_value(
TABLE* mysql_table,
byte* mysql_rec,
const dict_table_t* old_table,
- upd_t* parent_update,
- dict_foreign_t* foreign);
+ const upd_t* update);
/** Get the computed value by supplying the base column values.
@param[in,out] table the table whose virtual column
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index d196a4d6db6..62d7c139ee2 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -1142,6 +1142,16 @@ struct srv_slot_t{
to do */
que_thr_t* thr; /*!< suspended query thread
(only used for user threads) */
+#ifdef UNIV_DEBUG
+ struct debug_sync_t {
+ UT_LIST_NODE_T(debug_sync_t)
+ debug_sync_list;
+ char str[1];
+ };
+ UT_LIST_BASE_NODE_T(debug_sync_t)
+ debug_sync;
+ rw_lock_t debug_sync_lock;
+#endif
};
#ifdef UNIV_DEBUG
diff --git a/storage/innobase/include/trx0i_s.h b/storage/innobase/include/trx0i_s.h
index 7e766072272..ca65e053502 100644
--- a/storage/innobase/include/trx0i_s.h
+++ b/storage/innobase/include/trx0i_s.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -164,8 +164,8 @@ struct i_s_trx_row_t {
/*!< detailed_error in trx_t */
ulint trx_is_read_only;
/*!< trx_t::read_only */
- ulint trx_is_autocommit_non_locking;
- /*!< trx_is_autocommit_non_locking(trx)
+ bool trx_is_autocommit_non_locking;
+ /*!< trx:t::is_autocommit_non_locking()
*/
};
diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic
index 0a4d583671f..8518934e94f 100644
--- a/storage/innobase/include/trx0sys.ic
+++ b/storage/innobase/include/trx0sys.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, 2019, MariaDB Corporation.
+Copyright (c) 2018, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -185,7 +185,6 @@ trx_write_trx_id(
#if DATA_TRX_ID_LEN != 6
# error "DATA_TRX_ID_LEN != 6"
#endif
- ut_ad(id > 0);
mach_write_to_6(ptr, id);
}
@@ -252,7 +251,9 @@ trx_rw_min_trx_id_low(void)
if (trx == NULL) {
id = trx_sys->max_trx_id;
} else {
- assert_trx_in_rw_list(trx);
+ ut_ad(!trx->read_only);
+ ut_ad(trx->in_rw_trx_list);
+ ut_ad(!trx->is_autocommit_non_locking());
id = trx->id;
}
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index 5354c77db25..90365400d72 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -502,99 +502,6 @@ from innodb_lock_wait_timeout via trx_t::mysql_thd.
? thd_lock_wait_timeout((t)->mysql_thd) \
: 0)
-/**
-Determine if the transaction is a non-locking autocommit select
-(implied read-only).
-@param t transaction
-@return true if non-locking autocommit select transaction. */
-#define trx_is_autocommit_non_locking(t) \
-((t)->auto_commit && (t)->will_lock == 0)
-
-/**
-Determine if the transaction is a non-locking autocommit select
-with an explicit check for the read-only status.
-@param t transaction
-@return true if non-locking autocommit read-only transaction. */
-#define trx_is_ac_nl_ro(t) \
-((t)->read_only && trx_is_autocommit_non_locking((t)))
-
-/**
-Assert that the transaction is in the trx_sys_t::rw_trx_list */
-#define assert_trx_in_rw_list(t) do { \
- ut_ad(!(t)->read_only); \
- ut_ad((t)->in_rw_trx_list \
- == !((t)->read_only || !(t)->rsegs.m_redo.rseg)); \
- check_trx_state(t); \
-} while (0)
-
-/**
-Check transaction state */
-#define check_trx_state(t) do { \
- ut_ad(!trx_is_autocommit_non_locking((t))); \
- switch ((t)->state) { \
- case TRX_STATE_PREPARED: \
- case TRX_STATE_PREPARED_RECOVERED: \
- case TRX_STATE_ACTIVE: \
- case TRX_STATE_COMMITTED_IN_MEMORY: \
- continue; \
- case TRX_STATE_NOT_STARTED: \
- break; \
- } \
- ut_error; \
-} while (0)
-
-/** Check if transaction is free so that it can be re-initialized.
-@param t transaction handle */
-#define assert_trx_is_free(t) do { \
- ut_ad(trx_state_eq((t), TRX_STATE_NOT_STARTED)); \
- ut_ad(!(t)->id); \
- ut_ad(!(t)->has_logged()); \
- ut_ad(!(t)->is_referenced()); \
- ut_ad(!(t)->is_wsrep()); \
- ut_ad(!MVCC::is_view_active((t)->read_view)); \
- ut_ad((t)->lock.wait_thr == NULL); \
- ut_ad(UT_LIST_GET_LEN((t)->lock.trx_locks) == 0); \
- ut_ad((t)->lock.table_locks.empty()); \
- ut_ad(!(t)->autoinc_locks \
- || ib_vector_is_empty((t)->autoinc_locks)); \
- ut_ad((t)->dict_operation == TRX_DICT_OP_NONE); \
-} while(0)
-
-/** Check if transaction is in-active so that it can be freed and put back to
-transaction pool.
-@param t transaction handle */
-#define assert_trx_is_inactive(t) do { \
- assert_trx_is_free((t)); \
- ut_ad((t)->dict_operation_lock_mode == 0); \
-} while(0)
-
-#ifdef UNIV_DEBUG
-/*******************************************************************//**
-Assert that an autocommit non-locking select cannot be in the
-rw_trx_list and that it is a read-only transaction.
-The tranasction must be in the mysql_trx_list. */
-# define assert_trx_nonlocking_or_in_list(t) \
- do { \
- if (trx_is_autocommit_non_locking(t)) { \
- trx_state_t t_state = (t)->state; \
- ut_ad((t)->read_only); \
- ut_ad(!(t)->is_recovered); \
- ut_ad(!(t)->in_rw_trx_list); \
- ut_ad((t)->in_mysql_trx_list); \
- ut_ad(t_state == TRX_STATE_NOT_STARTED \
- || t_state == TRX_STATE_ACTIVE); \
- } else { \
- check_trx_state(t); \
- } \
- } while (0)
-#else /* UNIV_DEBUG */
-/*******************************************************************//**
-Assert that an autocommit non-locking slect cannot be in the
-rw_trx_list and that it is a read-only transaction.
-The tranasction must be in the mysql_trx_list. */
-# define assert_trx_nonlocking_or_in_list(trx) ((void)0)
-#endif /* UNIV_DEBUG */
-
typedef std::vector<ib_lock_t*, ut_allocator<ib_lock_t*> > lock_list;
/*******************************************************************//**
@@ -1070,16 +977,15 @@ public:
/*------------------------------*/
bool read_only; /*!< true if transaction is flagged
as a READ-ONLY transaction.
- if auto_commit && will_lock == 0
+ if auto_commit && !will_lock
then it will be handled as a
AC-NL-RO-SELECT (Auto Commit Non-Locking
Read Only Select). A read only
transaction will not be assigned an
UNDO log. */
bool auto_commit; /*!< true if it is an autocommit */
- ib_uint32_t will_lock; /*!< Will acquire some locks. Increment
- each time we determine that a lock will
- be acquired by the MySQL layer. */
+ bool will_lock; /*!< set to inform trx_start_low() that
+ the transaction may acquire locks */
/*------------------------------*/
fts_trx_t* fts_trx; /*!< FTS information, or NULL if
transaction hasn't modified tables
@@ -1191,14 +1097,36 @@ public:
ut_ad(old_n_ref > 0);
}
+ /** @return whether the table has lock on
+ mysql.innodb_table_stats and mysql.innodb_index_stats */
+ bool has_stats_table_lock() const;
+
/** Free the memory to trx_pools */
inline void free();
+ void assert_freed() const
+ {
+ ut_ad(state == TRX_STATE_NOT_STARTED);
+ ut_ad(!id);
+ ut_ad(!has_logged());
+ ut_ad(!const_cast<trx_t*>(this)->is_referenced());
+ ut_ad(!is_wsrep());
+ ut_ad(!trx_get_read_view(this));
+ ut_ad(!lock.wait_thr);
+ ut_ad(UT_LIST_GET_LEN(lock.trx_locks) == 0);
+ ut_ad(lock.table_locks.empty());
+ ut_ad(!autoinc_locks || ib_vector_is_empty(autoinc_locks));
+ ut_ad(dict_operation == TRX_DICT_OP_NONE);
+ }
+
+ /** @return whether this is a non-locking autocommit transaction */
+ bool is_autocommit_non_locking() const { return auto_commit && !will_lock; }
+
private:
- /** Assign a rollback segment for modifying temporary tables.
- @return the assigned rollback segment */
- trx_rseg_t* assign_temp_rseg();
+ /** Assign a rollback segment for modifying temporary tables.
+ @return the assigned rollback segment */
+ trx_rseg_t *assign_temp_rseg();
};
/**
diff --git a/storage/innobase/include/trx0trx.ic b/storage/innobase/include/trx0trx.ic
index 4a5b1ba717f..2a53509b206 100644
--- a/storage/innobase/include/trx0trx.ic
+++ b/storage/innobase/include/trx0trx.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2019, MariaDB Corporation.
+Copyright (c) 2016, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -50,17 +50,18 @@ trx_state_eq(
switch (trx->state) {
case TRX_STATE_PREPARED:
case TRX_STATE_PREPARED_RECOVERED:
- ut_ad(!trx_is_autocommit_non_locking(trx));
+ case TRX_STATE_COMMITTED_IN_MEMORY:
+ ut_ad(!trx->is_autocommit_non_locking());
return(trx->state == state);
case TRX_STATE_ACTIVE:
-
- assert_trx_nonlocking_or_in_list(trx);
- return(state == trx->state);
-
- case TRX_STATE_COMMITTED_IN_MEMORY:
-
- check_trx_state(trx);
+ if (trx->is_autocommit_non_locking()) {
+ ut_ad(!trx->is_recovered);
+ ut_ad(trx->read_only);
+ ut_ad(trx->mysql_thd);
+ ut_ad(!trx->in_rw_trx_list);
+ ut_ad(trx->in_mysql_trx_list);
+ }
return(state == trx->state);
case TRX_STATE_NOT_STARTED:
diff --git a/storage/innobase/include/trx0types.h b/storage/innobase/include/trx0types.h
index 097aea519a9..26589bb2a96 100644
--- a/storage/innobase/include/trx0types.h
+++ b/storage/innobase/include/trx0types.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -96,8 +96,6 @@ struct trx_t;
struct trx_lock_t;
/** Transaction system */
struct trx_sys_t;
-/** Signal */
-struct trx_sig_t;
/** Rollback segment */
struct trx_rseg_t;
/** Transaction undo log */
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index fcdc8a5ae9f..fb1f5b705aa 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -41,7 +41,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 5
#define INNODB_VERSION_MINOR 7
-#define INNODB_VERSION_BUGFIX 33
+#define INNODB_VERSION_BUGFIX 36
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
@@ -240,6 +240,12 @@ easy way to get it to work. See http://bugs.mysql.com/bug.php?id=52263. */
# define UNIV_INTERN
#endif
+#if defined(__GNUC__) && (__GNUC__ >= 11)
+# define ATTRIBUTE_ACCESS(X) __attribute__((access X))
+#else
+# define ATTRIBUTE_ACCESS(X)
+#endif
+
#ifndef MY_ATTRIBUTE
#if defined(__GNUC__)
# define MY_ATTRIBUTE(A) __attribute__(A)
@@ -458,7 +464,7 @@ in both 32-bit and 64-bit environments. */
#ifdef UNIV_INNOCHECKSUM
extern bool strict_verify;
extern FILE* log_file;
-extern unsigned long long cur_page_num;
+extern uint32_t cur_page_num;
#endif /* UNIV_INNOCHECKSUM */
typedef int64_t ib_int64_t;
diff --git a/storage/innobase/include/ut0byte.ic b/storage/innobase/include/ut0byte.ic
index b5b3d73fea8..8ca54c06dbc 100644
--- a/storage/innobase/include/ut0byte.ic
+++ b/storage/innobase/include/ut0byte.ic
@@ -77,7 +77,7 @@ ut_uint64_align_up(
/*********************************************************//**
The following function rounds up a pointer to the nearest aligned address.
@return aligned pointer */
-UNIV_INLINE
+UNIV_INLINE ATTRIBUTE_ACCESS((none,1))
void*
ut_align(
/*=====*/
@@ -97,7 +97,7 @@ ut_align(
The following function rounds down a pointer to the nearest
aligned address.
@return aligned pointer */
-UNIV_INLINE
+UNIV_INLINE ATTRIBUTE_ACCESS((none,1))
void*
ut_align_down(
/*==========*/
@@ -117,7 +117,7 @@ ut_align_down(
The following function computes the offset of a pointer from the nearest
aligned address.
@return distance from aligned pointer */
-UNIV_INLINE
+UNIV_INLINE ATTRIBUTE_ACCESS((none,1))
ulint
ut_align_offset(
/*============*/
diff --git a/storage/innobase/include/ut0wqueue.h b/storage/innobase/include/ut0wqueue.h
index 5a895f4ea3c..d9cc7aec9c9 100644
--- a/storage/innobase/include/ut0wqueue.h
+++ b/storage/innobase/include/ut0wqueue.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2006, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -46,6 +46,8 @@ struct ib_wqueue_t
ib_mutex_t mutex;
/** Work item list */
ib_list_t* items;
+ /** ib_list_len(*items) */
+ size_t length;
/** event we use to signal additions to list;
os_event_set() and os_event_reset() are protected by the mutex */
os_event_t event;
@@ -103,12 +105,5 @@ void*
ib_wqueue_nowait(
/*=============*/
ib_wqueue_t* wq); /*<! in: work queue */
-/********************************************************************
-Get number of items on queue.
-@return number of items on queue */
-ulint
-ib_wqueue_len(
-/*==========*/
- ib_wqueue_t* wq); /*<! in: work queue */
#endif /* IB_WORK_QUEUE_H */
diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake
index 523176b4530..b6276f73e31 100644
--- a/storage/innobase/innodb.cmake
+++ b/storage/innobase/innodb.cmake
@@ -86,6 +86,7 @@ MARK_AS_ADVANCED(INNODB_COMPILER_HINTS)
IF(INNODB_COMPILER_HINTS)
ADD_DEFINITIONS("-DCOMPILER_HINTS")
ENDIF()
+ADD_FEATURE_INFO(INNODB_COMPILER_HINTS INNODB_COMPILER_HINTS "InnoDB compiled with compiler hints")
SET(MUTEXTYPE "event" CACHE STRING "Mutex type: event, sys or futex")
@@ -121,15 +122,20 @@ IF(WITH_INNODB_AHI)
ADD_DEFINITIONS(-DBTR_CUR_HASH_ADAPT -DBTR_CUR_ADAPT)
IF(NOT WITH_INNODB_ROOT_GUESS)
MESSAGE(WARNING "WITH_INNODB_AHI implies WITH_INNODB_ROOT_GUESS")
+ SET(WITH_INNODB_ROOT_GUESS ON)
ENDIF()
ELSEIF(WITH_INNODB_ROOT_GUESS)
ADD_DEFINITIONS(-DBTR_CUR_ADAPT)
ENDIF()
+ADD_FEATURE_INFO(INNODB_AHI WITH_INNODB_AHI "InnoDB Adaptive Hash Index")
+ADD_FEATURE_INFO(INNODB_ROOT_GUESS WITH_INNODB_ROOT_GUESS
+ "Cache index root block descriptors in InnoDB")
OPTION(WITH_INNODB_BUG_ENDIAN_CRC32 "Weaken innodb_checksum_algorithm=crc32 by supporting upgrade from big-endian systems running 5.6/10.0/10.1" ${IS_BIG_ENDIAN})
IF(WITH_INNODB_BUG_ENDIAN_CRC32)
ADD_DEFINITIONS(-DINNODB_BUG_ENDIAN_CRC32)
ENDIF()
+ADD_FEATURE_INFO(INNODB_BUG_ENDIAN_CRC32 WITH_INNODB_BUG_ENDIAN_CRC32 "Big endian weaker CRC32 to support upgrade from big-endian systems running 5.6/10.0/10.1")
OPTION(WITH_INNODB_EXTRA_DEBUG "Enable extra InnoDB debug checks" OFF)
IF(WITH_INNODB_EXTRA_DEBUG)
@@ -148,6 +154,8 @@ IF(WITH_INNODB_EXTRA_DEBUG)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${EXTRA_DEBUG_FLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${EXTRA_DEBUG_FLAGS}")
ENDIF()
+ADD_FEATURE_INFO(INNODB_EXTRA_DEBUG WITH_INNODB_EXTRA_DEBUG "Extra InnoDB debug checks")
+
CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
IF(HAVE_SCHED_GETCPU)
@@ -220,11 +228,6 @@ ENDIF(NOT MSVC)
CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF)
-CHECK_CXX_SOURCE_COMPILES("struct t1{ int a; char *b; }; struct t1 c= { .a=1, .b=0 }; main() { }" HAVE_C99_INITIALIZERS)
-IF(HAVE_C99_INITIALIZERS)
- ADD_DEFINITIONS(-DHAVE_C99_INITIALIZERS)
-ENDIF()
-
SET(MUTEXTYPE "event" CACHE STRING "Mutex type: event, sys or futex")
IF(MUTEXTYPE MATCHES "event")
@@ -239,6 +242,7 @@ OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WI
IF (WITH_INNODB_DISALLOW_WRITES)
ADD_DEFINITIONS(-DWITH_INNODB_DISALLOW_WRITES)
ENDIF()
+ADD_FEATURE_INFO(INNODB_DISALLOW_WRITES WITH_INNODB_DISALLOW_WRITES "Expose innodb_disallow_writes switch to stop innodb from writing to disk")
# Include directories under innobase
@@ -281,8 +285,8 @@ IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${_SRC_DIR}/pars/lexyy.c
PROPERTIES COMPILE_FLAGS "/wd4003")
ENDIF()
-
+
# Include directories under innobase
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include
- ${CMAKE_SOURCE_DIR}/storage/innobase/handler
+ ${CMAKE_SOURCE_DIR}/storage/innobase/handler
${CMAKE_SOURCE_DIR}/libbinlogevents/include )
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 506106a2269..4daf4fb07b8 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -1376,6 +1376,19 @@ wsrep_print_wait_locks(
}
#endif /* WITH_WSREP */
+#ifdef UNIV_DEBUG
+/** Check transaction state */
+static void check_trx_state(const trx_t *trx)
+{
+ ut_ad(!trx->auto_commit || trx->will_lock);
+ const trx_state_t state= trx->state;
+ ut_ad(state == TRX_STATE_ACTIVE ||
+ state == TRX_STATE_PREPARED_RECOVERED ||
+ state == TRX_STATE_PREPARED ||
+ state == TRX_STATE_COMMITTED_IN_MEMORY);
+}
+#endif
+
/** Create a new record lock and inserts it to the lock queue,
without checking for deadlocks or conflicts.
@param[in] type_mode lock mode and wait flag; type will be replaced
@@ -3589,8 +3602,8 @@ lock_table_create(
ut_ad(table && trx);
ut_ad(lock_mutex_own());
ut_ad(trx_mutex_own(trx));
-
- check_trx_state(trx);
+ ut_ad(trx->is_recovered || trx->state == TRX_STATE_ACTIVE);
+ ut_ad(!trx->auto_commit || trx->will_lock);
if ((type_mode & LOCK_MODE_MASK) == LOCK_AUTO_INC) {
++table->n_waiting_or_granted_auto_inc_locks;
@@ -4545,7 +4558,10 @@ lock_remove_recovered_trx_record_locks(
trx != NULL;
trx = UT_LIST_GET_NEXT(trx_list, trx)) {
- assert_trx_in_rw_list(trx);
+ ut_ad(!trx->read_only);
+ ut_ad(trx->in_rw_trx_list);
+ ut_ad(!trx->is_autocommit_non_locking());
+ ut_ad(trx->state != TRX_STATE_NOT_STARTED);
if (!trx->is_recovered) {
continue;
@@ -5181,7 +5197,8 @@ lock_rec_queue_validate(
ut_ad(!index || lock->index == index);
trx_mutex_enter(lock->trx);
- ut_ad(!trx_is_ac_nl_ro(lock->trx));
+ ut_ad(!lock->trx->read_only
+ || !lock->trx->is_autocommit_non_locking());
ut_ad(trx_state_eq(lock->trx,
TRX_STATE_COMMITTED_IN_MEMORY)
|| !lock_get_wait(lock)
@@ -5260,8 +5277,7 @@ lock_rec_queue_validate(
for (lock = lock_rec_get_first(lock_sys->rec_hash, block, heap_no);
lock != NULL;
lock = lock_rec_get_next_const(heap_no, lock)) {
-
- ut_ad(!trx_is_ac_nl_ro(lock->trx));
+ ut_ad(!lock->trx->is_autocommit_non_locking());
if (index) {
ut_a(lock->index == index);
@@ -5357,7 +5373,8 @@ loop:
}
}
- ut_ad(!trx_is_ac_nl_ro(lock->trx));
+ ut_ad(!lock->trx->read_only
+ || !lock->trx->is_autocommit_non_locking());
/* Only validate the record queues when this thread is not
holding a space->latch. */
@@ -5465,7 +5482,7 @@ lock_rec_validate(
ib_uint64_t current;
- ut_ad(!trx_is_ac_nl_ro(lock->trx));
+ ut_ad(!lock->trx->is_autocommit_non_locking());
ut_ad(lock_get_type(lock) == LOCK_REC);
current = ut_ull_create(
@@ -7075,7 +7092,8 @@ DeadlockChecker::search()
ut_ad(m_start != NULL);
ut_ad(m_wait_lock != NULL);
- check_trx_state(m_wait_lock->trx);
+ ut_ad(!m_wait_lock->trx->auto_commit || m_wait_lock->trx->will_lock);
+ ut_d(check_trx_state(m_wait_lock->trx));
ut_ad(m_mark_start <= s_lock_mark_counter);
/* Look at the locks ahead of wait_lock in the lock queue. */
@@ -7235,7 +7253,8 @@ DeadlockChecker::check_and_resolve(const lock_t* lock, trx_t* trx)
{
ut_ad(lock_mutex_own());
ut_ad(trx_mutex_own(trx));
- check_trx_state(trx);
+ ut_ad(trx->state == TRX_STATE_ACTIVE);
+ ut_ad(!trx->auto_commit || trx->will_lock);
ut_ad(!srv_read_only_mode);
if (!innobase_deadlock_detect) {
diff --git a/storage/innobase/lock/lock0wait.cc b/storage/innobase/lock/lock0wait.cc
index 5d0d41ef494..df1488b9df3 100644
--- a/storage/innobase/lock/lock0wait.cc
+++ b/storage/innobase/lock/lock0wait.cc
@@ -192,28 +192,33 @@ wsrep_is_BF_lock_timeout(
const trx_t* trx,
bool locked = true)
{
- if (trx->is_wsrep() && wsrep_thd_is_BF(trx->mysql_thd, FALSE)
- && trx->error_state != DB_DEADLOCK) {
- ib::info() << "WSREP: BF lock wait long for trx:" << ib::hex(trx->id)
+ bool long_wait= (trx->error_state != DB_DEADLOCK &&
+ trx->is_wsrep() &&
+ wsrep_thd_is_BF(trx->mysql_thd, false));
+ bool was_wait= true;
+
+ DBUG_EXECUTE_IF("wsrep_instrument_BF_lock_wait",
+ was_wait=false; long_wait=true;);
+
+ if (long_wait) {
+ ib::info() << "WSREP: BF lock wait long for trx:" << trx->id
<< " query: " << wsrep_thd_query(trx->mysql_thd);
- if (!locked) {
+
+ if (!locked)
lock_mutex_enter();
- }
ut_ad(lock_mutex_own());
wsrep_trx_print_locking(stderr, trx, 3000);
+ /* Note this will release lock_sys mutex */
+ lock_print_info_all_transactions(stderr);
- if (!locked) {
- lock_mutex_exit();
- }
+ if (locked)
+ lock_mutex_enter();
- srv_print_innodb_monitor = TRUE;
- srv_print_innodb_lock_monitor = TRUE;
- os_event_set(srv_monitor_event);
- return true;
- }
- return false;
+ return was_wait;
+ } else
+ return false;
}
#endif /* WITH_WSREP */
diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc
index f1297921839..fcc2674699f 100644
--- a/storage/innobase/log/log0crypt.cc
+++ b/storage/innobase/log/log0crypt.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (C) 2014, 2018, MariaDB Corporation.
+Copyright (C) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -163,6 +163,7 @@ static bool init_crypt_key(crypt_info_t* info, bool upgrade = false)
<< info->key_version << " failed (" << rc
<< "). Maybe the key or the required encryption "
"key management plugin was not found.";
+ info->key_version = ENCRYPTION_KEY_VERSION_INVALID;
return false;
}
@@ -182,6 +183,7 @@ static bool init_crypt_key(crypt_info_t* info, bool upgrade = false)
if (err != MY_AES_OK || dst_len != MY_AES_BLOCK_SIZE) {
ib::error() << "Getting redo log crypto key failed: err = "
<< err << ", len = " << dst_len;
+ info->key_version = ENCRYPTION_KEY_VERSION_INVALID;
return false;
}
@@ -275,6 +277,7 @@ log_crypt_101_read_block(byte* buf)
for (const crypt_info_t* const end = info + infos_used; info < end;
info++) {
if (info->key_version
+ && info->key_version != ENCRYPTION_KEY_VERSION_INVALID
&& info->checkpoint_no == checkpoint_no) {
goto found;
}
@@ -286,6 +289,9 @@ log_crypt_101_read_block(byte* buf)
/* MariaDB Server 10.1 would use the first key if it fails to
find a key for the current checkpoint. */
info = infos;
+ if (info->key_version == ENCRYPTION_KEY_VERSION_INVALID) {
+ return false;
+ }
found:
byte dst[OS_FILE_LOG_BLOCK_SIZE];
uint dst_len;
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 4c68f3743e9..8dc29e302dd 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
-Copyright (c) 2014, 2020, MariaDB Corporation.
+Copyright (c) 2014, 2021, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -983,13 +983,9 @@ loop:
/** Flush the recently written changes to the log file.
and invoke log_mutex_enter(). */
-static
-void
-log_write_flush_to_disk_low()
+static void log_write_flush_to_disk_low()
{
- /* FIXME: This is not holding log_sys->mutex while
- calling os_event_set()! */
- ut_a(log_sys->n_pending_flushes == 1); /* No other threads here */
+ ut_a(log_sys->n_pending_flushes);
bool do_flush = srv_file_flush_method != SRV_O_DSYNC;
@@ -997,7 +993,6 @@ log_write_flush_to_disk_low()
fil_flush(SRV_LOG_SPACE_FIRST_ID);
}
-
log_mutex_enter();
if (do_flush) {
log_sys->flushed_to_disk_lsn = log_sys->current_flush_lsn;
@@ -1247,12 +1242,103 @@ loop:
/** write to the log file up to the last log entry.
@param[in] sync whether we want the written log
also to be flushed to disk. */
-void
-log_buffer_flush_to_disk(
- bool sync)
+void log_buffer_flush_to_disk(bool sync)
{
- ut_ad(!srv_read_only_mode);
- log_write_up_to(log_get_lsn(), sync);
+ ut_ad(!srv_read_only_mode);
+ log_write_up_to(log_get_lsn(), sync);
+}
+
+
+/** Durably write the log and release log_sys.mutex */
+ATTRIBUTE_COLD void log_write_and_flush()
+{
+ ut_ad(!srv_read_only_mode);
+ ut_ad(!recv_no_log_write);
+ ut_ad(!recv_recovery_is_on());
+
+ /* The following code is adapted from log_write_up_to(). */
+ DBUG_PRINT("ib_log", ("write " LSN_PF " to " LSN_PF,
+ log_sys->write_lsn, log_sys->lsn));
+ log_sys->n_pending_flushes++;
+ log_sys->current_flush_lsn= log_sys->lsn;
+ os_event_reset(log_sys->flush_event);
+ ut_ad(log_sys->buf_free != log_sys->buf_next_to_write);
+ ulint start_offset= log_sys->buf_next_to_write;
+ ulint end_offset= log_sys->buf_free;
+ ulint area_start= ut_2pow_round(start_offset, ulint(OS_FILE_LOG_BLOCK_SIZE));
+ ulint area_end= ut_calc_align(end_offset, ulint(OS_FILE_LOG_BLOCK_SIZE));
+ ulong write_ahead_size= srv_log_write_ahead_size;
+
+ log_block_set_flush_bit(log_sys->buf + area_start, TRUE);
+ log_block_set_checkpoint_no(log_sys->buf + area_end - OS_FILE_LOG_BLOCK_SIZE,
+ log_sys->next_checkpoint_no);
+ lsn_t write_lsn= log_sys->lsn;
+ byte *write_buf= log_sys->buf;
+
+ ut_ad(area_end - area_start > 0);
+
+ log_buffer_switch();
+
+ log_group_set_fields(&log_sys->log, log_sys->write_lsn);
+
+ /* Erase the end of the last log block. */
+ memset(write_buf + end_offset, 0,
+ ~end_offset & (OS_FILE_LOG_BLOCK_SIZE - 1));
+ /* Calculate pad_size if needed. */
+ ulint pad_size= 0;
+ if (write_ahead_size > OS_FILE_LOG_BLOCK_SIZE)
+ {
+ lsn_t end_offset=
+ log_group_calc_lsn_offset(ut_uint64_align_up(write_lsn,
+ OS_FILE_LOG_BLOCK_SIZE),
+ &log_sys->log);
+ ulint end_offset_in_unit= (ulint) (end_offset % write_ahead_size);
+
+ if (end_offset_in_unit && (area_end - area_start) > end_offset_in_unit)
+ {
+ /* The first block in the unit was initialized after the last
+ writing. Needs to be written padded data once. */
+ pad_size= std::min(ulint(write_ahead_size) - end_offset_in_unit,
+ log_sys->buf_size - area_end);
+ memset(write_buf + area_end, 0, pad_size);
+ }
+ }
+
+ if (log_sys->is_encrypted())
+ log_crypt(write_buf + area_start, log_sys->write_lsn,
+ area_end - area_start);
+
+ /* Do the write to the log files */
+ log_group_write_buf(&log_sys->log, write_buf + area_start,
+ area_end - area_start + pad_size,
+#ifdef UNIV_DEBUG
+ pad_size,
+#endif /* UNIV_DEBUG */
+ ut_uint64_align_down(log_sys->write_lsn,
+ OS_FILE_LOG_BLOCK_SIZE),
+ start_offset - area_start);
+ srv_stats.log_padded.add(pad_size);
+ log_sys->write_lsn= write_lsn;
+
+ log_write_mutex_exit();
+
+ /* Code adapted from log_write_flush_to_disk_low() */
+
+ ut_a(log_sys->n_pending_flushes);
+
+ if (srv_file_flush_method != SRV_O_DSYNC)
+ fil_flush(SRV_LOG_SPACE_FIRST_ID);
+
+ log_sys->flushed_to_disk_lsn= log_sys->current_flush_lsn;
+
+ log_sys->n_pending_flushes--;
+
+ os_event_set(log_sys->flush_event);
+
+ lsn_t wrote_lsn= log_sys->write_lsn, flush_lsn= log_sys->flushed_to_disk_lsn;
+ log_mutex_exit();
+
+ innobase_mysql_log_notify(wrote_lsn, flush_lsn);
}
/****************************************************************//**
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 42b8e4dee88..436633185b3 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -967,7 +967,8 @@ fail:
DBUG_EXECUTE_IF("log_checksum_mismatch", { cksum = crc + 1; });
if (crc != cksum) {
- ib::error() << "Invalid log block checksum."
+ ib::error_or_warn(srv_operation != SRV_OPERATION_BACKUP)
+ << "Invalid log block checksum."
<< " block: " << block_number
<< " checkpoint no: "
<< log_block_get_checkpoint_no(buf)
diff --git a/storage/innobase/lz4.cmake b/storage/innobase/lz4.cmake
index e901378eafc..a908dd3b73e 100644
--- a/storage/innobase/lz4.cmake
+++ b/storage/innobase/lz4.cmake
@@ -22,35 +22,17 @@ MACRO (MYSQL_CHECK_LZ4)
CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
+ SET(HAVE_INNODB_LZ4 TRUE)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
IF (HAVE_LZ4_COMPRESS_DEFAULT)
- ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
+ ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
ENDIF()
LINK_LIBRARIES(lz4)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required lz4 library is not found")
+ MESSAGE(FATAL_ERROR "Required lz4 library is not found")
ENDIF()
ENDIF()
ENDIF()
-ENDMACRO()
-
-MACRO (MYSQL_CHECK_LZ4_STATIC)
- IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO")
- CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
- CHECK_LIBRARY_EXISTS(liblz4.a LZ4_compress_limitedOutput "" HAVE_LZ4_LIB)
- CHECK_LIBRARY_EXISTS(liblz3.a LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
-
- IF(HAVE_LZ4_LIB AND HAVE_LZ4_H)
- ADD_DEFINITIONS(-DHAVE_LZ4=1)
- IF (HAVE_LZ4_COMPRESS_DEFAULT)
- ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
- ENDIF()
- LINK_LIBRARIES(liblz4.a)
- ELSE()
- IF (WITH_INNODB_LZ4 STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required lz4 library is not found")
- ENDIF()
- ENDIF()
- ENDIF()
+ ADD_FEATURE_INFO(INNODB_LZ4 HAVE_INNODB_LZ4 "LZ4 compression in the InnoDB storage engine")
ENDMACRO()
diff --git a/storage/innobase/lzma.cmake b/storage/innobase/lzma.cmake
index 93de0a2934d..3060139c27c 100644
--- a/storage/innobase/lzma.cmake
+++ b/storage/innobase/lzma.cmake
@@ -22,12 +22,14 @@ MACRO (MYSQL_CHECK_LZMA)
CHECK_LIBRARY_EXISTS(lzma lzma_easy_buffer_encode "" HAVE_LZMA_ENCODE)
IF (HAVE_LZMA_DECODE AND HAVE_LZMA_ENCODE AND HAVE_LZMA_H)
+ SET(HAVE_INNODB_LZMA TRUE)
ADD_DEFINITIONS(-DHAVE_LZMA=1)
LINK_LIBRARIES(lzma)
ELSE()
IF (WITH_INNODB_LZMA STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required lzma library is not found")
+ MESSAGE(FATAL_ERROR "Required lzma library is not found")
ENDIF()
ENDIF()
ENDIF()
+ ADD_FEATURE_INFO(INNODB_LZMA HAVE_INNODB_LZMA "LZMA compression in the InnoDB storage engine")
ENDMACRO()
diff --git a/storage/innobase/lzo.cmake b/storage/innobase/lzo.cmake
index 236eac2d1e5..ca2de6ab1c5 100644
--- a/storage/innobase/lzo.cmake
+++ b/storage/innobase/lzo.cmake
@@ -15,34 +15,20 @@
SET(WITH_INNODB_LZO AUTO CACHE STRING
"Build with lzo. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
-MACRO (MYSQL_CHECK_LZO_STATIC)
- IF (WITH_INNODB_LZO STREQUAL "ON" OR WITH_INNODB_LZO STREQUAL "AUTO")
- CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H)
- CHECK_LIBRARY_EXISTS(liblzo2.a lzo1x_1_compress "" HAVE_LZO_LIB)
-
- IF(HAVE_LZO_LIB AND HAVE_LZO_H)
- ADD_DEFINITIONS(-DHAVE_LZO=1)
- LINK_LIBRARIES(liblzo2.a)
- ELSE()
- IF (WITH_INNODB_LZO STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required lzo library is not found")
- ENDIF()
- ENDIF()
- ENDIF()
-ENDMACRO()
-
MACRO (MYSQL_CHECK_LZO)
IF (WITH_INNODB_LZO STREQUAL "ON" OR WITH_INNODB_LZO STREQUAL "AUTO")
CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H)
CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_SHARED_LIB)
IF(HAVE_LZO_SHARED_LIB AND HAVE_LZO_H)
+ SET(HAVE_INNODB_LZO TRUE)
ADD_DEFINITIONS(-DHAVE_LZO=1)
LINK_LIBRARIES(lzo2)
ELSE()
IF (WITH_INNODB_LZO STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required lzo library is not found")
+ MESSAGE(FATAL_ERROR "Required lzo library is not found")
ENDIF()
ENDIF()
ENDIF()
+ ADD_FEATURE_INFO(INNODB_LZO HAVE_INNODB_LZO "LZO compression in the InnoDB storage engine")
ENDMACRO()
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
index fefc0687ddb..4bd90e7842d 100644
--- a/storage/innobase/mtr/mtr0mtr.cc
+++ b/storage/innobase/mtr/mtr0mtr.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -465,6 +465,90 @@ mtr_t::commit()
release_resources();
}
+#ifdef UNIV_DEBUG
+/** Check that all pages belong to a shrunk tablespace. */
+struct Shrink
+{
+ const fil_space_t &space;
+ Shrink(const fil_space_t &space) : space(space) {}
+
+ bool operator()(const mtr_memo_slot_t *slot) const
+ {
+ if (!slot->object)
+ return true;
+ switch (slot->type) {
+ default:
+ ut_ad("invalid type" == 0);
+ return false;
+ case MTR_MEMO_MODIFY:
+ break;
+ case MTR_MEMO_SPACE_X_LOCK:
+ ut_ad(&space == slot->object);
+ return true;
+ case MTR_MEMO_PAGE_X_FIX:
+ case MTR_MEMO_PAGE_SX_FIX:
+ const buf_page_t &bpage= static_cast<buf_block_t*>(slot->object)->page;
+ const page_id_t &id= bpage.id;
+ if (id.space() == 0 && id.page_no() == TRX_SYS_PAGE_NO)
+ {
+ ut_ad(srv_is_undo_tablespace(space.id));
+ break;
+ }
+ ut_ad(id.space() == space.id);
+ ut_ad(id.page_no() < space.size);
+ ut_ad(bpage.state == BUF_BLOCK_FILE_PAGE);
+ ut_ad(!bpage.oldest_modification);
+ break;
+ }
+ return true;
+ }
+};
+#endif
+
+/** Commit a mini-transaction that is shrinking a tablespace.
+@param space tablespace that is being shrunk */
+void mtr_t::commit_shrink(fil_space_t &space)
+{
+ ut_ad(is_active());
+ ut_ad(!is_inside_ibuf());
+ ut_ad(!high_level_read_only);
+ ut_ad(m_modifications);
+ ut_ad(m_made_dirty);
+ ut_ad(!recv_recovery_is_on());
+ ut_ad(m_log_mode == MTR_LOG_ALL);
+ ut_ad(UT_LIST_GET_LEN(space.chain) == 1);
+
+ log_write_and_flush_prepare();
+
+ const lsn_t start_lsn= finish_write(prepare_write());
+
+ log_flush_order_mutex_enter();
+ /* Durably write the reduced FSP_SIZE before truncating the data file. */
+ log_write_and_flush();
+
+ os_file_truncate(space.chain.start->name, space.chain.start->handle,
+ os_offset_t(space.size) << srv_page_size_shift, true);
+
+ ut_d(m_memo.for_each_block_in_reverse(CIterate<Shrink>(space)));
+
+ m_memo.for_each_block_in_reverse(CIterate<const ReleaseBlocks>
+ (ReleaseBlocks(start_lsn, m_commit_lsn,
+ m_flush_observer)));
+ log_flush_order_mutex_exit();
+
+ mutex_enter(&fil_system->mutex);
+ ut_ad(space.is_being_truncated);
+ ut_ad(space.stop_new_ops);
+ space.stop_new_ops= false;
+ space.is_being_truncated= false;
+ mutex_exit(&fil_system->mutex);
+
+ m_memo.for_each_block_in_reverse(CIterate<ReleaseLatches>());
+ srv_stats.log_write_requests.inc();
+
+ release_resources();
+}
+
/** Commit a mini-transaction that did not modify any pages,
but generated some redo log on a higher level, such as
MLOG_FILE_NAME records and a MLOG_CHECKPOINT marker.
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index d2d5769d85e..48be5256ab1 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -1122,6 +1122,10 @@ os_file_lock(
int fd,
const char* name)
{
+ if (my_disable_locking) {
+ return 0;
+ }
+
struct flock lk;
lk.l_type = F_WRLCK;
@@ -5401,6 +5405,8 @@ os_file_set_size(
os_offset_t size,
bool is_sparse)
{
+ ut_ad(!(size & 4095));
+
#ifdef _WIN32
/* On Windows, changing file size works well and as expected for both
sparse and normal files.
@@ -5420,6 +5426,8 @@ os_file_set_size(
fallback:
#else
+ struct stat statbuf;
+
if (is_sparse) {
bool success = !ftruncate(file, size);
if (!success) {
@@ -5433,10 +5441,17 @@ fallback:
# ifdef HAVE_POSIX_FALLOCATE
int err;
do {
- os_offset_t current_size = os_file_get_size(file);
- err = current_size >= size
- ? 0 : posix_fallocate(file, current_size,
+ if (fstat(file, &statbuf)) {
+ err = errno;
+ } else {
+ os_offset_t current_size = statbuf.st_size;
+ if (current_size >= size) {
+ return true;
+ }
+ current_size &= ~4095ULL;
+ err = posix_fallocate(file, current_size,
size - current_size);
+ }
} while (err == EINTR
&& srv_shutdown_state <= SRV_SHUTDOWN_INITIATED);
@@ -5459,6 +5474,26 @@ fallback:
# endif /* HAVE_POSIX_ALLOCATE */
#endif /* _WIN32*/
+#ifdef _WIN32
+ os_offset_t current_size = os_file_get_size(file);
+ FILE_STORAGE_INFO info;
+ if (GetFileInformationByHandleEx(file, FileStorageInfo, &info,
+ sizeof info)) {
+ if (info.LogicalBytesPerSector) {
+ current_size &= ~os_offset_t(info.LogicalBytesPerSector
+ - 1);
+ }
+ }
+#else
+ if (fstat(file, &statbuf)) {
+ return false;
+ }
+ os_offset_t current_size = statbuf.st_size & ~4095ULL;
+#endif
+ if (current_size >= size) {
+ return true;
+ }
+
/* Write up to 1 megabyte at a time. */
ulint buf_size = ut_min(
static_cast<ulint>(64),
@@ -5476,8 +5511,6 @@ fallback:
/* Write buffer full of zeros */
memset(buf, 0, buf_size);
- os_offset_t current_size = os_file_get_size(file);
-
while (current_size < size
&& srv_shutdown_state <= SRV_SHUTDOWN_INITIATED) {
ulint n_bytes;
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index 1acbfd2e230..6fe5c62a0b7 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -2,7 +2,7 @@
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2014, 2020, MariaDB Corporation.
+Copyright (c) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -4983,9 +4983,9 @@ bool page_zip_verify_checksum(const byte *data, size_t size)
#ifdef UNIV_INNOCHECKSUM
if (log_file) {
- fprintf(log_file, "page::%llu;"
- " %s checksum: calculated = %u;"
- " recorded = %u\n", cur_page_num,
+ fprintf(log_file, "page::" UINT32PF ";"
+ " %s checksum: calculated = " UINT32PF ";"
+ " recorded = " UINT32PF "\n", cur_page_num,
buf_checksum_algorithm_name(
static_cast<srv_checksum_algorithm_t>(
srv_checksum_algorithm)),
@@ -4997,11 +4997,11 @@ bool page_zip_verify_checksum(const byte *data, size_t size)
data, size, SRV_CHECKSUM_ALGORITHM_CRC32);
if (log_file) {
- fprintf(log_file, "page::%llu: crc32 checksum:"
- " calculated = %u; recorded = %u\n",
+ fprintf(log_file, "page::" UINT32PF ": crc32 checksum:"
+ " calculated = " UINT32PF "; recorded = " UINT32PF "\n",
cur_page_num, crc32, stored);
- fprintf(log_file, "page::%llu: none checksum:"
- " calculated = %lu; recorded = %u\n",
+ fprintf(log_file, "page::" UINT32PF ": none checksum:"
+ " calculated = %lu; recorded = " UINT32PF "\n",
cur_page_num, BUF_NO_CHECKSUM_MAGIC, stored);
}
}
diff --git a/storage/innobase/pars/pars0grm.cc b/storage/innobase/pars/pars0grm.cc
index 7e10a783310..10d0d0becd7 100644
--- a/storage/innobase/pars/pars0grm.cc
+++ b/storage/innobase/pars/pars0grm.cc
@@ -79,6 +79,10 @@ que_node_t */
#include "que0que.h"
#include "row0sel.h"
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
+#endif
+
#define YYSTYPE que_node_t*
/* #define __STDC__ */
diff --git a/storage/innobase/pars/pars0grm.y b/storage/innobase/pars/pars0grm.y
index 625ed41bbd4..3fb0865f608 100644
--- a/storage/innobase/pars/pars0grm.y
+++ b/storage/innobase/pars/pars0grm.y
@@ -38,6 +38,10 @@ que_node_t */
#include "que0que.h"
#include "row0sel.h"
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
+#endif
+
#define YYSTYPE que_node_t*
/* #define __STDC__ */
diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc
index 280c4ee1815..851c0a0316b 100644
--- a/storage/innobase/pars/pars0pars.cc
+++ b/storage/innobase/pars/pars0pars.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2019, MariaDB Corporation.
+Copyright (c) 2019, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -1219,6 +1219,7 @@ pars_update_statement(
sel_node->row_lock_mode = LOCK_X;
} else {
node->has_clust_rec_x_lock = sel_node->set_x_locks;
+ ut_ad(node->has_clust_rec_x_lock);
}
ut_a(sel_node->n_tables == 1);
@@ -2351,7 +2352,6 @@ void
pars_info_bind_id(
/*==============*/
pars_info_t* info, /*!< in: info struct */
- ibool copy_name, /* in: copy name if TRUE */
const char* name, /*!< in: name */
const char* id) /*!< in: id */
{
@@ -2374,8 +2374,7 @@ pars_info_bind_id(
bid = static_cast<pars_bound_id_t*>(
ib_vector_push(info->bound_ids, NULL));
- bid->name = (copy_name)
- ? mem_heap_strdup(info->heap, name) : name;
+ bid->name = name;
}
bid->id = id;
diff --git a/storage/innobase/read/read0read.cc b/storage/innobase/read/read0read.cc
index 3fd52d5d6dd..a115672a8a6 100644
--- a/storage/innobase/read/read0read.cc
+++ b/storage/innobase/read/read0read.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2019, MariaDB Corporation.
+Copyright (c) 2019, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -574,7 +574,7 @@ MVCC::view_open(ReadView*& view, trx_t* trx)
Therefore we must set the low limit id after we reset the
closed status after the check. */
- if (trx_is_autocommit_non_locking(trx) && view->empty()) {
+ if (trx->is_autocommit_non_locking() && view->empty()) {
view->m_closed = false;
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 4085ff17bd3..8a3f0243035 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -770,7 +770,6 @@ fts_parallel_tokenization(
row_merge_block_t** crypt_block;
int tmpfd[FTS_NUM_AUX_INDEX];
ulint mycount[FTS_NUM_AUX_INDEX];
- ib_uint64_t total_rec = 0;
ulint num_doc_processed = 0;
doc_id_t last_doc_id = 0;
mem_heap_t* blob_heap = NULL;
@@ -924,7 +923,7 @@ loop:
<< " records, the sort queue has "
<< UT_LIST_GET_LEN(psort_info->fts_doc_list)
<< " records. But sort cannot get the next"
- " records";
+ " records during alter table " << table->name;
goto exit;
}
} else if (psort_info->state == FTS_PARENT_EXITING) {
@@ -1038,7 +1037,6 @@ exit:
goto func_exit;
}
- total_rec += merge_file[i]->n_rec;
close(tmpfd[i]);
}
@@ -1220,7 +1218,9 @@ row_merge_write_fts_word(
if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
ib::error() << "Failed to write word to FTS auxiliary"
- " index table, error " << error;
+ " index table "
+ << ins_ctx->btr_bulk->table_name()
+ << ", error " << error;
ret = error;
}
@@ -1664,7 +1664,6 @@ row_fts_merge_insert(
aux_table = dict_table_open_on_name(aux_table_name, FALSE, FALSE,
DICT_ERR_IGNORE_NONE);
ut_ad(aux_table != NULL);
- dict_table_close(aux_table, FALSE, FALSE);
aux_index = dict_table_get_first_index(aux_table);
/* Create bulk load instance */
@@ -1798,6 +1797,8 @@ exit:
error = ins_ctx.btr_bulk->finish(error);
UT_DELETE(ins_ctx.btr_bulk);
+ dict_table_close(aux_table, FALSE, FALSE);
+
trx_free_for_background(trx);
mem_heap_free(heap);
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index fa7db1e27b8..f4df44b3e2b 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -222,6 +222,19 @@ struct row_import {
found and was readable */
};
+struct fil_iterator_t {
+ pfs_os_file_t file; /*!< File handle */
+ const char* filepath; /*!< File path name */
+ os_offset_t start; /*!< From where to start */
+ os_offset_t end; /*!< Where to stop */
+ os_offset_t file_size; /*!< File size in bytes */
+ ulint n_io_buffers; /*!< Number of pages to use
+ for IO */
+ byte* io_buffer; /*!< Buffer to use for IO */
+ fil_space_crypt_t *crypt_data; /*!< Crypt data (if encrypted) */
+ byte* crypt_io_buffer; /*!< IO buffer when encrypted */
+};
+
/** Use the page cursor to iterate over records in a block. */
class RecIterator {
public:
@@ -432,6 +445,10 @@ public:
? block->page.zip.data : block->frame;
}
+ /** Invoke the functionality for the callback */
+ virtual dberr_t run(const fil_iterator_t& iter,
+ buf_block_t* block) UNIV_NOTHROW = 0;
+
protected:
/** Get the physical offset of the extent descriptor within the page.
@param page_no page number of the extent descriptor
@@ -592,6 +609,24 @@ AbstractCallback::init(
}
/**
+TODO: This can be made parallel trivially by chunking up the file
+and creating a callback per thread.. Main benefit will be to use
+multiple CPUs for checksums and compressed tables. We have to do
+compressed tables block by block right now. Secondly we need to
+decompress/compress and copy too much of data. These are
+CPU intensive.
+
+Iterate over all the pages in the tablespace.
+@param iter - Tablespace iterator
+@param block - block to use for IO
+@param callback - Callback to inspect and update page contents
+@retval DB_SUCCESS or error code */
+static dberr_t fil_iterate(
+ const fil_iterator_t& iter,
+ buf_block_t* block,
+ AbstractCallback& callback);
+
+/**
Try and determine the index root pages by checking if the next/prev
pointers are both FIL_NULL. We need to ensure that skip deleted pages. */
struct FetchIndexRootPages : public AbstractCallback {
@@ -608,15 +643,13 @@ struct FetchIndexRootPages : public AbstractCallback {
ulint m_page_no; /*!< Root page number */
};
- typedef std::vector<Index, ut_allocator<Index> > Indexes;
-
/** Constructor
@param trx covering (user) transaction
@param table table definition in server .*/
FetchIndexRootPages(const dict_table_t* table, trx_t* trx)
:
AbstractCallback(trx),
- m_table(table) UNIV_NOTHROW { }
+ m_table(table), m_index(0, 0) UNIV_NOTHROW { }
/** Destructor */
virtual ~FetchIndexRootPages() UNIV_NOTHROW { }
@@ -628,6 +661,13 @@ struct FetchIndexRootPages : public AbstractCallback {
return(m_space);
}
+ /** Fetch the clustered index root page in the tablespace
+ @param iter Tablespace iterator
+ @param block Block to use for IO
+ @retval DB_SUCCESS or error code */
+ dberr_t run(const fil_iterator_t& iter,
+ buf_block_t* block) UNIV_NOTHROW;
+
/** Called for each block as it is read from the file.
@param block block to convert, it is not from the buffer pool.
@retval DB_SUCCESS or error code. */
@@ -641,7 +681,7 @@ struct FetchIndexRootPages : public AbstractCallback {
const dict_table_t* m_table;
/** Index information */
- Indexes m_indexes;
+ Index m_index;
};
/** Called for each block as it is read from the file. Check index pages to
@@ -656,31 +696,19 @@ dberr_t FetchIndexRootPages::operator()(buf_block_t* block) UNIV_NOTHROW
const page_t* page = get_frame(block);
- ulint page_type = fil_page_get_type(page);
-
- if (page_type == FIL_PAGE_TYPE_XDES) {
- return set_current_xdes(block->page.id.page_no(), page);
- } else if (fil_page_index_page_check(page)
- && !is_free(block->page.id.page_no())
- && !page_has_siblings(page)) {
-
- index_id_t id = btr_page_get_index_id(page);
-
- m_indexes.push_back(Index(id, block->page.id.page_no()));
+ m_index.m_id = btr_page_get_index_id(page);
+ m_index.m_page_no = block->page.id.page_no();
- if (m_indexes.size() == 1) {
- /* Check that the tablespace flags match the table flags. */
- ulint expected = dict_tf_to_fsp_flags(m_table->flags);
- if (!fsp_flags_match(expected, m_space_flags)) {
- ib_errf(m_trx->mysql_thd, IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Expected FSP_SPACE_FLAGS=0x%x, .ibd "
- "file contains 0x%x.",
- unsigned(expected),
- unsigned(m_space_flags));
- return(DB_CORRUPTION);
- }
- }
+ /* Check that the tablespace flags match the table flags. */
+ ulint expected = dict_tf_to_fsp_flags(m_table->flags);
+ if (!fsp_flags_match(expected, m_space_flags)) {
+ ib_errf(m_trx->mysql_thd, IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Expected FSP_SPACE_FLAGS=0x%x, .ibd "
+ "file contains 0x%x.",
+ unsigned(expected),
+ unsigned(m_space_flags));
+ return(DB_CORRUPTION);
}
return DB_SUCCESS;
@@ -692,11 +720,9 @@ Update the import configuration that will be used to import the tablespace.
dberr_t
FetchIndexRootPages::build_row_import(row_import* cfg) const UNIV_NOTHROW
{
- Indexes::const_iterator end = m_indexes.end();
-
ut_a(cfg->m_table == m_table);
cfg->m_page_size.copy_from(m_page_size);
- cfg->m_n_indexes = m_indexes.size();
+ cfg->m_n_indexes = 1;
if (cfg->m_n_indexes == 0) {
@@ -722,37 +748,32 @@ FetchIndexRootPages::build_row_import(row_import* cfg) const UNIV_NOTHROW
row_index_t* cfg_index = cfg->m_indexes;
- for (Indexes::const_iterator it = m_indexes.begin();
- it != end;
- ++it, ++cfg_index) {
+ char name[BUFSIZ];
- char name[BUFSIZ];
+ snprintf(name, sizeof(name), "index" IB_ID_FMT, m_index.m_id);
- snprintf(name, sizeof(name), "index" IB_ID_FMT, it->m_id);
+ ulint len = strlen(name) + 1;
- ulint len = strlen(name) + 1;
+ cfg_index->m_name = UT_NEW_ARRAY_NOKEY(byte, len);
- cfg_index->m_name = UT_NEW_ARRAY_NOKEY(byte, len);
-
- /* Trigger OOM */
- DBUG_EXECUTE_IF(
- "ib_import_OOM_12",
- UT_DELETE_ARRAY(cfg_index->m_name);
- cfg_index->m_name = NULL;
- );
+ /* Trigger OOM */
+ DBUG_EXECUTE_IF(
+ "ib_import_OOM_12",
+ UT_DELETE_ARRAY(cfg_index->m_name);
+ cfg_index->m_name = NULL;
+ );
- if (cfg_index->m_name == NULL) {
- return(DB_OUT_OF_MEMORY);
- }
+ if (cfg_index->m_name == NULL) {
+ return(DB_OUT_OF_MEMORY);
+ }
- memcpy(cfg_index->m_name, name, len);
+ memcpy(cfg_index->m_name, name, len);
- cfg_index->m_id = it->m_id;
+ cfg_index->m_id = m_index.m_id;
- cfg_index->m_space = m_space;
+ cfg_index->m_space = m_space;
- cfg_index->m_page_no = it->m_page_no;
- }
+ cfg_index->m_page_no = m_index.m_page_no;
return(DB_SUCCESS);
}
@@ -803,6 +824,11 @@ public:
return(m_cfg->m_table->space);
}
+ dberr_t run(const fil_iterator_t& iter, buf_block_t* block) UNIV_NOTHROW
+ {
+ return fil_iterate(iter, block, *this);
+ }
+
/** Called for each block as it is read from the file.
@param block block to convert, it is not from the buffer pool.
@retval DB_SUCCESS or error code. */
@@ -1873,10 +1899,13 @@ PageConverter::update_index_page(
if (is_free(block->page.id.page_no())) {
return(DB_SUCCESS);
} else if ((id = btr_page_get_index_id(page)) != m_index->m_id) {
-
row_index_t* index = find_index(id);
if (UNIV_UNLIKELY(!index)) {
+ if (m_cfg->m_missing) {
+ return DB_SUCCESS;
+ }
+
ib::error() << "Page for tablespace " << m_space
<< " is index page with id " << id
<< " but that index is not found from"
@@ -3362,20 +3391,6 @@ row_import_update_discarded_flag(
return(err);
}
-struct fil_iterator_t {
- pfs_os_file_t file; /*!< File handle */
- const char* filepath; /*!< File path name */
- os_offset_t start; /*!< From where to start */
- os_offset_t end; /*!< Where to stop */
- os_offset_t file_size; /*!< File size in bytes */
- ulint n_io_buffers; /*!< Number of pages to use
- for IO */
- byte* io_buffer; /*!< Buffer to use for IO */
- fil_space_crypt_t *crypt_data; /*!< Crypt data (if encrypted) */
- byte* crypt_io_buffer; /*!< IO buffer when encrypted */
-};
-
-
/** InnoDB writes page by page when there is page compressed
tablespace involved. It does help to save the disk space when
punch hole is enabled
@@ -3426,22 +3441,91 @@ dberr_t fil_import_compress_fwrite(const fil_iterator_t &iter,
return err;
}
-/********************************************************************//**
-TODO: This can be made parallel trivially by chunking up the file and creating
-a callback per thread. . Main benefit will be to use multiple CPUs for
-checksums and compressed tables. We have to do compressed tables block by
-block right now. Secondly we need to decompress/compress and copy too much
-of data. These are CPU intensive.
+dberr_t FetchIndexRootPages::run(const fil_iterator_t& iter,
+ buf_block_t* block) UNIV_NOTHROW
+{
+ const ulint size= get_page_size().physical();
+ const ulint buf_size = srv_page_size
+#ifdef HAVE_LZO
+ + LZO1X_1_15_MEM_COMPRESS
+#elif defined HAVE_SNAPPY
+ + snappy_max_compressed_length(srv_page_size)
+#endif
+ ;
+ byte* page_compress_buf = static_cast<byte*>(malloc(buf_size));
+ ut_ad(!srv_read_only_mode);
-Iterate over all the pages in the tablespace.
-@param iter - Tablespace iterator
-@param block - block to use for IO
-@param callback - Callback to inspect and update page contents
-@retval DB_SUCCESS or error code */
-static
-dberr_t
-fil_iterate(
-/*========*/
+ if (!page_compress_buf)
+ return DB_OUT_OF_MEMORY;
+
+ const bool encrypted= iter.crypt_data != NULL &&
+ iter.crypt_data->should_encrypt();
+ byte* const readptr= iter.io_buffer;
+ block->frame= readptr;
+
+ if (block->page.zip.data)
+ block->page.zip.data= readptr;
+
+ IORequest read_request(IORequest::READ);
+ read_request.disable_partial_io_warnings();
+ ulint page_no= 0;
+ bool page_compressed= false;
+
+ dberr_t err= os_file_read_no_error_handling(
+ read_request, iter.file, readptr, 3 * size, size, 0);
+ if (err != DB_SUCCESS)
+ {
+ ib::error() << iter.filepath << ": os_file_read() failed";
+ goto func_exit;
+ }
+
+ block->page.id.set_page_no(3);
+ page_no= page_get_page_no(readptr);
+
+ if (page_no != 3)
+ {
+page_corrupted:
+ ib::warn() << filename() << ": Page 3 at offset "
+ << 3 * size << " looks corrupted.";
+ err= DB_CORRUPTION;
+ goto func_exit;
+ }
+
+ page_compressed= fil_page_is_compressed_encrypted(readptr) ||
+ fil_page_is_compressed(readptr);
+
+ if (page_compressed && block->page.zip.data)
+ goto page_corrupted;
+
+ if (encrypted)
+ {
+ if (!fil_space_verify_crypt_checksum(readptr, get_page_size()))
+ goto page_corrupted;
+
+ if (!fil_space_decrypt(iter.crypt_data, readptr,
+ get_page_size(), readptr, &err) ||
+ err != DB_SUCCESS)
+ goto func_exit;
+ }
+
+ if (page_compressed)
+ {
+ ulint compress_length = fil_page_decompress(page_compress_buf, readptr);
+ ut_ad(compress_length != srv_page_size);
+ if (compress_length == 0)
+ goto page_corrupted;
+ }
+ else if (buf_page_is_corrupted(
+ false, readptr, get_page_size(), NULL))
+ goto page_corrupted;
+
+ err = this->operator()(block);
+func_exit:
+ free(page_compress_buf);
+ return err;
+}
+
+static dberr_t fil_iterate(
const fil_iterator_t& iter,
buf_block_t* block,
AbstractCallback& callback)
@@ -3877,7 +3961,7 @@ fil_tablespace_iterate(
block->page.zip.data = block->frame + UNIV_PAGE_SIZE;
}
- err = fil_iterate(iter, block, callback);
+ err = callback.run(iter, block);
if (iter.crypt_data) {
fil_space_destroy_crypt_data(&iter.crypt_data);
@@ -4022,6 +4106,16 @@ row_import_for_mysql(
cfg.m_page_size.copy_from(univ_page_size);
+ if (UT_LIST_GET_LEN(table->indexes) > 1) {
+ ib_errf(trx->mysql_thd, IB_LOG_LEVEL_ERROR,
+ ER_INTERNAL_ERROR,
+ "Drop all secondary indexes before importing "
+ "table %s when .cfg file is missing.",
+ table->name.m_name);
+ err = DB_ERROR;
+ return row_import_error(prebuilt, trx, err);
+ }
+
FetchIndexRootPages fetchIndexRootPages(table, trx);
err = fil_tablespace_iterate(
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 635e7f659eb..cbe6577c02a 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2020, MariaDB Corporation.
+Copyright (c) 2016, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -898,7 +898,6 @@ row_ins_invalidate_query_cache(
innobase_invalidate_query_cache(thr_get_trx(thr), name, len);
}
-
/** Fill virtual column information in cascade node for the child table.
@param[out] cascade child update node
@param[in] rec clustered rec of child table
@@ -945,6 +944,11 @@ row_ins_foreign_fill_virtual(
if (!record) {
return DB_OUT_OF_MEMORY;
}
+ ut_ad(!node->is_delete
+ || (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL));
+ ut_ad(foreign->type & (DICT_FOREIGN_ON_DELETE_SET_NULL
+ | DICT_FOREIGN_ON_UPDATE_SET_NULL
+ | DICT_FOREIGN_ON_UPDATE_CASCADE));
for (ulint i = 0; i < n_v_fld; i++) {
@@ -960,7 +964,7 @@ row_ins_foreign_fill_virtual(
dfield_t* vfield = innobase_get_computed_value(
update->old_vrow, col, index,
&vc.heap, update->heap, NULL, thd, mysql_table,
- record, NULL, NULL, NULL);
+ record, NULL, NULL);
if (vfield == NULL) {
return DB_COMPUTE_VALUE_FAILED;
@@ -969,23 +973,18 @@ row_ins_foreign_fill_virtual(
upd_field = update->fields + n_diff;
upd_field->old_v_val = static_cast<dfield_t*>(
- mem_heap_alloc(cascade->heap,
- sizeof *upd_field->old_v_val));
+ mem_heap_alloc(update->heap,
+ sizeof *upd_field->old_v_val));
dfield_copy(upd_field->old_v_val, vfield);
upd_field_set_v_field_no(upd_field, i, index);
- bool set_null =
- node->is_delete
- ? (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)
- : (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL);
-
dfield_t* new_vfield = innobase_get_computed_value(
update->old_vrow, col, index,
&vc.heap, update->heap, NULL, thd,
mysql_table, record, NULL,
- set_null ? update : node->update, foreign);
+ update);
if (new_vfield == NULL) {
return DB_COMPUTE_VALUE_FAILED;
@@ -3250,7 +3249,7 @@ row_ins_index_entry(
dtuple_t* entry, /*!< in/out: index entry to insert */
que_thr_t* thr) /*!< in: query thread */
{
- ut_ad(thr_get_trx(thr)->id != 0);
+ ut_ad(thr_get_trx(thr)->id != 0 || index->table->is_temporary());
DBUG_EXECUTE_IF("row_ins_index_entry_timeout", {
DBUG_SET("-d,row_ins_index_entry_timeout");
@@ -3613,12 +3612,16 @@ row_ins_step(
table during the search operation, and there is no need to set
it again here. But we must write trx->id to node->sys_buf. */
- trx_write_trx_id(&node->sys_buf[DATA_ROW_ID_LEN], trx->id);
+ trx_write_trx_id(&node->sys_buf[DATA_TRX_ID_LEN], trx->id);
if (node->state == INS_NODE_SET_IX_LOCK) {
node->state = INS_NODE_ALLOC_ROW_ID;
+ if (node->table->is_temporary()) {
+ node->trx_id = trx->id;
+ }
+
/* It may be that the current session has not yet started
its transaction, or it has been committed: */
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 835d74043fd..faa148cca24 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -524,7 +524,9 @@ row_merge_buf_add(
DBUG_ENTER("row_merge_buf_add");
if (buf->n_tuples >= buf->max_tuples) {
- DBUG_RETURN(0);
+error:
+ n_row_added = 0;
+ goto end;
}
DBUG_EXECUTE_IF(
@@ -598,8 +600,8 @@ row_merge_buf_add(
row_field = innobase_get_computed_value(
row, v_col, clust_index,
v_heap, NULL, ifield, trx->mysql_thd,
- my_table, vcol_storage.innobase_record,
- old_table, NULL, NULL);
+ my_table, vcol_storage.innobase_record,
+ old_table, NULL);
if (row_field == NULL) {
*err = DB_COMPUTE_VALUE_FAILED;
@@ -689,7 +691,10 @@ row_merge_buf_add(
continue;
}
- if (field->len != UNIV_SQL_NULL
+ /* innobase_get_computed_value() sets the
+ length of the virtual column field. */
+ if (v_col == NULL
+ && field->len != UNIV_SQL_NULL
&& col->mtype == DATA_MYSQL
&& col->len != field->len) {
if (conv_heap != NULL) {
@@ -845,11 +850,6 @@ end:
if (vcol_storage.innobase_record)
innobase_free_row_for_vcol(&vcol_storage);
DBUG_RETURN(n_row_added);
-
-error:
- if (vcol_storage.innobase_record)
- innobase_free_row_for_vcol(&vcol_storage);
- DBUG_RETURN(0);
}
/*************************************************************//**
@@ -2567,16 +2567,18 @@ write_buffers:
new_table, psort_info, row, ext,
&doc_id, conv_heap,
&err, &v_heap, eval_table, trx)))) {
- /* An empty buffer should have enough
- room for at least one record. */
- ut_error;
- }
-
- if (err != DB_SUCCESS) {
- break;
+ /* An empty buffer should have enough
+ room for at least one record. */
+ ut_ad(err == DB_COMPUTE_VALUE_FAILED
+ || err == DB_OUT_OF_MEMORY
+ || err == DB_TOO_BIG_RECORD);
+ } else if (err == DB_SUCCESS) {
+ file->n_rec += rows_added;
+ continue;
}
- file->n_rec += rows_added;
+ trx->error_key_num = i;
+ break;
}
}
@@ -3696,17 +3698,20 @@ row_merge_drop_indexes_dict(
trx->op_info = "";
}
-/*********************************************************************//**
-Drop indexes that were created before an error occurred.
+/** Drop indexes that were created before an error occurred.
The data dictionary must have been locked exclusively by the caller,
-because the transaction will not be committed. */
+because the transaction will not be committed.
+@param trx dictionary transaction
+@param table table containing the indexes
+@param locked True if table is locked,
+ false - may need to do lazy drop
+@param alter_trx Alter table transaction */
void
row_merge_drop_indexes(
-/*===================*/
- trx_t* trx, /*!< in/out: dictionary transaction */
- dict_table_t* table, /*!< in/out: table containing the indexes */
- ibool locked) /*!< in: TRUE=table locked,
- FALSE=may need to do a lazy drop */
+ trx_t* trx,
+ dict_table_t* table,
+ bool locked,
+ const trx_t* alter_trx)
{
dict_index_t* index;
dict_index_t* next_index;
@@ -3732,7 +3737,7 @@ row_merge_drop_indexes(
A concurrent purge will be prevented by dict_operation_lock. */
if (!locked && (table->get_ref_count() > 1
- || UT_LIST_GET_FIRST(table->locks))) {
+ || table->has_lock_other_than(alter_trx))) {
/* We will have to drop the indexes later, when the
table is guaranteed to be no longer in use. Mark the
indexes as incomplete and corrupted, so that other
@@ -4363,7 +4368,7 @@ row_merge_create_index(
dberr_t err;
ulint n_fields = index_def->n_fields;
ulint i;
- bool has_new_v_col = false;
+ ulint n_add_vcol = 0;
DBUG_ENTER("row_merge_create_index");
@@ -4391,7 +4396,7 @@ row_merge_create_index(
ut_ad(ifield->col_no >= table->n_v_def);
name = add_v->v_col_name[
ifield->col_no - table->n_v_def];
- has_new_v_col = true;
+ n_add_vcol++;
} else {
name = dict_table_get_v_col_name(
table, ifield->col_no);
@@ -4410,7 +4415,9 @@ row_merge_create_index(
if (err == DB_SUCCESS) {
ut_ad(index != index_template);
index->parser = index_def->parser;
- index->has_new_v_col = has_new_v_col;
+ if (n_add_vcol) {
+ index->assign_new_v_col(n_add_vcol);
+ }
/* Note the id of the transaction that created this
index, we use it to restrict readers from accessing
this index, to ensure read consistency. */
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index c2f9186d408..6445f67f3c2 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -1465,23 +1465,6 @@ error_exit:
trx->error_state = DB_FTS_INVALID_DOCID;
goto error_exit;
}
-
- /* Difference between Doc IDs are restricted within
- 4 bytes integer. See fts_get_encoded_len(). Consecutive
- doc_ids difference should not exceed
- FTS_DOC_ID_MAX_STEP value. */
-
- if (doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) {
- ib::error() << "Doc ID " << doc_id
- << " is too big. Its difference with"
- " largest used Doc ID "
- << next_doc_id - 1 << " cannot"
- " exceed or equal to "
- << FTS_DOC_ID_MAX_STEP;
- err = DB_FTS_INVALID_DOCID;
- trx->error_state = DB_FTS_INVALID_DOCID;
- goto error_exit;
- }
}
if (table->skip_alter_undo) {
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index e79784a5a5f..10a0b91f8f8 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -46,6 +46,7 @@ Created 3/14/1997 Heikki Tuuri
#include "handler.h"
#include "ha_innodb.h"
#include "fil0fil.h"
+#include "debug_sync.h"
/*************************************************************************
IMPORTANT NOTE: Any operation that generates redo MUST check that there
@@ -729,7 +730,7 @@ row_purge_skip_uncommitted_virtual_index(
not support LOCK=NONE when adding an index on newly
added virtual column.*/
while (index != NULL && dict_index_has_virtual(index)
- && !index->is_committed() && index->has_new_v_col) {
+ && !index->is_committed() && index->has_new_v_col()) {
index = dict_table_get_next_index(index);
}
}
@@ -1208,6 +1209,25 @@ row_purge_step(
node->start();
+#ifdef UNIV_DEBUG
+ srv_slot_t *slot = thr->thread_slot;
+ ut_ad(slot);
+
+ rw_lock_x_lock(&slot->debug_sync_lock);
+ while (UT_LIST_GET_LEN(slot->debug_sync)) {
+ srv_slot_t::debug_sync_t *sync =
+ UT_LIST_GET_FIRST(slot->debug_sync);
+ bool result = debug_sync_set_action(current_thd,
+ sync->str,
+ strlen(sync->str));
+ ut_a(!result);
+
+ UT_LIST_REMOVE(slot->debug_sync, sync);
+ ut_free(sync);
+ }
+ rw_lock_x_unlock(&slot->debug_sync_lock);
+#endif
+
if (!(node->undo_recs == NULL || ib_vector_is_empty(node->undo_recs))) {
trx_purge_rec_t*purge_rec;
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index 864f7bd54ab..87c67edff4b 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -79,9 +79,9 @@ is alphabetically the same as the corresponding BLOB column in the clustered
index record.
NOTE: the comparison is NOT done as a binary comparison, but character
fields are compared with collation!
-@return TRUE if the columns are equal */
+@return whether the columns are equal */
static
-ibool
+bool
row_sel_sec_rec_is_for_blob(
/*========================*/
ulint mtype, /*!< in: main type */
@@ -100,19 +100,18 @@ row_sel_sec_rec_is_for_blob(
const byte* sec_field, /*!< in: column in secondary index */
ulint sec_len, /*!< in: length of sec_field */
ulint prefix_len, /*!< in: index column prefix length
- in bytes */
+ in bytes, or 0 for full column */
dict_table_t* table) /*!< in: table */
{
ulint len;
- byte buf[REC_VERSION_56_MAX_INDEX_COL_LEN];
+ byte buf[REC_VERSION_56_MAX_INDEX_COL_LEN + 1];
/* This function should never be invoked on an Antelope format
table, because they should always contain enough prefix in the
clustered index record. */
ut_ad(dict_table_get_format(table) >= UNIV_FORMAT_B);
ut_a(clust_len >= BTR_EXTERN_FIELD_REF_SIZE);
- ut_ad(prefix_len >= sec_len);
- ut_ad(prefix_len > 0);
+ ut_ad(!prefix_len || prefix_len >= sec_len);
ut_a(prefix_len <= sizeof buf);
if (!memcmp(clust_field + clust_len - BTR_EXTERN_FIELD_REF_SIZE,
@@ -121,11 +120,12 @@ row_sel_sec_rec_is_for_blob(
This record should only be seen by
recv_recovery_rollback_active() or any
TRX_ISO_READ_UNCOMMITTED transactions. */
- return(FALSE);
+ return false;
}
len = btr_copy_externally_stored_field_prefix(
- buf, prefix_len, dict_tf_get_page_size(table->flags),
+ buf, prefix_len ? prefix_len : sizeof buf,
+ dict_tf_get_page_size(table->flags),
clust_field, clust_len);
if (len == 0) {
@@ -134,15 +134,91 @@ row_sel_sec_rec_is_for_blob(
referring to this clustered index record, because
btr_free_externally_stored_field() is called after all
secondary index entries of the row have been purged. */
- return(FALSE);
+ return false;
}
- len = dtype_get_at_most_n_mbchars(prtype, mbminlen, mbmaxlen,
- prefix_len, len, (const char*) buf);
+ if (prefix_len) {
+ len = dtype_get_at_most_n_mbchars(prtype, mbminlen, mbmaxlen,
+ prefix_len, len,
+ reinterpret_cast<const char*>
+ (buf));
+ } else if (len >= sizeof buf) {
+ ut_ad("too long column" == 0);
+ return false;
+ }
return(!cmp_data_data(mtype, prtype, buf, len, sec_field, sec_len));
}
+/** Function to read the secondary spatial index, calculate
+the minimum bounding rectangle for clustered index record
+and secondary index record and compare it.
+@param sec_rec secondary index record
+@param sec_index spatial secondary index
+@param clust_rec clustered index record
+@param clust_index clustered index
+@retval DB_SUCCESS_LOCKED_REC if the secondary record is equal to the
+ corresponding fields in the clustered record, when compared with
+ collation;
+@retval DB_SUCCESS if not equal */
+static
+dberr_t
+row_sel_spatial_sec_rec_is_for_clust_rec(
+ const rec_t *sec_rec, const dict_index_t *sec_index,
+ const rec_t *clust_rec, dict_index_t *clust_index)
+{
+ mem_heap_t *heap= mem_heap_create(256);
+ rec_offs clust_offsets_[REC_OFFS_NORMAL_SIZE];
+ rec_offs *clust_offs= clust_offsets_;
+ ulint clust_len;
+
+ rec_offs_init(clust_offsets_);
+ ulint clust_pos= dict_col_get_clust_pos(
+ dict_index_get_nth_col(sec_index, 0), clust_index);
+ clust_offs= rec_get_offsets(clust_rec, clust_index, clust_offs,
+ true, clust_pos + 1, &heap);
+ ut_ad(sec_index->n_user_defined_cols == 1);
+ const byte *clust_field= rec_get_nth_field(clust_rec, clust_offs,
+ clust_pos, &clust_len);
+ if (clust_len == UNIV_SQL_NULL || clust_len < GEO_DATA_HEADER_SIZE)
+ {
+ ut_ad("corrupted geometry column" == 0);
+err_exit:
+ mem_heap_free(heap);
+ return DB_SUCCESS;
+ }
+
+ /* For externally stored field, we need to get full
+ geo data to generate the MBR for comparing. */
+ if (rec_offs_nth_extern(clust_offs, clust_pos))
+ {
+ clust_field= btr_copy_externally_stored_field(
+ &clust_len, clust_field, dict_table_page_size(sec_index->table),
+ clust_len, heap);
+ if (clust_field == NULL)
+ {
+ ut_ad("corrupted geometry blob" == 0);
+ goto err_exit;
+ }
+ }
+
+ ut_ad(clust_len >= GEO_DATA_HEADER_SIZE);
+ rtr_mbr_t tmp_mbr;
+ rtr_mbr_t sec_mbr;
+
+ rtree_mbr_from_wkb(
+ clust_field + GEO_DATA_HEADER_SIZE,
+ static_cast<uint>(clust_len - GEO_DATA_HEADER_SIZE),
+ SPDIMS, reinterpret_cast<double*>(&tmp_mbr));
+
+ rtr_read_mbr(sec_rec, &sec_mbr);
+
+ mem_heap_free(heap);
+ return MBR_EQUAL_CMP(&sec_mbr, &tmp_mbr)
+ ? DB_SUCCESS_LOCKED_REC
+ : DB_SUCCESS;
+}
+
/** Returns TRUE if the user-defined column values in a secondary index record
are alphabetically the same as the corresponding columns in the clustered
index record.
@@ -170,12 +246,31 @@ row_sel_sec_rec_is_for_clust_rec(
dict_index_t* clust_index,
que_thr_t* thr)
{
+ if (rec_get_deleted_flag(clust_rec,
+ dict_table_is_comp(clust_index->table))) {
+ /* In delete-marked records, DB_TRX_ID must
+ always refer to an existing undo log record. */
+ ut_ad(rec_get_trx_id(clust_rec, clust_index));
+
+ /* The clustered index record is delete-marked;
+ it is not visible in the read view. Besides,
+ if there are any externally stored columns,
+ some of them may have already been purged. */
+ return DB_SUCCESS;
+ }
+
+ if (sec_index->is_spatial()) {
+ return row_sel_spatial_sec_rec_is_for_clust_rec(
+ sec_rec, sec_index, clust_rec,
+ clust_index);
+ }
+
const byte* sec_field;
ulint sec_len;
const byte* clust_field;
ulint n;
ulint i;
- mem_heap_t* heap = NULL;
+ mem_heap_t* heap = mem_heap_create(256);
rec_offs clust_offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs sec_offsets_[REC_OFFS_SMALL_SIZE];
rec_offs* clust_offs = clust_offsets_;
@@ -184,20 +279,7 @@ row_sel_sec_rec_is_for_clust_rec(
rec_offs_init(clust_offsets_);
rec_offs_init(sec_offsets_);
- if (rec_get_deleted_flag(clust_rec,
- dict_table_is_comp(clust_index->table))) {
- /* In delete-marked records, DB_TRX_ID must
- always refer to an existing undo log record. */
- ut_ad(rec_get_trx_id(clust_rec, clust_index));
- /* The clustered index record is delete-marked;
- it is not visible in the read view. Besides,
- if there are any externally stored columns,
- some of them may have already been purged. */
- return DB_SUCCESS;
- }
-
- heap = mem_heap_create(256);
ib_vcol_row vc(heap);
clust_offs = rec_get_offsets(clust_rec, clust_index, clust_offs,
@@ -218,6 +300,8 @@ row_sel_sec_rec_is_for_clust_rec(
ifield = dict_index_get_nth_field(sec_index, i);
col = dict_field_get_col(ifield);
+ sec_field = rec_get_nth_field(sec_rec, sec_offs, i, &sec_len);
+
is_virtual = dict_col_is_virtual(col);
/* For virtual column, its value will need to be
@@ -244,90 +328,67 @@ row_sel_sec_rec_is_for_clust_rec(
&heap, NULL, NULL,
thr_get_trx(thr)->mysql_thd,
thr->prebuilt->m_mysql_table,
- record, NULL, NULL, NULL);
+ record, NULL, NULL);
if (vfield == NULL) {
innobase_report_computed_value_failed(row);
return DB_COMPUTE_VALUE_FAILED;
}
- clust_len = vfield->len;
+ len = clust_len = vfield->len;
clust_field = static_cast<byte*>(vfield->data);
} else {
clust_pos = dict_col_get_clust_pos(col, clust_index);
clust_field = rec_get_nth_field(
clust_rec, clust_offs, clust_pos, &clust_len);
- }
-
- sec_field = rec_get_nth_field(sec_rec, sec_offs, i, &sec_len);
-
- len = clust_len;
-
- if (ifield->prefix_len > 0 && len != UNIV_SQL_NULL
- && sec_len != UNIV_SQL_NULL && !is_virtual) {
+ if (clust_len == UNIV_SQL_NULL) {
+ if (sec_len == UNIV_SQL_NULL) {
+ continue;
+ }
+ return DB_SUCCESS;
+ }
+ if (sec_len == UNIV_SQL_NULL) {
+ return DB_SUCCESS;
+ }
+ len = clust_len;
if (rec_offs_nth_extern(clust_offs, clust_pos)) {
len -= BTR_EXTERN_FIELD_REF_SIZE;
}
- len = dtype_get_at_most_n_mbchars(
- col->prtype, col->mbminlen, col->mbmaxlen,
- ifield->prefix_len, len, (char*) clust_field);
-
- if (rec_offs_nth_extern(clust_offs, clust_pos)
- && len < sec_len) {
- if (!row_sel_sec_rec_is_for_blob(
- col->mtype, col->prtype,
- col->mbminlen, col->mbmaxlen,
- clust_field, clust_len,
- sec_field, sec_len,
- ifield->prefix_len,
- clust_index->table)) {
- return DB_SUCCESS;
+ if (ulint prefix_len = ifield->prefix_len) {
+ len = dtype_get_at_most_n_mbchars(
+ col->prtype, col->mbminlen,
+ col->mbmaxlen, prefix_len, len,
+ reinterpret_cast<const char*>(
+ clust_field));
+ if (len < sec_len) {
+ goto check_for_blob;
}
+ } else {
+check_for_blob:
+ if (rec_offs_nth_extern(clust_offs,
+ clust_pos)) {
+ if (!row_sel_sec_rec_is_for_blob(
+ col->mtype, col->prtype,
+ col->mbminlen,
+ col->mbmaxlen,
+ clust_field, clust_len,
+ sec_field, sec_len,
+ prefix_len,
+ clust_index->table)) {
+ return DB_SUCCESS;
+ }
- continue;
+ continue;
+ }
}
}
- /* For spatial index, the first field is MBR, we check
- if the MBR is equal or not. */
- if (dict_index_is_spatial(sec_index) && i == 0) {
- rtr_mbr_t tmp_mbr;
- rtr_mbr_t sec_mbr;
- byte* dptr =
- const_cast<byte*>(clust_field);
-
- ut_ad(clust_len != UNIV_SQL_NULL);
-
- /* For externally stored field, we need to get full
- geo data to generate the MBR for comparing. */
- if (rec_offs_nth_extern(clust_offs, clust_pos)) {
- dptr = btr_copy_externally_stored_field(
- &clust_len, dptr,
- dict_tf_get_page_size(
- sec_index->table->flags),
- len, heap);
- }
-
- rtree_mbr_from_wkb(dptr + GEO_DATA_HEADER_SIZE,
- static_cast<uint>(clust_len
- - GEO_DATA_HEADER_SIZE),
- SPDIMS,
- reinterpret_cast<double*>(
- &tmp_mbr));
- rtr_read_mbr(sec_field, &sec_mbr);
-
- if (!MBR_EQUAL_CMP(&sec_mbr, &tmp_mbr)) {
- return DB_SUCCESS;
- }
- } else {
-
- if (0 != cmp_data_data(col->mtype, col->prtype,
- clust_field, len,
- sec_field, sec_len)) {
- return DB_SUCCESS;
- }
+ if (0 != cmp_data_data(col->mtype, col->prtype,
+ clust_field, len,
+ sec_field, sec_len)) {
+ return DB_SUCCESS;
}
}
diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc
index 915d4b99d16..8c944189de6 100644
--- a/storage/innobase/row/row0uins.cc
+++ b/storage/innobase/row/row0uins.cc
@@ -106,7 +106,7 @@ row_undo_ins_remove_clust_rec(
btr_cur = btr_pcur_get_btr_cur(&node->pcur);
ut_ad(rec_get_trx_id(btr_cur_get_rec(btr_cur), btr_cur->index)
- == node->trx->id);
+ == node->trx->id || node->table->is_temporary());
ut_ad(!rec_get_deleted_flag(
btr_cur_get_rec(btr_cur),
dict_table_is_comp(btr_cur->index->table)));
diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc
index 80d90f40379..6ccb2250c05 100644
--- a/storage/innobase/row/row0umod.cc
+++ b/storage/innobase/row/row0umod.cc
@@ -109,7 +109,8 @@ row_undo_mod_clust_low(
ut_ad(success);
ut_ad(rec_get_trx_id(btr_cur_get_rec(btr_cur),
btr_cur_get_index(btr_cur))
- == thr_get_trx(thr)->id);
+ == thr_get_trx(thr)->id
+ || btr_cur_get_index(btr_cur)->table->is_temporary());
if (mode != BTR_MODIFY_LEAF
&& dict_index_is_online_ddl(btr_cur_get_index(btr_cur))) {
diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc
index b65b173fedb..e1978cfb297 100644
--- a/storage/innobase/row/row0undo.cc
+++ b/storage/innobase/row/row0undo.cc
@@ -194,7 +194,7 @@ row_undo_search_clust_to_pcur(
if (found) {
ut_ad(row_get_rec_trx_id(rec, clust_index, offsets)
- == node->trx->id);
+ == node->trx->id || node->table->is_temporary());
if (dict_table_get_format(node->table) >= UNIV_FORMAT_B) {
/* In DYNAMIC or COMPRESSED format, there is
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 4b81d1478b0..0a79225da8c 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -52,6 +52,11 @@ Created 12/27/1996 Heikki Tuuri
#include <algorithm>
#include <mysql/plugin.h>
#include <mysql/service_wsrep.h>
+#ifdef WITH_WSREP
+#include "log.h"
+#include "wsrep.h"
+#endif /* WITH_WSREP */
+
/* What kind of latch and lock can we assume when the control comes to
-------------------------------------------------------------------
@@ -549,7 +554,7 @@ row_upd_index_entry_sys_field(
field = static_cast<byte*>(dfield_get_data(dfield));
if (type == DATA_TRX_ID) {
- ut_ad(val > 0);
+ ut_ad(val > 0 || index->table->is_temporary());
trx_write_trx_id(field, val);
} else {
ut_ad(type == DATA_ROLL_PTR);
@@ -1144,7 +1149,7 @@ row_upd_build_difference_binary(
dfield_t* vfield = innobase_get_computed_value(
update->old_vrow, col, index,
&vc.heap, heap, NULL, thd, mysql_table, record,
- NULL, NULL, NULL);
+ NULL, NULL);
if (vfield == NULL) {
*error = DB_COMPUTE_VALUE_FAILED;
return(NULL);
@@ -2170,8 +2175,7 @@ row_upd_store_v_row(
node->row, col, index,
&vc.heap, node->heap,
NULL, thd, mysql_table,
- record, NULL, NULL,
- NULL);
+ record, NULL, NULL);
if (vfield == NULL) {
return false;
}
@@ -2461,34 +2465,30 @@ row_upd_sec_index_entry(
err = DB_SUCCESS;
break;
case DB_LOCK_WAIT:
- if (UNIV_UNLIKELY(wsrep_debug)) {
- ib::warn() << "WSREP: sec index FK lock wait"
- << " index " << index->name
- << " table " << index->table->name
- << " query " << wsrep_thd_query(trx->mysql_thd);
- }
- break;
case DB_DEADLOCK:
- if (UNIV_UNLIKELY(wsrep_debug)) {
- ib::warn() << "WSREP: sec index FK check fail for deadlock"
- << " index " << index->name
- << " table " << index->table->name
- << " query " << wsrep_thd_query(trx->mysql_thd);
- }
+ case DB_LOCK_WAIT_TIMEOUT:
+ WSREP_DEBUG("Foreign key check fail: "
+ "%s on table %s index %s query %s",
+ ut_strerr(err), index->name(), index->table->name.m_name,
+ wsrep_thd_query(trx->mysql_thd));
break;
default:
- ib::error() << "WSREP: referenced FK check fail: " << err
- << " index " << index->name
- << " table " << index->table->name
- << " query " << wsrep_thd_query(trx->mysql_thd);
-
+ WSREP_ERROR("Foreign key check fail: "
+ "%s on table %s index %s query %s",
+ ut_strerr(err), index->name(), index->table->name.m_name,
+ wsrep_thd_query(trx->mysql_thd));
break;
}
}
#endif /* WITH_WSREP */
}
+#ifdef WITH_WSREP
+ ut_ad(err == DB_SUCCESS || err == DB_LOCK_WAIT
+ || err == DB_DEADLOCK || err == DB_LOCK_WAIT_TIMEOUT);
+#else
ut_ad(err == DB_SUCCESS);
+#endif
if (referenced) {
@@ -2800,17 +2800,21 @@ check_fk:
case DB_NO_REFERENCED_ROW:
err = DB_SUCCESS;
break;
+ case DB_LOCK_WAIT:
case DB_DEADLOCK:
- if (UNIV_UNLIKELY(wsrep_debug)) {
- ib::warn() << "WSREP: sec index FK check fail for deadlock"
- << " index " << index->name
- << " table " << index->table->name;
- }
+ case DB_LOCK_WAIT_TIMEOUT:
+ WSREP_DEBUG("Foreign key check fail: "
+ "%s on table %s index %s query %s",
+ ut_strerr(err), index->name(), index->table->name.m_name,
+ wsrep_thd_query(trx->mysql_thd));
+
goto err_exit;
default:
- ib::error() << "WSREP: referenced FK check fail: " << err
- << " index " << index->name
- << " table " << index->table->name;
+ WSREP_ERROR("Foreign key check fail: "
+ "%s on table %s index %s query %s",
+ ut_strerr(err), index->name(), index->table->name.m_name,
+ wsrep_thd_query(trx->mysql_thd));
+
goto err_exit;
}
#endif /* WITH_WSREP */
@@ -3027,18 +3031,19 @@ row_upd_del_mark_clust_rec(
case DB_NO_REFERENCED_ROW:
err = DB_SUCCESS;
break;
+ case DB_LOCK_WAIT:
case DB_DEADLOCK:
- if (UNIV_UNLIKELY(wsrep_debug)) {
- ib::warn() << "WSREP: sec index FK check fail for deadlock"
- << " index " << index->name
- << " table " << index->table->name;
- }
+ case DB_LOCK_WAIT_TIMEOUT:
+ WSREP_DEBUG("Foreign key check fail: "
+ "%d on table %s index %s query %s",
+ err, index->name(), index->table->name.m_name,
+ wsrep_thd_query(trx->mysql_thd));
break;
default:
- ib::error() << "WSREP: referenced FK check fail: " << err
- << " index " << index->name
- << " table " << index->table->name;
-
+ WSREP_ERROR("Foreign key check fail: "
+ "%d on table %s index %s query %s",
+ err, index->name(), index->table->name.m_name,
+ wsrep_thd_query(trx->mysql_thd));
break;
}
#endif /* WITH_WSREP */
diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index 2d8704764d1..bf229966525 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -467,6 +467,7 @@ row_vers_build_clust_v_col(
vcol_info->set_used();
maria_table = vcol_info->table();
}
+ DEBUG_SYNC(current_thd, "ib_clust_v_col_before_row_allocated");
ib_vcol_row vc(NULL);
byte *record = vc.record(thd, index, &maria_table);
@@ -490,7 +491,7 @@ row_vers_build_clust_v_col(
dfield_t *vfield = innobase_get_computed_value(
row, col, clust_index, &vc.heap,
heap, NULL, thd, maria_table, record, NULL,
- NULL, NULL);
+ NULL);
if (vfield == NULL) {
innobase_report_computed_value_failed(row);
ut_ad(0);
diff --git a/storage/innobase/snappy.cmake b/storage/innobase/snappy.cmake
index 2810472cef6..3a2d828ee5c 100644
--- a/storage/innobase/snappy.cmake
+++ b/storage/innobase/snappy.cmake
@@ -21,12 +21,14 @@ MACRO (MYSQL_CHECK_SNAPPY)
CHECK_LIBRARY_EXISTS(snappy snappy_uncompress "" HAVE_SNAPPY_SHARED_LIB)
IF(HAVE_SNAPPY_SHARED_LIB AND HAVE_SNAPPY_H)
+ SET(HAVE_INNODB_SNAPPY TRUE)
ADD_DEFINITIONS(-DHAVE_SNAPPY=1)
LINK_LIBRARIES(snappy)
ELSE()
IF (WITH_INNODB_SNAPPY STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required snappy library is not found")
+ MESSAGE(FATAL_ERROR "Required snappy library is not found")
ENDIF()
ENDIF()
ENDIF()
+ ADD_FEATURE_INFO(INNODB_SNAPPY HAVE_INNODB_SNAPPY "Snappy compression in the InnoDB storage engine")
ENDMACRO()
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 44e0946f067..56c717e142b 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -2601,6 +2601,13 @@ DECLARE_THREAD(srv_worker_thread)(
slot = srv_reserve_slot(SRV_WORKER);
+#ifdef UNIV_DEBUG
+ UT_LIST_INIT(slot->debug_sync,
+ &srv_slot_t::debug_sync_t::debug_sync_list);
+ rw_lock_create(PFS_NOT_INSTRUMENTED, &slot->debug_sync_lock,
+ SYNC_NO_ORDER_CHECK);
+#endif
+
ut_a(srv_n_purge_threads > 1);
ut_a(ulong(my_atomic_loadlint(&srv_sys.n_threads_active[SRV_WORKER]))
< srv_n_purge_threads);
@@ -2625,6 +2632,8 @@ DECLARE_THREAD(srv_worker_thread)(
purge_sys->latch here. */
} while (purge_sys->state != PURGE_STATE_EXIT);
+ ut_d(rw_lock_free(&slot->debug_sync_lock));
+
srv_free_slot(slot);
rw_lock_x_lock(&purge_sys->latch);
@@ -2848,6 +2857,12 @@ DECLARE_THREAD(srv_purge_coordinator_thread)(
slot = srv_reserve_slot(SRV_PURGE);
+#ifdef UNIV_DEBUG
+ UT_LIST_INIT(slot->debug_sync,
+ &srv_slot_t::debug_sync_t::debug_sync_list);
+ rw_lock_create(PFS_NOT_INSTRUMENTED, &slot->debug_sync_lock,
+ SYNC_NO_ORDER_CHECK);
+#endif
ulint rseg_history_len = trx_sys->rseg_history_len;
do {
@@ -2881,6 +2896,8 @@ DECLARE_THREAD(srv_purge_coordinator_thread)(
shutdown state. */
ut_a(srv_get_task_queue_length() == 0);
+ ut_d(rw_lock_free(&slot->debug_sync_lock));
+
srv_free_slot(slot);
/* Note that we are shutting down. */
diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc
index 2b9d6c96acd..05579aeb223 100644
--- a/storage/innobase/trx/trx0i_s.cc
+++ b/storage/innobase/trx/trx0i_s.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -577,7 +577,7 @@ thd_done:
row->trx_is_read_only = trx->read_only;
- row->trx_is_autocommit_non_locking = trx_is_autocommit_non_locking(trx);
+ row->trx_is_autocommit_non_locking = trx->is_autocommit_non_locking();
return(TRUE);
}
@@ -1259,7 +1259,21 @@ fetch_data_into_cache_low(
continue;
}
- assert_trx_nonlocking_or_in_list(trx);
+
+#ifdef UNIV_DEBUG
+ if (trx->is_autocommit_non_locking()) {
+ ut_ad(trx->read_only);
+ ut_ad(!trx->is_recovered);
+ ut_ad(trx->mysql_thd);
+ ut_ad(trx->in_mysql_trx_list);
+ const trx_state_t state = trx->state;
+ ut_ad(state == TRX_STATE_NOT_STARTED
+ || state == TRX_STATE_ACTIVE);
+ }
+ else {
+ ut_ad(trx->state != TRX_STATE_NOT_STARTED);
+ }
+#endif /* UNIV_DEBUG */
ut_ad(trx->in_rw_trx_list == rw_trx_list);
diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc
index 2025ac70beb..a9593807d53 100644
--- a/storage/innobase/trx/trx0purge.cc
+++ b/storage/innobase/trx/trx0purge.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -1062,26 +1062,11 @@ trx_purge_initiate_truncate(
rseg->last_del_marks = FALSE;
}
- mtr.commit();
- /* Write-ahead the redo log record. */
- log_write_up_to(mtr.commit_lsn(), true);
+ mtr.commit_shrink(*space);
- /* Trim the file size. */
- os_file_truncate(file->name, file->handle,
- os_offset_t(size) << srv_page_size_shift, true);
-
- /* This is only executed by the srv_purge_coordinator_thread. */
+ /* No mutex; this is only updated by the purge coordinator. */
export_vars.innodb_undo_truncations++;
- /* TODO: PUNCH_HOLE the garbage (with write-ahead logging) */
-
- mutex_enter(&fil_system->mutex);
- ut_ad(space->stop_new_ops);
- ut_ad(space->is_being_truncated);
- space->stop_new_ops = false;
- space->is_being_truncated = false;
- mutex_exit(&fil_system->mutex);
-
if (purge_sys->rseg != NULL
&& purge_sys->rseg->last_page_no == FIL_NULL) {
/* If purge_sys->rseg is pointing to rseg that was recently
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc
index c5f70452bf2..ec2d3c1d03f 100644
--- a/storage/innobase/trx/trx0roll.cc
+++ b/storage/innobase/trx/trx0roll.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2020, MariaDB Corporation.
+Copyright (c) 2016, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -81,12 +81,19 @@ trx_rollback_to_savepoint_low(
heap = mem_heap_create(512);
roll_node = roll_node_create(heap);
+ ut_ad(!trx->in_rollback);
if (savept != NULL) {
roll_node->savept = savept;
- check_trx_state(trx);
+ ut_ad(trx->mysql_thd);
+ ut_ad(trx->in_mysql_trx_list);
+ ut_ad(!trx->is_recovered);
+ ut_ad(trx->state == TRX_STATE_ACTIVE);
} else {
- assert_trx_nonlocking_or_in_list(trx);
+ ut_d(trx_state_t state = trx->state);
+ ut_ad(state == TRX_STATE_ACTIVE
+ || state == TRX_STATE_PREPARED
+ || state == TRX_STATE_PREPARED_RECOVERED);
}
trx->error_state = DB_SUCCESS;
@@ -187,7 +194,8 @@ dberr_t trx_rollback_for_mysql(trx_t* trx)
switch (trx->state) {
case TRX_STATE_NOT_STARTED:
- trx->will_lock = 0;
+ trx->will_lock = false;
+ ut_ad(trx->mysql_thd);
ut_ad(trx->in_mysql_trx_list);
#ifdef WITH_WSREP
trx->wsrep = false;
@@ -196,12 +204,14 @@ dberr_t trx_rollback_for_mysql(trx_t* trx)
case TRX_STATE_ACTIVE:
ut_ad(trx->in_mysql_trx_list);
- assert_trx_nonlocking_or_in_list(trx);
+ ut_ad(trx->mysql_thd);
+ ut_ad(!trx->is_recovered);
+ ut_ad(!trx->is_autocommit_non_locking() || trx->read_only);
return(trx_rollback_for_mysql_low(trx));
case TRX_STATE_PREPARED:
case TRX_STATE_PREPARED_RECOVERED:
- ut_ad(!trx_is_autocommit_non_locking(trx));
+ ut_ad(!trx->is_autocommit_non_locking());
if (trx->has_logged_persistent()) {
/* The XA ROLLBACK of a XA PREPARE transaction
will consist of multiple mini-transactions.
@@ -245,7 +255,7 @@ dberr_t trx_rollback_for_mysql(trx_t* trx)
return(trx_rollback_for_mysql_low(trx));
case TRX_STATE_COMMITTED_IN_MEMORY:
- check_trx_state(trx);
+ ut_ad(!trx->is_autocommit_non_locking());
break;
}
@@ -274,7 +284,9 @@ trx_rollback_last_sql_stat_for_mysql(
return(DB_SUCCESS);
case TRX_STATE_ACTIVE:
- assert_trx_nonlocking_or_in_list(trx);
+ ut_ad(trx->mysql_thd);
+ ut_ad(!trx->is_recovered);
+ ut_ad(!trx->is_autocommit_non_locking() || trx->read_only);
trx->op_info = "rollback of SQL statement";
@@ -677,7 +689,8 @@ ibool
trx_rollback_resurrected(
/*=====================*/
trx_t* trx, /*!< in: transaction to rollback or clean */
- ibool* all) /*!< in/out: FALSE=roll back dictionary transactions;
+ ibool* all) /*!< in/out: FALSE=roll back dictionary and
+ statistics table transactions;
TRUE=roll back all non-PREPARED transactions */
{
ut_ad(trx_sys_mutex_own());
@@ -713,7 +726,8 @@ fake_prepared:
}
trx_mutex_exit(trx);
- if (*all || trx_get_dict_operation(trx) != TRX_DICT_OP_NONE) {
+ if (*all || trx_get_dict_operation(trx) != TRX_DICT_OP_NONE
+ || trx->has_stats_table_lock()) {
trx_sys_mutex_exit();
trx_rollback_active(trx);
if (trx->error_state != DB_SUCCESS) {
@@ -766,7 +780,11 @@ trx_roll_must_shutdown()
t != NULL;
t = UT_LIST_GET_NEXT(trx_list, t)) {
- assert_trx_in_rw_list(t);
+ ut_ad(!t->read_only);
+ ut_ad(t->in_rw_trx_list);
+ ut_ad(!t->is_autocommit_non_locking());
+ ut_ad(t->state != TRX_STATE_NOT_STARTED);
+
if (t->is_recovered
&& trx_state_eq(t, TRX_STATE_ACTIVE)) {
n_trx++;
@@ -829,7 +847,10 @@ trx_rollback_or_clean_recovered(
trx != NULL;
trx = UT_LIST_GET_NEXT(trx_list, trx)) {
- assert_trx_in_rw_list(trx);
+ ut_ad(!trx->read_only);
+ ut_ad(trx->in_rw_trx_list);
+ ut_ad(!trx->is_autocommit_non_locking());
+ ut_ad(trx->state != TRX_STATE_NOT_STARTED);
/* If this function does a cleanup or rollback
then it will release the trx_sys->mutex, therefore
diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc
index 8d00bd824a2..c8c68c37333 100644
--- a/storage/innobase/trx/trx0sys.cc
+++ b/storage/innobase/trx/trx0sys.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -513,7 +513,9 @@ trx_sys_init_at_db_start()
trx = UT_LIST_GET_NEXT(trx_list, trx)) {
ut_ad(trx->is_recovered);
- assert_trx_in_rw_list(trx);
+ ut_ad(!trx->read_only);
+ ut_ad(trx->in_rw_trx_list);
+ ut_ad(!trx->is_autocommit_non_locking());
if (trx_state_eq(trx, TRX_STATE_ACTIVE)) {
rows_to_undo += trx->undo_no;
@@ -997,11 +999,6 @@ trx_sys_any_active_transactions(void)
/* This may count some ACTIVE transactions twice,
both in rw_trx_list and mysql_trx_list. */
total_trx += trx->state == TRX_STATE_ACTIVE;
- /* Any PREPARED or COMMITTED transactions must be
- in rw_trx_list, so it suffices to count them there. */
- ut_ad(trx->in_rw_trx_list
- || trx->state == TRX_STATE_NOT_STARTED
- || trx->state == TRX_STATE_ACTIVE);
trx_mutex_exit(trx);
}
@@ -1031,7 +1028,8 @@ trx_sys_validate_trx_list_low(
trx != NULL;
prev_trx = trx, trx = UT_LIST_GET_NEXT(trx_list, prev_trx)) {
- check_trx_state(trx);
+ ut_ad(!trx->is_autocommit_non_locking());
+ ut_ad(trx->state != TRX_STATE_NOT_STARTED);
ut_a(prev_trx == NULL || prev_trx->id > trx->id);
}
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 42bd67cb24b..6669d15a31b 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -133,7 +133,7 @@ trx_init(
trx->auto_commit = false;
- trx->will_lock = 0;
+ trx->will_lock = false;
trx->ddl = false;
@@ -336,13 +336,13 @@ trx_t *trx_allocate_for_background()
MEM_MAKE_DEFINED(trx, sizeof *trx);
#endif
- assert_trx_is_free(trx);
+ trx->assert_freed();
mem_heap_t* heap;
ib_alloc_t* alloc;
/* We just got trx from pool, it should be non locking */
- ut_ad(trx->will_lock == 0);
+ ut_ad(!trx->will_lock);
ut_ad(trx->state == TRX_STATE_NOT_STARTED);
DBUG_LOG("trx", "Create: " << trx);
@@ -369,7 +369,8 @@ trx_t *trx_allocate_for_background()
/** Free the memory to trx_pools */
inline void trx_t::free()
{
- assert_trx_is_inactive(this);
+ assert_freed();
+ ut_ad(!dict_operation_lock_mode);
MEM_CHECK_DEFINED(this, sizeof *this);
@@ -539,7 +540,8 @@ trx_validate_state_before_free(trx_t* trx)
}
trx->dict_operation = TRX_DICT_OP_NONE;
- assert_trx_is_inactive(trx);
+ trx->assert_freed();
+ ut_ad(!trx->dict_operation_lock_mode);
}
/** Free and initialize a transaction object instantinated during recovery.
@@ -636,7 +638,9 @@ trx_free_prepared(
trx->release_locks();
trx_undo_free_prepared(trx);
- assert_trx_in_rw_list(trx);
+ ut_ad(!trx->read_only);
+ ut_ad(trx->in_rw_trx_list);
+ ut_ad(!trx->is_autocommit_non_locking());
ut_a(!trx->read_only);
@@ -685,7 +689,7 @@ trx_disconnect_from_mysql(
trx->is_recovered = true;
trx->mysql_thd = NULL;
/* todo/fixme: suggest to do it at innodb prepare */
- trx->will_lock = 0;
+ trx->will_lock = false;
}
trx_sys_mutex_exit();
@@ -1177,11 +1181,10 @@ void trx_t::remove_flush_observer()
/** Assign a rollback segment for modifying temporary tables.
@return the assigned rollback segment */
-trx_rseg_t*
-trx_t::assign_temp_rseg()
+trx_rseg_t *trx_t::assign_temp_rseg()
{
ut_ad(!rsegs.m_noredo.rseg);
- ut_ad(!trx_is_autocommit_non_locking(this));
+ ut_ad(!is_autocommit_non_locking());
compile_time_assert(ut_is_2pow(TRX_SYS_N_RSEGS));
/* Choose a temporary rollback segment between 0 and 127
@@ -1235,8 +1238,8 @@ trx_start_low(
&& thd_trx_is_read_only(trx->mysql_thd));
if (!trx->auto_commit) {
- ++trx->will_lock;
- } else if (trx->will_lock == 0) {
+ trx->will_lock = true;
+ } else if (!trx->will_lock) {
trx->read_only = true;
}
@@ -1305,7 +1308,7 @@ trx_start_low(
trx_sys_mutex_exit();
} else {
- if (!trx_is_autocommit_non_locking(trx)) {
+ if (!trx->is_autocommit_non_locking()) {
/* If this is a read-only transaction that is writing
to a temporary table then it needs a transaction id
@@ -1559,12 +1562,12 @@ trx_flush_log_if_needed_low(
bool flush = srv_file_flush_method != SRV_NOSYNC;
switch (srv_flush_log_at_trx_commit) {
- case 3:
case 2:
/* Write the log but do not flush it to disk */
flush = false;
/* fall through */
case 1:
+ case 3:
/* Write the log and optionally flush it to disk */
log_write_up_to(lsn, flush);
return;
@@ -1691,12 +1694,16 @@ trx_commit_in_memory(
{
trx->must_flush_log_later = false;
- if (trx_is_autocommit_non_locking(trx)) {
+ if (trx->is_autocommit_non_locking()) {
ut_ad(trx->id == 0);
ut_ad(trx->read_only);
+ ut_ad(!trx->will_lock);
ut_a(!trx->is_recovered);
ut_ad(trx->rsegs.m_redo.rseg == NULL);
ut_ad(!trx->in_rw_trx_list);
+ ut_ad(trx->in_mysql_trx_list);
+ ut_ad(trx->mysql_thd);
+ ut_ad(trx->state == TRX_STATE_ACTIVE);
/* Note: We are asserting without holding the lock mutex. But
that is OK because this transaction is not waiting and cannot
@@ -1712,8 +1719,6 @@ trx_commit_in_memory(
and it cannot be removed from the mysql_trx_list and freed
without first acquiring the trx_sys_t::mutex. */
- ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
-
if (trx->read_view != NULL) {
trx_sys->mvcc->view_close(trx->read_view, false);
}
@@ -1770,12 +1775,7 @@ trx_commit_in_memory(
ut_ad(!trx->rsegs.m_redo.update_undo);
- if (trx_rseg_t* rseg = trx->rsegs.m_redo.rseg) {
- mutex_enter(&rseg->mutex);
- ut_ad(rseg->trx_ref_count > 0);
- --rseg->trx_ref_count;
- mutex_exit(&rseg->mutex);
-
+ if (ut_d(trx_rseg_t* rseg =) trx->rsegs.m_redo.rseg) {
if (trx_undo_t*& insert = trx->rsegs.m_redo.insert_undo) {
ut_ad(insert->rseg == rseg);
trx_undo_commit_cleanup(insert, false);
@@ -1844,6 +1844,15 @@ trx_commit_in_memory(
ut_ad(!trx->rsegs.m_noredo.undo);
+ /* Only after trx_undo_commit_cleanup() it is safe to release
+ our rseg reference. */
+ if (trx_rseg_t* rseg = trx->rsegs.m_redo.rseg) {
+ mutex_enter(&rseg->mutex);
+ ut_ad(rseg->trx_ref_count > 0);
+ --rseg->trx_ref_count;
+ mutex_exit(&rseg->mutex);
+ }
+
/* Free all savepoints, starting from the first. */
trx_named_savept_t* savep = UT_LIST_GET_FIRST(trx->trx_savepoints);
@@ -1866,7 +1875,7 @@ trx_commit_in_memory(
/* trx->in_mysql_trx_list would hold between
trx_allocate_for_mysql() and trx_free_for_mysql(). It does not
hold for recovered transactions or system transactions. */
- assert_trx_is_free(trx);
+ trx->assert_freed();
trx_init(trx);
@@ -1885,30 +1894,20 @@ trx_commit_low(
mtr_t* mtr) /*!< in/out: mini-transaction (will be committed),
or NULL if trx made no modifications */
{
- assert_trx_nonlocking_or_in_list(trx);
- ut_ad(!trx_state_eq(trx, TRX_STATE_COMMITTED_IN_MEMORY));
ut_ad(!mtr || mtr->is_active());
ut_ad(!mtr == !trx->has_logged());
/* undo_no is non-zero if we're doing the final commit. */
if (trx->fts_trx != NULL && trx->undo_no != 0) {
- dberr_t error;
-
- ut_a(!trx_is_autocommit_non_locking(trx));
-
- error = fts_commit(trx);
+ ut_a(!trx->is_autocommit_non_locking());
/* FTS-FIXME: Temporarily tolerate DB_DUPLICATE_KEY
instead of dying. This is a possible scenario if there
is a crash between insert to DELETED table committing
and transaction committing. The fix would be able to
return error from this function */
- if (error != DB_SUCCESS && error != DB_DUPLICATE_KEY) {
- /* FTS-FIXME: once we can return values from this
- function, we should do so and signal an error
- instead of just dying. */
-
- ut_error;
+ if (dberr_t error = fts_commit(trx)) {
+ ut_a(error == DB_DUPLICATE_KEY);
}
}
@@ -2279,7 +2278,6 @@ trx_print_low(
/*!< in: mem_heap_get_size(trx->lock.lock_heap) */
{
ibool newline;
- const char* op_info;
ut_ad(trx_sys_mutex_own());
@@ -2308,9 +2306,7 @@ trx_print_low(
fprintf(f, ", state %lu", (ulong) trx->state);
ut_ad(0);
state_ok:
-
- /* prevent a race condition */
- op_info = trx->op_info;
+ const char* op_info = trx->op_info;
if (*op_info) {
putc(' ', f);
@@ -2549,7 +2545,7 @@ trx_assert_started(
/* Non-locking autocommits should not hold any locks and this
function is only called from the locking code. */
- check_trx_state(trx);
+ ut_ad(!trx->is_autocommit_non_locking());
/* trx->state can change from or to NOT_STARTED while we are holding
trx_sys->mutex for non-locking autocommit selects but not for other
@@ -2754,7 +2750,9 @@ trx_recover_for_mysql(
trx != NULL;
trx = UT_LIST_GET_NEXT(trx_list, trx)) {
- assert_trx_in_rw_list(trx);
+ ut_ad(!trx->read_only);
+ ut_ad(trx->in_rw_trx_list);
+ ut_ad(!trx->is_autocommit_non_locking());
/* The state of a read-write transaction cannot change
from or to NOT_STARTED while we are holding the
@@ -2821,7 +2819,9 @@ trx_t* trx_get_trx_by_xid_low(const XID* xid)
trx != NULL;
trx = UT_LIST_GET_NEXT(trx_list, trx)) {
trx_mutex_enter(trx);
- assert_trx_in_rw_list(trx);
+ ut_ad(!trx->read_only);
+ ut_ad(trx->in_rw_trx_list);
+ ut_ad(!trx->is_autocommit_non_locking());
/* Compare two X/Open XA transaction id's: their
length should be the same and binary comparison
@@ -2948,7 +2948,7 @@ trx_start_internal_low(
/* Ensure it is not flagged as an auto-commit-non-locking
transaction. */
- trx->will_lock = 1;
+ trx->will_lock = true;
trx->internal = true;
@@ -2964,7 +2964,7 @@ trx_start_internal_read_only_low(
/* Ensure it is not flagged as an auto-commit-non-locking
transaction. */
- trx->will_lock = 1;
+ trx->will_lock = true;
trx->internal = true;
@@ -2985,13 +2985,7 @@ trx_start_for_ddl_low(
the data dictionary will be locked in crash recovery. */
trx_set_dict_operation(trx, op);
-
- /* Ensure it is not flagged as an auto-commit-non-locking
- transation. */
- trx->will_lock = 1;
-
trx->ddl= true;
-
trx_start_internal_low(trx);
return;
@@ -3002,7 +2996,7 @@ trx_start_for_ddl_low(
trx->ddl = true;
ut_ad(trx->dict_operation != TRX_DICT_OP_NONE);
- ut_ad(trx->will_lock > 0);
+ ut_ad(trx->will_lock);
return;
case TRX_STATE_PREPARED:
@@ -3028,7 +3022,7 @@ trx_set_rw_mode(
{
ut_ad(trx->rsegs.m_redo.rseg == 0);
ut_ad(!trx->in_rw_trx_list);
- ut_ad(!trx_is_autocommit_non_locking(trx));
+ ut_ad(!trx->is_autocommit_non_locking());
ut_ad(!trx->read_only);
if (high_level_read_only) {
@@ -3072,3 +3066,16 @@ trx_set_rw_mode(
mutex_exit(&trx_sys->mutex);
}
+
+bool trx_t::has_stats_table_lock() const
+{
+ for (lock_list::const_iterator it= lock.table_locks.begin(),
+ end= lock.table_locks.end(); it != end; ++it)
+ {
+ const lock_t *lock= *it;
+ if (lock && lock->un_member.tab_lock.table->is_stats_table())
+ return true;
+ }
+
+ return false;
+}
diff --git a/storage/innobase/unittest/CMakeLists.txt b/storage/innobase/unittest/CMakeLists.txt
new file mode 100644
index 00000000000..df98cddf73e
--- /dev/null
+++ b/storage/innobase/unittest/CMakeLists.txt
@@ -0,0 +1,22 @@
+# Copyright (c) 2021, MariaDB Corporation.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/unittest/mytap
+ ${CMAKE_SOURCE_DIR}/storage/innobase/include)
+ADD_EXECUTABLE(innodb_fts-t innodb_fts-t.cc)
+TARGET_LINK_LIBRARIES(innodb_fts-t mysys mytap)
+ADD_DEPENDENCIES(innodb_fts-t GenError)
+MY_ADD_TEST(innodb_fts)
diff --git a/storage/innobase/unittest/innodb_fts-t.cc b/storage/innobase/unittest/innodb_fts-t.cc
new file mode 100644
index 00000000000..72a4ca3ae78
--- /dev/null
+++ b/storage/innobase/unittest/innodb_fts-t.cc
@@ -0,0 +1,52 @@
+#include "tap.h"
+#include "fts0fts.h"
+#include "fts0vlc.h"
+
+struct fts_encode_info
+{
+ const byte buf[10];
+ size_t len;
+ doc_id_t val;
+};
+
+/* Contains fts encoding min & max value for each length bytes */
+static const fts_encode_info fts_info[]=
+{
+ {{0x80}, 1, 0},
+ {{0xFF}, 1, (1 << 7) - 1},
+ {{0x01, 0x80}, 2, 1 << 7},
+ {{0x7F, 0XFF}, 2, (1 << 14) - 1},
+ {{0x01, 0x00, 0x80}, 3, 1 << 14},
+ {{0x7F, 0X7F, 0XFF}, 3, (1 << 21) - 1},
+ {{0x01, 0x00, 0x00, 0x80}, 4, 1 << 21},
+ {{0x7F, 0X7F, 0X7F, 0xFF}, 4, (1 << 28) - 1},
+ {{0x01, 0x00, 0x00, 0x00, 0x80}, 5, 1 << 28},
+ {{0x7F, 0X7F, 0X7F, 0x7F, 0xFF}, 5, (1ULL << 35) - 1},
+ {{0x01, 0x00, 0x00, 0x00, 0x00, 0x80}, 6, 1ULL << 35},
+ {{0x7F, 0X7F, 0X7F, 0x7F, 0x7F, 0xFF}, 6, (1ULL << 42) - 1},
+ {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, 7, 1ULL << 42},
+ {{0x7F, 0X7F, 0X7F, 0x7F, 0x7F, 0x7F, 0XFF}, 7, (1ULL << 49) - 1},
+ {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, 8, 1ULL << 49},
+ {{0x7F, 0X7F, 0X7F, 0x7F, 0x7F, 0x7F, 0X7F, 0XFF}, 8, (1ULL << 56) -1},
+ {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, 9, 1ULL << 56},
+ {{0x7F, 0X7F, 0X7F, 0x7F, 0x7F, 0x7F, 0X7F, 0x7F, 0XFF}, 9, (1ULL << 63) -1},
+ {{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, 10, 1ULL << 63},
+ {{0x01, 0X7F, 0X7F, 0x7F, 0x7F, 0x7F, 0X7F, 0x7F, 0x7F, 0xFF}, 10, ~0ULL}
+};
+
+int main(int, char**)
+{
+ for (int i= array_elements(fts_info); i--;)
+ {
+ byte buf[10];
+ const byte* fts_buf= buf;
+ size_t len= fts_encode_int(fts_info[i].val, buf) - &buf[0];
+ if (fts_info[i].len == len &&
+ !memcmp(&fts_info[i].buf, buf, len) &&
+ fts_decode_vlc(&fts_buf) == fts_info[i].val &&
+ fts_buf == &buf[len])
+ ok(true, "FTS Encoded for %zu bytes", fts_info[i].len);
+ else
+ ok(false, "FTS Encoded for %zu bytes", fts_info[i].len);
+ }
+}
diff --git a/storage/innobase/ut/ut0wqueue.cc b/storage/innobase/ut/ut0wqueue.cc
index ae97009430e..45af449cff9 100644
--- a/storage/innobase/ut/ut0wqueue.cc
+++ b/storage/innobase/ut/ut0wqueue.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2006, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2019, MariaDB Corporation.
+Copyright (c) 2019, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -45,6 +45,7 @@ ib_wqueue_create(void)
wq->items = ib_list_create();
wq->event = os_event_create(0);
+ wq->length = 0;
return(wq);
}
@@ -76,6 +77,8 @@ ib_wqueue_add(ib_wqueue_t* wq, void* item, mem_heap_t* heap, bool wq_locked)
}
ib_list_add_last(wq->items, item, heap);
+ wq->length++;
+ ut_ad(wq->length == ib_list_len(wq->items));
os_event_set(wq->event);
if (!wq_locked) {
@@ -102,12 +105,12 @@ ib_wqueue_wait(
if (node) {
ib_list_remove(wq->items, node);
-
- if (!ib_list_get_first(wq->items)) {
+ if (!--wq->length) {
/* We must reset the event when the list
gets emptied. */
os_event_reset(wq->event);
}
+ ut_ad(wq->length == ib_list_len(wq->items));
break;
}
@@ -142,7 +145,8 @@ ib_wqueue_timedwait(
if (node) {
ib_list_remove(wq->items, node);
-
+ wq->length--;
+ ut_ad(wq->length == ib_list_len(wq->items));
mutex_exit(&wq->mutex);
break;
}
@@ -204,20 +208,3 @@ bool ib_wqueue_is_empty(ib_wqueue_t* wq)
mutex_exit(&wq->mutex);
return is_empty;
}
-
-/********************************************************************
-Get number of items on queue.
-@return number of items on queue */
-ulint
-ib_wqueue_len(
-/*==========*/
- ib_wqueue_t* wq) /*<! in: work queue */
-{
- ulint len = 0;
-
- mutex_enter(&wq->mutex);
- len = ib_list_len(wq->items);
- mutex_exit(&wq->mutex);
-
- return(len);
-}
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index 2795528a044..cb4585d0f62 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -4191,7 +4191,7 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
const char * name, my_bool rep_quick)
{
int got_error;
- uint i,key, total_key_length, istep;
+ uint i,key, istep;
ha_rows start_records;
my_off_t new_header_length,del;
File new_file;
@@ -4353,7 +4353,9 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
_ma_check_print_error(param,"Not enough memory for key!");
goto err;
}
- total_key_length=0;
+#ifdef USING_SECOND_APPROACH
+ uint total_key_length=0;
+#endif
rec_per_key_part= param->new_rec_per_key_part;
share->state.state.records=share->state.state.del=share->state.split=0;
share->state.state.empty=0;
@@ -4422,7 +4424,9 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
if (keyseg->flag & HA_NULL_PART)
sort_param[i].key_length++;
}
+#ifdef USING_SECOND_APPROACH
total_key_length+=sort_param[i].key_length;
+#endif
if (sort_param[i].keyinfo->flag & HA_FULLTEXT)
{
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index b98fbe29e1f..8773e80942f 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -3395,10 +3395,9 @@ static uint16 translog_get_chunk_header_length(uchar *chunk)
DBUG_PRINT("info", ("TRANSLOG_CHUNK_LNGTH = 3"));
DBUG_RETURN(3);
break;
- default:
- DBUG_ASSERT(0);
- DBUG_RETURN(0); /* Keep compiler happy */
}
+ DBUG_ASSERT(0);
+ DBUG_RETURN(0); /* Keep compiler happy */
}
diff --git a/storage/maria/ma_rt_test.c b/storage/maria/ma_rt_test.c
index 5af941b78c8..f7e38af3dce 100644
--- a/storage/maria/ma_rt_test.c
+++ b/storage/maria/ma_rt_test.c
@@ -133,7 +133,6 @@ static int run_test(const char *filename)
int key_length=8;
int null_fields=0;
int nrecords=sizeof(rt_data)/(sizeof(double)*4);/* 40 */
- int rec_length=0;
int uniques=0;
int i, max_i;
int error;
@@ -153,7 +152,6 @@ static int run_test(const char *filename)
recinfo[0].type=FIELD_NORMAL;
recinfo[0].length=1; /* For NULL bits */
- rec_length=1;
/* Define 2*ndims columns for coordinates*/
@@ -161,7 +159,6 @@ static int run_test(const char *filename)
{
recinfo[i].type=FIELD_NORMAL;
recinfo[i].length=key_length;
- rec_length+=key_length;
}
/* Define a key with 2*ndims segments */
diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt
index 9af111baf56..14250c99f84 100644
--- a/storage/mroonga/CMakeLists.txt
+++ b/storage/mroonga/CMakeLists.txt
@@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.12)
project(mroonga)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
@@ -80,7 +80,7 @@ else()
set(MRN_SOURCE_DIR ${CMAKE_SOURCE_DIR})
endif()
-file(READ ${MRN_SOURCE_DIR}/version MRN_VERSION)
+file(READ ${MRN_SOURCE_DIR}/version_full MRN_VERSION)
file(READ ${MRN_SOURCE_DIR}/version_major MRN_VERSION_MAJOR)
file(READ ${MRN_SOURCE_DIR}/version_minor MRN_VERSION_MINOR)
file(READ ${MRN_SOURCE_DIR}/version_micro MRN_VERSION_MICRO)
@@ -219,8 +219,7 @@ set(MYSQL_INCLUDE_DIRS
"${MYSQL_REGEX_INCLUDE_DIR}"
"${MYSQL_RAPIDJSON_INCLUDE_DIR}"
"${MYSQL_LIBBINLOGEVENTS_EXPORT_DIR}"
- "${MYSQL_LIBBINLOGEVENTS_INCLUDE_DIR}"
- "${MYSQL_SOURCE_DIR}")
+ "${MYSQL_LIBBINLOGEVENTS_INCLUDE_DIR}")
if(MRN_BUNDLED)
set(MYSQL_PLUGIN_DIR "${INSTALL_PLUGINDIR}")
diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt
index e1f45b7fda9..998225d283c 100644
--- a/storage/mroonga/vendor/groonga/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/CMakeLists.txt
@@ -590,14 +590,13 @@ else()
set(GRN_WITH_MESSAGE_PACK FALSE)
endif()
-find_program(RUBY NAMES
- "ruby2.3" "ruby23"
- "ruby2.2" "ruby22"
- "ruby2.1" "ruby21"
- "ruby")
-
option(GRN_WITH_MRUBY "use mruby" OFF)
if(GRN_WITH_MRUBY)
+ find_program(RUBY NAMES
+ "ruby2.3" "ruby23"
+ "ruby2.2" "ruby22"
+ "ruby2.1" "ruby21"
+ "ruby")
set(MRUBY_INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/mruby-source/include")
set(MRUBY_LIBS mruby)
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt
index 80e531e5319..96e3f1a570d 100644
--- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt
@@ -29,7 +29,7 @@ option(GROONGA_NORMALIZER_MYSQL_EMBED
"Build as a static library to embed into an application"
${GROONGA_NORMALIZER_MYSQL_EMBED_DEFAULT})
-file(READ "${CMAKE_CURRENT_SOURCE_DIR}/version" VERSION)
+file(READ "${CMAKE_CURRENT_SOURCE_DIR}/version_full" VERSION)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
set(GROONGA_NORMALIZER_MYSQL_BUNDLED FALSE)
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/version b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/version_full
index 8cfbc905b39..8cfbc905b39 100644
--- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/version
+++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/version_full
diff --git a/storage/mroonga/version b/storage/mroonga/version_full
index 5b1f56847ae..5b1f56847ae 100644
--- a/storage/mroonga/version
+++ b/storage/mroonga/version_full
diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c
index f6930e91e6e..b2170a93cde 100644
--- a/storage/myisam/ft_parser.c
+++ b/storage/myisam/ft_parser.c
@@ -78,18 +78,25 @@ FT_WORD * ft_linearize(TREE *wtree, MEM_ROOT *mem_root)
DBUG_RETURN(wlist);
}
-my_bool ft_boolean_check_syntax_string(const uchar *str)
+my_bool ft_boolean_check_syntax_string(const uchar *str, size_t length,
+ CHARSET_INFO *cs)
{
uint i, j;
+ if (cs->mbminlen != 1)
+ {
+ DBUG_ASSERT(0);
+ return 1;
+ }
+
if (!str ||
- (strlen((char*) str)+1 != sizeof(DEFAULT_FTB_SYNTAX)) ||
+ (length + 1 != sizeof(DEFAULT_FTB_SYNTAX)) ||
(str[0] != ' ' && str[1] != ' '))
return 1;
for (i=0; i<sizeof(DEFAULT_FTB_SYNTAX); i++)
{
/* limiting to 7-bit ascii only */
- if ((unsigned char)(str[i]) > 127 || my_isalnum(default_charset_info, str[i]))
+ if ((unsigned char)(str[i]) > 127 || my_isalnum(cs, str[i]))
return 1;
for (j=0; j<i; j++)
if (str[i] == str[j] && (i != 11 || j != 10))
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index ce52f1af828..9a11a55ecab 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -945,7 +945,8 @@ void ha_myisam::setup_vcols_for_repair(HA_CHECK *param)
return;
file->s->vreclength= new_vreclength;
}
- DBUG_ASSERT(file->s->base.reclength < file->s->vreclength);
+ DBUG_ASSERT(file->s->base.reclength < file->s->vreclength ||
+ !table->s->stored_fields);
param->fix_record= compute_vcols;
table->use_all_columns();
table->vcol_set= &table->s->all_set;
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index d9b9bb5af4a..8bae409d1e6 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -2614,7 +2614,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick)
{
int got_error;
- uint i,key, total_key_length, istep;
+ uint i,key, istep;
ulong rec_length;
ha_rows start_records;
my_off_t new_header_length,del;
@@ -2800,7 +2800,9 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
mi_check_print_error(param,"Not enough memory for key!");
goto err;
}
- total_key_length=0;
+#ifdef USING_SECOND_APPROACH
+ uint total_key_length=0;
+#endif
rec_per_key_part= param->rec_per_key_part;
info->state->records=info->state->del=share->state.split=0;
info->state->empty=0;
@@ -2869,7 +2871,9 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
if (keyseg->flag & HA_NULL_PART)
sort_param[i].key_length++;
}
+#ifdef USING_SECOND_APPROACH
total_key_length+=sort_param[i].key_length;
+#endif
if (sort_param[i].keyinfo->flag & HA_FULLTEXT)
{
diff --git a/storage/myisam/rt_test.c b/storage/myisam/rt_test.c
index 78deb80064a..07310039fd0 100644
--- a/storage/myisam/rt_test.c
+++ b/storage/myisam/rt_test.c
@@ -103,7 +103,6 @@ static int run_test(const char *filename)
int key_length=8;
int null_fields=0;
int nrecords=sizeof(rt_data)/(sizeof(double)*4);/* 3000;*/
- int rec_length=0;
int uniques=0;
int i, max_i;
int error;
@@ -123,14 +122,12 @@ static int run_test(const char *filename)
recinfo[0].type=FIELD_NORMAL;
recinfo[0].length=1; /* For NULL bits */
- rec_length=1;
/* Define 2*ndims columns for coordinates*/
for (i=1; i<=2*ndims ;i++){
recinfo[i].type=FIELD_NORMAL;
recinfo[i].length=key_length;
- rec_length+=key_length;
}
/* Define a key with 2*ndims segments */
diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt
index 3be197f7106..9770820f0b7 100644
--- a/storage/oqgraph/CMakeLists.txt
+++ b/storage/oqgraph/CMakeLists.txt
@@ -3,6 +3,10 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
FUNCTION(CHECK_OQGRAPH)
MESSAGE(STATUS "Configuring OQGraph")
FIND_PACKAGE(Boost 1.40.0)
+SET_PACKAGE_PROPERTIES(Boost PROPERTIES
+ PURPOSE "Required for the OQGraph storage engine"
+ TYPE OPTIONAL
+)
IF(NOT Boost_FOUND)
MESSAGE(STATUS "Boost not found. OQGraph will not be compiled")
SET(OQGRAPH_OK 0 CACHE INTERNAL "")
@@ -11,6 +15,10 @@ ENDIF()
INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS})
FIND_PACKAGE(Judy)
+SET_PACKAGE_PROPERTIES(Judy PROPERTIES
+ PURPOSE "Required for the OQGraph storage engine"
+ TYPE OPTIONAL
+)
IF(NOT Judy_FOUND)
MESSAGE(STATUS "Judy not found. OQGraph will not be compiled")
SET(OQGRAPH_OK 0 CACHE INTERNAL "")
diff --git a/storage/oqgraph/mysql-test/oqgraph/social.test b/storage/oqgraph/mysql-test/oqgraph/social.test
index 69eb7698bb9..a71b160cc1d 100644
--- a/storage/oqgraph/mysql-test/oqgraph/social.test
+++ b/storage/oqgraph/mysql-test/oqgraph/social.test
@@ -1,3 +1,6 @@
+# The test can take very long time with valgrind
+--source include/not_valgrind.inc
+
--disable_warnings
DROP TABLE IF EXISTS rsb, rsb_graph;
--enable_warnings
diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt
index e1839bc5b00..7ed365ea175 100644
--- a/storage/perfschema/CMakeLists.txt
+++ b/storage/perfschema/CMakeLists.txt
@@ -20,8 +20,7 @@
# along with this program; if not, write to the Free Software Foundation,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}
- ${CMAKE_SOURCE_DIR}/include
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/sql
${PCRE_INCLUDES}
@@ -188,9 +187,10 @@ table_session_connect_attrs.cc
table_session_account_connect_attrs.cc
)
-MYSQL_ADD_PLUGIN(perfschema ${PERFSCHEMA_SOURCES} STORAGE_ENGINE DEFAULT STATIC_ONLY)
+MYSQL_ADD_PLUGIN(perfschema ${PERFSCHEMA_SOURCES} STORAGE_ENGINE DEFAULT
+ STATIC_ONLY DEPENDS GenServerSource)
+
IF (TARGET perfschema)
- ADD_DEPENDENCIES(perfschema GenServerSource)
IF(WITH_UNIT_TESTS)
ADD_SUBDIRECTORY(unittest)
ENDIF(WITH_UNIT_TESTS)
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index dbad7e966a5..2a484bea7f2 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -1496,7 +1496,7 @@ static void register_socket_v1(const char *category,
@sa PSI_v1::init_mutex.
*/
static PSI_mutex*
-init_mutex_v1(PSI_mutex_key key, const void *identity)
+init_mutex_v1(PSI_mutex_key key, void *identity)
{
INIT_BODY_V1(mutex, key, identity);
}
@@ -1519,7 +1519,7 @@ static void destroy_mutex_v1(PSI_mutex* mutex)
@sa PSI_v1::init_rwlock.
*/
static PSI_rwlock*
-init_rwlock_v1(PSI_rwlock_key key, const void *identity)
+init_rwlock_v1(PSI_rwlock_key key, void *identity)
{
INIT_BODY_V1(rwlock, key, identity);
}
@@ -1542,7 +1542,7 @@ static void destroy_rwlock_v1(PSI_rwlock* rwlock)
@sa PSI_v1::init_cond.
*/
static PSI_cond*
-init_cond_v1(PSI_cond_key key, const void *identity)
+init_cond_v1(PSI_cond_key key, void *identity)
{
INIT_BODY_V1(cond, key, identity);
}
diff --git a/storage/perfschema/table_accounts.cc b/storage/perfschema/table_accounts.cc
index 550f6614abb..d6c3ceb0c63 100644
--- a/storage/perfschema/table_accounts.cc
+++ b/storage/perfschema/table_accounts.cc
@@ -43,10 +43,10 @@ table_accounts::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE accounts("
- "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null,"
- "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null,"
- "CURRENT_CONNECTIONS bigint not null,"
- "TOTAL_CONNECTIONS bigint not null)") }
+ "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null comment 'The connection''s client user name for the connection, or NULL if an internal thread.',"
+ "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'The connection client''s host name, or NULL if an internal thread.',"
+ "CURRENT_CONNECTIONS bigint not null comment 'Current connections for the account.',"
+ "TOTAL_CONNECTIONS bigint not null comment 'Total connections for the account.')") }
};
PFS_engine_table* table_accounts::create()
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.cc b/storage/perfschema/table_esgs_by_account_by_event_name.cc
index 9a983eb076e..6ef00026370 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.cc
@@ -49,14 +49,14 @@ table_esgs_by_account_by_event_name::m_share=
sizeof(pos_esgs_by_account_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_by_account_by_event_name("
- "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null,"
- "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null comment 'User. Used together with HOST and EVENT_NAME for grouping events.',"
+ "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'Host. Used together with USER and EVENT_NAME for grouping events.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with USER and HOST for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events, which includes all timed and untimed events.',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the timed summarized events.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.cc b/storage/perfschema/table_esgs_by_host_by_event_name.cc
index 5ff9faf0c1e..880ed279ccf 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.cc
@@ -50,13 +50,13 @@ table_esgs_by_host_by_event_name::m_share=
sizeof(pos_esgs_by_host_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_by_host_by_event_name("
- "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'Host. Used together with EVENT_NAME for grouping events.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with HOST for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events, which includes all timed and untimed events.',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the timed summarized events.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.cc b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
index dfda9702abb..3f09cef4dba 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
@@ -49,13 +49,13 @@ table_esgs_by_thread_by_event_name::m_share=
sizeof(pos_esgs_by_thread_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_by_thread_by_event_name("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with THREAD_ID for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events, which includes all timed and untimed events.',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the timed summarized events.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.cc b/storage/perfschema/table_esgs_by_user_by_event_name.cc
index 23b7b0f6689..1e33b475e4b 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.cc
@@ -50,13 +50,13 @@ table_esgs_by_user_by_event_name::m_share=
sizeof(pos_esgs_by_user_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_by_user_by_event_name("
- "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null comment 'User. Used together with EVENT_NAME for grouping events.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with USER for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events, which includes all timed and untimed events.',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the timed summarized events.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_global_by_event_name.cc b/storage/perfschema/table_esgs_global_by_event_name.cc
index 6c5f0866671..d01b19ed539 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.cc
+++ b/storage/perfschema/table_esgs_global_by_event_name.cc
@@ -51,12 +51,12 @@ table_esgs_global_by_event_name::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_stages_summary_global_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events, which includes all timed and untimed events.',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the timed summarized events.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.cc b/storage/perfschema/table_esms_by_account_by_event_name.cc
index 312050aa9c9..fd255633f9c 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_account_by_event_name.cc
@@ -49,33 +49,33 @@ table_esms_by_account_by_event_name::m_share=
sizeof(pos_esms_by_account_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_account_by_event_name("
- "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null,"
- "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
+ "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null comment 'User. Used together with HOST and EVENT_NAME for grouping events.',"
+ "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'Host. Used together with USER and EVENT_NAME for grouping events.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with USER and HOST for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "SUM_LOCK_TIME BIGINT unsigned not null comment 'Sum of the LOCK_TIME column in the events_statements_current table.',"
+ "SUM_ERRORS BIGINT unsigned not null comment 'Sum of the ERRORS column in the events_statements_current table.',"
+ "SUM_WARNINGS BIGINT unsigned not null comment 'Sum of the WARNINGS column in the events_statements_current table.',"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null comment 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',"
+ "SUM_ROWS_SENT BIGINT unsigned not null comment 'Sum of the ROWS_SENT column in the events_statements_current table.',"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null comment 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE BIGINT unsigned not null comment 'Sum of the SELECT_RANGE column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',"
+ "SUM_SELECT_SCAN BIGINT unsigned not null comment 'Sum of the SELECT_SCAN column in the events_statements_current table.',"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null comment 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',"
+ "SUM_SORT_RANGE BIGINT unsigned not null comment 'Sum of the SORT_RANGE column in the events_statements_current table.',"
+ "SUM_SORT_ROWS BIGINT unsigned not null comment 'Sum of the SORT_ROWS column in the events_statements_current table.',"
+ "SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc
index 5295c29dc40..5f225ff5856 100644
--- a/storage/perfschema/table_esms_by_digest.cc
+++ b/storage/perfschema/table_esms_by_digest.cc
@@ -53,35 +53,35 @@ table_esms_by_digest::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_digest("
- "SCHEMA_NAME VARCHAR(64),"
- "DIGEST VARCHAR(32),"
- "DIGEST_TEXT LONGTEXT,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null,"
- "FIRST_SEEN TIMESTAMP(0) NOT NULL default 0,"
- "LAST_SEEN TIMESTAMP(0) NOT NULL default 0)") }
+ "SCHEMA_NAME VARCHAR(64) comment 'Database name. Records are summarised together with DIGEST.',"
+ "DIGEST VARCHAR(32) comment 'Performance Schema digest. Records are summarised together with SCHEMA NAME.',"
+ "DIGEST_TEXT LONGTEXT comment 'The unhashed form of the digest.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "SUM_LOCK_TIME BIGINT unsigned not null comment 'Sum of the LOCK_TIME column in the events_statements_current table.',"
+ "SUM_ERRORS BIGINT unsigned not null comment 'Sum of the ERRORS column in the events_statements_current table.',"
+ "SUM_WARNINGS BIGINT unsigned not null comment 'Sum of the WARNINGS column in the events_statements_current table.',"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null comment 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',"
+ "SUM_ROWS_SENT BIGINT unsigned not null comment 'Sum of the ROWS_SENT column in the events_statements_current table.',"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null comment 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE BIGINT unsigned not null comment 'Sum of the SELECT_RANGE column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',"
+ "SUM_SELECT_SCAN BIGINT unsigned not null comment 'Sum of the SELECT_SCAN column in the events_statements_current table.',"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null comment 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',"
+ "SUM_SORT_RANGE BIGINT unsigned not null comment 'Sum of the SORT_RANGE column in the events_statements_current table.',"
+ "SUM_SORT_ROWS BIGINT unsigned not null comment 'Sum of the SORT_ROWS column in the events_statements_current table.',"
+ "SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.',"
+ "FIRST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Time at which the digest was first seen.',"
+ "LAST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Time at which the digest was most recently seen.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.cc b/storage/perfschema/table_esms_by_host_by_event_name.cc
index b390d1e17a4..92359186e8a 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_host_by_event_name.cc
@@ -50,32 +50,32 @@ table_esms_by_host_by_event_name::m_share=
sizeof(pos_esms_by_host_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_host_by_event_name("
- "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
+ "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'Host. Used together with EVENT_NAME for grouping events.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with HOST for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "SUM_LOCK_TIME BIGINT unsigned not null comment 'Sum of the LOCK_TIME column in the events_statements_currentd table.',"
+ "SUM_ERRORS BIGINT unsigned not null comment 'Sum of the ERRORS column in the events_statements_current table.',"
+ "SUM_WARNINGS BIGINT unsigned not null comment 'Sum of the WARNINGS column in the events_statements_current table.',"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null comment 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',"
+ "SUM_ROWS_SENT BIGINT unsigned not null comment 'Sum of the ROWS_SENT column in the events_statements_current table.',"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null comment 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_RANGE_JOINW column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE BIGINT unsigned not null comment 'Sum of the SELECT_RANGE column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',"
+ "SUM_SELECT_SCAN BIGINT unsigned not null comment 'Sum of the SELECT_SCAN column in the events_statements_current table.',"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null comment 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',"
+ "SUM_SORT_RANGE BIGINT unsigned not null comment 'Sum of the SORT_RANGE column in the events_statements_current table.',"
+ "SUM_SORT_ROWS BIGINT unsigned not null comment 'Sum of the SORT_ROWS column in the events_statements_current table.',"
+ "SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.cc b/storage/perfschema/table_esms_by_thread_by_event_name.cc
index 0a7cf46986c..5a06f602e5c 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.cc
@@ -49,32 +49,32 @@ table_esms_by_thread_by_event_name::m_share=
sizeof(pos_esms_by_thread_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_thread_by_event_name("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with THREAD_ID for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "SUM_LOCK_TIME BIGINT unsigned not null comment 'Sum of the LOCK_TIME column in the events_statements_current table.',"
+ "SUM_ERRORS BIGINT unsigned not null comment 'Sum of the ERRORS column in the events_statements_current table.',"
+ "SUM_WARNINGS BIGINT unsigned not null comment 'Sum of the WARNINGS column in the events_statements_current table.',"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null comment 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',"
+ "SUM_ROWS_SENT BIGINT unsigned not null comment 'Sum of the ROWS_SENT column in the events_statements_current table.',"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null comment 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE BIGINT unsigned not null comment 'Sum of the SELECT_RANGE column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',"
+ "SUM_SELECT_SCAN BIGINT unsigned not null comment 'Sum of the SELECT_SCAN column in the events_statements_current table.',"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null comment 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',"
+ "SUM_SORT_RANGE BIGINT unsigned not null comment 'Sum of the SORT_RANGE column in the events_statements_current table.',"
+ "SUM_SORT_ROWS BIGINT unsigned not null comment 'Sum of the SORT_ROWS column in the events_statements_current table.',"
+ "SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.cc b/storage/perfschema/table_esms_by_user_by_event_name.cc
index 1fa1289aa8c..53bce1ac202 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_user_by_event_name.cc
@@ -50,32 +50,32 @@ table_esms_by_user_by_event_name::m_share=
sizeof(pos_esms_by_user_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_by_user_by_event_name("
- "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
+ "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null comment 'User. Used together with EVENT_NAME for grouping events.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with USER for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "SUM_LOCK_TIME BIGINT unsigned not null comment 'Sum of the LOCK_TIME column in the events_statements_current table.',"
+ "SUM_ERRORS BIGINT unsigned not null comment 'Sum of the ERRORS column in the events_statements_current table.',"
+ "SUM_WARNINGS BIGINT unsigned not null comment 'Sum of the WARNINGS column in the events_statements_current table.',"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null comment 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',"
+ "SUM_ROWS_SENT BIGINT unsigned not null comment 'Sum of the ROWS_SENT column in the events_statements_current table.',"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null comment 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE BIGINT unsigned not null comment 'Sum of the SELECT_RANGE column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',"
+ "SUM_SELECT_SCAN BIGINT unsigned not null comment 'Sum of the SELECT_SCAN column in the events_statements_current table.',"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null comment 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',"
+ "SUM_SORT_RANGE BIGINT unsigned not null comment 'Sum of the SORT_RANGE column in the events_statements_current table.',"
+ "SUM_SORT_ROWS BIGINT unsigned not null comment 'Sum of the SORT_ROWS column in the events_statements_current table.',"
+ "SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc
index 7d9584752b0..c33f05bbecb 100644
--- a/storage/perfschema/table_esms_global_by_event_name.cc
+++ b/storage/perfschema/table_esms_global_by_event_name.cc
@@ -51,31 +51,31 @@ table_esms_global_by_event_name::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_summary_global_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null)") }
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "SUM_LOCK_TIME BIGINT unsigned not null comment 'Sum of the LOCK_TIME column in the events_statements_current table.',"
+ "SUM_ERRORS BIGINT unsigned not null comment 'Sum of the ERRORS column in the events_statements_current table.',"
+ "SUM_WARNINGS BIGINT unsigned not null comment 'Sum of the WARNINGS column in the events_statements_current table.',"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null comment 'Sum of the ROWS_AFFECTED column in the events_statements_current table.',"
+ "SUM_ROWS_SENT BIGINT unsigned not null comment 'Sum of the ROWS_SENT column in the events_statements_current table.',"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null comment 'Sum of the ROWS_EXAMINED column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.',"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null comment 'Sum of the CREATED_TMP_TABLES column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE BIGINT unsigned not null comment 'Sum of the SELECT_RANGE column in the events_statements_current table.',"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.',"
+ "SUM_SELECT_SCAN BIGINT unsigned not null comment 'Sum of the SELECT_SCAN column in the events_statements_current table.',"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null comment 'Sum of the SORT_MERGE_PASSES column in the events_statements_current table.',"
+ "SUM_SORT_RANGE BIGINT unsigned not null comment 'Sum of the SORT_RANGE column in the events_statements_current table.',"
+ "SUM_SORT_ROWS BIGINT unsigned not null comment 'Sum of the SORT_ROWS column in the events_statements_current table.',"
+ "SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_events_stages.cc b/storage/perfschema/table_events_stages.cc
index 0a09d2c83fa..e2a9f71a849 100644
--- a/storage/perfschema/table_events_stages.cc
+++ b/storage/perfschema/table_events_stages.cc
@@ -48,16 +48,16 @@ table_events_stages_current::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_stages_current("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',"
+ "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',"
+ "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table',"
+ "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.',"
+ "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.',"
+ "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',"
+ "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',"
+ "NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either statement, stage or wait.')") }
};
THR_LOCK table_events_stages_history::m_table_lock;
@@ -75,16 +75,16 @@ table_events_stages_history::m_share=
sizeof(pos_events_stages_history), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_stages_history("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',"
+ "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',"
+ "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table',"
+ "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.',"
+ "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.',"
+ "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',"
+ "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',"
+ "NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either statement, stage or wait.')") }
};
THR_LOCK table_events_stages_history_long::m_table_lock;
@@ -102,16 +102,16 @@ table_events_stages_history_long::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_stages_history_long("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',"
+ "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',"
+ "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table',"
+ "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.',"
+ "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.',"
+ "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',"
+ "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',"
+ "NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either statement, stage or wait.')") }
};
table_events_stages_common::table_events_stages_common
diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc
index 392f1f747f2..8e4663242fa 100644
--- a/storage/perfschema/table_events_statements.cc
+++ b/storage/perfschema/table_events_statements.cc
@@ -51,46 +51,46 @@ table_events_statements_current::m_share=
sizeof(pos_events_statements_current), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_current("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "LOCK_TIME bigint unsigned not null,"
- "SQL_TEXT LONGTEXT,"
- "DIGEST VARCHAR(32),"
- "DIGEST_TEXT LONGTEXT,"
- "CURRENT_SCHEMA VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
- "MYSQL_ERRNO INTEGER,"
- "RETURNED_SQLSTATE VARCHAR(5),"
- "MESSAGE_TEXT VARCHAR(128),"
- "ERRORS BIGINT unsigned not null,"
- "WARNINGS BIGINT unsigned not null,"
- "ROWS_AFFECTED BIGINT unsigned not null,"
- "ROWS_SENT BIGINT unsigned not null,"
- "ROWS_EXAMINED BIGINT unsigned not null,"
- "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SELECT_RANGE BIGINT unsigned not null,"
- "SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SELECT_SCAN BIGINT unsigned not null,"
- "SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SORT_RANGE BIGINT unsigned not null,"
- "SORT_ROWS BIGINT unsigned not null,"
- "SORT_SCAN BIGINT unsigned not null,"
- "NO_INDEX_USED BIGINT unsigned not null,"
- "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',"
+ "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',"
+ "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table',"
+ "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.',"
+ "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.',"
+ "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',"
+ "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',"
+ "LOCK_TIME bigint unsigned not null comment 'Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.',"
+ "SQL_TEXT LONGTEXT comment 'The SQL statement, or NULL if the command is not associated with an SQL statement.',"
+ "DIGEST VARCHAR(32) comment 'Statement digest.',"
+ "DIGEST_TEXT LONGTEXT comment 'Statement digest text.',"
+ "CURRENT_SCHEMA VARCHAR(64) comment 'Statement''s default database for the statement, or NULL if there was none.',"
+ "OBJECT_TYPE VARCHAR(64) comment 'Reserved, currently NULL',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Reserved, currently NULL',"
+ "OBJECT_NAME VARCHAR(64) comment 'Reserved, currently NULL',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Address in memory of the statement object.',"
+ "MYSQL_ERRNO INTEGER comment 'Error code. See MariaDB Error Codes for a full list.',"
+ "RETURNED_SQLSTATE VARCHAR(5) comment 'The SQLSTATE value.',"
+ "MESSAGE_TEXT VARCHAR(128) comment 'Statement error message. See MariaDB Error Codes.',"
+ "ERRORS BIGINT unsigned not null comment '0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.',"
+ "WARNINGS BIGINT unsigned not null comment 'Number of warnings from the diagnostics area.',"
+ "ROWS_AFFECTED BIGINT unsigned not null comment 'Number of rows affected the statement affected.',"
+ "ROWS_SENT BIGINT unsigned not null comment 'Number of rows returned.',"
+ "ROWS_EXAMINED BIGINT unsigned not null comment 'Number of rows read during the statement''s execution.',"
+ "CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Number of on-disk temp tables created by the statement.',"
+ "CREATED_TMP_TABLES BIGINT unsigned not null comment 'Number of temp tables created by the statement.',"
+ "SELECT_FULL_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which did not use an index.',"
+ "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range search of the first table.',"
+ "SELECT_RANGE BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range of the first table.',"
+ "SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Number of joins without keys performed by the statement that check for key usage after each row.',"
+ "SELECT_SCAN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a full scan of the first table.',"
+ "SORT_MERGE_PASSES BIGINT unsigned not null comment 'Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.',"
+ "SORT_RANGE BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a range.',"
+ "SORT_ROWS BIGINT unsigned not null comment 'Number of rows sorted by the statement.',"
+ "SORT_SCAN BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a full table scan.',"
+ "NO_INDEX_USED BIGINT unsigned not null comment '0 if the statement performed a table scan with an index, 1 if without an index.',"
+ "NO_GOOD_INDEX_USED BIGINT unsigned not null comment '0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.',"
+ "NESTING_EVENT_ID BIGINT unsigned comment 'Reserved, currently NULL.',"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT') comment 'Reserved, currently NULL.')") }
};
THR_LOCK table_events_statements_history::m_table_lock;
@@ -108,46 +108,46 @@ table_events_statements_history::m_share=
sizeof(pos_events_statements_history), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_history("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "LOCK_TIME bigint unsigned not null,"
- "SQL_TEXT LONGTEXT,"
- "DIGEST VARCHAR(32),"
- "DIGEST_TEXT LONGTEXT,"
- "CURRENT_SCHEMA VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
- "MYSQL_ERRNO INTEGER,"
- "RETURNED_SQLSTATE VARCHAR(5),"
- "MESSAGE_TEXT VARCHAR(128),"
- "ERRORS BIGINT unsigned not null,"
- "WARNINGS BIGINT unsigned not null,"
- "ROWS_AFFECTED BIGINT unsigned not null,"
- "ROWS_SENT BIGINT unsigned not null,"
- "ROWS_EXAMINED BIGINT unsigned not null,"
- "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SELECT_RANGE BIGINT unsigned not null,"
- "SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SELECT_SCAN BIGINT unsigned not null,"
- "SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SORT_RANGE BIGINT unsigned not null,"
- "SORT_ROWS BIGINT unsigned not null,"
- "SORT_SCAN BIGINT unsigned not null,"
- "NO_INDEX_USED BIGINT unsigned not null,"
- "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',"
+ "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',"
+ "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table',"
+ "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.',"
+ "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.',"
+ "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',"
+ "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',"
+ "LOCK_TIME bigint unsigned not null comment 'Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.',"
+ "SQL_TEXT LONGTEXT comment 'The SQL statement, or NULL if the command is not associated with an SQL statement.',"
+ "DIGEST VARCHAR(32) comment 'Statement digest.',"
+ "DIGEST_TEXT LONGTEXT comment 'Statement digest text.',"
+ "CURRENT_SCHEMA VARCHAR(64) comment 'Statement''s default database for the statement, or NULL if there was none.',"
+ "OBJECT_TYPE VARCHAR(64) comment 'Reserved, currently NULL',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Reserved, currently NULL',"
+ "OBJECT_NAME VARCHAR(64) comment 'Reserved, currently NULL',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Address in memory of the statement object.',"
+ "MYSQL_ERRNO INTEGER comment 'Error code. See MariaDB Error Codes for a full list.',"
+ "RETURNED_SQLSTATE VARCHAR(5) comment 'The SQLSTATE value.',"
+ "MESSAGE_TEXT VARCHAR(128) comment 'Statement error message. See MariaDB Error Codes.',"
+ "ERRORS BIGINT unsigned not null comment '0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.',"
+ "WARNINGS BIGINT unsigned not null comment 'Number of warnings from the diagnostics area.',"
+ "ROWS_AFFECTED BIGINT unsigned not null comment 'Number of rows affected the statement affected.',"
+ "ROWS_SENT BIGINT unsigned not null comment 'Number of rows returned.',"
+ "ROWS_EXAMINED BIGINT unsigned not null comment 'Number of rows read during the statement''s execution.',"
+ "CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Number of on-disk temp tables created by the statement.',"
+ "CREATED_TMP_TABLES BIGINT unsigned not null comment 'Number of temp tables created by the statement.',"
+ "SELECT_FULL_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which did not use an index.',"
+ "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range search of the first table.',"
+ "SELECT_RANGE BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range of the first table.',"
+ "SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Number of joins without keys performed by the statement that check for key usage after each row.',"
+ "SELECT_SCAN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a full scan of the first table.',"
+ "SORT_MERGE_PASSES BIGINT unsigned not null comment 'Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.',"
+ "SORT_RANGE BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a range.',"
+ "SORT_ROWS BIGINT unsigned not null comment 'Number of rows sorted by the statement.',"
+ "SORT_SCAN BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a full table scan.',"
+ "NO_INDEX_USED BIGINT unsigned not null comment '0 if the statement performed a table scan with an index, 1 if without an index.',"
+ "NO_GOOD_INDEX_USED BIGINT unsigned not null comment '0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.',"
+ "NESTING_EVENT_ID BIGINT unsigned comment 'Reserved, currently NULL.',"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT') comment 'Reserved, currently NULL.')") }
};
THR_LOCK table_events_statements_history_long::m_table_lock;
@@ -165,46 +165,46 @@ table_events_statements_history_long::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_history_long("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "LOCK_TIME bigint unsigned not null,"
- "SQL_TEXT LONGTEXT,"
- "DIGEST VARCHAR(32),"
- "DIGEST_TEXT LONGTEXT,"
- "CURRENT_SCHEMA VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
- "MYSQL_ERRNO INTEGER,"
- "RETURNED_SQLSTATE VARCHAR(5),"
- "MESSAGE_TEXT VARCHAR(128),"
- "ERRORS BIGINT unsigned not null,"
- "WARNINGS BIGINT unsigned not null,"
- "ROWS_AFFECTED BIGINT unsigned not null,"
- "ROWS_SENT BIGINT unsigned not null,"
- "ROWS_EXAMINED BIGINT unsigned not null,"
- "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SELECT_RANGE BIGINT unsigned not null,"
- "SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SELECT_SCAN BIGINT unsigned not null,"
- "SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SORT_RANGE BIGINT unsigned not null,"
- "SORT_ROWS BIGINT unsigned not null,"
- "SORT_SCAN BIGINT unsigned not null,"
- "NO_INDEX_USED BIGINT unsigned not null,"
- "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'))") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',"
+ "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',"
+ "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table',"
+ "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.',"
+ "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.',"
+ "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',"
+ "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',"
+ "LOCK_TIME bigint unsigned not null comment 'Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.',"
+ "SQL_TEXT LONGTEXT comment 'The SQL statement, or NULL if the command is not associated with an SQL statement.',"
+ "DIGEST VARCHAR(32) comment 'Statement digest.',"
+ "DIGEST_TEXT LONGTEXT comment 'Statement digest text.',"
+ "CURRENT_SCHEMA VARCHAR(64) comment 'Statement''s default database for the statement, or NULL if there was none.',"
+ "OBJECT_TYPE VARCHAR(64) comment 'Reserved, currently NULL',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Reserved, currently NULL',"
+ "OBJECT_NAME VARCHAR(64) comment 'Reserved, currently NULL',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Address in memory of the statement object.',"
+ "MYSQL_ERRNO INTEGER comment 'Error code. See MariaDB Error Codes for a full list.',"
+ "RETURNED_SQLSTATE VARCHAR(5) comment 'The SQLSTATE value.',"
+ "MESSAGE_TEXT VARCHAR(128) comment 'Statement error message. See MariaDB Error Codes.',"
+ "ERRORS BIGINT unsigned not null comment '0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.',"
+ "WARNINGS BIGINT unsigned not null comment 'Number of warnings from the diagnostics area.',"
+ "ROWS_AFFECTED BIGINT unsigned not null comment 'Number of rows affected the statement affected.',"
+ "ROWS_SENT BIGINT unsigned not null comment 'Number of rows returned.',"
+ "ROWS_EXAMINED BIGINT unsigned not null comment 'Number of rows read during the statement''s execution.',"
+ "CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Number of on-disk temp tables created by the statement.',"
+ "CREATED_TMP_TABLES BIGINT unsigned not null comment 'Number of temp tables created by the statement.',"
+ "SELECT_FULL_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which did not use an index.',"
+ "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range search of the first table.',"
+ "SELECT_RANGE BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range of the first table.',"
+ "SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Number of joins without keys performed by the statement that check for key usage after each row.',"
+ "SELECT_SCAN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a full scan of the first table.',"
+ "SORT_MERGE_PASSES BIGINT unsigned not null comment 'Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.',"
+ "SORT_RANGE BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a range.',"
+ "SORT_ROWS BIGINT unsigned not null comment 'Number of rows sorted by the statement.',"
+ "SORT_SCAN BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a full table scan.',"
+ "NO_INDEX_USED BIGINT unsigned not null comment '0 if the statement performed a table scan with an index, 1 if without an index.',"
+ "NO_GOOD_INDEX_USED BIGINT unsigned not null comment '0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.',"
+ "NESTING_EVENT_ID BIGINT unsigned comment 'Reserved, currently NULL.',"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT') comment 'Reserved, currently NULL.')") }
};
table_events_statements_common::table_events_statements_common
diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc
index d6955a46984..44c58603088 100644
--- a/storage/perfschema/table_events_waits.cc
+++ b/storage/perfschema/table_events_waits.cc
@@ -50,25 +50,25 @@ table_events_waits_current::m_share=
sizeof(pos_events_waits_current), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_current("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "SPINS INTEGER unsigned,"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(512),"
- "INDEX_NAME VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
- "OPERATION VARCHAR(32) not null,"
- "NUMBER_OF_BYTES BIGINT,"
- "FLAGS INTEGER unsigned)") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',"
+ "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',"
+ "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table',"
+ "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.',"
+ "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.',"
+ "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',"
+ "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',"
+ "SPINS INTEGER unsigned comment 'Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.',"
+ "OBJECT_NAME VARCHAR(512) comment 'File name for file I/O objects, table name for table I/O objects, the socket''s IP:PORT value for a socket object or NULL for a synchronization object.',"
+ "INDEX_NAME VARCHAR(64) comment 'Name of the index, PRIMARY for the primary key, or NULL for no index used.',"
+ "OBJECT_TYPE VARCHAR(64) comment 'FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the object.',"
+ "NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either statement, stage or wait.',"
+ "OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock',"
+ "NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',"
+ "FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") }
};
THR_LOCK table_events_waits_history::m_table_lock;
@@ -86,25 +86,25 @@ table_events_waits_history::m_share=
sizeof(pos_events_waits_history), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_history("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "SPINS INTEGER unsigned,"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(512),"
- "INDEX_NAME VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
- "OPERATION VARCHAR(32) not null,"
- "NUMBER_OF_BYTES BIGINT,"
- "FLAGS INTEGER unsigned)") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',"
+ "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',"
+ "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table',"
+ "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.',"
+ "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.',"
+ "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',"
+ "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',"
+ "SPINS INTEGER unsigned comment 'Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.',"
+ "OBJECT_NAME VARCHAR(512) comment 'File name for file I/O objects, table name for table I/O objects, the socket''s IP:PORT value for a socket object or NULL for a synchronization object.',"
+ "INDEX_NAME VARCHAR(64) comment 'Name of the index, PRIMARY for the primary key, or NULL for no index used.',"
+ "OBJECT_TYPE VARCHAR(64) comment 'FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the object.',"
+ "NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either statement, stage or wait.',"
+ "OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock',"
+ "NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',"
+ "FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") }
};
THR_LOCK table_events_waits_history_long::m_table_lock;
@@ -122,25 +122,25 @@ table_events_waits_history_long::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_history_long("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "SPINS INTEGER unsigned,"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(512),"
- "INDEX_NAME VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
- "OPERATION VARCHAR(32) not null,"
- "NUMBER_OF_BYTES BIGINT,"
- "FLAGS INTEGER unsigned)") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.',"
+ "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.',"
+ "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table',"
+ "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.',"
+ "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.',"
+ "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.',"
+ "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.',"
+ "SPINS INTEGER unsigned comment 'Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.',"
+ "OBJECT_NAME VARCHAR(512) comment 'File name for file I/O objects, table name for table I/O objects, the socket''s IP:PORT value for a socket object or NULL for a synchronization object.',"
+ "INDEX_NAME VARCHAR(64) comment 'Name of the index, PRIMARY for the primary key, or NULL for no index used.',"
+ "OBJECT_TYPE VARCHAR(64) comment 'FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the object.',"
+ "NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either statement, stage or wait.',"
+ "OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock',"
+ "NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',"
+ "FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") }
};
table_events_waits_common::table_events_waits_common
diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc
index 03477f6d542..01de5b25355 100644
--- a/storage/perfschema/table_events_waits_summary.cc
+++ b/storage/perfschema/table_events_waits_summary.cc
@@ -48,13 +48,13 @@ table_events_waits_summary_by_instance::m_share=
sizeof(pos_all_instr),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_instance("
- "EVENT_NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with OBJECT_INSTANCE_BEGIN for grouping events.',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'If an instrument creates multiple instances, each instance has a unique OBJECT_INSTANCE_BEGIN value to allow for grouping by instance.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") }
};
PFS_engine_table* table_events_waits_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.cc b/storage/perfschema/table_ews_by_account_by_event_name.cc
index 40e0152f889..e859d0aa261 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_account_by_event_name.cc
@@ -49,14 +49,14 @@ table_ews_by_account_by_event_name::m_share=
sizeof(pos_ews_by_account_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_account_by_event_name("
- "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null,"
- "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null comment 'User. Used together with HOST and EVENT_NAME for grouping events.',"
+ "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'Host. Used together with USER and EVENT_NAME for grouping events.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with USER and HOST for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.cc b/storage/perfschema/table_ews_by_host_by_event_name.cc
index d22d6fc8d79..2fcbbc55033 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_host_by_event_name.cc
@@ -50,13 +50,13 @@ table_ews_by_host_by_event_name::m_share=
sizeof(pos_ews_by_host_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_host_by_event_name("
- "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'Host. Used together with EVENT_NAME for grouping events.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with USER and HOST for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.' )") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.cc b/storage/perfschema/table_ews_by_thread_by_event_name.cc
index 33f9765310b..58fdbbc2d10 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.cc
@@ -49,13 +49,13 @@ table_ews_by_thread_by_event_name::m_share=
sizeof(pos_ews_by_thread_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_thread_by_event_name("
- "THREAD_ID BIGINT unsigned not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with THREAD_ID for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.cc b/storage/perfschema/table_ews_by_user_by_event_name.cc
index b2f8e1da824..df8bb41010a 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_user_by_event_name.cc
@@ -50,13 +50,13 @@ table_ews_by_user_by_event_name::m_share=
sizeof(pos_ews_by_user_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_by_user_by_event_name("
- "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null comment 'User. Used together with EVENT_NAME for grouping events.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name. Used together with USER for grouping events.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index 7420c6351fd..eb44e30c3d4 100644
--- a/storage/perfschema/table_ews_global_by_event_name.cc
+++ b/storage/perfschema/table_ews_global_by_event_name.cc
@@ -51,12 +51,12 @@ table_ews_global_by_event_name::m_share=
sizeof(pos_ews_global_by_event_name),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_summary_global_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc
index b323df83ad2..1f64ddb54c5 100644
--- a/storage/perfschema/table_file_instances.cc
+++ b/storage/perfschema/table_file_instances.cc
@@ -48,9 +48,9 @@ table_file_instances::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE file_instances("
- "FILE_NAME VARCHAR(512) not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "OPEN_COUNT INTEGER unsigned not null)") }
+ "FILE_NAME VARCHAR(512) not null comment 'File name.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Instrument name associated with the file.',"
+ "OPEN_COUNT INTEGER unsigned not null comment 'Open handles on the file. A value of greater than zero means that the file is currently open.')") }
};
PFS_engine_table* table_file_instances::create(void)
diff --git a/storage/perfschema/table_file_summary_by_event_name.cc b/storage/perfschema/table_file_summary_by_event_name.cc
index 459b2bf99a6..ce83453875f 100644
--- a/storage/perfschema/table_file_summary_by_event_name.cc
+++ b/storage/perfschema/table_file_summary_by_event_name.cc
@@ -49,29 +49,29 @@ table_file_summary_by_event_name::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE file_summary_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
- "COUNT_MISC BIGINT unsigned not null,"
- "SUM_TIMER_MISC BIGINT unsigned not null,"
- "MIN_TIMER_MISC BIGINT unsigned not null,"
- "AVG_TIMER_MISC BIGINT unsigned not null,"
- "MAX_TIMER_MISC BIGINT unsigned not null)") }
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "COUNT_READ BIGINT unsigned not null comment 'Number of all read operations, including FGETS, FGETC, FREAD, and READ.',"
+ "SUM_TIMER_READ BIGINT unsigned not null comment 'Total wait time of all read operations that are timed.',"
+ "MIN_TIMER_READ BIGINT unsigned not null comment 'Minimum wait time of all read operations that are timed.',"
+ "AVG_TIMER_READ BIGINT unsigned not null comment 'Average wait time of all read operations that are timed.',"
+ "MAX_TIMER_READ BIGINT unsigned not null comment 'Maximum wait time of all read operations that are timed.',"
+ "SUM_NUMBER_OF_BYTES_READ BIGINT not null comment 'Bytes read by read operations.',"
+ "COUNT_WRITE BIGINT unsigned not null comment 'Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE.',"
+ "SUM_TIMER_WRITE BIGINT unsigned not null comment 'Total wait time of all write operations that are timed.',"
+ "MIN_TIMER_WRITE BIGINT unsigned not null comment 'Minimum wait time of all write operations that are timed.',"
+ "AVG_TIMER_WRITE BIGINT unsigned not null comment 'Average wait time of all write operations that are timed.',"
+ "MAX_TIMER_WRITE BIGINT unsigned not null comment 'Maximum wait time of all write operations that are timed.',"
+ "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null comment 'Bytes written by write operations.',"
+ "COUNT_MISC BIGINT unsigned not null comment 'Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC.',"
+ "SUM_TIMER_MISC BIGINT unsigned not null comment 'Total wait time of all miscellaneous operations that are timed.',"
+ "MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
+ "AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
+ "MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") }
};
PFS_engine_table* table_file_summary_by_event_name::create(void)
diff --git a/storage/perfschema/table_file_summary_by_instance.cc b/storage/perfschema/table_file_summary_by_instance.cc
index 3a30984405c..23172055bd1 100644
--- a/storage/perfschema/table_file_summary_by_instance.cc
+++ b/storage/perfschema/table_file_summary_by_instance.cc
@@ -48,31 +48,31 @@ table_file_summary_by_instance::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE file_summary_by_instance("
- "FILE_NAME VARCHAR(512) not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
- "COUNT_MISC BIGINT unsigned not null,"
- "SUM_TIMER_MISC BIGINT unsigned not null,"
- "MIN_TIMER_MISC BIGINT unsigned not null,"
- "AVG_TIMER_MISC BIGINT unsigned not null,"
- "MAX_TIMER_MISC BIGINT unsigned not null)") }
+ "FILE_NAME VARCHAR(512) not null comment 'File name.',"
+ "EVENT_NAME VARCHAR(128) not null comment 'Event name.',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory. Together with FILE_NAME and EVENT_NAME uniquely identifies a row.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "COUNT_READ BIGINT unsigned not null comment 'Number of all read operations, including FGETS, FGETC, FREAD, and READ.',"
+ "SUM_TIMER_READ BIGINT unsigned not null comment 'Total wait time of all read operations that are timed.',"
+ "MIN_TIMER_READ BIGINT unsigned not null comment 'Minimum wait time of all read operations that are timed.',"
+ "AVG_TIMER_READ BIGINT unsigned not null comment 'Average wait time of all read operations that are timed.',"
+ "MAX_TIMER_READ BIGINT unsigned not null comment 'Maximum wait time of all read operations that are timed.',"
+ "SUM_NUMBER_OF_BYTES_READ BIGINT not null comment 'Bytes read by read operations.',"
+ "COUNT_WRITE BIGINT unsigned not null comment 'Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE.',"
+ "SUM_TIMER_WRITE BIGINT unsigned not null comment 'Total wait time of all write operations that are timed.',"
+ "MIN_TIMER_WRITE BIGINT unsigned not null comment 'Minimum wait time of all write operations that are timed.',"
+ "AVG_TIMER_WRITE BIGINT unsigned not null comment 'Average wait time of all write operations that are timed.',"
+ "MAX_TIMER_WRITE BIGINT unsigned not null comment 'Maximum wait time of all write operations that are timed.',"
+ "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null comment 'Bytes written by write operations.',"
+ "COUNT_MISC BIGINT unsigned not null comment 'Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC.',"
+ "SUM_TIMER_MISC BIGINT unsigned not null comment 'Total wait time of all miscellaneous operations that are timed.',"
+ "MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
+ "AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
+ "MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") }
};
PFS_engine_table* table_file_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc
index 430dcf2763d..6ca776640d0 100644
--- a/storage/perfschema/table_host_cache.cc
+++ b/storage/perfschema/table_host_cache.cc
@@ -45,35 +45,35 @@ table_host_cache::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE host_cache("
- "IP VARCHAR(64) not null,"
- "HOST VARCHAR(255) collate utf8_bin,"
- "HOST_VALIDATED ENUM ('YES', 'NO') not null,"
- "SUM_CONNECT_ERRORS BIGINT not null,"
- "COUNT_HOST_BLOCKED_ERRORS BIGINT not null,"
- "COUNT_NAMEINFO_TRANSIENT_ERRORS BIGINT not null,"
- "COUNT_NAMEINFO_PERMANENT_ERRORS BIGINT not null,"
- "COUNT_FORMAT_ERRORS BIGINT not null,"
- "COUNT_ADDRINFO_TRANSIENT_ERRORS BIGINT not null,"
- "COUNT_ADDRINFO_PERMANENT_ERRORS BIGINT not null,"
- "COUNT_FCRDNS_ERRORS BIGINT not null,"
- "COUNT_HOST_ACL_ERRORS BIGINT not null,"
- "COUNT_NO_AUTH_PLUGIN_ERRORS BIGINT not null,"
- "COUNT_AUTH_PLUGIN_ERRORS BIGINT not null,"
- "COUNT_HANDSHAKE_ERRORS BIGINT not null,"
- "COUNT_PROXY_USER_ERRORS BIGINT not null,"
- "COUNT_PROXY_USER_ACL_ERRORS BIGINT not null,"
- "COUNT_AUTHENTICATION_ERRORS BIGINT not null,"
- "COUNT_SSL_ERRORS BIGINT not null,"
- "COUNT_MAX_USER_CONNECTIONS_ERRORS BIGINT not null,"
- "COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS BIGINT not null,"
- "COUNT_DEFAULT_DATABASE_ERRORS BIGINT not null,"
- "COUNT_INIT_CONNECT_ERRORS BIGINT not null,"
- "COUNT_LOCAL_ERRORS BIGINT not null,"
- "COUNT_UNKNOWN_ERRORS BIGINT not null,"
- "FIRST_SEEN TIMESTAMP(0) NOT NULL default 0,"
- "LAST_SEEN TIMESTAMP(0) NOT NULL default 0,"
- "FIRST_ERROR_SEEN TIMESTAMP(0) null default 0,"
- "LAST_ERROR_SEEN TIMESTAMP(0) null default 0)") }
+ "IP VARCHAR(64) not null comment 'Client IP address.',"
+ "HOST VARCHAR(255) collate utf8_bin comment 'IP''s resolved DNS host name, or NULL if unknown.',"
+ "HOST_VALIDATED ENUM ('YES', 'NO') not null comment 'YES if the IP-to-host DNS lookup was successful, and the HOST column can be used to avoid DNS calls, or NO if unsuccessful, in which case DNS lookup is performed for each connect until either successful or a permanent error.',"
+ "SUM_CONNECT_ERRORS BIGINT not null comment 'Number of connection errors. Counts only protocol handshake errors for hosts that passed validation. These errors count towards max_connect_errors.',"
+ "COUNT_HOST_BLOCKED_ERRORS BIGINT not null comment 'Number of blocked connections because SUM_CONNECT_ERRORS exceeded the max_connect_errors system variable.',"
+ "COUNT_NAMEINFO_TRANSIENT_ERRORS BIGINT not null comment 'Number of transient errors during IP-to-host DNS lookups.',"
+ "COUNT_NAMEINFO_PERMANENT_ERRORS BIGINT not null comment 'Number of permanent errors during IP-to-host DNS lookups.',"
+ "COUNT_FORMAT_ERRORS BIGINT not null comment 'Number of host name format errors, for example a numeric host column.',"
+ "COUNT_ADDRINFO_TRANSIENT_ERRORS BIGINT not null comment 'Number of transient errors during host-to-IP reverse DNS lookups.',"
+ "COUNT_ADDRINFO_PERMANENT_ERRORS BIGINT not null comment 'Number of permanent errors during host-to-IP reverse DNS lookups.',"
+ "COUNT_FCRDNS_ERRORS BIGINT not null comment 'Number of forward-confirmed reverse DNS errors, which occur when IP-to-host DNS lookup does not match the originating IP address.',"
+ "COUNT_HOST_ACL_ERRORS BIGINT not null comment 'Number of errors occurring because no user from the host is permitted to log in. These attempts return error code 1130 ER_HOST_NOT_PRIVILEGED and do not proceed to username and password authentication.',"
+ "COUNT_NO_AUTH_PLUGIN_ERRORS BIGINT not null comment 'Number of errors due to requesting an authentication plugin that was not available. This can be due to the plugin never having been loaded, or the load attempt failing.',"
+ "COUNT_AUTH_PLUGIN_ERRORS BIGINT not null comment 'Number of errors reported by an authentication plugin. Plugins can increment COUNT_AUTHENTICATION_ERRORS or COUNT_HANDSHAKE_ERRORS instead, but, if specified or the error is unknown, this column is incremented.',"
+ "COUNT_HANDSHAKE_ERRORS BIGINT not null comment 'Number of errors detected at the wire protocol level.',"
+ "COUNT_PROXY_USER_ERRORS BIGINT not null comment 'Number of errors detected when a proxy user is proxied to a user that does not exist.',"
+ "COUNT_PROXY_USER_ACL_ERRORS BIGINT not null comment 'Number of errors detected when a proxy user is proxied to a user that exists, but the proxy user doesn''t have the PROXY privilege.',"
+ "COUNT_AUTHENTICATION_ERRORS BIGINT not null comment 'Number of errors where authentication failed.',"
+ "COUNT_SSL_ERRORS BIGINT not null comment 'Number of errors due to TLS problems.',"
+ "COUNT_MAX_USER_CONNECTIONS_ERRORS BIGINT not null comment 'Number of errors due to the per-user quota being exceeded.',"
+ "COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS BIGINT not null comment 'Number of errors due to the per-hour quota being exceeded.',"
+ "COUNT_DEFAULT_DATABASE_ERRORS BIGINT not null comment 'Number of errors due to the user not having permission to access the specified default database, or it not existing.',"
+ "COUNT_INIT_CONNECT_ERRORS BIGINT not null comment 'Number of errors due to statements in the init_connect system variable.',"
+ "COUNT_LOCAL_ERRORS BIGINT not null comment 'Number of local server errors, such as out-of-memory errors, unrelated to network, authentication, or authorization.',"
+ "COUNT_UNKNOWN_ERRORS BIGINT not null comment 'Number of unknown errors that cannot be allocated to another column.',"
+ "FIRST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Timestamp of the first connection attempt by the IP.',"
+ "LAST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Timestamp of the most recent connection attempt by the IP.',"
+ "FIRST_ERROR_SEEN TIMESTAMP(0) null default 0 comment 'Timestamp of the first error seen from the IP.',"
+ "LAST_ERROR_SEEN TIMESTAMP(0) null default 0 comment 'Timestamp of the most recent error seen from the IP.')") }
};
PFS_engine_table* table_host_cache::create(void)
diff --git a/storage/perfschema/table_hosts.cc b/storage/perfschema/table_hosts.cc
index 221e0664590..b65b3889fef 100644
--- a/storage/perfschema/table_hosts.cc
+++ b/storage/perfschema/table_hosts.cc
@@ -44,9 +44,9 @@ table_hosts::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE hosts("
- "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null,"
- "CURRENT_CONNECTIONS bigint not null,"
- "TOTAL_CONNECTIONS bigint not null)") }
+ "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'Host name used by the client to connect, NULL for internal threads or user sessions that failed to authenticate.',"
+ "CURRENT_CONNECTIONS bigint not null comment 'Current number of the host''s connections.',"
+ "TOTAL_CONNECTIONS bigint not null comment 'Total number of the host''s connections')") }
};
PFS_engine_table* table_hosts::create()
diff --git a/storage/perfschema/table_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc
index b549b0c22e7..4cb947e2fe9 100644
--- a/storage/perfschema/table_os_global_by_type.cc
+++ b/storage/perfschema/table_os_global_by_type.cc
@@ -48,14 +48,14 @@ table_os_global_by_type::m_share=
sizeof(pos_os_global_by_type),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE objects_summary_global_by_type("
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null)") }
+ "OBJECT_TYPE VARCHAR(64) comment 'Groups records together with OBJECT_SCHEMA and OBJECT_NAME.',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Groups records together with OBJECT_TYPE and OBJECT_NAME.',"
+ "OBJECT_NAME VARCHAR(64) comment 'Groups records together with OBJECT_SCHEMA and OBJECT_TYPE.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc
index a77f005ab62..20d893bac14 100644
--- a/storage/perfschema/table_performance_timers.cc
+++ b/storage/perfschema/table_performance_timers.cc
@@ -46,10 +46,10 @@ table_performance_timers::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE performance_timers("
- "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null,"
- "TIMER_FREQUENCY BIGINT,"
- "TIMER_RESOLUTION BIGINT,"
- "TIMER_OVERHEAD BIGINT)") }
+ "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null comment 'Time name, used in the setup_timers table.',"
+ "TIMER_FREQUENCY BIGINT comment 'Number of timer units per second. Dependent on the processor speed.',"
+ "TIMER_RESOLUTION BIGINT comment 'Number of timer units by which timed values increase each time.',"
+ "TIMER_OVERHEAD BIGINT comment 'Minimum timer overhead, determined during initialization by calling the timer 20 times and selecting the smallest value. Total overhead will be at least double this, as the timer is called at the beginning and end of each timed event.')") }
};
PFS_engine_table* table_performance_timers::create(void)
diff --git a/storage/perfschema/table_session_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc
index 59a36e1cdb0..f23caa4b893 100644
--- a/storage/perfschema/table_session_account_connect_attrs.cc
+++ b/storage/perfschema/table_session_account_connect_attrs.cc
@@ -37,10 +37,10 @@ table_session_account_connect_attrs::m_share=
sizeof(pos_connect_attr_by_thread_by_attr), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE session_account_connect_attrs("
- "PROCESSLIST_ID INT NOT NULL,"
- "ATTR_NAME VARCHAR(32) NOT NULL,"
- "ATTR_VALUE VARCHAR(1024),"
- "ORDINAL_POSITION INT"
+ "PROCESSLIST_ID INT NOT NULL comment 'Session connection identifier.',"
+ "ATTR_NAME VARCHAR(32) NOT NULL comment 'Attribute name.',"
+ "ATTR_VALUE VARCHAR(1024) comment 'Attribute value.',"
+ "ORDINAL_POSITION INT comment 'Order in which attribute was added to the connection attributes.'"
") CHARACTER SET utf8 COLLATE utf8_bin") }
};
diff --git a/storage/perfschema/table_session_connect_attrs.cc b/storage/perfschema/table_session_connect_attrs.cc
index a4bb651f291..be3e00cc1c2 100644
--- a/storage/perfschema/table_session_connect_attrs.cc
+++ b/storage/perfschema/table_session_connect_attrs.cc
@@ -37,10 +37,10 @@ table_session_connect_attrs::m_share=
sizeof(pos_connect_attr_by_thread_by_attr), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE session_connect_attrs("
- "PROCESSLIST_ID INT NOT NULL,"
- "ATTR_NAME VARCHAR(32) NOT NULL,"
- "ATTR_VALUE VARCHAR(1024),"
- "ORDINAL_POSITION INT"
+ "PROCESSLIST_ID INT NOT NULL comment 'Session connection identifier.',"
+ "ATTR_NAME VARCHAR(32) NOT NULL comment 'Attribute name.',"
+ "ATTR_VALUE VARCHAR(1024) comment 'Attribute value.',"
+ "ORDINAL_POSITION INT comment 'Order in which attribute was added to the connection attributes.'"
") CHARACTER SET utf8 COLLATE utf8_bin") }
};
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index 767a7e9e6f0..9ef4b9efac2 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -49,9 +49,9 @@ table_setup_actors::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE setup_actors("
- "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default '%' not null,"
- "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default '%' not null,"
- "ROLE CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default '%' not null)") }
+ "HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default '%' not null comment 'Host name, either a literal, or the % wildcard representing any host.',"
+ "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default '%' not null comment 'User name, either a literal or the % wildcard representing any name.',"
+ "ROLE CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default '%' not null comment 'Unused')") }
};
PFS_engine_table* table_setup_actors::create()
diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index afd7f41260a..bcba001e615 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -112,8 +112,8 @@ table_setup_consumers::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE setup_consumers("
- "NAME VARCHAR(64) not null,"
- "ENABLED ENUM ('YES', 'NO') not null)") }
+ "NAME VARCHAR(64) not null comment 'Consumer name',"
+ "ENABLED ENUM ('YES', 'NO') not null comment 'YES or NO for whether or not the consumer is enabled. You can modify this column to ensure that event information is added, or is not added.')") }
};
PFS_engine_table* table_setup_consumers::create(void)
diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index 4741e944ee0..396faebf239 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -50,9 +50,9 @@ table_setup_instruments::m_share=
sizeof(pos_setup_instruments),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE setup_instruments("
- "NAME VARCHAR(128) not null,"
- "ENABLED ENUM ('YES', 'NO') not null,"
- "TIMED ENUM ('YES', 'NO') not null)") }
+ "NAME VARCHAR(128) not null comment 'Instrument name',"
+ "ENABLED ENUM ('YES', 'NO') not null comment 'Whether or not the instrument is enabled. It can be disabled, and the instrument will produce no events.',"
+ "TIMED ENUM ('YES', 'NO') not null comment 'Whether or not the instrument is timed. It can be set, but if disabled, events produced by the instrument will have NULL values for the corresponding TIMER_START, TIMER_END, and TIMER_WAIT values.')") }
};
PFS_engine_table* table_setup_instruments::create(void)
diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index 168c51cfdda..f14d3423276 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -50,11 +50,11 @@ table_setup_objects::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE setup_objects("
- "OBJECT_TYPE ENUM ('TABLE') not null default 'TABLE',"
- "OBJECT_SCHEMA VARCHAR(64) default '%',"
- "OBJECT_NAME VARCHAR(64) not null default '%',"
- "ENABLED ENUM ('YES', 'NO') not null default 'YES',"
- "TIMED ENUM ('YES', 'NO') not null default 'YES')") }
+ "OBJECT_TYPE ENUM ('TABLE') not null default 'TABLE' comment 'Type of object to instrument. Currently, only TABLE, for base table.',"
+ "OBJECT_SCHEMA VARCHAR(64) default '%' comment 'Schema containing the object, either the literal or % for any schema.',"
+ "OBJECT_NAME VARCHAR(64) not null default '%' comment 'Name of the instrumented object, either the literal or % for any object.',"
+ "ENABLED ENUM ('YES', 'NO') not null default 'YES' comment 'Whether the object''s events are instrumented or not. Can be disabled, in which case monitoring is not enabled for those objects.',"
+ "TIMED ENUM ('YES', 'NO') not null default 'YES' comment 'Whether the object''s events are timed or not. Can be modified.')") }
};
int update_derived_flags()
diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index be1ac58cc3e..ed643aed4c5 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -68,8 +68,8 @@ table_setup_timers::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE setup_timers("
- "NAME VARCHAR(64) not null,"
- "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null)") }
+ "NAME VARCHAR(64) not null comment 'Type of instrument the timer is used for.',"
+ "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null comment 'Timer applying to the instrument type. Can be modified.')") }
};
PFS_engine_table* table_setup_timers::create(void)
diff --git a/storage/perfschema/table_socket_instances.cc b/storage/perfschema/table_socket_instances.cc
index 920531136d5..fcfc6bb17c7 100644
--- a/storage/perfschema/table_socket_instances.cc
+++ b/storage/perfschema/table_socket_instances.cc
@@ -48,13 +48,13 @@ table_socket_instances::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE socket_instances("
- "EVENT_NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "THREAD_ID BIGINT unsigned,"
- "SOCKET_ID INTEGER not null,"
- "IP VARCHAR(64) not null,"
- "PORT INTEGER not null,"
- "STATE ENUM('IDLE','ACTIVE') not null)") }
+ "EVENT_NAME VARCHAR(128) not null comment 'NAME from the setup_instruments table, and the name of the wait/io/socket/* instrument that produced the event.',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Memory address of the object.',"
+ "THREAD_ID BIGINT unsigned comment 'Thread identifier that the server assigns to each socket.',"
+ "SOCKET_ID INTEGER not null comment 'The socket''s internal file handle.',"
+ "IP VARCHAR(64) not null comment 'Client IP address. Blank for Unix socket file, otherwise an IPv4 or IPv6 address. Together with the PORT identifies the connection.',"
+ "PORT INTEGER not null comment 'TCP/IP port number, from 0 to 65535. Together with the IP identifies the connection.',"
+ "STATE ENUM('IDLE','ACTIVE') not null comment 'Socket status, either IDLE if waiting to receive a request from a client, or ACTIVE')") }
};
PFS_engine_table* table_socket_instances::create(void)
diff --git a/storage/perfschema/table_socket_summary_by_event_name.cc b/storage/perfschema/table_socket_summary_by_event_name.cc
index c813d45b732..2db0ea2d6ff 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.cc
+++ b/storage/perfschema/table_socket_summary_by_event_name.cc
@@ -49,29 +49,29 @@ table_socket_summary_by_event_name::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE socket_summary_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
- "COUNT_MISC BIGINT unsigned not null,"
- "SUM_TIMER_MISC BIGINT unsigned not null,"
- "MIN_TIMER_MISC BIGINT unsigned not null,"
- "AVG_TIMER_MISC BIGINT unsigned not null,"
- "MAX_TIMER_MISC BIGINT unsigned not null)") }
+ "EVENT_NAME VARCHAR(128) not null comment 'Socket instrument.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "COUNT_READ BIGINT unsigned not null comment 'Number of all read operations, including RECV, RECVFROM, and RECVMSG.',"
+ "SUM_TIMER_READ BIGINT unsigned not null comment 'Total wait time of all read operations that are timed.',"
+ "MIN_TIMER_READ BIGINT unsigned not null comment 'Minimum wait time of all read operations that are timed.',"
+ "AVG_TIMER_READ BIGINT unsigned not null comment 'Average wait time of all read operations that are timed.',"
+ "MAX_TIMER_READ BIGINT unsigned not null comment 'Maximum wait time of all read operations that are timed.',"
+ "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null comment 'Bytes read by read operations.',"
+ "COUNT_WRITE BIGINT unsigned not null comment 'Number of all write operations, including SEND, SENDTO, and SENDMSG.',"
+ "SUM_TIMER_WRITE BIGINT unsigned not null comment 'Total wait time of all write operations that are timed.',"
+ "MIN_TIMER_WRITE BIGINT unsigned not null comment 'Minimum wait time of all write operations that are timed.',"
+ "AVG_TIMER_WRITE BIGINT unsigned not null comment 'Average wait time of all write operations that are timed.',"
+ "MAX_TIMER_WRITE BIGINT unsigned not null comment 'Maximum wait time of all write operations that are timed.',"
+ "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null comment 'Bytes written by write operations.',"
+ "COUNT_MISC BIGINT unsigned not null comment 'Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN.',"
+ "SUM_TIMER_MISC BIGINT unsigned not null comment 'Total wait time of all miscellaneous operations that are timed.',"
+ "MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
+ "AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
+ "MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") }
};
PFS_engine_table* table_socket_summary_by_event_name::create(void)
diff --git a/storage/perfschema/table_socket_summary_by_instance.cc b/storage/perfschema/table_socket_summary_by_instance.cc
index a4b1477aa90..8244d2c8bae 100644
--- a/storage/perfschema/table_socket_summary_by_instance.cc
+++ b/storage/perfschema/table_socket_summary_by_instance.cc
@@ -48,30 +48,30 @@ table_socket_summary_by_instance::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE socket_summary_by_instance("
- "EVENT_NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
- "COUNT_MISC BIGINT unsigned not null,"
- "SUM_TIMER_MISC BIGINT unsigned not null,"
- "MIN_TIMER_MISC BIGINT unsigned not null,"
- "AVG_TIMER_MISC BIGINT unsigned not null,"
- "MAX_TIMER_MISC BIGINT unsigned not null)") }
+ "EVENT_NAME VARCHAR(128) not null comment 'Socket instrument.',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "COUNT_READ BIGINT unsigned not null comment 'Number of all read operations, including RECV, RECVFROM, and RECVMSG.',"
+ "SUM_TIMER_READ BIGINT unsigned not null comment 'Total wait time of all read operations that are timed.',"
+ "MIN_TIMER_READ BIGINT unsigned not null comment 'Minimum wait time of all read operations that are timed.',"
+ "AVG_TIMER_READ BIGINT unsigned not null comment 'Average wait time of all read operations that are timed.',"
+ "MAX_TIMER_READ BIGINT unsigned not null comment 'Maximum wait time of all read operations that are timed.',"
+ "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null comment 'Bytes read by read operations.',"
+ "COUNT_WRITE BIGINT unsigned not null comment 'Number of all write operations, including SEND, SENDTO, and SENDMSG.',"
+ "SUM_TIMER_WRITE BIGINT unsigned not null comment 'Total wait time of all write operations that are timed.',"
+ "MIN_TIMER_WRITE BIGINT unsigned not null comment 'Minimum wait time of all write operations that are timed.',"
+ "AVG_TIMER_WRITE BIGINT unsigned not null comment 'Average wait time of all write operations that are timed.',"
+ "MAX_TIMER_WRITE BIGINT unsigned not null comment 'Maximum wait time of all write operations that are timed.',"
+ "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null comment 'Bytes written by write operations.',"
+ "COUNT_MISC BIGINT unsigned not null comment 'Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN.',"
+ "SUM_TIMER_MISC BIGINT unsigned not null comment 'Total wait time of all miscellaneous operations that are timed.',"
+ "MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
+ "AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
+ "MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") }
};
PFS_engine_table* table_socket_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc
index f0c7800d24a..aa9b004fc02 100644
--- a/storage/perfschema/table_sync_instances.cc
+++ b/storage/perfschema/table_sync_instances.cc
@@ -49,9 +49,9 @@ table_mutex_instances::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE mutex_instances("
- "NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "LOCKED_BY_THREAD_ID BIGINT unsigned)") }
+ "NAME VARCHAR(128) not null comment 'Instrument name associated with the mutex.',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Memory address of the instrumented mutex.',"
+ "LOCKED_BY_THREAD_ID BIGINT unsigned comment 'The THREAD_ID of the locking thread if a thread has a mutex locked, otherwise NULL.')") }
};
PFS_engine_table* table_mutex_instances::create(void)
@@ -192,10 +192,10 @@ table_rwlock_instances::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE rwlock_instances("
- "NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "WRITE_LOCKED_BY_THREAD_ID BIGINT unsigned,"
- "READ_LOCKED_BY_COUNT INTEGER unsigned not null)") }
+ "NAME VARCHAR(128) not null comment 'Instrument name associated with the read write lock',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the instrumented lock',"
+ "WRITE_LOCKED_BY_THREAD_ID BIGINT unsigned comment 'THREAD_ID of the locking thread if locked in write (exclusive) mode, otherwise NULL.',"
+ "READ_LOCKED_BY_COUNT INTEGER unsigned not null comment 'Count of current read locks held')") }
};
PFS_engine_table* table_rwlock_instances::create(void)
@@ -343,8 +343,8 @@ table_cond_instances::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE cond_instances("
- "NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null)") }
+ "NAME VARCHAR(128) not null comment 'Client user name for the connection, or NULL if an internal thread.',"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the instrumented condition.')") }
};
PFS_engine_table* table_cond_instances::create(void)
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index 00196718113..f342b5c6601 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -42,20 +42,20 @@ table_threads::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE threads("
- "THREAD_ID BIGINT unsigned not null,"
- "NAME VARCHAR(128) not null,"
- "TYPE VARCHAR(10) not null,"
- "PROCESSLIST_ID BIGINT unsigned,"
- "PROCESSLIST_USER VARCHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) "),"
- "PROCESSLIST_HOST VARCHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) "),"
- "PROCESSLIST_DB VARCHAR(64),"
- "PROCESSLIST_COMMAND VARCHAR(16),"
- "PROCESSLIST_TIME BIGINT,"
- "PROCESSLIST_STATE VARCHAR(64),"
- "PROCESSLIST_INFO LONGTEXT,"
- "PARENT_THREAD_ID BIGINT unsigned,"
- "ROLE VARCHAR(64),"
- "INSTRUMENTED ENUM ('YES', 'NO') not null)") }
+ "THREAD_ID BIGINT unsigned not null comment 'A unique thread identifier.',"
+ "NAME VARCHAR(128) not null comment 'Name associated with the server''s thread instrumentation code, for example thread/sql/main for the server''s main() function, and thread/sql/one_connection for a user connection.',"
+ "TYPE VARCHAR(10) not null comment 'FOREGROUND or BACKGROUND, depending on the thread type. User connection threads are FOREGROUND, internal server threads are BACKGROUND.',"
+ "PROCESSLIST_ID BIGINT unsigned comment 'The PROCESSLIST.ID value for threads displayed in the INFORMATION_SCHEMA.PROCESSLIST table, or 0 for background threads. Also corresponds with the CONNECTION_ID() return value for the thread.',"
+ "PROCESSLIST_USER VARCHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") comment 'Foreground thread user, or NULL for a background thread.',"
+ "PROCESSLIST_HOST VARCHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") comment 'Foreground thread host, or NULL for a background thread.',"
+ "PROCESSLIST_DB VARCHAR(64) comment 'Thread''s default database, or NULL if none exists.',"
+ "PROCESSLIST_COMMAND VARCHAR(16) comment 'Type of command executed by the thread. These correspond to the the COM_xxx client/server protocol commands, and the Com_xxx status variables. See Thread Command Values.',"
+ "PROCESSLIST_TIME BIGINT comment 'Time in seconds the thread has been in its current state.',"
+ "PROCESSLIST_STATE VARCHAR(64) comment 'Action, event or state indicating what the thread is doing.',"
+ "PROCESSLIST_INFO LONGTEXT comment 'Statement being executed by the thread, or NULL if a statement is not being executed. If a statement results in calling other statements, such as for a stored procedure, the innermost statement from the stored procedure is shown here.',"
+ "PARENT_THREAD_ID BIGINT unsigned comment 'THREAD_ID of the parent thread, if any. Subthreads can for example be spawned as a result of INSERT DELAYED statements.',"
+ "ROLE VARCHAR(64) comment 'Unused.',"
+ "INSTRUMENTED ENUM ('YES', 'NO') not null comment 'YES or NO for Whether the thread is instrumented or not. For foreground threads, the initial value is determined by whether there''s a user/host match in the setup_actors table. Subthreads are again matched, while for background threads, this will be set to YES by default. To monitor events that the thread executes, INSTRUMENTED must be YES and the thread_instrumentation consumer in the setup_consumers table must also be YES.')") }
};
PFS_engine_table* table_threads::create()
diff --git a/storage/perfschema/table_tiws_by_index_usage.cc b/storage/perfschema/table_tiws_by_index_usage.cc
index b49e9280469..034c91af653 100644
--- a/storage/perfschema/table_tiws_by_index_usage.cc
+++ b/storage/perfschema/table_tiws_by_index_usage.cc
@@ -49,45 +49,45 @@ table_tiws_by_index_usage::m_share=
sizeof(pos_tiws_by_index_usage),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE table_io_waits_summary_by_index_usage("
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "INDEX_NAME VARCHAR(64),"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "COUNT_FETCH BIGINT unsigned not null,"
- "SUM_TIMER_FETCH BIGINT unsigned not null,"
- "MIN_TIMER_FETCH BIGINT unsigned not null,"
- "AVG_TIMER_FETCH BIGINT unsigned not null,"
- "MAX_TIMER_FETCH BIGINT unsigned not null,"
- "COUNT_INSERT BIGINT unsigned not null,"
- "SUM_TIMER_INSERT BIGINT unsigned not null,"
- "MIN_TIMER_INSERT BIGINT unsigned not null,"
- "AVG_TIMER_INSERT BIGINT unsigned not null,"
- "MAX_TIMER_INSERT BIGINT unsigned not null,"
- "COUNT_UPDATE BIGINT unsigned not null,"
- "SUM_TIMER_UPDATE BIGINT unsigned not null,"
- "MIN_TIMER_UPDATE BIGINT unsigned not null,"
- "AVG_TIMER_UPDATE BIGINT unsigned not null,"
- "MAX_TIMER_UPDATE BIGINT unsigned not null,"
- "COUNT_DELETE BIGINT unsigned not null,"
- "SUM_TIMER_DELETE BIGINT unsigned not null,"
- "MIN_TIMER_DELETE BIGINT unsigned not null,"
- "AVG_TIMER_DELETE BIGINT unsigned not null,"
- "MAX_TIMER_DELETE BIGINT unsigned not null)") }
+ "OBJECT_TYPE VARCHAR(64) comment 'TABLE in the case of all indexes.',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Schema name.',"
+ "OBJECT_NAME VARCHAR(64) comment 'Table name.',"
+ "INDEX_NAME VARCHAR(64) comment 'Index name, or PRIMARY for the primary index, NULL for no index (inserts are counted in this case).',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events and the sum of the x_READ and x_WRITE columns.',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "COUNT_READ BIGINT unsigned not null comment 'Number of all read operations, and the sum of the equivalent x_FETCH columns.',"
+ "SUM_TIMER_READ BIGINT unsigned not null comment 'Total wait time of all read operations that are timed.',"
+ "MIN_TIMER_READ BIGINT unsigned not null comment 'Minimum wait time of all read operations that are timed.',"
+ "AVG_TIMER_READ BIGINT unsigned not null comment 'Average wait time of all read operations that are timed.',"
+ "MAX_TIMER_READ BIGINT unsigned not null comment 'Maximum wait time of all read operations that are timed.',"
+ "COUNT_WRITE BIGINT unsigned not null comment 'Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns.',"
+ "SUM_TIMER_WRITE BIGINT unsigned not null comment 'Total wait time of all write operations that are timed.',"
+ "MIN_TIMER_WRITE BIGINT unsigned not null comment 'Minimum wait time of all write operations that are timed.',"
+ "AVG_TIMER_WRITE BIGINT unsigned not null comment 'Average wait time of all write operations that are timed.',"
+ "MAX_TIMER_WRITE BIGINT unsigned not null comment 'Maximum wait time of all write operations that are timed.',"
+ "COUNT_FETCH BIGINT unsigned not null comment 'Number of all fetch operations.',"
+ "SUM_TIMER_FETCH BIGINT unsigned not null comment 'Total wait time of all fetch operations that are timed.',"
+ "MIN_TIMER_FETCH BIGINT unsigned not null comment 'Minimum wait time of all fetch operations that are timed.',"
+ "AVG_TIMER_FETCH BIGINT unsigned not null comment 'Average wait time of all fetch operations that are timed.',"
+ "MAX_TIMER_FETCH BIGINT unsigned not null comment 'Maximum wait time of all fetch operations that are timed.',"
+ "COUNT_INSERT BIGINT unsigned not null comment 'Number of all insert operations.',"
+ "SUM_TIMER_INSERT BIGINT unsigned not null comment 'Total wait time of all insert operations that are timed.',"
+ "MIN_TIMER_INSERT BIGINT unsigned not null comment 'Minimum wait time of all insert operations that are timed.',"
+ "AVG_TIMER_INSERT BIGINT unsigned not null comment 'Average wait time of all insert operations that are timed.',"
+ "MAX_TIMER_INSERT BIGINT unsigned not null comment 'Maximum wait time of all insert operations that are timed.',"
+ "COUNT_UPDATE BIGINT unsigned not null comment 'Number of all update operations.',"
+ "SUM_TIMER_UPDATE BIGINT unsigned not null comment 'Total wait time of all update operations that are timed.',"
+ "MIN_TIMER_UPDATE BIGINT unsigned not null comment 'Minimum wait time of all update operations that are timed.',"
+ "AVG_TIMER_UPDATE BIGINT unsigned not null comment 'Average wait time of all update operations that are timed.',"
+ "MAX_TIMER_UPDATE BIGINT unsigned not null comment 'Maximum wait time of all update operations that are timed.',"
+ "COUNT_DELETE BIGINT unsigned not null comment 'Number of all delete operations.',"
+ "SUM_TIMER_DELETE BIGINT unsigned not null comment 'Total wait time of all delete operations that are timed.',"
+ "MIN_TIMER_DELETE BIGINT unsigned not null comment 'Minimum wait time of all delete operations that are timed.',"
+ "AVG_TIMER_DELETE BIGINT unsigned not null comment 'Average wait time of all delete operations that are timed.',"
+ "MAX_TIMER_DELETE BIGINT unsigned not null comment 'Maximum wait time of all delete operations that are timed.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc
index db00fd2409e..4061164dbf4 100644
--- a/storage/perfschema/table_tiws_by_table.cc
+++ b/storage/perfschema/table_tiws_by_table.cc
@@ -49,44 +49,44 @@ table_tiws_by_table::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE table_io_waits_summary_by_table("
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "COUNT_FETCH BIGINT unsigned not null,"
- "SUM_TIMER_FETCH BIGINT unsigned not null,"
- "MIN_TIMER_FETCH BIGINT unsigned not null,"
- "AVG_TIMER_FETCH BIGINT unsigned not null,"
- "MAX_TIMER_FETCH BIGINT unsigned not null,"
- "COUNT_INSERT BIGINT unsigned not null,"
- "SUM_TIMER_INSERT BIGINT unsigned not null,"
- "MIN_TIMER_INSERT BIGINT unsigned not null,"
- "AVG_TIMER_INSERT BIGINT unsigned not null,"
- "MAX_TIMER_INSERT BIGINT unsigned not null,"
- "COUNT_UPDATE BIGINT unsigned not null,"
- "SUM_TIMER_UPDATE BIGINT unsigned not null,"
- "MIN_TIMER_UPDATE BIGINT unsigned not null,"
- "AVG_TIMER_UPDATE BIGINT unsigned not null,"
- "MAX_TIMER_UPDATE BIGINT unsigned not null,"
- "COUNT_DELETE BIGINT unsigned not null,"
- "SUM_TIMER_DELETE BIGINT unsigned not null,"
- "MIN_TIMER_DELETE BIGINT unsigned not null,"
- "AVG_TIMER_DELETE BIGINT unsigned not null,"
- "MAX_TIMER_DELETE BIGINT unsigned not null)") }
+ "OBJECT_TYPE VARCHAR(64) comment 'Since this table records waits by table, always set to TABLE.',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Schema name.',"
+ "OBJECT_NAME VARCHAR(64) comment 'Table name.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events and the sum of the x_READ and x_WRITE columns.',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "COUNT_READ BIGINT unsigned not null comment 'Number of all read operations, and the sum of the equivalent x_FETCH columns.',"
+ "SUM_TIMER_READ BIGINT unsigned not null comment 'Total wait time of all read operations that are timed.',"
+ "MIN_TIMER_READ BIGINT unsigned not null comment 'Minimum wait time of all read operations that are timed.',"
+ "AVG_TIMER_READ BIGINT unsigned not null comment 'Average wait time of all read operations that are timed.',"
+ "MAX_TIMER_READ BIGINT unsigned not null comment 'Maximum wait time of all read operations that are timed.',"
+ "COUNT_WRITE BIGINT unsigned not null comment 'Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns.',"
+ "SUM_TIMER_WRITE BIGINT unsigned not null comment 'Total wait time of all write operations that are timed.',"
+ "MIN_TIMER_WRITE BIGINT unsigned not null comment 'Minimum wait time of all write operations that are timed.',"
+ "AVG_TIMER_WRITE BIGINT unsigned not null comment 'Average wait time of all write operations that are timed.',"
+ "MAX_TIMER_WRITE BIGINT unsigned not null comment 'Maximum wait time of all write operations that are timed.',"
+ "COUNT_FETCH BIGINT unsigned not null comment 'Number of all fetch operations.',"
+ "SUM_TIMER_FETCH BIGINT unsigned not null comment 'Total wait time of all fetch operations that are timed.',"
+ "MIN_TIMER_FETCH BIGINT unsigned not null comment 'Minimum wait time of all fetch operations that are timed.',"
+ "AVG_TIMER_FETCH BIGINT unsigned not null comment 'Average wait time of all fetch operations that are timed.',"
+ "MAX_TIMER_FETCH BIGINT unsigned not null comment 'Maximum wait time of all fetch operations that are timed.',"
+ "COUNT_INSERT BIGINT unsigned not null comment 'Number of all insert operations.',"
+ "SUM_TIMER_INSERT BIGINT unsigned not null comment 'Total wait time of all insert operations that are timed.',"
+ "MIN_TIMER_INSERT BIGINT unsigned not null comment 'Minimum wait time of all insert operations that are timed.',"
+ "AVG_TIMER_INSERT BIGINT unsigned not null comment 'Average wait time of all insert operations that are timed.',"
+ "MAX_TIMER_INSERT BIGINT unsigned not null comment 'Maximum wait time of all insert operations that are timed.',"
+ "COUNT_UPDATE BIGINT unsigned not null comment 'Number of all update operations.',"
+ "SUM_TIMER_UPDATE BIGINT unsigned not null comment 'Total wait time of all update operations that are timed.',"
+ "MIN_TIMER_UPDATE BIGINT unsigned not null comment 'Minimum wait time of all update operations that are timed.',"
+ "AVG_TIMER_UPDATE BIGINT unsigned not null comment 'Average wait time of all update operations that are timed.',"
+ "MAX_TIMER_UPDATE BIGINT unsigned not null comment 'Maximum wait time of all update operations that are timed.',"
+ "COUNT_DELETE BIGINT unsigned not null comment 'Number of all delete operations.',"
+ "SUM_TIMER_DELETE BIGINT unsigned not null comment 'Total wait time of all delete operations that are timed.',"
+ "MIN_TIMER_DELETE BIGINT unsigned not null comment 'Minimum wait time of all delete operations that are timed.',"
+ "AVG_TIMER_DELETE BIGINT unsigned not null comment 'Average wait time of all delete operations that are timed.',"
+ "MAX_TIMER_DELETE BIGINT unsigned not null comment 'Maximum wait time of all delete operations that are timed.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc
index d802127d10d..759fdd88e12 100644
--- a/storage/perfschema/table_tlws_by_table.cc
+++ b/storage/perfschema/table_tlws_by_table.cc
@@ -49,79 +49,79 @@ table_tlws_by_table::m_share=
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE table_lock_waits_summary_by_table("
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "COUNT_READ_NORMAL BIGINT unsigned not null,"
- "SUM_TIMER_READ_NORMAL BIGINT unsigned not null,"
- "MIN_TIMER_READ_NORMAL BIGINT unsigned not null,"
- "AVG_TIMER_READ_NORMAL BIGINT unsigned not null,"
- "MAX_TIMER_READ_NORMAL BIGINT unsigned not null,"
- "COUNT_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "SUM_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "MIN_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "AVG_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "MAX_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "COUNT_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "SUM_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "MIN_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "AVG_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "MAX_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "COUNT_READ_NO_INSERT BIGINT unsigned not null,"
- "SUM_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
- "MIN_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
- "AVG_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
- "MAX_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
- "COUNT_READ_EXTERNAL BIGINT unsigned not null,"
- "SUM_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
- "MIN_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
- "AVG_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
- "MAX_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
- "COUNT_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "COUNT_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "COUNT_WRITE_DELAYED BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
- "COUNT_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "COUNT_WRITE_NORMAL BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
- "COUNT_WRITE_EXTERNAL BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_EXTERNAL BIGINT unsigned not null)") }
+ "OBJECT_TYPE VARCHAR(64) comment 'Since this table records waits by table, always set to TABLE.',"
+ "OBJECT_SCHEMA VARCHAR(64) comment 'Schema name.',"
+ "OBJECT_NAME VARCHAR(64) comment 'Table name.',"
+ "COUNT_STAR BIGINT unsigned not null comment 'Number of summarized events and the sum of the x_READ and x_WRITE columns.',"
+ "SUM_TIMER_WAIT BIGINT unsigned not null comment 'Total wait time of the summarized events that are timed.',"
+ "MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
+ "AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
+ "MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.',"
+ "COUNT_READ BIGINT unsigned not null comment 'Number of all read operations, and the sum of the equivalent x_READ_NORMAL, x_READ_WITH_SHARED_LOCKS, x_READ_HIGH_PRIORITY and x_READ_NO_INSERT columns.',"
+ "SUM_TIMER_READ BIGINT unsigned not null comment 'Total wait time of all read operations that are timed.',"
+ "MIN_TIMER_READ BIGINT unsigned not null comment 'Minimum wait time of all read operations that are timed.',"
+ "AVG_TIMER_READ BIGINT unsigned not null comment 'Average wait time of all read operations that are timed.',"
+ "MAX_TIMER_READ BIGINT unsigned not null comment 'Maximum wait time of all read operations that are timed.',"
+ "COUNT_WRITE BIGINT unsigned not null comment 'Number of all write operations, and the sum of the equivalent x_WRITE_ALLOW_WRITE, x_WRITE_CONCURRENT_INSERT, x_WRITE_DELAYED, x_WRITE_LOW_PRIORITY and x_WRITE_NORMAL columns.',"
+ "SUM_TIMER_WRITE BIGINT unsigned not null comment 'Total wait time of all write operations that are timed.',"
+ "MIN_TIMER_WRITE BIGINT unsigned not null comment 'Minimum wait time of all write operations that are timed.',"
+ "AVG_TIMER_WRITE BIGINT unsigned not null comment 'Average wait time of all write operations that are timed.',"
+ "MAX_TIMER_WRITE BIGINT unsigned not null comment 'Maximum wait time of all write operations that are timed.',"
+ "COUNT_READ_NORMAL BIGINT unsigned not null comment 'Number of all internal read normal locks.',"
+ "SUM_TIMER_READ_NORMAL BIGINT unsigned not null comment 'Total wait time of all internal read normal locks that are timed.',"
+ "MIN_TIMER_READ_NORMAL BIGINT unsigned not null comment 'Minimum wait time of all internal read normal locks that are timed.',"
+ "AVG_TIMER_READ_NORMAL BIGINT unsigned not null comment 'Average wait time of all internal read normal locks that are timed.',"
+ "MAX_TIMER_READ_NORMAL BIGINT unsigned not null comment 'Maximum wait time of all internal read normal locks that are timed.',"
+ "COUNT_READ_WITH_SHARED_LOCKS BIGINT unsigned not null comment 'Number of all internal read with shared locks.',"
+ "SUM_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null comment 'Total wait time of all internal read with shared locks that are timed.',"
+ "MIN_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null comment 'Minimum wait time of all internal read with shared locks that are timed.',"
+ "AVG_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null comment 'Average wait time of all internal read with shared locks that are timed.',"
+ "MAX_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null comment 'Maximum wait time of all internal read with shared locks that are timed.',"
+ "COUNT_READ_HIGH_PRIORITY BIGINT unsigned not null comment 'Number of all internal read high priority locks.',"
+ "SUM_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null comment 'Total wait time of all internal read high priority locks that are timed.',"
+ "MIN_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null comment 'Minimum wait time of all internal read high priority locks that are timed.',"
+ "AVG_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null comment 'Average wait time of all internal read high priority locks that are timed.',"
+ "MAX_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null comment 'Maximum wait time of all internal read high priority locks that are timed.',"
+ "COUNT_READ_NO_INSERT BIGINT unsigned not null comment 'Number of all internal read no insert locks.',"
+ "SUM_TIMER_READ_NO_INSERT BIGINT unsigned not null comment 'Total wait time of all internal read no insert locks that are timed.',"
+ "MIN_TIMER_READ_NO_INSERT BIGINT unsigned not null comment 'Minimum wait time of all internal read no insert locks that are timed.',"
+ "AVG_TIMER_READ_NO_INSERT BIGINT unsigned not null comment 'Average wait time of all internal read no insert locks that are timed.',"
+ "MAX_TIMER_READ_NO_INSERT BIGINT unsigned not null comment 'Maximum wait time of all internal read no insert locks that are timed.',"
+ "COUNT_READ_EXTERNAL BIGINT unsigned not null comment 'Number of all external read locks.',"
+ "SUM_TIMER_READ_EXTERNAL BIGINT unsigned not null comment 'Total wait time of all external read locks that are timed.',"
+ "MIN_TIMER_READ_EXTERNAL BIGINT unsigned not null comment 'Minimum wait time of all external read locks that are timed.',"
+ "AVG_TIMER_READ_EXTERNAL BIGINT unsigned not null comment 'Average wait time of all external read locks that are timed.',"
+ "MAX_TIMER_READ_EXTERNAL BIGINT unsigned not null comment 'Maximum wait time of all external read locks that are timed.',"
+ "COUNT_WRITE_ALLOW_WRITE BIGINT unsigned not null comment 'Number of all internal read normal locks.',"
+ "SUM_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null comment 'Total wait time of all internal write allow write locks that are timed.',"
+ "MIN_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null comment 'Minimum wait time of all internal write allow write locks that are timed.',"
+ "AVG_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null comment 'Average wait time of all internal write allow write locks that are timed.',"
+ "MAX_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null comment 'Maximum wait time of all internal write allow write locks that are timed.',"
+ "COUNT_WRITE_CONCURRENT_INSERT BIGINT unsigned not null comment 'Number of all internal concurrent insert write locks.',"
+ "SUM_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null comment 'Total wait time of all internal concurrent insert write locks that are timed.',"
+ "MIN_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null comment 'Minimum wait time of all internal concurrent insert write locks that are timed.',"
+ "AVG_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null comment 'Average wait time of all internal concurrent insert write locks that are timed.',"
+ "MAX_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null comment 'Maximum wait time of all internal concurrent insert write locks that are timed.',"
+ "COUNT_WRITE_DELAYED BIGINT unsigned not null comment 'Number of all internal write delayed locks.',"
+ "SUM_TIMER_WRITE_DELAYED BIGINT unsigned not null comment 'Total wait time of all internal write delayed locks that are timed.',"
+ "MIN_TIMER_WRITE_DELAYED BIGINT unsigned not null comment 'Minimum wait time of all internal write delayed locks that are timed.',"
+ "AVG_TIMER_WRITE_DELAYED BIGINT unsigned not null comment 'Average wait time of all internal write delayed locks that are timed.',"
+ "MAX_TIMER_WRITE_DELAYED BIGINT unsigned not null comment 'Maximum wait time of all internal write delayed locks that are timed.',"
+ "COUNT_WRITE_LOW_PRIORITY BIGINT unsigned not null comment 'Number of all internal write low priority locks.',"
+ "SUM_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null comment 'Total wait time of all internal write low priority locks that are timed.',"
+ "MIN_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null comment 'Minimum wait time of all internal write low priority locks that are timed.',"
+ "AVG_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null comment 'Average wait time of all internal write low priority locks that are timed.',"
+ "MAX_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null comment 'Maximum wait time of all internal write low priority locks that are timed.',"
+ "COUNT_WRITE_NORMAL BIGINT unsigned not null comment 'Number of all internal write normal locks.',"
+ "SUM_TIMER_WRITE_NORMAL BIGINT unsigned not null comment 'Total wait time of all internal write normal locks that are timed.',"
+ "MIN_TIMER_WRITE_NORMAL BIGINT unsigned not null comment 'Minimum wait time of all internal write normal locks that are timed.',"
+ "AVG_TIMER_WRITE_NORMAL BIGINT unsigned not null comment 'Average wait time of all internal write normal locks that are timed.',"
+ "MAX_TIMER_WRITE_NORMAL BIGINT unsigned not null comment 'Maximum wait time of all internal write normal locks that are timed.',"
+ "COUNT_WRITE_EXTERNAL BIGINT unsigned not null comment 'Number of all external write locks.',"
+ "SUM_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Total wait time of all external write locks that are timed.',"
+ "MIN_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Minimum wait time of all external write locks that are timed.',"
+ "AVG_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Average wait time of all external write locks that are timed.',"
+ "MAX_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Maximum wait time of all external write locks that are timed.')") }
};
PFS_engine_table*
diff --git a/storage/perfschema/table_users.cc b/storage/perfschema/table_users.cc
index e9592c55f55..ae738e47d81 100644
--- a/storage/perfschema/table_users.cc
+++ b/storage/perfschema/table_users.cc
@@ -44,9 +44,9 @@ table_users::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE users("
- "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null,"
- "CURRENT_CONNECTIONS bigint not null,"
- "TOTAL_CONNECTIONS bigint not null)") }
+ "USER CHAR(" STRINGIFY_ARG(USERNAME_CHAR_LENGTH) ") collate utf8_bin default null comment 'The connection''s client user name for the connection, or NULL if an internal thread.',"
+ "CURRENT_CONNECTIONS bigint not null comment 'Current connections for the user.',"
+ "TOTAL_CONNECTIONS bigint not null comment 'Total connections for the user.')") }
};
PFS_engine_table* table_users::create()
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index f9384848243..1db314b93db 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -2,6 +2,7 @@
MACRO(SKIP_ROCKSDB_PLUGIN msg)
MESSAGE_ONCE(SKIP_ROCKSDB_PLUGIN "Can't build rocksdb engine - ${msg}")
+ ADD_FEATURE_INFO(ROCKSDB "OFF" "Storage Engine")
RETURN()
ENDMACRO()
@@ -43,6 +44,15 @@ IF (WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
SKIP_ROCKSDB_PLUGIN("32-Bit Windows are temporarily disabled")
ENDIF()
+#
+# Also, disable on ARM64 when not Linux
+# Requires submodule update to v6.16.3
+# containing commit https://github.com/facebook/rocksdb/commit/ee4bd4780b321ddb5f92a0f4eb956f2a2ebd60dc
+#
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64|aarch64)" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ SKIP_ROCKSDB_PLUGIN("ARM64 disabled on all except Linux")
+ENDIF()
+
# This plugin needs recent C++ compilers (it is using C++11 features)
# Skip build for the old compilers
SET(CXX11_FLAGS)
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index 883ee15f74c..b1937344b9f 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -48,22 +48,28 @@ foreach(compression_lib LZ4 BZip2 ZSTD snappy)
endforeach()
if(LZ4_FOUND AND (NOT WITH_ROCKSDB_LZ4 STREQUAL "OFF"))
+ set(HAVE_ROCKSDB_LZ4 TRUE)
add_definitions(-DLZ4)
include_directories(${LZ4_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${LZ4_LIBRARY})
endif()
+ADD_FEATURE_INFO(ROCKSDB_LZ4 HAVE_ROCKSDB_LZ4 "LZ4 Compression in the RocksDB storage engine")
if(BZIP2_FOUND AND (NOT WITH_ROCKSDB_BZip2 STREQUAL "OFF"))
+ set(HAVE_ROCKSDB_BZIP2 TRUE)
add_definitions(-DBZIP2)
include_directories(${BZIP2_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${BZIP2_LIBRARIES})
endif()
+ADD_FEATURE_INFO(ROCKSDB_BZIP2 HAVE_ROCKSDB_BZIP2 "BZIP2 Compression in the RocksDB storage engine")
if(SNAPPY_FOUND AND (NOT WITH_ROCKSDB_snappy STREQUAL "OFF"))
+ set(HAVE_ROCKSDB_SNAPPY TRUE)
add_definitions(-DSNAPPY)
include_directories(${snappy_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${snappy_LIBRARIES})
endif()
+ADD_FEATURE_INFO(ROCKSDB_SNAPPY HAVE_ROCKSDB_SNAPPY "Snappy Compression in the RocksDB storage engine")
include(CheckFunctionExists)
if(ZSTD_FOUND AND (NOT WITH_ROCKSDB_ZSTD STREQUAL "OFF"))
@@ -75,14 +81,17 @@ if(ZSTD_FOUND AND (NOT WITH_ROCKSDB_ZSTD STREQUAL "OFF"))
"WITH_ROCKSDB_ZSTD is ON and ZSTD library was found, but the version needs to be >= 1.1.3")
endif()
if (ZSTD_VALID)
+ set(HAVE_ROCKSDB_ZSTD TRUE)
add_definitions(-DZSTD)
include_directories(${ZSTD_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${ZSTD_LIBRARY})
endif()
endif()
+ADD_FEATURE_INFO(ROCKSDB_ZSTD HAVE_ROCKSDB_ZSTD "Zstandard Compression in the RocksDB storage engine")
add_definitions(-DZLIB)
list(APPEND THIRDPARTY_LIBS ${ZLIB_LIBRARY})
+ADD_FEATURE_INFO(ROCKSDB_ZLIB "ON" "zlib Compression in the RocksDB storage engine")
if(CMAKE_SYSTEM_NAME MATCHES "Cygwin")
add_definitions(-fno-builtin-memcmp -DCYGWIN)
diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h
index 437c8667994..4a379cd638a 100644
--- a/storage/rocksdb/ha_rocksdb.h
+++ b/storage/rocksdb/ha_rocksdb.h
@@ -448,15 +448,13 @@ class ha_rocksdb : public my_core::handler {
}
}
- /** @brief
- The name that will be used for display purposes.
- */
- const char *table_type() const /*override*/ {
- DBUG_ENTER_FUNC();
- // MariaDB: this function is not virtual, however ha_innodb
- // declares it (and then never uses!) psergey-merge-todo:.
- DBUG_RETURN(rocksdb_hton_name);
- }
+ /*
+ MariaDB: this function:
+
+ const char *table_type() const
+
+ is non-virtual in class handler, so there's no point to override it.
+ */
/* The following is only used by SHOW KEYS: */
const char *index_type(uint inx) override {
diff --git a/storage/rocksdb/mysql-test/rocksdb/suite.pm b/storage/rocksdb/mysql-test/rocksdb/suite.pm
index 633e883f46d..b4feb20a451 100644
--- a/storage/rocksdb/mysql-test/rocksdb/suite.pm
+++ b/storage/rocksdb/mysql-test/rocksdb/suite.pm
@@ -15,7 +15,7 @@ use strict;
my $sst_dump=
::mtr_exe_maybe_exists(
- "$::bindir/storage/rocksdb$::opt_vs_config/sst_dump",
+ "$::bindir/storage/rocksdb$::multiconfig/sst_dump",
"$::path_client_bindir/sst_dump");
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/suite.pm b/storage/rocksdb/mysql-test/rocksdb_rpl/suite.pm
index 1cc123b2a2a..7e9fba4a59c 100644
--- a/storage/rocksdb/mysql-test/rocksdb_rpl/suite.pm
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/suite.pm
@@ -13,7 +13,7 @@ use strict;
my $sst_dump=
::mtr_exe_maybe_exists(
- "$::bindir/storage/rocksdb$::opt_vs_config/sst_dump",
+ "$::bindir/storage/rocksdb$::multiconfig/sst_dump",
"$::path_client_bindir/sst_dump");
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
diff --git a/storage/rocksdb/mysql-test/rocksdb_stress/suite.pm b/storage/rocksdb/mysql-test/rocksdb_stress/suite.pm
index 106a1d6a0e7..66a46291a8c 100644
--- a/storage/rocksdb/mysql-test/rocksdb_stress/suite.pm
+++ b/storage/rocksdb/mysql-test/rocksdb_stress/suite.pm
@@ -15,7 +15,7 @@ use strict;
my $sst_dump=
::mtr_exe_maybe_exists(
- "$::bindir/storage/rocksdb$::opt_vs_config/sst_dump",
+ "$::bindir/storage/rocksdb$::multiconfig/sst_dump",
"$::path_client_bindir/sst_dump");
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
diff --git a/storage/rocksdb/mysql-test/rocksdb_sys_vars/suite.pm b/storage/rocksdb/mysql-test/rocksdb_sys_vars/suite.pm
index 5264d657ef7..d50f4d2422e 100644
--- a/storage/rocksdb/mysql-test/rocksdb_sys_vars/suite.pm
+++ b/storage/rocksdb/mysql-test/rocksdb_sys_vars/suite.pm
@@ -12,7 +12,7 @@ use strict;
my $sst_dump=
::mtr_exe_maybe_exists(
- "$::bindir/storage/rocksdb$::opt_vs_config/sst_dump",
+ "$::bindir/storage/rocksdb$::multiconfig/sst_dump",
"$::path_client_bindir/sst_dump");
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
diff --git a/storage/spider/mysql-test/spider/include/init_master_1.inc b/storage/spider/mysql-test/spider/include/init_master_1.inc
index 2c45d0bd65d..460142b9c7d 100644
--- a/storage/spider/mysql-test/spider/include/init_master_1.inc
+++ b/storage/spider/mysql-test/spider/include/init_master_1.inc
@@ -152,6 +152,11 @@ let $MASTER_1_COMMENT_TEXT_PK1_1=
COMMENT 'tbl "t1", srv "s_2_1"';
let $MASTER_1_COMMENT_TEXT_KEY1_1=
COMMENT 'tbl "t1", srv "s_2_1"';
+let $MASTER_1_COMMENT_MDEV_25985=
+ COMMENT='table "t1"'
+ PARTITION BY LIST COLUMNS(`a`) (
+ PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"'
+ );
let $MASTER_1_CHECK_DIRECT_UPDATE_STATUS=
SHOW STATUS LIKE 'Spider_direct_update';
let $MASTER_1_CHECK_DIRECT_DELETE_STATUS=
diff --git a/storage/spider/mysql-test/spider/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/r/spider_fixes_part.result
index d2367af9bbd..ad8a87db727 100644
--- a/storage/spider/mysql-test/spider/r/spider_fixes_part.result
+++ b/storage/spider/mysql-test/spider/r/spider_fixes_part.result
@@ -262,6 +262,40 @@ a b c d e f
56B68DA68D6D4A04A08B453D09AD7B70 821E71E6ABB4404EBAA349BB681089F8 51041110620310 2018-08-02 13:48:28 510411 0
51ECF2C0CD3C48D99C91792E99D3C1A0 017B8A460DBC444682B791305EF75356 51041110620308 2018-08-02 13:48:29 510411 0
093B37A93A534DF883787AF5F6799674 996C7F14989D480589A553717D735E3E 51041110620302 2018-08-02 13:48:30 510411 0
+#
+# MDEV-25985 Spider handle ">=" as ">" in some cases
+#
+connection child2_1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a int,
+b int,
+c int,
+PRIMARY KEY (a),
+KEY (b,c)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES (1, 1, 1), (2, 2, 1);
+connection master_1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a int,
+b int,
+c int,
+PRIMARY KEY (a),
+KEY (b,c)
+) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "t1"'
+ PARTITION BY LIST COLUMNS(`a`) (
+PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"'
+ );
+connection master_1;
+SELECT * FROM t1 WHERE c > 0 AND b >= 1 AND b <= 2;
+a b c
+1 1 1
+2 2 1
+SELECT * FROM t1 WHERE c < 3 AND b <= 2;
+a b c
+1 1 1
+2 2 1
deinit
connection master_1;
diff --git a/storage/spider/mysql-test/spider/r/udf_pushdown.result b/storage/spider/mysql-test/spider/r/udf_pushdown.result
new file mode 100644
index 00000000000..e9182255bcd
--- /dev/null
+++ b/storage/spider/mysql-test/spider/r/udf_pushdown.result
@@ -0,0 +1,222 @@
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+child3_1
+child3_2
+child3_3
+#
+# MDEV-26545 Spider does not correctly handle UDF and stored function in where conds
+#
+
+##### enable general_log #####
+connection child2_1;
+SET @general_log_backup = @@global.general_log;
+SET @log_output_backup = @@global.log_output;
+SET @@global.general_log = 1;
+SET @@global.log_output = "TABLE";
+TRUNCATE TABLE mysql.general_log;
+
+##### create databases #####
+connection master_1;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+connection child2_1;
+CREATE DATABASE auto_test_remote;
+USE auto_test_remote;
+
+##### create tables #####
+connection child2_1;
+CHILD_CREATE_TABLE
+connection master_1;
+MASTER_CREATE_TABLE
+CREATE TABLE ta_l (
+id INT NOT NULL,
+a INT,
+PRIMARY KEY(id)
+) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+INSERT INTO ta_l VALUES
+(1, 11),
+(2, 22),
+(3, 33),
+(4, 44),
+(5, 55);
+
+##### create functions #####
+connection master_1;
+CREATE FUNCTION `plusone`( param INT ) RETURNS INT
+BEGIN
+RETURN param + 1;
+END //
+connection child2_1;
+CREATE FUNCTION `plusone`( param INT ) RETURNS INT
+BEGIN
+RETURN param + 1;
+END //
+
+########## spider_use_pushdown_udf=0 ##########
+connection master_1;
+SET @@spider_use_pushdown_udf = 0;
+
+##### test SELECTs #####
+connection master_1;
+SELECT * FROM ta_l WHERE id = plusone(1);
+id a
+2 22
+SELECT * FROM ta_l WHERE id IN (plusone(1), plusone(2)) AND a = plusone(32);
+id a
+3 33
+connection child2_1;
+SELECT argument FROM mysql.general_log WHERE argument LIKE "%select%" AND argument NOT LIKE "%argument%";
+argument
+select `id`,`a` from `auto_test_remote`.`ta_r`
+select `id`,`a` from `auto_test_remote`.`ta_r`
+
+##### test UPDATEs #####
+connection master_1;
+UPDATE ta_l SET a = plusone(221) WHERE id = plusone(1);
+SELECT * FROM ta_l;
+id a
+1 11
+2 222
+3 33
+4 44
+5 55
+UPDATE ta_l SET a = plusone(332) WHERE id IN (plusone(1), plusone(2)) AND a = plusone(32);
+SELECT * FROM ta_l;
+id a
+1 11
+2 222
+3 333
+4 44
+5 55
+connection child2_1;
+SELECT argument FROM mysql.general_log WHERE argument LIKE "%update%" AND argument NOT LIKE "%argument%";
+argument
+select `id`,`a` from `auto_test_remote`.`ta_r` for update
+update `auto_test_remote`.`ta_r` set `a` = 222 where `id` = 2 limit 1
+select `id`,`a` from `auto_test_remote`.`ta_r` for update
+update `auto_test_remote`.`ta_r` set `a` = 333 where `id` = 3 and `a` = 33 limit 1
+
+##### test DELETEs #####
+connection master_1;
+DELETE FROM ta_l WHERE id = plusone(1);
+SELECT * FROM ta_l;
+id a
+1 11
+3 333
+4 44
+5 55
+DELETE FROM ta_l WHERE id IN (plusone(1), plusone(2), plusone(3)) AND a = plusone(43);
+SELECT * FROM ta_l;
+id a
+1 11
+3 333
+5 55
+connection child2_1;
+SELECT argument FROM mysql.general_log WHERE (argument LIKE "%delete%" OR argument LIKE "%update%") AND argument NOT LIKE "%argument%";
+argument
+select `id` from `auto_test_remote`.`ta_r` for update
+delete from `auto_test_remote`.`ta_r` where `id` = 2 limit 1
+select `id`,`a` from `auto_test_remote`.`ta_r` for update
+delete from `auto_test_remote`.`ta_r` where `id` = 4 and `a` = 44 limit 1
+
+##### reset records #####
+connection master_1;
+TRUNCATE TABLE ta_l;
+INSERT INTO ta_l VALUES
+(1, 11),
+(2, 22),
+(3, 33),
+(4, 44),
+(5, 55);
+
+########## spider_use_pushdown_udf=1 ##########
+connection master_1;
+SET @@spider_use_pushdown_udf = 1;
+
+##### test SELECTs #####
+connection master_1;
+SELECT * FROM ta_l WHERE id = plusone(1);
+id a
+2 22
+SELECT * FROM ta_l WHERE id IN (plusone(1), plusone(2)) AND a = plusone(32);
+id a
+3 33
+connection child2_1;
+SELECT argument FROM mysql.general_log WHERE argument LIKE "%select%" AND argument NOT LIKE "%argument%";
+argument
+select `id`,`a` from `auto_test_remote`.`ta_r` where (`id` = (`plusone`(1)))
+select `id`,`a` from `auto_test_remote`.`ta_r` where ((`id` in( (`plusone`(1)) , (`plusone`(2)))) and (`a` = (`plusone`(32))))
+
+##### test UPDATEs #####
+connection master_1;
+UPDATE ta_l SET a = plusone(221) WHERE id = plusone(1);
+SELECT * FROM ta_l;
+id a
+1 11
+2 222
+3 33
+4 44
+5 55
+UPDATE ta_l SET a = plusone(332) WHERE id IN (plusone(1), plusone(2)) AND a = plusone(32);
+SELECT * FROM ta_l;
+id a
+1 11
+2 222
+3 333
+4 44
+5 55
+connection child2_1;
+SELECT argument FROM mysql.general_log WHERE argument LIKE "%update%" AND argument NOT LIKE "%argument%";
+argument
+select `id`,`a` from `auto_test_remote`.`ta_r` where (`id` = (`plusone`(1))) for update
+update `auto_test_remote`.`ta_r` set `a` = 222 where `id` = 2 limit 1
+select `id`,`a` from `auto_test_remote`.`ta_r` where ((`id` in( (`plusone`(1)) , (`plusone`(2)))) and (`a` = (`plusone`(32)))) for update
+update `auto_test_remote`.`ta_r` set `a` = 333 where `id` = 3 and `a` = 33 limit 1
+
+##### test DELETEs #####
+connection master_1;
+DELETE FROM ta_l WHERE id = plusone(1);
+SELECT * FROM ta_l;
+id a
+1 11
+3 333
+4 44
+5 55
+DELETE FROM ta_l WHERE id IN (plusone(1), plusone(2), plusone(3)) AND a = plusone(43);
+SELECT * FROM ta_l;
+id a
+1 11
+3 333
+5 55
+connection child2_1;
+SELECT argument FROM mysql.general_log WHERE (argument LIKE "%delete%" OR argument LIKE "%update%") AND argument NOT LIKE "%argument%";
+argument
+select `id` from `auto_test_remote`.`ta_r` where (`id` = (`plusone`(1))) for update
+delete from `auto_test_remote`.`ta_r` where `id` = 2 limit 1
+select `id`,`a` from `auto_test_remote`.`ta_r` where ((`id` in( (`plusone`(1)) , (`plusone`(2)) , (`plusone`(3)))) and (`a` = (`plusone`(43)))) for update
+delete from `auto_test_remote`.`ta_r` where `id` = 4 and `a` = 44 limit 1
+
+deinit
+connection master_1;
+DROP FUNCTION `plusone`;
+DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
+SET @@global.general_log = @general_log_backup;
+SET @@global.log_output = @log_output_backup;
+DROP FUNCTION `plusone`;
+DROP DATABASE IF EXISTS auto_test_remote;
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+child3_1
+child3_2
+child3_3
+
+end of test
diff --git a/storage/spider/mysql-test/spider/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/t/spider_fixes_part.test
index 868e684f959..68594458434 100644
--- a/storage/spider/mysql-test/spider/t/spider_fixes_part.test
+++ b/storage/spider/mysql-test/spider/t/spider_fixes_part.test
@@ -726,6 +726,41 @@ if ($HAVE_PARTITION)
}
}
+
+--echo #
+--echo # MDEV-25985 Spider handle ">=" as ">" in some cases
+--echo #
+
+--connection child2_1
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+eval CREATE TABLE t1 (
+ a int,
+ b int,
+ c int,
+ PRIMARY KEY (a),
+ KEY (b,c)
+) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
+
+INSERT INTO t1 VALUES (1, 1, 1), (2, 2, 1);
+
+--connection master_1
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+eval CREATE TABLE t1 (
+ a int,
+ b int,
+ c int,
+ PRIMARY KEY (a),
+ KEY (b,c)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_MDEV_25985;
+
+--connection master_1
+SELECT * FROM t1 WHERE c > 0 AND b >= 1 AND b <= 2;
+SELECT * FROM t1 WHERE c < 3 AND b <= 2;
+
--echo
--echo deinit
--disable_warnings
diff --git a/storage/spider/mysql-test/spider/t/udf_pushdown.inc b/storage/spider/mysql-test/spider/t/udf_pushdown.inc
new file mode 100644
index 00000000000..160e8af21b2
--- /dev/null
+++ b/storage/spider/mysql-test/spider/t/udf_pushdown.inc
@@ -0,0 +1,48 @@
+--echo
+--echo ##### test SELECTs #####
+--connection master_1
+SELECT * FROM ta_l WHERE id = plusone(1);
+SELECT * FROM ta_l WHERE id IN (plusone(1), plusone(2)) AND a = plusone(32);
+
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ SELECT argument FROM mysql.general_log WHERE argument LIKE "%select%" AND argument NOT LIKE "%argument%";
+ --disable_query_log
+ TRUNCATE TABLE mysql.general_log;
+ --enable_query_log
+}
+
+--echo
+--echo ##### test UPDATEs #####
+--connection master_1
+UPDATE ta_l SET a = plusone(221) WHERE id = plusone(1);
+SELECT * FROM ta_l;
+UPDATE ta_l SET a = plusone(332) WHERE id IN (plusone(1), plusone(2)) AND a = plusone(32);
+SELECT * FROM ta_l;
+
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ SELECT argument FROM mysql.general_log WHERE argument LIKE "%update%" AND argument NOT LIKE "%argument%";
+ --disable_query_log
+ TRUNCATE TABLE mysql.general_log;
+ --enable_query_log
+}
+
+--echo
+--echo ##### test DELETEs #####
+--connection master_1
+DELETE FROM ta_l WHERE id = plusone(1);
+SELECT * FROM ta_l;
+DELETE FROM ta_l WHERE id IN (plusone(1), plusone(2), plusone(3)) AND a = plusone(43);
+SELECT * FROM ta_l;
+
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ SELECT argument FROM mysql.general_log WHERE (argument LIKE "%delete%" OR argument LIKE "%update%") AND argument NOT LIKE "%argument%";
+ --disable_query_log
+ TRUNCATE TABLE mysql.general_log;
+ --enable_query_log
+}
diff --git a/storage/spider/mysql-test/spider/t/udf_pushdown.test b/storage/spider/mysql-test/spider/t/udf_pushdown.test
new file mode 100644
index 00000000000..2eadbbbb40b
--- /dev/null
+++ b/storage/spider/mysql-test/spider/t/udf_pushdown.test
@@ -0,0 +1,141 @@
+--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--enable_result_log
+--enable_query_log
+
+--echo #
+--echo # MDEV-26545 Spider does not correctly handle UDF and stored function in where conds
+--echo #
+
+let $CHILD_CREATE_TABLE=
+ CREATE TABLE ta_r (
+ id INT NOT NULL,
+ a INT,
+ PRIMARY KEY(id)
+ ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
+
+let $MASTER_CREATE_TABLE_OUTPUT=
+ CREATE TABLE ta_l (
+ id INT NOT NULL,
+ a INT,
+ PRIMARY KEY(id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
+
+let $MASTER_CREATE_TABLE=
+ CREATE TABLE ta_l (
+ id INT NOT NULL,
+ a INT,
+ PRIMARY KEY(id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
+
+--echo
+--echo ##### enable general_log #####
+--connection child2_1
+SET @general_log_backup = @@global.general_log;
+SET @log_output_backup = @@global.log_output;
+SET @@global.general_log = 1;
+SET @@global.log_output = "TABLE";
+TRUNCATE TABLE mysql.general_log;
+
+--echo
+--echo ##### create databases #####
+--connection master_1
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+}
+
+--echo
+--echo ##### create tables #####
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ --disable_query_log
+ echo CHILD_CREATE_TABLE;
+ eval $CHILD_CREATE_TABLE;
+ --enable_query_log
+}
+
+--connection master_1
+--disable_query_log
+echo MASTER_CREATE_TABLE;
+echo $MASTER_CREATE_TABLE_OUTPUT;
+eval $MASTER_CREATE_TABLE;
+--enable_query_log
+
+INSERT INTO ta_l VALUES
+ (1, 11),
+ (2, 22),
+ (3, 33),
+ (4, 44),
+ (5, 55);
+
+--echo
+--echo ##### create functions #####
+--connection master_1
+DELIMITER //;
+CREATE FUNCTION `plusone`( param INT ) RETURNS INT
+BEGIN
+ RETURN param + 1;
+END //
+DELIMITER ;//
+
+--connection child2_1
+DELIMITER //;
+CREATE FUNCTION `plusone`( param INT ) RETURNS INT
+BEGIN
+ RETURN param + 1;
+END //
+DELIMITER ;//
+
+--echo
+--echo ########## spider_use_pushdown_udf=0 ##########
+--connection master_1
+SET @@spider_use_pushdown_udf = 0;
+--source udf_pushdown.inc
+
+--echo
+--echo ##### reset records #####
+--connection master_1
+TRUNCATE TABLE ta_l;
+INSERT INTO ta_l VALUES
+ (1, 11),
+ (2, 22),
+ (3, 33),
+ (4, 44),
+ (5, 55);
+
+--echo
+--echo ########## spider_use_pushdown_udf=1 ##########
+--connection master_1
+SET @@spider_use_pushdown_udf = 1;
+--source udf_pushdown.inc
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP FUNCTION `plusone`;
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ SET @@global.general_log = @general_log_backup;
+ SET @@global.log_output = @log_output_backup;
+ DROP FUNCTION `plusone`;
+ DROP DATABASE IF EXISTS auto_test_remote;
+}
+--disable_query_log
+--disable_result_log
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc
index 8d4e9acda07..df6c0ceb5f5 100644
--- a/storage/spider/spd_db_conn.cc
+++ b/storage/spider/spd_db_conn.cc
@@ -1867,12 +1867,20 @@ int spider_db_append_key_where_internal(
case HA_READ_AFTER_KEY:
if (sql_kind == SPIDER_SQL_KIND_SQL)
{
+ const char* op_str;
+ uint32 op_len;
+ if (start_key_part_map == 1) {
+ op_str = SPIDER_SQL_GT_STR;
+ op_len = SPIDER_SQL_GT_LEN;
+ } else {
+ op_str = SPIDER_SQL_GTEQUAL_STR;
+ op_len = SPIDER_SQL_GTEQUAL_LEN;
+ }
if (str->reserve(store_length + key_name_length +
- /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 +
- SPIDER_SQL_GT_LEN))
+ /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 + op_len))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
dbton_share->append_column_name(str, field->field_index);
- str->q_append(SPIDER_SQL_GT_STR, SPIDER_SQL_GT_LEN);
+ str->q_append(op_str, op_len);
if (spider_dbton[dbton_id].db_util->
append_column_value(spider, str, field, ptr,
share->access_charset))
@@ -1927,12 +1935,20 @@ int spider_db_append_key_where_internal(
result_list->desc_flg = TRUE;
if (sql_kind == SPIDER_SQL_KIND_SQL)
{
+ const char* op_str;
+ uint32 op_len;
+ if (start_key_part_map == 1) {
+ op_str = SPIDER_SQL_LT_STR;
+ op_len = SPIDER_SQL_LT_LEN;
+ } else {
+ op_str = SPIDER_SQL_LTEQUAL_STR;
+ op_len = SPIDER_SQL_LTEQUAL_LEN;
+ }
if (str->reserve(store_length + key_name_length +
- /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 +
- SPIDER_SQL_LT_LEN))
+ /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 + op_len))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
dbton_share->append_column_name(str, field->field_index);
- str->q_append(SPIDER_SQL_LT_STR, SPIDER_SQL_LT_LEN);
+ str->q_append(op_str, op_len);
if (spider_dbton[dbton_id].db_util->
append_column_value(spider, str, field, ptr,
share->access_charset))
@@ -2297,12 +2313,20 @@ int spider_db_append_key_where_internal(
case HA_READ_BEFORE_KEY:
if (sql_kind == SPIDER_SQL_KIND_SQL)
{
+ const char* op_str;
+ uint32 op_len;
+ if (end_key_part_map == 1) {
+ op_str = SPIDER_SQL_LT_STR;
+ op_len = SPIDER_SQL_LT_LEN;
+ } else {
+ op_str = SPIDER_SQL_LTEQUAL_STR;
+ op_len = SPIDER_SQL_LTEQUAL_LEN;
+ }
if (str->reserve(store_length + key_name_length +
- /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 +
- SPIDER_SQL_LT_LEN))
+ /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 + op_len))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
dbton_share->append_column_name(str, field->field_index);
- str->q_append(SPIDER_SQL_LT_STR, SPIDER_SQL_LT_LEN);
+ str->q_append(op_str, op_len);
if (spider_dbton[dbton_id].db_util->
append_column_value(spider, str, field, ptr,
share->access_charset))
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index 1a24d80a95f..4db1232aebf 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -4085,10 +4085,16 @@ int spider_db_mysql_util::open_item_func(
separete_str_length = SPIDER_SQL_AND_LEN;
}
break;
+ case Item_func::FUNC_SP:
case Item_func::UDF_FUNC:
use_pushdown_udf = spider_param_use_pushdown_udf(spider->trx->thd,
spider->share->use_pushdown_udf);
if (!use_pushdown_udf)
+ /*
+ This is the default behavior because the remote nodes may deal with
+ the function in an unexpected way (e.g. not having the same
+ definition). Users can turn it on if they know what they are doing.
+ */
DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM);
if (str)
{
diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc
index c4aaef3a404..468e5844189 100644
--- a/storage/spider/spd_param.cc
+++ b/storage/spider/spd_param.cc
@@ -1931,7 +1931,7 @@ static MYSQL_THDVAR_INT(
"Remote server transmission existence when UDF is used at condition and \"engine_condition_pushdown=1\"", /* comment */
NULL, /* check */
NULL, /* update */
- -1, /* def */
+ 0, /* def */
-1, /* min */
1, /* max */
0 /* blk */
diff --git a/storage/test_sql_discovery/mysql-test/sql_discovery/simple.test b/storage/test_sql_discovery/mysql-test/sql_discovery/simple.test
index 90eea753a38..a8c7ef9a6bb 100644
--- a/storage/test_sql_discovery/mysql-test/sql_discovery/simple.test
+++ b/storage/test_sql_discovery/mysql-test/sql_discovery/simple.test
@@ -29,6 +29,7 @@ show warnings;
set @@test_sql_discovery_statement='t1:create table t1 (a int primary key) partition by hash(id) partitions 2';
--error ER_SQL_DISCOVER_ERROR
select * from t1;
+--replace_result 1289 1290 "The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working" "The MariaDB server is running with the --skip-partition option so it cannot execute this statement"
show warnings;
set @@test_sql_discovery_statement='t1:create table t1 (a int) union=(t3,t4)';
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index 12d3a5a060a..6c0e24fc82b 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -7260,7 +7260,7 @@ int ha_tokudb::create(
// in the database directory, so automatic filename-based
// discover_table_names() doesn't work either. So, it must force .frm
// file to disk.
- form->s->write_frm_image();
+ error= form->s->write_frm_image();
#endif
#if defined(TOKU_INCLUDE_OPTION_STRUCTS) && TOKU_INCLUDE_OPTION_STRUCTS
@@ -7292,8 +7292,8 @@ int ha_tokudb::create(
#endif // defined(TOKU_INCLUDE_OPTION_STRUCTS) && TOKU_INCLUDE_OPTION_STRUCTS
const toku_compression_method compression_method =
row_format_to_toku_compression_method(row_format);
-
bool create_from_engine = (create_info->table_options & HA_OPTION_CREATE_FROM_ENGINE);
+ if (error) { goto cleanup; }
if (create_from_engine) {
// table already exists, nothing to do
error = 0;
diff --git a/storage/tokudb/mysql-test/tokudb/r/bug-23786.result b/storage/tokudb/mysql-test/tokudb/r/bug-23786.result
new file mode 100644
index 00000000000..1b21758b85a
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/r/bug-23786.result
@@ -0,0 +1,10 @@
+#
+# 10.2 Test
+#
+# MDEV-23786: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+# is_bulk_op())'failed for TokuDB engine CREATE TABLE
+#
+set default_storage_engine='tokudb';
+CREATE TABLE _uppercase.t (a INT) ENGINE=TokuDB;
+ERROR 42000: Unknown database '_uppercase'
+# End of 10.2 Test
diff --git a/storage/tokudb/mysql-test/tokudb/t/bug-23786.test b/storage/tokudb/mysql-test/tokudb/t/bug-23786.test
new file mode 100644
index 00000000000..a8a0c4a1577
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/bug-23786.test
@@ -0,0 +1,14 @@
+source include/have_tokudb.inc;
+
+--echo #
+--echo # 10.2 Test
+--echo #
+--echo # MDEV-23786: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+--echo # is_bulk_op())'failed for TokuDB engine CREATE TABLE
+--echo #
+
+set default_storage_engine='tokudb';
+--error ER_BAD_DB_ERROR
+CREATE TABLE _uppercase.t (a INT) ENGINE=TokuDB;
+
+--echo # End of 10.2 Test
diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt
index bed5946541c..3408ff69a13 100644
--- a/storage/xtradb/CMakeLists.txt
+++ b/storage/xtradb/CMakeLists.txt
@@ -524,7 +524,6 @@ IF(TARGET xtradb)
IF(NOT XTRADB_OK)
MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
ENDIF()
- ADD_DEPENDENCIES(xtradb GenError)
ENDIF()
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/extra/mariabackup ${CMAKE_BINARY_DIR}/extra/mariabackup)
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index 038e7163901..810e0127202 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -88,7 +88,7 @@ IF(UNIX)
INSTALL(FILES ${out} DESTINATION ${inst_location}/policy/selinux COMPONENT SupportFiles)
ENDFOREACH()
IF(RPM)
- EXECUTE_PROCESS(COMMAND rpm -q --qf "%{VERSION}-%{RELEASE}" libsepol
+ EXECUTE_PROCESS(COMMAND rpm -q --qf "%{VERSION}" libsepol
OUTPUT_VARIABLE LIBSEPOL_VERSION RESULT_VARIABLE err)
IF (NOT err)
SET(CPACK_RPM_server_PACKAGE_REQUIRES
diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
index 245c506c117..7c885b1f6e9 100644
--- a/support-files/mariadb.service.in
+++ b/support-files/mariadb.service.in
@@ -142,7 +142,7 @@ TimeoutStopSec=900
##
# Number of files limit. previously [mysqld_safe] open-files-limit
-LimitNOFILE=16384
+LimitNOFILE=32768
# Maximium core size. previously [mysqld_safe] core-file-size
# LimitCore=
diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
index a487e22521b..d625ce67396 100644
--- a/support-files/mariadb@.service.in
+++ b/support-files/mariadb@.service.in
@@ -168,7 +168,7 @@ TimeoutStopSec=900
##
# Number of files limit. previously [mysqld_safe] open-files-limit
-LimitNOFILE=16384
+LimitNOFILE=32768
# Maximium core size. previously [mysqld_safe] core-file-size
# LimitCore=
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index 6eb2d0bc257..7f034601539 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -91,16 +91,15 @@ datadir_set=
#
# Use LSB init script functions for printing messages, if possible
-#
+# Include non-LSB RedHat init functions to make systemctl redirect work
+init_functions="/etc/init.d/functions"
lsb_functions="/lib/lsb/init-functions"
-if test -f $lsb_functions ; then
+if test -f $lsb_functions; then
. $lsb_functions
-else
- # Include non-LSB RedHat init functions to make systemctl redirect work
- init_functions="/etc/init.d/functions"
- if test -f $init_functions; then
- . $init_functions
- fi
+fi
+
+if test -f $init_functions; then
+ . $init_functions
log_success_msg()
{
echo " SUCCESS! $@"
diff --git a/support-files/rpm/server-posttrans.sh b/support-files/rpm/server-posttrans.sh
index 1525b592735..3250423da8f 100644
--- a/support-files/rpm/server-posttrans.sh
+++ b/support-files/rpm/server-posttrans.sh
@@ -3,7 +3,7 @@ if [ -r %{restart_flag} ] ; then
# only restart the server if it was alredy running
if [ -x /usr/bin/systemctl ] ; then
/usr/bin/systemctl daemon-reload > /dev/null 2>&1
- if [ /usr/bin/systemctl is-active mysql ]; then
+ if /usr/bin/systemctl is-active mysql; then
/usr/bin/systemctl restart mysql > /dev/null 2>&1
else
/usr/bin/systemctl try-restart mariadb.service > /dev/null 2>&1
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 93f23236dbc..ac9c06ac94b 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -18051,9 +18051,9 @@ static void test_bug40365(void)
if (!opt_silent)
fprintf(stdout, "\ntime[%d]: %02d-%02d-%02d ",
i, tm[i].year, tm[i].month, tm[i].day);
- DIE_UNLESS(tm[i].year == 0);
- DIE_UNLESS(tm[i].month == 0);
- DIE_UNLESS(tm[i].day == 0);
+ DIE_UNLESS(tm[i].year == 0);
+ DIE_UNLESS(tm[i].month == 0);
+ DIE_UNLESS(tm[i].day == 0);
}
mysql_stmt_close(stmt);
rc= mysql_commit(mysql);
@@ -19896,6 +19896,71 @@ static void test_ps_params_in_ctes()
myquery(rc);
}
+void display_result_metadata(MYSQL_FIELD *field,
+ uint num_fields)
+{
+ MYSQL_FIELD* field_end;
+
+ mct_log("Catalog\tDatabase\tTable\tTable_alias\tColumn\t"
+ "Column_alias\tType\tLength\tMax length\tIs_null\t"
+ "Flags\tDecimals\tCharsetnr\n");
+ for (field_end= field+num_fields; field < field_end; field++)
+ {
+ mct_log("%s\t", field->catalog);
+ mct_log("%s\t", field->db);
+ mct_log("%s\t", field->org_table);
+ mct_log("%s\t", field->table);
+ mct_log("%s\t", field->org_name);
+ mct_log("%s\t", field->name);
+ mct_log("%u\t", field->type);
+ mct_log("%lu\t", field->length);
+ mct_log("%lu\t", field->max_length);
+ mct_log("%s\t", (IS_NOT_NULL(field->flags) ? "N" : "Y"));
+ mct_log("%u\t", field->flags);
+ mct_log("%u\t", field->decimals);
+ mct_log("%u\n", field->charsetnr);
+ }
+}
+
+static void test_mdev_26145()
+{
+ MYSQL_STMT *stmt;
+ MYSQL_RES *result;
+ MYSQL_FIELD *fields;
+ int rc, num_fields;
+
+ myheader("test_mdev_26145");
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "CREATE TABLE t1(a INT)");
+ myquery(rc);
+
+ stmt= mysql_simple_prepare(
+ mysql, "(SELECT MAX(a) FROM t1) UNION (SELECT MAX(a) FROM t1)");
+ check_stmt(stmt);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ result= mysql_stmt_result_metadata(stmt);
+ DIE_UNLESS(result);
+
+ num_fields= mysql_stmt_field_count(stmt);
+ fields= mysql_fetch_fields(result);
+
+ mct_start_logging("test_mdev26145");
+ display_result_metadata(fields, num_fields);
+ mct_close_log();
+
+ mysql_free_result(result);
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE t1");
+
+ myquery(rc);
+}
#ifndef EMBEDDED_LIBRARY
#define MDEV19838_MAX_PARAM_COUNT 32
@@ -20047,6 +20112,7 @@ static void test_mdev19838()
#endif // EMBEDDED_LIBRARY
static struct my_tests_st my_tests[]= {
+ { "test_mdev_26145", test_mdev_26145 },
{ "disable_query_logs", disable_query_logs },
{ "test_view_sp_list_fields", test_view_sp_list_fields },
{ "client_query", client_query },
diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt
index ded44af5276..2b8f550bf82 100644
--- a/win/packaging/CMakeLists.txt
+++ b/win/packaging/CMakeLists.txt
@@ -224,6 +224,12 @@ ADD_CUSTOM_TARGET(
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
+ADD_CUSTOM_TARGET(
+ win_package_test
+ COMMAND ${CMAKE_CPACK_COMMAND} ${CPACK_CONFIG_PARAM} --config ${CMAKE_CURRENT_SOURCE_DIR}/CPackZipTestConfig.cmake
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+)
+
ADD_CUSTOM_TARGET(win_package DEPENDS win_package_zip win_package_debuginfo)
SET_TARGET_PROPERTIES(
win_package win_package_zip win_package_debuginfo
diff --git a/win/packaging/CPackZIPTestConfig.cmake b/win/packaging/CPackZIPTestConfig.cmake
new file mode 100644
index 00000000000..1dfba7ecabf
--- /dev/null
+++ b/win/packaging/CPackZIPTestConfig.cmake
@@ -0,0 +1,6 @@
+INCLUDE(CPackConfig.cmake)
+set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-test")
+set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
+set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
+SET(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY ON)
+SET(CPACK_COMPONENTS_ALL Test)
diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake
index 6de033eacb2..c57282ce90a 100644
--- a/win/packaging/heidisql.cmake
+++ b/win/packaging/heidisql.cmake
@@ -1,4 +1,4 @@
-SET(HEIDISQL_BASE_NAME "HeidiSQL_11.2_32_Portable")
+SET(HEIDISQL_BASE_NAME "HeidiSQL_11.3_32_Portable")
SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip")
SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}")
SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME})
diff --git a/win/packaging/mysql_server.wxs.in b/win/packaging/mysql_server.wxs.in
index c10116830e7..6a157c56347 100644
--- a/win/packaging/mysql_server.wxs.in
+++ b/win/packaging/mysql_server.wxs.in
@@ -18,7 +18,7 @@
SummaryCodepage='1252'
Platform='@Platform@'/>
- <Media Id='1' Cabinet='product.cab' EmbedCab='yes' CompressionLevel='high' />
+ <MediaTemplate EmbedCab="yes" MaximumUncompressedMediaSize="2" CompressionLevel="high"/>
<!-- Upgrade -->
<Upgrade Id="@CPACK_WIX_UPGRADE_CODE@">
diff --git a/win/upgrade_wizard/upgradeDlg.cpp b/win/upgrade_wizard/upgradeDlg.cpp
index d996c0ebe5d..d0dd6a3fa75 100644
--- a/win/upgrade_wizard/upgradeDlg.cpp
+++ b/win/upgrade_wizard/upgradeDlg.cpp
@@ -367,7 +367,10 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename)
ErrorExit("Stdout SetHandleInformation");
string commandline("mysql_upgrade_service.exe --service=");
+ commandline += "\"";
commandline += servicename;
+ commandline += "\"";
+
si.cb = sizeof(si);
si.hStdInput= GetStdHandle(STD_INPUT_HANDLE);
si.hStdOutput= hPipeWrite;
@@ -397,7 +400,7 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename)
else
{
/*
- Creating a process with CREATE_BREAKAWAY_FROM_JOB, reset this flag
+ Creating a process with CREATE_BREAKAWAY_FROM_JOB failed, reset this flag
and retry.
*/
if (!CreateProcess(NULL, (LPSTR)commandline.c_str(), NULL, NULL, TRUE,