29 #include "row0vers.ic"
60 const rec_t* clust_rec,
72 rec_t* prev_version = NULL;
76 ut_ad(rec_offs_validate(rec, index, offsets));
80 clust_offsets = rec_get_offsets(
81 clust_rec, clust_index, NULL, ULINT_UNDEFINED, &heap);
91 trx_id, clust_rec, clust_index, clust_offsets,
116 for (version = clust_rec;; version = prev_version) {
131 clust_rec, mtr, version, clust_index, clust_offsets,
132 heap, &prev_version);
138 if (prev_version == NULL) {
149 clust_offsets = rec_get_offsets(
150 prev_version, clust_index, NULL, ULINT_UNDEFINED,
162 row =
row_build(ROW_COPY_POINTERS, clust_index, prev_version,
164 NULL, NULL, NULL, &ext, heap);
195 prev_version, clust_index,
206 if (rec_del != vers_del) {
224 }
else if (!rec_del) {
231 if (trx_id != prev_trx_id) {
260 const rec_t* clust_rec;
279 if (UNIV_UNLIKELY(!clust_rec)) {
295 clust_rec, clust_index, rec, index, offsets, &mtr);
316 #ifdef UNIV_SYNC_DEBUG
346 const rec_t* version;
349 ulint* clust_offsets;
356 ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
357 || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
358 #ifdef UNIV_SYNC_DEBUG
362 clust_index = dict_table_get_first_index(index->
table);
367 clust_offsets = rec_get_offsets(rec, clust_index, NULL,
368 ULINT_UNDEFINED, &heap);
380 row =
row_build(ROW_COPY_POINTERS, clust_index,
382 NULL, NULL, NULL, &ext, heap);
420 clust_index, clust_offsets,
421 heap, &prev_version);
432 clust_offsets = rec_get_offsets(prev_version, clust_index,
433 NULL, ULINT_UNDEFINED, &heap);
441 row =
row_build(ROW_COPY_POINTERS, clust_index,
442 prev_version, clust_offsets,
443 NULL, NULL, NULL, &ext, heap);
466 version = prev_version;
499 const rec_t* version;
507 ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
508 || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
509 #ifdef UNIV_SYNC_DEBUG
513 ut_ad(rec_offs_validate(rec, index, *offsets));
546 #if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
554 *old_vers =
rec_copy(buf, version, *offsets);
555 rec_offs_make_valid(*old_vers, index,
570 if (prev_version == NULL) {
576 *offsets = rec_get_offsets(prev_version, index, *offsets,
577 ULINT_UNDEFINED, offset_heap);
579 #if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
590 buf =
static_cast<byte*
>(
594 *old_vers =
rec_copy(buf, prev_version, *offsets);
595 rec_offs_make_valid(*old_vers, index, *offsets);
599 version = prev_version;
632 const rec_t* version;
638 ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
639 || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
640 #ifdef UNIV_SYNC_DEBUG
644 ut_ad(rec_offs_validate(rec, index, *offsets));
649 const trx_t* version_trx;
655 if (rec == version) {
656 rec_trx_id = version_trx_id;
667 TRX_STATE_COMMITTED_IN_MEMORY)) {
673 committed_version_trx:
677 #if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
681 if (rec == version) {
691 if (rec_trx_id == version_trx_id) {
698 *offsets = rec_get_offsets(version,
704 buf =
static_cast<byte*
>(
708 *old_vers =
rec_copy(buf, version, *offsets);
709 rec_offs_make_valid(*old_vers, index, *offsets);
713 DEBUG_SYNC_C(
"after_row_vers_check_trx_active");
724 goto committed_version_trx;
731 if (prev_version == NULL) {
737 version = prev_version;
738 *offsets = rec_get_offsets(version, index, *offsets,
739 ULINT_UNDEFINED, offset_heap);
740 #if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG