Skip to content
/ server Public

Commit 12e93b9

Browse files
committed
Merge 10.11 into 11.4
2 parents 9515cb9 + 97b32c4 commit 12e93b9

Some content is hidden

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

42 files changed

+845
-374
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6117,16 +6117,12 @@ xb_delta_open_matching_space(
61176117
ut_ad(fil_space_t::physical_size(flags) == info.page_size);
61186118

61196119
mysql_mutex_lock(&fil_system.mutex);
6120-
fil_space_t* space = fil_space_t::create(uint32_t(info.space_id),
6121-
flags, false, 0,
6122-
FIL_ENCRYPTION_DEFAULT, true);
6120+
std::ignore = fil_space_t::create(uint32_t(info.space_id),
6121+
flags, false, 0,
6122+
FIL_ENCRYPTION_DEFAULT, true);
61236123
mysql_mutex_unlock(&fil_system.mutex);
6124-
if (space) {
6125-
*success = xb_space_create_file(real_name, info.space_id,
6126-
flags, &file);
6127-
} else {
6128-
msg("Can't create tablespace %s\n", dest_space_name);
6129-
}
6124+
*success = xb_space_create_file(real_name, info.space_id,
6125+
flags, &file);
61306126

61316127
goto exit;
61326128
}

include/ilist.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ template <class T, class Tag= void> class ilist
189189
ListNode *prev= pos.node_->prev;
190190
ListNode *next= pos.node_->next;
191191

192+
DBUG_ASSERT(prev->next == pos.node_);
193+
DBUG_ASSERT(next->prev == pos.node_);
194+
192195
prev->next= next;
193196
next->prev= prev;
194197

@@ -202,7 +205,7 @@ template <class T, class Tag= void> class ilist
202205
}
203206

204207
void push_back(reference value) noexcept { insert(end(), value); }
205-
void pop_back() noexcept { erase(end()); }
208+
void pop_back() noexcept { erase(--end()); }
206209

207210
void push_front(reference value) noexcept { insert(begin(), value); }
208211
void pop_front() noexcept { erase(begin()); }

mysql-test/main/grant_kill.result

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ GRANT ALL PRIVILEGES ON *.* TO bar@localhost;
1414
REVOKE CONNECTION ADMIN ON *.* FROM bar@localhost;
1515
connect foo,localhost,foo,,;
1616
connect bar,localhost,bar,,;
17-
SELECT user FROM information_schema.processlist ORDER BY user;
17+
SELECT user FROM information_schema.processlist WHERE id=$id;
1818
user
19-
bar
2019
foo
21-
root
2220
KILL ID;
2321
ERROR HY000: You are not owner of thread ID
2422
disconnect foo;
@@ -35,11 +33,9 @@ CREATE USER bar@localhost;
3533
GRANT PROCESS, CONNECTION ADMIN ON *.* TO bar@localhost;
3634
connect foo,localhost,foo,,;
3735
connect bar,localhost,bar,,;
38-
SELECT user FROM information_schema.processlist ORDER BY user;
36+
SELECT user FROM information_schema.processlist WHERE id=$id;
3937
user
40-
bar
4138
foo
42-
root
4339
KILL ID;
4440
connection default;
4541
disconnect foo;

mysql-test/main/grant_kill.test

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
--echo #
1010
--disable_service_connection
1111

12-
--let $count_sessions=1
13-
1412
--echo #
1513
--echo # Test that KILL is not allowed without CONNECTION ADMIN
1614
--echo #
@@ -21,16 +19,15 @@ CREATE USER bar@localhost;
2119
GRANT ALL PRIVILEGES ON *.* TO bar@localhost;
2220
REVOKE CONNECTION ADMIN ON *.* FROM bar@localhost;
2321
--connect (foo,localhost,foo,,)
24-
let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
22+
let $id=`select connection_id()`;
2523
--connect (bar,localhost,bar,,)
26-
SELECT user FROM information_schema.processlist ORDER BY user;
24+
evalp SELECT user FROM information_schema.processlist WHERE id=$id;
2725
--replace_result $id ID
2826
--error ER_KILL_DENIED_ERROR
2927
--eval KILL $id
3028
--disconnect foo
3129
--disconnect bar
3230
--connection default
33-
--source include/wait_until_count_sessions.inc
3431
DROP USER foo@localhost;
3532
DROP USER bar@localhost;
3633

@@ -43,9 +40,9 @@ GRANT SELECT ON *.* TO foo@localhost;
4340
CREATE USER bar@localhost;
4441
GRANT PROCESS, CONNECTION ADMIN ON *.* TO bar@localhost;
4542
--connect (foo,localhost,foo,,)
46-
let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
43+
let $id=`select connection_id()`;
4744
--connect (bar,localhost,bar,,)
48-
SELECT user FROM information_schema.processlist ORDER BY user;
45+
evalp SELECT user FROM information_schema.processlist WHERE id=$id;
4946
--replace_result $id ID
5047
--eval KILL $id
5148
--connection default
@@ -55,7 +52,6 @@ let $wait_condition=
5552
--source include/wait_condition.inc
5653
--disconnect foo
5754
--disconnect bar
58-
--source include/wait_until_count_sessions.inc
5955
DROP USER foo@localhost;
6056
DROP USER bar@localhost;
6157

mysql-test/main/old-mode.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ drop table t1,t2;
1414
#
1515
# Test that SHOW PROCESSLIST doesn't have the Progress column
1616
#
17+
let $count_sessions= 1;
18+
source include/wait_until_count_sessions.inc;
1719

1820
--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
1921
# Embedded server is hardcoded to show "Writing to net" as STATE.

mysql-test/main/sp-bugs2.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--source include/have_perfschema.inc
12
--echo #
23
--echo # MDEV-6610 Assertion `thd->is_error() || thd->killed' failed in mysql_execute_command on executing an SP with repeated CREATE TABLE .. SELECT
34
--echo #
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
connection node_2;
2+
connection node_1;
3+
connection node_1;
4+
CREATE TABLE t1 (c INT);
5+
INSERT INTO t1 VALUES (0),(0);
6+
CREATE TABLE t2 (c INT);
7+
SET SESSION wsrep_trx_fragment_unit='STATEMENTS';
8+
SET SESSION wsrep_trx_fragment_size=2;
9+
DROP TABLE mysql.wsrep_streaming_log;
10+
ERROR 42000: DROP command denied to user 'root'@'localhost' for table `mysql`.`wsrep_streaming_log`
11+
CREATE TRIGGER tgr AFTER INSERT ON t2 FOR EACH ROW UPDATE t1 SET c=c+1;
12+
INSERT INTO t2 VALUES (1),(2);
13+
SELECT * FROM t1;
14+
c
15+
2
16+
2
17+
SELECT * FROM t2;
18+
c
19+
1
20+
2
21+
SET wsrep_trx_fragment_unit=DEFAULT;
22+
SET GLOBAL wsrep_trx_fragment_size=DEFAULT;
23+
DROP TRIGGER tgr;
24+
DROP TABLE t1, t2;
25+
connection node_2;
26+
SET GLOBAL wsrep_on=OFF;
27+
SET SESSION wsrep_trx_fragment_unit='STATEMENTS';
28+
ERROR 42000: Variable 'wsrep_trx_fragment_unit' can't be set to the value of 'STATEMENTS'
29+
SELECT @@wsrep_trx_fragment_unit;
30+
@@wsrep_trx_fragment_unit
31+
bytes
32+
SELECT @@wsrep_trx_fragment_size;
33+
@@wsrep_trx_fragment_size
34+
0
35+
SET SESSION wsrep_trx_fragment_size = 2;
36+
ERROR 42000: Variable 'wsrep_trx_fragment_size' can't be set to the value of '2'
37+
SHOW WARNINGS;
38+
Level Code Message
39+
Warning 1231 Cannot set 'wsrep_trx_fragment_size' to a value other than 0 because wsrep is switched off.
40+
Error 1231 Variable 'wsrep_trx_fragment_size' can't be set to the value of '2'
41+
SELECT @@wsrep_trx_fragment_unit;
42+
@@wsrep_trx_fragment_unit
43+
bytes
44+
SELECT @@wsrep_trx_fragment_size;
45+
@@wsrep_trx_fragment_size
46+
0
47+
DROP TABLE mysql.wsrep_streaming_log;
48+
SET SESSION wsrep_trx_fragment_unit='STATEMENTS';
49+
ERROR 42000: Variable 'wsrep_trx_fragment_unit' can't be set to the value of 'STATEMENTS'
50+
SET SESSION wsrep_trx_fragment_size = 2;
51+
ERROR 42000: Variable 'wsrep_trx_fragment_size' can't be set to the value of '2'
52+
SHOW WARNINGS;
53+
Level Code Message
54+
Warning 1231 Cannot set 'wsrep_trx_fragment_size' to a value other than 0 because wsrep is switched off.
55+
Error 1231 Variable 'wsrep_trx_fragment_size' can't be set to the value of '2'
56+
SELECT @@wsrep_trx_fragment_unit;
57+
@@wsrep_trx_fragment_unit
58+
bytes
59+
SELECT @@wsrep_trx_fragment_size;
60+
@@wsrep_trx_fragment_size
61+
0
62+
SET SESSION wsrep_trx_fragment_size = 0;
63+
SELECT @@wsrep_trx_fragment_unit;
64+
@@wsrep_trx_fragment_unit
65+
bytes
66+
SELECT @@wsrep_trx_fragment_size;
67+
@@wsrep_trx_fragment_size
68+
0
69+
SET GLOBAL wsrep_on=ON;
70+
SET SESSION wsrep_trx_fragment_unit='STATEMENTS';
71+
ERROR 42000: Variable 'wsrep_trx_fragment_unit' can't be set to the value of 'STATEMENTS'
72+
SET SESSION wsrep_trx_fragment_size = 2;
73+
ERROR 42000: Variable 'wsrep_trx_fragment_size' can't be set to the value of '2'
74+
SHOW WARNINGS;
75+
Level Code Message
76+
Warning 1231 Cannot set 'wsrep_trx_fragment_size' to a value other than 0 because streaming table mysql.wsrep_streaming_log does not exists.
77+
Error 1231 Variable 'wsrep_trx_fragment_size' can't be set to the value of '2'
78+
SELECT @@wsrep_trx_fragment_unit;
79+
@@wsrep_trx_fragment_unit
80+
bytes
81+
SELECT @@wsrep_trx_fragment_size;
82+
@@wsrep_trx_fragment_size
83+
0
84+
SET GLOBAL wsrep_on=OFF;
85+
CREATE TABLE IF NOT EXISTS mysql.wsrep_streaming_log
86+
(
87+
node_uuid CHAR(36),
88+
trx_id BIGINT,
89+
seqno BIGINT,
90+
flags INT NOT NULL,
91+
frag LONGBLOB NOT NULL,
92+
PRIMARY KEY (node_uuid, trx_id, seqno)
93+
) ENGINE=InnoDB STATS_PERSISTENT=0 CHARSET=latin1;
94+
SET GLOBAL wsrep_on=ON;
95+
connection node_1;
96+
CREATE TABLE t1 (c INT);
97+
INSERT INTO t1 VALUES (0),(0);
98+
CREATE TABLE t2 (c INT);
99+
SET SESSION wsrep_trx_fragment_unit='STATEMENTS';
100+
SET SESSION wsrep_trx_fragment_size=2;
101+
CREATE TRIGGER tgr AFTER INSERT ON t2 FOR EACH ROW UPDATE t1 SET c=c+1;
102+
INSERT INTO t2 VALUES (1),(2);
103+
SELECT * FROM t1;
104+
c
105+
2
106+
2
107+
SELECT * FROM t2;
108+
c
109+
1
110+
2
111+
connection node_2;
112+
INSERT INTO t2 VALUES (1),(2);
113+
SELECT * FROM t1;
114+
c
115+
4
116+
4
117+
SELECT * FROM t2;
118+
c
119+
1
120+
2
121+
1
122+
2
123+
connection node_1;
124+
SET wsrep_trx_fragment_unit=DEFAULT;
125+
SET GLOBAL wsrep_trx_fragment_size=DEFAULT;
126+
DROP TRIGGER tgr;
127+
DROP TABLE t1, t2;
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+
SET sql_mode='';
4+
SET SESSION autocommit=0;
5+
SET SESSION enforce_storage_engine=Aria;
6+
SET WSREP_OSU_METHOD = RSU;
7+
CREATE TABLE t1 (a TEXT) ;
8+
Warnings:
9+
Note 1266 Using storage engine Aria for table 't1'
10+
Note 1266 Using storage engine Aria for table 't1'
11+
CREATE TABLE t2 (a TEXT) ;
12+
Warnings:
13+
Note 1266 Using storage engine Aria for table 't2'
14+
Note 1266 Using storage engine Aria for table 't2'
15+
SET SESSION autocommit=1;
16+
REPLACE INTO t2 (a) SELECT a from t1;
17+
ERROR 42000: This version of MariaDB doesn't yet support 'RSU on this table engine'
18+
REPLACE INTO t2 (a) SELECT /*!99997 */ a from t1;
19+
ERROR 42000: This version of MariaDB doesn't yet support 'RSU on this table engine'
20+
SET WSREP_OSU_METHOD = TOI;
21+
DROP TABLE t1,t2;
22+
SET sql_mode='';
23+
SET SESSION autocommit=0;
24+
SET SESSION enforce_storage_engine=MyISAM;
25+
SET WSREP_OSU_METHOD = RSU;
26+
CREATE TABLE t1 (a TEXT) ;
27+
Warnings:
28+
Note 1266 Using storage engine MyISAM for table 't1'
29+
Note 1266 Using storage engine MyISAM for table 't1'
30+
CREATE TABLE t2 (a TEXT) ;
31+
Warnings:
32+
Note 1266 Using storage engine MyISAM for table 't2'
33+
Note 1266 Using storage engine MyISAM for table 't2'
34+
SET SESSION autocommit=1;
35+
REPLACE INTO t2 (a) SELECT a from t1;
36+
ERROR 42000: This version of MariaDB doesn't yet support 'RSU on this table engine'
37+
REPLACE INTO t2 (a) SELECT /*!99997 */ a from t1;
38+
ERROR 42000: This version of MariaDB doesn't yet support 'RSU on this table engine'
39+
SET WSREP_OSU_METHOD = TOI;
40+
DROP TABLE t1,t2;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
connection node_2;
2+
connection node_1;
3+
connection node_1;
4+
connection node_2;
5+
connection node_2;
6+
SET SESSION max_error_count=0;
7+
SET GLOBAL wsrep_ignore_apply_errors = 0;
8+
GRANT SELECT ON *.* TO dummy@'localhost';
9+
ERROR 28000: Can't find any matching row in the user table
10+
SHOW WARNINGS;
11+
Level Code Message
12+
# Node_2 is on inconsistency state so kill it
13+
SET SESSION wsrep_sync_wait = 0;
14+
Killing server ...
15+
connection node_1;
16+
connection node_2;
17+
SET GLOBAL wsrep_ignore_apply_errors = DEFAULT;
18+
call mtr.add_suppression("Inconsistency detected: Inconsistent by consensus on");

0 commit comments

Comments
 (0)