diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-07-22 09:50:20 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-07-22 10:05:13 +0300 |
commit | 82d5994520c239da1b6edf1b24e08138ae0c753d (patch) | |
tree | 57960cba641e07952799a86eb5bed816064a128a /storage/innobase/row | |
parent | bf435a3f4daa90dd6b4b94ed62f05a8e30fecc3d (diff) | |
download | mariadb-git-82d5994520c239da1b6edf1b24e08138ae0c753d.tar.gz |
MDEV-26110: Do not rely on alignment on static allocation
It is implementation-defined whether alignment requirements
that are larger than std::max_align_t (typically 8 or 16 bytes)
will be honored by the compiler and linker.
It turns out that on IBM AIX, both alignas() and MY_ALIGNED()
only guarantees alignment up to 16 bytes.
For some data structures, specifying alignment to the CPU
cache line size (typically 64 or 128 bytes) is a mere performance
optimization, and we do not really care whether the requested
alignment is guaranteed.
But, for the correct operation of direct I/O, we do require that
the buffers be aligned at a block size boundary.
field_ref_zero: Define as a pointer, not an array.
For innochecksum, we can make this point to unaligned memory;
for anything else, we will allocate an aligned buffer from the heap.
This buffer will be used for overwriting freed data pages when
innodb_immediate_scrub_data_uncompressed=ON. And exactly that code
hit an assertion failure on AIX, in the test innodb.innodb_scrub.
log_sys.checkpoint_buf: Define as a pointer to aligned memory
that is allocated from heap.
log_t::file::write_header_durable(): Reuse log_sys.checkpoint_buf
instead of trying to allocate an aligned buffer from the stack.
Diffstat (limited to 'storage/innobase/row')
-rw-r--r-- | storage/innobase/row/row0ins.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 4b1926c0ec0..96cc3aa413e 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -3424,7 +3424,7 @@ row_ins_index_entry_set_vals( field->len = UNIV_SQL_NULL; field->type.prtype = DATA_BINARY_TYPE; } else { - ut_ad(col->len <= sizeof field_ref_zero); + ut_ad(col->len <= UNIV_PAGE_SIZE_MAX); ut_ad(ind_field->fixed_len <= col->len); dfield_set_data(field, field_ref_zero, ind_field->fixed_len); |