Skip to content
Permalink
Browse files
MDEV-27691: make working view-protocol
Update tests for version 10.8
  • Loading branch information
mariadb-lenastartseva committed Sep 27, 2022
1 parent c5cc8a7 commit a4234f0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
@@ -16,8 +16,11 @@ insert into t1 select seq from seq_1_to_1000;
set optimizer_trace=1;
explain select * from t1 force index(a) where a in (2, 4, 6);

#enable after fix MDEV-27871
--disable_view_protocol
select json_detailed(json_extract(trace, '$**.range_access_plan.ranges'))
from information_schema.optimizer_trace;
--enable_view_protocol
set optimizer_trace=default;

--echo # These should go in reverse order:
@@ -35,6 +38,8 @@ create table t1 (

insert into t1 select A.seq, B.seq*10 from seq_1_to_10 A, seq_1_to_10 B;

#enable after fix MDEV-27871
--disable_view_protocol
set optimizer_trace=1;
explain select * from t1 force index(ab) where a>=8 and b>=50;
select json_detailed(json_extract(trace, '$**.range_access_plan.ranges'))
@@ -43,14 +48,18 @@ from information_schema.optimizer_trace;
explain select * from t1 force index(ab) where a>=8 and b<=50;
select json_detailed(json_extract(trace, '$**.range_access_plan.ranges'))
from information_schema.optimizer_trace;
--enable_view_protocol

select * from t1 force index(ab) where a>=8 and b<=50;
select * from t1 ignore index(ab) where a>=8 and b<=50 order by a, b desc;

#enable after fix MDEV-27871
--disable_view_protocol
explain
select * from t1 where a between 2 and 4 and b between 50 and 80;
select json_detailed(json_extract(trace, '$**.range_access_plan.ranges'))
from information_schema.optimizer_trace;
--enable_view_protocol

select * from t1 where a between 2 and 4 and b between 50 and 80;

@@ -63,6 +72,8 @@ create table t2 (
);
insert into t2 select A.seq, B.seq*10 from seq_1_to_10 A, seq_1_to_10 B;

#enable after fix MDEV-27871
--disable_view_protocol
explain
select * from t2 where a between 2 and 4;
select json_detailed(json_extract(trace, '$**.range_access_plan.ranges'))
@@ -72,6 +83,7 @@ explain
select * from t2 where a between 2 and 4 and b between 50 and 80;
select json_detailed(json_extract(trace, '$**.range_access_plan.ranges'))
from information_schema.optimizer_trace;
--enable_view_protocol

drop table t2;

@@ -81,8 +93,11 @@ drop table t2;
CREATE TABLE t1 (p int NOT NULL, a int NOT NULL, PRIMARY KEY (p,a desc));
insert into t1 select 2,seq from seq_0_to_1000;
EXPLAIN select MIN(a) from t1 where p = 2 group by p;
#enable after fix MDEV-27871
--disable_view_protocol
select json_detailed(json_extract(trace, '$**.potential_group_range_indexes'))
from information_schema.optimizer_trace;
--enable_view_protocol
drop table t1;

set optimizer_trace=default;
@@ -870,7 +870,10 @@ SELECT CRC32('01234567'), CRC32('012345678');
SELECT CRC32('~!@$%^*'), CRC32('-0.0001');
SELECT CRC32(99999999999999999999999999999999);
SELECT CRC32(-99999999999999999999999999999999);
#enable_after fix MDEV-28535
--disable_view_protocol
SELECT CRC32C(NULL), CRC32C(''), CRC32C('MariaDB'), CRC32C('mariadb');
--enable_view_protocol
SELECT CRC32(NULL,1),CRC32C(NULL,1), CRC32(1,''), CRC32C(1,'');
SELECT CRC32(42,''),CRC32C(42,''),CRC32('42',''),CRC32C('42','');
SELECT CRC32(42,NULL),CRC32C(42,NULL);
@@ -117,6 +117,8 @@ drop table t2;

DELETE FROM mysql.column_stats;

--disable_service_connection

create schema world;
use world;
--disable_query_log
@@ -143,6 +145,9 @@ set histogram_type=@save_histogram_type;
set histogram_size=@save_histogram_size;

DROP SCHEMA world;

--enable_service_connection

use test;

create table t10 (

0 comments on commit a4234f0

Please sign in to comment.