diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-10-04 16:50:39 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-10-04 16:50:39 +0300 |
commit | 806adaf5c2d3db39903b5e84ee8afa829284125b (patch) | |
tree | 128ee9f303d8261aa0b9180f5b59dd3e7334c45e | |
parent | 553d8175cb27167416b94efbeb936b5d6e50bbca (diff) | |
download | mariadb-git-806adaf5c2d3db39903b5e84ee8afa829284125b.tar.gz |
Pack PAGE_INSTANT to the LSB end of the PAGE_DIRECTION_B
-rw-r--r-- | storage/innobase/include/page0page.h | 4 | ||||
-rw-r--r-- | storage/innobase/include/page0page.ic | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index 00aaf733175..a5649d83ac0 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -82,8 +82,8 @@ ADD COLUMN. Instant ADD COLUMN will change FIL_PAGE_TYPE to FIL_PAGE_TYPE_INSTANT and initialize the PAGE_INSTANT field to the original number of fields in the clustered index (dict_index_t::n_core_fields). The most -significant 8 bits are in the first byte, and the least significant 2 -bits are stored in the most significant 2 bits of PAGE_DIRECTION_B. +significant bits are in the first byte, and the least significant 5 +bits are stored in the most significant 5 bits of PAGE_DIRECTION_B. These FIL_PAGE_TYPE_INSTANT and PAGE_INSTANT may be assigned even if instant ADD COLUMN was not committed. Changes to these page header fields diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 83de0a4fd54..ee908896050 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -1082,7 +1082,7 @@ byte page_ptr_get_direction(const byte* ptr) { ut_ad(page_offset(ptr) == PAGE_HEADER + PAGE_DIRECTION_B); - return *ptr & ((1U << 6) - 1); + return *ptr & ((1U << 3) - 1); } /** Set the PAGE_DIRECTION field. @@ -1095,7 +1095,7 @@ page_ptr_set_direction(byte* ptr, byte dir) ut_ad(page_offset(ptr) == PAGE_HEADER + PAGE_DIRECTION_B); ut_ad(dir >= PAGE_LEFT); ut_ad(dir <= PAGE_NO_DIRECTION); - *ptr = (*ptr & ~((1U << 6) - 1)) | dir; + *ptr = (*ptr & ~((1U << 3) - 1)) | dir; } /** Read the PAGE_INSTANT field. @@ -1110,7 +1110,7 @@ page_get_instant(const page_t* page) switch (fil_page_get_type(page)) { case FIL_PAGE_TYPE_INSTANT: ut_ad(page_get_direction(page) <= PAGE_NO_DIRECTION); - ut_ad(i >> 6); + ut_ad(i >> 3); break; case FIL_PAGE_INDEX: ut_ad(i <= PAGE_NO_DIRECTION || !page_is_comp(page)); @@ -1123,7 +1123,7 @@ page_get_instant(const page_t* page) break; } #endif /* UNIV_DEBUG */ - return(i >> 6); + return(i >> 3); } /** Assign the PAGE_INSTANT field. @@ -1136,10 +1136,10 @@ page_set_instant(page_t* page, unsigned n, mtr_t* mtr) { ut_ad(fil_page_get_type(page) == FIL_PAGE_TYPE_INSTANT); ut_ad(n > 0); - ut_ad(n < 1U << 10); + ut_ad(n < REC_MAX_N_FIELDS); uint16_t i = page_header_get_field(page, PAGE_INSTANT); ut_ad(i <= PAGE_NO_DIRECTION); - i |= n << 6; + i |= n << 3; mlog_write_ulint(PAGE_HEADER + PAGE_INSTANT + page, i, MLOG_2BYTES, mtr); } |