maria:bb-10.5-mdev-30435-30981

Last commit made on 2023-06-07
Get this branch:
git clone -b bb-10.5-mdev-30435-30981 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.5-mdev-30435-30981
Repository:
lp:maria

Recent commits

3b2d1d1... by Yuchen Pei

MDEV-30435 MDEV-30981 Fix ubsan errors w.r.t. memcpy in spd_trx.cc

Extract the indexed string memcopy pattern in spd_trx.cc to a static
inline function.

Also updated the ubsan check in mdev_26541.test (h/t roel).

bb9da13... by Marko Mäkelä

MDEV-31373 innodb_undo_log_truncate=ON recovery results in a corrupted undo log

recv_sys_t::apply(): When applying an undo log truncation operation,
invoke os_file_truncate() on space->recv_size, which must not be
less than the original truncated file size.

Alternatively, as pointed out by Thirunarayanan Balathandayuthapani,
we could assign space->size = t.pages, so that
fil_system_t::extend_to_recv_size() would extend the file back
to space->recv_size.

3aea77e... by Marko Mäkelä

MDEV-31347 fil_ibd_create() may hijack the file handle of an old file

fil_space_t::add(): If a file handle was passed, invoke
fil_node_t::find_metadata() before releasing fil_system.mutex.
The call was moved from fil_ibd_create().

This is a 10.5 version of commit e3b06156c6ecd5d3fd4376ee025df1ab45311a6d
from 10.6.

383105d... by Marko Mäkelä

Merge bb-10.5-release into 10.5

c5cf94b... by Marko Mäkelä

MDEV-31234 fixup: Free some UNDO pages earlier

trx_purge_truncate_rseg_history(): Add a parameter to specify if
the entire rollback segment is safe to be freed. If not, we may
still be able to invoke trx_undo_truncate_start() and free some pages.

9c35f9c... by Marko Mäkelä

MDEV-31234 fixup: Allow innodb_undo_log_truncate=ON after upgrade

trx_purge_truncate_history(): Relax a condition that would prevent
undo log truncation if the undo log tablespaces were "contaminated"
by the bug that commit e0084b9d315f10e3ceb578b65e144d751b208bf1 fixed.
That is, trx_purge_truncate_rseg_history() would have invoked
flst_remove() on TRX_RSEG_HISTORY but not reduced TRX_RSEG_HISTORY_SIZE.

To avoid any regression with normal operation, we implement this
fixup during slow shutdown only. The condition on the history list
being empty is necessary: without it, in the test
innodb.undo_truncate_recover there may be much fewer than the
expected 90,000 calls to row_purge() before the truncation.
That is, we would truncate the undo tablespace before actually having
processed all undo log records in it.

To truncate such "contaminated" or "bloated" undo log tablespaces
(when using innodb_undo_tablespaces=2 or more)
you can execute the following SQL:

BEGIN;INSERT mysql.innodb_table_stats VALUES('','',DEFAULT,0,0,0);ROLLBACK;
SET GLOBAL innodb_undo_log_truncate=ON, innodb_fast_shutdown=0;
SHUTDOWN;

The first line creates a dummy InnoDB transaction, to ensure that there
will be some history to be purged during shutdown and that the undo
tablespaces will be truncated.

a7adfd4... by Monty <email address hidden>

Optimized version of safe_strcpy()

Note: We should replace most case of safe_strcpy() with strmake() to avoid
the not needed zerofill.

92d2cea... by Monty <email address hidden>

MDEV-28285 Unexpected result when combining DISTINCT, subselect and LIMIT

The problem was that when JOIN_TAB::remove_duplicates() noticed there
can only be one possible row in the output, it adjusted limits but
didn't take into account any possible offset.

Fixed by not adjusting limit offset when setting one-row-limit.

cd37e49... by Monty <email address hidden>

MDEV-31083 ASAN use-after-poison in myrg_attach_children

The reason for ASAN report was that the MERGE and MYISAM file
had different key definitions, which is not allowed.

Fixed by ensuring that the MERGE code is not copying more key stats
than what is in the MyISAM file.

Other things:
- Give an error if different MyISAM files has different number of
  key parts.

c7e04af... by Monty <email address hidden>

Update main.selectivity test and results