mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +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)
This commit is contained in:
parent
71c69f42cd
commit
5faaf74818
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