From bc46f1a7d95c918fc0548c8e23d5173c31c3df60 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 25 Jan 2024 15:00:39 +0100 Subject: [PATCH] cleanup: remove SEARCH_TYPE from search_pattern_in_file.inc --- mysql-test/include/search_pattern_in_file.inc | 13 +------------ .../binlog/include/print_optional_metadata.inc | 3 +-- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc index 3105f7f9077..d26495ca3ed 100644 --- a/mysql-test/include/search_pattern_in_file.inc +++ b/mysql-test/include/search_pattern_in_file.inc @@ -9,9 +9,6 @@ # # The environment variables SEARCH_FILE and SEARCH_PATTERN must be set # before sourcing this routine. -# SEARCH_TYPE can also be set to either NULL(default) or _gm_ -# NULL is equivalent of using m/SEARCH_PATTERN/gs -# _gm_ is equivalent of using m/SEARCH_RANGE/gm # # Optionally, SEARCH_RANGE can be set to the max number of bytes of the file # to search. If negative, it will search that many bytes at the end of the @@ -83,15 +80,7 @@ perl; close(FILE); $content.= $file_content; } - my @matches; - if (not defined($ENV{SEARCH_TYPE})) - { - @matches=($content =~ /$search_pattern/gs); - } - elsif($ENV{SEARCH_TYPE} == "_gm_") - { - @matches=($content =~ /$search_pattern/gm); - } + my @matches= ($content =~ /$search_pattern/gs); my $res; if (@matches) { diff --git a/mysql-test/suite/binlog/include/print_optional_metadata.inc b/mysql-test/suite/binlog/include/print_optional_metadata.inc index 739903ab190..47feede80ec 100644 --- a/mysql-test/suite/binlog/include/print_optional_metadata.inc +++ b/mysql-test/suite/binlog/include/print_optional_metadata.inc @@ -16,10 +16,9 @@ if ($stop_position) --exec $MYSQL_BINLOG -F --print-table-metadata $_stop_position_opt $binlog_file > $output_file ---let SEARCH_PATTERN= # (?:Columns\(| {8}).* +--let SEARCH_PATTERN= (?m-s:# (?:Columns\(| {8}).*) --let SEARCH_FILE= $output_file --let SEARCH_OUTPUT=matches ---let SEARCH_TYPE="_gm_" --source include/search_pattern_in_file.inc if ($print_primary_key)