Bug #72987 it unnecessary to set page max trx_id in update_index_page when index is cluster
Submitted: 12 Jun 2014 15:28 Modified: 9 May 2017 14:43
Reporter: zhang simon (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.6, 5.7 OS:Any
Assigned to: CPU Architecture:Any

[12 Jun 2014 15:28] zhang simon
Description:
it unnecessary to set page max trx_id in update_index_page when index is cluster

#define PAGE_MAX_TRX_ID	 18	/* highest id of a trx which may have modified
				a record on the page; trx_id_t; defined only
				in secondary indexes and in the insert buffer
                tree. in cluster indexes, store table max auto_inc
                value. */

How to repeat:
check about this function
PageConverter::update_index_page

Suggested fix:
Index: storage/innobase/row/row0import.cc
===================================================================
--- storage/innobase/row/row0import.cc	(revision 6630)
+++ storage/innobase/row/row0import.cc	(working copy)
@@ -1942,8 +1942,9 @@
 	btr_page_set_index_id(
 		page, m_page_zip_ptr, m_index->m_srv_index->id, 0);
 
-	page_set_max_trx_id(block, m_page_zip_ptr, m_trx->id, 0);
-
+    if (dict_index_is_sec_or_ibuf(m_index->m_srv_index) && page_is_leaf(page))
+        page_set_max_trx_id(block, m_page_zip_ptr, m_trx->id, 0);
+        
 	if (page_is_empty(block->frame)) {
[9 May 2017 14:43] MySQL Verification Team
Hi Zhang,

Thank you so much for your contribution.

I have studied the code carefully and concluded that you are right.

Verifed.