Skip to content

Commit 45ede88

Browse files
committed
Merge 11.4 into 11.8
2 parents 2a96bc4 + f780d4d commit 45ede88

147 files changed

Lines changed: 3126 additions & 568 deletions

File tree

Some content is hidden

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

‎include/ssl_compat.h‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
#define HAVE_OPENSSL11 1
2525
#define SSL_LIBRARY OpenSSL_version(OPENSSL_VERSION)
2626
#define ERR_remove_state(X) ERR_clear_error()
27-
#define EVP_CIPHER_CTX_SIZE 200
28-
#define EVP_MD_CTX_SIZE 80
29-
#undef EVP_MD_CTX_init
30-
#define EVP_MD_CTX_init(X) do { memset((X), 0, EVP_MD_CTX_SIZE); EVP_MD_CTX_reset(X); } while(0)
31-
#undef EVP_CIPHER_CTX_init
32-
#define EVP_CIPHER_CTX_init(X) do { memset((X), 0, EVP_CIPHER_CTX_SIZE); EVP_CIPHER_CTX_reset(X); } while(0)
3327

3428
/*
3529
Macros below are deprecated. OpenSSL 1.1 may define them or not,
@@ -66,24 +60,16 @@
6660
#endif /* HAVE_OPENSSL11 */
6761
#endif
6862

69-
#ifdef HAVE_WOLFSSL
70-
#define EVP_MD_CTX_SIZE sizeof(wc_Md5)
71-
#endif
72-
7363
#ifndef HAVE_OPENSSL11
7464
#ifndef ASN1_STRING_get0_data
7565
#define ASN1_STRING_get0_data(X) ASN1_STRING_data(X)
7666
#endif
77-
#ifndef EVP_MD_CTX_SIZE
78-
#define EVP_MD_CTX_SIZE sizeof(EVP_MD_CTX)
79-
#endif
8067

8168
#ifndef DH_set0_pqg
8269
#define DH_set0_pqg(D,P,Q,G) ((D)->p= (P), (D)->g= (G))
8370
#endif
8471

8572
#define EVP_CIPHER_CTX_encrypting(ctx) ((ctx)->encrypt)
86-
#define EVP_CIPHER_CTX_SIZE sizeof(EVP_CIPHER_CTX)
8773

8874
#ifndef HAVE_WOLFSSL
8975
#define OPENSSL_init_ssl(X,Y) SSL_library_init()
@@ -97,13 +83,3 @@
9783
#ifndef TLS1_3_VERSION
9884
#define SSL_CTX_set_ciphersuites(X,Y) 0
9985
#endif
100-
101-
#ifdef __cplusplus
102-
extern "C" {
103-
#endif /* __cplusplus */
104-
105-
int check_openssl_compatibility();
106-
107-
#ifdef __cplusplus
108-
}
109-
#endif
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# MDEV-39146 Fix stack-use-after-return in PROCESSLIST for event threads
3+
#
4+
CREATE USER definer@localhost;
5+
GRANT EVENT ON *.* TO definer@localhost;
6+
GRANT SUPER ON *.* TO definer@localhost;
7+
SET DEBUG_SYNC= 'RESET';
8+
# Per-session DEBUG_SYNC: must arm from inside the event body (its own
9+
# thd), not from another connection.
10+
CREATE DEFINER=definer@localhost EVENT ev
11+
ON SCHEDULE AT CURRENT_TIMESTAMP
12+
DO
13+
BEGIN
14+
SET DEBUG_SYNC= 'event_worker_thread_after_execute_returned SIGNAL event_execute_returned';
15+
SET DEBUG_SYNC= 'now SIGNAL definer_ctx_active WAIT_FOR event_may_finish';
16+
END|
17+
Warnings:
18+
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
19+
SET GLOBAL event_scheduler= ON;
20+
# Connect 'waiter' now: iterate() holds server_threads' rwlock for the
21+
# whole scan; connecting after would deadlock (needs that lock's
22+
# write side).
23+
connect waiter, localhost, root,,;
24+
connection default;
25+
SET DEBUG_SYNC= 'now WAIT_FOR definer_ctx_active';
26+
# Pause right after processlist_callback() captures the
27+
# DEFINER-switched security_ctx, before USER/HOST are read.
28+
SET @saved_dbug= @@SESSION.debug_dbug;
29+
SET SESSION debug_dbug= '+d,processlist_callback_pause_after_sctx_capture';
30+
SET DEBUG_SYNC= 'processlist_callback_captured_sctx SIGNAL scanner_captured WAIT_FOR let_scanner_continue';
31+
# Filter by name: checks the value read through the captured pointer.
32+
SELECT user, host FROM information_schema.processlist WHERE user = 'definer';
33+
connection waiter;
34+
SET DEBUG_SYNC= 'now WAIT_FOR scanner_captured';
35+
# Let the event finish and execute() return.
36+
SET DEBUG_SYNC= 'now SIGNAL event_may_finish WAIT_FOR event_execute_returned TIMEOUT 60';
37+
# Release the scanner to dereference the pointer it captured.
38+
SET DEBUG_SYNC= 'now SIGNAL let_scanner_continue';
39+
disconnect waiter;
40+
connection default;
41+
user host
42+
definer localhost
43+
SET SESSION debug_dbug= @saved_dbug;
44+
SET DEBUG_SYNC= 'RESET';
45+
SET GLOBAL event_scheduler= OFF;
46+
DROP USER definer@localhost;
47+
# End of 10.11 tests

‎mysql-test/main/events_debug.test‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
--source include/have_debug.inc
2+
--source include/have_debug_sync.inc
3+
--source include/not_embedded.inc
4+
5+
--echo #
6+
--echo # MDEV-39146 Fix stack-use-after-return in PROCESSLIST for event threads
7+
--echo #
8+
9+
CREATE USER definer@localhost;
10+
GRANT EVENT ON *.* TO definer@localhost;
11+
GRANT SUPER ON *.* TO definer@localhost;
12+
13+
SET DEBUG_SYNC= 'RESET';
14+
15+
--echo # Per-session DEBUG_SYNC: must arm from inside the event body (its own
16+
--echo # thd), not from another connection.
17+
--delimiter |
18+
CREATE DEFINER=definer@localhost EVENT ev
19+
ON SCHEDULE AT CURRENT_TIMESTAMP
20+
DO
21+
BEGIN
22+
SET DEBUG_SYNC= 'event_worker_thread_after_execute_returned SIGNAL event_execute_returned';
23+
SET DEBUG_SYNC= 'now SIGNAL definer_ctx_active WAIT_FOR event_may_finish';
24+
END|
25+
--delimiter ;
26+
27+
SET GLOBAL event_scheduler= ON;
28+
29+
--echo # Connect 'waiter' now: iterate() holds server_threads' rwlock for the
30+
--echo # whole scan; connecting after would deadlock (needs that lock's
31+
--echo # write side).
32+
connect (waiter, localhost, root,,);
33+
connection default;
34+
35+
SET DEBUG_SYNC= 'now WAIT_FOR definer_ctx_active';
36+
37+
--echo # Pause right after processlist_callback() captures the
38+
--echo # DEFINER-switched security_ctx, before USER/HOST are read.
39+
SET @saved_dbug= @@SESSION.debug_dbug;
40+
SET SESSION debug_dbug= '+d,processlist_callback_pause_after_sctx_capture';
41+
SET DEBUG_SYNC= 'processlist_callback_captured_sctx SIGNAL scanner_captured WAIT_FOR let_scanner_continue';
42+
43+
--echo # Filter by name: checks the value read through the captured pointer.
44+
--send SELECT user, host FROM information_schema.processlist WHERE user = 'definer'
45+
46+
connection waiter;
47+
SET DEBUG_SYNC= 'now WAIT_FOR scanner_captured';
48+
49+
--echo # Let the event finish and execute() return.
50+
SET DEBUG_SYNC= 'now SIGNAL event_may_finish WAIT_FOR event_execute_returned TIMEOUT 60';
51+
52+
--echo # Release the scanner to dereference the pointer it captured.
53+
SET DEBUG_SYNC= 'now SIGNAL let_scanner_continue';
54+
55+
--disconnect waiter
56+
--connection default
57+
--reap
58+
59+
SET SESSION debug_dbug= @saved_dbug;
60+
SET DEBUG_SYNC= 'RESET';
61+
62+
SET GLOBAL event_scheduler= OFF;
63+
--source include/check_events_off.inc
64+
let $count_sessions= 1;
65+
--source include/wait_until_count_sessions.inc
66+
DROP USER definer@localhost;
67+
68+
--echo # End of 10.11 tests

‎mysql-test/main/grant2.result‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,11 +1143,11 @@ connection con1;
11431143
set time_zone= '+00:00';
11441144
select row_start, row_end from t;
11451145
row_start row_end
1146-
2001-01-01 00:00:00.000000 2106-02-07 06:28:15.999999
1146+
2001-01-01 00:00:00.000000 #
11471147
handler t open;
11481148
handler t read first;
11491149
id a b row_start row_end DB_ROW_HASH_1
1150-
1 10 x 2001-01-01 00:00:00.000000 2106-02-07 06:28:15.999999 #
1150+
1 10 x 2001-01-01 00:00:00.000000 # #
11511151
handler t close;
11521152
disconnect con1;
11531153
connection default;

‎mysql-test/main/grant2.test‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,9 +1179,10 @@ connection default;
11791179
grant select (a) on db.t to u@localhost;
11801180
connection con1;
11811181
set time_zone= '+00:00';
1182+
--replace_column 2 #
11821183
select row_start, row_end from t;
11831184
handler t open;
1184-
--replace_column 6 #
1185+
--replace_column 5 # 6 #
11851186
handler t read first;
11861187
handler t close;
11871188
disconnect con1;

‎mysql-test/main/group_by.result‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,7 +3043,7 @@ EXPLAIN
30433043
{
30443044
"query_block": {
30453045
"select_id": 1,
3046-
"pseudo_bits_condition": "if(uuid_short(),NULL,1)",
3046+
"outer_ref_condition": "if(uuid_short(),NULL,1)",
30473047
"nested_loop": [
30483048
{
30493049
"table": {
@@ -3069,7 +3069,7 @@ EXPLAIN
30693069
{
30703070
"query_block": {
30713071
"select_id": 1,
3072-
"pseudo_bits_condition": "10 = rand()",
3072+
"outer_ref_condition": "10 = rand()",
30733073
"nested_loop": [
30743074
{
30753075
"table": {

‎mysql-test/main/olap.result‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,3 +921,19 @@ MAX(c)
921921
DROP TABLE t1;
922922
# End of 10.11 tests
923923
ALTER DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
924+
#
925+
# MDEV-41146: WHERE is not checked when every table is const and
926+
# the query needs a temporary table
927+
#
928+
create table t1 (a int primary key);
929+
insert into t1 values (1),(2),(3);
930+
# rand() < 0 is never true, so only the ROLLUP total row is returned.
931+
select distinct a from t1 where a=1 and rand() < 0 group by a with rollup;
932+
a
933+
NULL
934+
select distinct a from t1 where a=1 and rand() >= 0 group by a with rollup;
935+
a
936+
1
937+
NULL
938+
drop table t1;
939+
# End of 11.4 tests

‎mysql-test/main/olap.test‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,4 +546,20 @@ SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP limit 5;
546546
DROP TABLE t1;
547547
--echo # End of 10.11 tests
548548

549-
--source include/test_db_charset_restore.inc
549+
ALTER DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
550+
551+
--echo #
552+
--echo # MDEV-41146: WHERE is not checked when every table is const and
553+
--echo # the query needs a temporary table
554+
--echo #
555+
556+
create table t1 (a int primary key);
557+
insert into t1 values (1),(2),(3);
558+
559+
--echo # rand() < 0 is never true, so only the ROLLUP total row is returned.
560+
select distinct a from t1 where a=1 and rand() < 0 group by a with rollup;
561+
select distinct a from t1 where a=1 and rand() >= 0 group by a with rollup;
562+
563+
drop table t1;
564+
565+
--echo # End of 11.4 tests

‎mysql-test/main/partition_explicit_prune.result‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,6 +2007,29 @@ drop table t1;
20072007
# End of 10.4 tests
20082008
#
20092009
#
2010+
# MDEV-17613 Read sole now-partition for non-historical versioned query
2011+
#
2012+
# INSERT ... SELECT from explicit PARTITION() without WHERE must not
2013+
# read partitions outside of it (read_partitions widened by auto-increment)
2014+
#
2015+
create table t1 (id int auto_increment primary key, x int)
2016+
partition by range (id) (
2017+
partition p0 values less than (10),
2018+
partition p1 values less than maxvalue);
2019+
insert into t1 values (1, 1), (2, 2), (11, 11), (12, 12);
2020+
create table t2 (id int, x int);
2021+
# Fresh share: auto-increment is not initialized yet
2022+
flush tables;
2023+
insert into t2 select * from t1 partition (p0);
2024+
select * from t2;
2025+
id x
2026+
1 1
2027+
2 2
2028+
drop tables t1, t2;
2029+
#
2030+
# End of 10.11 tests
2031+
#
2032+
#
20102033
# MDEV-33988 DELETE (single table) to support table aliases
20112034
#
20122035
CREATE TABLE `t1` (

‎mysql-test/main/partition_explicit_prune.test‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,29 @@ drop table t1;
942942
--echo # End of 10.4 tests
943943
--echo #
944944

945+
--echo #
946+
--echo # MDEV-17613 Read sole now-partition for non-historical versioned query
947+
--echo #
948+
--echo # INSERT ... SELECT from explicit PARTITION() without WHERE must not
949+
--echo # read partitions outside of it (read_partitions widened by auto-increment)
950+
--echo #
951+
create table t1 (id int auto_increment primary key, x int)
952+
partition by range (id) (
953+
partition p0 values less than (10),
954+
partition p1 values less than maxvalue);
955+
insert into t1 values (1, 1), (2, 2), (11, 11), (12, 12);
956+
create table t2 (id int, x int);
957+
--echo # Fresh share: auto-increment is not initialized yet
958+
flush tables;
959+
insert into t2 select * from t1 partition (p0);
960+
--sorted_result
961+
select * from t2;
962+
drop tables t1, t2;
963+
964+
--echo #
965+
--echo # End of 10.11 tests
966+
--echo #
967+
945968
--echo #
946969
--echo # MDEV-33988 DELETE (single table) to support table aliases
947970
--echo #

0 commit comments

Comments
 (0)