Skip to content

Commit 3ce999d

Browse files
committed
Merge 10.11 into 11.4
2 parents 38beaa6 + f249b01 commit 3ce999d

43 files changed

Lines changed: 543 additions & 78 deletions

Some content is hidden

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

cmake/win_compatibility.manifest

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919

2020
</application>
2121
</compatibility>
22-
<application>
22+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
2323
<windowsSettings>
2424
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
25+
<heapType xmlns="http://schemas.microsoft.com/SMI/2020/WindowsSettings">SegmentHeap</heapType>
2526
</windowsSettings>
2627
</application>
2728
</asmv1:assembly>

include/json_lib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ enum json_errors {
3030
JE_ESCAPING= -6, /* Error in the escaping. */
3131

3232
JE_DEPTH= -7, /* The limit on the JSON depth was overrun. */
33+
JE_KILLED= -8, /* Killed during processing */
3334
};
3435

3536

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
create table t1(a int) engine=innodb;
2+
#
3+
# MDEV-39541 mem_pressure::~mem_pressure() causes a crash on bootstrap
4+
#
25
# restart
36
select * from t1;
47
a
58
1
69
2
710
5
811
drop table t1;
12+
# End of 10.11 tests

mysql-test/main/bootstrap_innodb.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ EOF
2222
exec $MYSQLD_BOOTSTRAP_CMD --datadir=$datadir --tmpdir=$MYSQL_TMP_DIR --innodb < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1;
2323
remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;
2424

25+
--echo #
26+
--echo # MDEV-39541 mem_pressure::~mem_pressure() causes a crash on bootstrap
27+
--echo #
28+
29+
write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;
30+
SHUTDOWN;
31+
EOF
32+
exec $MYSQLD_BOOTSTRAP_CMD --datadir=$datadir --tmpdir=$MYSQL_TMP_DIR --innodb < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1;
33+
remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;
34+
2535
source include/start_mysqld.inc;
2636
select * from t1;
2737
drop table t1;
38+
39+
--echo # End of 10.11 tests

mysql-test/main/column_compression.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,3 +3035,19 @@ select * from (select * from t) as t natural join (select * from t) as t1;
30353035
a b
30363036
drop tables t, t4;
30373037
# End of 10.5 tests
3038+
#
3039+
# MDEV-39450: Memory corruption: overlapping memory ranges in `Field_longstr::compress` on UPDATE of compressed column
3040+
#
3041+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
3042+
REPLACE INTO t VALUES ('abcdefghijklm');
3043+
UPDATE t SET c=RIGHT(c,10);
3044+
DROP TABLE t;
3045+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
3046+
REPLACE INTO t VALUES ('abcdefghijklm');
3047+
UPDATE t SET c=SUBSTRING(c,3);
3048+
DROP TABLE t;
3049+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
3050+
REPLACE INTO t VALUES ('abcdefghijklm');
3051+
UPDATE t SET c=MID(c,2,4);
3052+
DROP TABLE t;
3053+
# End of 10.6 tests

mysql-test/main/column_compression.test

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,3 +573,24 @@ select * from (select * from t) as t natural join (select * from t) as t1;
573573
drop tables t, t4;
574574

575575
--echo # End of 10.5 tests
576+
577+
--echo #
578+
--echo # MDEV-39450: Memory corruption: overlapping memory ranges in `Field_longstr::compress` on UPDATE of compressed column
579+
--echo #
580+
581+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
582+
REPLACE INTO t VALUES ('abcdefghijklm');
583+
UPDATE t SET c=RIGHT(c,10);
584+
DROP TABLE t;
585+
586+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
587+
REPLACE INTO t VALUES ('abcdefghijklm');
588+
UPDATE t SET c=SUBSTRING(c,3);
589+
DROP TABLE t;
590+
591+
CREATE TABLE t (c VARCHAR(255) COMPRESSED);
592+
REPLACE INTO t VALUES ('abcdefghijklm');
593+
UPDATE t SET c=MID(c,2,4);
594+
DROP TABLE t;
595+
596+
--echo # End of 10.6 tests

mysql-test/main/cte_recursive.result

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6055,7 +6055,7 @@ ERROR 42S22: Unknown column 'x' in 'SELECT'
60556055
# MDEV-32299 Segfault when preparing unreferenced select in recursive CTE
60566056
#
60576057
SELECT ( WITH RECURSIVE x AS ( SELECT * FROM ( SELECT UTC_TIMESTAMP FROM ( SELECT ( WITH x AS ( WITH x AS ( SELECT * FROM x ) SELECT 1 ) SELECT 1 ) ) x ) x UNION SELECT NULL ) ( SELECT x FROM x ) ) ;
6058-
ERROR 42S22: Unknown column 'x' in 'SELECT'
6058+
ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'x'
60596059
select (
60606060
with recursive x as (
60616061
select * from (
@@ -6077,7 +6077,7 @@ select null
60776077
)
60786078
(select x from x)
60796079
);
6080-
ERROR 42S22: Unknown column 'x' in 'SELECT'
6080+
ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'x'
60816081
select (
60826082
with recursive r as (
60836083
select * from (
@@ -6229,4 +6229,13 @@ y
62296229
2
62306230
2
62316231
4
6232+
#
6233+
# MDEV-32326: Recursive reference in scalar subquery should be rejected
6234+
#
6235+
WITH RECURSIVE x AS (
6236+
SELECT 1
6237+
UNION
6238+
SELECT 1 > ( WITH cte AS ( SELECT 1 FROM x ) SELECT 1 FROM cte ) )
6239+
SELECT 1 FROM x;
6240+
ERROR HY000: Restrictions imposed on recursive definitions are violated for table 'x'
62326241
# End of 10.11 tests

mysql-test/main/cte_recursive.test

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4074,12 +4074,12 @@ SELECT ( WITH RECURSIVE x AS ( WITH x AS ( SELECT 1 FROM t14 ) SELECT x ) , t14
40744074
--echo #
40754075

40764076
# As in bug report
4077-
--error ER_BAD_FIELD_ERROR
4077+
--error ER_NOT_STANDARD_COMPLIANT_RECURSIVE
40784078
SELECT ( WITH RECURSIVE x AS ( SELECT * FROM ( SELECT UTC_TIMESTAMP FROM ( SELECT ( WITH x AS ( WITH x AS ( SELECT * FROM x ) SELECT 1 ) SELECT 1 ) ) x ) x UNION SELECT NULL ) ( SELECT x FROM x ) ) ;
40794079

40804080
#0 0x00005555569dff7b in TABLE_LIST::reset_const_table (this=0x7fffe0019938) at ../src/sql/table.cc:9615
40814081
#1 0x00005555569dffd4 in TABLE_LIST::reset_const_table (this=0x7fffe001a8c0) at ../src/sql/table.cc:9622
4082-
--error ER_BAD_FIELD_ERROR
4082+
--error ER_NOT_STANDARD_COMPLIANT_RECURSIVE
40834083
select (
40844084
with recursive x as (
40854085
select * from (
@@ -4243,4 +4243,15 @@ with recursive r (y) as (
42434243
select z * 2 from r where z < 10)
42444244
select y from r;
42454245

4246+
--echo #
4247+
--echo # MDEV-32326: Recursive reference in scalar subquery should be rejected
4248+
--echo #
4249+
4250+
--error ER_NOT_STANDARD_COMPLIANT_RECURSIVE
4251+
WITH RECURSIVE x AS (
4252+
SELECT 1
4253+
UNION
4254+
SELECT 1 > ( WITH cte AS ( SELECT 1 FROM x ) SELECT 1 FROM cte ) )
4255+
SELECT 1 FROM x;
4256+
42464257
--echo # End of 10.11 tests

mysql-test/main/derived_opt.result

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,4 +566,36 @@ DROP TABLE t1, t2;
566566
#
567567
# End of 10.3 tests
568568
#
569+
#
570+
# MDEV-24931: Assertion `prefix_size <= width' failed in
571+
# Bitmap<64>::is_prefix with >64-column NATURAL JOIN on derived table
572+
#
573+
CREATE TABLE t1 (
574+
c1 INT, c2 INT, c3 INT, c4 INT, c5 INT, c6 INT, c7 INT, c8 INT,
575+
c9 INT, c10 INT, c11 INT, c12 INT, c13 INT, c14 INT, c15 INT, c16 INT,
576+
c17 INT, c18 INT, c19 INT, c20 INT, c21 INT, c22 INT, c23 INT, c24 INT,
577+
c25 INT, c26 INT, c27 INT, c28 INT, c29 INT, c30 INT, c31 INT, c32 INT,
578+
c33 INT, c34 INT, c35 INT, c36 INT, c37 INT, c38 INT, c39 INT, c40 INT,
579+
c41 INT, c42 INT, c43 INT, c44 INT, c45 INT, c46 INT, c47 INT, c48 INT,
580+
c49 INT, c50 INT, c51 INT, c52 INT, c53 INT, c54 INT, c55 INT, c56 INT,
581+
c57 INT, c58 INT, c59 INT, c60 INT, c61 INT, c62 INT, c63 INT, c64 INT,
582+
c65 INT
583+
) ENGINE=InnoDB;
584+
CREATE VIEW v1 AS SELECT * FROM t1;
585+
set optimizer_switch='derived_merge=off';
586+
# Derived table subquery
587+
SELECT * FROM t1 AS a NATURAL JOIN (SELECT * FROM t1) AS b;
588+
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 c33 c34 c35 c36 c37 c38 c39 c40 c41 c42 c43 c44 c45 c46 c47 c48 c49 c50 c51 c52 c53 c54 c55 c56 c57 c58 c59 c60 c61 c62 c63 c64 c65
589+
# View
590+
SELECT * FROM v1 NATURAL JOIN t1;
591+
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 c33 c34 c35 c36 c37 c38 c39 c40 c41 c42 c43 c44 c45 c46 c47 c48 c49 c50 c51 c52 c53 c54 c55 c56 c57 c58 c59 c60 c61 c62 c63 c64 c65
592+
# CTE
593+
WITH cte AS (SELECT * FROM t1) SELECT * FROM t1 NATURAL JOIN cte;
594+
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 c33 c34 c35 c36 c37 c38 c39 c40 c41 c42 c43 c44 c45 c46 c47 c48 c49 c50 c51 c52 c53 c54 c55 c56 c57 c58 c59 c60 c61 c62 c63 c64 c65
595+
set optimizer_switch= @save_optimizer_switch;
596+
DROP VIEW v1;
597+
DROP TABLE t1;
598+
#
599+
# End of 10.11 tests
600+
#
569601
set optimizer_switch=@exit_optimizer_switch;

mysql-test/main/derived_opt.test

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Initialize
2+
--source include/have_innodb.inc
23
--disable_warnings
34
drop table if exists t0,t1,t2,t3;
45
drop database if exists test1;
@@ -439,5 +440,43 @@ DROP TABLE t1, t2;
439440
--echo # End of 10.3 tests
440441
--echo #
441442

443+
--echo #
444+
--echo # MDEV-24931: Assertion `prefix_size <= width' failed in
445+
--echo # Bitmap<64>::is_prefix with >64-column NATURAL JOIN on derived table
446+
--echo #
447+
448+
CREATE TABLE t1 (
449+
c1 INT, c2 INT, c3 INT, c4 INT, c5 INT, c6 INT, c7 INT, c8 INT,
450+
c9 INT, c10 INT, c11 INT, c12 INT, c13 INT, c14 INT, c15 INT, c16 INT,
451+
c17 INT, c18 INT, c19 INT, c20 INT, c21 INT, c22 INT, c23 INT, c24 INT,
452+
c25 INT, c26 INT, c27 INT, c28 INT, c29 INT, c30 INT, c31 INT, c32 INT,
453+
c33 INT, c34 INT, c35 INT, c36 INT, c37 INT, c38 INT, c39 INT, c40 INT,
454+
c41 INT, c42 INT, c43 INT, c44 INT, c45 INT, c46 INT, c47 INT, c48 INT,
455+
c49 INT, c50 INT, c51 INT, c52 INT, c53 INT, c54 INT, c55 INT, c56 INT,
456+
c57 INT, c58 INT, c59 INT, c60 INT, c61 INT, c62 INT, c63 INT, c64 INT,
457+
c65 INT
458+
) ENGINE=InnoDB;
459+
460+
CREATE VIEW v1 AS SELECT * FROM t1;
461+
462+
set optimizer_switch='derived_merge=off';
463+
464+
--echo # Derived table subquery
465+
SELECT * FROM t1 AS a NATURAL JOIN (SELECT * FROM t1) AS b;
466+
467+
--echo # View
468+
SELECT * FROM v1 NATURAL JOIN t1;
469+
470+
--echo # CTE
471+
WITH cte AS (SELECT * FROM t1) SELECT * FROM t1 NATURAL JOIN cte;
472+
473+
set optimizer_switch= @save_optimizer_switch;
474+
DROP VIEW v1;
475+
DROP TABLE t1;
476+
477+
--echo #
478+
--echo # End of 10.11 tests
479+
--echo #
480+
442481
# The following command must be the last one the file
443482
set optimizer_switch=@exit_optimizer_switch;

0 commit comments

Comments
 (0)