File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 13
13
drop table t1;
14
14
rename table mysql.table_stats_save to mysql.table_stats;
15
15
flush tables;
16
+ #
17
+ # MDEV-26753 Assertion state == TRX_STATE_PREPARED ||... failed
18
+ #
19
+ CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
20
+ XA START 'test';
21
+ SELECT COUNT(*)>0 FROM mysql.innodb_index_stats LOCK IN SHARE MODE;
22
+ COUNT(*)>0
23
+ 1
24
+ INSERT INTO t1 VALUES (1),(2);
25
+ UPDATE mysql.innodb_table_stats SET last_update=NULL WHERE table_name='t1';
26
+ XA END 'test';
27
+ XA ROLLBACK 'test';
28
+ DROP TABLE t1;
29
+ # End of 10.6 tests
Original file line number Diff line number Diff line change @@ -15,3 +15,17 @@ select * from t1;
15
15
drop table t1;
16
16
rename table mysql.table_stats_save to mysql.table_stats;
17
17
flush tables;
18
+
19
+ --echo #
20
+ --echo # MDEV-26753 Assertion state == TRX_STATE_PREPARED ||... failed
21
+ --echo #
22
+ CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
23
+ XA START 'test';
24
+ SELECT COUNT(*)>0 FROM mysql.innodb_index_stats LOCK IN SHARE MODE;
25
+ INSERT INTO t1 VALUES (1),(2);
26
+ UPDATE mysql.innodb_table_stats SET last_update=NULL WHERE table_name='t1';
27
+ XA END 'test';
28
+ XA ROLLBACK 'test';
29
+ DROP TABLE t1;
30
+
31
+ --echo # End of 10.6 tests
Original file line number Diff line number Diff line change 1
1
/* ****************************************************************************
2
2
3
3
Copyright (c) 2009, 2019, Oracle and/or its affiliates. All Rights Reserved.
4
- Copyright (c) 2015, 2021 , MariaDB Corporation.
4
+ Copyright (c) 2015, 2022 , MariaDB Corporation.
5
5
6
6
This program is free software; you can redistribute it and/or modify it under
7
7
the terms of the GNU General Public License as published by the Free Software
@@ -3115,7 +3115,9 @@ dict_stats_save(
3115
3115
ret = lock_table_for_trx (index_stats, trx, LOCK_X);
3116
3116
}
3117
3117
if (ret != DB_SUCCESS) {
3118
- trx->commit ();
3118
+ if (trx->state != TRX_STATE_NOT_STARTED) {
3119
+ trx->commit ();
3120
+ }
3119
3121
goto unlocked_free_and_exit;
3120
3122
}
3121
3123
You can’t perform that action at this time.
0 commit comments