Bug #72138 There art no MYSQL_SET_TRANSACTION_TRXID in source code.
Submitted: 26 Mar 2014 22:41 Modified: 27 Mar 2014 15:37
Reporter: 徹 赤松 Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:5.7.3 OS:Linux
Assigned to: CPU Architecture:Any
Tags: MYSQL_SET_TRANSACTION_TRXID, pfs_set_transaction_trxid_v1, set_transaction_trxid

[26 Mar 2014 22:41] 徹 赤松
Description:
I am reading transaction in performance_schema source code now.
I know about real processed finction pfs_set_transaction_trxid_v1(),
But I can not find MYSQL_SET_TRANSACTION_TRXID in source code.

Please check whether it has forgotten to write. 

I am pleased if you can reply. 

How to repeat:
I have finded recursive in source code about MYSQL_SET_TRANSACTION_TRXID.

dir_name=mysql-5.7.3-m13.origin
mysql-5.7.3-m13.origin/include/mysql/psi/mysql_transaction.h
   69   #define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
   72   #define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
There art only about DEFINE.

I can find real processed function about set_transaction_trxid.

dir_name=mysql-5.7.3-m13.origin
mysql-5.7.3-m13.origin/storage/perfschema/pfs.cc
 5611 void pfs_set_transaction_trxid_v1(PSI_transaction_locker *locker,
 6381   pfs_set_transaction_trxid_v1,

mysql-5.7.3-m13.origin/storage/unittest/pfs_noop-t.cc
  208   PSI_server->set_transaction_trxid(NULL, NULL);

mysql-5.7.3-m13.origin/mysys/psi_noop.c
  628 static void set_transaction_trxid_noop(PSI_transaction_locker *locker NNN,
  910   set_transaction_trxid_noop,

mysql-5.7.3-m13.origin/include/pfs_transaction_provider.h
   57 void pfs_set_transaction_trxid_v1(PSI_transaction_locker *locker,

mysql-5.7.3-m13.origin/include/mysql/psi/mysql_transaction.h
   70     inline_mysql_set_transaction_trxid(LOCKER, P1)
  164 inline_mysql_set_transaction_trxid(PSI_transaction_locker *locker,
  168     PSI_TRANSACTION_CALL(set_transaction_trxid)(locker, trxid);

mysql-5.7.3-m13.origin/include/mysql/psi/psi.h
 2141 typedef void (*set_transaction_trxid_v1_t)
 2509   /** @sa set_transaction_trxid_v1_t. */
 2510   set_transaction_trxid_v1_t set_transaction_trxid;
 2510   set_transaction_trxid_v1_t set_transaction_trxid;

mysql-5.7.3-m13.origin/include/mysql/psi/psi_abi_v1.h.pp
  598 typedef void (*set_transaction_trxid_v1_t)
  758   set_transaction_trxid_v1_t set_transaction_trxid;
  758   set_transaction_trxid_v1_t set_transaction_trxid;

Suggested fix:
I think it has forgotten to write.
[27 Mar 2014 15:37] MySQL Verification Team
Dear 徹 赤松,

You are quite right. Macro MYSQL_SET_TRANSACTION_TRXID is defined in the mysql_transaction.h file within psi/ subdirectory, but is not used anywhere in the code. This is simply for the fact that all platforms on which we are building our servers, `psi` interface is supported. So, this macro is there as a reserve, if ever we hit a platform that can't support it.

Our developers are well aware of these facts and will change the code to use the macro, once an incompatible platform enters the list of ones we support.