Skip to content

Commit ae8c8d8

Browse files
committed
Merge 10.5 into 10.6
2 parents 1e9c922 + 699de65 commit ae8c8d8

File tree

12 files changed

+137
-32
lines changed

12 files changed

+137
-32
lines changed

include/wsrep.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626

2727
#define WSREP_MYSQL_DB (char *)"mysql"
2828

29-
#define WSREP_TO_ISOLATION_BEGIN_IF(db_, table_, table_list_) \
30-
if (WSREP_ON && WSREP(thd) && \
31-
wsrep_to_isolation_begin(thd, db_, table_, table_list_))
32-
3329
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
3430
if (WSREP_ON && WSREP(thd) && \
3531
wsrep_to_isolation_begin(thd, db_, table_, table_list_)) \
@@ -57,10 +53,6 @@
5753
wsrep_to_isolation_begin(thd, db_, table_, table_list_)) \
5854
goto wsrep_error_label;
5955

60-
#define WSREP_TO_ISOLATION_BEGIN_FK_TABLES(db_, table_, table_list_, fk_tables) \
61-
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
62-
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_, NULL, fk_tables))
63-
6456
#define WSREP_SYNC_WAIT(thd_, before_) \
6557
{ if (WSREP_CLIENT(thd_) && \
6658
wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; }
@@ -75,7 +67,6 @@
7567
#define WSREP_ERROR(...)
7668
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) do { } while(0)
7769
#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_, fk_tables_, create_info_)
78-
#define WSREP_TO_ISOLATION_BEGIN_FK_TABLES(db_, table_, table_list_, fk_tables_)
7970
#define WSREP_TO_ISOLATION_BEGIN_CREATE(db_, table_, table_list_, create_info_)
8071
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
8172
#define WSREP_SYNC_WAIT(thd_, before_)

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
@@ -33,7 +33,6 @@ galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
3333
galera_pc_ignore_sb : MDEV-20888 galera.galera_pc_ignore_sb
3434
galera_pc_recovery : MDEV-25199 cluster fails to start up
3535
galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
36-
galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade
3736
galera_sst_mysqldump : MDEV-26501 : galera.galera_sst_mysqldump MTR failed: galera SST with mysqldump failed
3837
galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting
3938
galera_toi_truncate : MDEV-22996 Hang on galera_toi_truncate test case
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
@@ -83,3 +83,22 @@ select * from t1;
8383

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

sql/sql_admin.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -477,16 +477,17 @@ static bool wsrep_toi_replication(THD *thd, TABLE_LIST *tables)
477477
/* now TOI replication, with no locks held */
478478
if (keys.empty())
479479
{
480-
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, tables);
481-
} else {
482-
WSREP_TO_ISOLATION_BEGIN_FK_TABLES(NULL, NULL, tables, &keys) {
480+
if (!thd->lex->no_write_to_binlog &&
481+
wsrep_to_isolation_begin(thd, NULL, NULL, tables))
482+
return true;
483+
}
484+
else
485+
{
486+
if (!thd->lex->no_write_to_binlog &&
487+
wsrep_to_isolation_begin(thd, NULL, NULL, tables, NULL, &keys))
483488
return true;
484-
}
485489
}
486490
return false;
487-
488-
wsrep_error_label:
489-
return true;
490491
}
491492
#endif /* WITH_WSREP */
492493

sql/sql_truncate.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,15 +467,13 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref)
467467
{
468468
if (keys.empty())
469469
{
470-
WSREP_TO_ISOLATION_BEGIN_IF(table_ref->db.str, table_ref->table_name.str, NULL)
471-
{
470+
if (wsrep_to_isolation_begin(thd, table_ref->db.str, table_ref->table_name.str, NULL))
472471
DBUG_RETURN(TRUE);
473-
}
474-
} else {
475-
WSREP_TO_ISOLATION_BEGIN_FK_TABLES(NULL, NULL, table_ref, &keys)
476-
{
472+
}
473+
else
474+
{
475+
if (wsrep_to_isolation_begin(thd, NULL, NULL, table_ref, NULL, &keys))
477476
DBUG_RETURN(TRUE);
478-
}
479477
}
480478
}
481479
}

storage/innobase/include/dict0mem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2462,7 +2462,7 @@ inline void dict_index_t::clear_instant_alter()
24622462
{ return a.col->ind < b.col->ind; });
24632463
table->instant = NULL;
24642464
if (ai_col) {
2465-
auto a = std::find_if(begin, end,
2465+
auto a = std::find_if(fields, end,
24662466
[ai_col](const dict_field_t& f)
24672467
{ return f.col == ai_col; });
24682468
table->persistent_autoinc = (a == end)

0 commit comments

Comments
 (0)