Skip to content

Commit 699de65

Browse files
committed
Merge 10.4 into 10.5
2 parents c430aa7 + 03a1070 commit 699de65

File tree

13 files changed

+140
-32
lines changed

13 files changed

+140
-32
lines changed

include/wsrep.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#define DBUG_ASSERT_IF_WSREP(A) DBUG_ASSERT(A)
2626

2727
#define WSREP_MYSQL_DB (char *)"mysql"
28-
#define WSREP_TO_ISOLATION_BEGIN_IF(db_, table_, table_list_) \
29-
if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_))
3028

3129
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
3230
if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) \
@@ -58,10 +56,6 @@
5856
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
5957
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto wsrep_error_label;
6058

61-
#define WSREP_TO_ISOLATION_BEGIN_FK_TABLES(db_, table_, table_list_, fk_tables) \
62-
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
63-
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_, NULL, fk_tables))
64-
6559
#define WSREP_SYNC_WAIT(thd_, before_) \
6660
{ if (WSREP_CLIENT(thd_) && \
6761
wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; }
@@ -76,7 +70,6 @@
7670
#define WSREP_ERROR(...)
7771
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) do { } while(0)
7872
#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_, fk_tables_, create_info_)
79-
#define WSREP_TO_ISOLATION_BEGIN_FK_TABLES(db_, table_, table_list_, fk_tables_)
8073
#define WSREP_TO_ISOLATION_END
8174
#define WSREP_TO_ISOLATION_BEGIN_CREATE(db_, table_, table_list_, create_info_)
8275
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)

mysql-test/main/alias.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,16 @@ disconnect c1;
223223
#
224224
create or replace table t1 (a int);
225225
create or replace table t2 (b int);
226-
insert into t1 values(1),(2);
226+
insert into t1 values(1<<30),(1<<29);
227227
insert into t2 values(1),(2);
228228
select t1.a as a1 from t1 as t1,t2 order by t2.b,t1.a;
229229
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
230-
def test t1 t1 a a1 3 11 1 Y 32768 0 63
230+
def test t1 t1 a a1 3 11 10 Y 32768 0 63
231231
a1
232-
1
233-
2
234-
1
235-
2
232+
536870912
233+
1073741824
234+
536870912
235+
1073741824
236236
drop table t1,t2;
237237
#
238238
# End of 10.4 tests

mysql-test/main/alias.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ disconnect c1;
231231
--echo #
232232
create or replace table t1 (a int);
233233
create or replace table t2 (b int);
234-
insert into t1 values(1),(2);
234+
insert into t1 values(1<<30),(1<<29);
235235
insert into t2 values(1),(2);
236236
--enable_metadata
237237
select t1.a as a1 from t1 as t1,t2 order by t2.b,t1.a;

mysql-test/suite/galera/disabled.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
3232
galera_pc_ignore_sb : MDEV-20888 galera.galera_pc_ignore_sb
3333
galera_pc_recovery : MDEV-25199 cluster fails to start up
3434
galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
35-
galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade
3635
galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting
3736
galera_toi_truncate : MDEV-22996 Hang on galera_toi_truncate test case
3837
galera_trigger : MDEV-24048 galera.galera_trigger MTR fails: Result content mismatch
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
connection node_2;
2+
connection node_1;
3+
CREATE TABLE author (
4+
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
5+
name VARCHAR(100) NOT NULL
6+
) ENGINE = InnoDB;
7+
CREATE TABLE book (
8+
id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
9+
title VARCHAR(200) NOT NULL,
10+
author_id SMALLINT UNSIGNED NOT NULL,
11+
CONSTRAINT `fk_book_author`
12+
FOREIGN KEY (author_id) REFERENCES author (id)
13+
ON DELETE CASCADE
14+
ON UPDATE RESTRICT
15+
) ENGINE = InnoDB;
16+
INSERT INTO author (name) VALUES ('Abdul Alhazred');
17+
INSERT INTO book (title, author_id) VALUES ('Necronomicon', LAST_INSERT_ID());
18+
TRUNCATE TABLE book;
19+
SELECT * FROM author;
20+
id name
21+
1 Abdul Alhazred
22+
SELECT * FROM book;
23+
id title author_id
24+
connection node_2;
25+
SELECT * FROM author;
26+
id name
27+
1 Abdul Alhazred
28+
SELECT * FROM book;
29+
id title author_id
30+
INSERT INTO author (name) VALUES ('Abdul Alhazred');
31+
INSERT INTO book (title, author_id) VALUES ('Necronomicon', LAST_INSERT_ID());
32+
TRUNCATE TABLE book;
33+
SELECT * FROM author;
34+
id name
35+
1 Abdul Alhazred
36+
2 Abdul Alhazred
37+
SELECT * FROM book;
38+
id title author_id
39+
connection node_1;
40+
TRUNCATE TABLE book;
41+
SELECT * FROM author;
42+
id name
43+
1 Abdul Alhazred
44+
2 Abdul Alhazred
45+
SELECT * FROM book;
46+
id title author_id
47+
DROP TABLE book, author;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
connection node_2;
2+
connection node_1;
13
connection node_1;
24
call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*");
35
connection node_2;
@@ -24,5 +26,6 @@ connection node_1;
2426
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
2527
VARIABLE_VALUE = 2
2628
1
29+
connection node_2;
2730
disconnect node_2;
2831
disconnect node_1;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
--source include/galera_cluster.inc
2+
3+
CREATE TABLE author (
4+
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
5+
name VARCHAR(100) NOT NULL
6+
) ENGINE = InnoDB;
7+
8+
CREATE TABLE book (
9+
id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
10+
title VARCHAR(200) NOT NULL,
11+
author_id SMALLINT UNSIGNED NOT NULL,
12+
CONSTRAINT `fk_book_author`
13+
FOREIGN KEY (author_id) REFERENCES author (id)
14+
ON DELETE CASCADE
15+
ON UPDATE RESTRICT
16+
) ENGINE = InnoDB;
17+
18+
INSERT INTO author (name) VALUES ('Abdul Alhazred');
19+
INSERT INTO book (title, author_id) VALUES ('Necronomicon', LAST_INSERT_ID());
20+
21+
TRUNCATE TABLE book;
22+
SELECT * FROM author;
23+
SELECT * FROM book;
24+
25+
--connection node_2
26+
SELECT * FROM author;
27+
SELECT * FROM book;
28+
INSERT INTO author (name) VALUES ('Abdul Alhazred');
29+
INSERT INTO book (title, author_id) VALUES ('Necronomicon', LAST_INSERT_ID());
30+
TRUNCATE TABLE book;
31+
SELECT * FROM author;
32+
SELECT * FROM book;
33+
34+
--connection node_1
35+
TRUNCATE TABLE book;
36+
SELECT * FROM author;
37+
SELECT * FROM book;
38+
39+
DROP TABLE book, author;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,11 @@ select * from t1;
7070
ERROR HY000: Tablespace has been discarded for table `t1`
7171
drop table t2;
7272
drop table t1;
73+
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i1 INT) ENGINE=INNODB;
74+
CREATE TABLE t2 (id INT PRIMARY KEY AUTO_INCREMENT, i1 INT, i2 INT) ENGINE=INNODB;
75+
ALTER TABLE t2 DROP COLUMN i2, ALGORITHM=INSTANT;
76+
ALTER TABLE t2 DISCARD TABLESPACE;
77+
FLUSH TABLE t1 FOR EXPORT;
78+
UNLOCK TABLES;
79+
ALTER TABLE t2 IMPORT TABLESPACE;
80+
DROP TABLE t2, t1;

mysql-test/suite/innodb/t/instant_alter_import.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,22 @@ select * from t1;
8282

8383
drop table t2;
8484
drop table t1;
85+
86+
87+
--let $MYSQLD_DATADIR= `SELECT @@datadir`
88+
89+
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i1 INT) ENGINE=INNODB;
90+
91+
CREATE TABLE t2 (id INT PRIMARY KEY AUTO_INCREMENT, i1 INT, i2 INT) ENGINE=INNODB;
92+
ALTER TABLE t2 DROP COLUMN i2, ALGORITHM=INSTANT;
93+
ALTER TABLE t2 DISCARD TABLESPACE;
94+
95+
FLUSH TABLE t1 FOR EXPORT;
96+
97+
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
98+
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
99+
100+
UNLOCK TABLES;
101+
ALTER TABLE t2 IMPORT TABLESPACE;
102+
103+
DROP TABLE t2, t1;

sql/sql_admin.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,16 +462,17 @@ static bool wsrep_toi_replication(THD *thd, TABLE_LIST *tables)
462462
/* now TOI replication, with no locks held */
463463
if (keys.empty())
464464
{
465-
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, tables);
466-
} else {
467-
WSREP_TO_ISOLATION_BEGIN_FK_TABLES(NULL, NULL, tables, &keys) {
465+
if (!thd->lex->no_write_to_binlog &&
466+
wsrep_to_isolation_begin(thd, NULL, NULL, tables))
467+
return true;
468+
}
469+
else
470+
{
471+
if (!thd->lex->no_write_to_binlog &&
472+
wsrep_to_isolation_begin(thd, NULL, NULL, tables, NULL, &keys))
468473
return true;
469-
}
470474
}
471475
return false;
472-
473-
wsrep_error_label:
474-
return true;
475476
}
476477
#endif /* WITH_WSREP */
477478

0 commit comments

Comments
 (0)