Bug #72994 innobase_trx_init() is called twice in check_trx_exists when trx == NULL.
Submitted: 13 Jun 2014 2:55 Modified: 17 Jun 2014 10:53
Reporter: Allen Lai Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[13 Jun 2014 2:55] Allen Lai
Description:
In function check_trx_exists:
        if (trx == NULL) {
		trx = innobase_trx_allocate(thd);
	} else {
		ut_a(trx->magic_n == TRX_MAGIC_N);
	}

	innobase_trx_init(thd, trx);
Function innobase_trx_allocate calls innobase_trx_init in itself.
So, innobase_trx_init() is called twice in check_trx_exists when trx == NULL.

How to repeat:
--------------

Suggested fix:
--------------
[13 Jun 2014 4:59] Allen Lai
Posted by developer:
 
------------------------------------------------------------
revno: 8200
committer: Allen lai <zheng.lai@oracle.com>
branch nick: mysql-trunk
timestamp: Fri 2014-06-13 12:56:25 +0800
message:
  Fixed bug#18971483 INNOBASE_TRX_INIT() IS CALLED TWICE IN
  CHECK_TRX_EXISTS WHEN TRX == NULL.
  
  Approved by Sunny on IM.