Skip to content
Permalink
Browse files
Merge branch '10.9' into 10.10
  • Loading branch information
sanja-byelkin committed Jan 18, 2023
2 parents 6ffe9ad + 08d4968 commit 45087dd
Show file tree
Hide file tree
Showing 53 changed files with 827 additions and 131 deletions.
@@ -9,10 +9,8 @@ MariaDB Corporation https://www.mariadb.com (2013)
Microsoft https://microsoft.com/ (2017)
ServiceNow https://servicenow.com (2019)
SIT https://sit.org (2022)
Tencent Cloud https://cloud.tencent.com (2017)
Development Bank of Singapore https://dbs.com (2016)
IBM https://www.ibm.com (2017)
Visma https://visma.com (2015)
Automattic https://automattic.com (2019)
Galera Cluster https://galeracluster.com (2020)
Percona https://www.percona.com (2018)
@@ -54,8 +54,8 @@ MACRO(BUNDLE_PCRE2)
ExternalProject_Add(
pcre2
PREFIX "${dir}"
URL "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.40/pcre2-10.40.zip"
URL_MD5 798698846982ce171d881ed0d7535c2a
URL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.zip"
URL_MD5 fe90992fbfb03f854bd9f344074f49eb
INSTALL_COMMAND ""
CMAKE_ARGS
"-DCMAKE_WARN_DEPRECATED=FALSE"
@@ -157,6 +157,8 @@ IF(WOLFSSL_X86_64_BUILD)
${WOLFCRYPT_SRCDIR}/sha512_asm.S
${WOLFCRYPT_SRCDIR}/sha256_asm.S)
ADD_DEFINITIONS(-maes -msse4.2 -mpclmul)
# WolfSSL 5.5.4 bug - user_settings.h not included into aes_asm.S
SET_PROPERTY(SOURCE ${WOLFCRYPT_SRCDIR}/aes_asm.S APPEND PROPERTY COMPILE_OPTIONS "-DWOLFSSL_X86_64_BUILD")
ENDIF()
ENDIF()

Submodule wolfssl updated 522 files
@@ -183,7 +183,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP PROCEDURE sp;
DROP TABLE t1;
#
# End of 10.2 tests
#
create table t1 (a int check (a>10)) select 100 as 'a';
show create table t1;
Table Create Table
@@ -201,3 +203,35 @@ a
19
ccc
drop table t1;
create table t1 (a int, b int);
create procedure sp() alter table t1 add constraint if not exists foo check (b > 0);
call sp;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `foo` CHECK (`b` > 0)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
call sp;
Warnings:
Note 1826 Duplicate CHECK constraint name 'foo'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `foo` CHECK (`b` > 0)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
call sp;
Warnings:
Note 1826 Duplicate CHECK constraint name 'foo'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `foo` CHECK (`b` > 0)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop procedure sp;
drop table t1;
@@ -151,7 +151,9 @@ show create table t1;
DROP PROCEDURE sp;
DROP TABLE t1;

--echo #
--echo # End of 10.2 tests
--echo #

#
# Check that we don't lose constraints as part of CREATE ... SELECT
@@ -172,3 +174,18 @@ insert into t1 values ("ccc");
insert into t1 values ("");
select * from t1;
drop table t1;

#
# add if not exists in SP
#

create table t1 (a int, b int);
create procedure sp() alter table t1 add constraint if not exists foo check (b > 0);
call sp;
show create table t1;
call sp;
show create table t1;
call sp;
show create table t1;
drop procedure sp;
drop table t1;
@@ -1611,6 +1611,18 @@ SELECT json_object('a', coalesce(json_object('b', 'c')));
json_object('a', coalesce(json_object('b', 'c')))
{"a": {"b": "c"}}
#
# MDEV-26392: Crash with json_get_path_next and 10.5.12
#
CREATE TABLE arrNestTest (
id VARCHAR(80) AS (JSON_COMPACT(JSON_EXTRACT(doc, "$._id"))) UNIQUE KEY,
doc JSON,
CONSTRAINT id_not_null CHECK(id IS NOT NULL));
INSERT INTO test.arrNestTest (doc) VALUES ('{ "_id" : { "$oid" : "611c0a463b150154132f6636" }, "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : 1.0 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }');
SELECT * FROM arrNestTest;
id doc
{"$oid":"611c0a463b150154132f6636"} { "_id" : { "$oid" : "611c0a463b150154132f6636" }, "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : 1.0 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }
DROP TABLE arrNestTest;
#
# MDEV-26054 Server crashes in Item_func_json_arrayagg::get_str_from_field
#
CREATE TABLE t (a VARCHAR(8));
@@ -2506,6 +2518,24 @@ SELECT JSON_OVERLAPS(@json1, @json2);
JSON_OVERLAPS(@json1, @json2)
0
#
# MDEV-30304: Json Range only affects first row of the result set
#
CREATE TABLE t1 ( j JSON );
INSERT INTO t1 (j) VALUES ('[{"key1": 1, "key2": 1}, {"key3": 1, "key4": 1}]');
INSERT INTO t1 (j) VALUES ('[{"key1": 2, "key2": 2}, {"key3": 2, "key4": 2}, {"key5": 2, "key6": 2}]');
INSERT INTO t1 (j) VALUES ('[{"key1": 3, "key2": 3}, {"key3": 3, "key4": 3}, {"key5": 3}]');
SELECT JSON_EXTRACT(j, '$[0 to 1]') FROM t1 ;
JSON_EXTRACT(j, '$[0 to 1]')
[{"key1": 1, "key2": 1}, {"key3": 1, "key4": 1}]
[{"key1": 2, "key2": 2}, {"key3": 2, "key4": 2}]
[{"key1": 3, "key2": 3}, {"key3": 3, "key4": 3}]
SELECT JSON_EXTRACT(j, '$[*]') FROM t1 ;
JSON_EXTRACT(j, '$[*]')
[{"key1": 1, "key2": 1}, {"key3": 1, "key4": 1}]
[{"key1": 2, "key2": 2}, {"key3": 2, "key4": 2}, {"key5": 2, "key6": 2}]
[{"key1": 3, "key2": 3}, {"key3": 3, "key4": 3}, {"key5": 3}]
DROP TABLE t1;
#
# End of 10.9 Test
#
#
@@ -1054,6 +1054,18 @@ DROP TABLE t2;
SELECT json_object('a', if(1, json_object('b', 'c'), json_object('e', 'f')));
SELECT json_object('a', coalesce(json_object('b', 'c')));

--echo #
--echo # MDEV-26392: Crash with json_get_path_next and 10.5.12
--echo #

CREATE TABLE arrNestTest (
id VARCHAR(80) AS (JSON_COMPACT(JSON_EXTRACT(doc, "$._id"))) UNIQUE KEY,
doc JSON,
CONSTRAINT id_not_null CHECK(id IS NOT NULL));

INSERT INTO test.arrNestTest (doc) VALUES ('{ "_id" : { "$oid" : "611c0a463b150154132f6636" }, "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : 1.0 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }');
SELECT * FROM arrNestTest;
DROP TABLE arrNestTest;

--echo #
--echo # MDEV-26054 Server crashes in Item_func_json_arrayagg::get_str_from_field
@@ -1706,6 +1718,21 @@ SET @json2 = '{"kk":{"k1":"v1","k2":"v2","k3":"v3"}}';
SELECT JSON_OVERLAPS(@json2, @json1);
SELECT JSON_OVERLAPS(@json1, @json2);

--echo #
--echo # MDEV-30304: Json Range only affects first row of the result set
--echo #

CREATE TABLE t1 ( j JSON );

INSERT INTO t1 (j) VALUES ('[{"key1": 1, "key2": 1}, {"key3": 1, "key4": 1}]');
INSERT INTO t1 (j) VALUES ('[{"key1": 2, "key2": 2}, {"key3": 2, "key4": 2}, {"key5": 2, "key6": 2}]');
INSERT INTO t1 (j) VALUES ('[{"key1": 3, "key2": 3}, {"key3": 3, "key4": 3}, {"key5": 3}]');

SELECT JSON_EXTRACT(j, '$[0 to 1]') FROM t1 ;
SELECT JSON_EXTRACT(j, '$[*]') FROM t1 ;

DROP TABLE t1;

--echo #
--echo # End of 10.9 Test
--echo #
@@ -3407,3 +3407,20 @@ id select_type table type possible_keys key key_len ref rows Extra
drop table t1,t2,t3;
drop table t1000,t10,t03;
# End of 10.3 tests
#
# MDEV-30080 Wrong result with LEFT JOINs involving constant tables
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1),(1);
CREATE TABLE t3 (c INT PRIMARY KEY) ENGINE=MyISAM;
SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
a b c
1 1 NULL
1 1 NULL
SELECT COUNT(*) FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
COUNT(*)
2
DROP TABLE t1, t2, t3;
# End of 10.5 tests
@@ -1820,3 +1820,18 @@ drop table t1,t2,t3;
drop table t1000,t10,t03;

--echo # End of 10.3 tests

--echo #
--echo # MDEV-30080 Wrong result with LEFT JOINs involving constant tables
--echo #

CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1),(1);
CREATE TABLE t3 (c INT PRIMARY KEY) ENGINE=MyISAM;
SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
SELECT COUNT(*) FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
DROP TABLE t1, t2, t3;

--echo # End of 10.5 tests
@@ -2325,6 +2325,38 @@ DROP TABLE federated.t1;
connection slave;
DROP TABLE federated.t1;
connection default;
#
# MDEV-30395 Wrong result with semijoin and Federated as outer table
#
create server s foreign data wrapper mysql options (host "127.0.0.1", database "test", user "root", port MASTER_PORT);
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (3),(2),(3);
CREATE TABLE t2 (pk INT PRIMARY KEY);
INSERT INTO t2 VALUES (1),(2),(3),(4);
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch="materialization=off";
CREATE TABLE t2_fed ENGINE=FEDERATED CONNECTION='s/t2';
explain SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2_fed ALL NULL NULL NULL NULL 4 Using where
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
pk
2
3
SET optimizer_switch='semijoin=off';
explain SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2_fed ALL NULL NULL NULL NULL 4 Using where
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
pk
2
3
DROP TABLE t2_fed, t1, t2;
set @@optimizer_switch=@save_optimizer_switch;
DROP SERVER s;
# End of 10.5 tests
connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
@@ -2060,4 +2060,34 @@ connection slave;
DROP TABLE federated.t1;
connection default;

--echo #
--echo # MDEV-30395 Wrong result with semijoin and Federated as outer table
--echo #


--replace_result $MASTER_MYPORT MASTER_PORT
eval create server s foreign data wrapper mysql options (host "127.0.0.1", database "test", user "root", port $MASTER_MYPORT);

CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (3),(2),(3);
CREATE TABLE t2 (pk INT PRIMARY KEY);
INSERT INTO t2 VALUES (1),(2),(3),(4);

set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch="materialization=off";

CREATE TABLE t2_fed ENGINE=FEDERATED CONNECTION='s/t2';
explain SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
SET optimizer_switch='semijoin=off';
explain SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );

DROP TABLE t2_fed, t1, t2;
set @@optimizer_switch=@save_optimizer_switch;

DROP SERVER s;

--echo # End of 10.5 tests

source include/federated_cleanup.inc;
@@ -0,0 +1,40 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 varchar(2000));
INSERT INTO t1 VALUES (1, 0, REPEAT('1234567890', 200));
INSERT INTO t1 VALUES (3, 3, REPEAT('1234567890', 200));
SET SESSION wsrep_sync_wait=0;
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb";
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET SESSION wsrep_sync_wait=0;
connection node_1;
begin;
select f1,f2 from t1;
f1 f2
1 0
3 3
connection node_2;
UPDATE t1 SET f2=2 WHERE f1=3;
connection node_1a;
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
connection node_1;
UPDATE t1 SET f2=1 WHERE f1=3;
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync';
SET GLOBAL DEBUG_DBUG = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
SET GLOBAL debug_dbug = NULL;
SET debug_sync='RESET';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
select f1,f2 from t1;
f1 f2
1 0
3 2
DROP TABLE t1;
@@ -20,8 +20,6 @@ connection node_1;
include/diff_servers.inc [servers=1 2]
connection node_1;
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [async IST sender starting to serve]
connection node_2;
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
DROP TABLE t1;
@@ -134,8 +134,6 @@ connection node_1;
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
CALL mtr.add_suppression("conflict state 7 after post commit");
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [async IST sender starting to serve]
connection node_2;
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]

0 comments on commit 45087dd

Please sign in to comment.