Skip to content

Commit e704a13

Browse files
committed
Merge 10.9 into 10.10
2 parents 886a7ce + 5b37d58 commit e704a13

40 files changed

+491
-137
lines changed

debian/mariadb-test.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ usr/lib/mysql/plugin/qa_auth_interface.so
2626
usr/lib/mysql/plugin/qa_auth_server.so
2727
usr/lib/mysql/plugin/test_sql_service.so
2828
usr/lib/mysql/plugin/test_versioning.so
29+
usr/lib/mysql/plugin/type_mysql_timestamp.so
2930
usr/share/man/man1/mariadb-client-test-embedded.1
3031
usr/share/man/man1/mariadb-client-test.1
3132
usr/share/man/man1/mariadb-test-embedded.1

mysql-test/main/create_w_max_indexes_128.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ t1 CREATE TABLE `t1` (
470470
KEY `a126_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
471471
KEY `a127_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
472472
KEY `a128_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
473-
) ENGINE=MyISAM DEFAULT CHARSET=latin1
473+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
474474
flush tables;
475475
show create table t1;
476476
Table Create Table
@@ -619,7 +619,7 @@ t1 CREATE TABLE `t1` (
619619
KEY `a126_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
620620
KEY `a127_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
621621
KEY `a128_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
622-
) ENGINE=MyISAM DEFAULT CHARSET=latin1
622+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
623623
drop table t1;
624624
create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
625625
c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
@@ -1092,7 +1092,7 @@ t1 CREATE TABLE `t1` (
10921092
KEY `a126_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
10931093
KEY `a127_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
10941094
KEY `a128_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
1095-
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1095+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
10961096
flush tables;
10971097
show create table t1;
10981098
Table Create Table
@@ -1241,7 +1241,7 @@ t1 CREATE TABLE `t1` (
12411241
KEY `a126_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
12421242
KEY `a127_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
12431243
KEY `a128_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
1244-
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1244+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
12451245
alter table t1 add key
12461246
a129_long_123456789_123456789_123456789_123456789_123456789_1234 (
12471247
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);

mysql-test/main/derived_cond_pushdown.result

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20787,6 +20787,100 @@ a
2078720787
deallocate prepare stmt;
2078820788
drop view v1;
2078920789
drop table t1;
20790+
#
20791+
# MDEV-31240: condition pushed into splittable derived has reference to
20792+
# outer column and does not refer to any column of embedding
20793+
# select
20794+
#
20795+
create table t1 (a int);
20796+
insert into t1 select seq from seq_1_to_1000;
20797+
create table t2 (a int, b int, key (a));
20798+
insert into t2 select mod(seq,100), rand(13) * mod(seq,500) from seq_1_to_1000;
20799+
create table t3 (a int);
20800+
insert into t3 values (3), (1);
20801+
analyze table t1, t2, t3 persistent for all;
20802+
Table Op Msg_type Msg_text
20803+
test.t1 analyze status Engine-independent statistics collected
20804+
test.t1 analyze status OK
20805+
test.t2 analyze status Engine-independent statistics collected
20806+
test.t2 analyze status Table is already up to date
20807+
test.t3 analyze status Engine-independent statistics collected
20808+
test.t3 analyze status OK
20809+
explain select
20810+
a,
20811+
( select concat(t3.a,'=',dt.s)
20812+
from
20813+
(select a, sum(b) as s from t2 group by a) as dt,
20814+
t3
20815+
where dt.a=t1.a and t3.a < 3
20816+
)
20817+
from t1 limit 5;
20818+
id select_type table type possible_keys key key_len ref rows Extra
20819+
1 PRIMARY t1 ALL NULL NULL NULL NULL 1000
20820+
2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where
20821+
2 DEPENDENT SUBQUERY <derived3> ref key0 key0 5 test.t1.a 2
20822+
3 LATERAL DERIVED t2 ref a a 5 test.t1.a 10
20823+
select
20824+
a,
20825+
( select concat(t3.a,'=',dt.s)
20826+
from
20827+
(select a, sum(b) as s from t2 group by a) as dt,
20828+
t3
20829+
where dt.a=t1.a and t3.a < 3
20830+
)
20831+
from t1 limit 5;
20832+
a ( select concat(t3.a,'=',dt.s)
20833+
from
20834+
(select a, sum(b) as s from t2 group by a) as dt,
20835+
t3
20836+
where dt.a=t1.a and t3.a < 3
20837+
)
20838+
1 1=804
20839+
2 1=1056
20840+
3 1=846
20841+
4 1=947
20842+
5 1=973
20843+
truncate table t2;
20844+
insert into t2 select mod(seq,10), rand(15) * mod(seq,500) from seq_1_to_1000;
20845+
analyze table t2 persistent for all;
20846+
Table Op Msg_type Msg_text
20847+
test.t2 analyze status Engine-independent statistics collected
20848+
test.t2 analyze status Table is already up to date
20849+
explain select
20850+
a,
20851+
( select concat(t3.a,'=',dt.s)
20852+
from
20853+
(select a, sum(b) as s from t2 group by a) as dt,
20854+
t3
20855+
where dt.a=t1.a and t3.a < 3
20856+
)
20857+
from t1 limit 5;
20858+
id select_type table type possible_keys key key_len ref rows Extra
20859+
1 PRIMARY t1 ALL NULL NULL NULL NULL 1000
20860+
2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where
20861+
2 DEPENDENT SUBQUERY <derived3> ref key0 key0 5 test.t1.a 100
20862+
3 DERIVED t2 ALL a NULL NULL NULL 1000 Using temporary; Using filesort
20863+
select
20864+
a,
20865+
( select concat(t3.a,'=',dt.s)
20866+
from
20867+
(select a, sum(b) as s from t2 group by a) as dt,
20868+
t3
20869+
where dt.a=t1.a and t3.a < 3
20870+
)
20871+
from t1 limit 5;
20872+
a ( select concat(t3.a,'=',dt.s)
20873+
from
20874+
(select a, sum(b) as s from t2 group by a) as dt,
20875+
t3
20876+
where dt.a=t1.a and t3.a < 3
20877+
)
20878+
1 1=11858
20879+
2 1=11380
20880+
3 1=11588
20881+
4 1=11373
20882+
5 1=11612
20883+
drop table t1,t2,t3;
2079020884
# End of 10.4 tests
2079120885
#
2079220886
# MDEV-28958: condition pushable into view after simplification

mysql-test/main/derived_cond_pushdown.test

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3973,6 +3973,47 @@ deallocate prepare stmt;
39733973
drop view v1;
39743974
drop table t1;
39753975

3976+
--echo #
3977+
--echo # MDEV-31240: condition pushed into splittable derived has reference to
3978+
--echo # outer column and does not refer to any column of embedding
3979+
--echo # select
3980+
--echo #
3981+
3982+
create table t1 (a int);
3983+
insert into t1 select seq from seq_1_to_1000;
3984+
3985+
create table t2 (a int, b int, key (a));
3986+
insert into t2 select mod(seq,100), rand(13) * mod(seq,500) from seq_1_to_1000;
3987+
3988+
create table t3 (a int);
3989+
insert into t3 values (3), (1);
3990+
3991+
analyze table t1, t2, t3 persistent for all;
3992+
3993+
let $q=
3994+
select
3995+
a,
3996+
( select concat(t3.a,'=',dt.s)
3997+
from
3998+
(select a, sum(b) as s from t2 group by a) as dt,
3999+
t3
4000+
where dt.a=t1.a and t3.a < 3
4001+
)
4002+
from t1 limit 5;
4003+
4004+
eval explain $q;
4005+
eval $q;
4006+
4007+
truncate table t2;
4008+
insert into t2 select mod(seq,10), rand(15) * mod(seq,500) from seq_1_to_1000;
4009+
4010+
analyze table t2 persistent for all;
4011+
4012+
eval explain $q;
4013+
eval $q;
4014+
4015+
drop table t1,t2,t3;
4016+
39764017
--echo # End of 10.4 tests
39774018

39784019
--echo #

mysql-test/main/derived_split_innodb.result

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,5 +839,20 @@ SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id=
839839
a
840840
set optimizer_switch= @tmp1, join_cache_level= @tmp2;
841841
DROP TABLE t1, t2;
842+
#
843+
# MDEV-31403: Server crashes in st_join_table::choose_best_splitting (still)
844+
#
845+
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
846+
INSERT INTO t1 VALUES
847+
(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15);
848+
CREATE TABLE t2 (b INT) ENGINE=InnoDB;
849+
INSERT INTO t2 VALUES (100),(200);
850+
CREATE TABLE t3 (c INT, d INT, KEY(c)) ENGINE=InnoDB;
851+
INSERT INTO t3 VALUES (1,1),(2,2);
852+
CREATE VIEW v AS SELECT c, d FROM t3 GROUP BY c, d;
853+
SELECT * FROM t1 JOIN t2 WHERE (t1.a, t2.b) IN (SELECT * FROM v);
854+
a b
855+
DROP VIEW v;
856+
DROP TABLE t1, t2, t3;
842857
# End of 10.4 tests
843858
SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent;

mysql-test/main/derived_split_innodb.test

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,27 @@ set optimizer_switch= @tmp1, join_cache_level= @tmp2;
466466
# Cleanup
467467
DROP TABLE t1, t2;
468468

469+
--echo #
470+
--echo # MDEV-31403: Server crashes in st_join_table::choose_best_splitting (still)
471+
--echo #
472+
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
473+
INSERT INTO t1 VALUES
474+
(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15);
475+
476+
CREATE TABLE t2 (b INT) ENGINE=InnoDB;
477+
INSERT INTO t2 VALUES (100),(200);
478+
479+
CREATE TABLE t3 (c INT, d INT, KEY(c)) ENGINE=InnoDB;
480+
INSERT INTO t3 VALUES (1,1),(2,2);
481+
482+
CREATE VIEW v AS SELECT c, d FROM t3 GROUP BY c, d;
483+
484+
SELECT * FROM t1 JOIN t2 WHERE (t1.a, t2.b) IN (SELECT * FROM v);
485+
486+
# Cleanup
487+
DROP VIEW v;
488+
DROP TABLE t1, t2, t3;
489+
469490
--echo # End of 10.4 tests
470491

471492
SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent;

mysql-test/main/explain_non_select.result

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,22 @@ EXECUTE stmt;
277277
id select_type table type possible_keys key key_len ref rows Extra
278278
1 SIMPLE t2 ALL NULL NULL NULL NULL 2
279279
drop table t1,t2;
280+
#
281+
# MDEV-31224: EXPLAIN EXTENDED for multi-table update of system table
282+
#
283+
CREATE TABLE t1 (a INT);
284+
INSERT INTO t1 VALUES (1),(2);
285+
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
286+
INSERT INTO t2 VALUES (3);
287+
EXPLAIN EXTENDED UPDATE t1, t2 SET b = 4 WHERE a IN (6,2);
288+
id select_type table type possible_keys key key_len ref rows filtered Extra
289+
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
290+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
291+
Warnings:
292+
Note 1003 update `test`.`t1` set `test`.`t2`.`b` = 4 where `test`.`t1`.`a` in (6,2)
293+
UPDATE t1, t2 SET b = 4 WHERE a IN (6,2);
294+
SELECT * from t2;
295+
b
296+
4
297+
DROP TABLE t1, t2;
298+
# End of 10.4 tests

mysql-test/main/explain_non_select.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,23 @@ PREPARE stmt FROM 'EXPLAIN INSERT INTO t1 SELECT * FROM t2';
250250
EXECUTE stmt;
251251
drop table t1,t2;
252252

253+
--echo #
254+
--echo # MDEV-31224: EXPLAIN EXTENDED for multi-table update of system table
255+
--echo #
256+
257+
CREATE TABLE t1 (a INT);
258+
INSERT INTO t1 VALUES (1),(2);
259+
260+
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
261+
INSERT INTO t2 VALUES (3);
262+
263+
let $q=
264+
UPDATE t1, t2 SET b = 4 WHERE a IN (6,2);
265+
266+
eval EXPLAIN EXTENDED $q;
267+
eval $q;
268+
SELECT * from t2;
269+
270+
DROP TABLE t1, t2;
271+
272+
--echo # End of 10.4 tests

mysql-test/main/group_min_max.result

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4204,6 +4204,30 @@ a b s1
42044204
2 2 t2:t2a-null;min_t3_b:t3b-null
42054205
3 3 t2:1;min_t3_b:3
42064206
drop table t1,t2,t3;
4207+
#
4208+
# MDEV-31380: Assertion `s->table->opt_range_condition_rows <= s->found_records' failed
4209+
# (assertion in 10.6+, DBL_MAX costs in 10.5)
4210+
#
4211+
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a), KEY(b)) ENGINE=InnoDB;
4212+
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
4213+
SET
4214+
@tmp=@@optimizer_use_condition_selectivity,
4215+
optimizer_use_condition_selectivity = 1,
4216+
@tmp2=@@optimizer_trace,
4217+
optimizer_trace=1;
4218+
SELECT DISTINCT * FROM t1 WHERE a IN (1, 2);
4219+
a b
4220+
1 1
4221+
2 2
4222+
select
4223+
CAST(json_value(json_extract(trace, '$**.chosen_access_method.cost'), '$[0]')
4224+
as DOUBLE) < 1.0e100
4225+
from information_schema.optimizer_trace;
4226+
CAST(json_value(json_extract(trace, '$**.chosen_access_method.cost'), '$[0]')
4227+
as DOUBLE) < 1.0e100
4228+
1
4229+
set optimizer_use_condition_selectivity = @tmp, optimizer_trace=@tmp2;
4230+
drop table t1;
42074231
#
42084232
# End of 10.5 tests
42094233
#

mysql-test/main/group_min_max.test

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
--source include/default_optimizer_switch.inc
88
--source include/have_sequence.inc
99
--source include/have_innodb.inc
10+
--source include/have_sequence.inc
1011
#
1112
# TODO:
1213
# Add queries with:
@@ -1859,6 +1860,30 @@ from t1;
18591860

18601861
drop table t1,t2,t3;
18611862

1863+
--echo #
1864+
--echo # MDEV-31380: Assertion `s->table->opt_range_condition_rows <= s->found_records' failed
1865+
--echo # (assertion in 10.6+, DBL_MAX costs in 10.5)
1866+
--echo #
1867+
1868+
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a), KEY(b)) ENGINE=InnoDB;
1869+
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
1870+
1871+
SET
1872+
@tmp=@@optimizer_use_condition_selectivity,
1873+
optimizer_use_condition_selectivity = 1,
1874+
@tmp2=@@optimizer_trace,
1875+
optimizer_trace=1;
1876+
1877+
SELECT DISTINCT * FROM t1 WHERE a IN (1, 2);
1878+
1879+
select
1880+
CAST(json_value(json_extract(trace, '$**.chosen_access_method.cost'), '$[0]')
1881+
as DOUBLE) < 1.0e100
1882+
from information_schema.optimizer_trace;
1883+
1884+
set optimizer_use_condition_selectivity = @tmp, optimizer_trace=@tmp2;
1885+
drop table t1;
1886+
18621887
--echo #
18631888
--echo # End of 10.5 tests
18641889
--echo #

0 commit comments

Comments
 (0)