29 #include "row0vers.ic"
80 ut_ad(mutex_own(&kernel_mutex));
81 #ifdef UNIV_SYNC_DEBUG
85 mutex_exit(&kernel_mutex);
110 mutex_enter(&kernel_mutex);
117 clust_offsets = rec_get_offsets(clust_rec, clust_index, NULL,
118 ULINT_UNDEFINED, &heap);
123 mutex_enter(&kernel_mutex);
133 clust_offsets, TRUE)) {
163 mutex_exit(&kernel_mutex);
178 clust_index, clust_offsets,
179 heap, &prev_version);
182 if (prev_version == NULL) {
183 mutex_enter(&kernel_mutex);
195 ut_ad(err == DB_SUCCESS);
205 clust_offsets = rec_get_offsets(prev_version, clust_index,
206 NULL, ULINT_UNDEFINED, &heap);
217 if (vers_del && trx_id != prev_trx_id) {
219 mutex_enter(&kernel_mutex);
226 row =
row_build(ROW_COPY_POINTERS, clust_index, prev_version,
227 clust_offsets, NULL, &ext, heap);
235 mutex_enter(&kernel_mutex);
251 ut_ad(err == DB_SUCCESS);
260 if (rec_del != vers_del) {
279 }
else if (!rec_del) {
288 if (trx_id != prev_trx_id) {
295 version = prev_version;
318 #ifdef UNIV_SYNC_DEBUG
356 const rec_t* version;
359 ulint* clust_offsets;
367 ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
368 || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
369 #ifdef UNIV_SYNC_DEBUG
374 clust_index = dict_table_get_first_index(index->
table);
379 clust_offsets = rec_get_offsets(rec, clust_index, NULL,
380 ULINT_UNDEFINED, &heap);
388 row =
row_build(ROW_COPY_POINTERS, clust_index,
389 rec, clust_offsets, NULL, &ext, heap);
413 if (entry && !dtuple_coll_cmp(ientry, entry)) {
427 clust_index, clust_offsets,
428 heap, &prev_version);
431 if (err != DB_SUCCESS || !prev_version) {
439 clust_offsets = rec_get_offsets(prev_version, clust_index,
440 NULL, ULINT_UNDEFINED, &heap);
448 row =
row_build(ROW_COPY_POINTERS, clust_index,
449 prev_version, clust_offsets,
465 if (entry && !dtuple_coll_cmp(ientry, entry)) {
473 version = prev_version;
505 const rec_t* version;
513 ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
514 || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
515 #ifdef UNIV_SYNC_DEBUG
555 *old_vers =
rec_copy(buf, version, *offsets);
556 rec_offs_make_valid(*old_vers, index,
571 if (err != DB_SUCCESS) {
575 if (prev_version == NULL) {
583 *offsets = rec_get_offsets(prev_version, index, *offsets,
584 ULINT_UNDEFINED, offset_heap);
594 *old_vers =
rec_copy(buf, prev_version, *offsets);
595 rec_offs_make_valid(*old_vers, index, *offsets);
601 version = prev_version;
632 const rec_t** old_vers)
636 const rec_t* version;
643 ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
644 || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
645 #ifdef UNIV_SYNC_DEBUG
666 if (rec == version) {
667 rec_trx_id = version_trx_id;
670 mutex_enter(&kernel_mutex);
672 mutex_exit(&kernel_mutex);
676 || version_trx->
conc_state == TRX_COMMITTED_IN_MEMORY) {
681 if (rec == version) {
692 if (rec_trx_id == version_trx_id) {
699 *offsets = rec_get_offsets(version,
706 *old_vers =
rec_copy(buf, version, *offsets);
707 rec_offs_make_valid(*old_vers, index, *offsets);
723 if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
727 if (prev_version == NULL) {
735 version = prev_version;
736 *offsets = rec_get_offsets(version, index, *offsets,
737 ULINT_UNDEFINED, offset_heap);