Skip to content

Commit 7e8a13d

Browse files
committed
Merge 10.6 into 10.7
2 parents 32e8e84 + e0f7c89 commit 7e8a13d

File tree

134 files changed

+3656
-3643
lines changed

Some content is hidden

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

134 files changed

+3656
-3643
lines changed

cmake/install_macros.cmake

+12-8
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,20 @@ IF(WIN32)
182182
SET(SIGNTOOL_PARAMETERS
183183
/a /t http://timestamp.globalsign.com/?signature=sha2
184184
CACHE STRING "parameters for signtool (list)")
185-
FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool
186-
PATHS "$ENV{ProgramFiles}/Microsoft SDKs/Windows/v7.0A/bin"
187-
"$ENV{ProgramFiles}/Windows Kits/8.0/bin/x86"
188-
"$ENV{ProgramFiles}/Windows Kits/8.1/bin/x86"
189-
)
190185
IF(NOT SIGNTOOL_EXECUTABLE)
191-
MESSAGE(FATAL_ERROR
192-
"signtool is not found. Signing executables not possible")
186+
FILE(GLOB path_list
187+
"$ENV{ProgramFiles} (x86)/Windows Kits/*/bin/*/x64"
188+
"$ENV{ProgramFiles} (x86)/Windows Kits/*/App Certification Kit"
189+
)
190+
FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool
191+
PATHS ${path_list}
192+
)
193+
IF(NOT SIGNTOOL_EXECUTABLE)
194+
MESSAGE(FATAL_ERROR
195+
"signtool is not found. Signing executables not possible")
196+
ENDIF()
197+
MARK_AS_ADVANCED(SIGNTOOL_EXECUTABLE SIGNTOOL_PARAMETERS)
193198
ENDIF()
194-
MARK_AS_ADVANCED(SIGNTOOL_EXECUTABLE SIGNTOOL_PARAMETERS)
195199
ENDIF()
196200
ENDIF()
197201

mysql-test/main/cte_nonrecursive.result

+50
Original file line numberDiff line numberDiff line change
@@ -2086,6 +2086,56 @@ a b a b
20862086
1 3 1 3
20872087
drop procedure sp;
20882088
drop table t1;
2089+
#
2090+
# MDEV-26825: query with two usage of CTE that refers to another CTE
2091+
# with stored function using a base table.
2092+
#
2093+
create table t1 (id int primary key);
2094+
insert into t1 values
2095+
(1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
2096+
create function f(in_id int) returns integer
2097+
return (select id from t1 where t1.id = in_id);
2098+
with c1 as (select id from t1 where f(id)=id group by id),
2099+
c2 as (select id from c1 as pt group by id)
2100+
select id from c2 as s1 union select id from c2 as s2;
2101+
id
2102+
1
2103+
2
2104+
3
2105+
4
2106+
5
2107+
6
2108+
7
2109+
8
2110+
9
2111+
10
2112+
with c1 as (select id from t1 as r where f(id)=id group by id),
2113+
c2 as (select id from c1 as pt group by id)
2114+
select id from c2 as s1 union select id from c2 as s2;
2115+
id
2116+
1
2117+
2
2118+
3
2119+
4
2120+
5
2121+
6
2122+
7
2123+
8
2124+
9
2125+
10
2126+
create function g() returns int return (select count(*) from t1);
2127+
create procedure sp1()
2128+
with c1 as (select id from t1 a where g() > 10),
2129+
c2 as (select id from c1)
2130+
select id from c2 as s1 union select id from c2 as s2;
2131+
call sp1();
2132+
id
2133+
call sp1();
2134+
id
2135+
drop procedure sp1;
2136+
drop function g;
2137+
drop function f;
2138+
drop table t1;
20892139
# End of 10.2 tests
20902140
#
20912141
# MDEV-21673: several references to CTE that uses

mysql-test/main/cte_nonrecursive.test

+36
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,42 @@ call sp();
15541554
drop procedure sp;
15551555
drop table t1;
15561556

1557+
--echo #
1558+
--echo # MDEV-26825: query with two usage of CTE that refers to another CTE
1559+
--echo # with stored function using a base table.
1560+
--echo #
1561+
1562+
create table t1 (id int primary key);
1563+
insert into t1 values
1564+
(1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
1565+
1566+
create function f(in_id int) returns integer
1567+
return (select id from t1 where t1.id = in_id);
1568+
1569+
with c1 as (select id from t1 where f(id)=id group by id),
1570+
c2 as (select id from c1 as pt group by id)
1571+
select id from c2 as s1 union select id from c2 as s2;
1572+
1573+
with c1 as (select id from t1 as r where f(id)=id group by id),
1574+
c2 as (select id from c1 as pt group by id)
1575+
select id from c2 as s1 union select id from c2 as s2;
1576+
1577+
create function g() returns int return (select count(*) from t1);
1578+
create procedure sp1()
1579+
1580+
with c1 as (select id from t1 a where g() > 10),
1581+
c2 as (select id from c1)
1582+
select id from c2 as s1 union select id from c2 as s2;
1583+
1584+
call sp1();
1585+
call sp1();
1586+
1587+
drop procedure sp1;
1588+
drop function g;
1589+
1590+
drop function f;
1591+
drop table t1;
1592+
15571593
--echo # End of 10.2 tests
15581594

15591595
--echo #

mysql-test/main/mysql_binary_zero_insert.result

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ COUNT(*)=8
3232
# Note: We only look for 00 because the 5c only served as an escape
3333
# in parsing.
3434
#
35-
# MYSQL_DUMP test tb --hex-blob | grep INSERT > MYSQL_TMP_DIR/dump.sql
36-
FOUND 10 /00/ in dump.sql
35+
# MYSQL_DUMP test tb --hex-blob > MYSQL_TMP_DIR/dump.sql
36+
FOUND 8 /\([0-9]+,0x([1-9][0-9])*00([1-9][0-9])*\)/ in dump.sql
3737
#
3838
# Ensure data consistency on mysqlbinlog replay
3939
#

mysql-test/main/mysql_binary_zero_insert.test

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ SELECT COUNT(*)=8 from tb;
114114
--echo # Note: We only look for 00 because the 5c only served as an escape
115115
--echo # in parsing.
116116
--echo #
117-
--echo # MYSQL_DUMP test tb --hex-blob | grep INSERT > MYSQL_TMP_DIR/dump.sql
118-
--exec $MYSQL_DUMP test tb --hex-blob | grep -A8 INSERT > $MYSQL_TMP_DIR/dump.sql
119-
--let SEARCH_PATTERN= 00
117+
--echo # MYSQL_DUMP test tb --hex-blob > MYSQL_TMP_DIR/dump.sql
118+
--exec $MYSQL_DUMP test tb --hex-blob > $MYSQL_TMP_DIR/dump.sql
119+
--let SEARCH_PATTERN= \([0-9]+,0x([1-9][0-9])*00([1-9][0-9])*\)
120120
--let SEARCH_FILE= $MYSQL_TMP_DIR/dump.sql
121121
--source include/search_pattern_in_file.inc
122122

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
call mtr.add_suppression("InnoDB: .*: Page 0 at offset 0 looks corrupted");
2+
call mtr.add_suppression("Index for table 'dst' is corrupt; try to repair it");
3+
call mtr.add_suppression("Page for tablespace .* is index page with id .* but that index is not found from configuration file");
4+
CREATE TABLE src (pk INT PRIMARY KEY, value INT) ENGINE=INNODB;
5+
INSERT INTO src VALUES (1, 1), (2, 2), (3, 3);
6+
FLUSH TABLES src FOR EXPORT;
7+
UNLOCK TABLES;
8+
DROP TABLE src;
9+
CREATE TABLE dst (pk INT PRIMARY KEY, value INT) ENGINE=INNODB;
10+
ALTER TABLE dst DISCARD TABLESPACE;
11+
ALTER TABLE dst IMPORT TABLESPACE;
12+
ERROR HY000: Index for table 'dst' is corrupt; try to repair it
13+
DROP TABLE dst;

mysql-test/suite/encryption/r/innodb_encrypt_key_rotation_age.result

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ test/t2
6767
test/t3
6868
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
6969
NAME
70-
test/t4
71-
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
72-
NAME
7370
innodb_system
74-
mysql/innodb_index_stats
7571
mysql/innodb_table_stats
72+
mysql/innodb_index_stats
7673
mysql/transaction_registry
74+
test/t4
75+
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
76+
NAME
7777
test/t1
7878
test/t2
7979
test/t3

mysql-test/suite/encryption/r/innodb_encryption.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ innodb_encryption_threads 0
6666
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
6767
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
6868
NAME
69-
innodb_system
7069
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
7170
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
7271
NAME
72+
innodb_system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[crc32]
2+
innodb-checksum-algorithm=crc32
3+
[full_crc32]
4+
innodb-checksum-algorithm=full_crc32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--innodb-encrypt-tables=1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--source include/have_innodb.inc
2+
--source include/have_example_key_management_plugin.inc
3+
4+
call mtr.add_suppression("InnoDB: .*: Page 0 at offset 0 looks corrupted");
5+
call mtr.add_suppression("Index for table 'dst' is corrupt; try to repair it");
6+
call mtr.add_suppression("Page for tablespace .* is index page with id .* but that index is not found from configuration file");
7+
8+
let MYSQLD_DATADIR = `SELECT @@datadir`;
9+
10+
11+
CREATE TABLE src (pk INT PRIMARY KEY, value INT) ENGINE=INNODB;
12+
INSERT INTO src VALUES (1, 1), (2, 2), (3, 3);
13+
14+
FLUSH TABLES src FOR EXPORT;
15+
16+
--copy_file $MYSQLD_DATADIR/test/src.ibd $MYSQLD_DATADIR/test/tmp.ibd
17+
--copy_file $MYSQLD_DATADIR/test/src.cfg $MYSQLD_DATADIR/test/tmp.cfg
18+
19+
perl;
20+
use strict;
21+
die unless open(FILE, "+<$ENV{MYSQLD_DATADIR}/test/tmp.ibd");
22+
binmode FILE;
23+
die unless seek(FILE, 3 * 16384 + 26, 0);
24+
print FILE pack("N", 0x00000000);
25+
close(FILE);
26+
EOF
27+
28+
UNLOCK TABLES;
29+
30+
DROP TABLE src;
31+
32+
CREATE TABLE dst (pk INT PRIMARY KEY, value INT) ENGINE=INNODB;
33+
ALTER TABLE dst DISCARD TABLESPACE;
34+
35+
--copy_file $MYSQLD_DATADIR/test/tmp.ibd $MYSQLD_DATADIR/test/dst.ibd
36+
--copy_file $MYSQLD_DATADIR/test/tmp.cfg $MYSQLD_DATADIR/test/dst.cfg
37+
38+
--error ER_NOT_KEYFILE
39+
ALTER TABLE dst IMPORT TABLESPACE;
40+
41+
DROP TABLE dst;
42+
43+
--remove_file $MYSQLD_DATADIR/test/tmp.ibd
44+
--remove_file $MYSQLD_DATADIR/test/tmp.cfg

mysql-test/suite/encryption/t/innodb_encryption.test

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NA
9090

9191
SHOW VARIABLES LIKE 'innodb_encrypt%';
9292

93+
--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
94+
--source include/wait_condition.inc
95+
9396
--sorted_result
9497
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
9598
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';

mysql-test/suite/gcol/r/virtual_index_drop.result

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ t1 CREATE TABLE `t1` (
2525
) ENGINE=InnoDB DEFAULT CHARSET=latin1
2626
DROP TABLE t1;
2727
CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB;
28+
INSERT INTO t1(f1) VALUES(1);
2829
SET DEBUG_DBUG="+d,create_index_fail";
2930
SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal";
3031
ALTER TABLE t1 ADD COLUMN f3 INT AS (f1) VIRTUAL, ADD INDEX(f2, f3);
@@ -33,6 +34,7 @@ SET DEBUG_SYNC="now WAIT_FOR con1_go";
3334
BEGIN;
3435
SELECT * FROM t1;
3536
f1 f2
37+
1 1
3638
SET DEBUG_SYNC="now SIGNAL alter_signal";
3739
connection default;
3840
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
@@ -47,6 +49,7 @@ t1 CREATE TABLE `t1` (
4749
) ENGINE=InnoDB DEFAULT CHARSET=latin1
4850
DROP TABLE t1;
4951
CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB;
52+
INSERT INTO t1(f1) VALUES(1);
5053
SET DEBUG_DBUG="+d,create_index_fail";
5154
SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal";
5255
ALTER TABLE t1 ADD INDEX(f2);

mysql-test/suite/gcol/t/virtual_index_drop.test

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ DROP TABLE t1;
2929
# new_vcol_info in index when rollback of alter happens
3030

3131
CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB;
32+
INSERT INTO t1(f1) VALUES(1);
3233
SET DEBUG_DBUG="+d,create_index_fail";
3334
SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal";
3435
SEND ALTER TABLE t1 ADD COLUMN f3 INT AS (f1) VIRTUAL, ADD INDEX(f2, f3);
@@ -47,6 +48,7 @@ SHOW CREATE TABLE t1;
4748
DROP TABLE t1;
4849

4950
CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB;
51+
INSERT INTO t1(f1) VALUES(1);
5052
SET DEBUG_DBUG="+d,create_index_fail";
5153
SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal";
5254
send ALTER TABLE t1 ADD INDEX(f2);

mysql-test/suite/innodb/r/alter_candidate_key.result

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ CREATE TABLE t1(f1 INT, f2 INT,
3434
PRIMARY KEY(f1, f2),
3535
UNIQUE INDEX uidx2 (f1, f2),
3636
UNIQUE INDEX uidx1 (f2))ENGINE=InnoDB;
37+
INSERT INTO t1 VALUES(2, 2);
3738
ALTER TABLE t1 DROP PRIMARY KEY;
3839
SHOW CREATE TABLE t1;
3940
Table Create Table
@@ -66,7 +67,7 @@ test.t1 check status OK
6667
DROP TABLE t1;
6768
SET SQL_MODE= strict_trans_tables;
6869
CREATE TABLE t1(a INT UNIQUE) ENGINE=InnoDB;
69-
INSERT INTO t1 VALUES(3);
70+
INSERT INTO t1 VALUES(1);
7071
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
7172
ALTER TABLE t1 MODIFY COLUMN a INT NOT NULL;
7273
connection con1;

mysql-test/suite/innodb/r/alter_not_null_debug.result

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ SET DEBUG_SYNC='RESET';
8080
#
8181
CREATE TABLE t1 (f VARCHAR(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci)
8282
ENGINE=InnoDB;
83+
INSERT INTO t1 VALUES('ZERO');
8384
connection con1;
8485
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR insert_done';
8586
ALTER TABLE t1 MODIFY f VARCHAR(256) COLLATE latin1_german2_ci NOT NULL;
@@ -96,5 +97,6 @@ ALTER TABLE t1 CHANGE f eins VARCHAR(257) COLLATE latin1_german1_ci NOT NULL,
9697
ALGORITHM=INSTANT;
9798
SELECT * FROM t1;
9899
eins
100+
ZERO
99101
one
100102
DROP TABLE t1;

mysql-test/suite/innodb/r/alter_primary_key.result

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55
CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
66
CREATE TABLE t1 (c CHAR(2) NOT NULL) ENGINE=InnoDB;
7+
INSERT INTO t1 VALUES('cd');
78
connect con1,localhost,root,,;
89
BEGIN;
910
INSERT INTO t0 VALUES(1);
@@ -21,6 +22,7 @@ ERROR 23000: Duplicate entry 'a' for key 'PRIMARY'
2122
SET DEBUG_SYNC='RESET';
2223
SELECT * FROM t1;
2324
c
25+
cd
2426
ab
2527
ac
2628
DROP TABLE t0,t1;

mysql-test/suite/innodb/r/ddl_purge.result

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
22
CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=InnoDB;
33
INSERT INTO t0 VALUES(100);
4+
INSERT INTO t1 VALUES(100, 100);
45
connect con1,localhost,root,,test;
56
BEGIN;
67
INSERT INTO t0 SET pk=1;

mysql-test/suite/innodb/r/innodb-alter-tempfile.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ connect con1,localhost,root,,;
5555
BEGIN;
5656
DELETE FROM mysql.innodb_table_stats;
5757
connect con2,localhost,root,,;
58-
SET DEBUG_SYNC='inplace_after_index_build SIGNAL blocked WAIT_FOR ever';
58+
SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL blocked WAIT_FOR ever';
5959
ALTER TABLE t1 FORCE;
6060
connection default;
6161
SET DEBUG_SYNC='now WAIT_FOR blocked';

mysql-test/suite/innodb/r/innodb-index-debug.result

+4-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ COUNT(k1) k2 k3
8181
drop table t1;
8282
create table t1(k1 int auto_increment primary key,
8383
k2 char(200),k3 char(200))engine=innodb;
84+
INSERT INTO t1 VALUES(1, "test", "test");
8485
SET DEBUG_SYNC= 'row_merge_after_scan
8586
SIGNAL opened WAIT_FOR flushed';
8687
ALTER TABLE t1 FORCE, ADD COLUMN k4 int;
@@ -100,6 +101,7 @@ SELECT COUNT(k1),k2,k3 FROM t1 GROUP BY k2,k3;
100101
COUNT(k1) k2 k3
101102
480 aaa bbb
102103
480 aaaa bbbb
104+
1 test test
103105
disconnect con1;
104106
connection default;
105107
show create table t1;
@@ -109,14 +111,15 @@ t1 CREATE TABLE `t1` (
109111
`k2` char(200) DEFAULT NULL,
110112
`k3` char(200) DEFAULT NULL,
111113
PRIMARY KEY (`k1`)
112-
) ENGINE=InnoDB AUTO_INCREMENT=1023 DEFAULT CHARSET=latin1
114+
) ENGINE=InnoDB AUTO_INCREMENT=1024 DEFAULT CHARSET=latin1
113115
drop table t1;
114116
drop table t480;
115117
#
116118
# MDEV-12827 Assertion failure when reporting duplicate key error
117119
# in online table rebuild
118120
#
119121
CREATE TABLE t1 (j INT UNIQUE, i INT UNIQUE) ENGINE=InnoDB;
122+
INSERT INTO t1 VALUES(2, 2);
120123
connect con1,localhost,root,,test;
121124
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL built WAIT_FOR log';
122125
ALTER TABLE t1 DROP j, FORCE;

0 commit comments

Comments
 (0)