Commit 7c7de020 authored by Sergei Golubchik's avatar Sergei Golubchik

10.5 fixes for --view and --embedded

parent 92502ad7
...@@ -22732,7 +22732,7 @@ from ...@@ -22732,7 +22732,7 @@ from
(select a, sum(b) as s from t2 group by a) as dt, (select a, sum(b) as s from t2 group by a) as dt,
t3 t3
where dt.a=t1.a and t3.a < 3 where dt.a=t1.a and t3.a < 3
) ) x
from t1 limit 5; from t1 limit 5;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 1 PRIMARY t1 ALL NULL NULL NULL NULL 1000
...@@ -22746,14 +22746,9 @@ from ...@@ -22746,14 +22746,9 @@ from
(select a, sum(b) as s from t2 group by a) as dt, (select a, sum(b) as s from t2 group by a) as dt,
t3 t3
where dt.a=t1.a and t3.a < 3 where dt.a=t1.a and t3.a < 3
) ) x
from t1 limit 5; from t1 limit 5;
a ( select concat(t3.a,'=',dt.s) a x
from
(select a, sum(b) as s from t2 group by a) as dt,
t3
where dt.a=t1.a and t3.a < 3
)
1 1=804 1 1=804
2 1=1056 2 1=1056
3 1=846 3 1=846
...@@ -22772,7 +22767,7 @@ from ...@@ -22772,7 +22767,7 @@ from
(select a, sum(b) as s from t2 group by a) as dt, (select a, sum(b) as s from t2 group by a) as dt,
t3 t3
where dt.a=t1.a and t3.a < 3 where dt.a=t1.a and t3.a < 3
) ) x
from t1 limit 5; from t1 limit 5;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 1 PRIMARY t1 ALL NULL NULL NULL NULL 1000
...@@ -22786,14 +22781,9 @@ from ...@@ -22786,14 +22781,9 @@ from
(select a, sum(b) as s from t2 group by a) as dt, (select a, sum(b) as s from t2 group by a) as dt,
t3 t3
where dt.a=t1.a and t3.a < 3 where dt.a=t1.a and t3.a < 3
) ) x
from t1 limit 5; from t1 limit 5;
a ( select concat(t3.a,'=',dt.s) a x
from
(select a, sum(b) as s from t2 group by a) as dt,
t3
where dt.a=t1.a and t3.a < 3
)
1 1=11858 1 1=11858
2 1=11380 2 1=11380
3 1=11588 3 1=11588
......
...@@ -4198,7 +4198,7 @@ select ...@@ -4198,7 +4198,7 @@ select
(select a, sum(b) as s from t2 group by a) as dt, (select a, sum(b) as s from t2 group by a) as dt,
t3 t3
where dt.a=t1.a and t3.a < 3 where dt.a=t1.a and t3.a < 3
) ) x
from t1 limit 5; from t1 limit 5;
eval explain $q; eval explain $q;
......
...@@ -4239,29 +4239,6 @@ a b s1 ...@@ -4239,29 +4239,6 @@ a b s1
3 3 t2:1;min_t3_b:3 3 3 t2:1;min_t3_b:3
drop table t1,t2,t3; drop table t1,t2,t3;
# #
# MDEV-31380: Assertion `s->table->opt_range_condition_rows <= s->found_records' failed
# (assertion in 10.6+, DBL_MAX costs in 10.5)
#
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a), KEY(b)) ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
SET
@tmp=@@optimizer_use_condition_selectivity,
optimizer_use_condition_selectivity = 1,
@tmp2=@@optimizer_trace,
optimizer_trace=1;
SELECT DISTINCT * FROM t1 WHERE a IN (1, 2);
a b
1 1
2 2
select
CAST(json_value(json_extract(trace, '$**.chosen_access_method.cost'), '$[0]')
as DOUBLE) < 1.0e100 x
from information_schema.optimizer_trace;
x
1
set optimizer_use_condition_selectivity = @tmp, optimizer_trace=@tmp2;
drop table t1;
#
# End of 10.5 tests # End of 10.5 tests
# #
# #
......
...@@ -1867,30 +1867,6 @@ from t1; ...@@ -1867,30 +1867,6 @@ from t1;
drop table t1,t2,t3; drop table t1,t2,t3;
--echo #
--echo # MDEV-31380: Assertion `s->table->opt_range_condition_rows <= s->found_records' failed
--echo # (assertion in 10.6+, DBL_MAX costs in 10.5)
--echo #
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a), KEY(b)) ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
SET
@tmp=@@optimizer_use_condition_selectivity,
optimizer_use_condition_selectivity = 1,
@tmp2=@@optimizer_trace,
optimizer_trace=1;
SELECT DISTINCT * FROM t1 WHERE a IN (1, 2);
select
CAST(json_value(json_extract(trace, '$**.chosen_access_method.cost'), '$[0]')
as DOUBLE) < 1.0e100 x
from information_schema.optimizer_trace;
set optimizer_use_condition_selectivity = @tmp, optimizer_trace=@tmp2;
drop table t1;
--echo # --echo #
--echo # End of 10.5 tests --echo # End of 10.5 tests
--echo # --echo #
......
...@@ -102,3 +102,29 @@ set optimizer_switch=@save_optimizer_switch_for_selectivity_test; ...@@ -102,3 +102,29 @@ set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
SET SESSION STORAGE_ENGINE=DEFAULT; SET SESSION STORAGE_ENGINE=DEFAULT;
Warnings: Warnings:
Warning 1287 '@@storage_engine' is deprecated and will be removed in a future release. Please use '@@default_storage_engine' instead Warning 1287 '@@storage_engine' is deprecated and will be removed in a future release. Please use '@@default_storage_engine' instead
#
# MDEV-31380: Assertion `s->table->opt_range_condition_rows <= s->found_records' failed
# (assertion in 10.6+, DBL_MAX costs in 10.5)
#
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a), KEY(b)) ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
SET
@tmp=@@optimizer_use_condition_selectivity,
optimizer_use_condition_selectivity = 1,
@tmp2=@@optimizer_trace,
optimizer_trace=1;
SELECT DISTINCT * FROM t1 WHERE a IN (1, 2);
a b
1 1
2 2
select
CAST(json_value(json_extract(trace, '$**.chosen_access_method.cost'), '$[0]')
as DOUBLE) < 1.0e100 x
from information_schema.optimizer_trace;
x
1
set optimizer_use_condition_selectivity = @tmp, optimizer_trace=@tmp2;
drop table t1;
#
# End of 10.5 tests
#
...@@ -14,3 +14,32 @@ set optimizer_switch='extended_keys=on'; ...@@ -14,3 +14,32 @@ set optimizer_switch='extended_keys=on';
set optimizer_switch=@save_optimizer_switch_for_selectivity_test; set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
SET SESSION STORAGE_ENGINE=DEFAULT; SET SESSION STORAGE_ENGINE=DEFAULT;
--echo #
--echo # MDEV-31380: Assertion `s->table->opt_range_condition_rows <= s->found_records' failed
--echo # (assertion in 10.6+, DBL_MAX costs in 10.5)
--echo #
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a), KEY(b)) ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
SET
@tmp=@@optimizer_use_condition_selectivity,
optimizer_use_condition_selectivity = 1,
@tmp2=@@optimizer_trace,
optimizer_trace=1;
SELECT DISTINCT * FROM t1 WHERE a IN (1, 2);
select
CAST(json_value(json_extract(trace, '$**.chosen_access_method.cost'), '$[0]')
as DOUBLE) < 1.0e100 x
from information_schema.optimizer_trace;
set optimizer_use_condition_selectivity = @tmp, optimizer_trace=@tmp2;
drop table t1;
--echo #
--echo # End of 10.5 tests
--echo #
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