diff --git a/include/mysql/psi/mysql_transaction.h b/include/mysql/psi/mysql_transaction.h index dab9cfee14f..6de794d95bb 100644 --- a/include/mysql/psi/mysql_transaction.h +++ b/include/mysql/psi/mysql_transaction.h @@ -124,7 +124,7 @@ static inline struct PSI_transaction_locker * inline_mysql_start_transaction(PSI_transaction_locker_state *state, const void *xid, - const ulonglong *trxid, + ulonglong trxid, int isolation_level, my_bool read_only, my_bool autocommit, diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h index c6403223724..958a086f05a 100644 --- a/include/mysql/psi/psi.h +++ b/include/mysql/psi/psi.h @@ -2205,7 +2205,7 @@ typedef void (*end_statement_v1_t) */ typedef struct PSI_transaction_locker* (*get_thread_transaction_locker_v1_t) (struct PSI_transaction_locker_state_v1 *state, const void *xid, - const ulonglong *trxid, int isolation_level, my_bool read_only, + ulonglong trxid, int isolation_level, my_bool read_only, my_bool autocommit); /** diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp index 738ce1ea746..60a6a8031a6 100644 --- a/include/mysql/psi/psi_abi_v1.h.pp +++ b/include/mysql/psi/psi_abi_v1.h.pp @@ -602,7 +602,7 @@ typedef void (*end_statement_v1_t) (struct PSI_statement_locker *locker, void *stmt_da); typedef struct PSI_transaction_locker* (*get_thread_transaction_locker_v1_t) (struct PSI_transaction_locker_state_v1 *state, const void *xid, - const ulonglong *trxid, int isolation_level, my_bool read_only, + ulonglong trxid, int isolation_level, my_bool read_only, my_bool autocommit); typedef void (*start_transaction_v1_t) (struct PSI_transaction_locker *locker, diff --git a/include/pfs_transaction_provider.h b/include/pfs_transaction_provider.h index 7cf5357c570..fdaad8ae1c6 100644 --- a/include/pfs_transaction_provider.h +++ b/include/pfs_transaction_provider.h @@ -35,7 +35,7 @@ C_MODE_START PSI_transaction_locker* pfs_get_thread_transaction_locker_v1(PSI_transaction_locker_state *state, const void *xid, - const ulonglong *trxid, + ulonglong trxid, int isolation_level, my_bool read_only, my_bool autocommit); diff --git a/mysys/psi_noop.c b/mysys/psi_noop.c index 132b8395e32..09b839468ac 100644 --- a/mysys/psi_noop.c +++ b/mysys/psi_noop.c @@ -629,7 +629,7 @@ static void end_statement_noop(PSI_statement_locker *locker NNN, static PSI_transaction_locker* get_thread_transaction_locker_noop(PSI_transaction_locker_state *state NNN, const void *xid NNN, - const ulonglong *trxid NNN, + ulonglong trxid NNN, int isolation_level NNN, my_bool read_only NNN, my_bool autocommit NNN) diff --git a/sql/handler.cc b/sql/handler.cc index 60089d348f2..73bc86d010b 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1236,8 +1236,7 @@ void ha_pre_shutdown() times per transaction. */ -void trans_register_ha(THD *thd, bool all, handlerton *ht_arg, - const ulonglong *trxid) +void trans_register_ha(THD *thd, bool all, handlerton *ht_arg, ulonglong trxid) { THD_TRANS *trans; Ha_trx_info *ha_info; diff --git a/sql/handler.h b/sql/handler.h index ab1e1590e5b..f17c303571f 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -5062,7 +5062,7 @@ int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal); /* these are called by storage engines */ void trans_register_ha(THD *thd, bool all, handlerton *ht, - const ulonglong *trxid); + ulonglong trxid); /* Storage engine has to assume the transaction will end up with 2pc if diff --git a/sql/log.cc b/sql/log.cc index 174adc4d145..65679ea6685 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2212,8 +2212,8 @@ void MYSQL_BIN_LOG::set_write_error(THD *thd, bool is_transactional) if (WSREP_EMULATE_BINLOG(thd)) { if (is_transactional) - trans_register_ha(thd, TRUE, binlog_hton, NULL); - trans_register_ha(thd, FALSE, binlog_hton, NULL); + trans_register_ha(thd, TRUE, binlog_hton, 0); + trans_register_ha(thd, FALSE, binlog_hton, 0); } #endif /* WITH_WSREP */ DBUG_VOID_RETURN; @@ -5713,8 +5713,8 @@ THD::binlog_start_trans_and_stmt() } #endif if (mstmt_mode) - trans_register_ha(this, TRUE, binlog_hton, NULL); - trans_register_ha(this, FALSE, binlog_hton, NULL); + trans_register_ha(this, TRUE, binlog_hton, 0); + trans_register_ha(this, FALSE, binlog_hton, 0); /* Mark statement transaction as read/write. We never start a binary log transaction and keep it read-only, @@ -5758,7 +5758,7 @@ binlog_start_consistent_snapshot(handlerton *hton, THD *thd) strmake_buf(cache_mngr->last_commit_pos_file, mysql_bin_log.last_commit_pos_file); cache_mngr->last_commit_pos_offset= mysql_bin_log.last_commit_pos_offset; - trans_register_ha(thd, TRUE, binlog_hton, NULL); + trans_register_ha(thd, TRUE, binlog_hton, 0); DBUG_RETURN(err); } @@ -10748,8 +10748,8 @@ void wsrep_register_binlog_handler(THD *thd, bool trx) Set callbacks in order to be able to call commmit or rollback. */ if (trx) - trans_register_ha(thd, TRUE, binlog_hton, NULL); - trans_register_ha(thd, FALSE, binlog_hton, NULL); + trans_register_ha(thd, TRUE, binlog_hton, 0); + trans_register_ha(thd, FALSE, binlog_hton, 0); /* Set the binary log as read/write otherwise callbacks are not called. diff --git a/sql/transaction.cc b/sql/transaction.cc index 5138b275673..f5258abb751 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -223,7 +223,7 @@ bool trans_begin(THD *thd, uint flags) if (thd->m_transaction_psi == NULL) { thd->m_transaction_psi= MYSQL_START_TRANSACTION(&thd->m_transaction_state, - NULL, NULL, thd->tx_isolation, + NULL, 0, thd->tx_isolation, thd->tx_read_only, false); DEBUG_SYNC(thd, "after_set_transaction_psi_before_set_transaction_gtid"); //gtid_set_performance_schema_values(thd); diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 207964e9e9b..b76391dae4e 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -3492,7 +3492,7 @@ int ha_federatedx::start_stmt(MYSQL_THD thd, thr_lock_type lock_type) if (!txn->in_transaction()) { txn->stmt_begin(); - trans_register_ha(thd, FALSE, ht, NULL); + trans_register_ha(thd, FALSE, ht, 0); } DBUG_RETURN(0); } @@ -3515,12 +3515,12 @@ int ha_federatedx::external_lock(MYSQL_THD thd, int lock_type) if (!thd_test_options(thd, (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { txn->stmt_begin(); - trans_register_ha(thd, FALSE, ht, NULL); + trans_register_ha(thd, FALSE, ht, 0); } else { txn->txn_begin(); - trans_register_ha(thd, TRUE, ht, NULL); + trans_register_ha(thd, TRUE, ht, 0); } } } @@ -3538,7 +3538,7 @@ int ha_federatedx::savepoint_set(handlerton *hton, MYSQL_THD thd, void *sv) if (txn && txn->has_connections()) { if (txn->txn_begin()) - trans_register_ha(thd, TRUE, hton, NULL); + trans_register_ha(thd, TRUE, hton, 0); txn->sp_acquire((ulong *) sv); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 4072e88efdd..806bd01453a 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2789,12 +2789,12 @@ innobase_register_trx( const ulonglong trx_id = static_cast( trx_get_id_for_print(trx)); - trans_register_ha(thd, FALSE, hton, &trx_id); + trans_register_ha(thd, FALSE, hton, trx_id); if (!trx_is_registered_for_2pc(trx) && thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) { - trans_register_ha(thd, TRUE, hton, &trx_id); + trans_register_ha(thd, TRUE, hton, trx_id); } trx_register_for_2pc(trx); diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 6a275c9eff1..a5d5af03969 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -5904,7 +5904,7 @@ void pfs_drop_sp_v1(uint sp_type, PSI_transaction_locker* pfs_get_thread_transaction_locker_v1(PSI_transaction_locker_state *state, const void *xid, - const ulonglong *trxid, + ulonglong trxid, int isolation_level, my_bool read_only, my_bool autocommit) @@ -5948,7 +5948,7 @@ pfs_get_thread_transaction_locker_v1(PSI_transaction_locker_state *state, pfs->m_xid= *(PSI_xid *)xid; pfs->m_xa= false; pfs->m_xa_state= TRANS_STATE_XA_NOTR; - pfs->m_trxid= (trxid == NULL) ? 0 : *trxid; + pfs->m_trxid= trxid; pfs->m_isolation_level= (enum_isolation_level)isolation_level; pfs->m_read_only= read_only; pfs->m_autocommit= autocommit; diff --git a/storage/perfschema/pfs_prepared_stmt.h b/storage/perfschema/pfs_prepared_stmt.h index 4638266cce7..c163514ccc2 100644 --- a/storage/perfschema/pfs_prepared_stmt.h +++ b/storage/perfschema/pfs_prepared_stmt.h @@ -90,7 +90,6 @@ PFS_prepared_stmt* create_prepared_stmt(void *identity, PFS_thread *thread, PFS_program *pfs_program, PFS_events_statements *pfs_stmt, uint stmt_id, - const char* stmt_name, uint stmt_name_length, - const char* sqltext, uint sqltext_length); + const char* stmt_name, uint stmt_name_length); void delete_prepared_stmt(PFS_prepared_stmt *pfs_ps); #endif diff --git a/storage/perfschema/unittest/pfs_noop-t.cc b/storage/perfschema/unittest/pfs_noop-t.cc index 8ef11371519..2756680dc22 100644 --- a/storage/perfschema/unittest/pfs_noop-t.cc +++ b/storage/perfschema/unittest/pfs_noop-t.cc @@ -213,7 +213,7 @@ void test_noop() ok(metadata_locker == NULL, "no metadata_locker"); PSI_server->end_metadata_wait(NULL, 0); - transaction_locker= PSI_server->get_thread_transaction_locker(NULL, NULL, NULL, 1, false, 1); + transaction_locker= PSI_server->get_thread_transaction_locker(NULL, NULL, 0, 1, false, 1); ok(transaction_locker == NULL, "no transaction_locker"); PSI_server->start_transaction(NULL, NULL, 0); PSI_server->end_transaction(NULL, true); diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 711aaaaa173..3b2314d3f42 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -4788,10 +4788,10 @@ static inline void rocksdb_register_tx(handlerton *const hton, THD *const thd, Rdb_transaction *const tx) { DBUG_ASSERT(tx != nullptr); - trans_register_ha(thd, FALSE, rocksdb_hton, NULL); + trans_register_ha(thd, FALSE, rocksdb_hton, 0); if (my_core::thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) { tx->start_stmt(); - trans_register_ha(thd, TRUE, rocksdb_hton, NULL); + trans_register_ha(thd, TRUE, rocksdb_hton, 0); } } diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc index 137c2f5984c..8062ea68646 100644 --- a/storage/spider/spd_trx.cc +++ b/storage/spider/spd_trx.cc @@ -1994,9 +1994,9 @@ int spider_internal_start_trx( trx->trx_consistent_snapshot ? "TRUE" : "FALSE")); if (!trx->trx_consistent_snapshot) { - trans_register_ha(thd, FALSE, spider_hton_ptr, NULL); + trans_register_ha(thd, FALSE, spider_hton_ptr, 0); if (thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) - trans_register_ha(thd, TRUE, spider_hton_ptr, NULL); + trans_register_ha(thd, TRUE, spider_hton_ptr, 0); } trx->trx_start = TRUE; trx->trx_xa_prepared = FALSE; @@ -3339,8 +3339,8 @@ int spider_start_consistent_snapshot( trx->trx_consistent_snapshot = TRUE; trx->use_consistent_snapshot = TRUE; trx->internal_xa_snapshot = spider_param_internal_xa_snapshot(trx->thd); - trans_register_ha(trx->thd, FALSE, spider_hton_ptr, NULL); - trans_register_ha(trx->thd, TRUE, spider_hton_ptr, NULL); + trans_register_ha(trx->thd, FALSE, spider_hton_ptr, 0); + trans_register_ha(trx->thd, TRUE, spider_hton_ptr, 0); if (spider_param_use_all_conns_snapshot(trx->thd)) { trx->internal_xa = FALSE;