mariadb/mysql-test/suite/rpl/r/rpl_autocommit_off.result
Kristian Nielsen 13aad4ed2b MDEV-20586: Incorrect commit of transaction in GTID table processing
The initial scanning of the GTID pos table in find_gtid_pos_tables_cb() used
the wrong call to commit the transaction, ha_commit_trans(thd, TRUE) instead
of trans_commit(thd). This could cause an assertion
  Assertion '!thd->in_active_multi_stmt_transaction() || thd->in_multi_stmt_transaction_mode()' failed in mysql_execute_command
and possibly other issues due to incorrect state in the SQL thread THD.

Similar problem in rpl_slave_state::truncate_state_table() also fixed.

Note there is a sister patch cd88b0831f
which applied this same pattern which fixed a hang due to locks
not being released in the ha_commit_trans(thd, TRUE) call.

Test-case-by: Alice Sherepa <alice.sherepa@gmail.com>
Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-01-15 16:19:34 -07:00

16 lines
452 B
Text

include/rpl_init.inc [topology=1->2]
connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
connection server_2;
include/stop_slave.inc
connection server_1;
CREATE TABLE t1 (a INT);
connection server_2;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
connection server_2;
include/sync_with_master_gtid.inc
connection server_1;
DROP TABLE t1;
include/rpl_end.inc