1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

MDEV-11866: ANALYZE FORMAT=JSON not predicatable for r_total_time_ms/r_buffer_size

[0-9]*[.]?[0-9]* wasn't a sufficient regex to cover the
%lg used in Json_writer::add_double. Exponent formats
where missed.

Here we normalize all the replace_regex expressions for
ANALYZE FORMAT=JSON into one include file.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
This commit is contained in:
Daniel Black
2017-01-23 13:32:57 +11:00
parent b7b4c332c0
commit 10b1f4dd09
7 changed files with 66 additions and 63 deletions

View File

@@ -219,7 +219,7 @@ create table t1 (a int, b int, c int, d int, key(a,b,c));
insert into t1 select A.a, B.a, C.a, D.a from t2 A, t2 B, t2 C, t2 D;
explain select count(distinct b) from t1 group by a;
explain format=json select count(distinct b) from t1 group by a;
--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
--source include/analyze-format.inc
analyze format=json select count(distinct b) from t1 group by a;
drop table t1,t2;
@@ -342,7 +342,7 @@ explain
select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
explain format=json
select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
--source include/analyze-format.inc
analyze format=json
select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
@@ -351,7 +351,7 @@ explain
select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
explain format=json
select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
--source include/analyze-format.inc
analyze format=json
select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
@@ -360,7 +360,7 @@ explain
select distinct t1.a from t1 join t2 on t2.pk=t1.a;
explain format=json
select distinct t1.a from t1 join t2 on t2.pk=t1.a;
--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
--source include/analyze-format.inc
analyze format=json
select distinct t1.a from t1 join t2 on t2.pk=t1.a;
drop table t1,t2;
@@ -386,7 +386,7 @@ explain
select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
explain format=json
select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
--source include/analyze-format.inc
analyze format=json
select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
set optimizer_switch=@tmp_optimizer_switch;