Skip to content

Commit 448c207

Browse files
committed
Merge 10.5 into 10.6
2 parents a6bf4b5 + be5fd3e commit 448c207

File tree

4 files changed

+78
-35
lines changed

4 files changed

+78
-35
lines changed

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,30 @@ xa prepare 'xid2';
1515
release savepoint `sv1`;
1616
xa commit 'xid2';
1717
drop table t1;
18+
#
19+
# MDEV-31928 Assertion xid ... < 128 failed in trx_undo_write_xid()
20+
#
21+
CREATE TABLE t (a INT PRIMARY KEY) ENGINE=INNODB;
22+
XA START 'gtrid_67890123456789012345678901234567890123456789012345678901234','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
23+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1234567890' at line 1
24+
XA START 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_67890123456789012345678901234567890123456789012345678901234',1234567890;
25+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1234567890' at line 1
26+
XA START 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
27+
INSERT INTO t VALUES(1);
28+
XA END 'gtrid_67890123456789012345678901234567890123456789012345678901234','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
29+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1234567890' at line 1
30+
XA END 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_67890123456789012345678901234567890123456789012345678901234',1234567890;
31+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1234567890' at line 1
32+
XA END 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
33+
XA PREPARE 'gtrid_67890123456789012345678901234567890123456789012345678901234','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
34+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1234567890' at line 1
35+
XA PREPARE 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_67890123456789012345678901234567890123456789012345678901234',1234567890;
36+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1234567890' at line 1
37+
XA PREPARE 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
38+
XA COMMIT 'gtrid_67890123456789012345678901234567890123456789012345678901234','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
39+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1234567890' at line 1
40+
XA COMMIT 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_67890123456789012345678901234567890123456789012345678901234',1234567890;
41+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1234567890' at line 1
42+
XA COMMIT 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
43+
DROP TABLE t;
44+
# End of 10.4 tests
Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--source include/have_innodb.inc
22

3-
--disable_abort_on_error
3+
--error ER_XAER_NOTA
44
xa rollback 'xid2';
55
drop table if exists t1;
66
create table t1(a int)engine=innodb;
@@ -9,9 +9,42 @@ xa start 'xid2';
99
insert into `t1` values (1);
1010
savepoint `sv1`;
1111
xa end 'xid2';
12+
--error ER_XAER_RMFAIL
1213
start transaction;
1314
xa prepare 'xid2';
1415
release savepoint `sv1`;
1516
xa commit 'xid2';
1617
drop table t1;
1718

19+
-- echo #
20+
-- echo # MDEV-31928 Assertion xid ... < 128 failed in trx_undo_write_xid()
21+
-- echo #
22+
23+
CREATE TABLE t (a INT PRIMARY KEY) ENGINE=INNODB;
24+
--error ER_PARSE_ERROR
25+
XA START 'gtrid_67890123456789012345678901234567890123456789012345678901234','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
26+
--error ER_PARSE_ERROR
27+
XA START 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_67890123456789012345678901234567890123456789012345678901234',1234567890;
28+
XA START 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
29+
30+
INSERT INTO t VALUES(1);
31+
32+
--error ER_PARSE_ERROR
33+
XA END 'gtrid_67890123456789012345678901234567890123456789012345678901234','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
34+
--error ER_PARSE_ERROR
35+
XA END 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_67890123456789012345678901234567890123456789012345678901234',1234567890;
36+
XA END 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
37+
--error ER_PARSE_ERROR
38+
XA PREPARE 'gtrid_67890123456789012345678901234567890123456789012345678901234','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
39+
--error ER_PARSE_ERROR
40+
XA PREPARE 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_67890123456789012345678901234567890123456789012345678901234',1234567890;
41+
XA PREPARE 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
42+
--error ER_PARSE_ERROR
43+
XA COMMIT 'gtrid_67890123456789012345678901234567890123456789012345678901234','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
44+
--error ER_PARSE_ERROR
45+
XA COMMIT 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_67890123456789012345678901234567890123456789012345678901234',1234567890;
46+
XA COMMIT 'gtrid_6789012345678901234567890123456789012345678901234567890123','bqual_6789012345678901234567890123456789012345678901234567890123',1234567890;
47+
48+
DROP TABLE t;
49+
50+
-- echo # End of 10.4 tests

sql/rpl_parallel.cc

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,21 +2369,6 @@ rpl_parallel_entry::choose_thread(rpl_group_info *rgi, bool *did_enter_cond,
23692369
/* The thread is ready to queue into. */
23702370
break;
23712371
}
2372-
else if (unlikely(rli->sql_driver_thd->check_killed(1)))
2373-
{
2374-
unlock_or_exit_cond(rli->sql_driver_thd, &thr->LOCK_rpl_thread,
2375-
did_enter_cond, old_stage);
2376-
my_error(ER_CONNECTION_KILLED, MYF(0));
2377-
#ifdef ENABLED_DEBUG_SYNC
2378-
DBUG_EXECUTE_IF("rpl_parallel_wait_queue_max",
2379-
{
2380-
debug_sync_set_action(rli->sql_driver_thd,
2381-
STRING_WITH_LEN("now SIGNAL wait_queue_killed"));
2382-
};);
2383-
#endif
2384-
slave_output_error_info(rgi, rli->sql_driver_thd);
2385-
return NULL;
2386-
}
23872372
else
23882373
{
23892374
/*
@@ -2411,6 +2396,23 @@ rpl_parallel_entry::choose_thread(rpl_group_info *rgi, bool *did_enter_cond,
24112396
old_stage);
24122397
*did_enter_cond= true;
24132398
}
2399+
2400+
if (unlikely(rli->sql_driver_thd->check_killed(1)))
2401+
{
2402+
unlock_or_exit_cond(rli->sql_driver_thd, &thr->LOCK_rpl_thread,
2403+
did_enter_cond, old_stage);
2404+
my_error(ER_CONNECTION_KILLED, MYF(0));
2405+
#ifdef ENABLED_DEBUG_SYNC
2406+
DBUG_EXECUTE_IF("rpl_parallel_wait_queue_max",
2407+
{
2408+
debug_sync_set_action(rli->sql_driver_thd,
2409+
STRING_WITH_LEN("now SIGNAL wait_queue_killed"));
2410+
};);
2411+
#endif
2412+
slave_output_error_info(rgi, rli->sql_driver_thd);
2413+
return NULL;
2414+
}
2415+
24142416
mysql_cond_wait(&thr->COND_rpl_thread_queue, &thr->LOCK_rpl_thread);
24152417
}
24162418
}

storage/innobase/buf/buf0lru.cc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,25 +1184,6 @@ static bool buf_LRU_block_remove_hashed(buf_page_t *bpage, const page_id_t id,
11841184
return true;
11851185
}
11861186

1187-
/* Question: If we release hash_lock here
1188-
then what protects us against:
1189-
1) Some other thread buffer fixing this page
1190-
2) Some other thread trying to read this page and
1191-
not finding it in buffer pool attempting to read it
1192-
from the disk.
1193-
Answer:
1194-
1) Cannot happen because the page is no longer in the
1195-
page_hash. Only possibility is when while invalidating
1196-
a tablespace we buffer fix the prev_page in LRU to
1197-
avoid relocation during the scan. But that is not
1198-
possible because we are holding buf_pool mutex.
1199-
1200-
2) Not possible because in buf_page_init_for_read()
1201-
we do a look up of page_hash while holding buf_pool
1202-
mutex and since we are holding buf_pool mutex here
1203-
and by the time we'll release it in the caller we'd
1204-
have inserted the compressed only descriptor in the
1205-
page_hash. */
12061187
hash_lock.unlock();
12071188

12081189
if (bpage->zip.data) {

0 commit comments

Comments
 (0)