diff options
author | unknown <marko@hundin.mysql.fi> | 2004-12-09 15:29:55 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2004-12-09 15:29:55 +0200 |
commit | 7945222c28e3a6a4e6087c7c99ea34c3a990e46f (patch) | |
tree | 6765ffbcdc2b26af7abb9ec1f19b58356912d9bc /innobase/trx | |
parent | f9bd116c297f80613ed0e51750e20e5fcb623f75 (diff) | |
download | mariadb-git-7945222c28e3a6a4e6087c7c99ea34c3a990e46f.tar.gz |
InnoDB: Changed interface to rec_get_offsets(), to reduce the use of
memory heaps. This changeset plugs also a few memory leaks that
were introduced with the compact InnoDB table format.
innobase/btr/btr0btr.c:
Changed interface to rec_get_offsets()
innobase/btr/btr0cur.c:
Changed interface to rec_get_offsets()
innobase/btr/btr0pcur.c:
Changed interface to rec_get_offsets()
innobase/btr/btr0sea.c:
Changed interface to rec_get_offsets()
innobase/include/rem0rec.h:
Changed interface to rec_get_offsets()
innobase/include/rem0rec.ic:
Changed interface to rec_get_offsets()
innobase/lock/lock0lock.c:
Changed interface to rec_get_offsets()
innobase/page/page0cur.c:
Changed interface to rec_get_offsets()
innobase/page/page0page.c:
Changed interface to rec_get_offsets()
innobase/rem/rem0rec.c:
Changed interface to rec_get_offsets()
innobase/row/row0ins.c:
Changed interface to rec_get_offsets()
innobase/row/row0mysql.c:
Changed interface to rec_get_offsets()
innobase/row/row0purge.c:
Changed interface to rec_get_offsets()
innobase/row/row0row.c:
Changed interface to rec_get_offsets()
innobase/row/row0sel.c:
Changed interface to rec_get_offsets()
innobase/row/row0umod.c:
Changed interface to rec_print()
innobase/row/row0undo.c:
Changed interface to rec_get_offsets()
innobase/row/row0upd.c:
Changed interface to rec_get_offsets()
innobase/row/row0vers.c:
Changed interface to rec_get_offsets()
innobase/trx/trx0rec.c:
Changed interface to rec_get_offsets()
Diffstat (limited to 'innobase/trx')
-rw-r--r-- | innobase/trx/trx0rec.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c index 484d4f62744..12a0512da53 100644 --- a/innobase/trx/trx0rec.c +++ b/innobase/trx/trx0rec.c @@ -1010,8 +1010,9 @@ trx_undo_report_row_operation( ibool is_insert; trx_rseg_t* rseg; mtr_t mtr; - mem_heap_t* heap; - ulint* offsets = NULL; + mem_heap_t* heap = NULL; + ulint offsets_[100] = { 100, }; + ulint* offsets = offsets_; ut_a(index->type & DICT_CLUSTERED); @@ -1066,8 +1067,6 @@ trx_undo_report_row_operation( mtr_start(&mtr); - heap = mem_heap_create(100); - for (;;) { undo_page = buf_page_get_gen(undo->space, page_no, RW_X_LATCH, undo->guess_page, @@ -1084,8 +1083,8 @@ trx_undo_report_row_operation( index, clust_entry, &mtr); } else { - offsets = rec_reget_offsets(rec, index, - offsets, ULINT_UNDEFINED, heap); + offsets = rec_get_offsets(rec, index, offsets, + ULINT_UNDEFINED, &heap); offset = trx_undo_page_report_modify(undo_page, trx, index, rec, offsets, update, cmpl_info, &mtr); } @@ -1129,7 +1128,9 @@ trx_undo_report_row_operation( mutex_exit(&(trx->undo_mutex)); mtr_commit(&mtr); - mem_heap_free(heap); + if (heap) { + mem_heap_free(heap); + } return(DB_OUT_OF_FILE_SPACE); } } @@ -1146,7 +1147,9 @@ trx_undo_report_row_operation( *roll_ptr = trx_undo_build_roll_ptr(is_insert, rseg->id, page_no, offset); - mem_heap_free(heap); + if (heap) { + mem_heap_free(heap); + } return(DB_SUCCESS); } @@ -1266,7 +1269,6 @@ trx_undo_prev_version_build( ibool dummy_extern; byte* buf; ulint err; - ulint* index_offsets = NULL; #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED)); #endif /* UNIV_SYNC_DEBUG */ @@ -1282,12 +1284,10 @@ trx_undo_prev_version_build( "InnoDB: Submit a detailed bug report to" " http://bugs.mysql.com\n" "InnoDB: index record ", index->name); - index_offsets = rec_get_offsets(index_rec, index, - ULINT_UNDEFINED, heap); - rec_print(stderr, index_rec, index_offsets); + rec_print(stderr, index_rec, index); fputs("\n" "InnoDB: record version ", stderr); - rec_print(stderr, rec, offsets); + rec_print_new(stderr, rec, offsets); putc('\n', stderr); return(DB_ERROR); } @@ -1353,12 +1353,10 @@ trx_undo_prev_version_build( ut_print_buf(stderr, undo_rec, 150); fputs("\n" "InnoDB: index record ", stderr); - index_offsets = rec_get_offsets(index_rec, index, - ULINT_UNDEFINED, heap); - rec_print(stderr, index_rec, index_offsets); + rec_print(stderr, index_rec, index); fputs("\n" "InnoDB: record version ", stderr); - rec_print(stderr, rec, offsets); + rec_print_new(stderr, rec, offsets); fprintf(stderr, "\n" "InnoDB: Record trx id %lu %lu, update rec trx id %lu %lu\n" "InnoDB: Roll ptr in rec %lu %lu, in update rec %lu %lu\n", |