Skip to content

Commit 4d41ec0

Browse files
committed
Merge branch '10.6' into 10.11
2 parents ddd5ba3 + 19644f6 commit 4d41ec0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2752
-1701
lines changed

cmake/cpack_rpm.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ IF(WITH_WSREP)
245245
"galera-4" "rsync" "grep" "gawk" "iproute"
246246
"coreutils" "findutils" "tar")
247247
SETA(CPACK_RPM_server_PACKAGE_RECOMMENDS "lsof" "socat" "pv")
248-
SETA(CPACK_RPM_test_PACKAGE_REQUIRES "socat")
248+
SETA(CPACK_RPM_test_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}" "socat")
249249
ENDIF()
250250

251251
SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh)
@@ -292,7 +292,7 @@ ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7")
292292
ALTERNATIVE_NAME("server" "mariadb-server")
293293
ALTERNATIVE_NAME("server" "mysql-compat-server")
294294
ALTERNATIVE_NAME("test" "mariadb-test")
295-
ELSEIF(RPM MATCHES "(rhel|centos|rocky)[89]")
295+
ELSEIF(RPM MATCHES "(rhel|centos|rocky)")
296296
SET(epoch 3:)
297297
ALTERNATIVE_NAME("backup" "mariadb-backup")
298298
ALTERNATIVE_NAME("client" "mariadb")

mysql-test/main/derived_cond_pushdown.result

+93-101
Original file line numberDiff line numberDiff line change
@@ -11761,71 +11761,56 @@ SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
1176111761
EXPLAIN INSERT INTO t1
1176211762
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
1176311763
id select_type table type possible_keys key key_len ref rows Extra
11764-
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 144 Using where
11765-
2 DERIVED <derived4> ALL NULL NULL NULL NULL 12
11766-
2 DERIVED t1 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
11764+
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 12 Using temporary
11765+
1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1176711766
4 DERIVED t1 ALL NULL NULL NULL NULL 12
1176811767
EXPLAIN FORMAT=JSON INSERT INTO t1
1176911768
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
1177011769
EXPLAIN
1177111770
{
1177211771
"query_block": {
1177311772
"select_id": 1,
11774-
"nested_loop": [
11775-
{
11776-
"table": {
11777-
"table_name": "<derived2>",
11778-
"access_type": "ALL",
11779-
"rows": 144,
11780-
"filtered": 100,
11781-
"attached_condition": "t.f is not null",
11782-
"materialized": {
11783-
"query_block": {
11784-
"select_id": 2,
11785-
"nested_loop": [
11786-
{
11787-
"table": {
11788-
"table_name": "<derived4>",
11789-
"access_type": "ALL",
11790-
"rows": 12,
11791-
"filtered": 100,
11792-
"materialized": {
11793-
"query_block": {
11794-
"select_id": 4,
11795-
"nested_loop": [
11796-
{
11797-
"table": {
11798-
"table_name": "t1",
11799-
"access_type": "ALL",
11800-
"rows": 12,
11801-
"filtered": 100
11802-
}
11803-
}
11804-
]
11805-
}
11806-
}
11807-
}
11808-
},
11809-
{
11810-
"block-nl-join": {
11773+
"temporary_table": {
11774+
"nested_loop": [
11775+
{
11776+
"table": {
11777+
"table_name": "<derived4>",
11778+
"access_type": "ALL",
11779+
"rows": 12,
11780+
"filtered": 100,
11781+
"materialized": {
11782+
"query_block": {
11783+
"select_id": 4,
11784+
"nested_loop": [
11785+
{
1181111786
"table": {
1181211787
"table_name": "t1",
1181311788
"access_type": "ALL",
1181411789
"rows": 12,
11815-
"filtered": 100,
11816-
"attached_condition": "t1.f is not null"
11817-
},
11818-
"buffer_type": "flat",
11819-
"buffer_size": "64",
11820-
"join_type": "BNL"
11790+
"filtered": 100
11791+
}
1182111792
}
11822-
}
11823-
]
11793+
]
11794+
}
1182411795
}
1182511796
}
11797+
},
11798+
{
11799+
"block-nl-join": {
11800+
"table": {
11801+
"table_name": "t1",
11802+
"access_type": "ALL",
11803+
"rows": 12,
11804+
"filtered": 100,
11805+
"attached_condition": "t1.f is not null"
11806+
},
11807+
"buffer_type": "flat",
11808+
"buffer_size": "64",
11809+
"join_type": "BNL"
11810+
}
1182611811
}
11827-
}
11828-
]
11812+
]
11813+
}
1182911814
}
1183011815
}
1183111816
SELECT * FROM t1;
@@ -11854,62 +11839,48 @@ EXPLAIN
1185411839
{
1185511840
"query_block": {
1185611841
"select_id": 1,
11857-
"nested_loop": [
11858-
{
11859-
"table": {
11860-
"table_name": "<derived2>",
11861-
"access_type": "ALL",
11862-
"rows": 16,
11863-
"filtered": 100,
11864-
"attached_condition": "t.f is not null",
11865-
"materialized": {
11866-
"query_block": {
11867-
"select_id": 2,
11868-
"nested_loop": [
11869-
{
11870-
"table": {
11871-
"table_name": "t1",
11872-
"access_type": "ALL",
11873-
"rows": 8,
11874-
"filtered": 100,
11875-
"attached_condition": "t1.f is not null"
11876-
}
11877-
},
11878-
{
11879-
"table": {
11880-
"table_name": "<derived4>",
11881-
"access_type": "ref",
11882-
"possible_keys": ["key0"],
11883-
"key": "key0",
11884-
"key_length": "4",
11885-
"used_key_parts": ["f"],
11886-
"ref": ["test.t1.f"],
11887-
"rows": 2,
11888-
"filtered": 100,
11889-
"materialized": {
11890-
"query_block": {
11891-
"select_id": 4,
11892-
"nested_loop": [
11893-
{
11894-
"table": {
11895-
"table_name": "t1",
11896-
"access_type": "ALL",
11897-
"rows": 8,
11898-
"filtered": 100,
11899-
"attached_condition": "t1.f is not null"
11900-
}
11901-
}
11902-
]
11903-
}
11842+
"temporary_table": {
11843+
"nested_loop": [
11844+
{
11845+
"table": {
11846+
"table_name": "t1",
11847+
"access_type": "ALL",
11848+
"rows": 8,
11849+
"filtered": 100,
11850+
"attached_condition": "t1.f is not null"
11851+
}
11852+
},
11853+
{
11854+
"table": {
11855+
"table_name": "<derived4>",
11856+
"access_type": "ref",
11857+
"possible_keys": ["key0"],
11858+
"key": "key0",
11859+
"key_length": "4",
11860+
"used_key_parts": ["f"],
11861+
"ref": ["test.t1.f"],
11862+
"rows": 2,
11863+
"filtered": 100,
11864+
"materialized": {
11865+
"query_block": {
11866+
"select_id": 4,
11867+
"nested_loop": [
11868+
{
11869+
"table": {
11870+
"table_name": "t1",
11871+
"access_type": "ALL",
11872+
"rows": 8,
11873+
"filtered": 100,
11874+
"attached_condition": "t1.f is not null"
1190411875
}
1190511876
}
11906-
}
11907-
]
11877+
]
11878+
}
1190811879
}
1190911880
}
1191011881
}
11911-
}
11912-
]
11882+
]
11883+
}
1191311884
}
1191411885
}
1191511886
SELECT * FROM t1;
@@ -21669,6 +21640,27 @@ FROM cte2
2166921640
GROUP BY 1 ;
2167021641
( SELECT 1 FROM ( SELECT 1 FROM cte1) dt GROUP BY x HAVING x= 1 )
2167121642
1
21643+
create table t1 (f int);
21644+
create view v1 as select f, count(*) c from t1 group by f;
21645+
#
21646+
# MDEV-25012 Server crash in find_field_in_tables, Assertion `name' failed in find_field_in_table_ref
21647+
#
21648+
select * from v1 where export_set(1, default(f), 'x', aes_decrypt('secret', f));
21649+
f c
21650+
show warnings;
21651+
Level Code Message
21652+
drop view v1;
21653+
drop table t1;
21654+
create table t(c3 longtext) ;
21655+
with cte1 as
21656+
(
21657+
select default(c3) as a
21658+
from t group by 1
21659+
)
21660+
select * from cte1
21661+
where cte1.a >= 1;
21662+
a
21663+
drop table t;
2167221664
# End of 10.5 tests
2167321665
#
2167421666
# MDEV-28958: condition pushable into view after simplification

mysql-test/main/derived_cond_pushdown.test

+22
Original file line numberDiff line numberDiff line change
@@ -4271,6 +4271,28 @@ SELECT
42714271
FROM cte2
42724272
GROUP BY 1 ;
42734273

4274+
create table t1 (f int);
4275+
create view v1 as select f, count(*) c from t1 group by f;
4276+
4277+
--echo #
4278+
--echo # MDEV-25012 Server crash in find_field_in_tables, Assertion `name' failed in find_field_in_table_ref
4279+
--echo #
4280+
select * from v1 where export_set(1, default(f), 'x', aes_decrypt('secret', f));
4281+
show warnings;
4282+
# cleanup
4283+
drop view v1;
4284+
drop table t1;
4285+
4286+
create table t(c3 longtext) ;
4287+
with cte1 as
4288+
(
4289+
select default(c3) as a
4290+
from t group by 1
4291+
)
4292+
select * from cte1
4293+
where cte1.a >= 1;
4294+
drop table t;
4295+
42744296
--echo # End of 10.5 tests
42754297

42764298
--echo #

mysql-test/main/derived_view.result

+2
Original file line numberDiff line numberDiff line change
@@ -2461,6 +2461,8 @@ SELECT * FROM t1;
24612461
a
24622462
1
24632463
1
2464+
1
2465+
1
24642466
drop table t1,t2;
24652467
set optimizer_switch=@save968720_optimizer_switch;
24662468
#

mysql-test/main/insert.result

+71-1
Original file line numberDiff line numberDiff line change
@@ -806,5 +806,75 @@ a
806806
8
807807
drop table t1;
808808
#
809-
# End of 10.5 tests
809+
# MDEV-32086 Server crash when inserting from derived table containing insert target table
810+
# (part 2)
810811
#
812+
create table t1 (pk int, id int);
813+
insert into t1 values (2,2), (3,3), (4,4);
814+
select * from t1;
815+
pk id
816+
2 2
817+
3 3
818+
4 4
819+
select 101+count(*)
820+
from
821+
(
822+
select dt2.id
823+
from (select id from t1) dt2, t1 t where t.id=dt2.id
824+
) dt
825+
where dt.id<1000;
826+
101+count(*)
827+
104
828+
prepare s from '
829+
insert into t1 values(
830+
(select 101+count(*)
831+
from
832+
(
833+
select dt2.id
834+
from (select id from t1) dt2, t1 t where t.id=dt2.id
835+
) dt
836+
where dt.id<1000
837+
), 123
838+
)
839+
';
840+
execute s;
841+
select * from t1;
842+
pk id
843+
2 2
844+
3 3
845+
4 4
846+
104 123
847+
select 101+count(*)
848+
from
849+
(
850+
select dt2.id
851+
from (select id from t1) dt2, t1 t where t.id=dt2.id
852+
) dt
853+
where dt.id<1000;
854+
101+count(*)
855+
105
856+
execute s;
857+
select * from t1;
858+
pk id
859+
2 2
860+
3 3
861+
4 4
862+
104 123
863+
105 123
864+
drop table t1;
865+
#
866+
# Try this: INSERT INTO t1 VALUES ... reference to t1
867+
# RETURNING (subquery not touching t1)
868+
create table t1 (a int, b int);
869+
create table t2 (a int, b int);
870+
# This is accepted:
871+
insert into t1 (a) values
872+
(3),
873+
((select max(a) from t1))
874+
returning
875+
a, b, (select max(a) from t2);
876+
a b (select max(a) from t2)
877+
3 NULL NULL
878+
NULL NULL NULL
879+
drop table t1,t2;
880+
# End of 10.5 tests

0 commit comments

Comments
 (0)