mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge 10.9 into 10.10
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
# The time on ANALYSE FORMAT=JSON is rather variable
|
||||
# Remove non-deterministic parts of ANALYZE FORMAT=JSON output:
|
||||
# - any timings
|
||||
# - Buffer sizes (depend on pointer size)
|
||||
# - r_engine_stats depends on buffer pool state and whether old record versions
|
||||
# were purged.
|
||||
|
||||
--replace_regex /("(r_[a-z_]*_time(_in_progress)?_ms|r_buffer_size)": )[^, \n]*/\1"REPLACED"/
|
||||
--replace_regex /("(r_[a-z_]*_time(_in_progress)?_ms|r_buffer_size)": )[^, \n]*/\1"REPLACED"/ /("r_engine_stats":) {[^}]*}/\1 REPLACED/
|
||||
|
85
mysql-test/include/log_grep.inc
Normal file
85
mysql-test/include/log_grep.inc
Normal file
@ -0,0 +1,85 @@
|
||||
if ($log_expected_matches) {
|
||||
--echo [log_grep.inc] file: $log_file pattern: $grep_pattern expected_matches: $log_expected_matches
|
||||
}
|
||||
if (!$log_expected_matches) {
|
||||
--echo [log_grep.inc] file: $log_file pattern: $grep_pattern
|
||||
}
|
||||
--let LOG_GREP_PERL_RESULT=$MYSQL_TMP_DIR/log_grep_perl_result.test
|
||||
perl;
|
||||
|
||||
open my $command_file, ">", "$ENV{'LOG_GREP_PERL_RESULT'}" or die "Cannot create file";
|
||||
|
||||
$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/);
|
||||
}
|
||||
$log_expected_matches= $ENV{'log_expected_matches'};
|
||||
if ($log_expected_matches) {
|
||||
if ($log_expected_matches != $lines) {
|
||||
print "[log_grep.inc] ERROR: expected matches: $log_expected_matches, actual matches: $lines\n";
|
||||
print "[log_grep.inc] log file at $log_file_full_path\n";
|
||||
close(FILE);
|
||||
open(FILE, "$log_file_full_path")
|
||||
or die("Cannot open file $log_file_full_path: $!\n");
|
||||
while (<FILE>) {
|
||||
print ;
|
||||
}
|
||||
print $command_file "--let \$log_grep_failed= 1;\n";
|
||||
} else {
|
||||
print "[log_grep.inc] found expected match count: $log_expected_matches\n";
|
||||
}
|
||||
} else {
|
||||
print "[log_grep.inc] lines: $lines\n";
|
||||
}
|
||||
}
|
||||
close(FILE);
|
||||
close($command_file);
|
||||
EOF
|
||||
--source $LOG_GREP_PERL_RESULT
|
||||
--remove_file $LOG_GREP_PERL_RESULT
|
||||
if ($log_grep_failed)
|
||||
{
|
||||
SHOW SESSION STATUS LIKE 'Slow_queries';
|
||||
SHOW GLOBAL VARIABLES LIKE 'log%';
|
||||
SHOW GLOBAL VARIABLES LIKE 'long_query_time';
|
||||
SHOW GLOBAL VARIABLES LIKE 'min_examined_row_limit';
|
||||
SHOW GLOBAL VARIABLES LIKE 'query_cache%';
|
||||
SHOW GLOBAL VARIABLES LIKE 'slow_query%';
|
||||
SHOW SESSION VARIABLES LIKE 'log%';
|
||||
SHOW SESSION VARIABLES LIKE 'long_query_time';
|
||||
SHOW SESSION VARIABLES LIKE 'min_examined_row_limit';
|
||||
SHOW SESSION VARIABLES LIKE 'query_cache%';
|
||||
SHOW SESSION VARIABLES LIKE 'slow_query%';
|
||||
--die Testcase failed!
|
||||
}
|
6
mysql-test/include/log_slow_cleanup.inc
Normal file
6
mysql-test/include/log_slow_cleanup.inc
Normal file
@ -0,0 +1,6 @@
|
||||
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp $log_slow_prefix-*.slog
|
||||
--disable_query_log
|
||||
EVAL SET GLOBAL log_output= $log_output_old;
|
||||
EVAL SET GLOBAL slow_query_log_file= "$slow_query_log_file_old";
|
||||
EVAL SET GLOBAL slow_query_log= $slow_query_log_old;
|
||||
--enable_query_log
|
25
mysql-test/include/log_slow_grep.inc
Normal file
25
mysql-test/include/log_slow_grep.inc
Normal file
@ -0,0 +1,25 @@
|
||||
# Common extensions to the slow query log
|
||||
--let grep_pattern = ^# Thread_id: .+ Schema: .+ QC_hit: (Yes|No)\$
|
||||
--let log_expected_matches = $log_slow_verbosity_expected_matches
|
||||
--source include/log_grep.inc
|
||||
--let grep_pattern = ^# Query_time: \d+\.\d+ Lock_time: \d+\.\d+ Rows_sent: \d+ Rows_examined: \d+\$
|
||||
--source include/log_grep.inc
|
||||
--let grep_pattern = ^# Rows_affected: \d+ Bytes_sent: \d+\$
|
||||
--source include/log_grep.inc
|
||||
|
||||
# Query plan
|
||||
--let log_expected_matches = $log_slow_verbosity_queryplan_expected_matches
|
||||
--let grep_pattern = ^# Full_scan: (Yes|No) Full_join: (Yes|No) Tmp_table: (Yes|No) Tmp_table_on_disk: (Yes|No)\$
|
||||
--source include/log_grep.inc
|
||||
--let grep_pattern = ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+\ Priority_queue: (Yes|No)\$
|
||||
--source include/log_grep.inc
|
||||
|
||||
# Temp tables
|
||||
--let log_expected_matches = $log_slow_verbosity_tmptable_expected_matches
|
||||
--source include/log_grep.inc
|
||||
--let grep_pattern = ^# Tmp_tables: \d+ Tmp_disk_tables: \d+\$
|
||||
--source include/log_grep.inc
|
||||
|
||||
# InnoDB/Engines
|
||||
--let log_expected_matches = $log_slow_innodb_expected_matches
|
||||
--let grep_pattern = ^# Pages_accessed: \d+ Pages_read: \d+ Pages_updated: \d+ Old_rows_read: \d+\n# Pages_read_time: \d+\.\d+ Engine_time: \d+\.\d+\$
|
8
mysql-test/include/log_slow_prepare.inc
Normal file
8
mysql-test/include/log_slow_prepare.inc
Normal file
@ -0,0 +1,8 @@
|
||||
--disable_query_log
|
||||
--let slow_query_log_old= `select @@slow_query_log`
|
||||
--let slow_query_log_file_old= `select @@slow_query_log_file`
|
||||
--let log_output_old= `select @@log_output`
|
||||
|
||||
SET GLOBAL slow_query_log=0;
|
||||
SET GLOBAL log_output=FILE;
|
||||
--enable_query_log
|
6
mysql-test/include/log_slow_start.inc
Normal file
6
mysql-test/include/log_slow_start.inc
Normal file
@ -0,0 +1,6 @@
|
||||
--disable_query_log
|
||||
--let log_file_full_path=$MYSQLTEST_VARDIR/tmp/$log_file.slog
|
||||
--echo [slow_log_start.inc] $log_file
|
||||
EVAL SET GLOBAL slow_query_log_file="$log_file_full_path";
|
||||
SET GLOBAL slow_query_log=1;
|
||||
--enable_query_log
|
4
mysql-test/include/log_slow_stop.inc
Normal file
4
mysql-test/include/log_slow_stop.inc
Normal file
@ -0,0 +1,4 @@
|
||||
--disable_query_log
|
||||
SET GLOBAL slow_query_log=0;
|
||||
--echo [log_slow_stop.inc] $log_file
|
||||
--enable_query_log
|
Reference in New Issue
Block a user