Commit bc46f1a7 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: remove SEARCH_TYPE from search_pattern_in_file.inc

parent 424210ab
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
# #
# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set # The environment variables SEARCH_FILE and SEARCH_PATTERN must be set
# before sourcing this routine. # 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 # 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 # to search. If negative, it will search that many bytes at the end of the
...@@ -83,15 +80,7 @@ perl; ...@@ -83,15 +80,7 @@ perl;
close(FILE); close(FILE);
$content.= $file_content; $content.= $file_content;
} }
my @matches; my @matches= ($content =~ /$search_pattern/gs);
if (not defined($ENV{SEARCH_TYPE}))
{
@matches=($content =~ /$search_pattern/gs);
}
elsif($ENV{SEARCH_TYPE} == "_gm_")
{
@matches=($content =~ /$search_pattern/gm);
}
my $res; my $res;
if (@matches) if (@matches)
{ {
......
...@@ -16,10 +16,9 @@ if ($stop_position) ...@@ -16,10 +16,9 @@ if ($stop_position)
--exec $MYSQL_BINLOG -F --print-table-metadata $_stop_position_opt $binlog_file > $output_file --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_FILE= $output_file
--let SEARCH_OUTPUT=matches --let SEARCH_OUTPUT=matches
--let SEARCH_TYPE="_gm_"
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
if ($print_primary_key) if ($print_primary_key)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment