Skip to content

Commit 1c6043c

Browse files
authored
Merge branch '10.6' into MDEV-37048
2 parents c1a79f0 + 0dd6566 commit 1c6043c

25 files changed

Lines changed: 256 additions & 66 deletions

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,15 @@ connection node_1;
77
connection node_1;
88
CREATE TABLE t1(i INT) ENGINE=INNODB;
99
CREATE TABLE t2(i INT) ENGINE=MYISAM;
10-
Warnings:
11-
Note 1266 Using storage engine InnoDB for table 't2'
12-
Note 1266 Using storage engine InnoDB for table 't2'
10+
ERROR HY000: The MariaDB server is running with the ENFORCE_STORAGE_ENGINE option so it cannot execute this statement
1311
connection node_2;
1412
SHOW TABLES;
1513
Tables_in_test
1614
t1
17-
t2
1815
SHOW CREATE TABLE t1;
1916
Table Create Table
2017
t1 CREATE TABLE `t1` (
2118
`i` int(11) DEFAULT NULL
2219
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
23-
SHOW CREATE TABLE t2;
24-
Table Create Table
25-
t2 CREATE TABLE `t2` (
26-
`i` int(11) DEFAULT NULL
27-
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
28-
DROP TABLE t1, t2;
20+
DROP TABLE t1;
2921
# End of tests
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
connection node_2;
2+
connection node_1;
3+
set session sql_mode='';
4+
SET @@enforce_storage_engine=INNODB;
5+
CREATE TABLE t1 (c INT ) ENGINE=ARIA;
6+
ERROR HY000: The MariaDB server is running with the ENFORCE_STORAGE_ENGINE option so it cannot execute this statement
7+
SHOW WARNINGS;
8+
Level Code Message
9+
Error 1290 The MariaDB server is running with the ENFORCE_STORAGE_ENGINE option so it cannot execute this statement
10+
Note 1290 Do not use ENGINE=x when @@enforce_storage_engine is set
11+
Error 1290 The MariaDB server is running with the ENFORCE_STORAGE_ENGINE option so it cannot execute this statement
12+
Note 1290 Do not use ENGINE=x when @@enforce_storage_engine is set
13+
CREATE TABLE t1 (c INT );
14+
DROP TABLE t1;
15+
CREATE TABLE t1 (c INT ) ENGINE=INNODB;
16+
DROP TABLE t1;
17+
SET @@enforce_storage_engine=ARIA;
18+
CREATE TABLE t1 (c INT ) ENGINE=INNODB;
19+
ERROR HY000: The MariaDB server is running with the ENFORCE_STORAGE_ENGINE option so it cannot execute this statement
20+
SHOW WARNINGS;
21+
Level Code Message
22+
Error 1290 The MariaDB server is running with the ENFORCE_STORAGE_ENGINE option so it cannot execute this statement
23+
Note 1290 Do not use ENGINE=x when @@enforce_storage_engine is set
24+
Error 1290 The MariaDB server is running with the ENFORCE_STORAGE_ENGINE option so it cannot execute this statement
25+
Note 1290 Do not use ENGINE=x when @@enforce_storage_engine is set

mysql-test/suite/galera/r/mysql-wsrep#198.result

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ SELECT 1 FROM DUAL;
77
1
88
1
99
LOCK TABLE t2 WRITE;
10+
connect node_2_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_2;
11+
connection node_2_ctrl;
12+
SET SESSION wsrep_sync_wait=0;
1013
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
1114
connection node_2a;
1215
OPTIMIZE TABLE t1,t2;;
16+
connection node_2_ctrl;
17+
SET SESSION wsrep_sync_wait = 0;
1318
connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2;
1419
connection node_2b;
1520
REPAIR TABLE t1,t2;;
16-
connection node_2;
17-
SET SESSION wsrep_sync_wait = 0;
21+
connection node_2_ctrl;
1822
connection node_1;
1923
INSERT INTO t2 VALUES (1);
2024
connection node_2;
@@ -34,3 +38,4 @@ DROP TABLE t2;
3438
connection node_1;
3539
disconnect node_2a;
3640
disconnect node_2b;
41+
disconnect node_2_ctrl;
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
--source include/galera_cluster.inc
22
--source include/have_innodb.inc
3+
--source include/have_aria.inc
34

45
--echo #
56
--echo # MDEV-9312: storage engine not enforced during galera cluster
67
--echo # replication
78
--echo #
89
--connection node_1
910
CREATE TABLE t1(i INT) ENGINE=INNODB;
11+
#
12+
# This is not anymore supported because enforce_storage_engine
13+
# is local setting and final used storage engine
14+
# on other members of cluster depend on their configuration.
15+
# Currently, there is no way to query remote node
16+
# configuration.
17+
#
18+
--error ER_OPTION_PREVENTS_STATEMENT
1019
CREATE TABLE t2(i INT) ENGINE=MYISAM;
1120

1221
--connection node_2
1322
SHOW TABLES;
1423
SHOW CREATE TABLE t1;
15-
SHOW CREATE TABLE t2;
1624

1725
# Cleanup
18-
DROP TABLE t1, t2;
26+
DROP TABLE t1;
1927

2028
--echo # End of tests
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--source include/galera_cluster.inc
2+
--source include/have_aria.inc
3+
--source include/log_bin.inc
4+
5+
set session sql_mode='';
6+
SET @@enforce_storage_engine=INNODB;
7+
--error ER_OPTION_PREVENTS_STATEMENT
8+
CREATE TABLE t1 (c INT ) ENGINE=ARIA;
9+
SHOW WARNINGS;
10+
11+
CREATE TABLE t1 (c INT );
12+
DROP TABLE t1;
13+
CREATE TABLE t1 (c INT ) ENGINE=INNODB;
14+
DROP TABLE t1;
15+
16+
SET @@enforce_storage_engine=ARIA;
17+
--error ER_OPTION_PREVENTS_STATEMENT
18+
CREATE TABLE t1 (c INT ) ENGINE=INNODB;
19+
SHOW WARNINGS;

mysql-test/suite/galera/t/mysql-wsrep#198.test

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,33 @@ SELECT 1 FROM DUAL;
1010

1111
LOCK TABLE t2 WRITE;
1212

13+
--connect node_2_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_2
14+
--connection node_2_ctrl
15+
SET SESSION wsrep_sync_wait=0;
16+
1317
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
1418
--connection node_2a
1519
--send OPTIMIZE TABLE t1,t2;
1620

21+
--connection node_2_ctrl
22+
SET SESSION wsrep_sync_wait = 0;
23+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'acquiring total order isolation%';
24+
--let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
25+
--source include/wait_condition_with_debug_and_kill.inc
26+
1727
--connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
1828
--connection node_2b
1929
--send REPAIR TABLE t1,t2;
2030

21-
--connection node_2
22-
SET SESSION wsrep_sync_wait = 0;
23-
--let $wait_condition = SELECT COUNT(*) BETWEEN 1 AND 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%';
31+
--connection node_2_ctrl
32+
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'acquiring total order isolation%';
2433
--let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
2534
--source include/wait_condition_with_debug_and_kill.inc
2635

2736
--connection node_1
37+
# We have LOCK TABLE in node_2 so this could fail on lock wait
38+
# or next statement is fast enought and succeed
39+
--error 0,ER_LOCK_WAIT_TIMEOUT
2840
INSERT INTO t2 VALUES (1);
2941

3042
--connection node_2
@@ -43,3 +55,4 @@ DROP TABLE t2;
4355

4456
--disconnect node_2a
4557
--disconnect node_2b
58+
--disconnect node_2_ctrl

mysql-test/suite/galera_3nodes/r/inconsistency_shutdown.result

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ UPDATE t1 SET f2 = 1 WHERE f1 = 6;
3232
UPDATE t1 SET f2 = 1 WHERE f1 = 7;
3333
UPDATE t1 SET f2 = 1 WHERE f1 = 8;
3434
connection node_2;
35-
SET wsrep_on=OFF;
36-
SET wsrep_on=ON;
35+
# make sure all events landed to slave queue
36+
set wsrep_sync_wait=0;
3737
UNLOCK TABLES;
3838
SET SESSION wsrep_on = ON;
3939
SET SESSION wsrep_sync_wait = 15;
@@ -56,7 +56,8 @@ f1 f2
5656
7 1
5757
8 1
5858
connection node_2;
59-
SET GLOBAL wsrep_on=OFF;
59+
# Gracefully restart the node
60+
set wsrep_on=OFF;
6061
# restart
6162
DROP TABLE t1;
6263
connection node_1;
@@ -73,11 +74,15 @@ INSERT INTO t1 VALUES (8, 0);
7374
COMMIT;
7475
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 INT);
7576
connection node_2;
77+
# Allow 1K slave queue without flow control
7678
SET GLOBAL wsrep_provider_options='gcs.fc_limit=1K';
79+
# Introduce inconsistency
7780
SET wsrep_on=OFF;
7881
DROP TABLE t2;
7982
SET wsrep_on=ON;
83+
# set up sync point to ensure DROP TABLE replication order below
8084
SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
85+
# Build up slave queue:
8186
LOCK TABLES t1 READ;
8287
connection node_1;
8388
UPDATE t1 SET f2 = 1 WHERE f1 = 1;
@@ -86,18 +91,19 @@ UPDATE t1 SET f2 = 1 WHERE f1 = 3;
8691
UPDATE t1 SET f2 = 1 WHERE f1 = 4;
8792
UPDATE t1 SET f2 = 2 WHERE f1 = 4;
8893
/* dependent applier */;
94+
# interleave a failing statement
8995
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
9096
connection node_2a;
9197
DROP TABLE t2;;
98+
# make sure DROP TABLE from above has replicated
9299
connection node_2;
93-
SET wsrep_on=OFF;
100+
set wsrep_sync_wait=0;
94101
"Wait for DROP TABLE to replicate"
95102
SET SESSION wsrep_on = 0;
96-
SET SESSION wsrep_on = 0;
103+
SET SESSION wsrep_on = 1;
97104
SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
98105
SET GLOBAL wsrep_provider_options = 'dbug=';
99106
"DROP TABLE replicated"
100-
SET wsrep_on=ON;
101107
connection node_1;
102108
UPDATE t1 SET f2 = 3 WHERE f1 = 4;
103109
/* dependent applier */
@@ -106,8 +112,7 @@ UPDATE t1 SET f2 = 1 WHERE f1 = 6;
106112
UPDATE t1 SET f2 = 1 WHERE f1 = 7;
107113
UPDATE t1 SET f2 = 1 WHERE f1 = 8;
108114
connection node_2;
109-
SET wsrep_on=OFF;
110-
SET wsrep_on=ON;
115+
# make sure all events landed to slave queue
111116
UNLOCK TABLES;
112117
connection node_2a;
113118
ERROR 42S02: Unknown table 'test.t2'
@@ -128,11 +133,11 @@ f1 f2
128133
7 1
129134
8 1
130135
connection node_2;
131-
SET SESSION wsrep_on = ON;
136+
set wsrep_on=OFF;
132137
SET SESSION wsrep_sync_wait = 15;
133-
SET SESSION wsrep_on = ON;
138+
# Wait for the node to shutdown replication
134139
SET SESSION wsrep_sync_wait = 15;
135-
SET GLOBAL wsrep_on=OFF;
140+
# Gracefully restart the node
136141
# restart
137142
DROP TABLE t1;
138143
CALL mtr.add_suppression("Can't find record in 't1'");

mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.test

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ SET wsrep_on=OFF;
3333
DELETE FROM t1 WHERE f1 = 2;
3434
DELETE FROM t1 WHERE f1 = 4;
3535
SET wsrep_on=ON;
36+
--source include/galera_wait_ready.inc
3637

3738
# Build up slave queue:
3839
# - first 8 events will be picked by slave threads
@@ -51,11 +52,11 @@ UPDATE t1 SET f2 = 1 WHERE f1 = 7;
5152
UPDATE t1 SET f2 = 1 WHERE f1 = 8;
5253

5354
--connection node_2
54-
# make sure all events landed to slave queue
55-
SET wsrep_on=OFF;
55+
--echo # make sure all events landed to slave queue
56+
set wsrep_sync_wait=0;
5657
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_recv_queue';
5758
--source include/wait_condition.inc
58-
SET wsrep_on=ON;
59+
5960
UNLOCK TABLES;
6061
--source include/wsrep_wait_disconnect.inc
6162
# Wait for the node to shutdown replication
@@ -70,8 +71,8 @@ SHOW STATUS LIKE 'wsrep_cluster_size';
7071
SELECT * FROM t1;
7172

7273
--connection node_2
73-
#Gracefully restart the node
74-
SET GLOBAL wsrep_on=OFF;
74+
--echo # Gracefully restart the node
75+
set wsrep_on=OFF;
7576
--source include/shutdown_mysqld.inc
7677
--source include/start_mysqld.inc
7778
--source include/galera_wait_ready.inc
@@ -98,20 +99,21 @@ COMMIT;
9899
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 INT);
99100

100101
--connection node_2
101-
# Allow 1K slave queue without flow control
102+
--echo # Allow 1K slave queue without flow control
102103
SET GLOBAL wsrep_provider_options='gcs.fc_limit=1K';
103-
# Introduce inconsistency
104-
SET wsrep_on=OFF;
105104
--let $wait_condition = SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
106105
--source include/wait_condition.inc
106+
--echo # Introduce inconsistency
107+
SET wsrep_on=OFF;
107108
DROP TABLE t2;
108109
SET wsrep_on=ON;
110+
--source include/galera_wait_ready.inc
109111

110-
# set up sync point to ensure DROP TABLE replication order below
112+
--echo # set up sync point to ensure DROP TABLE replication order below
111113
--let galera_sync_point = after_replicate_sync
112114
--source include/galera_set_sync_point.inc
113115

114-
# Build up slave queue:
116+
--echo # Build up slave queue:
115117
# - first 8 events will be picked by slave threads
116118
# - one more event will be waiting in slave queue
117119
LOCK TABLES t1 READ;
@@ -123,20 +125,19 @@ UPDATE t1 SET f2 = 1 WHERE f1 = 3;
123125
UPDATE t1 SET f2 = 1 WHERE f1 = 4;
124126
UPDATE t1 SET f2 = 2 WHERE f1 = 4; /* dependent applier */;
125127

126-
# interleave a failing statement
128+
--echo # interleave a failing statement
127129
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
128130
--connection node_2a
129131
--send DROP TABLE t2;
130132

131-
# make sure DROP TABLE from above has replicated
133+
--echo # make sure DROP TABLE from above has replicated
132134
--connection node_2
133-
SET wsrep_on=OFF;
135+
set wsrep_sync_wait=0;
134136
--echo "Wait for DROP TABLE to replicate"
135137
--source include/galera_wait_sync_point.inc
136138
--source include/galera_signal_sync_point.inc
137139
--source include/galera_clear_sync_point.inc
138140
--echo "DROP TABLE replicated"
139-
SET wsrep_on=ON;
140141

141142
--connection node_1
142143
UPDATE t1 SET f2 = 3 WHERE f1 = 4; /* dependent applier */
@@ -146,11 +147,10 @@ UPDATE t1 SET f2 = 1 WHERE f1 = 7;
146147
UPDATE t1 SET f2 = 1 WHERE f1 = 8;
147148

148149
--connection node_2
149-
# make sure all events landed to slave queue
150-
SET wsrep_on=OFF;
150+
--echo # make sure all events landed to slave queue
151151
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_recv_queue';
152152
--source include/wait_condition.inc
153-
SET wsrep_on=ON;
153+
154154
UNLOCK TABLES;
155155

156156
--connection node_2a
@@ -165,12 +165,13 @@ SHOW STATUS LIKE 'wsrep_cluster_size';
165165
SELECT * FROM t1;
166166

167167
--connection node_2
168+
set wsrep_on=OFF;
168169
--source include/wsrep_wait_disconnect.inc
169-
# Wait for the node to shutdown replication
170+
--echo # Wait for the node to shutdown replication
170171
--let $members=0
171172
--source include/wsrep_wait_membership.inc
172-
# Gracefully restart the node
173-
SET GLOBAL wsrep_on=OFF;
173+
--echo # Gracefully restart the node
174+
174175
--source include/shutdown_mysqld.inc
175176
--source include/start_mysqld.inc
176177
--source include/galera_wait_ready.inc

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ SET GLOBAL innodb_fast_shutdown = 0;
2626
# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0
2727
begin;
2828
insert into t1 values (6, repeat('%', 400));
29+
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0, innodb_max_dirty_pages_pct=0;
2930
# Make the first page dirty for system tablespace
3031
set global innodb_saved_page_number_debug = 0;
3132
set global innodb_fil_make_page_dirty_debug = 0;
3233
# Make the second page dirty for system tablespace
3334
set global innodb_saved_page_number_debug = 1;
3435
set global innodb_fil_make_page_dirty_debug = 0;
35-
set global innodb_buf_flush_list_now = 1;
3636
# Kill the server
3737
# Make the 1st page (page_no=0) and 2nd page (page_no=1)
3838
# of the system tablespace all zeroes.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,11 @@ ALTER TABLE t2 STATS_PERSISTENT=1;
131131
DROP TABLE t2;
132132
SELECT * FROM mysql.innodb_index_stats;
133133
database_name table_name index_name last_update stat_name stat_value sample_size stat_description
134+
#
135+
# MDEV-37123 dict_table_open_on_id() fails to release dict_sys.latch
136+
#
137+
SET GLOBAL innodb_defragment_stats_accuracy=1;
138+
CREATE TABLE t (f INT,f2 CHAR(1),KEY k1 (f2),FULLTEXT KEY(f2),
139+
FOREIGN KEY(f2) REFERENCES t (f3)) ENGINE=InnoDB;
140+
ERROR HY000: Can't create table `test`.`t` (errno: 150 "Foreign key constraint is incorrectly formed")
141+
SET GLOBAL innodb_defragment_stats_accuracy=default;

0 commit comments

Comments
 (0)