From 429382c29f2dc6bcd97b623d3acfe493caf37eb4 Mon Sep 17 00:00:00 2001 From: Dmitry Shulga Date: Thu, 15 Jul 2021 16:27:31 +0700 Subject: MDEV-26142: Fix failures of the tests main.features and sys_vars.stored_program_cache_func when they are run in PS mode These tests produced different results in case they were run with the option --ps-protocol. These tests produced different result sets since a value of Feature_subquery and handler_read_key status system variables are updated one time more for ps-protocol (the first time it is updated on Prepare phase and the second time on Execute phase of PS protocol) So different result sets are expected for both tests. To make tests successfully runnable both for case it is run with and without the option --ps-protocol the new protocol combination [ps, nm] and protocol specific result files have been added. Moreover, the perl script mysql-test/mariadb-test-run.pl has been updated to make the variable opt_ps_protocol visible outside perl file containing this variable. --- mysql-test/include/protocol.combinations | 3 +++ mysql-test/include/protocol.inc | 2 ++ mysql-test/main/features,ps.rdiff | 21 +++++++++++++++++++++ mysql-test/main/features.test | 5 +---- mysql-test/mariadb-test-run.pl | 2 +- mysql-test/suite.pm | 6 ++++++ .../sys_vars/r/stored_program_cache_func,ps.rdiff | 18 ++++++++++++++++++ .../suite/sys_vars/t/stored_program_cache_func.test | 6 ++---- 8 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 mysql-test/include/protocol.combinations create mode 100644 mysql-test/include/protocol.inc create mode 100644 mysql-test/main/features,ps.rdiff create mode 100644 mysql-test/suite/sys_vars/r/stored_program_cache_func,ps.rdiff diff --git a/mysql-test/include/protocol.combinations b/mysql-test/include/protocol.combinations new file mode 100644 index 00000000000..fa5b08c0e51 --- /dev/null +++ b/mysql-test/include/protocol.combinations @@ -0,0 +1,3 @@ +[nm] + +[ps] diff --git a/mysql-test/include/protocol.inc b/mysql-test/include/protocol.inc new file mode 100644 index 00000000000..02f8c3f3dec --- /dev/null +++ b/mysql-test/include/protocol.inc @@ -0,0 +1,2 @@ +# The goal of including this file is to enable protocol +# combinations (see include/protocol.combinations) diff --git a/mysql-test/main/features,ps.rdiff b/mysql-test/main/features,ps.rdiff new file mode 100644 index 00000000000..9065c132714 --- /dev/null +++ b/mysql-test/main/features,ps.rdiff @@ -0,0 +1,21 @@ +--- features.result ++++ features,ps.result +@@ -46,7 +46,7 @@ + 1212 + show status like "feature_dynamic_columns"; + Variable_name Value +-Feature_dynamic_columns 2 ++Feature_dynamic_columns 4 + # + # Feature fulltext + # +@@ -93,7 +93,7 @@ + drop table t1; + show status like "feature_subquery"; + Variable_name Value +-Feature_subquery 4 ++Feature_subquery 5 + # + # Feature timezone + # + diff --git a/mysql-test/main/features.test b/mysql-test/main/features.test index 0dd0be20c9e..14c86255c37 100644 --- a/mysql-test/main/features.test +++ b/mysql-test/main/features.test @@ -1,10 +1,7 @@ # Testing of feature statistics -if (`SELECT $PS_PROTOCOL != 0`) -{ - --skip Test temporarily disabled for ps-protocol -} -- source include/have_geometry.inc +-- source include/protocol.inc --disable_warnings drop table if exists t1; diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl index becf799c825..7b9422565ab 100755 --- a/mysql-test/mariadb-test-run.pl +++ b/mysql-test/mariadb-test-run.pl @@ -244,7 +244,7 @@ my $opt_ssl; my $opt_skip_ssl; my @opt_skip_test_list; our $opt_ssl_supported; -my $opt_ps_protocol; +our $opt_ps_protocol; my $opt_sp_protocol; my $opt_cursor_protocol; my $opt_view_protocol; diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm index 5100b4137a2..4cc6b410fa1 100644 --- a/mysql-test/suite.pm +++ b/mysql-test/suite.pm @@ -25,6 +25,12 @@ sub skip_combinations { $skip{'include/platform.combinations'} = [ 'aix', 'win' ]; } + if ( $::opt_ps_protocol ) { + $skip{'include/protocol.combinations'} = [ 'nm' ]; + } else { + $skip{'include/protocol.combinations'} = [ 'ps' ]; + } + $skip{'include/maybe_debug.combinations'} = [ defined $::mysqld_variables{'debug-dbug'} ? 'release' : 'debug' ]; diff --git a/mysql-test/suite/sys_vars/r/stored_program_cache_func,ps.rdiff b/mysql-test/suite/sys_vars/r/stored_program_cache_func,ps.rdiff new file mode 100644 index 00000000000..f07e82c3472 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/stored_program_cache_func,ps.rdiff @@ -0,0 +1,18 @@ +--- stored_program_cache_func.result ++++ stored_program_cache_func,ps.result +@@ -21,13 +21,13 @@ + 1 + show status like 'handler_read_key'; + Variable_name Value +-Handler_read_key 2 ++Handler_read_key 3 + call p1; + 1 + 1 + show status like 'handler_read_key'; + Variable_name Value +-Handler_read_key 3 ++Handler_read_key 5 + drop procedure p1; + set global stored_program_cache=default; + create procedure pr(i int) begin diff --git a/mysql-test/suite/sys_vars/t/stored_program_cache_func.test b/mysql-test/suite/sys_vars/t/stored_program_cache_func.test index 86cdd56a6de..611c33b530e 100644 --- a/mysql-test/suite/sys_vars/t/stored_program_cache_func.test +++ b/mysql-test/suite/sys_vars/t/stored_program_cache_func.test @@ -1,7 +1,5 @@ -if (`SELECT $PS_PROTOCOL != 0`) -{ - --skip Test temporarily disabled for ps-protocol -} +--source include/protocol.inc + create procedure p1() select 1; flush status; -- cgit v1.2.1