@@ -748,18 +748,24 @@ btr_cur_will_modify_tree(
748748
749749/* * Detects whether the modifying record might need a opposite modification
750750to the intention.
751- @param page page
752- @param lock_intention lock intention for the tree operation
751+ @param bpage buffer pool page
752+ @param is_clust whether this is a clustered index
753+ @param lock_intention lock intention for the tree operation
753754@param node_ptr_max_size the maximum size of a node pointer
754755@param compress_limit BTR_CUR_PAGE_COMPRESS_LIMIT(index)
755- @param rec record (current node_ptr)
756- @return true if tree modification is needed */
757- static bool btr_cur_need_opposite_intention (const page_t *page,
756+ @param rec record (current node_ptr)
757+ @return true if tree modification is needed */
758+ static bool btr_cur_need_opposite_intention (const buf_page_t &bpage,
759+ bool is_clust,
758760 btr_intention_t lock_intention,
759761 ulint node_ptr_max_size,
760762 ulint compress_limit,
761763 const rec_t *rec)
762764{
765+ if (UNIV_LIKELY_NULL (bpage.zip .data ) &&
766+ !page_zip_available (&bpage.zip , is_clust, node_ptr_max_size, 1 ))
767+ return true ;
768+ const page_t *const page= bpage.frame ;
763769 if (lock_intention != BTR_INTENTION_INSERT)
764770 {
765771 /* We compensate also for btr_cur_compress_recommendation() */
@@ -1342,7 +1348,8 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode,
13421348 !btr_block_get (*index (), btr_page_get_next (block->page .frame ),
13431349 RW_X_LATCH, false , mtr, &err))
13441350 goto func_exit;
1345- if (btr_cur_need_opposite_intention (block->page .frame , lock_intention,
1351+ if (btr_cur_need_opposite_intention (block->page , index ()->is_clust (),
1352+ lock_intention,
13461353 node_ptr_max_size, compress_limit,
13471354 page_cur.rec ))
13481355 goto need_opposite_intention;
@@ -1398,7 +1405,8 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode,
13981405 default :
13991406 break ;
14001407 case BTR_MODIFY_TREE:
1401- if (btr_cur_need_opposite_intention (block->page .frame , lock_intention,
1408+ if (btr_cur_need_opposite_intention (block->page , index ()->is_clust (),
1409+ lock_intention,
14021410 node_ptr_max_size, compress_limit,
14031411 page_cur.rec ))
14041412 /* If the rec is the first or last in the page for pessimistic
@@ -1948,7 +1956,7 @@ dberr_t btr_cur_t::open_leaf(bool first, dict_index_t *index,
19481956 break ;
19491957
19501958 if (!index->lock .have_x () &&
1951- btr_cur_need_opposite_intention (block->page . frame ,
1959+ btr_cur_need_opposite_intention (block->page , index-> is_clust () ,
19521960 lock_intention,
19531961 node_ptr_max_size,
19541962 compress_limit, page_cur.rec ))
@@ -1995,7 +2003,8 @@ dberr_t btr_cur_t::open_leaf(bool first, dict_index_t *index,
19952003 ut_ad (latch_mode != BTR_MODIFY_TREE || upper_rw_latch == RW_X_LATCH);
19962004
19972005 if (latch_mode != BTR_MODIFY_TREE);
1998- else if (btr_cur_need_opposite_intention (block->page .frame , lock_intention,
2006+ else if (btr_cur_need_opposite_intention (block->page , index->is_clust (),
2007+ lock_intention,
19992008 node_ptr_max_size, compress_limit,
20002009 page_cur.rec ))
20012010 {
0 commit comments