-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
119 changed files
with
1,558 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--innodb_buffer_pool_dump_at_shutdown=off --innodb_buffer_pool_load_at_startup=off --innodb-stats-persistent=1 --innodb-stats-auto-recalc=off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# | ||
# MDEV-34125: ANALYZE FORMAT=JSON: r_engine_stats.pages_read_time_ms has wrong scale | ||
# | ||
create table t1 ( | ||
a varchar(255), | ||
b varchar(255), | ||
c varchar(255), | ||
d varchar(255), | ||
primary key(a,b,c,d) | ||
) engine=innodb; | ||
SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR | ||
insert into t1 select | ||
repeat(uuid(), 7), | ||
repeat(uuid(), 7), | ||
repeat(uuid(), 7), | ||
repeat(uuid(), 7) | ||
from seq_1_to_16384; | ||
SET GLOBAL innodb_fast_shutdown=0; | ||
# restart | ||
set log_slow_verbosity='engine'; | ||
set long_query_time=0.0; | ||
set @js='$analyze_output'; | ||
select @js; | ||
@js | ||
{ | ||
"query_optimization": { | ||
"r_total_time_ms": "REPLACED" | ||
}, | ||
"query_block": { | ||
"select_id": 1, | ||
"cost": 0.011647987, | ||
"r_loops": 1, | ||
"r_total_time_ms": "REPLACED", | ||
"nested_loop": [ | ||
{ | ||
"table": { | ||
"table_name": "t1", | ||
"access_type": "index", | ||
"key": "PRIMARY", | ||
"key_length": "1028", | ||
"used_key_parts": ["a", "b", "c", "d"], | ||
"loops": 1, | ||
"r_loops": 1, | ||
"rows": 1, | ||
"r_rows": 16384, | ||
"cost": 0.0110178, | ||
"r_table_time_ms": "REPLACED", | ||
"r_other_time_ms": "REPLACED", | ||
"r_engine_stats": { | ||
"pages_accessed": "REPLACED", | ||
"pages_read_count": "REPLACED", | ||
"pages_read_time_ms": "REPLACED" | ||
}, | ||
"filtered": 100, | ||
"r_filtered": 100 | ||
} | ||
} | ||
] | ||
} | ||
} | ||
set @pages_read_time_ms= | ||
(select json_value(@js,'$.query_block.nested_loop[0].table.r_engine_stats.pages_read_time_ms')); | ||
|
||
|
||
OK: pages_read_time is same in slow log and ANALYZE | ||
|
||
set long_query_time=default; | ||
drop table t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# | ||
# r_engine_stats tests that require slow query log. | ||
# | ||
--source include/analyze-format.inc | ||
--source include/have_sequence.inc | ||
--source include/have_innodb.inc | ||
|
||
--echo # | ||
--echo # MDEV-34125: ANALYZE FORMAT=JSON: r_engine_stats.pages_read_time_ms has wrong scale | ||
--echo # | ||
|
||
# Each row is 1K. | ||
create table t1 ( | ||
a varchar(255), | ||
b varchar(255), | ||
c varchar(255), | ||
d varchar(255), | ||
primary key(a,b,c,d) | ||
) engine=innodb; | ||
|
||
# The data size is 160K * 1K = 160M | ||
# 16M / (page_size=16K) = 1K pages. | ||
SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR | ||
insert into t1 select | ||
repeat(uuid(), 7), | ||
repeat(uuid(), 7), | ||
repeat(uuid(), 7), | ||
repeat(uuid(), 7) | ||
from seq_1_to_16384; | ||
|
||
SET GLOBAL innodb_fast_shutdown=0; | ||
source include/restart_mysqld.inc; | ||
set log_slow_verbosity='engine'; | ||
set long_query_time=0.0; | ||
|
||
let $analyze_output= `analyze format=json | ||
select * from t1 force index (PRIMARY) order by a desc, b desc, c desc, d desc`; | ||
evalp set @js='$analyze_output'; | ||
|
||
# Print it out for user-friendlines | ||
--replace_regex /("(r_[a-z_]*_time_ms|pages[^"]*)": )[^, \n]*/\1"REPLACED"/ | ||
select @js; | ||
|
||
set @pages_read_time_ms= | ||
(select json_value(@js,'$.query_block.nested_loop[0].table.r_engine_stats.pages_read_time_ms')); | ||
|
||
let ANALYZE_PAGES=`select @pages_read_time_ms`; | ||
let SLOW_LOG_FILE= `select @@slow_query_log_file`; | ||
|
||
perl; | ||
my $slow_log_file= $ENV{'SLOW_LOG_FILE'} or die "SLOW_LOG_FILE not set"; | ||
my $analyze_pages=$ENV{'ANALYZE_PAGES'}; | ||
open(FILE, $slow_log_file) or die "Failed to open $slow_log_file"; | ||
# We didn't run any queries touching a storage engine after the query of | ||
# interest, so we will be fine here if we just get the last occurrence of | ||
# Pages_read_time: NNNN in the file | ||
while(<FILE>) { | ||
$slow_log_pages=$1 if (/Pages_read_time: ([0-9.]+)/); | ||
} | ||
close(FILE); | ||
|
||
if ( $slow_log_pages > $analyze_pages * 0.95 && | ||
$slow_log_pages < $analyze_pages * 1.05) { | ||
print "\n\n OK: pages_read_time is same in slow log and ANALYZE\n\n"; | ||
} else { | ||
print "\n\n FAIL: $slow_log_pages not equal to $analyze_pages\n"; | ||
} | ||
|
||
EOF | ||
|
||
|
||
set long_query_time=default; | ||
drop table t1; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# MDEV-34226 On startup: UBSAN: applying zero offset to null pointer in my_copy_fix_mb from strings/ctype-mb.c and other locations | ||
# | ||
connect con1,localhost,root,,"*NO-ONE*"; | ||
SELECT database(); | ||
database() | ||
NULL | ||
disconnect con1; | ||
connection default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--echo # | ||
--echo # MDEV-34226 On startup: UBSAN: applying zero offset to null pointer in my_copy_fix_mb from strings/ctype-mb.c and other locations | ||
--echo # | ||
|
||
# Connect without a database | ||
|
||
connect (con1,localhost,root,,"*NO-ONE*"); | ||
SELECT database(); | ||
disconnect con1; | ||
connection default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.