diff options
Diffstat (limited to 'mysql-test/include')
-rw-r--r-- | mysql-test/include/binlog_start_pos.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/func_str_ascii_checksum.inc | 24 | ||||
-rw-r--r-- | mysql-test/include/index_merge2.inc | 1 | ||||
-rw-r--r-- | mysql-test/include/reset_master_slave.inc | 29 | ||||
-rw-r--r-- | mysql-test/include/search_pattern_in_file.inc | 35 | ||||
-rw-r--r-- | mysql-test/include/wait_for_sql_thread_read_all.inc | 6 |
6 files changed, 82 insertions, 17 deletions
diff --git a/mysql-test/include/binlog_start_pos.inc b/mysql-test/include/binlog_start_pos.inc index 942a124d639..5412a7ea75f 100644 --- a/mysql-test/include/binlog_start_pos.inc +++ b/mysql-test/include/binlog_start_pos.inc @@ -21,8 +21,8 @@ # ############################################################################## -let $binlog_start_pos=256; --disable_query_log -SET @binlog_start_pos=256; +set @binlog_start_pos=256 + @@encrypt_binlog * (36 + (@@binlog_checksum != 'NONE') * 4); --enable_query_log +let $binlog_start_pos=`select @binlog_start_pos`; diff --git a/mysql-test/include/func_str_ascii_checksum.inc b/mysql-test/include/func_str_ascii_checksum.inc new file mode 100644 index 00000000000..8e51c92c1ac --- /dev/null +++ b/mysql-test/include/func_str_ascii_checksum.inc @@ -0,0 +1,24 @@ +--echo # Start of func_str_ascii_checksum.inc + +--echo # +--echo # MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST')) +--echo # + +--eval CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2)) +--eval INSERT INTO t1 VALUES ('test',$func('test')), ('TEST', $func('TEST')) +--eval SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= $func("test") OR f2= $func("TEST")) +--eval SELECT * FROM t1 WHERE f1='test' AND (f2= $func("test") OR f2= $func("TEST")) +--eval SELECT * FROM t1 WHERE f1='test' AND (f2= $func("TEST") OR f2= $func("test")) +DROP TABLE t1; + + +--echo # +--echo # MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec() +--echo # + +--eval PREPARE stmt FROM "SELECT $func(CONVERT('foo' USING latin1))" +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + + +--echo # End of func_str_ascii_checksum.inc diff --git a/mysql-test/include/index_merge2.inc b/mysql-test/include/index_merge2.inc index c50a45a9923..03afa49d323 100644 --- a/mysql-test/include/index_merge2.inc +++ b/mysql-test/include/index_merge2.inc @@ -341,6 +341,7 @@ while ($1) alter table t1 add index i2(key2); alter table t1 add index i3(key3); update t1 set key2=key1,key3=key1; +analyze table t1; # to test the bug, the following must use "sort_union": --replace_column 9 REF diff --git a/mysql-test/include/reset_master_slave.inc b/mysql-test/include/reset_master_slave.inc new file mode 100644 index 00000000000..af66da2bb8b --- /dev/null +++ b/mysql-test/include/reset_master_slave.inc @@ -0,0 +1,29 @@ +# +# The include file runs RESET ALL for every replication connection +# currently present in SHOW FULL SLAVE STATUS output on the server, +# and also runs RESET MASTER on the same server. +# + +--let $include_filename= reset_master_slave.inc +--source include/begin_include_file.inc + +--disable_query_log +--disable_result_log +--disable_warnings +--let $default_master = `SELECT @@default_master_connection` +--let $con_name = query_get_value(show all slaves status, Connection_name, 1) +while ($con_name != 'No such row') +{ + eval set default_master_connection = '$con_name'; + stop slave; + --source include/wait_for_slave_to_stop.inc + reset slave all; + --let $con_name = query_get_value(show all slaves status, Connection_name, 1) +} + +--error 0,ER_FLUSH_MASTER_BINLOG_CLOSED +reset master; +set global gtid_slave_pos=''; +eval set default_master_connection = '$default_master'; +--source include/end_include_file.inc + diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc index 84237026ed0..3280dbfd574 100644 --- a/mysql-test/include/search_pattern_in_file.inc +++ b/mysql-test/include/search_pattern_in_file.inc @@ -60,25 +60,30 @@ perl; use strict; - my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set"; + die "SEARCH_FILE not set" unless $ENV{'SEARCH_FILE'}; + my @search_files= glob($ENV{'SEARCH_FILE'}); my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set"; my $search_range= $ENV{'SEARCH_RANGE'}; - my $file_content; + my $content; $search_range= 50000 unless $search_range =~ /-?[0-9]+/; - open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n"); - if ($search_range >= 0) { - read(FILE, $file_content, $search_range, 0); - } else { - my $size= -s $search_file; - $search_range = -$size if $size > -$search_range; - seek(FILE, $search_range, 2); - read(FILE, $file_content, -$search_range, 0); + foreach my $search_file (@search_files) { + open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n"); + my $file_content; + if ($search_range >= 0) { + read(FILE, $file_content, $search_range, 0); + } else { + my $size= -s $search_file; + $search_range = -$size if $size > -$search_range; + seek(FILE, $search_range, 2); + read(FILE, $file_content, -$search_range, 0); + } + close(FILE); + $content.= $file_content; } - close(FILE); - $search_file =~ s{^.*?([^/\\]+)$}{$1}; - if ($file_content =~ m{$search_pattern}) { - print "FOUND /$search_pattern/ in $search_file\n" + $ENV{'SEARCH_FILE'} =~ s{^.*?([^/\\]+)$}{$1}; + if ($content =~ m{$search_pattern}) { + print "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n" } else { - print "NOT FOUND /$search_pattern/ in $search_file\n" + print "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n" } EOF diff --git a/mysql-test/include/wait_for_sql_thread_read_all.inc b/mysql-test/include/wait_for_sql_thread_read_all.inc new file mode 100644 index 00000000000..ec5ecd0cb17 --- /dev/null +++ b/mysql-test/include/wait_for_sql_thread_read_all.inc @@ -0,0 +1,6 @@ +--let $show_statement = show all slaves status +--let $field = Slave_SQL_State +--let $condition = = 'Slave has read all relay log; waiting for the slave I/O thread to update it' +--let $wait_for_all = 1 +--source include/wait_show_condition.inc + |