Skip to content

Commit a8c5635

Browse files
committed
Merge 10.5 into 10.6
2 parents 95de524 + 0459d2c commit a8c5635

Some content is hidden

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

41 files changed

+710
-110
lines changed

CREDITS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ MariaDB Corporation https://www.mariadb.com (2013)
99
Microsoft https://microsoft.com/ (2017)
1010
ServiceNow https://servicenow.com (2019)
1111
SIT https://sit.org (2022)
12-
Tencent Cloud https://cloud.tencent.com (2017)
1312
Development Bank of Singapore https://dbs.com (2016)
1413
IBM https://www.ibm.com (2017)
15-
Visma https://visma.com (2015)
1614
Automattic https://automattic.com (2019)
1715
Galera Cluster https://galeracluster.com (2020)
1816
Percona https://www.percona.com (2018)

libmariadb

mysql-test/main/constraints.result

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ t1 CREATE TABLE `t1` (
183183
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
184184
DROP PROCEDURE sp;
185185
DROP TABLE t1;
186+
#
186187
# End of 10.2 tests
188+
#
187189
create table t1 (a int check (a>10)) select 100 as 'a';
188190
show create table t1;
189191
Table Create Table
@@ -201,3 +203,35 @@ a
201203
19
202204
ccc
203205
drop table t1;
206+
create table t1 (a int, b int);
207+
create procedure sp() alter table t1 add constraint if not exists foo check (b > 0);
208+
call sp;
209+
show create table t1;
210+
Table Create Table
211+
t1 CREATE TABLE `t1` (
212+
`a` int(11) DEFAULT NULL,
213+
`b` int(11) DEFAULT NULL,
214+
CONSTRAINT `foo` CHECK (`b` > 0)
215+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
216+
call sp;
217+
Warnings:
218+
Note 1826 Duplicate CHECK constraint name 'foo'
219+
show create table t1;
220+
Table Create Table
221+
t1 CREATE TABLE `t1` (
222+
`a` int(11) DEFAULT NULL,
223+
`b` int(11) DEFAULT NULL,
224+
CONSTRAINT `foo` CHECK (`b` > 0)
225+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
226+
call sp;
227+
Warnings:
228+
Note 1826 Duplicate CHECK constraint name 'foo'
229+
show create table t1;
230+
Table Create Table
231+
t1 CREATE TABLE `t1` (
232+
`a` int(11) DEFAULT NULL,
233+
`b` int(11) DEFAULT NULL,
234+
CONSTRAINT `foo` CHECK (`b` > 0)
235+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
236+
drop procedure sp;
237+
drop table t1;

mysql-test/main/constraints.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ show create table t1;
151151
DROP PROCEDURE sp;
152152
DROP TABLE t1;
153153

154+
--echo #
154155
--echo # End of 10.2 tests
156+
--echo #
155157

156158
#
157159
# Check that we don't lose constraints as part of CREATE ... SELECT
@@ -172,3 +174,18 @@ insert into t1 values ("ccc");
172174
insert into t1 values ("");
173175
select * from t1;
174176
drop table t1;
177+
178+
#
179+
# add if not exists in SP
180+
#
181+
182+
create table t1 (a int, b int);
183+
create procedure sp() alter table t1 add constraint if not exists foo check (b > 0);
184+
call sp;
185+
show create table t1;
186+
call sp;
187+
show create table t1;
188+
call sp;
189+
show create table t1;
190+
drop procedure sp;
191+
drop table t1;

mysql-test/main/join.result

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3407,3 +3407,20 @@ id select_type table type possible_keys key key_len ref rows Extra
34073407
drop table t1,t2,t3;
34083408
drop table t1000,t10,t03;
34093409
# End of 10.3 tests
3410+
#
3411+
# MDEV-30080 Wrong result with LEFT JOINs involving constant tables
3412+
#
3413+
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
3414+
INSERT INTO t1 VALUES (1);
3415+
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
3416+
INSERT INTO t2 VALUES (1),(1);
3417+
CREATE TABLE t3 (c INT PRIMARY KEY) ENGINE=MyISAM;
3418+
SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
3419+
a b c
3420+
1 1 NULL
3421+
1 1 NULL
3422+
SELECT COUNT(*) FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
3423+
COUNT(*)
3424+
2
3425+
DROP TABLE t1, t2, t3;
3426+
# End of 10.5 tests

mysql-test/main/join.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,3 +1820,18 @@ drop table t1,t2,t3;
18201820
drop table t1000,t10,t03;
18211821

18221822
--echo # End of 10.3 tests
1823+
1824+
--echo #
1825+
--echo # MDEV-30080 Wrong result with LEFT JOINs involving constant tables
1826+
--echo #
1827+
1828+
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
1829+
INSERT INTO t1 VALUES (1);
1830+
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
1831+
INSERT INTO t2 VALUES (1),(1);
1832+
CREATE TABLE t3 (c INT PRIMARY KEY) ENGINE=MyISAM;
1833+
SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
1834+
SELECT COUNT(*) FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
1835+
DROP TABLE t1, t2, t3;
1836+
1837+
--echo # End of 10.5 tests

mysql-test/suite/federated/federatedx.result

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,6 +2325,38 @@ DROP TABLE federated.t1;
23252325
connection slave;
23262326
DROP TABLE federated.t1;
23272327
connection default;
2328+
#
2329+
# MDEV-30395 Wrong result with semijoin and Federated as outer table
2330+
#
2331+
create server s foreign data wrapper mysql options (host "127.0.0.1", database "test", user "root", port MASTER_PORT);
2332+
CREATE TABLE t1 (a INT);
2333+
INSERT INTO t1 VALUES (3),(2),(3);
2334+
CREATE TABLE t2 (pk INT PRIMARY KEY);
2335+
INSERT INTO t2 VALUES (1),(2),(3),(4);
2336+
set @save_optimizer_switch=@@optimizer_switch;
2337+
set optimizer_switch="materialization=off";
2338+
CREATE TABLE t2_fed ENGINE=FEDERATED CONNECTION='s/t2';
2339+
explain SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
2340+
id select_type table type possible_keys key key_len ref rows Extra
2341+
1 PRIMARY t2_fed ALL NULL NULL NULL NULL 4 Using where
2342+
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
2343+
SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
2344+
pk
2345+
2
2346+
3
2347+
SET optimizer_switch='semijoin=off';
2348+
explain SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
2349+
id select_type table type possible_keys key key_len ref rows Extra
2350+
1 PRIMARY t2_fed ALL NULL NULL NULL NULL 4 Using where
2351+
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
2352+
SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
2353+
pk
2354+
2
2355+
3
2356+
DROP TABLE t2_fed, t1, t2;
2357+
set @@optimizer_switch=@save_optimizer_switch;
2358+
DROP SERVER s;
2359+
# End of 10.5 tests
23282360
connection master;
23292361
DROP TABLE IF EXISTS federated.t1;
23302362
DROP DATABASE IF EXISTS federated;

mysql-test/suite/federated/federatedx.test

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,4 +2060,34 @@ connection slave;
20602060
DROP TABLE federated.t1;
20612061
connection default;
20622062

2063+
--echo #
2064+
--echo # MDEV-30395 Wrong result with semijoin and Federated as outer table
2065+
--echo #
2066+
2067+
2068+
--replace_result $MASTER_MYPORT MASTER_PORT
2069+
eval create server s foreign data wrapper mysql options (host "127.0.0.1", database "test", user "root", port $MASTER_MYPORT);
2070+
2071+
CREATE TABLE t1 (a INT);
2072+
INSERT INTO t1 VALUES (3),(2),(3);
2073+
CREATE TABLE t2 (pk INT PRIMARY KEY);
2074+
INSERT INTO t2 VALUES (1),(2),(3),(4);
2075+
2076+
set @save_optimizer_switch=@@optimizer_switch;
2077+
set optimizer_switch="materialization=off";
2078+
2079+
CREATE TABLE t2_fed ENGINE=FEDERATED CONNECTION='s/t2';
2080+
explain SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
2081+
SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
2082+
SET optimizer_switch='semijoin=off';
2083+
explain SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
2084+
SELECT * FROM t2_fed WHERE pk IN ( SELECT a FROM t1 );
2085+
2086+
DROP TABLE t2_fed, t1, t2;
2087+
set @@optimizer_switch=@save_optimizer_switch;
2088+
2089+
DROP SERVER s;
2090+
2091+
--echo # End of 10.5 tests
2092+
20632093
source include/federated_cleanup.inc;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
connection node_2;
2+
connection node_1;
3+
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 varchar(2000));
4+
INSERT INTO t1 VALUES (1, 0, REPEAT('1234567890', 200));
5+
INSERT INTO t1 VALUES (3, 3, REPEAT('1234567890', 200));
6+
SET SESSION wsrep_sync_wait=0;
7+
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb";
8+
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
9+
connection node_1a;
10+
SET SESSION wsrep_sync_wait=0;
11+
connection node_1;
12+
begin;
13+
select f1,f2 from t1;
14+
f1 f2
15+
1 0
16+
3 3
17+
connection node_2;
18+
UPDATE t1 SET f2=2 WHERE f1=3;
19+
connection node_1a;
20+
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
21+
connection node_1;
22+
UPDATE t1 SET f2=1 WHERE f1=3;
23+
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
24+
COMMIT;
25+
connection node_1a;
26+
SET SESSION wsrep_on = 0;
27+
SET SESSION wsrep_on = 1;
28+
SET GLOBAL wsrep_provider_options = 'dbug=';
29+
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync';
30+
SET GLOBAL DEBUG_DBUG = "";
31+
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
32+
SET GLOBAL debug_dbug = NULL;
33+
SET debug_sync='RESET';
34+
connection node_1;
35+
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
36+
select f1,f2 from t1;
37+
f1 f2
38+
1 0
39+
3 2
40+
DROP TABLE t1;

mysql-test/suite/galera/r/galera_gcache_recover.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ connection node_1;
2020
include/diff_servers.inc [servers=1 2]
2121
connection node_1;
2222
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
23-
include/assert_grep.inc [async IST sender starting to serve]
2423
connection node_2;
2524
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
26-
include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
2725
DROP TABLE t1;

0 commit comments

Comments
 (0)