diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-06-11 13:00:18 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-06-11 13:00:18 +0300 |
commit | b42dbdbccd3b939394ca9b608ad91a04235e95f1 (patch) | |
tree | e969f314963faa202fdb6f87d5aca67810844742 /mysql-test | |
parent | 490dcfd5d74ce45cbdd6105e4295116f6a944e2b (diff) | |
parent | cbac8f935182ecc5bb907de3ae48942467f0b8ba (diff) | |
download | mariadb-git-b42dbdbccd3b939394ca9b608ad91a04235e95f1.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/lib/My/Config.pm | 17 | ||||
-rw-r--r-- | mysql-test/lib/My/ConfigFactory.pm | 8 | ||||
-rw-r--r-- | mysql-test/main/subselect_no_semijoin.result | 55 | ||||
-rw-r--r-- | mysql-test/main/subselect_no_semijoin.test | 23 | ||||
-rw-r--r-- | mysql-test/main/win.result | 27 | ||||
-rw-r--r-- | mysql-test/main/win.test | 16 | ||||
-rw-r--r-- | mysql-test/suite/binlog/r/flashback-largebinlog.result | 71 | ||||
-rw-r--r-- | mysql-test/suite/binlog/t/flashback-largebinlog.test | 110 | ||||
-rw-r--r-- | mysql-test/suite/encryption/r/compressed_import_tablespace.result | 39 | ||||
-rw-r--r-- | mysql-test/suite/encryption/t/compressed_import_tablespace.opt | 3 | ||||
-rw-r--r-- | mysql-test/suite/encryption/t/compressed_import_tablespace.test | 46 | ||||
-rw-r--r-- | mysql-test/valgrind.supp | 21 |
12 files changed, 431 insertions, 5 deletions
diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm index 12647edf0a4..ecc0830c3df 100644 --- a/mysql-test/lib/My/Config.pm +++ b/mysql-test/lib/My/Config.pm @@ -21,6 +21,17 @@ use strict; use warnings; use Carp; +# Define all MariaDB options that the user should be able to specify +# many times in the config file. Note that options must be written +# using '-' instead of '_' here! + +my %multipart_options= + ( + "plugin-load-add" => 1, + "optimizer-switch" => 1, +); + + sub new { my ($class, $option_name, $option_value)= @_; my $self= bless { name => $option_name, @@ -327,7 +338,6 @@ sub new { # Skip comment next; } - else { croak "Unexpected line '$line' found in '$path'"; } @@ -355,6 +365,11 @@ sub insert { if ( defined $option ) { #print "option: $option, value: $value\n"; + my $tmp_option= $option; + $tmp_option =~ s/_/-/g; + + # If the option is an option that one can specify many times, always add + $if_not_exist= 1 if ($multipart_options{$tmp_option}); # Add the option to the group $group->insert($option, $value, $if_not_exist); diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index cae2c8c33e5..72d7600e8df 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -311,7 +311,7 @@ sub post_check_client_groups { $first_mysqld->name()); # Then generate [client.<suffix>] for each [mysqld.<suffix>] - foreach my $mysqld ( $config->like('mysqld.') ) { + foreach my $mysqld ( $config->like('mysqld\.') ) { $self->post_check_client_group($config, 'client'.$mysqld->after('mysqld'), $mysqld->name()) @@ -333,7 +333,7 @@ sub post_check_embedded_group { my $mysqld= $config->group('mysqld') or croak "Can't run with embedded, config has no default mysqld section"; - my $first_mysqld= $config->first_like('mysqld.') or + my $first_mysqld= $config->first_like('mysqld\.') or croak "Can't run with embedded, config has no mysqld"; my %no_copy = map { $_ => 1 } @@ -372,7 +372,7 @@ sub resolve_at_variable { } $res .= $after; - $config->insert($group->name(), $option->name(), $res) + $option->{value}= $res; } @@ -457,7 +457,7 @@ sub new_config { } $self->run_section_rules($config, - 'mysqld.', + 'mysqld\.', @mysqld_rules); # [mysqlbinlog] need additional settings diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result index e58a01d1983..505d4a712e2 100644 --- a/mysql-test/main/subselect_no_semijoin.result +++ b/mysql-test/main/subselect_no_semijoin.result @@ -7290,5 +7290,60 @@ pk i c pk i c 1 10 foo 1 10 foo DROP TABLE t; # End of 10.2 tests +# +# MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON +# +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (1),(5); +CREATE TABLE t2 ( b INT ) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1); +CREATE TABLE t3 ( c INT ); +INSERT INTO t3 VALUES (4),(5); +SET @tmp19714=@@optimizer_switch; +SET optimizer_switch='subquery_cache=off'; +explain format=json +SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100 + }, + "subqueries": [ + { + "query_block": { + "select_id": 2, + "pseudo_bits_condition": "1 = t1.a or <in_optimizer>(1,<exists>(subquery#3))", + "table": { + "table_name": "t2", + "access_type": "system", + "rows": 1, + "filtered": 100 + }, + "subqueries": [ + { + "query_block": { + "select_id": 3, + "table": { + "table_name": "t3", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "1 = t3.c" + } + } + } + ] + } + } + ] + } +} +SET optimizer_switch=@tmp19714; +drop table t1,t2,t3; set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/main/subselect_no_semijoin.test b/mysql-test/main/subselect_no_semijoin.test index 6b82b748912..84d312c03c8 100644 --- a/mysql-test/main/subselect_no_semijoin.test +++ b/mysql-test/main/subselect_no_semijoin.test @@ -8,5 +8,28 @@ set @join_cache_level_for_subselect_test=@@join_cache_level; --source subselect.test +--echo # +--echo # MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON +--echo # +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (1),(5); + +# t2 must be MyISAM or Aria and contain 1 row +CREATE TABLE t2 ( b INT ) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1); + +CREATE TABLE t3 ( c INT ); +INSERT INTO t3 VALUES (4),(5); + +SET @tmp19714=@@optimizer_switch; +SET optimizer_switch='subquery_cache=off'; + +explain format=json +SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; + +SET optimizer_switch=@tmp19714; + +drop table t1,t2,t3; + set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result index b872e058c6c..412bfca4bf2 100644 --- a/mysql-test/main/win.result +++ b/mysql-test/main/win.result @@ -3607,6 +3607,33 @@ b row_number() over (partition by sum(a)+1) 2000 1 drop table t1; # +# MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF, +# window functions and views +# +create table t1 (id int, n1 int); +insert into t1 values (1,1),(2,1),(3,2),(4,4); +explain +select max(n1) over (partition by 'abc') from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary +select max(n1) over (partition by 'abc') from t1; +max(n1) over (partition by 'abc') +4 +4 +4 +4 +explain +select rank() over (partition by 'abc' order by 'xyz') from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary +select rank() over (partition by 'abc' order by 'xyz') from t1; +rank() over (partition by 'abc' order by 'xyz') +1 +1 +1 +1 +drop table t1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test index 16e8be5eb0a..d49be4a0433 100644 --- a/mysql-test/main/win.test +++ b/mysql-test/main/win.test @@ -2326,6 +2326,22 @@ select b, row_number() over (partition by sum(a)+1) from t1 group by b; drop table t1; --echo # +--echo # MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF, +--echo # window functions and views +--echo # + +create table t1 (id int, n1 int); +insert into t1 values (1,1),(2,1),(3,2),(4,4); +explain +select max(n1) over (partition by 'abc') from t1; +select max(n1) over (partition by 'abc') from t1; + +explain +select rank() over (partition by 'abc' order by 'xyz') from t1; +select rank() over (partition by 'abc' order by 'xyz') from t1; +drop table t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/suite/binlog/r/flashback-largebinlog.result b/mysql-test/suite/binlog/r/flashback-largebinlog.result new file mode 100644 index 00000000000..526204f259f --- /dev/null +++ b/mysql-test/suite/binlog/r/flashback-largebinlog.result @@ -0,0 +1,71 @@ +# +# Preparatory cleanup. +# +drop database if exists mysqltest; +create database mysqltest; +use mysqltest; +DROP TABLE IF EXISTS t1; +# +# We need a fixed timestamp to avoid varying results. +# +SET timestamp=1000000000; +# +# We need big packets. +# +# Capture initial value to reset at the end of the test +# Now adjust max_allowed_packet +SET @@global.max_allowed_packet= 10*1024*1024*1024; +Warnings: +Warning 1292 Truncated incorrect max_allowed_packet value: '10737418240' +max_allowed_packet is a global variable. +In order for the preceding change in max_allowed_packets' value +to be seen and used, we must start a new connection. +The change does not take effect with the current one. +For simplicity, we just disconnect / reconnect connection default here. +disconnect default; +connect default, localhost,root,,; +# +# Delete all existing binary logs. +# +RESET MASTER; +# +# Create a test table. +# +use mysqltest; +CREATE TABLE t1 ( +c1 LONGTEXT +) DEFAULT CHARSET latin1; +# +# Show how many rows are affected by each statement. +# +# +# Insert some big rows. +# +insert 1024MB data twice +INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 67108864)); +affected rows: 1 +INSERT INTO t1 VALUES (REPEAT('MegaByteBlckMany', 67108864)); +affected rows: 1 +# +# Flush all log buffers to the log file. +# +FLUSH LOGS; +affected rows: 0 +# +# Call mysqlbinlog to display the log file contents. +# NOTE: The output of mysqlbinlog is redirected to +# $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out +# If you want to examine it, disable remove_file +# at the bottom of the test script. +# +# +# Cleanup. +# +# reset variable value to pass testcase checks +SET @@global.max_allowed_packet = 16777216; +affected rows: 0 +DROP TABLE t1; +affected rows: 0 +drop database if exists mysqltest; +affected rows: 0 +remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out diff --git a/mysql-test/suite/binlog/t/flashback-largebinlog.test b/mysql-test/suite/binlog/t/flashback-largebinlog.test new file mode 100644 index 00000000000..6ff58b706d3 --- /dev/null +++ b/mysql-test/suite/binlog/t/flashback-largebinlog.test @@ -0,0 +1,110 @@ +# mysqlbinlog_big.test +# +# Show that mysqlbinlog can handle big rows. +# + +# +# The *huge* output of mysqlbinlog will be redirected to +# $MYSQLTEST_VARDIR/$mysqlbinlog_output +# +--let $mysqlbinlog_output= tmp/mysqlbinlog_big_1.out + +--source include/have_binlog_format_row.inc + +--source include/have_log_bin.inc + +# This is a big test. +--source include/big_test.inc + +--echo # +--echo # Preparatory cleanup. +--echo # +--disable_warnings +drop database if exists mysqltest; +create database mysqltest; +use mysqltest; +DROP TABLE IF EXISTS t1; +--enable_warnings + +--echo # +--echo # We need a fixed timestamp to avoid varying results. +--echo # +SET timestamp=1000000000; + +--echo # +--echo # We need big packets. +--echo # +--echo # Capture initial value to reset at the end of the test +# use let $<var> = query_get_value as FLUSH statements +# in the test will set @<var> values to NULL +let $orig_max_allowed_packet = +query_get_value(SELECT @@global.max_allowed_packet, @@global.max_allowed_packet, 1); + +--echo # Now adjust max_allowed_packet +SET @@global.max_allowed_packet= 10*1024*1024*1024; + +--echo max_allowed_packet is a global variable. +--echo In order for the preceding change in max_allowed_packets' value +--echo to be seen and used, we must start a new connection. +--echo The change does not take effect with the current one. +--echo For simplicity, we just disconnect / reconnect connection default here. +disconnect default; +connect (default, localhost,root,,); + +--echo # +--echo # Delete all existing binary logs. +--echo # +RESET MASTER; + +--echo # +--echo # Create a test table. +--echo # +use mysqltest; +eval CREATE TABLE t1 ( + c1 LONGTEXT + ) DEFAULT CHARSET latin1; + +--echo # +--echo # Show how many rows are affected by each statement. +--echo # +--enable_info + +--echo # +--echo # Insert some big rows. +--echo # + +--echo insert 1024MB data twice +INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 67108864)); +INSERT INTO t1 VALUES (REPEAT('MegaByteBlckMany', 67108864)); + +--echo # +--echo # Flush all log buffers to the log file. +--echo # +FLUSH LOGS; + +--echo # +--echo # Call mysqlbinlog to display the log file contents. +--echo # NOTE: The output of mysqlbinlog is redirected to +--echo # \$MYSQLTEST_VARDIR/$mysqlbinlog_output +--echo # If you want to examine it, disable remove_file +--echo # at the bottom of the test script. +--echo # +let $MYSQLD_DATADIR= `select @@datadir`; +--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR> +--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ +--exec $MYSQL_BINLOG -B -v -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output + +--echo # +--echo # Cleanup. +--echo # +--echo # reset variable value to pass testcase checks +eval SET @@global.max_allowed_packet = $orig_max_allowed_packet; +DROP TABLE t1; +drop database if exists mysqltest; + +--echo remove_file \$MYSQLTEST_VARDIR/$mysqlbinlog_output +# +# NOTE: If you want to see the *huge* mysqlbinlog output, disable next line: +# +--remove_file $MYSQLTEST_VARDIR/$mysqlbinlog_output + diff --git a/mysql-test/suite/encryption/r/compressed_import_tablespace.result b/mysql-test/suite/encryption/r/compressed_import_tablespace.result new file mode 100644 index 00000000000..63e7cf8b0c3 --- /dev/null +++ b/mysql-test/suite/encryption/r/compressed_import_tablespace.result @@ -0,0 +1,39 @@ +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; +INSERT INTO t1 VALUES(1, repeat('Nesamani', 10)); +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `a` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `ENCRYPTED`=YES +# Wait max 10 min for key encryption threads to encrypt all spaces +db.opt +t1.frm +t1.ibd +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +db.opt +t1.cfg +t1.frm +t1.ibd +UNLOCK TABLES; +DROP TABLE t1; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; +ALTER TABLE t1 DISCARD TABLESPACE; +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `a` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `ENCRYPTED`=YES +DROP TABLE t1; diff --git a/mysql-test/suite/encryption/t/compressed_import_tablespace.opt b/mysql-test/suite/encryption/t/compressed_import_tablespace.opt new file mode 100644 index 00000000000..a9893ed4b29 --- /dev/null +++ b/mysql-test/suite/encryption/t/compressed_import_tablespace.opt @@ -0,0 +1,3 @@ +--innodb-encrypt-tables=ON +--innodb-encryption-threads=4 +--innodb-tablespaces-encryption diff --git a/mysql-test/suite/encryption/t/compressed_import_tablespace.test b/mysql-test/suite/encryption/t/compressed_import_tablespace.test new file mode 100644 index 00000000000..b9e4913584b --- /dev/null +++ b/mysql-test/suite/encryption/t/compressed_import_tablespace.test @@ -0,0 +1,46 @@ +-- source include/have_innodb.inc +-- source include/have_example_key_management_plugin.inc +-- source include/not_valgrind.inc +-- source include/not_embedded.inc + +let MYSQLD_DATADIR = `SELECT @@datadir`; +--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; +INSERT INTO t1 VALUES(1, repeat('Nesamani', 10)); + +SELECT COUNT(*) FROM t1; +SHOW CREATE TABLE t1; + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--let $wait_timeout= 600 +--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING <> 0 +--source include/wait_condition.inc + +--source include/shutdown_mysqld.inc + +--source include/start_mysqld.inc +let MYSQLD_DATADIR =`SELECT @@datadir`; + +--list_files $MYSQLD_DATADIR/test +FLUSH TABLES t1 FOR EXPORT; +perl; +do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; +ib_backup_tablespaces("test", "t1"); +EOF +--list_files $MYSQLD_DATADIR/test +UNLOCK TABLES; +DROP TABLE t1; + +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; +ALTER TABLE t1 DISCARD TABLESPACE; +perl; +do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; +ib_discard_tablespaces("test", "t1"); +ib_restore_tablespaces("test", "t1"); +EOF + +ALTER TABLE t1 IMPORT TABLESPACE; + +SELECT COUNT(*) FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index e3cbf8fba84..0b0fefd9adf 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1779,3 +1779,24 @@ fun:CRYPTO_malloc fun:ENGINE_new } + +# +# OpenSSL 1.0.1l problems +# + +{ + OpenSSL 1.0.1l wrong jump + Memcheck:Cond + fun:bcmp + obj:/usr/lib64/libcrypto.so* + fun:FIPS_selftest +} + +{ + OpenSSL 1.0.1l wrong jump 2 + Memcheck:Cond + obj:/usr/lib64/libcrypto.so* + fun:FIPS_mode_set + obj:/usr/lib64/libcrypto.so* +} + |