Commit 69b8dd20 authored by Lena Startseva's avatar Lena Startseva

MDEV-31933: Make working view-protocol + ps-protocol (running two protocols together)

Fix for v. 11.0
parent 9f7deaab
...@@ -1173,8 +1173,11 @@ insert into t10 select seq, seq, seq from seq_1_to_10000; ...@@ -1173,8 +1173,11 @@ insert into t10 select seq, seq, seq from seq_1_to_10000;
explain format=json select * from t10 where a<3 and b!=5 and c<10; explain format=json select * from t10 where a<3 and b!=5 and c<10;
set optimizer_trace='enabled=on'; set optimizer_trace='enabled=on';
select * from t10 where a<3 and b!=5 and c<10; select * from t10 where a<3 and b!=5 and c<10;
#Enable after fix MDEV-32034
--disable_view_protocol
select json_detailed(json_extract(trace, '$**.attaching_conditions_to_tables')) as out1 select json_detailed(json_extract(trace, '$**.attaching_conditions_to_tables')) as out1
from information_schema.optimizer_trace; from information_schema.optimizer_trace;
--enable_view_protocol
drop table t10; drop table t10;
--echo # --echo #
...@@ -1214,8 +1217,11 @@ INSERT INTO t3 SELECT seq, seq from seq_1_to_10; ...@@ -1214,8 +1217,11 @@ INSERT INTO t3 SELECT seq, seq from seq_1_to_10;
set optimizer_trace='enabled=on'; set optimizer_trace='enabled=on';
explain partitions select * from t2,t3 where t2.a in (2,3,4) and t3.a in (4,5); explain partitions select * from t2,t3 where t2.a in (2,3,4) and t3.a in (4,5);
#Enable after fix MDEV-32034
--disable_view_protocol
select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1 select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1
from information_schema.optimizer_trace; from information_schema.optimizer_trace;
--enable_view_protocol
drop table t2,t3; drop table t2,t3;
create table t1 ( create table t1 (
...@@ -1228,8 +1234,11 @@ create table t1 ( ...@@ -1228,8 +1234,11 @@ create table t1 (
insert into t1 values (5),(15),(22); insert into t1 values (5),(15),(22);
explain select * from t1 where a = 28; explain select * from t1 where a = 28;
#Enable after fix MDEV-32034
--disable_view_protocol
select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1 select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1
from information_schema.optimizer_trace; from information_schema.optimizer_trace;
--enable_view_protocol
drop table t1; drop table t1;
set @@optimizer_switch= @save_optimizer_switch; set @@optimizer_switch= @save_optimizer_switch;
......
...@@ -48,7 +48,8 @@ select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.selectivity_for_indexes')) as JS; ...@@ -48,7 +48,8 @@ select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.selectivity_for_indexes')) as JS;
--echo # Ensure that we only use selectivity from non used index for simple cases --echo # Ensure that we only use selectivity from non used index for simple cases
#Enable after fix MDEV-32034
--disable_view_protocol
select count(*) from t1 where (a=2 and b= 5); select count(*) from t1 where (a=2 and b= 5);
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
from INFORMATION_SCHEMA.OPTIMIZER_TRACE; from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
...@@ -81,6 +82,7 @@ from INFORMATION_SCHEMA.OPTIMIZER_TRACE; ...@@ -81,6 +82,7 @@ from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select count(*) from t1 where (a between 2 and 3 and b between 0 and 100); select count(*) from t1 where (a between 2 and 3 and b between 0 and 100);
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
from INFORMATION_SCHEMA.OPTIMIZER_TRACE; from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
--enable_view_protocol
drop table t1; drop table t1;
set optimizer_trace='enabled=off'; set optimizer_trace='enabled=off';
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