/usr/lib/mysql-testsuite/include/log_grep.inc is in percona-server-test-5.6 5.6.22-rel71.0-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | --echo [log_grep.inc] file: $log_file pattern: $grep_pattern
perl;
$log_file= $ENV{'log_file'};
$log_file_full_path= $ENV{'log_file_full_path'};
$log_slow_rate_test= $ENV{'log_slow_rate_test'};
open(FILE, "$log_file_full_path")
or die("Cannot open file $log_file_full_path: $!\n");
if ($log_slow_rate_test) {
$one= 0;
$two= 0;
$three= 0;
while(<FILE>) {
$one++ if(/'connection_one'/);
$two++ if(/'connection_two'/);
$three++ if(/'connection_three'/);
}
$sum= $one + $two + $three;
$zero= 0;
if ($one == 0) {
$zero++;
}
if ($two == 0) {
$zero++;
}
if ($three == 0) {
$zero++;
}
print "[log_grep.inc] sum: $sum\n";
print "[log_grep.inc] zero: $zero\n";
}
else {
$grep_pattern= $ENV{'grep_pattern'};
$lines= 0;
while(<FILE>) {
$lines++ if (/$grep_pattern/);
}
print "[log_grep.inc] lines: $lines\n";
}
close(FILE);
EOF
|