Skip to content

Commit 1900c2e

Browse files
committed
Merge 10.5 into 10.6
2 parents 76db096 + 0ba845a commit 1900c2e

Some content is hidden

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

50 files changed

+1264
-204
lines changed

include/my_pthread.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ static inline int my_sigwait(sigset_t *set, int *sig, int *code)
196196
*code= siginfo.si_code;
197197
return *sig < 0 ? errno : 0;
198198
#else
199-
#define SI_KERNEL 128
200199
*code= 0;
201200
return sigwait(set, sig);
202201
#endif

include/myisamchk.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ typedef struct st_handler_check_param
7070
*/
7171
ulonglong unique_count[HA_MAX_KEY_SEG + 1];
7272
ulonglong notnull_count[HA_MAX_KEY_SEG + 1];
73-
73+
ulonglong max_allowed_lsn;
7474
my_off_t search_after_block;
7575
my_off_t new_file_pos, key_file_blocks;
7676
my_off_t keydata, totaldata, key_blocks, start_check_pos;
@@ -96,6 +96,7 @@ typedef struct st_handler_check_param
9696
uint out_flag, error_printed, verbose;
9797
uint opt_sort_key, total_files, max_level;
9898
uint key_cache_block_size, pagecache_block_size;
99+
uint skip_lsn_error_count;
99100
int tmpfile_createflag, err_count;
100101
myf myf_rw;
101102
uint16 language;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# MDEV-25334 FTWRL/Backup blocks DDL on temporary tables with binlog
3+
# enabled assertion fails in Diagnostics_area::set_error_status
4+
#
5+
select @@binlog_format;
6+
@@binlog_format
7+
MIXED
8+
connect con1,localhost,root,,;
9+
connection default;
10+
#
11+
# Test 1
12+
#
13+
CREATE TEMPORARY TABLE tmp (a INT);
14+
connection con1;
15+
FLUSH TABLES WITH READ LOCK;
16+
connection default;
17+
SET lock_wait_timeout= 1;
18+
ALTER TABLE tmp;
19+
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
20+
connection con1;
21+
unlock tables;
22+
connection default;
23+
drop table tmp;
24+
#
25+
# Test 2 (In statement format to ensure temporary table gets logged)
26+
#
27+
set @@binlog_format=statement;
28+
CREATE TEMPORARY TABLE tmp (a INT);
29+
connection con1;
30+
BACKUP STAGE START;
31+
BACKUP STAGE BLOCK_COMMIT;
32+
connection default;
33+
SET lock_wait_timeout= 1;
34+
ALTER TABLE tmp;
35+
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
36+
connection con1;
37+
BACKUP STAGE end;
38+
connection default;
39+
drop table tmp;
40+
disconnect con1;
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
--source include/have_binlog_format_mixed_or_statement.inc
2+
3+
#
4+
# Tests involving locks and binlog
5+
#
6+
7+
--echo #
8+
--echo # MDEV-25334 FTWRL/Backup blocks DDL on temporary tables with binlog
9+
--echo # enabled assertion fails in Diagnostics_area::set_error_status
10+
--echo #
11+
12+
select @@binlog_format;
13+
--connect (con1,localhost,root,,)
14+
connection default;
15+
16+
--echo #
17+
--echo # Test 1
18+
--echo #
19+
20+
CREATE TEMPORARY TABLE tmp (a INT);
21+
--connection con1
22+
FLUSH TABLES WITH READ LOCK;
23+
--connection default
24+
SET lock_wait_timeout= 1;
25+
--error ER_LOCK_WAIT_TIMEOUT
26+
ALTER TABLE tmp;
27+
--connection con1
28+
unlock tables;
29+
--connection default
30+
drop table tmp;
31+
32+
--echo #
33+
--echo # Test 2 (In statement format to ensure temporary table gets logged)
34+
--echo #
35+
36+
set @@binlog_format=statement;
37+
CREATE TEMPORARY TABLE tmp (a INT);
38+
--connection con1
39+
BACKUP STAGE START;
40+
BACKUP STAGE BLOCK_COMMIT;
41+
--connection default
42+
SET lock_wait_timeout= 1;
43+
--error ER_LOCK_WAIT_TIMEOUT
44+
ALTER TABLE tmp;
45+
--connection con1
46+
BACKUP STAGE end;
47+
--connection default
48+
drop table tmp;
49+
--disconnect con1

mysql-test/suite/encryption/r/aria_tiny.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,12 @@ set global aria_encrypt_tables = 1;
22
create table t1 (i int, key(i)) engine=aria;
33
insert into t1 values (1);
44
drop table t1;
5+
create table t1 (a int primary key, b int, c int, key(b),key(c)) engine=aria;
6+
alter table t1 disable keys;
7+
insert into t1 select seq,seq,seq from seq_1_to_100;
8+
alter table t1 enable keys;
9+
check table t1;
10+
Table Op Msg_type Msg_text
11+
test.t1 check status OK
12+
drop table t1;
513
set global aria_encrypt_tables = 0;
Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1+
--source include/have_file_key_management_plugin.inc
2+
--source include/have_sequence.inc
3+
14
#
25
# MDEV-8022 Assertion `rc == 0' failed in ma_encrypt on dropping an encrypted Aria table
36
#
4-
5-
--source include/have_file_key_management_plugin.inc
6-
77
set global aria_encrypt_tables = 1;
88
create table t1 (i int, key(i)) engine=aria;
99
insert into t1 values (1);
1010
drop table t1;
11-
set global aria_encrypt_tables = 0;
1211

12+
#
13+
# MDEV-17913 Encrypted transactional Aria tables remain corrupt after crash
14+
# recovery, automatic repair does not work
15+
#
16+
# We are using a simplifed version of the test here. This works thanks to
17+
# the extended check table code that also checks if LSN's are reasonable.
18+
#
19+
20+
create table t1 (a int primary key, b int, c int, key(b),key(c)) engine=aria;
21+
alter table t1 disable keys;
22+
insert into t1 select seq,seq,seq from seq_1_to_100;
23+
alter table t1 enable keys;
24+
check table t1;
25+
drop table t1;
26+
27+
#
28+
# Cleanup
29+
#
30+
set global aria_encrypt_tables = 0;

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,49 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3;
2222
COUNT(*) = 1
2323
1
2424
DROP TABLE t1;
25+
START TRANSACTION;
26+
SET SESSION wsrep_on=OFF;
27+
ERROR 25000: You are not allowed to execute this command in a transaction
28+
SET GLOBAL wsrep_on=OFF;
29+
ERROR 25000: You are not allowed to execute this command in a transaction
30+
COMMIT;
31+
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
32+
START TRANSACTION;
33+
INSERT INTO t1 VALUES (1);
34+
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;;
35+
connection node_1a;
36+
SET GLOBAL wsrep_on = OFF;
37+
connection node_1;
38+
SHOW SESSION VARIABLES LIKE 'wsrep_on';
39+
Variable_name Value
40+
wsrep_on ON
41+
SHOW GLOBAL VARIABLES LIKE 'wsrep_on';
42+
Variable_name Value
43+
wsrep_on OFF
44+
INSERT INTO t1 VALUES (2);
45+
COMMIT;
46+
connection node_2;
47+
SET SESSION wsrep_sync_wait = 15;
48+
SELECT * FROM t1;
49+
f1
50+
1
51+
2
52+
connection node_1a;
53+
SET GLOBAL wsrep_on = ON;
54+
DROP TABLE t1;
55+
connection node_1;
56+
SET GLOBAL wsrep_on = OFF;
57+
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;;
58+
connection node_1b;
59+
SHOW SESSION VARIABLES LIKE 'wsrep_on';
60+
Variable_name Value
61+
wsrep_on OFF
62+
SHOW GLOBAL VARIABLES LIKE 'wsrep_on';
63+
Variable_name Value
64+
wsrep_on OFF
65+
CREATE TABLE t2 (f1 INTEGER);
66+
DROP TABLE t2;
67+
SET GLOBAL wsrep_on = ON;
68+
SHOW SESSION VARIABLES LIKE 'wsrep_on';
69+
Variable_name Value
70+
wsrep_on ON

mysql-test/suite/galera/t/galera_var_wsrep_on_off.test

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,60 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3;
3030

3131
DROP TABLE t1;
3232

33+
34+
#
35+
# Test that variable wsrep_on cannot be changed while in
36+
# active transaction.
37+
#
38+
39+
START TRANSACTION;
40+
--error ER_CANT_DO_THIS_DURING_AN_TRANSACTION
41+
SET SESSION wsrep_on=OFF;
42+
--error ER_CANT_DO_THIS_DURING_AN_TRANSACTION
43+
SET GLOBAL wsrep_on=OFF;
44+
COMMIT;
45+
46+
47+
#
48+
# Test that @@global.wsrep_on does not affect the value of
49+
# @@session.wsrep_on of current sessions
50+
#
51+
52+
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
53+
START TRANSACTION;
54+
INSERT INTO t1 VALUES (1);
55+
56+
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
57+
--connection node_1a
58+
SET GLOBAL wsrep_on = OFF;
59+
60+
--connection node_1
61+
SHOW SESSION VARIABLES LIKE 'wsrep_on';
62+
SHOW GLOBAL VARIABLES LIKE 'wsrep_on';
63+
INSERT INTO t1 VALUES (2);
64+
COMMIT;
65+
66+
--connection node_2
67+
SET SESSION wsrep_sync_wait = 15;
68+
SELECT * FROM t1;
69+
70+
--connection node_1a
71+
SET GLOBAL wsrep_on = ON;
72+
DROP TABLE t1;
73+
74+
75+
#
76+
# New connections inherit @@session.wsrep_on from @@global.wsrep_on
77+
#
78+
--connection node_1
79+
SET GLOBAL wsrep_on = OFF;
80+
81+
--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
82+
--connection node_1b
83+
SHOW SESSION VARIABLES LIKE 'wsrep_on';
84+
SHOW GLOBAL VARIABLES LIKE 'wsrep_on';
85+
CREATE TABLE t2 (f1 INTEGER);
86+
DROP TABLE t2;
87+
88+
SET GLOBAL wsrep_on = ON;
89+
SHOW SESSION VARIABLES LIKE 'wsrep_on';
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
connection node_2;
2+
connection node_1;
3+
connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5;
4+
connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
5+
connection node_4;
6+
CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos;;
7+
START SLAVE;
8+
include/wait_for_slave_to_start.inc
9+
connection node_1;
10+
CREATE TABLE t1(c1 INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INTEGER);
11+
INSERT INTO t1(c2) VALUES(1);
12+
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
13+
connection node_3;
14+
SELECT COUNT(*) = 1 FROM t1;
15+
COUNT(*) = 1
16+
1
17+
connection node_1;
18+
include/save_master_gtid.inc
19+
connection node_4;
20+
include/sync_with_master_gtid.inc
21+
SELECT COUNT(*) = 1 FROM t1;
22+
COUNT(*) = 1
23+
1
24+
connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6;
25+
connection node_6;
26+
SELECT COUNT(*) = 1 FROM t1;
27+
COUNT(*) = 1
28+
1
29+
connection node_2;
30+
ALTER TABLE t1 ADD COLUMN t3 INTEGER;
31+
Node 2 column number AFTER ALTER
32+
SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1';
33+
COUNT(*) = 3
34+
1
35+
connection node_3;
36+
Node 3 column number AFTER ALTER
37+
SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1';
38+
COUNT(*) = 3
39+
1
40+
connection node_1;
41+
include/save_master_gtid.inc
42+
connection node_4;
43+
include/sync_with_master_gtid.inc
44+
Node 4 column number AFTER ALTER
45+
SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1';
46+
COUNT(*) = 3
47+
1
48+
connection node_6;
49+
Node 6 column number AFTER ALTER
50+
SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1';
51+
COUNT(*) = 3
52+
1
53+
connection node_2;
54+
OPTIMIZE TABLE t1;
55+
Table Op Msg_type Msg_text
56+
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
57+
test.t1 optimize status OK
58+
connection node_1;
59+
connection node_4;
60+
connection node_6;
61+
connection node_1;
62+
DROP TABLE t1;
63+
connection node_4;
64+
STOP SLAVE;
65+
RESET SLAVE;
66+
SET GLOBAL wsrep_on = OFF;
67+
RESET MASTER;
68+
SET GLOBAL wsrep_on = ON;
69+
SET GLOBAL GTID_SLAVE_POS="";
70+
connection node_1;
71+
SET GLOBAL wsrep_on = OFF;
72+
RESET MASTER;
73+
SET GLOBAL wsrep_on = ON;
74+
connection node_2;
75+
SET GLOBAL wsrep_on = OFF;
76+
RESET MASTER;
77+
SET GLOBAL wsrep_on = ON;
78+
connection node_3;
79+
SET GLOBAL wsrep_on = OFF;
80+
RESET MASTER;
81+
SET GLOBAL wsrep_on = ON;
82+
connection node_5;
83+
SET GLOBAL wsrep_on = OFF;
84+
RESET MASTER;
85+
SET GLOBAL wsrep_on = ON;
86+
connection node_6;
87+
SET GLOBAL wsrep_on = OFF;
88+
RESET MASTER;
89+
SET GLOBAL wsrep_on = ON;

0 commit comments

Comments
 (0)