Skip to content

Commit

Permalink
backport include/search_pattern_in_file.inc from 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Oct 26, 2016
1 parent 5569ac0 commit 2593270
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 6 deletions.
15 changes: 9 additions & 6 deletions mysql-test/include/search_pattern_in_file.inc
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@

perl;
use strict;
my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
my $search_range= $ENV{'SEARCH_RANGE'};
my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
my $search_range= $ENV{'SEARCH_RANGE'};
my $file_content;
$search_range= 50000 unless $search_range =~ /-?[0-9]+/;
open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n");
open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
if ($search_range >= 0) {
read(FILE, $file_content, $search_range, 0);
} else {
Expand All @@ -75,7 +75,10 @@ perl;
read(FILE, $file_content, -$search_range, 0);
}
close(FILE);
if ( not $file_content =~ m{$search_pattern} ) {
die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n");
$search_file =~ s{^.*?([^/\\]+)$}{$1};
if ($file_content =~ m{$search_pattern}) {
print "FOUND /$search_pattern/ in $search_file\n"
} else {
print "NOT FOUND /$search_pattern/ in $search_file\n"
}
EOF
1 change: 1 addition & 0 deletions mysql-test/r/lowercase_fs_on.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
# Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS
#
FOUND /\[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names/ in my_restart.err
1 change: 1 addition & 0 deletions mysql-test/r/named_pipe.result
Original file line number Diff line number Diff line change
Expand Up @@ -2154,3 +2154,4 @@ Privat (Private Nutzung) Mobilfunk
Warnings:
Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
FOUND /\[ERROR\] Create named pipe failed/ in second-mysqld.err
1 change: 1 addition & 0 deletions mysql-test/r/view.result
Original file line number Diff line number Diff line change
Expand Up @@ -5432,6 +5432,7 @@ DROP FUNCTION f1;
DROP VIEW v1;
DROP TABLE t1, t2;
create view v1 as select 1;
FOUND /mariadb-version/ in v1.frm
drop view v1;
#
# MDEV-7260: Crash in get_best_combination when executing multi-table
Expand Down
1 change: 1 addition & 0 deletions mysql-test/r/wait_timeout_not_windows.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set global log_warnings=2;
set @@wait_timeout=1;
FOUND /Aborted.*Got timeout reading communication packets/ in mysqld.1.err
set global log_warnings=@@log_warnings;
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ INSERT INTO t1 VALUES(1,'X',1);
SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
SELECT b FROM t1 LIMIT 3;
ERROR HY000: Lost connection to MySQL server during query
FOUND /Wrote log record for ibuf update in place operation/ in my_restart.err
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/rpl/r/rpl_checksum.result
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ SET debug_dbug= @old_dbug;
INSERT INTO t4 VALUES (2);
include/wait_for_slave_sql_error.inc [errno=1590]
Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log'
FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590/ in mysqld.2.err
SELECT * FROM t4 ORDER BY a;
a
1
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ a
3
4
5
FOUND /Slave SQL: Error 'Duplicate entry .* on query\. .*Query: '.*', Gtid 0-1-100, Internal MariaDB error code:|Slave SQL: Could not execute Write_rows.*table test.t1; Duplicate entry.*, Gtid 0-1-100, Internal MariaDB error/ in mysqld.2.err
FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
DROP TABLE t1;
include/rpl_end.inc

0 comments on commit 2593270

Please sign in to comment.