From ae96b47f9ed184cdfe6622f564312209e2cd9251 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sun, 18 Nov 2018 17:38:48 +0200 Subject: MDEV-17507 Make MTR tests work for builds without Aria for temporary tables Skip tests which expectedly fail when Aria is not used for temporary tables --- mysql-test/include/have_aria_used_for_temp_tables.inc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 mysql-test/include/have_aria_used_for_temp_tables.inc (limited to 'mysql-test/include') diff --git a/mysql-test/include/have_aria_used_for_temp_tables.inc b/mysql-test/include/have_aria_used_for_temp_tables.inc new file mode 100644 index 00000000000..c921ba91d22 --- /dev/null +++ b/mysql-test/include/have_aria_used_for_temp_tables.inc @@ -0,0 +1,4 @@ +if (!`SELECT @@aria_used_for_temp_tables`) +{ + skip Need Aria to be used for temporary tables; +} -- cgit v1.2.1 From 8324e5e84dc786b2d4a07d7798f26ddea239159e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 21 Nov 2018 09:05:47 +0200 Subject: MDEV-17771: Add Galera ist and sst tests using mariabackup Add test case for encrypted and page compressed tables. --- mysql-test/include/innodb_encrypt_tables.combinations | 14 ++++++++++++++ mysql-test/include/innodb_encrypt_tables.inc | 4 ++++ 2 files changed, 18 insertions(+) create mode 100644 mysql-test/include/innodb_encrypt_tables.combinations create mode 100644 mysql-test/include/innodb_encrypt_tables.inc (limited to 'mysql-test/include') diff --git a/mysql-test/include/innodb_encrypt_tables.combinations b/mysql-test/include/innodb_encrypt_tables.combinations new file mode 100644 index 00000000000..cb32fea998a --- /dev/null +++ b/mysql-test/include/innodb_encrypt_tables.combinations @@ -0,0 +1,14 @@ +[crypt] +innodb_encrypt_tables=ON +plugin-load-add=$FILE_KEY_MANAGEMENT_SO +loose-file-key-management +loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt +file-key-management-encryption-algorithm=aes_ctr + +[clear] +innodb_encrypt_tables=OFF +plugin-load-add=$FILE_KEY_MANAGEMENT_SO +loose-file-key-management +loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt +file-key-management-encryption-algorithm=aes_ctr + diff --git a/mysql-test/include/innodb_encrypt_tables.inc b/mysql-test/include/innodb_encrypt_tables.inc new file mode 100644 index 00000000000..31ab7999aef --- /dev/null +++ b/mysql-test/include/innodb_encrypt_tables.inc @@ -0,0 +1,4 @@ +# The goal of including this file is to enable innodb_encrypt_tables combinations +# (see include/innodb_encrypt_tables.combinations) + +--source include/have_innodb.inc -- cgit v1.2.1 From 9207a838ededa0d5f40129848de20a2075ab0e44 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Sun, 9 Dec 2018 13:25:27 +0530 Subject: MDEV-17255: New optimizer defaults and ANALYZE TABLE Added to new values to the server variable use_stat_tables. The values are COMPLEMENTARY_FOR_QUERIES and PREFERABLY_FOR_QUERIES. Both these values don't allow to collect EITS for queries like analyze table t1; To collect EITS we would need to use the syntax with persistent like analyze table t1 persistent for columns (col1,col2...) index (idx1, idx2...) / ALL Changing the default value from NEVER to PREFERABLY_FOR_QUERIES. --- mysql-test/include/default_mysqld.cnf | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/include') diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 69a2b58288b..edae06ee7be 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -107,6 +107,7 @@ loose-performance-schema-consumer-thread-instrumentation=ON binlog-direct-non-transactional-updates default-storage-engine=myisam +use_stat_tables=preferably loose-ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem loose-ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/server-cert.pem -- cgit v1.2.1 From 7a9dfdd8d985040778881fe815cfca019fdd37f1 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 30 Oct 2018 00:09:02 +0400 Subject: Combine GLOBAL and COMMIT namespaces into BACKUP namespace. Part of MDEV-5336 Implement LOCK FOR BACKUP Other things: - Added printing of MDL locks to DBUG. --- mysql-test/include/check_ftwrl_incompatible.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'mysql-test/include') diff --git a/mysql-test/include/check_ftwrl_incompatible.inc b/mysql-test/include/check_ftwrl_incompatible.inc index 4787a69ea9c..a7e87c3750b 100644 --- a/mysql-test/include/check_ftwrl_incompatible.inc +++ b/mysql-test/include/check_ftwrl_incompatible.inc @@ -68,8 +68,7 @@ connection $con_aux1; --enable_query_log let $wait_condition= select count(*) = 1 from information_schema.processlist - where (state = "Waiting for global read lock" or - state = "Waiting for commit lock") and + where state = "Waiting for backup lock" and info = "$statement"; --source include/wait_condition.inc --disable_result_log @@ -116,8 +115,7 @@ connection $con_aux2; --enable_query_log let $wait_condition= select count(*) = 1 from information_schema.processlist - where (state = "Waiting for global read lock" or - state = "Waiting for commit lock") and + where state = "Waiting for backup lock" and info = "flush tables with read lock"; --source include/wait_condition.inc --disable_result_log -- cgit v1.2.1 From a4ac987cbc77fc89eeadd5725a5dc7d658bf45e8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 11 Dec 2018 18:22:40 +0100 Subject: more tests for mysql_install_db.exe --- mysql-test/include/wait_until_connected_again.inc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'mysql-test/include') diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc index 26168d10558..15a1e5bf847 100644 --- a/mysql-test/include/wait_until_connected_again.inc +++ b/mysql-test/include/wait_until_connected_again.inc @@ -11,7 +11,7 @@ let $counter= 5000; let $mysql_errno= 9999; while ($mysql_errno) { - --error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,ER_LOCK_WAIT_TIMEOUT,2002,2006,2013 + --error 0,ER_ACCESS_DENIED_ERROR,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,ER_LOCK_WAIT_TIMEOUT,2002,2006,2013 show status; dec $counter; @@ -19,13 +19,18 @@ while ($mysql_errno) { --die Server failed to restart } + if (!$mysql_errno) + { + # WSREP: SHOW STATUS queries are allowed even if wsrep + # is not ready. Make sure wsrep is ready before + # returning from this script + source include/wait_wsrep_ready.inc; + } + if ($mysql_errno == 1045) + { + let $mysql_errno=0; + } --sleep 0.1 } --enable_query_log --enable_result_log - -# WSREP: SHOW STATUS queries are allowed even if wsrep -# is not ready. Make sure wsrep is ready before -# returning from this script - ---source include/wait_wsrep_ready.inc -- cgit v1.2.1 From 4abb8216a054e14afbeb81e8529e02bab6fa14ac Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 24 Nov 2018 14:13:41 +0100 Subject: MDEV-17658 change the structure of mysql.user table Implement User_table_json. Fix scripts to use mysql.global_priv. Fix tests. --- mysql-test/include/add_anonymous_users.inc | 2 +- mysql-test/include/mtr_check.sql | 2 +- mysql-test/include/switch_to_mysql_global_priv.inc | 6 +++ mysql-test/include/switch_to_mysql_user.inc | 56 ++++++++++++++++++++++ mysql-test/include/system_db_struct.inc | 1 + 5 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 mysql-test/include/switch_to_mysql_global_priv.inc create mode 100644 mysql-test/include/switch_to_mysql_user.inc (limited to 'mysql-test/include') diff --git a/mysql-test/include/add_anonymous_users.inc b/mysql-test/include/add_anonymous_users.inc index 635a80e3dee..86ce529d1e2 100644 --- a/mysql-test/include/add_anonymous_users.inc +++ b/mysql-test/include/add_anonymous_users.inc @@ -1,7 +1,7 @@ # Allow anonymous users to connect disable_warnings; disable_query_log; -INSERT IGNORE INTO mysql.user (host, user) VALUES ('localhost',''); +INSERT IGNORE INTO mysql.global_priv (host, user) VALUES ('localhost',''); FLUSH PRIVILEGES; enable_query_log; enable_warnings; diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index 8548200f437..b5673b2a313 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -95,7 +95,7 @@ BEGIN mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, - mysql.user; + mysql.global_priv; -- verify that no plugin changed its disabled/enabled state SELECT * FROM INFORMATION_SCHEMA.PLUGINS; diff --git a/mysql-test/include/switch_to_mysql_global_priv.inc b/mysql-test/include/switch_to_mysql_global_priv.inc new file mode 100644 index 00000000000..78df6642760 --- /dev/null +++ b/mysql-test/include/switch_to_mysql_global_priv.inc @@ -0,0 +1,6 @@ +disable_query_log; +drop table mysql.user; +rename table mysql.user_bak to mysql.user; +rename table mysql.global_priv_bak to mysql.global_priv; +flush privileges; +enable_query_log; diff --git a/mysql-test/include/switch_to_mysql_user.inc b/mysql-test/include/switch_to_mysql_user.inc new file mode 100644 index 00000000000..f5801db6114 --- /dev/null +++ b/mysql-test/include/switch_to_mysql_user.inc @@ -0,0 +1,56 @@ +disable_query_log; +rename table mysql.user to mysql.user_bak; +CREATE TABLE mysql.user ( + Host char(60) binary DEFAULT '' NOT NULL, + User char(80) binary DEFAULT '' NOT NULL, + Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, + Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + Delete_history_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + ssl_type enum('','ANY','X509','SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + ssl_cipher BLOB NOT NULL, + x509_issuer BLOB NOT NULL, + x509_subject BLOB NOT NULL, + max_questions int(11) unsigned DEFAULT 0 NOT NULL, + max_updates int(11) unsigned DEFAULT 0 NOT NULL, + max_connections int(11) unsigned DEFAULT 0 NOT NULL, + max_user_connections int(11) DEFAULT 0 NOT NULL, + plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, + authentication_string TEXT NOT NULL, + password_expired ENUM('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + is_role enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + default_role char(80) binary DEFAULT '' NOT NULL, + max_statement_time decimal(12,6) DEFAULT 0 NOT NULL, + PRIMARY KEY Host (Host,User) +) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +insert mysql.user select * from mysql.user_bak; +rename table mysql.global_priv to mysql.global_priv_bak; +flush privileges; +enable_query_log; diff --git a/mysql-test/include/system_db_struct.inc b/mysql-test/include/system_db_struct.inc index 7dd7746459e..d043d209850 100644 --- a/mysql-test/include/system_db_struct.inc +++ b/mysql-test/include/system_db_struct.inc @@ -7,6 +7,7 @@ show tables; show create table db; show create table user; show create table func; +show create table global_priv; show create table tables_priv; show create table columns_priv; show create table procs_priv; -- cgit v1.2.1 From ee543beabf01c1eff15fc8e888ef62fc99efbaed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 17 Dec 2018 07:05:27 +0200 Subject: MDEV-18021: Galera test galera_sst_mariabackup_table_options fails if AES_CTR is not available Problem is that if you use bundled yassl AES_CTR is not supported. There is a way to detect that but as we really want to keep this test enabled did not add skip for missing support. Changed method to AES_CBC as there is no need to use AES_CTR. --- mysql-test/include/innodb_encrypt_tables.combinations | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/include') diff --git a/mysql-test/include/innodb_encrypt_tables.combinations b/mysql-test/include/innodb_encrypt_tables.combinations index cb32fea998a..4ca9b672119 100644 --- a/mysql-test/include/innodb_encrypt_tables.combinations +++ b/mysql-test/include/innodb_encrypt_tables.combinations @@ -3,12 +3,12 @@ innodb_encrypt_tables=ON plugin-load-add=$FILE_KEY_MANAGEMENT_SO loose-file-key-management loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt -file-key-management-encryption-algorithm=aes_ctr +file-key-management-encryption-algorithm=aes_cbc [clear] innodb_encrypt_tables=OFF plugin-load-add=$FILE_KEY_MANAGEMENT_SO loose-file-key-management loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt -file-key-management-encryption-algorithm=aes_ctr +file-key-management-encryption-algorithm=aes_cbc -- cgit v1.2.1 From 83c81d8991fd72fb8af54172c612310e885720f5 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 5 Dec 2018 13:13:07 +0100 Subject: MDEV-7598 Lock user after too many password errors --- mysql-test/include/have_auth_named_pipe.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 mysql-test/include/have_auth_named_pipe.inc (limited to 'mysql-test/include') diff --git a/mysql-test/include/have_auth_named_pipe.inc b/mysql-test/include/have_auth_named_pipe.inc new file mode 100644 index 00000000000..4f4bf37f11e --- /dev/null +++ b/mysql-test/include/have_auth_named_pipe.inc @@ -0,0 +1,13 @@ +--source include/not_embedded.inc + +if (!$AUTH_NAMED_PIPE_SO) { + skip No auth_named_pipe plugin; +} + +if (!$USERNAME) { + skip USER variable is undefined; +} + +if (`SELECT count(*) <> 0 FROM mysql.user WHERE user = '$USERNAME'`) { + skip %USERNAME%=$USER which exists in mysql.user; +} -- cgit v1.2.1 From 36a2a185fe18d31a644da46cfabd9757a379280c Mon Sep 17 00:00:00 2001 From: Brave Galera Crew Date: Wed, 23 Jan 2019 15:30:00 +0400 Subject: Galera4 --- mysql-test/include/check-testcase.test | 51 +++++++++++++++++++++++++++ mysql-test/include/galera_cluster.inc | 6 ++++ mysql-test/include/galera_have_debug_sync.inc | 9 +++++ mysql-test/include/galera_wait_sync_point.inc | 11 ++++++ mysql-test/include/have_wsrep_enabled.inc | 1 - mysql-test/include/kill_galera.inc | 20 +++++++++++ mysql-test/include/wsrep_wait_disconnect.inc | 20 +++++++++++ 7 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 mysql-test/include/galera_have_debug_sync.inc create mode 100644 mysql-test/include/kill_galera.inc create mode 100644 mysql-test/include/wsrep_wait_disconnect.inc (limited to 'mysql-test/include') diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test index a9c8e13fa7c..39aa3d49d68 100644 --- a/mysql-test/include/check-testcase.test +++ b/mysql-test/include/check-testcase.test @@ -103,5 +103,56 @@ cat_file $datadir.tempfiles.txt; remove_file $datadir.tempfiles.txt; list_files $datadir/mysql #sql*; +# +# Check that SHOW ENGINE INNODB STATUS does not show any active transactions +# We do this only if wsrep provider is loaded, to avoid disturbing any non-Galera MTR tests +# +if (`SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`) { + if (`SELECT @@wsrep_on`) { + if (`SELECT COUNT(*) FROM information_schema.innodb_trx WHERE trx_mysql_thread_id != 0`) { + if ($before) { + --echo Before test start. + } + if (!$before) { + --echo After test end. + } + --echo There is one or more active InnoDB transaction(s) when there should be none. Dumping some diagnostics. + + --let $status_locks = `SELECT @@innodb_status_output_locks` + --let $status_output = `SELECT @@innodb_status_output` + --enable_query_log + SET GLOBAL innodb_status_output_locks=ON; + SHOW ENGINE INNODB STATUS; + --disable_query_log + --eval SET GLOBAL innodb_status_output_locks=$status_locks; + --eval SET GLOBAL innodb_status_output=$status_output; + --enable_query_log + + --vertical_results + if ($before) { + --replace_regex /$/ / + } + SELECT * FROM information_schema.processlist; + + if ($before) { + --replace_regex /$/ / + } + SELECT * FROM information_schema.innodb_trx; + + if ($before) { + --replace_regex /$/ / + } + SELECT * FROM information_schema.innodb_locks; + + if ($before) { + --replace_regex /$/ / + } + SELECT * FROM information_schema.innodb_lock_waits; + --horizontal_results + --disable_query_log + } + } +} + --enable_query_log diff --git a/mysql-test/include/galera_cluster.inc b/mysql-test/include/galera_cluster.inc index c1834c3c26f..7f76ea59c7f 100644 --- a/mysql-test/include/galera_cluster.inc +++ b/mysql-test/include/galera_cluster.inc @@ -8,5 +8,11 @@ --let $galera_cluster_size = 2 --source include/galera_init.inc +--source include/have_innodb.inc +--source include/galera_wait_ready.inc +--connection node_2 +--source include/galera_wait_ready.inc --source include/have_innodb.inc + +--connection node_1 diff --git a/mysql-test/include/galera_have_debug_sync.inc b/mysql-test/include/galera_have_debug_sync.inc new file mode 100644 index 00000000000..7c0156052d8 --- /dev/null +++ b/mysql-test/include/galera_have_debug_sync.inc @@ -0,0 +1,9 @@ +--disable_query_log + +--let $galera_have_debug_sync = `SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'` + +--if (!$galera_have_debug_sync) { + --skip "Test requires Galera debug library with debug_sync functionality" +} + +--enable_query_log diff --git a/mysql-test/include/galera_wait_sync_point.inc b/mysql-test/include/galera_wait_sync_point.inc index cf3a4980186..c0951b220b4 100644 --- a/mysql-test/include/galera_wait_sync_point.inc +++ b/mysql-test/include/galera_wait_sync_point.inc @@ -1,6 +1,17 @@ --let $wait_timeout = 10 --let $wsrep_on_orig = `SELECT @@wsrep_on` SET SESSION wsrep_on = 0; + +# +# following is only for debugging purposes +# should be commented out when test wporks as planned +# +#--sleep 1 +# SHOW PROCESSLIST; +#SHOW STATUS LIKE 'wsrep_%'; +#--echo $galera_sync_point + --let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = '$galera_sync_point' --source include/wait_condition.inc --eval SET SESSION wsrep_on = $wsrep_on_orig + diff --git a/mysql-test/include/have_wsrep_enabled.inc b/mysql-test/include/have_wsrep_enabled.inc index 9287369c87c..7eb8b4372cf 100644 --- a/mysql-test/include/have_wsrep_enabled.inc +++ b/mysql-test/include/have_wsrep_enabled.inc @@ -1,7 +1,6 @@ # To be used in a test which requires wsrep plugin to be ACTIVE and enabled # (i.e. wsrep_on=ON). It includes have_wsrep.inc. ---source include/have_wsrep.inc --source include/have_innodb.inc if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_on' AND VARIABLE_VALUE='ON'`) diff --git a/mysql-test/include/kill_galera.inc b/mysql-test/include/kill_galera.inc new file mode 100644 index 00000000000..d7f665df6c7 --- /dev/null +++ b/mysql-test/include/kill_galera.inc @@ -0,0 +1,20 @@ +--echo Killing server ... + +# Write file to make mysql-test-run.pl expect the crash, but don't start it +--let $_server_id= `SELECT @@server_id` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--exec echo "wait" > $_expect_file_name + +# Kill the connected server +--disable_reconnect +--let KILL_NODE_PIDFILE = `SELECT @@pid_file` + +--perl + my $pid_filename = $ENV{'KILL_NODE_PIDFILE'}; + my $mysqld_pid = `cat $pid_filename`; + chomp($mysqld_pid); + system("kill -9 $mysqld_pid"); + exit(0); +EOF + +--source include/wait_until_disconnected.inc diff --git a/mysql-test/include/wsrep_wait_disconnect.inc b/mysql-test/include/wsrep_wait_disconnect.inc new file mode 100644 index 00000000000..740fc0d9426 --- /dev/null +++ b/mysql-test/include/wsrep_wait_disconnect.inc @@ -0,0 +1,20 @@ +let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'OFF'; +# since this is called until AFTER provider disconnects,we need to allow +# queries in non-prim +# +# We are also forced to use a hard-coded value for wsrep_sync_wait here because +# we can not issue a SELECT query to obtain the original value and then restore +# it +disable_query_log; +SET SESSION wsrep_sync_wait = 7; +--let $restore_wsrep_on = `SHOW VARIABLES WHERE Variable_name = 'wsrep_on' AND Value = 'ON'` +SET SESSION wsrep_on = OFF; + +--source include/wait_condition.inc + +if ($restore_wsrep_on != "") +{ + --eval SET SESSION wsrep_on = ON +} +SET SESSION wsrep_sync_wait = 15; +enable_query_log; -- cgit v1.2.1 From 9c60535f867678e65ade1258ca10b7d2ee2bdc53 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 26 Jan 2019 22:29:24 +0100 Subject: SSL test fixes * fix CRL tests to work * regenerate certificates to be at least 2048 bit (fixes buster and rhel8 in buildbot) * update generate-ssl-cert.sh to generate crl files * make all SSL tests to use certificates generated in generate-ssl-cert.sh, remove unused certificates --- mysql-test/include/have_openssl.inc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'mysql-test/include') diff --git a/mysql-test/include/have_openssl.inc b/mysql-test/include/have_openssl.inc index c9260123f9d..ee51ee4527a 100644 --- a/mysql-test/include/have_openssl.inc +++ b/mysql-test/include/have_openssl.inc @@ -1,7 +1,4 @@ --- source include/have_ssl_communication.inc -let $crllen=`select length(trim(coalesce(@@ssl_crl, ''))) + length(trim(coalesce(@@ssl_crlpath, '')))`; -if (!$crllen) -{ +if (`SELECT count(*) = 0 FROM information_schema.GLOBAL_VARIABLES WHERE + VARIABLE_NAME = 'have_openssl' AND VARIABLE_VALUE = 'YES'`){ skip Needs OpenSSL; } - -- cgit v1.2.1