From 4f4c5a2ba9310a0e5065338687fc78010ff8b331 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 26 Aug 2024 19:27:45 +0200 Subject: [PATCH] fix a typo and an old bug in prefschema.transaction test --- .../suite/perfschema/r/transaction.result | 18 ++++++++---------- mysql-test/suite/perfschema/t/transaction.test | 10 ++++------ sql/log.cc | 1 + 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/mysql-test/suite/perfschema/r/transaction.result b/mysql-test/suite/perfschema/r/transaction.result index c516a4543c2..32b6592e6c2 100644 --- a/mysql-test/suite/perfschema/r/transaction.result +++ b/mysql-test/suite/perfschema/r/transaction.result @@ -408,8 +408,6 @@ CALL clear_transaction_tables(); # STEP 8 - TRANSACTIONAL AND NON-TRANSACTIONAL TABLES # ======================================================================== # -## MariaDB bug: MDEV-6012? MDEV-14436? -set @mariadb_bug=1; connection con1; SET SESSION AUTOCOMMIT = 0; SELECT * FROM performance_schema.events_transactions_current ORDER BY event_id; @@ -422,17 +420,17 @@ INSERT INTO nt1 VALUES (801, 'NON-TRANSACTIONAL'); # ## Expect 0 transactions in events_transactions_current connection default; -CALL transaction_verifier(0, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, @mariadb_bug); +CALL transaction_verifier(0, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, 0); ACTUAL EXPECTED - 1 1 + 0 0 connection con1; COMMIT; # ## Expect 0 transactions in events_transactions_history connection default; -CALL transaction_verifier(1, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, @mariadb_bug); +CALL transaction_verifier(1, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, 0); ACTUAL EXPECTED - 1 1 + 0 0 # # # STEP 8.2 - UPDATE TRANSACTIONAL AND NON-TRANSACTIONAL TABLES @@ -445,9 +443,9 @@ INSERT INTO nt1 VALUES (802, 'NON-TRANSACTIONAL'); # ## Expect 0 transactions in events_transactions_current connection default; -CALL transaction_verifier(0, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, @mariadb_bug); +CALL transaction_verifier(0, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, 0); ACTUAL EXPECTED - 1 1 + 0 0 # ## Now transactional. Transaction should be started. connection con1; @@ -467,9 +465,9 @@ connection default; CALL transaction_verifier(0, @con1_thread_id, 'transaction', 'COMMITTED', 0, '', '', '', '', 'READ WRITE', '', 'NO', 0, 0, 0, 1); ACTUAL EXPECTED 1 1 -CALL transaction_verifier(1, @con1_thread_id, 'transaction', 'COMMITTED', 0, '', '', '', '', 'READ WRITE', '', 'NO', 0, 0, 0, 1+@mariadb_bug); +CALL transaction_verifier(1, @con1_thread_id, 'transaction', 'COMMITTED', 0, '', '', '', '', 'READ WRITE', '', 'NO', 0, 0, 0, 1); ACTUAL EXPECTED - 2 2 + 1 1 CALL clear_transaction_tables(); # # ======================================================================== diff --git a/mysql-test/suite/perfschema/t/transaction.test b/mysql-test/suite/perfschema/t/transaction.test index d950139f7d6..19dab50bbb7 100644 --- a/mysql-test/suite/perfschema/t/transaction.test +++ b/mysql-test/suite/perfschema/t/transaction.test @@ -409,8 +409,6 @@ CALL clear_transaction_tables(); --echo # STEP 8 - TRANSACTIONAL AND NON-TRANSACTIONAL TABLES --echo # ======================================================================== --echo # ---echo ## MariaDB bug: MDEV-6012? MDEV-14436? -set @mariadb_bug=1; ## Statements that work with non-transactional engines have no effect on the ## transaction state of the connection. For implicit transactions, @@ -431,7 +429,7 @@ INSERT INTO nt1 VALUES (801, 'NON-TRANSACTIONAL'); --echo # --echo ## Expect 0 transactions in events_transactions_current --connection default -CALL transaction_verifier(0, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, @mariadb_bug); +CALL transaction_verifier(0, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, 0); --connection con1 COMMIT; @@ -439,7 +437,7 @@ COMMIT; --echo # --echo ## Expect 0 transactions in events_transactions_history --connection default -CALL transaction_verifier(1, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, @mariadb_bug); +CALL transaction_verifier(1, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, 0); --echo # --echo # @@ -454,7 +452,7 @@ INSERT INTO nt1 VALUES (802, 'NON-TRANSACTIONAL'); --echo # --echo ## Expect 0 transactions in events_transactions_current --connection default -CALL transaction_verifier(0, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, @mariadb_bug); +CALL transaction_verifier(0, @con1_thread_id, 'transaction', '', 0, '', '', '', '', '', '', '', 0, 0, 0, 0); --echo # --echo ## Now transactional. Transaction should be started. @@ -475,7 +473,7 @@ COMMIT; --echo ## Expect 1 committed transaction in events_transactions_current and history --connection default CALL transaction_verifier(0, @con1_thread_id, 'transaction', 'COMMITTED', 0, '', '', '', '', 'READ WRITE', '', 'NO', 0, 0, 0, 1); -CALL transaction_verifier(1, @con1_thread_id, 'transaction', 'COMMITTED', 0, '', '', '', '', 'READ WRITE', '', 'NO', 0, 0, 0, 1+@mariadb_bug); +CALL transaction_verifier(1, @con1_thread_id, 'transaction', 'COMMITTED', 0, '', '', '', '', 'READ WRITE', '', 'NO', 0, 0, 0, 1); CALL clear_transaction_tables(); --echo # diff --git a/sql/log.cc b/sql/log.cc index 36417c72e78..00904b814c1 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1770,6 +1770,7 @@ binlog_trans_log_truncate(THD *thd, my_off_t pos) int binlog_init(void *p) { binlog_hton= (handlerton *)p; + binlog_hton->db_type= DB_TYPE_BINLOG; binlog_hton->savepoint_offset= sizeof(my_off_t); binlog_hton->close_connection= binlog_close_connection; binlog_hton->savepoint_set= binlog_savepoint_set;