diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
|
index dc740cad862..d37d3d85f96 100644
|
--- a/storage/innobase/page/page0cur.cc
|
+++ b/storage/innobase/page/page0cur.cc
|
@@ -1579,8 +1579,12 @@ page_cur_insert_rec_low(
|
const byte *r= rec;
|
const byte *c= cur->rec;
|
const byte *c_end= cur->rec + data_size;
|
+ static_assert(REC_N_OLD_EXTRA_BYTES == REC_N_NEW_EXTRA_BYTES + 1, "");
|
if (c <= insert_buf && c_end > insert_buf)
|
c_end= insert_buf;
|
+ else if (c_end < next_rec &&
|
+ c_end >= next_rec - REC_N_OLD_EXTRA_BYTES + comp)
|
+ c_end= next_rec - REC_N_OLD_EXTRA_BYTES + comp;
|
else
|
c_end= std::min<const byte*>(c_end, block->page.frame + srv_page_size -
|
PAGE_DIR - PAGE_DIR_SLOT_SIZE *
|