From 542d769ea1a22a7a6a87c9fe76ff911a162ade44 Mon Sep 17 00:00:00 2001 From: mkaruza Date: Wed, 11 Nov 2020 09:22:05 +0100 Subject: MDEV-18280: Galera test failure on galera_split_brain and galera_kill_nochanges --- mysql-test/suite/galera/disabled.def | 2 -- mysql-test/suite/galera/r/galera_kill_nochanges.result | 2 ++ mysql-test/suite/galera/r/galera_split_brain.result | 4 +++- mysql-test/suite/galera/t/galera_split_brain.test | 6 ------ 4 files changed, 5 insertions(+), 9 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 0185871eaa4..31c9c17daf1 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -26,13 +26,11 @@ galera_encrypt_tmp_files : Get error failed to enable encryption of temporary fi galera_ftwrl : MDEV-21525 galera.galera_ftwrl galera_gcache_recover_manytrx : MDEV-18834 Galera test failure galera_kill_largechanges : MDEV-18179 Galera test failure on galera.galera_kill_largechanges -galera_kill_nochanges : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges galera_many_tables_nopk : MDEV-18182 Galera test failure on galera.galera_many_tables_nopk galera_mdl_race : MDEV-21524 galera.galera_mdl_race galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails galera_pc_ignore_sb : MDEV-20888 galera.galera_pc_ignore_sb galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim -galera_split_brain : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting diff --git a/mysql-test/suite/galera/r/galera_kill_nochanges.result b/mysql-test/suite/galera/r/galera_kill_nochanges.result index 8795608a303..f7478e29fd8 100644 --- a/mysql-test/suite/galera/r/galera_kill_nochanges.result +++ b/mysql-test/suite/galera/r/galera_kill_nochanges.result @@ -1,3 +1,5 @@ +connection node_2; +connection node_1; connection node_1; connection node_2; connection node_1; diff --git a/mysql-test/suite/galera/r/galera_split_brain.result b/mysql-test/suite/galera/r/galera_split_brain.result index 7c669e5516a..bd8c3a5bc44 100644 --- a/mysql-test/suite/galera/r/galera_split_brain.result +++ b/mysql-test/suite/galera/r/galera_split_brain.result @@ -1,3 +1,5 @@ +connection node_2; +connection node_1; connection node_1; connection node_2; call mtr.add_suppression("WSREP: TO isolation failed for: "); @@ -6,7 +8,7 @@ connection node_2; Killing server ... connection node_1; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -ERROR 40001: WSREP replication failed. Check your wsrep connection state and retry the query. +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction connection node_2; connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; disconnect node_2; diff --git a/mysql-test/suite/galera/t/galera_split_brain.test b/mysql-test/suite/galera/t/galera_split_brain.test index 91a2cc326a2..6a822b8f127 100644 --- a/mysql-test/suite/galera/t/galera_split_brain.test +++ b/mysql-test/suite/galera/t/galera_split_brain.test @@ -26,18 +26,13 @@ call mtr.add_suppression("WSREP: TO isolation failed for: "); CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; # Reset the master and restart the slave so that post-test checks can run - - --connection node_2 --source include/start_mysqld.inc ---sleep 5 --source include/wait_until_connected_again.inc --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' --source include/wait_condition.inc ---sleep 10 - --connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 --source include/wait_until_connected_again.inc @@ -46,4 +41,3 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; --source include/auto_increment_offset_restore.inc --source include/galera_end.inc - -- cgit v1.2.1 From a4d4836f2b58ff43d811dac610ac30b0c6f308f1 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Fri, 29 Jan 2021 19:31:07 +0200 Subject: List of unstable tests for 10.2.37 release Test code modifications and new failures from buildbot only registered for the main suite. The rest was updated partially, based on the status of existing JIRA items --- mysql-test/unstable-tests | 294 +++++++++++++++++----------------------------- 1 file changed, 111 insertions(+), 183 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 7eac636dc5d..286c99cba14 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,28 +23,31 @@ # ############################################################################## # -# Based on bb-10.2-release 72eea39d4c4a8bcadccfdac457e61abc7b618ff8 -# Fri Oct 30 12:58:16 2020 +0200 -# MDEV-23991 fixup: Initialize the memory +# Based on 10.2 9c84852809214e97cf91327a798204c1b745881e +# for main suite changes and failures, and +# bb-10.2-release 72eea39d4c4a8bcadccfdac457e61abc7b618ff8 +# for the rest -main.alter_table : Modified in 10.2.35 -main.alter_table_trans : MDEV-12084 - timeout +main.alter_table_trans : MDEV-12084 - Timeout main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result -main.aria_icp_debug : Added in 10.2.35 main.auth_named_pipe : MDEV-14724 - System error 2 -main.blackhole : Modified in 10.2.35 -main.bootstrap_innodb : Added in 10.2.35 main.connect : MDEV-17282 - Wrong result main.connect2 : MDEV-13885 - Server crash -main.count_distinct2 : MDEV-11768 - timeout +main.create : Modified in 10.2.37 main.create_delayed : MDEV-10605 - failed with timeout main.create_drop_event : MDEV-16271 - Wrong result +main.cte_nonrecursive : Modified in 10.2.37 +main.cte_nonrecursive_not_embedded : Added in 10.2.37 +main.cte_recursive : Modified in 10.2.37 main.ctype_ucs : MDEV-17681 - Data too long for column main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade main.ctype_utf16 : MDEV-10675: timeout or extra warnings -main.ctype_utf8 : Modified in 10.2.35 +main.ctype_utf8mb4 : Modified in 10.2.37 +main.ctype_utf8mb4_heap : Include file modified in 10.2.37 +main.ctype_utf8mb4_innodb : Include file modified in 10.2.37 +main.ctype_utf8mb4_myisam : Include file modified in 10.2.37 main.debug_sync : MDEV-10607 - internal error -main.derived_opt : MDEV-11768 - timeout +main.derived_cond_pushdown : Modified in 10.2.37 main.dirty_close : MDEV-19368 - mysqltest failed but provided no output main.distinct : MDEV-14194 - Crash main.drop_bad_db_type : MDEV-15676 - Wrong result @@ -52,104 +55,92 @@ main.events_2 : MDEV-13277 - Crash main.events_bugs : MDEV-12892 - Crash main.events_restart : MDEV-12236 - Server shutdown problem main.events_slowlog : MDEV-12821 - Wrong result -main.fast_prefix_index_fetch_innodb : Modified in 10.2.35 main.flush : MDEV-19368 - mysqltest failed but provided no output -main.func_gconcat : MDEV-21379 - Valgrind warnings -main.func_json : Modified in 10.2.35 -main.func_test : Modified in 10.2.35 +main.func_gconcat : MDEV-21379 - Valgrind warnings; modified in 10.2.37 +main.func_like : Modified in 10.2.37 main.gis : MDEV-13411 - wrong result on P8 +main.gis-json : Modified in 10.2.37 main.gis_notembedded : MDEV-21264 - Wrong result with different default charset -main.grant : Modified in 10.2.35 -main.grant5 : Modified in 10.2.35 +main.group_by : Modified in 10.2.37 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown main.index_intersect_innodb : MDEV-10643 - failed with timeout main.index_merge_innodb : MDEV-7142 - Plan mismatch -main.information_schema : Modified in 10.2.35 -main.innodb_ext_key : Modified in 10.2.35 -main.innodb_icp_debug : Added in 10.2.35 +main.information_schema : Modified in 10.2.37 +main.innodb_mrr_cpk : MDEV-24737 - Server crash main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure (Fixed in 10.3+, MDEV-22947) +main.kill : Modified in 10.2.37 main.kill-2 : MDEV-13257 - Wrong result main.kill_processlist-6619 : MDEV-10793 - Wrong result -main.limit_rows_examined : Modified in 10.2.35 main.loaddata : MDEV-19368 - mysqltest failed but provided no output main.locale : MDEV-20521 - Missing warning -main.lock_view : Added in 10.2.35 +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 : Modified in 10.2.35 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.multi_update_big : Modified in 10.2.35 -main.myisam_icp_debug : Added in 10.2.35 +main.myisam : Modified in 10.2.37 main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2 main.mysql_client_test_comp : MDEV-16641 - Error in exec main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed -main.mysql_upgrade : Modified in 10.2.35 +main.mysql_upgrade : Modified in 10.2.37 main.mysql_upgrade_noengine : MDEV-14355 - Wrong result -main.mysqlbinlog_row_minimal : Modified in 10.2.35 -main.mysqld--help : Modified in 10.2.35 main.mysqld_option_err : MDEV-21571 - Crash on bootstrap -main.mysqldump : MDEV-14800 - Stack smashing detected -main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug +main.mysqldump : Modified in 10.2.37 +main.mysqldump-system : Added in 10.2.37 main.mysqlslap : MDEV-11801 - timeout main.mysqltest : MDEV-9269 - fails on Alpha; MDEV-13887 - Wrong result main.old-mode : MDEV-19373 - Wrong result main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.order_by : Modified in 10.2.35 +main.order_by : Modified in 10.2.37 main.order_by_optimizer_innodb : MDEV-10683 - Wrong result -main.parser : Modified in 10.2.35 -main.partition : Modified in 10.2.35 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings main.partition_innodb_semi_consistent : MDEV-19411 - Failed to start mysqld.1 -main.plugin_innodb : Modified in 10.2.35 -main.pool_of_threads : Modified in 10.2.35 -main.precedence : Added in 10.2.35 -main.precedence_bugs : Added in 10.2.35 -main.processlist_notembedded : Modified in 10.2.35 +main.precedence : Modified in 10.2.37 +main.processlist_notembedded : MDEV-23752 - Not explainable command main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count -main.query_cache : MDEV-16180 - Wrong result +main.ps_show_log : Added in 10.2.37 +main.query_cache : MDEV-16180 - Wrong result; modified in 10.2.37 main.query_cache_debug : MDEV-15281 - Query cache is disabled -main.range : Modified in 10.2.35 +main.range : Modified in 10.2.37 main.range_innodb : MDEV-23371 - Server crash main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away main.set_statement : MDEV-13183 - Wrong result main.set_statement_notembedded : MDEV-19414 - Wrong result main.shm : MDEV-12727 - Mismatch, ERROR 2013 main.show_explain : MDEV-10674 - Wrong result code +main.skip_grants : Modified in 10.2.37 +main.sp : Modified in 10.2.37 main.sp-security : MDEV-10607 - sporadic "can't connect" +main.sp-ucs2 : Modified in 10.2.37 main.sp_notembedded : MDEV-10607 - internal error main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1 main.ssl_ca : MDEV-10895 - SSL connection error on Power main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1 main.ssl_timeout : MDEV-11244 - Crash +main.stat_tables : Modified in 10.2.37 main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding main.status : MDEV-13255 - Wrong result -main.subselect4 : Modified in 10.2.35 -main.subselect_innodb : MDEV-10614 - Sporadic wrong results; modified in 10.2.35 -main.sum_distinct-big : Modified in 10.2.35 +main.subselect_innodb : MDEV-10614 - Sporadic wrong results main.tc_heuristic_recover : MDEV-14189 - Wrong result -main.temp_table_symlink : MDEV-24058 - Wrong error code; added in 10.2.35 +main.temp_table_symlink : MDEV-24058 - Wrong error code main.type_blob : MDEV-15195 - Wrong result -main.type_date : Modified in 10.2.35 -main.type_datetime : Modified in 10.2.35 main.type_datetime_hires : MDEV-10687 - Timeout -main.type_newdecimal : Modified in 10.2.35 main.type_temporal_innodb : MDEV-24025 - Wrong result -main.udf : Modified in 10.2.35 +main.type_year : Modified in 10.2.37 +main.user_limits : Modified in 10.2.37 main.userstat : MDEV-12904 - SSL errors -main.view : Modified in 10.2.35 +main.view : Modified in 10.2.37 main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query -main.win : Modified in 10.2.35 -main.xa : MDEV-11769 - lock wait timeout +main.xa : MDEV-11769 - lock wait timeout; modified in 10.2.37 #----------------------------------------------------------------------- -archive.archive_bitfield : MDEV-11771 - table is marked as crashed -archive.archive_symlink : MDEV-12170 - unexpected error on rmdir -archive.discover : MDEV-10510 - Table is marked as crashed -archive.mysqlhotcopy_archive : MDEV-10995 - Hang on debug +archive.archive_bitfield : MDEV-11771 - table is marked as crashed +archive.archive_symlink : MDEV-12170 - unexpected error on rmdir +archive.discover : MDEV-10510 - Table is marked as crashed #----------------------------------------------------------------------- @@ -157,18 +148,14 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed #----------------------------------------------------------------------- -binlog.binlog_commit_wait : MDEV-10150 - Mismatch -binlog.binlog_killed : MDEV-12925 - Wrong result -binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown -binlog.binlog_mysqlbinlog_row : Modified in 10.2.35 -binlog.binlog_mysqlbinlog_row_frag : Modified in 10.2.35 -binlog.binlog_no_uniqfile_crash : MDEV-24078 - Server crash upon shutdown -binlog.binlog_recover_checksum_error : Added in 10.2.35 -binlog.binlog_show_binlog_event_random_pos : Modified in 10.2.35 -binlog.binlog_stm_mix_innodb_myisam : MDEV-24057 - Wrong result -binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint -binlog.flashback-largebinlog : MDEV-19764 - Out of memory -binlog.load_data_stm_view : MDEV-16948 - Wrong result +binlog.binlog_commit_wait : MDEV-10150 - Mismatch +binlog.binlog_killed : MDEV-12925 - Wrong result +binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown +binlog.binlog_no_uniqfile_crash : MDEV-24078 - Server crash upon shutdown +binlog.binlog_stm_mix_innodb_myisam : MDEV-24057 - Wrong result +binlog.binlog_xa_recover : MDEV-12908 - Extra checkpoint +binlog.flashback-largebinlog : MDEV-19764 - Out of memory +binlog.load_data_stm_view : MDEV-16948 - Wrong result #----------------------------------------------------------------------- @@ -193,10 +180,9 @@ binlog_encryption.rpl_typeconv : MDEV-14362 - Lost con #----------------------------------------------------------------------- -connect.pivot : MDEV-14803 - Failed to discover table -connect.updelx : Modified in 10.2.35 -connect.vcol : MDEV-12374 - Fails on Windows -connect.zip : MDEV-13884 - Wrong result +connect.pivot : MDEV-14803 - Failed to discover table +connect.vcol : MDEV-12374 - Fails on Windows +connect.zip : MDEV-13884 - Wrong result #----------------------------------------------------------------------- @@ -204,40 +190,34 @@ disks.disks_notembedded : MDEV-21587 - Wrong result #----------------------------------------------------------------------- -encryption.create_or_replace : Modified in 10.2.35 -encryption.create_or_replace_big : Added in 10.2.35 -encryption.debug_key_management : MDEV-13841 - Timeout -encryption.encrypt_and_grep : MDEV-13765 - Wrong result -encryption.innochecksum : MDEV-13644 - Assertion failure -encryption.innodb-bad-key-change2 : MDEV-19118 - Can't connect through socket -encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate -encryption.innodb-discard-import : MDEV-19113 - Timeout -encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout -encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait condition -encryption.innodb-force-corrupt : MDEV-17286 - SSL error -encryption.innodb-missing-key : MDEV-17286 - SSL error -encryption.innodb-page_encryption : MDEV-10641 - mutex problem -encryption.innodb-page_encryption_compression : Modified in 10.2.35 -encryption.innodb-page_encryption_log_encryption : Modified in 10.2.35 -encryption.innodb-read-only : MDEV-16563 - Crash on startup -encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup -encryption.innodb-remove-encryption : MDEV-16493 - Timeout in wait condition -encryption.innodb-spatial-index : MDEV-13746 - Wrong result -encryption.innodb_encrypt_key_rotation_age : MDEV-19763 - Timeout -encryption.innodb_encrypt_log : MDEV-13725 - Wrong result -encryption.innodb_encrypt_log_corruption : MDEV-14379 - Server crash -encryption.innodb_encrypt_temporary_tables : MDEV-20142 - Wrong result -encryption.innodb_encryption : MDEV-14728 - Unable to get certificate; MDEV-15675 - Timeout -encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure -encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result -encryption.innodb_encryption_is : MDEV-12898 - Server hang on startup -encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash -encryption.innodb_first_page : MDEV-10689 - Crash -encryption.innodb_onlinealter_encryption : MDEV-17287 - SIGABRT on server restart -encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing (Fixed in 10.5+) -encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing (Fixed in 10.5+) -encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing (Fixed in 10.5+) -encryption.tempfiles_encrypted : Added in 10.2.35 +encryption.create_or_replace : MDEV-24081 - Lock wait timeout exceeded +encryption.debug_key_management : MDEV-13841 - Timeout +encryption.encrypt_and_grep : MDEV-13765 - Wrong result +encryption.innochecksum : MDEV-13644 - Assertion failure +encryption.innodb-bad-key-change2 : MDEV-19118 - Can't connect through socket +encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate +encryption.innodb-discard-import : MDEV-19113 - Timeout +encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout +encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait condition +encryption.innodb-force-corrupt : MDEV-17286 - SSL error +encryption.innodb-missing-key : MDEV-17286 - SSL error +encryption.innodb-page_encryption : MDEV-10641 - mutex problem +encryption.innodb-read-only : MDEV-16563 - Crash on startup +encryption.innodb-remove-encryption : MDEV-16493 - Timeout in wait condition +encryption.innodb-spatial-index : MDEV-13746 - Wrong result +encryption.innodb_encrypt_key_rotation_age : MDEV-19763 - Timeout +encryption.innodb_encrypt_log : MDEV-13725 - Wrong result +encryption.innodb_encrypt_log_corruption : MDEV-14379 - Server crash +encryption.innodb_encrypt_temporary_tables : MDEV-20142 - Wrong result +encryption.innodb_encryption : MDEV-14728 - Unable to get certificate; MDEV-15675 - Timeout +encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure +encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result +encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash +encryption.innodb_first_page : MDEV-10689 - Crash +encryption.innodb_onlinealter_encryption : MDEV-17287 - SIGABRT on server restart +encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing (Fixed in 10.5+) +encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing (Fixed in 10.5+) +encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing (Fixed in 10.5+) #----------------------------------------------------------------------- @@ -285,33 +265,20 @@ galera_3nodes.* : Suite is not stable yet #----------------------------------------------------------------------- -gcol.gcol_keys_innodb : Include file modified in 10.2.35 -gcol.gcol_keys_myisam : Include file modified in 10.2.35 -gcol.gcol_partition_innodb : Include file modified in 10.2.35 -gcol.gcol_update : Include file modified in 10.2.35 -gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion -gcol.innodb_virtual_debug : MDEV-23111 - Server crash -gcol.innodb_virtual_debug_purge : Include file modified in 10.2.35 -gcol.innodb_virtual_fk : Modified in 10.2.35 -gcol.innodb_virtual_index : Modified in 10.2.35 -gcol.innodb_virtual_purge : Include file modified in 10.2.35 +gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion +gcol.innodb_virtual_debug : MDEV-23111 - Server crash #----------------------------------------------------------------------- innodb.101_compatibility : MDEV-13891 - Wrong result innodb.alter_copy : MDEV-16181 - Assertion failure innodb.alter_crash : MDEV-16944 - The process cannot access the file -innodb.alter_table : Modified in 10.2.35 innodb.binlog_consistent : MDEV-10618 - Server fails to start innodb.blob-crash : MDEV-20481 - Failures upon recovery innodb.doublewrite : MDEV-12905 - Server crash -innodb.foreign-keys : Modified in 10.2.35 -innodb.foreign_key : Modified in 10.2.35 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed innodb.group_commit_crash_no_optimize_thread : MDEV-11770 - Checksum mismatch innodb.ibuf_not_empty : MDEV-19021 - Wrong result -innodb.innodb : Modified in 10.2.35 -innodb.innodb-64k : Modified in 10.2.35 innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS innodb.innodb-alter-table : MDEV-10619 - Testcase timeout @@ -319,18 +286,15 @@ innodb.innodb-blob : MDEV-12053 - Client crash innodb.innodb-change-buffer-recovery : MDEV-19115 - Lost connection to MySQL server during query innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown innodb.innodb-get-fk : MDEV-13276 - Server crash -innodb.innodb-index : Include file modified in 10.2.35 -innodb.innodb-index-debug : Include file modified in 10.2.35 innodb.innodb-index-online : MDEV-14809 - Cannot save statistics innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem innodb.innodb-table-online : MDEV-13894 - Wrong result +innodb.innodb-ucs2 : MDEV-24505 - Assertion failure innodb.innodb-wl5522-1 : MDEV-22945 - Server crash innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno innodb.innodb_buffer_pool_dump_pct : MDEV-20139 - Timeout in wait_condition.inc -innodb.innodb_buffer_pool_resize_with_chunks : MDEV-16964 - Assertion failure -innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt innodb.innodb_bug30423 : MDEV-7311 - Wrong result innodb.innodb_bug47167 : MDEV-20524 - Table 'user' is marked as crashed and should be repaired innodb.innodb_bug48024 : MDEV-14352 - Assertion failure @@ -339,14 +303,11 @@ innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full innodb.innodb_information_schema : MDEV-8851 - Wrong result innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result -innodb.innodb_monitor : MDEV-10939 - Testcase timeout innodb.innodb_mysql : MDEV-19873 - Wrong result innodb.innodb_stats : MDEV-10682 - wrong result -innodb.innodb_stats_drop_locked : Modified in 10.2.35 innodb.innodb_stats_persistent : MDEV-21567 - Wrong result in execution plan innodb.innodb_stats_persistent_debug : MDEV-14801 - Operation failed innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait -innodb.innodb_trx_weight : Configuration deleted in 10.2.35 innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks innodb.log_corruption : MDEV-13251 - Wrong result innodb.log_data_file_size : MDEV-14204 - Server failed to start @@ -357,24 +318,19 @@ innodb.purge_secondary : MDEV-15681 - Wrong result innodb.purge_thread_shutdown : MDEV-13792 - Wrong result innodb.read_only_recovery : MDEV-13886 - Server crash innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile -innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace; modified in 10.2.35 -innodb.stats_persistent : Added in 10.2.35 +innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace innodb.table_definition_cache_debug : MDEV-14206 - Extra warning innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start innodb.temp_table_savepoint : MDEV-24077 - Assertion failure innodb.temporary_table : MDEV-13265 - Wrong result -innodb.truncate : Modified in 10.2.35 innodb.undo_truncate : MDEV-17340 - Server hung innodb.undo_truncate_recover : MDEV-17679 - MySQL server has gone away -innodb.update-cascade : Combinations added in 10.2.35 innodb.update_time : MDEV-14804 - Wrong result innodb.xa_recovery : MDEV-15279 - mysqld got exception #----------------------------------------------------------------------- -innodb_fts.basic : Modified in 10.2.35 innodb_fts.fulltext2 : MDEV-24074 - Server crash -innodb_fts.innodb_fts_misc_1 : Modified in 10.2.35 innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log innodb_fts.innodb_fts_stopword_charset : MDEV-13259 - Table crashed @@ -383,13 +339,11 @@ innodb_fts.sync_ddl : MDEV-21568 - Errno: 2000 #----------------------------------------------------------------------- innodb_gis.gis_split_nan : MDEV-21678 - Cannot get geometry object -innodb_gis.rtree_add_index : Include file modified in 10.2.35 -innodb_gis.rtree_compress : Include file modified in 10.2.35 innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded -innodb_gis.rtree_purge : MDEV-15275 - Timeout; include file modified in 10.2.35 +innodb_gis.rtree_purge : MDEV-15275 - Timeout innodb_gis.rtree_recovery : MDEV-15274 - Error on check innodb_gis.rtree_split : MDEV-14208 - Too many arguments -innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file; include file modified in 10.2.35 +innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file innodb_gis.types : MDEV-15679 - Table is marked as crashed #----------------------------------------------------------------------- @@ -412,24 +366,18 @@ maria.maria : MDEV-14430 - Extra warning #----------------------------------------------------------------------- -mariabackup.apply-log-only : MDEV-20135 - Timeout -mariabackup.backup_ssl : MDEV-24073 - Server crash upon shutdown -mariabackup.data_directory : MDEV-15270 - Error on exec -mariabackup.ddl_incremental_encrypted : Added in 10.2.35 -mariabackup.full_backup : MDEV-16571 - Wrong result -mariabackup.huge_lsn : MDEV-17286 - SSL error -mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure -mariabackup.incremental_ddl_during_backup : Modified in 10.2.35 -mariabackup.incremental_encrypted : MDEV-15667 - Timeout -mariabackup.innodb_redo_overwrite : Added in 10.2.35 -mariabackup.mdev-14447 : MDEV-15201 - Timeout -mariabackup.mlog_index_load : Modified in 10.2.35 -mariabackup.partial_exclude : MDEV-15270 - Error on exec -mariabackup.rpl_slave_info : Added in 10.2.35 -mariabackup.unencrypted_page_compressed : Include file modified in 10.2.35 -mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault -mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 -mariabackup.xb_partition : MDEV-17584 - Crash on shutdown +mariabackup.apply-log-only : MDEV-20135 - Timeout +mariabackup.backup_ssl : MDEV-24073 - Server crash upon shutdown +mariabackup.data_directory : MDEV-15270 - Error on exec +mariabackup.full_backup : MDEV-16571 - Wrong result +mariabackup.huge_lsn : MDEV-17286 - SSL error +mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure +mariabackup.incremental_encrypted : MDEV-15667 - Timeout +mariabackup.mdev-14447 : MDEV-15201 - Timeout +mariabackup.partial_exclude : MDEV-15270 - Error on exec +mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault +mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 +mariabackup.xb_partition : MDEV-17584 - Crash on shutdown #----------------------------------------------------------------------- @@ -453,8 +401,6 @@ multi_source.info_logs : MDEV-12629 - Valgrind, MDEV-10042 - Wrong result, MDE multi_source.mdev-8874 : MDEV-19415 - AddressSanitizer: heap-use-after-free multi_source.mdev-9544 : MDEV-19415 - AddressSanitizer: heap-use-after-free multi_source.multisource : MDEV-10417 - Fails on Mips -multi_source.reset_slave : MDEV-10690 - Wrong result -multi_source.simple : MDEV-4633 - Wrong result multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_heartbeats #----------------------------------------------------------------------- @@ -503,7 +449,7 @@ perfschema_stress.* : MDEV-10996 - Not maintained plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such plugins.processlist : MDEV-16574 - Wrong result -plugins.server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.2.35 +plugins.server_audit : MDEV-9562 - crashes on sol10-sparc plugins.thread_pool_server_audit : MDEV-14295 - Wrong result #----------------------------------------------------------------------- @@ -553,7 +499,6 @@ rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log rpl.rpl_binlog_errors : MDEV-12742 - Crash -rpl.rpl_binlog_index : Modified in 10.2.35 rpl.rpl_checksum_cache : MDEV-22510 - Server crash rpl.rpl_colSize : MDEV-16112 - Server crash rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac @@ -563,13 +508,10 @@ rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Warnings/errors rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning -rpl.rpl_filter_tables_dynamic : Modified in 10.2.35 -rpl.rpl_filter_wild_tables_dynamic : Modified in 10.2.35 rpl.rpl_flushlog_loop : MDEV-21570 - Server crash rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output rpl.rpl_gtid_basic : MDEV-10681 - server startup problem -rpl.rpl_gtid_crash : MDEV-13643 - Lost connection; modified in 10.2.35 -rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout; MDEV-23103 - Could not delete gtid domain; modified in 10.2.35 +rpl.rpl_gtid_crash : MDEV-13643 - Lost connection rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings rpl.rpl_gtid_reconnect : MDEV-14497 - Crash @@ -587,12 +529,9 @@ rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog rpl.rpl_mdev12179 : MDEV-19043 - Warnings/errors rpl.rpl_mdev6020 : MDEV-23426 - Server crash, ASAN failures; MDEV-15272 - Server crash rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout -rpl.rpl_mysql_upgrade : Modified in 10.2.35 rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait rpl.rpl_parallel : MDEV-10653 - Timeouts -rpl.rpl_parallel2 : Modified in 10.2.35 rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash -rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master @@ -613,19 +552,15 @@ rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed rpl.rpl_row_index_choice : MDEV-15196 - Slave crash rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum -rpl.rpl_semi_sync : MDEV-11220 - Wrong result -rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings -rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures +rpl.rpl_semi_sync_uninstall_plugin : MDEV-24561 - Wrong usage of mutex; MDEV-7140 - Assorted failures rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition rpl.rpl_show_slave_hosts : MDEV-10681 - Crash rpl.rpl_skip_replication : MDEV-23372 - Extra warning -rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock; ; modified in 10.2.35 rpl.rpl_slave_load_tmpdir_not_exist : MDEV-23372 - Extra warning rpl.rpl_slow_query_log : MDEV-13250 - Test abort rpl.rpl_sp_effects : MDEV-13249 - Crash -rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout; modified in 10.2.35 +rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash rpl.rpl_sync : MDEV-10633 - Database page corruption @@ -635,7 +570,6 @@ rpl.rpl_trigger : MDEV-18055 - Wrong result rpl.rpl_truncate_3innodb : MDEV-19454 - Sporadic syntax error rpl.rpl_user_variables : MDEV-20522 - Wrong result rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result -rpl.show_status_stop_slave_race-7126 : Modified in 10.2.35 #----------------------------------------------------------------------- @@ -682,14 +616,9 @@ sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected err sys_vars.innodb_checksum_algorithm_basic : MDEV-21568 - Errno: 2000 sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash -sys_vars.replicate_do_db_basic : Modified in 10.2.35 -sys_vars.rpl_init_slave_func : Modified in 10.2.35 -sys_vars.session_track_system_variables_basic : Modified in 10.2.35 sys_vars.slow_query_log_func : MDEV-14273 - Wrong result sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result sys_vars.wait_timeout_func : MDEV-12896 - Wrong result -sys_vars.wsrep_cluster_address_basic : Modified in 10.2.35 -sys_vars.wsrep_on_basic : Configuration deleted in 10.2.35 #----------------------------------------------------------------------- @@ -721,7 +650,7 @@ tokudb_alter_table.hcad_all_add2 : MDEV-15269 - Timeout #----------------------------------------------------------------------- -tokudb_backup.* : MDEV-11001 - Missing include file +tokudb_backup.* : MDEV-11001 - Missing include file (Won't fix) #----------------------------------------------------------------------- @@ -738,11 +667,11 @@ tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection #----------------------------------------------------------------------- -tokudb_rpl.* : MDEV-11001 - Missing include file +tokudb_rpl.* : MDEV-11001 - Missing include file (Won't fix) #----------------------------------------------------------------------- -tokudb_sys_vars.* : MDEV-11001 - Missing include file +tokudb_sys_vars.* : MDEV-11001 - Missing include file (Won't fix) #----------------------------------------------------------------------- @@ -760,14 +689,13 @@ unit.mf_iocache : MDEV-20952 - Buffer overflow vcol.not_supported : MDEV-10639 - Testcase timeout vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout -vcol.vcol_misc : MDEV-16651 - Wrong error message; modified in 10.2.35 +vcol.vcol_misc : MDEV-16651 - Wrong error message #----------------------------------------------------------------------- wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node wsrep.mdev_6832 : MDEV-14195 - Check testcase failed wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use -wsrep.variables : Modified in 10.2.35 #----------------------------------------------------------------------- -- cgit v1.2.1 From b87c342da5e51e112e06b36d8b95037f182bdb0e Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Fri, 29 Jan 2021 00:27:19 +0530 Subject: MDEV-11172: EXPLAIN shows non-sensical value for key_len with type=index The issue happens when the secondary keys are extended with primary key parts. Inside the function TABLE_SHARE::init_from_binary_frm_image() adds the length bytes for the primary key key parts to the length of the secondary key. This is not needed because when the extended keys are used we recalculate the length for the used key parts. Also removed TABLE_SHARE::total_key_length as it is not used in the code Apporved-by: Monty --- mysql-test/r/innodb_ext_key.result | 16 ++++++++++++++++ mysql-test/t/innodb_ext_key.test | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/innodb_ext_key.result b/mysql-test/r/innodb_ext_key.result index c7a5b1a80ca..880d7a8bceb 100644 --- a/mysql-test/r/innodb_ext_key.result +++ b/mysql-test/r/innodb_ext_key.result @@ -790,3 +790,19 @@ EXPLAIN } drop table t1; SET optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +# +# MDEV-11172: EXPLAIN shows non-sensical value for key_len with type=index +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +CREATE TABLE t2 ( +pk VARCHAR(50), +a VARCHAR(20), +KEY k1(a), +PRIMARY KEY(pk) +)ENGINE=INNODB; +INSERT INTO t2 SELECT a,a FROM t1; +EXPLAIN SELECT pk FROM t2 FORCE INDEX(k1); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL k1 23 NULL 10 Using index +DROP TABLE t1,t2; diff --git a/mysql-test/t/innodb_ext_key.test b/mysql-test/t/innodb_ext_key.test index f5edd736490..de9ca10ff1b 100644 --- a/mysql-test/t/innodb_ext_key.test +++ b/mysql-test/t/innodb_ext_key.test @@ -606,3 +606,22 @@ explain format= json select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3'; drop table t1; SET optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; + +--echo # +--echo # MDEV-11172: EXPLAIN shows non-sensical value for key_len with type=index +--echo # + +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +CREATE TABLE t2 ( + pk VARCHAR(50), + a VARCHAR(20), + KEY k1(a), + PRIMARY KEY(pk) +)ENGINE=INNODB; + +INSERT INTO t2 SELECT a,a FROM t1; +EXPLAIN SELECT pk FROM t2 FORCE INDEX(k1); + +DROP TABLE t1,t2; -- cgit v1.2.1 From 072b39da66d9c1693ca832eb97f2d63b238cc412 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Sat, 30 Jan 2021 22:36:51 +0530 Subject: MDEV-22583: Selectivity for BIT columns in filtered column for EXPLAIN is incorrect For BIT columns when EITS is collected, we store the integral value in text representation in the min and max fields of the statistical table When this value is retrieved from the statistical table to original table field then we try to store the text representation in the original field which is INCORRECT. The value that is retrieved should be converted to integral type and that value should be stored back in the original field. This would get us the correct estimate for selectivity of the predicate. --- mysql-test/r/selectivity.result | 24 ++++++++++++++++++++++++ mysql-test/r/selectivity_innodb.result | 24 ++++++++++++++++++++++++ mysql-test/t/selectivity.test | 18 ++++++++++++++++++ 3 files changed, 66 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index 10af9265649..4d45d6b175b 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -1887,4 +1887,28 @@ a b set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1; # End of 10.1 tests +# +# MDEV-22583: Selectivity for BIT columns in filtered column for EXPLAIN is incorrect +# +SET optimizer_use_condition_selectivity=4; +SET histogram_size=255; +CREATE TABLE t1 (a BIT(32), b INT); +INSERT INTO t1 VALUES (80, 80), (81, 81), (82, 82); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +EXPLAIN EXTENDED SELECT * from t1 where t1.a >= 81; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 66.41 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` >= 81 +SELECT HEX(a), b from t1 where t1.a >= 81; +HEX(a) b +51 81 +52 82 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +DROP TABLE t1; +# End of 10.2 tests set @@global.histogram_size=@save_histogram_size; diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index ee0f56ae7ed..b97bbf8153f 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -1897,6 +1897,30 @@ a b set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1; # End of 10.1 tests +# +# MDEV-22583: Selectivity for BIT columns in filtered column for EXPLAIN is incorrect +# +SET optimizer_use_condition_selectivity=4; +SET histogram_size=255; +CREATE TABLE t1 (a BIT(32), b INT); +INSERT INTO t1 VALUES (80, 80), (81, 81), (82, 82); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +EXPLAIN EXTENDED SELECT * from t1 where t1.a >= 81; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 66.41 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` >= 81 +SELECT HEX(a), b from t1 where t1.a >= 81; +HEX(a) b +51 81 +52 82 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +DROP TABLE t1; +# End of 10.2 tests set @@global.histogram_size=@save_histogram_size; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; set @tmp_ust= @@use_stat_tables; diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test index a31573edb8e..b4f535f1584 100644 --- a/mysql-test/t/selectivity.test +++ b/mysql-test/t/selectivity.test @@ -1286,6 +1286,24 @@ drop table t1; --echo # End of 10.1 tests +--echo # +--echo # MDEV-22583: Selectivity for BIT columns in filtered column for EXPLAIN is incorrect +--echo # + +SET optimizer_use_condition_selectivity=4; +SET histogram_size=255; +CREATE TABLE t1 (a BIT(32), b INT); +INSERT INTO t1 VALUES (80, 80), (81, 81), (82, 82); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +EXPLAIN EXTENDED SELECT * from t1 where t1.a >= 81; +SELECT HEX(a), b from t1 where t1.a >= 81; + +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +DROP TABLE t1; + +--echo # End of 10.2 tests + # # Clean up # -- cgit v1.2.1 From 26f5033555a9bb33d3d8b68e2d766e274bec28ba Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Sun, 31 Jan 2021 19:55:07 +0530 Subject: MDEV-23449: alias do not exist and a query do not report an error For an IN/ANY/ALL subquery without an aggregate function and HAVING clause, the GROUP BY clause is removed. Due to the GROUP BY list being removed, the invalid reference in the GROUP BY clause was never resolved. Remove the GROUP BY list only when the all the items in the GROUP BY list are resolved. Also removing the GROUP BY list later would not affect the extension that allows using non-aggregated field in an aggregate function (when ONLY_FULL_GROUP_BY is not set) because the GROUP BY list is removed only when their is NO aggregate function in IN/ALL/ANY subquery. --- mysql-test/r/subselect4.result | 8 ++++++++ mysql-test/t/subselect4.test | 11 +++++++++++ 2 files changed, 19 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index c0df4f626b1..25937373e5e 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -2686,4 +2686,12 @@ SELECT * FROM t2; f bar DROP TABLE t1, t2; +# +# MDEV-23449: alias do not exist and a query do not report an error +# +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5); +SELECT a, b FROM t1 WHERE a IN (SELECT A.a FROM t1 A GROUP BY s.id); +ERROR 42S22: Unknown column 's.id' in 'group statement' +DROP TABLE t1; # End of 10.2 tests diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index 6eada9b27d9..fd36023435f 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -2201,4 +2201,15 @@ SELECT * FROM t2; DROP TABLE t1, t2; +--echo # +--echo # MDEV-23449: alias do not exist and a query do not report an error +--echo # + +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5); + +--error ER_BAD_FIELD_ERROR +SELECT a, b FROM t1 WHERE a IN (SELECT A.a FROM t1 A GROUP BY s.id); +DROP TABLE t1; + --echo # End of 10.2 tests -- cgit v1.2.1 From eef4c5d378c3a4bd838d57e2ea35e9e970113204 Mon Sep 17 00:00:00 2001 From: Sujatha Date: Mon, 18 Jan 2021 14:00:13 +0530 Subject: MDEV-22741: *SAN: ERROR: AddressSanitizer: use-after-poison on address in instrings/strmake.c:36 from change_master (on optimized builds) Problem: ======== CHANGE MASTER TO MASTER_USER='root', MASTER_SSL=0, MASTER_SSL_CA='', MASTER_SSL_CERT='', MASTER_SSL_KEY='', MASTER_SSL_CRL='', MASTER_SSL_CRLPATH=''; CHANGE MASTER TO MASTER_USER='root', MASTER_PASSWORD='', MASTER_SSL=0; use-after-poison is reported for lex_mi->ssl_crl File: sql_repl.cc if (lex_mi->ssl_crl) strmake_buf(mi->ssl_crl, lex_mi->ssl_crl); Analysis: ======== At the end of CHANGE MASTER statement execution, the LEX_MASTER_INFO parameters are reset so that the next query will have a clean state. But 'ssl_crl' and 'ssl_crl_path' members of LEX_MASTER_INFO object are not cleared during 'LEX_MASTER_INFO::reset'. Hence when a new CHANGE MASTER statement is executed, the stale value of lex_mi->ssl_crl is used, so ASAN reports use-after-poison. Fix: === Clear 'ssl_crl' and 'ssl_crl_path' as part of 'reset'. --- mysql-test/suite/rpl/r/rpl_change_master.result | 4 ++++ mysql-test/suite/rpl/t/rpl_change_master.test | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result index 5439bdef72c..48cec72d917 100644 --- a/mysql-test/suite/rpl/r/rpl_change_master.result +++ b/mysql-test/suite/rpl/r/rpl_change_master.result @@ -22,4 +22,8 @@ n connection master; drop table t1; connection slave; +connection master; +CHANGE MASTER TO MASTER_USER='root', MASTER_SSL=0, MASTER_SSL_CA='', MASTER_SSL_CERT='', +MASTER_SSL_KEY='', MASTER_SSL_CRL='', MASTER_SSL_CRLPATH=''; +CHANGE MASTER TO MASTER_USER='root', MASTER_PASSWORD='', MASTER_SSL=0; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test index 5e170d5acce..9ab49a585e6 100644 --- a/mysql-test/suite/rpl/t/rpl_change_master.test +++ b/mysql-test/suite/rpl/t/rpl_change_master.test @@ -101,4 +101,11 @@ connection master; drop table t1; } +--connection master +# MDEV-22741: *SAN: ERROR: AddressSanitizer: use-after-poison on address in +# instrings/strmake.c:36 from change_master (on optimized builds) +CHANGE MASTER TO MASTER_USER='root', MASTER_SSL=0, MASTER_SSL_CA='', MASTER_SSL_CERT='', + MASTER_SSL_KEY='', MASTER_SSL_CRL='', MASTER_SSL_CRLPATH=''; +CHANGE MASTER TO MASTER_USER='root', MASTER_PASSWORD='', MASTER_SSL=0; + --source include/rpl_end.inc -- cgit v1.2.1 From 739abf5195765914fad6f759f4b08e2a09a6006a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Sun, 7 Feb 2021 14:31:48 +0200 Subject: Make innodb_gis.rtree_purge run faster A locking SELECT from an InnoDB table is very slow especially in debug builds. Replacing some INSERT...SELECT should not reduce the test coverage, because the test will still do DELETE (which will acquire explicit record locks). --- mysql-test/suite/innodb_gis/t/rtree_purge.test | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb_gis/t/rtree_purge.test b/mysql-test/suite/innodb_gis/t/rtree_purge.test index 42f00428b88..60ecbe2e53a 100644 --- a/mysql-test/suite/innodb_gis/t/rtree_purge.test +++ b/mysql-test/suite/innodb_gis/t/rtree_purge.test @@ -1,7 +1,7 @@ # This test case will test R-tree purge. --source include/innodb_page_size.inc -# Valgrind takes too much time on PB2 even in the --big-test runs. +--source include/have_sequence.inc --source include/not_valgrind.inc SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; @@ -16,9 +16,7 @@ set @p=point(1,1); let $n=200; while ($n) { begin; -insert into t values(@p,@p),(@p,@p); -insert into t select @p,@p -from t a,t b,t c,t d,t e,t f,t g; +insert into t select @p,@p from seq_1_to_130; delete from t; commit; dec $n; -- cgit v1.2.1 From afc5bac49d48b6fd13def25409642104b988de28 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 5 Feb 2021 19:50:05 +0400 Subject: MDEV-24790 CAST('0e1111111111' AS DECIMAL(38,0)) returns a wrong result --- mysql-test/r/type_decimal.result | 89 +++++++++++++++++++++- .../suite/engines/iuds/r/insert_decimal.result | 17 ++--- mysql-test/t/type_decimal.test | 44 +++++++++++ 3 files changed, 137 insertions(+), 13 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 2a410d2ce97..519f0d547a2 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -176,9 +176,8 @@ Note 1265 Data truncated for column 'a' at row 2 insert ignore into t1 values ("1e+18446744073709551615"),("1e+18446744073709551616"),("1e-9223372036854775807"),("1e-9223372036854775809"); Warnings: Warning 1264 Out of range value for column 'a' at row 1 -Warning 1366 Incorrect decimal value: '1e+18446744073709551616' for column `test`.`t1`.`a` at row 2 +Warning 1264 Out of range value for column 'a' at row 2 Note 1265 Data truncated for column 'a' at row 3 -Warning 1366 Incorrect decimal value: '1e-9223372036854775809' for column `test`.`t1`.`a` at row 4 insert ignore into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); Warnings: Warning 1265 Data truncated for column 'a' at row 1 @@ -209,7 +208,7 @@ a 99999999.99 0.00 99999999.99 -0.00 +99999999.99 0.00 0.00 123.40 @@ -1078,5 +1077,89 @@ t1 CREATE TABLE `t1` ( DROP TABLE t1; DROP TABLE t1dec102; # +# MDEV-24790 CAST('0e1111111111' AS DECIMAL(38,0)) returns a wrong result +# +SELECT CAST('0e111111111' AS DECIMAL(38,0)) AS a; +a +0 +SELECT CAST('0e1111111111' AS DECIMAL(38,0)) AS a; +a +0 +SELECT CAST('.00000000000000000000000000000000000001e111111111111111111111' AS DECIMAL(38,0)) AS a; +a +99999999999999999999999999999999999999 +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated +Warning 1292 Truncated incorrect DECIMAL value: '.00000000000000000000000000000000000001e111111111111111111111' +Warning 1264 Out of range value for column 'a' at row 1 +CREATE TABLE t1 (str VARCHAR(128), comment VARCHAR(128)); +INSERT INTO t1 VALUES +('0e111111111111111111111', 'Zero mantissa and a huge positive exponent'), +('1e111111111111111111111', 'Non-zero mantissa, huge positive exponent'), +('0e-111111111111111111111', 'Zero mantissa and a huge negative exponent'), +('1e-111111111111111111111', 'Non-zero mantissa and a huge negative exponent'); +BEGIN NOT ATOMIC +DECLARE done INT DEFAULT FALSE; +DECLARE vstr, vcomment VARCHAR(128); +DECLARE cur1 CURSOR FOR SELECT str, comment FROM t1 ORDER BY str; +DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; +OPEN cur1; +read_loop: +LOOP +FETCH cur1 INTO vstr, vcomment; +IF done THEN +LEAVE read_loop; +END IF; +SELECT vstr AS `--------`, vcomment AS `--------`; +SELECT CAST(str AS DECIMAL(38,0)) FROM t1 WHERE str=vstr; +SHOW WARNINGS; +SELECT CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) FROM t1 WHERE str=vstr; +SHOW WARNINGS; +END LOOP; +END; +$$ +-------- -------- +0e-111111111111111111111 Zero mantissa and a huge negative exponent +CAST(str AS DECIMAL(38,0)) +0 +Level Code Message +CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) +0 +Level Code Message +Warning 1292 Truncated incorrect DECIMAL value: '0e-111111111111111111111garbage' +-------- -------- +0e111111111111111111111 Zero mantissa and a huge positive exponent +CAST(str AS DECIMAL(38,0)) +0 +Level Code Message +CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) +0 +Level Code Message +Warning 1292 Truncated incorrect DECIMAL value: '0e111111111111111111111garbage' +-------- -------- +1e-111111111111111111111 Non-zero mantissa and a huge negative exponent +CAST(str AS DECIMAL(38,0)) +0 +Level Code Message +CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) +0 +Level Code Message +Warning 1292 Truncated incorrect DECIMAL value: '1e-111111111111111111111garbage' +-------- -------- +1e111111111111111111111 Non-zero mantissa, huge positive exponent +CAST(str AS DECIMAL(38,0)) +99999999999999999999999999999999999999 +Level Code Message +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated +Warning 1292 Truncated incorrect DECIMAL value: '1e111111111111111111111' +Warning 1264 Out of range value for column 'CAST(str AS DECIMAL(38,0))' at row 1 +CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) +99999999999999999999999999999999999999 +Level Code Message +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated +Warning 1292 Truncated incorrect DECIMAL value: '1e111111111111111111111garbage' +Warning 1264 Out of range value for column 'CAST(CONCAT(str,'garbage') AS DECIMAL(38,0))' at row 1 +DROP TABLE t1; +# # End of 10.2 tests # diff --git a/mysql-test/suite/engines/iuds/r/insert_decimal.result b/mysql-test/suite/engines/iuds/r/insert_decimal.result index c0f3224e26f..4a6ad168a1d 100644 --- a/mysql-test/suite/engines/iuds/r/insert_decimal.result +++ b/mysql-test/suite/engines/iuds/r/insert_decimal.result @@ -110,15 +110,12 @@ Warnings: Warning 1264 Out of range value for column 'c1' at row 1 Warning 1264 Out of range value for column 'c2' at row 1 Warning 1264 Out of range value for column 'c3' at row 1 -Warning 1366 Incorrect decimal value: '1e+18446744073709551616' for column `test`.`t2`.`c1` at row 2 -Warning 1366 Incorrect decimal value: '1e+18446744073709551616' for column `test`.`t2`.`c2` at row 2 -Warning 1366 Incorrect decimal value: '1e+18446744073709551616' for column `test`.`t2`.`c3` at row 2 +Warning 1264 Out of range value for column 'c1' at row 2 +Warning 1264 Out of range value for column 'c2' at row 2 +Warning 1264 Out of range value for column 'c3' at row 2 Note 1265 Data truncated for column 'c1' at row 3 Note 1265 Data truncated for column 'c2' at row 3 Note 1265 Data truncated for column 'c3' at row 3 -Warning 1366 Incorrect decimal value: '1e-9223372036854775809' for column `test`.`t2`.`c1` at row 4 -Warning 1366 Incorrect decimal value: '1e-9223372036854775809' for column `test`.`t2`.`c2` at row 4 -Warning 1366 Incorrect decimal value: '1e-9223372036854775809' for column `test`.`t2`.`c3` at row 4 SELECT * FROM t1; c1 c2 c3 c4 0.00000 -0.10000 0 13 @@ -142,7 +139,6 @@ c1 c2 c3 c4 0 0 0 15 0 0 0 26 0 0 0 29 -0 0 0 31 0 0 0 32 0 0 0 33 0 0 0 7 @@ -160,6 +156,7 @@ c1 c2 c3 c4 9999999999 9999999999 9999999999 25 9999999999 9999999999 9999999999 28 9999999999 9999999999 9999999999 30 +9999999999 9999999999 9999999999 31 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) as max_value, sum(c1) as sum, avg(c1) as avg FROM t1; total_rows min_value max_value sum avg 7 0.00000 99999.99999 212446.04999 30349.435712857 @@ -171,13 +168,13 @@ total_rows min_value max_value sum avg 7 0 111111111 111211212 18535202.0000 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) as max_value, sum(c1) as sum, avg(c1) as avg FROM t2; total_rows min_value max_value sum avg -30 -9999999999 9999999999 21322222222 710740740.7333 +30 -9999999999 9999999999 31322222221 1044074074.0333 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) as max_value, sum(c2) as sum, avg(c2) as avg FROM t2; total_rows min_value max_value sum avg -30 0 9999999999 33444444445 1114814814.8333 +30 0 9999999999 43444444444 1448148148.1333 SELECT count(*) as total_rows, min(c3) as min_value, max(c3) as max_value, sum(c3) as sum, avg(c3) as avg FROM t2; total_rows min_value max_value sum avg -30 -9999999999 9999999999 43322222220 1444074074.0000 +30 -9999999999 9999999999 53322222219 1777407407.3000 SELECT * FROM t1; c1 c2 c3 c4 0.00000 -0.10000 0 13 diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 77c9c2875e2..80c196b11f1 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -669,6 +669,50 @@ DROP TABLE t1; DROP TABLE t1dec102; +--echo # +--echo # MDEV-24790 CAST('0e1111111111' AS DECIMAL(38,0)) returns a wrong result +--echo # + +SELECT CAST('0e111111111' AS DECIMAL(38,0)) AS a; +SELECT CAST('0e1111111111' AS DECIMAL(38,0)) AS a; +SELECT CAST('.00000000000000000000000000000000000001e111111111111111111111' AS DECIMAL(38,0)) AS a; + +CREATE TABLE t1 (str VARCHAR(128), comment VARCHAR(128)); +INSERT INTO t1 VALUES +('0e111111111111111111111', 'Zero mantissa and a huge positive exponent'), +('1e111111111111111111111', 'Non-zero mantissa, huge positive exponent'), +('0e-111111111111111111111', 'Zero mantissa and a huge negative exponent'), +('1e-111111111111111111111', 'Non-zero mantissa and a huge negative exponent'); + +# The loop below issues SHOW WARNINGS manually, disable automatic warnings +--disable_warnings +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE done INT DEFAULT FALSE; + DECLARE vstr, vcomment VARCHAR(128); + DECLARE cur1 CURSOR FOR SELECT str, comment FROM t1 ORDER BY str; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + OPEN cur1; +read_loop: + LOOP + FETCH cur1 INTO vstr, vcomment; + IF done THEN + LEAVE read_loop; + END IF; + SELECT vstr AS `--------`, vcomment AS `--------`; + SELECT CAST(str AS DECIMAL(38,0)) FROM t1 WHERE str=vstr; + SHOW WARNINGS; + SELECT CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) FROM t1 WHERE str=vstr; + SHOW WARNINGS; + END LOOP; +END; +$$ +DELIMITER ;$$ +--enable_warnings + + +DROP TABLE t1; + --echo # --echo # End of 10.2 tests --echo # -- cgit v1.2.1 From 362dcf9e017a7d16082237950bc8e241cb34f1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 11 Feb 2021 08:02:24 +0200 Subject: Update Galera disabled.def --- mysql-test/suite/galera/disabled.def | 2 ++ mysql-test/suite/galera_3nodes/disabled.def | 1 + 2 files changed, 3 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 7fe03a94220..7fee78fa009 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -17,6 +17,7 @@ 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_bf_lock_wait : MDEV-24649 galera.galera_bf_lock_wait MTR failed with sigabrt: Assertion `!is_owned()' failed in sync0policy.ic on MutexDebug with Mutex = TTASEventMutex 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 @@ -30,3 +31,4 @@ partition : MDEV-19958 Galera test failure on galera.partition query_cache: MDEV-15805 Test failure on galera.query_cache sql_log_bin : MDEV-21491 galera.sql_log_bin versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch + diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def index 884c2a8c82a..87eca207d5a 100644 --- a/mysql-test/suite/galera_3nodes/disabled.def +++ b/mysql-test/suite/galera_3nodes/disabled.def @@ -20,5 +20,6 @@ galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0 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 -- cgit v1.2.1 From da88e1ec12b0ba39552bf54367c1bb3b89eac4a8 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 10 Feb 2021 23:38:52 -0800 Subject: MDEV-24840 Crash caused by query with IN subquery containing union of two table value costructors This bug affected queries with a [NOT] IN/ANY/ALL subquery whose top level unit contained several table value constructors. The problem appeared because the code of the function Item_subselect::fix_fields() that was responsible for wrapping table value constructors encountered at the top level unit of a [NOT] IN/ANY/ALL subquery did not take into account that the chain of the select objects comprising the unit were not immutable. Approved by Oleksandr Byelkin --- mysql-test/main/table_value_constr.result | 68 +++++++++++++++++++++++++++++++ mysql-test/main/table_value_constr.test | 33 +++++++++++++++ 2 files changed, 101 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result index 69c75ddab75..d7b32865db5 100644 --- a/mysql-test/main/table_value_constr.result +++ b/mysql-test/main/table_value_constr.result @@ -2674,4 +2674,72 @@ values (1,2); values ((select min(a), max(b) from t1)); ERROR 21000: Operand should contain 1 column(s) drop table t1; +# +# MDEV-24840: union of TVCs in IN subquery +# +create table t1 (a int) engine=myisam; +insert into t1 values (3), (7), (1); +select a from t1 where a in (values (7) union values (8)); +a +7 +explain extended select a from t1 where a in (values (7) union values (8)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +4 DEPENDENT SUBQUERY ref key0 key0 4 func 2 100.00 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +5 DEPENDENT UNION ref key0 key0 4 func 2 100.00 +3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,(/* select#4 */ select `tvc_0`.`7` from (values (7)) `tvc_0` where (`test`.`t1`.`a`) = `tvc_0`.`7` union /* select#5 */ select `tvc_0`.`8` from (values (8)) `tvc_0` where (`test`.`t1`.`a`) = `tvc_0`.`8`))) +prepare stmt from "select a from t1 where a in (values (7) union values (8))"; +execute stmt; +a +7 +execute stmt; +a +7 +deallocate prepare stmt; +select a from t1 where a not in (values (7) union values (8)); +a +3 +1 +explain extended select a from t1 where a not in (values (7) union values (8)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +4 DEPENDENT SUBQUERY ALL NULL NULL NULL NULL 2 100.00 Using where +2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +5 DEPENDENT UNION ALL NULL NULL NULL NULL 2 100.00 Using where +3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where !<`test`.`t1`.`a`>((`test`.`t1`.`a`,(/* select#4 */ select `tvc_0`.`7` from (values (7)) `tvc_0` where trigcond((`test`.`t1`.`a`) = `tvc_0`.`7`) union /* select#5 */ select `tvc_0`.`8` from (values (8)) `tvc_0` where trigcond((`test`.`t1`.`a`) = `tvc_0`.`8`)))) +select a from t1 where a < all(values (7) union values (8)); +a +3 +1 +explain extended select a from t1 where a < all(values (7) union values (8)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +4 SUBQUERY ALL NULL NULL NULL NULL 2 100.00 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +5 UNION ALL NULL NULL NULL NULL 2 100.00 +3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a`,(/* select#4 */ select `tvc_0`.`7` from (values (7)) `tvc_0` union /* select#5 */ select `tvc_0`.`8` from (values (8)) `tvc_0`) <= (`test`.`t1`.`a`))) +select a from t1 where a >= any(values (7) union values (8)); +a +7 +explain extended select a from t1 where a >= any(values (7) union values (8)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +4 SUBQUERY ALL NULL NULL NULL NULL 2 100.00 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +5 UNION ALL NULL NULL NULL NULL 2 100.00 +3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a`,(/* select#4 */ select `tvc_0`.`7` from (values (7)) `tvc_0` union /* select#5 */ select `tvc_0`.`8` from (values (8)) `tvc_0`) <= (`test`.`t1`.`a`))) +drop table t1; End of 10.3 tests diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test index e8697bef589..bac85ff75cc 100644 --- a/mysql-test/main/table_value_constr.test +++ b/mysql-test/main/table_value_constr.test @@ -1401,4 +1401,37 @@ values ((select min(a), max(b) from t1)); drop table t1; +--echo # +--echo # MDEV-24840: union of TVCs in IN subquery +--echo # + +create table t1 (a int) engine=myisam; +insert into t1 values (3), (7), (1); + +let $q= +select a from t1 where a in (values (7) union values (8)); +eval $q; +eval explain extended $q; +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +let $q= +select a from t1 where a not in (values (7) union values (8)); +eval $q; +eval explain extended $q; + +let $q= +select a from t1 where a < all(values (7) union values (8)); +eval $q; +eval explain extended $q; + +let $q= +select a from t1 where a >= any(values (7) union values (8)); +eval $q; +eval explain extended $q; + +drop table t1; + --echo End of 10.3 tests -- cgit v1.2.1 From 95003eab451cac2fd2c0552f374a85842f2773f2 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Wed, 10 Feb 2021 14:04:25 +0100 Subject: MDEV-19950: Galera test failure on galera_ssl_upgrade The test requires adaptation for MariaDB, which is done in this patch. In addition, this patch includes a fix for the SST script startup code that adds escaping for special characters on the command line (in case they are contained in the arguments to mysqld). The fix does not require separate tests, as the required tests are already part of the mtr suite for Galera. --- mysql-test/suite/galera/disabled.def | 1 - mysql-test/suite/galera/include/galera_base_port.inc | 8 ++++++++ mysql-test/suite/galera/r/galera_ssl_upgrade.result | 5 +++++ mysql-test/suite/galera/t/galera_ssl_upgrade.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ssl_upgrade.test | 13 ++++++++++++- 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 mysql-test/suite/galera/include/galera_base_port.inc (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 7fee78fa009..054bb7b7693 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -23,7 +23,6 @@ galera_mdl_race : MDEV-21524: galera.galera_mdl_race MTR failed: query 'reap' su 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_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key galera_var_node_address : MDEV-20485 Galera test failure galera_wan : MDEV-17259 Test failure on galera.galera_wan diff --git a/mysql-test/suite/galera/include/galera_base_port.inc b/mysql-test/suite/galera/include/galera_base_port.inc new file mode 100644 index 00000000000..caf986ee950 --- /dev/null +++ b/mysql-test/suite/galera/include/galera_base_port.inc @@ -0,0 +1,8 @@ +# +# Extract base_port from galera node. +# + +# Convert "... base_port = N; ..." to "N; ..." +--let $s1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('base_port =', @@wsrep_provider_options) + LENGTH('base_port = '))` +# Convert "N; ..." to "N" +--let $_NODE_GALERAPORT = `SELECT SUBSTR('$s1', 1, LOCATE(';', '$s1') - 1)` diff --git a/mysql-test/suite/galera/r/galera_ssl_upgrade.result b/mysql-test/suite/galera/r/galera_ssl_upgrade.result index b24671d120d..5d2bfd299fd 100644 --- a/mysql-test/suite/galera/r/galera_ssl_upgrade.result +++ b/mysql-test/suite/galera/r/galera_ssl_upgrade.result @@ -4,12 +4,17 @@ VARIABLE_VALUE = 'Synced' SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +connection node_1; +connection node_2; +connection node_1; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +connection node_2; 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 diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf b/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf index 3fd1c650c05..2954ae0f4cb 100644 --- a/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf +++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem' +wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem' +wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem' diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.test b/mysql-test/suite/galera/t/galera_ssl_upgrade.test index eb5f79c12b4..4784fa784cd 100644 --- a/mysql-test/suite/galera/t/galera_ssl_upgrade.test +++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.test @@ -6,15 +6,26 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_ssl_communication.inc 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'; +# Setup galera ports +--connection node_1 +--source suite/galera/include/galera_base_port.inc +--let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT + +--connection node_2 +--source suite/galera/include/galera_base_port.inc +--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT + # 2. Restart node #1 with a socket.ssl_ca that includes both the new and the old certificate --connection node_1 --source include/shutdown_mysqld.inc ---let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/cakey.pem +--let $restart_noprint = 1 +--let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/galera-key.pem --source include/start_mysqld.inc --source include/wait_until_connected_again.inc -- cgit v1.2.1 From 028ba10d0bd0f66b0d3c49167b67ab2e6061eb64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 12 Feb 2021 09:41:15 +0200 Subject: MDEV-18468 fixup: Make test case robust w.r.t. deferred DROP TABLE --- mysql-test/suite/innodb/r/alter_varchar_change.result | 11 +++++++++-- mysql-test/suite/innodb/t/alter_varchar_change.test | 12 ++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/alter_varchar_change.result b/mysql-test/suite/innodb/r/alter_varchar_change.result index 8ffc6e5cfe2..e7793863ff8 100644 --- a/mysql-test/suite/innodb/r/alter_varchar_change.result +++ b/mysql-test/suite/innodb/r/alter_varchar_change.result @@ -460,11 +460,18 @@ DROP TABLE t1; DROP PROCEDURE get_index_id; DROP PROCEDURE get_table_id; create table t (a varchar(100)) engine=innodb; -select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a'; +select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len +from information_schema.innodb_sys_columns sc +inner join information_schema.innodb_sys_tables st +on sc.table_id=st.table_id where st.name='test/t' and sc.name='a'; name pos mtype prtype len a 0 1 524303 100 alter table t modify a varchar(110), algorithm=inplace; -select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a'; +select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len +from information_schema.innodb_sys_columns sc +inner join information_schema.innodb_sys_tables st +on sc.table_id=st.table_id where st.name='test/t' and sc.name='a'; name pos mtype prtype len a 0 1 524303 110 drop table t; +# End of 10.2 tests diff --git a/mysql-test/suite/innodb/t/alter_varchar_change.test b/mysql-test/suite/innodb/t/alter_varchar_change.test index 6a5719a1ef0..98e32146b99 100644 --- a/mysql-test/suite/innodb/t/alter_varchar_change.test +++ b/mysql-test/suite/innodb/t/alter_varchar_change.test @@ -337,7 +337,15 @@ DROP PROCEDURE get_table_id; # LEN must increase here create table t (a varchar(100)) engine=innodb; -select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a'; +select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len +from information_schema.innodb_sys_columns sc +inner join information_schema.innodb_sys_tables st +on sc.table_id=st.table_id where st.name='test/t' and sc.name='a'; alter table t modify a varchar(110), algorithm=inplace; -select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a'; +select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len +from information_schema.innodb_sys_columns sc +inner join information_schema.innodb_sys_tables st +on sc.table_id=st.table_id where st.name='test/t' and sc.name='a'; drop table t; + +--echo # End of 10.2 tests -- cgit v1.2.1 From 6f3f191cfa434f1be71b42747769114ba31ae567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 12 Feb 2021 09:48:36 +0200 Subject: MDEV-24763 ALTER TABLE fails to rename a column in SYS_FIELDS innobase_rename_column_try(): When renaming SYS_FIELDS records for secondary indexes, try to use both formats of SYS_FIELDS.POS as keys, in case the PRIMARY KEY includes a column prefix. Without this fix, an ALTER TABLE that renames a column followed by a server restart (or LRU eviction of the table definition from dict_sys) would make the table inaccessible. --- mysql-test/suite/innodb/r/alter_table.result | 16 ++++++++++++++++ mysql-test/suite/innodb/t/alter_table.test | 15 +++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/alter_table.result b/mysql-test/suite/innodb/r/alter_table.result index fc08f29e515..ba99119f130 100644 --- a/mysql-test/suite/innodb/r/alter_table.result +++ b/mysql-test/suite/innodb/r/alter_table.result @@ -70,3 +70,19 @@ ERROR HY000: Tablespace has been discarded for table `t` ALTER TABLE t FORCE; ERROR HY000: Tablespace has been discarded for table `t` DROP TABLE t; +# +# MDEV-24763 ALTER TABLE fails to rename a column in SYS_FIELDS +# +CREATE TABLE t1 (a INT, b TEXT, c INT, PRIMARY KEY(b(9)), INDEX(c,a)) +ENGINE=InnoDB; +ALTER TABLE t1 CHANGE COLUMN a u INT; +SELECT sf.* FROM information_schema.innodb_sys_fields sf +INNER JOIN information_schema.innodb_sys_indexes si ON sf.index_id=si.index_id +INNER JOIN information_schema.innodb_sys_tables st ON si.table_id=st.table_id +WHERE st.name='test/t1' ORDER BY pos; +INDEX_ID NAME POS +ID b 0 +ID c 0 +ID u 1 +DROP TABLE t1; +# End of 10.2 tests diff --git a/mysql-test/suite/innodb/t/alter_table.test b/mysql-test/suite/innodb/t/alter_table.test index 5050abdc087..a17b1099dda 100644 --- a/mysql-test/suite/innodb/t/alter_table.test +++ b/mysql-test/suite/innodb/t/alter_table.test @@ -79,3 +79,18 @@ ALTER TABLE t ENGINE INNODB; --error ER_TABLESPACE_DISCARDED ALTER TABLE t FORCE; DROP TABLE t; + +--echo # +--echo # MDEV-24763 ALTER TABLE fails to rename a column in SYS_FIELDS +--echo # +CREATE TABLE t1 (a INT, b TEXT, c INT, PRIMARY KEY(b(9)), INDEX(c,a)) +ENGINE=InnoDB; +ALTER TABLE t1 CHANGE COLUMN a u INT; +--replace_column 1 ID +SELECT sf.* FROM information_schema.innodb_sys_fields sf +INNER JOIN information_schema.innodb_sys_indexes si ON sf.index_id=si.index_id +INNER JOIN information_schema.innodb_sys_tables st ON si.table_id=st.table_id +WHERE st.name='test/t1' ORDER BY pos; +DROP TABLE t1; + +--echo # End of 10.2 tests -- cgit v1.2.1 From da3211e48743d143224ddc2334ac8a01942ecae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 12 Feb 2021 14:03:25 +0200 Subject: MDEV-24763 fixup: Use deterministic ORDER BY --- mysql-test/suite/innodb/r/alter_table.result | 2 +- mysql-test/suite/innodb/t/alter_table.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/alter_table.result b/mysql-test/suite/innodb/r/alter_table.result index ba99119f130..46162c167da 100644 --- a/mysql-test/suite/innodb/r/alter_table.result +++ b/mysql-test/suite/innodb/r/alter_table.result @@ -79,7 +79,7 @@ ALTER TABLE t1 CHANGE COLUMN a u INT; SELECT sf.* FROM information_schema.innodb_sys_fields sf INNER JOIN information_schema.innodb_sys_indexes si ON sf.index_id=si.index_id INNER JOIN information_schema.innodb_sys_tables st ON si.table_id=st.table_id -WHERE st.name='test/t1' ORDER BY pos; +WHERE st.name='test/t1' ORDER BY sf.index_id,sf.pos; INDEX_ID NAME POS ID b 0 ID c 0 diff --git a/mysql-test/suite/innodb/t/alter_table.test b/mysql-test/suite/innodb/t/alter_table.test index a17b1099dda..5c06388cdba 100644 --- a/mysql-test/suite/innodb/t/alter_table.test +++ b/mysql-test/suite/innodb/t/alter_table.test @@ -90,7 +90,7 @@ ALTER TABLE t1 CHANGE COLUMN a u INT; SELECT sf.* FROM information_schema.innodb_sys_fields sf INNER JOIN information_schema.innodb_sys_indexes si ON sf.index_id=si.index_id INNER JOIN information_schema.innodb_sys_tables st ON si.table_id=st.table_id -WHERE st.name='test/t1' ORDER BY pos; +WHERE st.name='test/t1' ORDER BY sf.index_id,sf.pos; DROP TABLE t1; --echo # End of 10.2 tests -- cgit v1.2.1 From cb4434c44aa045256543c0a027b04e2ecb9c717d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Sat, 13 Feb 2021 10:28:10 +0200 Subject: MDEV-24856 : Server crashes when wsrep_provider_options set to NULL Null pointer reference to wsrep_provider_options variable. Fixed by adding condition and error handling. --- .../suite/galera/r/galera_var_wsrep_provider_options.result | 10 ++++++++++ .../suite/galera/t/galera_var_wsrep_provider_options.test | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 mysql-test/suite/galera/r/galera_var_wsrep_provider_options.result create mode 100644 mysql-test/suite/galera/t/galera_var_wsrep_provider_options.test (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/galera_var_wsrep_provider_options.result b/mysql-test/suite/galera/r/galera_var_wsrep_provider_options.result new file mode 100644 index 00000000000..5ef4a23fd90 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_var_wsrep_provider_options.result @@ -0,0 +1,10 @@ +connection node_2; +connection node_1; +call mtr.add_suppression("WSREP: Unknown parameter 'a'"); +call mtr.add_suppression("WSREP: Set options returned 7"); +SET GLOBAL wsrep_provider_options=NULL; +ERROR HY000: Incorrect arguments to SET +SET GLOBAL wsrep_provider_options=''; +SET GLOBAL wsrep_provider_options=' '; +SET GLOBAL wsrep_provider_options='a=1'; +ERROR HY000: Incorrect arguments to SET diff --git a/mysql-test/suite/galera/t/galera_var_wsrep_provider_options.test b/mysql-test/suite/galera/t/galera_var_wsrep_provider_options.test new file mode 100644 index 00000000000..3dc2cbaa7d6 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_var_wsrep_provider_options.test @@ -0,0 +1,11 @@ +--source include/galera_cluster.inc + +call mtr.add_suppression("WSREP: Unknown parameter 'a'"); +call mtr.add_suppression("WSREP: Set options returned 7"); + +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_provider_options=NULL; +SET GLOBAL wsrep_provider_options=''; +SET GLOBAL wsrep_provider_options=' '; +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_provider_options='a=1'; -- cgit v1.2.1 From 23833dce05268b1b1c4e1acf3f1b0819c3dc062f Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Fri, 12 Feb 2021 11:28:42 +0300 Subject: MDEV-24792 Assertion `!newest_lsn || fil_page_get_type(page)' failed upon MariaBackup prepare in buf_flush_init_for_writing with innodb_log_optimize_ddl=off fsp_free_page() writes MLOG_INIT_FREE_PAGE, but does not update page type. But fil_crypt_rotate_page() checks the type to understand if the page is freshly initialized, and writes dummy record(updates space id) to force rotation during recovery. This dummy record causes assertion crash when the page is flushed after recovery, as it's supposed that pages LSN is 0 for freshly initialized pages. The bug is similiar to MDEV-24695, the difference is that in 10.5 the assertion crashes during log record applying, but in 10.4 it crashes during page flushing. The fix could be in marking page as freed and not writing dummy record during keys rotation procedure for such marked pages. But bpage->file_page_was_freed is not consistent enough for release builds in 10.4, and the issue is fixed in 10.5 and does not exist in 10.[23] as MLOG_INIT_FREE_PAGE was introduced since 10.4. So the better solution is just to relax the assertion and implement some additional property for freshly allocated pages, and check this property during pages flushing. The test is copied from MDEV-24695, the only change is in forcing pages flushing after each server start to cause crash in non-fixed code. There is no need to merge it to 10.5+, as the bug is already fixed by MDEV-24695. --- .../suite/encryption/r/innodb_encrypt_freed.result | 100 +++++++++++++++++ .../suite/encryption/t/innodb_encrypt_freed.opt | 5 + .../suite/encryption/t/innodb_encrypt_freed.test | 121 +++++++++++++++++++++ .../suite/encryption/t/innodb_encryption.test | 2 +- 4 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/encryption/r/innodb_encrypt_freed.result create mode 100644 mysql-test/suite/encryption/t/innodb_encrypt_freed.opt create mode 100644 mysql-test/suite/encryption/t/innodb_encrypt_freed.test (limited to 'mysql-test') diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_freed.result b/mysql-test/suite/encryption/r/innodb_encrypt_freed.result new file mode 100644 index 00000000000..c0d8b770403 --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb_encrypt_freed.result @@ -0,0 +1,100 @@ +SHOW VARIABLES LIKE 'innodb_encrypt%'; +Variable_name Value +innodb_encrypt_log ON +innodb_encrypt_tables ON +innodb_encrypt_temporary_tables OFF +innodb_encryption_rotate_key_age 1 +innodb_encryption_rotation_iops 100 +innodb_encryption_threads 1 +SET GLOBAL innodb_encrypt_tables = ON; +CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, +f3 int not null, index(f1), index idx_1(f2), +index(f2, f3)) ENGINE=InnoDB; +# Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +CREATE TABLE t2 (f1 int not null)engine=innodb; +# restart: --debug=d,ib_log_checkpoint_avoid +SET GLOBAL innodb_log_checkpoint_now=TRUE; +connect con1,localhost,root,,,; +begin; +insert into t2 values(1); +connection default; +set global innodb_encrypt_tables = OFF; +# 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; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +test/t2 +alter table t1 drop index idx_1; +set global innodb_encrypt_tables = ON; +# Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +test/t2 +disconnect con1; +# restart: --debug=d,ib_log_checkpoint_avoid +SET GLOBAL innodb_log_checkpoint_now=TRUE; +drop table t1, t2; +CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, +f3 int not null, index(f1), index idx_1(f2), +index(f2, f3)) ENGINE=InnoDB; +# Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +CREATE TABLE t2 (f1 int not null)engine=innodb; +# restart: --debug=d,ib_log_checkpoint_avoid +SET GLOBAL innodb_log_checkpoint_now=TRUE; +connect con1,localhost,root,,,; +begin; +insert into t2 values(1); +connection default; +set global innodb_encrypt_tables = OFF; +# 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; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +test/t2 +alter table t1 drop index idx_1; +disconnect con1; +# restart: --debug=d,ib_log_checkpoint_avoid +SET GLOBAL innodb_log_checkpoint_now=TRUE; +connect con1,localhost,root,,,; +begin; +insert into t2 values(1); +connection default; +set global innodb_encrypt_tables = ON; +# Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +test/t2 +disconnect con1; +drop table t2, t1; diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_freed.opt b/mysql-test/suite/encryption/t/innodb_encrypt_freed.opt new file mode 100644 index 00000000000..f6f932c680d --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb_encrypt_freed.opt @@ -0,0 +1,5 @@ +--innodb-encrypt-tables +--innodb-encrypt-log +--innodb-encryption-threads=1 +--innodb-tablespaces-encryption +--innodb-log-optimize-ddl=OFF diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_freed.test b/mysql-test/suite/encryption/t/innodb_encrypt_freed.test new file mode 100644 index 00000000000..951fc93eef5 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb_encrypt_freed.test @@ -0,0 +1,121 @@ +--source include/have_innodb.inc +--source include/have_example_key_management_plugin.inc +--source include/have_debug.inc +--source include/not_embedded.inc + +SHOW VARIABLES LIKE 'innodb_encrypt%'; + +SET GLOBAL innodb_encrypt_tables = ON; + +CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, + f3 int not null, index(f1), index idx_1(f2), + index(f2, f3)) ENGINE=InnoDB; +--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--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 +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +CREATE TABLE t2 (f1 int not null)engine=innodb; +let $restart_parameters="--debug=d,ib_log_checkpoint_avoid"; +--source include/restart_mysqld.inc +SET GLOBAL innodb_log_checkpoint_now=TRUE; + +# Stop the purge +connect(con1,localhost,root,,,); +begin; +insert into t2 values(1); + +connection default; + +--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +set global innodb_encrypt_tables = OFF; + +--echo # Wait max 10 min for key encryption threads to decrypt all spaces +--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 +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + +# Free the index `idx_1` +alter table t1 drop index idx_1; + +set global innodb_encrypt_tables = ON; + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--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 +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +disconnect con1; +let $shutdown_timeout=0; +--source include/restart_mysqld.inc +SET GLOBAL innodb_log_checkpoint_now=TRUE; + +drop table t1, t2; + +# +# +CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, + f3 int not null, index(f1), index idx_1(f2), + index(f2, f3)) ENGINE=InnoDB; +--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--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 +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +CREATE TABLE t2 (f1 int not null)engine=innodb; +--source include/restart_mysqld.inc +SET GLOBAL innodb_log_checkpoint_now=TRUE; + +# Stop the purge +connect(con1,localhost,root,,,); +begin; +insert into t2 values(1); + +connection default; + +--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +set global innodb_encrypt_tables = OFF; + +--echo # Wait max 10 min for key encryption threads to decrypt all spaces +--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 +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + +# Free the index `idx_1` +alter table t1 drop index idx_1; + +disconnect con1; +--source include/restart_mysqld.inc +SET GLOBAL innodb_log_checkpoint_now=TRUE; + +# Stop the purge +connect(con1,localhost,root,,,); +begin; +insert into t2 values(1); + +connection default; +set global innodb_encrypt_tables = ON; + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--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 +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +disconnect con1; +drop table t2, t1; diff --git a/mysql-test/suite/encryption/t/innodb_encryption.test b/mysql-test/suite/encryption/t/innodb_encryption.test index a1abfb51462..1c8d200458a 100644 --- a/mysql-test/suite/encryption/t/innodb_encryption.test +++ b/mysql-test/suite/encryption/t/innodb_encryption.test @@ -14,7 +14,7 @@ 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 $tables_count= `select count(*) + @@global.innodb_undo_tablespaces + 1 from information_schema.tables where engine = 'InnoDB'` --echo # Wait max 10 min for key encryption threads to encrypt all spaces --let $wait_timeout= 600 -- cgit v1.2.1 From af31e2c55d569de343b2b855131e73c0138e7c2d Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 14 Feb 2021 17:42:19 +0200 Subject: MDEV-23843 Assertions in Diagnostics_area upon table operations under FTWRL 2 different problems: - MYSQL_BIN_LOG::write() did not check if mdl_context.acquire_lock() failed - Sql_cmd_optimize_table::execute() and Sql_cmd_repair_table::execute() called write_bin_log(), which could fail if sql_admin() had already called my_eof() Fixed by adding check for aquire_lock() return status and protect write_bin_log() in the above two functions with set_overwrite_status(). --- mysql-test/main/flush_and_binlog.result | 22 ++++++++++++++++++++++ mysql-test/main/flush_and_binlog.test | 29 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 mysql-test/main/flush_and_binlog.result create mode 100644 mysql-test/main/flush_and_binlog.test (limited to 'mysql-test') diff --git a/mysql-test/main/flush_and_binlog.result b/mysql-test/main/flush_and_binlog.result new file mode 100644 index 00000000000..b9560964046 --- /dev/null +++ b/mysql-test/main/flush_and_binlog.result @@ -0,0 +1,22 @@ +# +# MDEV-23843 Assertions in Diagnostics_area upon table operations under +# FTWRL +# +CREATE TABLE t1 (a INT); +FLUSH TABLES WITH READ LOCK; +connect con1,localhost,root,,; +SET lock_wait_timeout= 1; +OPTIMIZE TABLE t1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +disconnect con1; +connection default; +UNLOCK TABLES; +DROP TABLE t1; +FLUSH TABLES WITH READ LOCK; +connect con1,localhost,root,,test; +SET lock_wait_timeout= 1; +FLUSH TABLES; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +disconnect con1; +unlock tables; diff --git a/mysql-test/main/flush_and_binlog.test b/mysql-test/main/flush_and_binlog.test new file mode 100644 index 00000000000..373b900b451 --- /dev/null +++ b/mysql-test/main/flush_and_binlog.test @@ -0,0 +1,29 @@ +--source include/have_log_bin.inc + +--echo # +--echo # MDEV-23843 Assertions in Diagnostics_area upon table operations under +--echo # FTWRL +--echo # + +CREATE TABLE t1 (a INT); +FLUSH TABLES WITH READ LOCK; +--connect (con1,localhost,root,,) +SET lock_wait_timeout= 1; +--error ER_LOCK_WAIT_TIMEOUT +OPTIMIZE TABLE t1; +# Cleanup +--disconnect con1 +--connection default +UNLOCK TABLES; +DROP TABLE t1; +# +# Second test case from MDEV_23843 +# +FLUSH TABLES WITH READ LOCK; +--connect (con1,localhost,root,,test) +SET lock_wait_timeout= 1; +--error ER_LOCK_WAIT_TIMEOUT +FLUSH TABLES; +--connection default +--disconnect con1 +unlock tables; -- cgit v1.2.1 From 6f142306438f812fbfb6df94c6dd1ebfd5f5c548 Mon Sep 17 00:00:00 2001 From: Alice Sherepa Date: Mon, 15 Feb 2021 13:41:44 +0100 Subject: MDEV-11862 rpl.rpl_semi_sync_event_after_sync 'fails if there is no semisync plugin --- mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test | 1 + mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test | 1 + mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync.test | 1 + 3 files changed, 3 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test index 2d91d2e4118..f8726deb61d 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test @@ -1,4 +1,5 @@ --source include/have_binlog_format_statement.inc +--source include/have_semisync.inc set global rpl_semi_sync_master_wait_point=AFTER_SYNC; source rpl_semi_sync.test; set global rpl_semi_sync_master_wait_point=default; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test index 47af6c34fcf..3e89bed640b 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test @@ -1,4 +1,5 @@ --source include/have_binlog_format_row.inc +--source include/have_semisync.inc set global rpl_semi_sync_master_wait_point=AFTER_SYNC; source rpl_semi_sync.test; set global rpl_semi_sync_master_wait_point=default; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync.test index 527900fd949..9bca4965f15 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event_after_sync.test @@ -1,3 +1,4 @@ +source include/have_semisync.inc; set global rpl_semi_sync_master_wait_point=AFTER_SYNC; source rpl_semi_sync_event.test; set global rpl_semi_sync_master_wait_point=default; -- cgit v1.2.1 From e926964cb8c2ddad2304adc3ff5739a3bb91aea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 15 Feb 2021 18:04:17 +0200 Subject: Remove useless test innodb.innodb_bug60049 The test innodb.innodb_bug60049 used to check that the record (ID,NAME)=(12,'SYS_FOREIGN_COLS') is the last record in the secondary index of the system table SYS_TABLES. But, ever since commit 233655842374e0723d3191febac7ff2a11470fba or mysql/mysql-server@082d59670f2616f68af37666fac0f23dbeb43099 that record no longer is the last one in the table! The more recent test innodb.purge_secondary covers the purge functionality much better. --- mysql-test/suite/innodb/r/innodb_bug60049.result | 8 ---- .../suite/innodb/t/innodb_bug60049-master.opt | 1 - mysql-test/suite/innodb/t/innodb_bug60049.test | 49 ---------------------- 3 files changed, 58 deletions(-) delete mode 100644 mysql-test/suite/innodb/r/innodb_bug60049.result delete mode 100644 mysql-test/suite/innodb/t/innodb_bug60049-master.opt delete mode 100644 mysql-test/suite/innodb/t/innodb_bug60049.test (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/innodb_bug60049.result b/mysql-test/suite/innodb/r/innodb_bug60049.result deleted file mode 100644 index f34ebc0a955..00000000000 --- a/mysql-test/suite/innodb/r/innodb_bug60049.result +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE t(a INT)ENGINE=InnoDB STATS_PERSISTENT=0; -RENAME TABLE t TO u; -DROP TABLE u; -SELECT @@innodb_fast_shutdown; -@@innodb_fast_shutdown -0 -Last record of ID_IND root page (9): -18080000180500c0000000000000000c5359535f464f524549474e5f434f4c53 diff --git a/mysql-test/suite/innodb/t/innodb_bug60049-master.opt b/mysql-test/suite/innodb/t/innodb_bug60049-master.opt deleted file mode 100644 index 22a5d4ed221..00000000000 --- a/mysql-test/suite/innodb/t/innodb_bug60049-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb_fast_shutdown=0 diff --git a/mysql-test/suite/innodb/t/innodb_bug60049.test b/mysql-test/suite/innodb/t/innodb_bug60049.test deleted file mode 100644 index cb05ca297ea..00000000000 --- a/mysql-test/suite/innodb/t/innodb_bug60049.test +++ /dev/null @@ -1,49 +0,0 @@ -# Bug #60049 Verify that purge leaves no garbage in unique secondary indexes -# This test requires a fresh server start-up and a slow shutdown. -# This was a suspected bug (not a bug). - --- source include/not_embedded.inc --- source include/have_innodb.inc --- source include/have_innodb_16k.inc - --- disable_query_log -call mtr.add_suppression('\\[ERROR\\] InnoDB: Table `mysql`.`innodb_(table|index)_stats` not found'); -call mtr.add_suppression('\\[ERROR\\] InnoDB: Fetch of persistent statistics requested for table `mysql`.`gtid_executed`'); - -let $create1 = query_get_value(SHOW CREATE TABLE mysql.innodb_table_stats, Create Table, 1); -let $create2 = query_get_value(SHOW CREATE TABLE mysql.innodb_index_stats, Create Table, 1); -DROP TABLE mysql.innodb_index_stats; -DROP TABLE mysql.innodb_table_stats; --- enable_query_log - -CREATE TABLE t(a INT)ENGINE=InnoDB STATS_PERSISTENT=0; -RENAME TABLE t TO u; -DROP TABLE u; -SELECT @@innodb_fast_shutdown; -let $MYSQLD_DATADIR=`select @@datadir`; - ---source include/shutdown_mysqld.inc - -# Check the tail of ID_IND (SYS_TABLES.ID) -let IBDATA1=$MYSQLD_DATADIR/ibdata1; -perl; -my $file = $ENV{'IBDATA1'}; -open(FILE, "<$file") || die "Unable to open $file"; -# Read DICT_HDR_TABLE_IDS, the root page number of ID_IND (SYS_TABLES.ID). -seek(FILE, 7*16384+38+36, 0) || die "Unable to seek $file"; -die unless read(FILE, $_, 4) == 4; -my $sys_tables_id_root = unpack("N", $_); -print "Last record of ID_IND root page ($sys_tables_id_root):\n"; -# This should be the last record in ID_IND. Dump it in hexadecimal. -seek(FILE, $sys_tables_id_root*16384 + 152, 0) || die "Unable to seek $file"; -read(FILE, $_, 32) || die "Unable to read $file"; -close(FILE); -print unpack("H*", $_), "\n"; -EOF - ---source include/start_mysqld.inc - --- disable_query_log -USE mysql; -eval $create1; -eval $create2; -- cgit v1.2.1 From a461e4d306bc53134cefa0eeeb624f3d9eba70f8 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Tue, 9 Feb 2021 20:27:21 +0530 Subject: MDEV-19474: Histogram statistics are used even with optimizer_use_condition_selectivity=3 The issue here was histogram statistics were being used even when the level of optimizer_use_condition_selectivity doesn't allow usage of statistics from histogram. The histogram statistics are read for a table only when optimizer_use_condition_selectivity > 3. But the TABLE structure can be stored in the internal table cache and be reused for the next query. So in this case the histogram statistics will be available for the next query. The fix would be to make sure to use the histogram statistics only when optimizer_use_condition_selectivity > 3. --- mysql-test/r/selectivity.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/r/selectivity_innodb.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/t/selectivity.test | 27 +++++++++++++++++++++++++++ 3 files changed, 95 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index 4d45d6b175b..0f519c53f3e 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -1910,5 +1910,39 @@ HEX(a) b set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set histogram_size=@save_histogram_size; DROP TABLE t1; +# +# MDEV-19474: Histogram statistics are used even with optimizer_use_condition_selectivity=3 +# +CREATE TABLE t1(a int); +INSERT INTO t1 values (1),(2),(2),(3),(4); +SET optimizer_use_condition_selectivity=4; +SET histogram_size= 255; +set use_stat_tables='preferably'; +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 39.84 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +SET optimizer_use_condition_selectivity=3; +# filtered should show 25 % +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +FLUSH TABLES; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; +DROP TABLE t1; # End of 10.2 tests set @@global.histogram_size=@save_histogram_size; diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index b97bbf8153f..5452919aa6d 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -1920,6 +1920,40 @@ HEX(a) b set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set histogram_size=@save_histogram_size; DROP TABLE t1; +# +# MDEV-19474: Histogram statistics are used even with optimizer_use_condition_selectivity=3 +# +CREATE TABLE t1(a int); +INSERT INTO t1 values (1),(2),(2),(3),(4); +SET optimizer_use_condition_selectivity=4; +SET histogram_size= 255; +set use_stat_tables='preferably'; +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 39.84 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +SET optimizer_use_condition_selectivity=3; +# filtered should show 25 % +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +FLUSH TABLES; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; +DROP TABLE t1; # End of 10.2 tests set @@global.histogram_size=@save_histogram_size; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test index b4f535f1584..4d7dcdc9781 100644 --- a/mysql-test/t/selectivity.test +++ b/mysql-test/t/selectivity.test @@ -1302,6 +1302,33 @@ set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivi set histogram_size=@save_histogram_size; DROP TABLE t1; +--echo # +--echo # MDEV-19474: Histogram statistics are used even with optimizer_use_condition_selectivity=3 +--echo # + +CREATE TABLE t1(a int); +INSERT INTO t1 values (1),(2),(2),(3),(4); +SET optimizer_use_condition_selectivity=4; +SET histogram_size= 255; + +set use_stat_tables='preferably'; + +ANALYZE TABLE t1 PERSISTENT FOR ALL; + +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +SET optimizer_use_condition_selectivity=3; + +--echo # filtered should show 25 % +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +FLUSH TABLES; + +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; + +DROP TABLE t1; + --echo # End of 10.2 tests # -- cgit v1.2.1 From 7e9a6b7f09bfb00e781d8ca63dfe7701900c368b Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Mon, 15 Feb 2021 16:28:44 +0530 Subject: MDEV-24779: main.subselect fails in buildbot with --ps-protocol Follow-up fix to commit 26f5033(MDEV-23449) The GROUP BY clause inside IN/ALL/ANY subquery is removed when there is no aggregate function or HAVING clause in the subquery. When the GROUP BY clause is removed, a subquery can also be removed if it part of the GROUP BY clause. This is done inside the function remove_redundant_subquery_clauses. Here we walk over the GROUP BY list and remove a subselect from its unit via the callback function eliminate_subselect_processor. The issue here was that when the query was being re-executed it was trying to reinitialize the select that was removed as stated above. This is not required, so the fix would be to remove select_lex both from tree lex structure and the global list of nodes so that we don't do the reinitialization again. --- mysql-test/r/ps.result | 12 ++++++++++++ mysql-test/t/ps.test | 10 ++++++++++ 2 files changed, 22 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 8d4b52e1b2e..076c7d9abda 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -5390,5 +5390,17 @@ ERROR HY000: Default/ignore value is not supported for such parameter usage EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING 0; Database # +# MDEV-24779: main.subselect fails in buildbot with --ps-protocol +# +CREATE TABLE t1(a INT); +PREPARE stmt FROM "SELECT EXISTS(SELECT 1 FROM t1 GROUP BY a IN (select a from t1))"; +EXECUTE stmt; +EXISTS(SELECT 1 FROM t1 GROUP BY a IN (select a from t1)) +0 +EXECUTE stmt; +EXISTS(SELECT 1 FROM t1 GROUP BY a IN (select a from t1)) +0 +DROP TABLE t1; +# # End of 10.2 tests # diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 90af3ff7ce1..1b1f88094ff 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -4902,6 +4902,16 @@ DROP TABLE t1; EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING DEFAULT; EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING 0; +--echo # +--echo # MDEV-24779: main.subselect fails in buildbot with --ps-protocol +--echo # + +CREATE TABLE t1(a INT); +PREPARE stmt FROM "SELECT EXISTS(SELECT 1 FROM t1 GROUP BY a IN (select a from t1))"; +EXECUTE stmt; +EXECUTE stmt; +DROP TABLE t1; + --echo # --echo # End of 10.2 tests --echo # -- cgit v1.2.1 From 3544643f0999081dcea022b67ecf7758c37b3ce9 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Mon, 15 Feb 2021 16:30:55 +0530 Subject: MDEV-23291: SUM column from a derived table returns invalid values The issue here was the read_set bitmap was not set for a field which was used as a reference in an inner select. We need to make sure that if we are in an inner select and we have references from outer select then we update the table bitmaps for such references. Introduced a function in the class Item_subselect that would update bitmaps of table for the references within a subquery that are defined in outer selects. --- mysql-test/r/view.result | 15 +++++++++++++++ mysql-test/t/view.test | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index e48a99f6aff..ef4f0a48534 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -6818,5 +6818,20 @@ DROP PROCEDURE sp1; DROP VIEW v1; DROP TABLE t1, t2; # +# MDEV-23291: SUM column from a derived table returns invalid values +# +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2); +CREATE view v1 AS +SELECT a as x, (select x) as y, (select y) as z FROM t1; +SELECT sum(z) FROM (SELECT a as x, (select x) as y, (select y) as z FROM t1) q; +sum(z) +3 +SELECT sum(z) FROM v1; +sum(z) +3 +DROP TABLE t1; +DROP VIEW v1; +# # End of 10.2 tests # diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index b5ce6a1cabf..8cb00f7a6f4 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -6543,6 +6543,22 @@ DROP PROCEDURE sp1; DROP VIEW v1; DROP TABLE t1, t2; +--echo # +--echo # MDEV-23291: SUM column from a derived table returns invalid values +--echo # + +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2); + +CREATE view v1 AS +SELECT a as x, (select x) as y, (select y) as z FROM t1; + +SELECT sum(z) FROM (SELECT a as x, (select x) as y, (select y) as z FROM t1) q; +SELECT sum(z) FROM v1; + +DROP TABLE t1; +DROP VIEW v1; + --echo # --echo # End of 10.2 tests --echo # -- cgit v1.2.1 From a5bcec727b096f634e43f9031440cc1dc9e302c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 16 Feb 2021 08:46:14 +0200 Subject: MDEV-24865 : Server crashes when truncate mysql user table For truncate we try to find out possible foreign key tables using open_tables. However, table_list was not cleaned up properly and there was no error handling. Fixed by cleaning table_list and adding proper error handling. --- mysql-test/suite/galera/r/galera_truncate.result | 11 +++++++++++ mysql-test/suite/galera/t/galera_truncate.test | 20 ++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/galera_truncate.result b/mysql-test/suite/galera/r/galera_truncate.result index c649d9bbaf9..c9a4bc854f8 100644 --- a/mysql-test/suite/galera/r/galera_truncate.result +++ b/mysql-test/suite/galera/r/galera_truncate.result @@ -32,6 +32,17 @@ SELECT AUTO_INCREMENT = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME IN ('t AUTO_INCREMENT = 1 1 1 +connection node_1; +TRUNCATE TABLE mysql.user; +ERROR 42S02: Table 'mysql.user' doesn't exist +TRUNCATE TABLE performance_schema.threads; +ERROR HY000: Invalid performance_schema usage +TRUNCATE TABLE information_schema.tables; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +TRUNCATE TABLE mysql.innodb_index_stats; +TRUNCATE TABLE foo.bar; +ERROR 42S02: Table 'foo.bar' doesn't exist +TRUNCATE TABLE t1; DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; diff --git a/mysql-test/suite/galera/t/galera_truncate.test b/mysql-test/suite/galera/t/galera_truncate.test index 3c3ee56a23f..c3dd02017bb 100644 --- a/mysql-test/suite/galera/t/galera_truncate.test +++ b/mysql-test/suite/galera/t/galera_truncate.test @@ -3,8 +3,7 @@ # --source include/galera_cluster.inc ---source include/have_innodb.inc - +--source include/have_perfschema.inc # # Simple case # @@ -54,6 +53,23 @@ TRUNCATE TABLE t4; --connection node_2 SELECT AUTO_INCREMENT = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME IN ('t3', 't4'); + +# +# MDEV-24865 : Server crashes when truncate mysql user table +# +--connection node_1 + +--error ER_NO_SUCH_TABLE +TRUNCATE TABLE mysql.user; +--error ER_WRONG_PERFSCHEMA_USAGE +TRUNCATE TABLE performance_schema.threads; +--error ER_DBACCESS_DENIED_ERROR +TRUNCATE TABLE information_schema.tables; +TRUNCATE TABLE mysql.innodb_index_stats; +--error ER_NO_SUCH_TABLE +TRUNCATE TABLE foo.bar; +TRUNCATE TABLE t1; + DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; -- cgit v1.2.1 From 067465cd2f019e66274e7726004ebca985e450d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 16 Feb 2021 12:07:48 +0200 Subject: MDEV-15641 fixup: Make the test faster Let us avoid the excessive allocation of explicit record locks (a work-around of MDEV-24813) so that the test will execute much faster under AddressSanitizer, MemorySanitizer, Valgrind. --- mysql-test/suite/innodb/r/alter_large_dml.result | 10 ++-------- mysql-test/suite/innodb/t/alter_large_dml.test | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/alter_large_dml.result b/mysql-test/suite/innodb/r/alter_large_dml.result index 056e8fdd768..41f497a5591 100644 --- a/mysql-test/suite/innodb/r/alter_large_dml.result +++ b/mysql-test/suite/innodb/r/alter_large_dml.result @@ -14,16 +14,10 @@ SET DEBUG_SYNC = 'now SIGNAL dml_pause'; SET DEBUG_SYNC = 'now WAIT_FOR dml_restart'; ROLLBACK; BEGIN; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; +INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_81920; ROLLBACK; BEGIN; -INSERT INTO t1 SELECT * FROM t1; -INSERT INTO t1 SELECT * FROM t1; -INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_114688; ROLLBACK; SET DEBUG_SYNC = 'now SIGNAL dml_done'; connect con2, localhost,root,,test; diff --git a/mysql-test/suite/innodb/t/alter_large_dml.test b/mysql-test/suite/innodb/t/alter_large_dml.test index 5ab3f394115..54f5f171f05 100644 --- a/mysql-test/suite/innodb/t/alter_large_dml.test +++ b/mysql-test/suite/innodb/t/alter_large_dml.test @@ -25,17 +25,11 @@ SET DEBUG_SYNC = 'now WAIT_FOR dml_restart'; ROLLBACK; BEGIN; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; +INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_81920; ROLLBACK; BEGIN; -INSERT INTO t1 SELECT * FROM t1; -INSERT INTO t1 SELECT * FROM t1; -INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_114688; ROLLBACK; SET DEBUG_SYNC = 'now SIGNAL dml_done'; -- cgit v1.2.1 From 4d300ab1a88bee613be1bcd75153a9ce6d63cbee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 16 Feb 2021 11:52:50 +0200 Subject: MDEV-24867 : wsrep.variables MTR failed: Result length mismatch Stabilize test case. --- mysql-test/suite/wsrep/r/variables.result | 10 ---------- mysql-test/suite/wsrep/t/variables.test | 6 ++---- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result index 9ef1b3290af..01f5355cbad 100644 --- a/mysql-test/suite/wsrep/r/variables.result +++ b/mysql-test/suite/wsrep/r/variables.result @@ -136,16 +136,6 @@ drop user test@localhost; # SET @wsrep_sst_auth_saved= @@global.wsrep_sst_auth; SET @@global.wsrep_sst_auth= 'user:pass'; -SELECT @@global.wsrep_sst_auth; -@@global.wsrep_sst_auth -******** SET @@global.wsrep_sst_auth= ''; -SELECT @@global.wsrep_sst_auth; -@@global.wsrep_sst_auth -NULL SET @@global.wsrep_sst_auth= NULL; -SELECT @@global.wsrep_sst_auth; -@@global.wsrep_sst_auth -NULL -SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved; # End of test. diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test index 5ab0eb68505..f815c0edf0f 100644 --- a/mysql-test/suite/wsrep/t/variables.test +++ b/mysql-test/suite/wsrep/t/variables.test @@ -152,15 +152,13 @@ drop user test@localhost; --echo # SET @wsrep_sst_auth_saved= @@global.wsrep_sst_auth; SET @@global.wsrep_sst_auth= 'user:pass'; -SELECT @@global.wsrep_sst_auth; SET @@global.wsrep_sst_auth= ''; -SELECT @@global.wsrep_sst_auth; SET @@global.wsrep_sst_auth= NULL; -SELECT @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved; # Reset (for mtr internal checks) --disable_query_log + +SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved; SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved; eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved; -- cgit v1.2.1 From 8db5274dce7f8710b25ca954559843c9cd812ac5 Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 21 Feb 2021 20:38:32 +0200 Subject: MDEV-22703 DEFAULT() on a BLOB column can overwrite the default record This can cause crashes when accessing already released memory The issue was the Item_default created a internal field, pointing to share->default_values, to be used with the DEFAULT() function. This does not work for BLOB fields as these are freed at end of query. Fixed by storing BLOB field data inside and area allocated by Item_default_value, like we do for nondeterministic default values. --- mysql-test/main/default.result | 15 +++++++++++++++ mysql-test/main/default.test | 19 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/main/default.result b/mysql-test/main/default.result index cf0788b2fb2..f5ee1474b94 100644 --- a/mysql-test/main/default.result +++ b/mysql-test/main/default.result @@ -3390,3 +3390,18 @@ ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ERROR 42S22: Unknown column 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' in 'DEFAULT' DROP TABLE t1; # end of 10.2 test +# +# MDEV-22703 DEFAULT() on a BLOB column can overwrite the default +# record, which can cause crashes when accessing already released +# memory. +# +CREATE TEMPORARY TABLE t1 (h POINT DEFAULT ST_GEOMFROMTEXT('Point(1 1)')) ENGINE=InnoDB; +INSERT INTO t1 () VALUES (),(); +ALTER TABLE t1 FORCE; +SELECT DEFAULT(h) FROM t1; +SELECT length(DEFAULT(h)) FROM t1; +length(DEFAULT(h)) +25 +25 +INSERT INTO t1 () VALUES (); +drop table t1; diff --git a/mysql-test/main/default.test b/mysql-test/main/default.test index 27e38eeeb49..c0561deac67 100644 --- a/mysql-test/main/default.test +++ b/mysql-test/main/default.test @@ -1,3 +1,5 @@ +--source include/have_innodb.inc + # # test of already fixed bugs # @@ -2107,5 +2109,20 @@ CREATE OR REPLACE TABLE t1(i int); ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`; DROP TABLE t1; - --echo # end of 10.2 test + +--echo # +--echo # MDEV-22703 DEFAULT() on a BLOB column can overwrite the default +--echo # record, which can cause crashes when accessing already released +--echo # memory. +--echo # + +CREATE TEMPORARY TABLE t1 (h POINT DEFAULT ST_GEOMFROMTEXT('Point(1 1)')) ENGINE=InnoDB; +INSERT INTO t1 () VALUES (),(); +ALTER TABLE t1 FORCE; +--disable_result_log +SELECT DEFAULT(h) FROM t1; +--enable_result_log +SELECT length(DEFAULT(h)) FROM t1; +INSERT INTO t1 () VALUES (); +drop table t1; -- cgit v1.2.1 From 374f4c3f8ce35eb86d9b6ff515022eeae9f5c888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 18 Feb 2021 10:09:30 +0200 Subject: Suppress warning on galera_ssl_upgrade test. --- mysql-test/suite/galera/r/galera_ssl_upgrade.result | 4 ++++ mysql-test/suite/galera/t/galera_ssl_upgrade.test | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/galera_ssl_upgrade.result b/mysql-test/suite/galera/r/galera_ssl_upgrade.result index 5d2bfd299fd..818469bf6ad 100644 --- a/mysql-test/suite/galera/r/galera_ssl_upgrade.result +++ b/mysql-test/suite/galera/r/galera_ssl_upgrade.result @@ -5,6 +5,10 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N VARIABLE_VALUE = 2 1 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.*"); +connection node_1; connection node_2; connection node_1; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.test b/mysql-test/suite/galera/t/galera_ssl_upgrade.test index 4784fa784cd..b69e390533f 100644 --- a/mysql-test/suite/galera/t/galera_ssl_upgrade.test +++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.test @@ -11,6 +11,11 @@ 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.*"); + # Setup galera ports --connection node_1 --source suite/galera/include/galera_base_port.inc -- cgit v1.2.1 From a5b18613ec7966ff1aaa30fe0685fbd7fef8f7c9 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sun, 21 Feb 2021 22:01:24 -0800 Subject: MDEV-24936 EXPLAIN for query based on table value constructor lacks info on used subqueries If a query was based on a table value constructor that contained subqueries then EXPLAIN for such query did not contain any lines explaining the execution plans of the subqueries. This happened because - no optimize() method was called for any subquery used by the table value constructor when EXPLAIN command for the query was processed; - EXPLAIN node created for the table value constructor itself did not assume that some child nodes could be attached to it. Approved by Oleksandr Byelkin --- mysql-test/main/table_value_constr.result | 33 +++++++++++++++++++++++++++++++ mysql-test/main/table_value_constr.test | 25 +++++++++++++++++++++++ 2 files changed, 58 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result index d7b32865db5..e112aca78af 100644 --- a/mysql-test/main/table_value_constr.result +++ b/mysql-test/main/table_value_constr.result @@ -2742,4 +2742,37 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a`,(/* select#4 */ select `tvc_0`.`7` from (values (7)) `tvc_0` union /* select#5 */ select `tvc_0`.`8` from (values (8)) `tvc_0`) <= (`test`.`t1`.`a`))) drop table t1; +# +# MDEV-24934:EXPLAIN for queries based on TVC using subqueries +# +create table t1 (a int); +insert into t1 values (3), (7), (1); +values (8), ((select * from t1 where a between 2 and 4)); +8 +8 +3 +explain values (8), ((select * from t1 where a between 2 and 4)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +values ((select * from t1 where a between 2 and 4)), +((select * from t1 where a > 10)); +(select * from t1 where a between 2 and 4) +3 +NULL +explain values ((select * from t1 where a between 2 and 4)), +((select * from t1 where a > 10)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +3 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +values (10,11), ((select * from t1 where a = 7) + 1, 21); +10 11 +10 11 +8 21 +explain values (10,11), ((select * from t1 where a = 7) + 1, 21); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +drop table t1; End of 10.3 tests diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test index bac85ff75cc..0a78fd9b386 100644 --- a/mysql-test/main/table_value_constr.test +++ b/mysql-test/main/table_value_constr.test @@ -1434,4 +1434,29 @@ eval explain extended $q; drop table t1; +--echo # +--echo # MDEV-24934:EXPLAIN for queries based on TVC using subqueries +--echo # + +create table t1 (a int); +insert into t1 values (3), (7), (1); + +let $q1= +values (8), ((select * from t1 where a between 2 and 4)); +eval $q1; +eval explain $q1; + +let $q2= +values ((select * from t1 where a between 2 and 4)), + ((select * from t1 where a > 10)); +eval $q2; +eval explain $q2; + +let $q3= +values (10,11), ((select * from t1 where a = 7) + 1, 21); +eval $q3; +eval explain $q3; + +drop table t1; + --echo End of 10.3 tests -- cgit v1.2.1 From 3b0b4e614c22362baf05e7a5fba0bc2d739b7d84 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 24 Jan 2021 21:57:37 +0100 Subject: cleanup: remove dead code in mtr --- mysql-test/mysql-test-run.pl | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 05ceab98d7e..1c51acf7341 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -48,9 +48,7 @@ BEGIN { "Could not find the lib/ directory \n"; exit(1); } -} -BEGIN { # Check backward compatibility support # By setting the environment variable MTR_VERSION # it's possible to use a previous version of @@ -338,17 +336,7 @@ my %mysqld_logs; my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions. my $warn_seconds = 60; -sub testcase_timeout ($) { - my ($tinfo)= @_; - if (exists $tinfo->{'case-timeout'}) { - # Return test specific timeout if *longer* that the general timeout - my $test_to= $tinfo->{'case-timeout'}; - $test_to*= 10 if $opt_valgrind; - return $test_to * 60 if $test_to > $opt_testcase_timeout; - } - return $opt_testcase_timeout * 60; -} - +sub testcase_timeout ($) { return $opt_testcase_timeout * 60; } sub check_timeout ($) { return testcase_timeout($_[0]); } our $opt_warnings= 1; -- cgit v1.2.1 From feacc0aaf2860a391f0febbc11e42f1d09598705 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 25 Jan 2021 13:16:04 +0100 Subject: unify mtr handling of debuggers "debugger" is anything that wraps execution of a target binary (mysqld or mysqltest). Currently the list includes: gdb, ddd, dbx, lldb, valgrind, strace, ktrace, rr, devenv, windbg, vsjitdebugger. for every debugger xxx, mtr will recognize four options: --xxx, --boot-xxx, --manual-xxx, --client-xxx. They all support an optional "=string" argument. String being a semicolon-separated list of commands (e.g. for gdb) or one (not semicolon-separated) command line of options (e.g. for valgrind). Or both (e.g. --gdb='-quiet -nh;info files' In embedded both --xxx and --client-xxx work. Functionality changed/removed: * --rr-args is gone * --rr-dir is gone * --manual-debug is gone * --debugger={devenv|vc|windbg|vc_express|vsjitdebugger} is gone * --strace-option is gone * --stracer={strace|ktrace} is gone * --valgrind only enables it for the server, not for everything * --valgrind-all is gone * --valgrind-mysqltest is gone * --valgrind-mysqld is gone * --valgrind-options is gone * --valgrind-option is gone * --valgrind-path is gone * --callgrind is gone * one cannot combine --valgrind --gdb anymore * valgrind report doesn't add a fake test line to the output * vc and vcexpress on windows are no longer supported --- mysql-test/lib/My/Debugger.pm | 247 ++++++++++++++ mysql-test/mysql-test-run.pl | 779 ++---------------------------------------- 2 files changed, 276 insertions(+), 750 deletions(-) create mode 100644 mysql-test/lib/My/Debugger.pm (limited to 'mysql-test') diff --git a/mysql-test/lib/My/Debugger.pm b/mysql-test/lib/My/Debugger.pm new file mode 100644 index 00000000000..700124ec3cb --- /dev/null +++ b/mysql-test/lib/My/Debugger.pm @@ -0,0 +1,247 @@ +package My::Debugger; + +use strict; +use warnings; +use Text::Wrap; +use Cwd; + +# 1. options to support: +# --xxx[=ARGS] +# --manual-xxx[=ARGS] +# --client-xxx[=ARGS] +# --boot-xxx[=ARGS] +# TODO --manual-client-xxx[=ARGS] +# TODO --manual-boot-xxx[=ARGS] +# TODO --exec-xxx[=ARGS] (for $ENV{MYSQL}, etc) +# +# ARGS is a semicolon-separated list of commands for the +# command file. If the first command starts from '-' it'll +# be for a command line, not for a command file. +# +# 2. terminal to use: xterm +# TODO MTR_TERM="xterm -title {title} -e {command}" +# +# 3. debugger combinations are *not allowed* +# (thus no --valgrind --gdb) +# +# 4. variables for the command line / file templates: +# {vardir} -> vardir +# {exe} -> /path/to/binary/to/execute +# {args} -> command-line arguments, "-quoted +# {input} +# {type} -> client, mysqld.1, etc +# {script} -> vardir/tmp/{debugger}init.$type +# {log} -> vardir/log/$type.{debugger} +# {options} -> user options for the debugger. +# +# if {options} isn't used, they're auto-placed before {exe} +# or at the end if no {exe} + +my %debuggers = ( + gdb => { + term => 1, + options => '-x {script} {exe}', + script => 'set args {args} < {input}', + }, + ddd => { + options => '--command {script} {exe}', + script => 'set args {args} < {input}', + }, + dbx => { + term => 1, + options => '-c "stop in main; run {exe} {args} < {input}"', + }, + devenv => { + options => '/debugexe {exe} {args}', + }, + windbg => { + options => '{exe} {args}', + }, + lldb => { + term => 1, + options => '-s {script} {exe}', + script => 'process launch --stop-at-entry {args}', + }, + valgrind => { + options => '--tool=memcheck --show-reachable=yes --leak-check=yes --num-callers=16 --quiet --suppressions='.cwd().'/valgrind.supp {exe} {args} --loose-wait-for-pos-timeout=1500', + pre => sub { + my $debug_libraries_path= "/usr/lib/debug"; + $ENV{LD_LIBRARY_PATH} .= ":$debug_libraries_path" if -d $debug_libraries_path; + } + }, + strace => { + options => '-f -o {log} {exe} {args}', + }, + rr => { + options => 'record -o {log} {exe} {args}', + pre => sub { + ::mtr_error('rr requires kernel.perf_event_paranoid <= 1') + if ::mtr_grab_file('/proc/sys/kernel/perf_event_paranoid') > 1; + } + }, + + # aliases + vsjitdebugger => 'windbg', + ktrace => 'strace', +); + +my %opts; +my %opt_vals; +my $help = "\n\nOptions for running debuggers\n\n"; + +for my $k (sort keys %debuggers) { + my $v = $debuggers{$k}; + $v = $debuggers{$k} = $debuggers{$v} if not ref $v; # resolve aliases + + sub register_opt($$) { + my ($name, $msg) = @_; + $opts{"$name=s"} = \$opt_vals{$name}; + $help .= wrap(sprintf(" %-23s", $name), ' 'x25, "$msg under $name\n"); + } + + $v->{script} = '' unless $v->{script}; + $v->{options} =~ s/(\{exe\}|$)/ {options} $&/ unless $v->{options} =~ /\{options\}/; + + register_opt "$k" => "Start mysqld"; + register_opt "client-$k" => "Start mysqltest client"; + register_opt "boot-$k" => "Start bootstrap server"; + register_opt "manual-$k" => "Before running test(s) let user manually start mysqld"; +} + +sub subst($%) { + use warnings FATAL => 'uninitialized'; + my ($templ, %vars) = @_; + $templ =~ s/\{(\w+)\}/$vars{$1}/g; + $templ; +} + +sub do_args($$$$$) { + my ($args, $exe, $input, $type, $opt) = @_; + my $k = $opt =~ /^(?:client|boot|manual)-(.*)$/ ? $1 : $opt; + my $v = $debuggers{$k}; + + # on windows mtr args are quoted (for system), otherwise not (for exec) + 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]) } + + my %vars = ( + vardir => $::opt_vardir, + exe => $$exe, + args => join(' ', map { quote_from_mtr $_ } @$$args, '--gdb'), + input => $input, + script => "$::opt_vardir/tmp/${k}init.$type", + log => "$::opt_vardir/log/$type.$k", + options => '', + ); + my @params = split /;/, $opt_vals{$opt}; + $vars{options} = shift @params if @params and $params[0] =~ /^-/; + + my $script = join "\n", @params; + if ($v->{script}) { + ::mtr_tofile($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"; + } + + my $options = subst($v->{options}, %vars); + @$$args = map { unquote_for_mtr $_ } $options =~ /("[^"]+"|\S+)/g; + + if ($opt =~ /^manual-/) { + print "\nTo start $k for $type, type in another window:\n"; + print "$k $options\n"; + $$exe= undef; # Indicate the exe should not be started + } elsif ($v->{term}) { + unshift @$$args, '-title', $type, '-e', $k; + $$exe = 'xterm'; + } else { + $$exe = $k; + } +} + +sub options() { %opts } +sub help() { $help } + +sub fix_options(@) { + my $re=join '|', keys %opts; + $re =~ s/=s//g; + map { $_ . (/^--($re)$/ and '=;') } @_; +} + +sub pre_setup() { + my $used; + for my $k (keys %debuggers) { + for my $opt ($k, "manual-$k", "boot-$k", "client-$k") { + if ($opt_vals{$opt}) + { + $used = 1; + if ($debuggers{$k}->{pre}) { + $debuggers{$k}->{pre}->(); + delete $debuggers{$k}->{pre}; + } + } + } + } + + if ($used) { + $ENV{ASAN_OPTIONS}= 'abort_on_error=1:'.($ENV{ASAN_OPTIONS} || ''); + ::mtr_error("Can't use --extern when using debugger") if $ENV{USE_RUNNING_SERVER}; + + $::opt_retry= 1; + $::opt_retry_failure= 1; + $::opt_testcase_timeout= 7 * 24 * 60; # in minutes + $::opt_suite_timeout= 7 * 24 * 60; # in minutes + $::opt_shutdown_timeout= 24 * 60 *60; # in seconds + $::opt_start_timeout= 24 * 60 * 60; # in seconds + } +} + +sub setup_boot_args($$$) { + my ($args, $exe, $input) = @_; + my $found; + + for my $k (keys %debuggers) { + if ($opt_vals{"boot-$k"}) { + die "--boot-$k and --$found cannot be used at the same time\n" if $found; + + $found="boot-$k"; + do_args($args, $exe, $input, 'bootstrap', $found); + } + } +} + +sub setup_client_args($$) { + my ($args, $exe) = @_; + my $found; + my $embedded = $::opt_embedded_server ? ' with --embedded' : ''; + + for my $k (keys %debuggers) { + my @opt_names=("client-$k"); + push @opt_names, $k if $embedded; + for my $opt (@opt_names) { + if ($opt_vals{$opt}) { + die "--$opt and --$found cannot be used at the same time$embedded\n" if $found; + $found=$opt; + do_args($args, $exe, ::IS_WINDOWS ? 'NUL' : '/dev/null', 'client', $found); + } + } + } +} + +sub setup_args($$$) { + my ($args, $exe, $type) = @_; + my $found; + + for my $k (keys %debuggers) { + for my $opt ($k, "manual-$k") { + if ($opt_vals{$opt}) { + die "--$opt and --$found cannot be used at the same time\n" if $found; + $found=$opt; + do_args($args, $exe, ::IS_WINDOWS ? 'NUL' : '/dev/null', $type, $found); + } + } + } +} + +1; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1c51acf7341..07f103ba91e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -93,6 +93,7 @@ use My::Tee; use My::Find; use My::SysInfo; use My::CoreDump; +use My::Debugger; use mtr_cases; use mtr_report; use mtr_match; @@ -106,6 +107,9 @@ require "mtr_io.pl"; require "mtr_gprof.pl"; require "mtr_misc.pl"; +my $opt_valgrind; +my $valgrind_reports= 0; + $SIG{INT}= sub { mtr_error("Got ^C signal"); }; $SIG{HUP}= sub { mtr_error("Hangup detected on controlling terminal"); }; @@ -257,28 +261,6 @@ our $opt_gcov; our $opt_gprof; our %gprof_dirs; -our $glob_debugger= 0; -our $opt_gdb; -my $opt_rr; -my $opt_rr_dir; -my @rr_record_args; -our $opt_client_gdb; -my $opt_boot_gdb; -my $opt_boot_rr; -our $opt_dbx; -our $opt_client_dbx; -my $opt_boot_dbx; -our $opt_ddd; -our $opt_client_ddd; -my $opt_boot_ddd; -our $opt_manual_gdb; -our $opt_manual_lldb; -our $opt_manual_dbx; -our $opt_manual_ddd; -our $opt_manual_debug; -our $opt_debugger; -our $opt_client_debugger; - my $config; # The currently running config my $current_config_name; # The currently running config file template @@ -304,34 +286,23 @@ our $opt_report_times= 0; my $opt_sleep; -my $opt_testcase_timeout= $ENV{MTR_TESTCASE_TIMEOUT} || 15; # minutes -my $opt_suite_timeout = $ENV{MTR_SUITE_TIMEOUT} || 360; # minutes -my $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} || 10; # seconds -my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds +our $opt_retry= 1; +our $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2); +our $opt_testcase_timeout= $ENV{MTR_TESTCASE_TIMEOUT} || 15; # minutes +our $opt_suite_timeout = $ENV{MTR_SUITE_TIMEOUT} || 360; # minutes +our $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} || 10; # seconds +our $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds sub suite_timeout { return $opt_suite_timeout * 60; }; my $opt_wait_all; my $opt_user_args; my $opt_repeat= 1; -my $opt_retry= 1; -my $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2); my $opt_reorder= 1; my $opt_force_restart= 0; our $opt_user = "root"; -our $opt_valgrind= 0; -my $opt_valgrind_mysqld= 0; -my $opt_valgrind_mysqltest= 0; -my @valgrind_args; -my $opt_strace= 0; -my $opt_stracer; -my $opt_client_strace = 0; -my @strace_args; -my $opt_valgrind_path; -my $valgrind_reports= 0; -my $opt_callgrind; my %mysqld_logs; my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions. my $warn_seconds = 60; @@ -1154,7 +1125,7 @@ sub run_worker ($) { } mark_time_used('restart'); my $valgrind_reports= 0; - if ($opt_valgrind_mysqld) { + if ($opt_valgrind) { $valgrind_reports= valgrind_exit_reports(); print $server "VALGREP\n" if $valgrind_reports; } @@ -1216,8 +1187,6 @@ sub print_global_resfile { resfile_global("debug", $opt_debug ? 1 : 0); resfile_global("gcov", $opt_gcov ? 1 : 0); resfile_global("gprof", $opt_gprof ? 1 : 0); - resfile_global("valgrind", $opt_valgrind ? 1 : 0); - resfile_global("callgrind", $opt_callgrind ? 1 : 0); resfile_global("mem", $opt_mem); resfile_global("tmpdir", $opt_tmpdir); resfile_global("vardir", $opt_vardir); @@ -1307,30 +1276,6 @@ sub command_line_setup { 'debug' => \$opt_debug, 'debug-common' => \$opt_debug_common, 'debug-server' => \$opt_debug_server, - 'gdb=s' => \$opt_gdb, - 'rr' => \$opt_rr, - 'rr-arg=s' => \@rr_record_args, - 'rr-dir=s' => \$opt_rr_dir, - 'client-gdb=s' => \$opt_client_gdb, - 'manual-gdb' => \$opt_manual_gdb, - 'manual-lldb' => \$opt_manual_lldb, - 'boot-gdb' => \$opt_boot_gdb, - 'boot-rr' => \$opt_boot_rr, - 'manual-debug' => \$opt_manual_debug, - 'ddd' => \$opt_ddd, - 'client-ddd' => \$opt_client_ddd, - 'manual-ddd' => \$opt_manual_ddd, - 'boot-ddd' => \$opt_boot_ddd, - 'dbx' => \$opt_dbx, - 'client-dbx' => \$opt_client_dbx, - 'manual-dbx' => \$opt_manual_dbx, - 'debugger=s' => \$opt_debugger, - 'boot-dbx' => \$opt_boot_dbx, - 'client-debugger=s' => \$opt_client_debugger, - 'strace' => \$opt_strace, - 'strace-option=s' => \@strace_args, - 'client-strace' => \$opt_client_strace, - 'stracer=s' => \$opt_stracer, 'max-save-core=i' => \$opt_max_save_core, 'max-save-datadir=i' => \$opt_max_save_datadir, 'max-test-fail=i' => \$opt_max_test_fail, @@ -1339,23 +1284,6 @@ sub command_line_setup { # Coverage, profiling etc 'gcov' => \$opt_gcov, 'gprof' => \$opt_gprof, - 'valgrind|valgrind-all' => \$opt_valgrind, - 'valgrind-mysqltest' => \$opt_valgrind_mysqltest, - 'valgrind-mysqld' => \$opt_valgrind_mysqld, - 'valgrind-options=s' => sub { - my ($opt, $value)= @_; - # Deprecated option unless it's what we know pushbuild uses - if ($value eq "--gen-suppressions=all --show-reachable=yes") { - push(@valgrind_args, $_) for (split(' ', $value)); - return; - } - die("--valgrind-options=s is deprecated. Use ", - "--valgrind-option=s, to be specified several", - " times if necessary"); - }, - 'valgrind-option=s' => \@valgrind_args, - 'valgrind-path=s' => \$opt_valgrind_path, - 'callgrind' => \$opt_callgrind, 'debug-sync-timeout=i' => \$opt_debug_sync_timeout, # Directories @@ -1404,12 +1332,13 @@ sub command_line_setup { # list-options is internal, not listed in help 'list-options' => \$opt_list_options, 'skip-test-list=s' => \@opt_skip_test_list, - 'xml-report=s' => \$opt_xml_report + 'xml-report=s' => \$opt_xml_report, + + My::Debugger::options() ); # fix options (that take an optional argument and *only* after = sign - my %fixopt = ( '--gdb' => '--gdb=#', '--client-gdb' => '--client-gdb=#' ); - @ARGV = map { $fixopt{$_} or $_ } @ARGV; + @ARGV = My::Debugger::fix_options(@ARGV); GetOptions(%options) or usage("Can't read options"); usage("") if $opt_usage; list_options(\%options) if $opt_list_options; @@ -1734,39 +1663,6 @@ sub command_line_setup { { mtr_error("Can't use --extern with --embedded-server"); } - - - if ($opt_gdb) - { - $opt_client_gdb= $opt_gdb; - $opt_gdb= undef; - } - - if ($opt_ddd) - { - $opt_client_ddd= $opt_ddd; - $opt_ddd= undef; - } - - if ($opt_dbx) { - mtr_warning("Silently converting --dbx to --client-dbx in embedded mode"); - $opt_client_dbx= $opt_dbx; - $opt_dbx= undef; - } - - if ($opt_debugger) - { - $opt_client_debugger= $opt_debugger; - $opt_debugger= undef; - } - - if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_lldb || - $opt_manual_ddd || $opt_manual_debug || $opt_debugger || $opt_dbx || - $opt_manual_dbx) - { - mtr_error("You need to use the client debug options for the", - "embedded server. Ex: --client-gdb"); - } } # -------------------------------------------------------------------------- @@ -1786,42 +1682,6 @@ sub command_line_setup { mtr_error("Coverage test needs the source - please use source dist"); } - # -------------------------------------------------------------------------- - # Check debug related options - # -------------------------------------------------------------------------- - if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || $opt_rr || - $opt_manual_gdb || $opt_manual_lldb || $opt_manual_ddd || - $opt_manual_debug || $opt_dbx || $opt_client_dbx || $opt_manual_dbx || - $opt_debugger || $opt_client_debugger ) - { - $ENV{ASAN_OPTIONS}= 'abort_on_error=1:'.($ENV{ASAN_OPTIONS} || ''); - if ( using_extern() ) - { - mtr_error("Can't use --extern when using debugger"); - } - # Indicate that we are using debugger - $glob_debugger= 1; - $opt_retry= 1; - $opt_retry_failure= 1; - # Set one week timeout (check-testcase timeout will be 1/10th) - $opt_testcase_timeout= 7 * 24 * 60; - $opt_suite_timeout= 7 * 24 * 60; - # One day to shutdown - $opt_shutdown_timeout= 24 * 60; - # One day for PID file creation (this is given in seconds not minutes) - $opt_start_timeout= 24 * 60 * 60; - if ($opt_rr && open(my $fh, '<', '/proc/sys/kernel/perf_event_paranoid')) - { - my $perf_event_paranoid= <$fh>; - close $fh; - chomp $perf_event_paranoid; - if ($perf_event_paranoid == 0) - { - mtr_error("rr requires kernel.perf_event_paranoid set to 1"); - } - } - } - # -------------------------------------------------------------------------- # Modified behavior with --start options # -------------------------------------------------------------------------- @@ -1883,87 +1743,6 @@ sub command_line_setup { "for option --testsuite-timeout") if ($opt_suite_timeout <= 0); - # -------------------------------------------------------------------------- - # Check valgrind arguments - # -------------------------------------------------------------------------- - if ( $opt_valgrind or $opt_valgrind_path or @valgrind_args) - { - mtr_report("Turning on valgrind for all executables"); - $opt_valgrind= 1; - $opt_valgrind_mysqld= 1; - $opt_valgrind_mysqltest= 1; - } - elsif ( $opt_valgrind_mysqld ) - { - mtr_report("Turning on valgrind for mysqld(s) only"); - $opt_valgrind= 1; - } - elsif ( $opt_valgrind_mysqltest ) - { - mtr_report("Turning on valgrind for mysqltest and mysql_client_test only"); - $opt_valgrind= 1; - } - - if ($opt_valgrind) - { - # Increase the timeouts when running with valgrind - $opt_testcase_timeout*= 10; - $opt_suite_timeout*= 6; - $opt_start_timeout*= 10; - $warn_seconds*= 10; - } - - if ( $opt_callgrind ) - { - mtr_report("Turning on valgrind with callgrind for mysqld(s)"); - $opt_valgrind= 1; - $opt_valgrind_mysqld= 1; - - # Set special valgrind options unless options passed on command line - push(@valgrind_args, "--trace-children=yes") - unless @valgrind_args; - unshift(@valgrind_args, "--tool=callgrind"); - } - - # default to --tool=memcheck - if ($opt_valgrind && ! grep(/^--tool=/i, @valgrind_args)) - { - # Set valgrind_option unless already defined - push(@valgrind_args, ("--show-reachable=yes", "--leak-check=yes", - "--num-callers=16")) - unless @valgrind_args; - unshift(@valgrind_args, "--tool=memcheck"); - } - - if ( $opt_valgrind ) - { - # Make valgrind run in quiet mode so it only print errors - push(@valgrind_args, "--quiet" ); - - push(@valgrind_args, "--suppressions=${glob_mysql_test_dir}/valgrind.supp") - if -f "$glob_mysql_test_dir/valgrind.supp"; - - mtr_report("Running valgrind with options \"", - join(" ", @valgrind_args), "\""); - } - - if (@strace_args || $opt_stracer) - { - $opt_strace=1; - } - - # InnoDB does not bother to do individual de-allocations at exit. Instead it - # relies on a custom allocator to track every allocation, and frees all at - # once during exit. - # In XtraDB, an option use-sys-malloc is introduced (and on by default) to - # disable this (for performance). But this exposes Valgrind to all the - # missing de-allocations, so we need to disable it to at least get - # meaningful leak checking for the rest of the server. - if ($opt_valgrind_mysqld) - { - push(@opt_extra_mysqld_opt, "--loose-skip-innodb-use-sys-malloc"); - } - if ($opt_debug_common) { $opt_debug= 1; @@ -2178,21 +1957,6 @@ sub executable_setup () { $exe_patch='patch' if `patch -v`; - # - # Check if libtool is available in this distribution/clone - # we need it when valgrinding or debugging non installed binary - # Otherwise valgrind will valgrind the libtool wrapper or bash - # and gdb will not find the real executable to debug - # - if ( -x "../libtool") - { - $exe_libtool= "../libtool"; - if ($opt_valgrind or $glob_debugger or $opt_strace) - { - mtr_report("Using \"$exe_libtool\" when running valgrind, strace or debugger"); - } - } - # Look for the client binaries $exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin"); $exe_mysql= mtr_exe_exists("$path_client_bindir/mysql"); @@ -2317,9 +2081,6 @@ sub mysql_client_test_arguments(){ my $args; mtr_init_args(\$args); - if ( $opt_valgrind_mysqltest ) { - valgrind_arguments($args, \$exe); - } mtr_add_arg($args, "--defaults-file=%s", $path_config_file); mtr_add_arg($args, "--testcase"); mtr_add_arg($args, "--vardir=$opt_vardir"); @@ -2365,6 +2126,8 @@ sub environment_setup { umask(022); + $ENV{'USE_RUNNING_SERVER'}= using_extern(); + my @ld_library_paths; if ($path_client_libdir) @@ -2395,30 +2158,12 @@ sub environment_setup { } } - # -------------------------------------------------------------------------- - # Valgrind need to be run with debug libraries otherwise it's almost - # impossible to add correct supressions, that means if "/usr/lib/debug" - # is available, it should be added to - # LD_LIBRARY_PATH - # - # But pthread is broken in libc6-dbg on Debian <= 3.1 (see Debian - # bug 399035, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=399035), - # so don't change LD_LIBRARY_PATH on that platform. - # -------------------------------------------------------------------------- - my $debug_libraries_path= "/usr/lib/debug"; - my $deb_version; - if ( $opt_valgrind and -d $debug_libraries_path and - (! -e '/etc/debian_version' or - ($deb_version= - mtr_grab_file('/etc/debian_version')) !~ /^[0-9]+\.[0-9]$/ or - $deb_version > 3.1 ) ) - { - push(@ld_library_paths, $debug_libraries_path); - } - $ENV{'LD_LIBRARY_PATH'}= join(":", @ld_library_paths, $ENV{'LD_LIBRARY_PATH'} ? split(':', $ENV{'LD_LIBRARY_PATH'}) : ()); + + My::Debugger::pre_setup(); + mtr_debug("LD_LIBRARY_PATH: $ENV{'LD_LIBRARY_PATH'}"); $ENV{'DYLD_LIBRARY_PATH'}= join(":", @ld_library_paths, @@ -2453,7 +2198,6 @@ sub environment_setup { $ENV{'LC_CTYPE'}= "C"; $ENV{'LC_COLLATE'}= "C"; - $ENV{'USE_RUNNING_SERVER'}= using_extern(); $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'}; $ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir; @@ -2604,10 +2348,6 @@ sub environment_setup { $ENV{'INNOCHECKSUM'}= native_path($exe_innochecksum); } - # Create an environment variable to make it possible - # to detect that valgrind is being used from test cases - $ENV{'VALGRIND_TEST'}= $opt_valgrind; - # Add dir of this perl to aid mysqltest in finding perl my $perldir= dirname($^X); my $pathsep= ":"; @@ -3404,25 +3144,7 @@ sub mysql_install_db { if (! -e $bootstrap_sql_file) { - if ($opt_boot_gdb) { - gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } - if ($opt_boot_dbx) { - dbx_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } - if ($opt_boot_ddd) { - ddd_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } - if ($opt_boot_rr) { - $args= ["record", @rr_record_args, $exe_mysqld_bootstrap, @$args]; - $exe_mysqld_bootstrap= "rr"; - my $rr_dir= $opt_rr_dir ? $opt_rr_dir : "$opt_vardir/rr.boot"; - $ENV{'_RR_TRACE_DIR'}= $rr_dir; - mkpath($rr_dir); - } + My::Debugger::setup_boot_args(\$args, \$exe_mysqld_bootstrap, $bootstrap_sql_file); my $path_sql= my_find_file($install_basedir, ["mysql", "sql/share", "share/mariadb", @@ -5140,7 +4862,7 @@ sub after_failure ($) { sub report_failure_and_restart ($) { my $tinfo= shift; - if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'}) && + if ($opt_valgrind && ($tinfo->{'warnings'} || $tinfo->{'timeout'}) && $opt_core_on_failure == 0) { # In these cases we may want valgrind report from normal termination @@ -5270,12 +4992,6 @@ sub mysqld_arguments ($$$) { # Check if "extra_opt" contains --log-bin my $skip_binlog= not grep /^--(loose-)?log-bin/, @$extra_opts; - # Indicate to mysqld it will be debugged in debugger - if ( $glob_debugger ) - { - mtr_add_arg($args, "--gdb"); - } - my $found_skip_core= 0; foreach my $arg ( @$extra_opts ) { @@ -5324,7 +5040,6 @@ sub mysqld_start ($$) { mtr_verbose(My::Options::toStr("mysqld_start", @$extra_opts)); my $exe= find_mysqld($mysqld->value('basedir')); - my $wait_for_pid_file= 1; mtr_error("Internal error: mysqld should never be started for embedded") if $opt_embedded_server; @@ -5332,15 +5047,6 @@ sub mysqld_start ($$) { my $args; mtr_init_args(\$args); - if ( $opt_valgrind_mysqld and not $opt_gdb and not $opt_manual_gdb ) - { - valgrind_arguments($args, \$exe); - } - if ( $opt_strace) - { - strace_arguments($args, \$exe, $mysqld->name()); - } - mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld')); # Add any additional options from an in-test restart @@ -5364,49 +5070,8 @@ sub mysqld_start ($$) { # options from *.opt and *.combination files. $ENV{'MYSQLD_LAST_CMD'}= "$exe @$args"; - if ( $opt_gdb || $opt_manual_gdb ) - { - gdb_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_manual_lldb ) - { - lldb_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_ddd || $opt_manual_ddd ) - { - ddd_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_dbx || $opt_manual_dbx ) { - dbx_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_debugger ) - { - debugger_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_manual_debug ) - { - print "\nStart " .$mysqld->name()." in your debugger\n" . - "dir: $glob_mysql_test_dir\n" . - "exe: $exe\n" . - "args: " . join(" ", @$args) . "\n\n" . - "Waiting ....\n"; - - # Indicate the exe should not be started - $exe= undef; - } - elsif ( $opt_rr ) - { - $args= ["record", @rr_record_args, "$exe", @$args]; - $exe= "rr"; - my $rr_dir= $opt_rr_dir ? $opt_rr_dir : "$opt_vardir/rr". $mysqld->after('mysqld'); - $ENV{'_RR_TRACE_DIR'}= $rr_dir; - mkpath($rr_dir); - } - else - { - # Default to not wait until pid file has been created - $wait_for_pid_file= 0; - } + My::Debugger::setup_args(\$args, \$exe, $mysqld->name()); + $ENV{'VALGRIND_TEST'}= $opt_valgrind = int($exe && $exe eq 'valgrind'); # Remove the old pidfile if any unlink($mysqld->value('pid-file')); @@ -5455,11 +5120,8 @@ sub mysqld_start ($$) { mtr_verbose("Started $mysqld->{proc}"); } - if ( $wait_for_pid_file && - !sleep_until_file_created($mysqld->value('pid-file'), - $opt_start_timeout, - $mysqld->{'proc'}, - $warn_seconds)) + 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"); @@ -5906,13 +5568,6 @@ sub start_mysqltest ($) { mtr_add_arg($args, "--sleep=%d", $opt_sleep); } - if ( $opt_valgrind ) - { - # We are running server under valgrind, which causes some replication - # test to be much slower, notable rpl_mdev6020. Increase timeout. - mtr_add_arg($args, "--wait-for-pos-timeout=1500"); - } - if ( $opt_ssl ) { # Turn on SSL for _all_ test cases if option --ssl was used @@ -5945,31 +5600,6 @@ sub start_mysqltest ($) { # ---------------------------------------------------------------------- $ENV{'MYSQL_TEST'}= mtr_args2str($exe_mysqltest, @$args); - # ---------------------------------------------------------------------- - # Add arguments that should not go into the MYSQL_TEST env var - # ---------------------------------------------------------------------- - if ( $opt_valgrind_mysqltest ) - { - # Prefix the Valgrind options to the argument list. - # We do this here, since we do not want to Valgrind the nested invocations - # of mysqltest; that would mess up the stderr output causing test failure. - my @args_saved = @$args; - mtr_init_args(\$args); - valgrind_arguments($args, \$exe); - mtr_add_arg($args, "%s", $_) for @args_saved; - } - - # ---------------------------------------------------------------------- - # Prefix the strace options to the argument list. - # ---------------------------------------------------------------------- - if ( $opt_client_strace ) - { - my @args_saved = @$args; - mtr_init_args(\$args); - strace_arguments($args, \$exe, "mysqltest"); - mtr_add_arg($args, "%s", $_) for @args_saved; - } - if ($opt_force > 1) { mtr_add_arg($args, "--continue-on-error"); @@ -6005,21 +5635,7 @@ sub start_mysqltest ($) { } } - if ( $opt_client_gdb ) - { - gdb_arguments(\$args, \$exe, "client"); - } - elsif ( $opt_client_ddd ) - { - ddd_arguments(\$args, \$exe, "client"); - } - if ( $opt_client_dbx ) { - dbx_arguments(\$args, \$exe, "client"); - } - elsif ( $opt_client_debugger ) - { - debugger_arguments(\$args, \$exe, "client"); - } + My::Debugger::setup_client_args(\$args, \$exe); my $proc= My::SafeProcess->new ( @@ -6034,291 +5650,6 @@ sub start_mysqltest ($) { return $proc; } -# -# Modify the exe and args so that program is run in gdb in xterm -# -sub gdb_arguments { - my $args= shift; - my $exe= shift; - my $type= shift; - my $input= shift; - - my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type"; - - # Remove the old gdbinit file - unlink($gdb_init_file); - - # Put $args into a single string - $input = $input ? "< $input" : ""; - - if ($type eq 'client') { - mtr_tofile($gdb_init_file, - join("\n", - "set args @$$args $input", - split /;/, $opt_client_gdb || "" - )); - } elsif ($opt_valgrind_mysqld) { - my $v = $$exe; - my $vargs = []; - valgrind_arguments($vargs, \$v); - mtr_tofile($gdb_init_file, < 'libjemalloc*', - 'bundled jemalloc' => 'NONE' - ); - my ($syn) = $somalloc{$mysqld_variables{'version-malloc-library'}}; - mtr_add_arg($args, '--soname-synonyms=somalloc=%s', $syn) if $syn; - } - - # Add valgrind options, can be overridden by user - mtr_add_arg($args, '%s', $_) for (@valgrind_args); - - mtr_add_arg($args, $$exe); - - $$exe= $opt_valgrind_path || "valgrind"; - - if ($exe_libtool) - { - # Add "libtool --mode-execute" before the test to execute - # if running in valgrind(to avoid valgrinding bash) - unshift(@$args, "--mode=execute", $$exe); - $$exe= $exe_libtool; - } -} - -# -# Modify the exe and args so that program is run in strace -# -sub strace_arguments { - my $args= shift; - my $exe= shift; - my $mysqld_name= shift; - my $output= sprintf("%s/log/%s.strace", $path_vardir_trace, $mysqld_name); - - mtr_add_arg($args, "-f"); - mtr_add_arg($args, "-o%s", $output); - - # Add strace options - mtr_add_arg($args, '%s', $_) for (@strace_args); - - mtr_add_arg($args, $$exe); - - $$exe= $opt_stracer || "strace"; - - if ($exe_libtool) - { - # Add "libtool --mode-execute" before the test to execute - # if running in valgrind(to avoid valgrinding bash) - unshift(@$args, "--mode=execute", $$exe); - $$exe= $exe_libtool; - } -} - # # Search server logs for valgrind reports printed at mysqld termination # @@ -6400,7 +5731,7 @@ sub usage ($) { local $"= ','; # for @DEFAULT_SUITES below - print < Path to the valgrind executable - callgrind Instruct valgrind to use callgrind - -Options for strace - - strace Run the "mysqld" executables using strace. Default - options are -f -o 'vardir'/log/'mysqld-name'.strace. - client-strace Trace the "mysqltest". - strace-option=ARGS Option to give strace, appends to existing options. - stracer= Specify name and path to the trace program to use. - Default is "strace". Example: $0 --stracer=ktrace. - -Options for rr (Record and Replay) - rr Run the "mysqld" executables using rr. Default run - option is "rr record mysqld mysqld_options" - boot-rr Start bootstrap server in rr - rr-arg=ARG Option to give rr record, can be specified more then once - rr-dir=DIR The directory where rr recordings are stored. Defaults - to 'vardir'/rr.0 (rr.boot for bootstrap instance and - rr.1, ..., rr.N for slave instances). +HERE Misc options user=USER User for connecting to mysqld(default: $opt_user) -- cgit v1.2.1 From 77c23c62ae28611f660ea4a8b25525c3cfe2871f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 26 Jan 2021 11:56:17 +0100 Subject: support for mtr --valgdb add a new "debugger" to mtr, that runs the executable under valgrind in gdb. valgrind pid is auto-detected, but the delay (sleep) and vgdb path are hard-coded for now --- mysql-test/lib/My/Debugger.pm | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/lib/My/Debugger.pm b/mysql-test/lib/My/Debugger.pm index 700124ec3cb..f6aa41269cb 100644 --- a/mysql-test/lib/My/Debugger.pm +++ b/mysql-test/lib/My/Debugger.pm @@ -79,6 +79,22 @@ my %debuggers = ( if ::mtr_grab_file('/proc/sys/kernel/perf_event_paranoid') > 1; } }, + valgdb => { + term => 1, + run => 'gdb', + options => '-x {script} {exe}', + script => < 'windbg', @@ -147,16 +163,17 @@ sub do_args($$$$$) { my $options = subst($v->{options}, %vars); @$$args = map { unquote_for_mtr $_ } $options =~ /("[^"]+"|\S+)/g; + my $run = $v->{run} || $k; if ($opt =~ /^manual-/) { print "\nTo start $k for $type, type in another window:\n"; - print "$k $options\n"; + print "$run $options\n"; $$exe= undef; # Indicate the exe should not be started } elsif ($v->{term}) { - unshift @$$args, '-title', $type, '-e', $k; + unshift @$$args, '-title', $type, '-e', $run; $$exe = 'xterm'; } else { - $$exe = $k; + $$exe = $run; } } -- cgit v1.2.1 From 7fe351aba4e4e17e1be2599fa36ff73a0ce103f9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 Feb 2021 16:59:26 +0100 Subject: mtr fixes for old (5.10.1) perl --- mysql-test/lib/My/Debugger.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/lib/My/Debugger.pm b/mysql-test/lib/My/Debugger.pm index f6aa41269cb..d2add55d680 100644 --- a/mysql-test/lib/My/Debugger.pm +++ b/mysql-test/lib/My/Debugger.pm @@ -4,6 +4,7 @@ use strict; use warnings; use Text::Wrap; use Cwd; +use My::Platform; # 1. options to support: # --xxx[=ARGS] @@ -139,8 +140,8 @@ sub do_args($$$$$) { # on windows mtr args are quoted (for system), otherwise not (for exec) 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]) } + sub quote_from_mtr($) { IS_WINDOWS() ? $_[0] : quote($_[0]) } + sub unquote_for_mtr($) { IS_WINDOWS() ? $_[0] : unquote($_[0]) } my %vars = ( vardir => $::opt_vardir, @@ -240,7 +241,7 @@ sub setup_client_args($$) { if ($opt_vals{$opt}) { die "--$opt and --$found cannot be used at the same time$embedded\n" if $found; $found=$opt; - do_args($args, $exe, ::IS_WINDOWS ? 'NUL' : '/dev/null', 'client', $found); + do_args($args, $exe, IS_WINDOWS() ? 'NUL' : '/dev/null', 'client', $found); } } } @@ -255,7 +256,7 @@ sub setup_args($$$) { if ($opt_vals{$opt}) { die "--$opt and --$found cannot be used at the same time\n" if $found; $found=$opt; - do_args($args, $exe, ::IS_WINDOWS ? 'NUL' : '/dev/null', $type, $found); + do_args($args, $exe, IS_WINDOWS() ? 'NUL' : '/dev/null', $type, $found); } } } -- cgit v1.2.1 From bb98c6bf447a35252e7054d543d39e78e98f6667 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 19 Feb 2021 16:48:19 +0100 Subject: cleanup: renames, no need to create a new .inc file if it's the whole content of a test anyway. --- .../extra/binlog_tests/binlog_xa_recover.inc | 280 -------------------- .../suite/binlog/t/binlog_xa_recover-master.opt | 1 - mysql-test/suite/binlog/t/binlog_xa_recover.opt | 1 + mysql-test/suite/binlog/t/binlog_xa_recover.test | 281 ++++++++++++++++++++- .../binlog_encryption/binlog_xa_recover-master.opt | 1 - .../suite/binlog_encryption/binlog_xa_recover.test | 2 +- 6 files changed, 282 insertions(+), 284 deletions(-) delete mode 100644 mysql-test/extra/binlog_tests/binlog_xa_recover.inc delete mode 100644 mysql-test/suite/binlog/t/binlog_xa_recover-master.opt create mode 100644 mysql-test/suite/binlog/t/binlog_xa_recover.opt delete mode 100644 mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt (limited to 'mysql-test') diff --git a/mysql-test/extra/binlog_tests/binlog_xa_recover.inc b/mysql-test/extra/binlog_tests/binlog_xa_recover.inc deleted file mode 100644 index 9e0906c90f0..00000000000 --- a/mysql-test/extra/binlog_tests/binlog_xa_recover.inc +++ /dev/null @@ -1,280 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently binlog and binlog_encryption). -# Please check all dependent tests after modifying it -# - ---source include/have_innodb.inc ---source include/have_debug.inc ---source include/have_debug_sync.inc ---source include/have_binlog_format_row.inc -# Valgrind does not work well with test that crashes the server ---source include/not_valgrind.inc - -# (We do not need to restore these settings, as we crash the server). -SET GLOBAL max_binlog_size= 4096; -SET GLOBAL innodb_flush_log_at_trx_commit= 1; -RESET MASTER; - -CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; -# Insert some data to force a couple binlog rotations (3), so we get some -# normal binlog checkpoints before starting the test. -INSERT INTO t1 VALUES (100, REPEAT("x", 4100)); -# Wait for the master-bin.000002 binlog checkpoint to appear. ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000002" ---let $field= Info ---let $condition= = "master-bin.000002" ---source include/wait_show_condition.inc -INSERT INTO t1 VALUES (101, REPEAT("x", 4100)); ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003" ---let $field= Info ---let $condition= = "master-bin.000003" ---source include/wait_show_condition.inc -INSERT INTO t1 VALUES (102, REPEAT("x", 4100)); ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" ---let $field= Info ---let $condition= = "master-bin.000004" ---source include/wait_show_condition.inc - -# Now start a bunch of transactions that span multiple binlog -# files. Leave then in the state prepared-but-not-committed in the engine -# and crash the server. Check that crash recovery is able to recover all -# of them. -# -# We use debug_sync to get all the transactions into the prepared state before -# we commit any of them. This is because the prepare step flushes the InnoDB -# redo log - including any commits made before, so recovery would become -# unnecessary, decreasing the value of this test. -# -# We arrange to have con1 with a prepared transaction in master-bin.000004, -# con2 and con3 with a prepared transaction in master-bin.000005, and a new -# empty master-bin.000006. So the latest binlog checkpoint should be -# master-bin.000006. - -connect(con1,localhost,root,,); -# First wait after prepare and before write to binlog. -SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont"; -# Then complete InnoDB commit in memory (but not commit checkpoint / write to -# disk), and hang until crash, leaving a transaction to be XA recovered. -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever"; -send INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con1_wait"; - -connect(con2,localhost,root,,); -SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont"; -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever"; -send INSERT INTO t1 VALUES (2, NULL); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con2_wait"; - -connect(con3,localhost,root,,); -SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont"; -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever"; -send INSERT INTO t1 VALUES (3, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con3_wait"; - -connect(con4,localhost,root,,); -SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont"; -SET SESSION debug_dbug="+d,crash_commit_after_log"; -send INSERT INTO t1 VALUES (4, NULL); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con4_wait"; - -SET DEBUG_SYNC= "now SIGNAL con1_cont"; -SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; -SET DEBUG_SYNC= "now SIGNAL con2_cont"; -SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; -SET DEBUG_SYNC= "now SIGNAL con3_cont"; -SET DEBUG_SYNC= "now WAIT_FOR con3_ready"; - -# Check that everything is committed in binary log. ---source include/show_binary_logs.inc ---let $binlog_file= master-bin.000003 ---let $binlog_start= 4 ---source include/show_binlog_events.inc ---let $binlog_file= master-bin.000004 ---source include/show_binlog_events.inc ---let $binlog_file= master-bin.000005 ---source include/show_binlog_events.inc ---let $binlog_file= master-bin.000006 ---source include/show_binlog_events.inc - - -# Check that server will not purge too much. -PURGE BINARY LOGS TO "master-bin.000006"; ---source include/show_binary_logs.inc - -# Now crash the server with one more transaction in prepared state. ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait-binlog_xa_recover.test -EOF ---error 0,2006,2013 -SET DEBUG_SYNC= "now SIGNAL con4_cont"; -connection con4; ---error 2006,2013 -reap; - ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart-group_commit_binlog_pos.test -EOF - -connection default; ---enable_reconnect ---source include/wait_until_connected_again.inc - -# Check that all transactions are recovered. -SELECT a FROM t1 ORDER BY a; - ---echo Test that with multiple binlog checkpoints, recovery starts from the last one. -SET GLOBAL max_binlog_size= 4096; -SET GLOBAL innodb_flush_log_at_trx_commit= 1; -RESET MASTER; - -# Rotate to binlog master-bin.000003 while delaying binlog checkpoints. -# So we get multiple binlog checkpoints in master-bin.000003. -# Then complete the checkpoints, crash, and check that we only scan -# the necessary binlog file (ie. that we use the _last_ checkpoint). - -connect(con10,localhost,root,,); -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont"; -send INSERT INTO t1 VALUES (10, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con10_ready"; - -connect(con11,localhost,root,,); -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont"; -send INSERT INTO t1 VALUES (11, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con11_ready"; - -connect(con12,localhost,root,,); -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont"; -send INSERT INTO t1 VALUES (12, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con12_ready"; -INSERT INTO t1 VALUES (13, NULL); - ---source include/show_binary_logs.inc ---let $binlog_file= master-bin.000004 ---let $binlog_start= 4 ---source include/show_binlog_events.inc - -SET DEBUG_SYNC= "now SIGNAL con10_cont"; -connection con10; -reap; -connection default; - -# We need to sync the test case with the background processing of the -# commit checkpoint, otherwise we get nondeterministic results. -SET @old_dbug= @@global.DEBUG_DBUG; -SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed"; -SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed"; -SET DEBUG_SYNC= "now SIGNAL con12_cont"; -connection con12; -reap; -connection default; -SET GLOBAL debug_dbug= @old_dbug; - -SET DEBUG_SYNC= "now SIGNAL con11_cont"; -connection con11; -reap; - -connection default; -# Wait for the last (master-bin.000004) binlog checkpoint to appear. ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" ---let $field= Info ---let $condition= = "master-bin.000004" ---source include/wait_show_condition.inc - ---echo Checking that master-bin.000004 is the last binlog checkpoint ---source include/show_binlog_events.inc - ---echo Now crash the server -# It is not too easy to test XA recovery, as it runs early during server -# startup, before any connections can be made. -# What we do is set a DBUG error insert which will crash if XA recovery -# starts from any other binlog than master-bin.000004 (check the file -# binlog_xa_recover-master.opt). Then we will fail here if XA recovery -# would start from the wrong place. ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait-binlog_xa_recover.test -EOF -SET SESSION debug_dbug="+d,crash_commit_after_log"; ---error 2006,2013 -INSERT INTO t1 VALUES (14, NULL); - ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart-group_commit_binlog_pos.test -EOF - -connection default; ---enable_reconnect ---source include/wait_until_connected_again.inc - -# Check that all transactions are recovered. -SELECT a FROM t1 ORDER BY a; - - ---echo *** Check that recovery works if we crashed early during rotate, before ---echo *** binlog checkpoint event could be written. - -SET GLOBAL max_binlog_size= 4096; -SET GLOBAL innodb_flush_log_at_trx_commit= 1; -RESET MASTER; - -# We need some initial data to reach binlog master-bin.000004. Otherwise -# crash recovery fails due to the error insert used for previous test. -INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); -INSERT INTO t1 VALUES (22, REPEAT("x", 4100)); -# Wait for the master-bin.000003 binlog checkpoint to appear. ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003" ---let $field= Info ---let $condition= = "master-bin.000003" ---source include/wait_show_condition.inc -INSERT INTO t1 VALUES (23, REPEAT("x", 4100)); -# Wait for the last (master-bin.000004) binlog checkpoint to appear. ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" ---let $field= Info ---let $condition= = "master-bin.000004" ---source include/wait_show_condition.inc - ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait-binlog_xa_recover.test -EOF -SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event"; ---error 2006,2013 -INSERT INTO t1 VALUES (24, REPEAT("x", 4100)); - ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart-group_commit_binlog_pos.test -EOF - ---enable_reconnect ---source include/wait_until_connected_again.inc - -# Check that all transactions are recovered. -SELECT a FROM t1 ORDER BY a; - ---source include/show_binary_logs.inc ---let $binlog_file= master-bin.000004 ---let $binlog_start= 4 ---source include/show_binlog_events.inc - -# Cleanup -connection default; -DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover-master.opt b/mysql-test/suite/binlog/t/binlog_xa_recover-master.opt deleted file mode 100644 index 3c44f9fad10..00000000000 --- a/mysql-test/suite/binlog/t/binlog_xa_recover-master.opt +++ /dev/null @@ -1 +0,0 @@ ---skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004 diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover.opt b/mysql-test/suite/binlog/t/binlog_xa_recover.opt new file mode 100644 index 00000000000..3c44f9fad10 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_xa_recover.opt @@ -0,0 +1 @@ +--skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004 diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover.test b/mysql-test/suite/binlog/t/binlog_xa_recover.test index 0e0b80433ff..9e0906c90f0 100644 --- a/mysql-test/suite/binlog/t/binlog_xa_recover.test +++ b/mysql-test/suite/binlog/t/binlog_xa_recover.test @@ -1 +1,280 @@ ---source extra/binlog_tests/binlog_xa_recover.inc +# +# This include file is used by more than one test suite +# (currently binlog and binlog_encryption). +# Please check all dependent tests after modifying it +# + +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/have_binlog_format_row.inc +# Valgrind does not work well with test that crashes the server +--source include/not_valgrind.inc + +# (We do not need to restore these settings, as we crash the server). +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; +# Insert some data to force a couple binlog rotations (3), so we get some +# normal binlog checkpoints before starting the test. +INSERT INTO t1 VALUES (100, REPEAT("x", 4100)); +# Wait for the master-bin.000002 binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000002" +--let $field= Info +--let $condition= = "master-bin.000002" +--source include/wait_show_condition.inc +INSERT INTO t1 VALUES (101, REPEAT("x", 4100)); +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003" +--let $field= Info +--let $condition= = "master-bin.000003" +--source include/wait_show_condition.inc +INSERT INTO t1 VALUES (102, REPEAT("x", 4100)); +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" +--let $field= Info +--let $condition= = "master-bin.000004" +--source include/wait_show_condition.inc + +# Now start a bunch of transactions that span multiple binlog +# files. Leave then in the state prepared-but-not-committed in the engine +# and crash the server. Check that crash recovery is able to recover all +# of them. +# +# We use debug_sync to get all the transactions into the prepared state before +# we commit any of them. This is because the prepare step flushes the InnoDB +# redo log - including any commits made before, so recovery would become +# unnecessary, decreasing the value of this test. +# +# We arrange to have con1 with a prepared transaction in master-bin.000004, +# con2 and con3 with a prepared transaction in master-bin.000005, and a new +# empty master-bin.000006. So the latest binlog checkpoint should be +# master-bin.000006. + +connect(con1,localhost,root,,); +# First wait after prepare and before write to binlog. +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont"; +# Then complete InnoDB commit in memory (but not commit checkpoint / write to +# disk), and hang until crash, leaving a transaction to be XA recovered. +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever"; +send INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con1_wait"; + +connect(con2,localhost,root,,); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever"; +send INSERT INTO t1 VALUES (2, NULL); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con2_wait"; + +connect(con3,localhost,root,,); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever"; +send INSERT INTO t1 VALUES (3, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con3_wait"; + +connect(con4,localhost,root,,); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont"; +SET SESSION debug_dbug="+d,crash_commit_after_log"; +send INSERT INTO t1 VALUES (4, NULL); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con4_wait"; + +SET DEBUG_SYNC= "now SIGNAL con1_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +SET DEBUG_SYNC= "now SIGNAL con2_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; +SET DEBUG_SYNC= "now SIGNAL con3_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con3_ready"; + +# Check that everything is committed in binary log. +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000003 +--let $binlog_start= 4 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000004 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000005 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000006 +--source include/show_binlog_events.inc + + +# Check that server will not purge too much. +PURGE BINARY LOGS TO "master-bin.000006"; +--source include/show_binary_logs.inc + +# Now crash the server with one more transaction in prepared state. +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-binlog_xa_recover.test +EOF +--error 0,2006,2013 +SET DEBUG_SYNC= "now SIGNAL con4_cont"; +connection con4; +--error 2006,2013 +reap; + +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-group_commit_binlog_pos.test +EOF + +connection default; +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that all transactions are recovered. +SELECT a FROM t1 ORDER BY a; + +--echo Test that with multiple binlog checkpoints, recovery starts from the last one. +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +# Rotate to binlog master-bin.000003 while delaying binlog checkpoints. +# So we get multiple binlog checkpoints in master-bin.000003. +# Then complete the checkpoints, crash, and check that we only scan +# the necessary binlog file (ie. that we use the _last_ checkpoint). + +connect(con10,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont"; +send INSERT INTO t1 VALUES (10, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con10_ready"; + +connect(con11,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont"; +send INSERT INTO t1 VALUES (11, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con11_ready"; + +connect(con12,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont"; +send INSERT INTO t1 VALUES (12, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con12_ready"; +INSERT INTO t1 VALUES (13, NULL); + +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000004 +--let $binlog_start= 4 +--source include/show_binlog_events.inc + +SET DEBUG_SYNC= "now SIGNAL con10_cont"; +connection con10; +reap; +connection default; + +# We need to sync the test case with the background processing of the +# commit checkpoint, otherwise we get nondeterministic results. +SET @old_dbug= @@global.DEBUG_DBUG; +SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed"; +SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed"; +SET DEBUG_SYNC= "now SIGNAL con12_cont"; +connection con12; +reap; +connection default; +SET GLOBAL debug_dbug= @old_dbug; + +SET DEBUG_SYNC= "now SIGNAL con11_cont"; +connection con11; +reap; + +connection default; +# Wait for the last (master-bin.000004) binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" +--let $field= Info +--let $condition= = "master-bin.000004" +--source include/wait_show_condition.inc + +--echo Checking that master-bin.000004 is the last binlog checkpoint +--source include/show_binlog_events.inc + +--echo Now crash the server +# It is not too easy to test XA recovery, as it runs early during server +# startup, before any connections can be made. +# What we do is set a DBUG error insert which will crash if XA recovery +# starts from any other binlog than master-bin.000004 (check the file +# binlog_xa_recover-master.opt). Then we will fail here if XA recovery +# would start from the wrong place. +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-binlog_xa_recover.test +EOF +SET SESSION debug_dbug="+d,crash_commit_after_log"; +--error 2006,2013 +INSERT INTO t1 VALUES (14, NULL); + +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-group_commit_binlog_pos.test +EOF + +connection default; +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that all transactions are recovered. +SELECT a FROM t1 ORDER BY a; + + +--echo *** Check that recovery works if we crashed early during rotate, before +--echo *** binlog checkpoint event could be written. + +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +# We need some initial data to reach binlog master-bin.000004. Otherwise +# crash recovery fails due to the error insert used for previous test. +INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (22, REPEAT("x", 4100)); +# Wait for the master-bin.000003 binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003" +--let $field= Info +--let $condition= = "master-bin.000003" +--source include/wait_show_condition.inc +INSERT INTO t1 VALUES (23, REPEAT("x", 4100)); +# Wait for the last (master-bin.000004) binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" +--let $field= Info +--let $condition= = "master-bin.000004" +--source include/wait_show_condition.inc + +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-binlog_xa_recover.test +EOF +SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event"; +--error 2006,2013 +INSERT INTO t1 VALUES (24, REPEAT("x", 4100)); + +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-group_commit_binlog_pos.test +EOF + +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that all transactions are recovered. +SELECT a FROM t1 ORDER BY a; + +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000004 +--let $binlog_start= 4 +--source include/show_binlog_events.inc + +# Cleanup +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt b/mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt deleted file mode 100644 index 3c44f9fad10..00000000000 --- a/mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt +++ /dev/null @@ -1 +0,0 @@ ---skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004 diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover.test b/mysql-test/suite/binlog_encryption/binlog_xa_recover.test index 0e0b80433ff..c03adb6aff2 100644 --- a/mysql-test/suite/binlog_encryption/binlog_xa_recover.test +++ b/mysql-test/suite/binlog_encryption/binlog_xa_recover.test @@ -1 +1 @@ ---source extra/binlog_tests/binlog_xa_recover.inc +--source suite/binlog/t/binlog_xa_recover.test -- cgit v1.2.1 From 3c021485c913828b83510967c1ff277011a9d59a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 19 Feb 2021 16:54:58 +0100 Subject: fix binlog_xa_recover test 1. wait for the binlog thread to reach the certain state, don't use a debug_sync that's incorrectly placed to detect the state 2. no need to do a (non-deterministic) `show binlog events` to verify what is guaranteed by the directly preceding line --- mysql-test/suite/binlog/r/binlog_xa_recover.result | 17 ----------------- mysql-test/suite/binlog/t/binlog_xa_recover.test | 10 +++------- .../suite/binlog_encryption/binlog_xa_recover.result | 18 ------------------ 3 files changed, 3 insertions(+), 42 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/binlog/r/binlog_xa_recover.result b/mysql-test/suite/binlog/r/binlog_xa_recover.result index cb2cad957f0..f5060fd5160 100644 --- a/mysql-test/suite/binlog/r/binlog_xa_recover.result +++ b/mysql-test/suite/binlog/r/binlog_xa_recover.result @@ -146,29 +146,12 @@ master-bin.000004 # Xid # # COMMIT /* XID */ SET DEBUG_SYNC= "now SIGNAL con10_cont"; connection con10; connection default; -SET @old_dbug= @@global.DEBUG_DBUG; -SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed"; -SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed"; SET DEBUG_SYNC= "now SIGNAL con12_cont"; connection con12; connection default; -SET GLOBAL debug_dbug= @old_dbug; SET DEBUG_SYNC= "now SIGNAL con11_cont"; connection con11; connection default; -Checking that master-bin.000004 is the last binlog checkpoint -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -master-bin.000004 # Gtid_list # # [#-#-#] -master-bin.000004 # Binlog_checkpoint # # master-bin.000001 -master-bin.000004 # Gtid # # BEGIN GTID #-#-# -master-bin.000004 # Annotate_rows # # INSERT INTO t1 VALUES (13, NULL) -master-bin.000004 # Table_map # # table_id: # (test.t1) -master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F -master-bin.000004 # Xid # # COMMIT /* XID */ -master-bin.000004 # Binlog_checkpoint # # master-bin.000002 -master-bin.000004 # Binlog_checkpoint # # master-bin.000004 Now crash the server SET SESSION debug_dbug="+d,crash_commit_after_log"; INSERT INTO t1 VALUES (14, NULL); diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover.test b/mysql-test/suite/binlog/t/binlog_xa_recover.test index 9e0906c90f0..51c30ee705d 100644 --- a/mysql-test/suite/binlog/t/binlog_xa_recover.test +++ b/mysql-test/suite/binlog/t/binlog_xa_recover.test @@ -178,14 +178,13 @@ connection default; # We need to sync the test case with the background processing of the # commit checkpoint, otherwise we get nondeterministic results. -SET @old_dbug= @@global.DEBUG_DBUG; -SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed"; -SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed"; +let $wait_condition= select count(*) = 1 from performance_schema.threads where processlist_state = "Waiting for background binlog tasks"; +--source include/wait_condition.inc + SET DEBUG_SYNC= "now SIGNAL con12_cont"; connection con12; reap; connection default; -SET GLOBAL debug_dbug= @old_dbug; SET DEBUG_SYNC= "now SIGNAL con11_cont"; connection con11; @@ -199,9 +198,6 @@ connection default; --let $condition= = "master-bin.000004" --source include/wait_show_condition.inc ---echo Checking that master-bin.000004 is the last binlog checkpoint ---source include/show_binlog_events.inc - --echo Now crash the server # It is not too easy to test XA recovery, as it runs early during server # startup, before any connections can be made. diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover.result b/mysql-test/suite/binlog_encryption/binlog_xa_recover.result index 6e33595eb9e..3e4ed42cf7c 100644 --- a/mysql-test/suite/binlog_encryption/binlog_xa_recover.result +++ b/mysql-test/suite/binlog_encryption/binlog_xa_recover.result @@ -151,30 +151,12 @@ master-bin.000004 # Xid # # COMMIT /* XID */ SET DEBUG_SYNC= "now SIGNAL con10_cont"; connection con10; connection default; -SET @old_dbug= @@global.DEBUG_DBUG; -SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed"; -SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed"; SET DEBUG_SYNC= "now SIGNAL con12_cont"; connection con12; connection default; -SET GLOBAL debug_dbug= @old_dbug; SET DEBUG_SYNC= "now SIGNAL con11_cont"; connection con11; connection default; -Checking that master-bin.000004 is the last binlog checkpoint -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -master-bin.000004 # Start_encryption # # -master-bin.000004 # Gtid_list # # [#-#-#] -master-bin.000004 # Binlog_checkpoint # # master-bin.000001 -master-bin.000004 # Gtid # # BEGIN GTID #-#-# -master-bin.000004 # Annotate_rows # # INSERT INTO t1 VALUES (13, NULL) -master-bin.000004 # Table_map # # table_id: # (test.t1) -master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F -master-bin.000004 # Xid # # COMMIT /* XID */ -master-bin.000004 # Binlog_checkpoint # # master-bin.000002 -master-bin.000004 # Binlog_checkpoint # # master-bin.000004 Now crash the server SET SESSION debug_dbug="+d,crash_commit_after_log"; INSERT INTO t1 VALUES (14, NULL); -- cgit v1.2.1 From 640f42311a72fa82bf7117c2791fc47ceb420361 Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 20 Feb 2021 14:46:19 +0200 Subject: MDEV-24929 Server crash in thr_multi_unlock or in get_schema_tables_result This was caused by two different bugs: 1) Information_schema tables where not locked by lock_tables, but get_lock_data() was not filtering these out. This caused a crash when mysql_unlock_some_tables() tried to unlock tables early, including not locked information schema tables. Fixed by not locking SYSTEM_TMP_TABLES 2) In some cases the optimizer will notice that we do not need to read the information_schema tables at all. In this case join_tab->read_record is not set, which caused a crash in get_schema_tables_result() Fixed by ignoring const tables in get_schema_tables_result() --- mysql-test/main/information_schema.result | 13 +++++++++++++ mysql-test/main/information_schema.test | 10 ++++++++++ 2 files changed, 23 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result index 93ff6e170f6..c65a10cbd4b 100644 --- a/mysql-test/main/information_schema.result +++ b/mysql-test/main/information_schema.result @@ -2303,5 +2303,18 @@ group by f; f drop table t1; # +# MDEV-24929 Server crash in thr_multi_unlock or in +# get_schema_tables_result upon select from I_S with joins +# +CREATE TABLE t1 (a TIMESTAMP, KEY (a)); +INSERT INTO t1 VALUES ('2012-12-12'),('2021-11-11'); +SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.ROUTINES) ON (t1b.a IS NULL); +count(*) +2 +SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.PROFILING) ON (t1b.a IS NULL); +count(*) +2 +DROP TABLE t1; +# # End of 10.3 tests # diff --git a/mysql-test/main/information_schema.test b/mysql-test/main/information_schema.test index 6319cc79df7..4468eb18e45 100644 --- a/mysql-test/main/information_schema.test +++ b/mysql-test/main/information_schema.test @@ -2034,6 +2034,16 @@ inner join t1 on f=i.column_name group by f; drop table t1; +--echo # +--echo # MDEV-24929 Server crash in thr_multi_unlock or in +--echo # get_schema_tables_result upon select from I_S with joins +--echo # + +CREATE TABLE t1 (a TIMESTAMP, KEY (a)); +INSERT INTO t1 VALUES ('2012-12-12'),('2021-11-11'); +SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.ROUTINES) ON (t1b.a IS NULL); +SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.PROFILING) ON (t1b.a IS NULL); +DROP TABLE t1; --echo # --echo # End of 10.3 tests --echo # -- cgit v1.2.1 From 8b77e6c6760239b1d97da770722c881b2fdb70d3 Mon Sep 17 00:00:00 2001 From: Robert Bindar Date: Tue, 15 Dec 2020 17:39:24 +0200 Subject: MDEV-24114 SHOW CREATE USER doesnt display correct password expiry status Given PASSWORD EXPIRE and PASSWORD EXPIRE [NEVER|INTERVAL x DAY] are two different mechanisms, SHOW CREATE USER should display all the information required to restore the state of an account which includes both a manual expired state and an automatic policy. The solution proposed here keeps a CREATE USER ... PASSWORD EXPIRE statement and adds an aditional ALTER USER .. PASSWORD EXPIRE [NEVER|INTERVAL x DAY] when necessary This way a tool can restore almost the complete state of an account as it was before a dump. The only information left still is the value of the password_last_changed column from mysql.global_priv --- mysql-test/main/lock_user.result | 2 ++ mysql-test/main/password_expiration.result | 5 +++++ mysql-test/main/system_mysql_db_507.result | 1 + 3 files changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/main/lock_user.result b/mysql-test/main/lock_user.result index 7d9aeebb7aa..560ae6ce425 100644 --- a/mysql-test/main/lock_user.result +++ b/mysql-test/main/lock_user.result @@ -156,6 +156,7 @@ alter user user1@localhost PASSWORD EXPIRE NEVER ACCOUNT UNLOCK ; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER alter user user1@localhost ACCOUNT LOCK PASSWORD EXPIRE DEFAULT; show create user user1@localhost; CREATE USER for user1@localhost @@ -167,5 +168,6 @@ localhost user1 {"access":0,"plugin":"mysql_native_password","authentication_str show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE INTERVAL 60 DAY drop user user1@localhost; drop user user2@localhost; diff --git a/mysql-test/main/password_expiration.result b/mysql-test/main/password_expiration.result index d05f6b3b5d0..897811bb4ad 100644 --- a/mysql-test/main/password_expiration.result +++ b/mysql-test/main/password_expiration.result @@ -125,6 +125,7 @@ alter user user1@localhost password expire; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE INTERVAL 123 DAY set password for user1@localhost= password(''); show create user user1@localhost; CREATE USER for user1@localhost @@ -151,10 +152,12 @@ alter user user1@localhost password expire; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER flush privileges; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER set password for user1@localhost= password(''); alter user user1@localhost password expire default; show create user user1@localhost; @@ -184,10 +187,12 @@ alter user user1@localhost password expire; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER flush privileges; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER set global disconnect_on_expired_password=ON; connect(localhost,user1,,test,MYSQL_PORT,MYSQL_SOCK); connect con1,localhost,user1; diff --git a/mysql-test/main/system_mysql_db_507.result b/mysql-test/main/system_mysql_db_507.result index 2d68dc82529..8069405aa3a 100644 --- a/mysql-test/main/system_mysql_db_507.result +++ b/mysql-test/main/system_mysql_db_507.result @@ -214,6 +214,7 @@ alter user user@localhost password expire; show create user user@localhost; CREATE USER for user@localhost CREATE USER `user`@`localhost` PASSWORD EXPIRE +ALTER USER `user`@`localhost` PASSWORD EXPIRE INTERVAL 123 DAY set password for user@localhost= password(''); show create user user@localhost; CREATE USER for user@localhost -- cgit v1.2.1