mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
InnoDB: Zero fill newly created pages and deleted records to
remove old junk and to improve compression ratio. InnoDB: Make implicit type conversions explicit. (Bug #8826) innobase/btr/btr0cur.c: Add "offsets" parameter to page_cur_delete_rec() calls btr_cur_optimistic_delete(): Simplify the logic with a flag variable btr_cur_pessimistic_delete(): Compute "offsets" earlier innobase/include/page0cur.h: page_cur_delete_rec(): Add parameter "offsets" innobase/include/page0page.h: page_mem_free(): Replace parameter "index" with "offsets" innobase/include/page0page.ic: page_mem_free(): Replace parameter "index" with "offsets". Clear the data bytes of the freed record. (The "extra" bytes will be needed by free space management.) innobase/include/rem0rec.h: Remove unnecessary function rec_get_size() innobase/log/log0recv.c: Remove function rec_apply_log_recs_for_backup() unless #ifdef UNIV_HOTBACKUP. innobase/page/page0cur.c: Add parameter "offsets" to page_cur_delete_rec(). innobase/page/page0page.c: page_create(): Zero fill the data area. page_delete_rec_list_start(): Add parameter "offsets" to page_cur_delete_rec(). innobase/rem/rem0rec.c: Remove unnecessary function rec_get_size(). Fix compiler warnings about implicit type conversions. (Bug #8826) innobase/srv/srv0srv.c: Fix compiler warnings about implicit type conversions. (Bug #8826) innobase/sync/sync0sync.c: Fix compiler warnings about implicit type conversions. (Bug #8826)
This commit is contained in:
parent
679088a2ae
commit
b9b69440c1
11 changed files with 85 additions and 77 deletions
|
|
@ -182,9 +182,10 @@ next record after the deleted one. */
|
|||
void
|
||||
page_cur_delete_rec(
|
||||
/*================*/
|
||||
page_cur_t* cursor, /* in: a page cursor */
|
||||
dict_index_t* index, /* in: record descriptor */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
page_cur_t* cursor, /* in: a page cursor */
|
||||
dict_index_t* index, /* in: record descriptor */
|
||||
const ulint* offsets,/* in: rec_get_offsets(cursor->rec, index) */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/********************************************************************
|
||||
Searches the right position for a page cursor. */
|
||||
UNIV_INLINE
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ page_mem_free(
|
|||
/*==========*/
|
||||
page_t* page, /* in: index page */
|
||||
rec_t* rec, /* in: pointer to the (origin of) record */
|
||||
dict_index_t* index); /* in: record descriptor */
|
||||
const ulint* offsets);/* in: array returned by rec_get_offsets() */
|
||||
/**************************************************************
|
||||
The index page creation function. */
|
||||
|
||||
|
|
|
|||
|
|
@ -777,20 +777,28 @@ page_mem_free(
|
|||
/*==========*/
|
||||
page_t* page, /* in: index page */
|
||||
rec_t* rec, /* in: pointer to the (origin of) record */
|
||||
dict_index_t* index) /* in: record descriptor */
|
||||
const ulint* offsets)/* in: array returned by rec_get_offsets() */
|
||||
{
|
||||
rec_t* free;
|
||||
ulint garbage;
|
||||
|
||||
ut_ad(rec_offs_validate(rec, NULL, offsets));
|
||||
free = page_header_get_ptr(page, PAGE_FREE);
|
||||
|
||||
page_rec_set_next(rec, free);
|
||||
page_header_set_ptr(page, PAGE_FREE, rec);
|
||||
|
||||
/* Clear the data bytes of the deleted record in order to improve
|
||||
the compression ratio of the page and to make it easier to read
|
||||
page dumps in corruption reports. The extra bytes of the record
|
||||
cannot be cleared, because page_mem_alloc() needs them in order
|
||||
to determine the size of the deleted record. */
|
||||
memset(rec, 0, rec_offs_data_size(offsets));
|
||||
|
||||
garbage = page_header_get_field(page, PAGE_GARBAGE);
|
||||
|
||||
page_header_set_field(page, PAGE_GARBAGE,
|
||||
garbage + rec_get_size(rec, index));
|
||||
garbage + rec_offs_size(offsets));
|
||||
}
|
||||
|
||||
#ifdef UNIV_MATERIALIZE
|
||||
|
|
|
|||
|
|
@ -435,15 +435,6 @@ rec_offs_size(
|
|||
/* out: size */
|
||||
const ulint* offsets);/* in: array returned by rec_get_offsets() */
|
||||
/**************************************************************
|
||||
Returns the total size of a physical record. */
|
||||
|
||||
ulint
|
||||
rec_get_size(
|
||||
/*=========*/
|
||||
/* out: size */
|
||||
rec_t* rec, /* in: physical record */
|
||||
dict_index_t* index); /* in: record descriptor */
|
||||
/**************************************************************
|
||||
Returns a pointer to the start of the record. */
|
||||
UNIV_INLINE
|
||||
byte*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue