File tree Expand file tree Collapse file tree 6 files changed +47
-0
lines changed Expand file tree Collapse file tree 6 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ SET pseudo_slave_mode=1;
2+ CREATE TABLE t1 (c INT) ENGINE=InnoDB;
3+ CREATE TABLE t2 (c INT) ENGINE=MEMORY;
4+ XA START 'a';
5+ INSERT INTO t1 VALUES (0);
6+ CREATE TEMPORARY TABLE t1t (c INT) ENGINE=InnoDB;
7+ INSERT INTO t1t VALUES (0);
8+ XA END 'a';
9+ XA PREPARE 'a';
10+ OPTIMIZE TABLE t1t;
11+ Table Op Msg_type Msg_text
12+ test.t1t optimize Error Table 'test.t1t' doesn't exist
13+ test.t1t optimize status Operation failed
14+ LOCK TABLE t2 READ;
15+ XA COMMIT 'a';
16+ # restart
17+ DROP TABLE t1, t2;
Original file line number Diff line number Diff line change 1+ #
2+ # MDEV-35046 SIGSEGV in list_delete in optimized builds when using pseudo_slave_mode
3+ # https://jira.mariadb.org/browse/MDEV-35046
4+ #
5+ --source include/have_innodb.inc
6+ SET pseudo_slave_mode=1;
7+ CREATE TABLE t1 (c INT) ENGINE=InnoDB;
8+ CREATE TABLE t2 (c INT) ENGINE=MEMORY;
9+ XA START 'a';
10+ INSERT INTO t1 VALUES (0);
11+ CREATE TEMPORARY TABLE t1t (c INT) ENGINE=InnoDB;
12+ INSERT INTO t1t VALUES (0);
13+ XA END 'a';
14+ XA PREPARE 'a';
15+ OPTIMIZE TABLE t1t;
16+ LOCK TABLE t2 READ;
17+ XA COMMIT 'a';
18+ --source include/restart_mysqld.inc
19+ DROP TABLE t1, t2;
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ xa start 's';
2929insert into t2 values (0);
3030xa end 's';
3131xa prepare 's';
32+ Warnings:
33+ Warning 4196 Pseudo thread id should not be modified by the client as it will be overwritten
3234include/save_master_gtid.inc
3335connection slave;
3436include/sync_with_master_gtid.inc
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ xa start 's';
3535insert into t2 values (0);
3636xa end 's';
3737xa prepare 's';
38+ Warnings:
39+ Warning 4196 Pseudo thread id should not be modified by the client as it will be overwritten
3840include/save_master_gtid.inc
3941connection slave;
4042include/sync_with_master_gtid.inc
Original file line number Diff line number Diff line change @@ -12270,3 +12270,5 @@ ER_JSON_SCHEMA_KEYWORD_UNSUPPORTED
1227012270 sw "%s neno kuu halitumiki"
1227112271ER_JSON_NO_VARIABLE_SCHEMA
1227212272 eng "Variable schema is not supported."
12273+ ER_PSEUDO_THREAD_ID_OVERWRITE
12274+ eng "Pseudo thread id should not be modified by the client as it will be overwritten"
Original file line number Diff line number Diff line change @@ -1196,5 +1196,10 @@ static bool slave_applier_reset_xa_trans(THD *thd)
11961196 thd->has_waiter = false ;
11971197 MYSQL_COMMIT_TRANSACTION (thd->m_transaction_psi ); // TODO/Fixme: commit?
11981198 thd->m_transaction_psi = NULL ;
1199+ if (thd->variables .pseudo_slave_mode && thd->variables .pseudo_thread_id == 0 )
1200+ push_warning (thd, Sql_condition::WARN_LEVEL_WARN,
1201+ ER_PSEUDO_THREAD_ID_OVERWRITE,
1202+ ER_THD (thd, ER_PSEUDO_THREAD_ID_OVERWRITE));
1203+ thd->variables .pseudo_thread_id = 0 ;
11991204 return thd->is_error ();
12001205}
You can’t perform that action at this time.
0 commit comments