maria:bb-10.6-mdev-29447-31338

Last commit made on 2023-06-23
Get this branch:
git clone -b bb-10.6-mdev-29447-31338 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-mdev-29447-31338
Repository:
lp:maria

Recent commits

1ed20b9... by Yuchen Pei

MDEV-29447 MDEV-26285 MDEV-31338 Refactor spider_db_mbase_util::open_item_func

spider_db_mbase_util::open_item_func() is a monster function.
It is difficult to maintain while it is expected that we need to
modify it when a new SQL function or a new func_type is added.

We split the function into two distinct functions: one handles the
case of str != NULL and the other handles the case of str == NULL.

This refactoring was done in a conservative way because we do not
have comprehensive tests on the function.

It also fixes MDEV-29447 and MDEV-31338 where field items that are
arguments of a func item may be used before created / initialised.

Note this commit is adapted from a patch by Nayuta for MDEV-26285.

c2d44ec... by Brandon Nesterenko

MDEV-29894: Calling a function from a different database in a slave side trigger crashes

When opening and locking tables, if triggers will be invoked in a
separate database, thd->set_db() is invoked, thus freeeing the memory
and headers which thd->db had previously pointed to. In row based
replication, the event execution logic initializes thd->db to point
to the database which the event targets, which is owned by the
corresponding table share (introduced in d9898c9 for MDEV-7409).
The problem then, is that during the table opening and locking
process for a row event, memory which belongs to the table share
would be freed, which is not valid.

This patch replaces the thd->reset_db() calls to thd->set_db(),
which copies-by-value, rather than by reference. Then when the
memory is freed, our copy of memory is freed, rather than memory
which belongs to a table share.

Notes:
  1. The call to change thd->db now happens on a higher-level, in
Rows_log_event::do_apply_event() rather than ::do_exec_row(), in the
call stack. This is because do_exec_row() is called within a loop,
and each invocation would redundantly set and unset the db to the
same value.
  2. thd->set_db() is only used if triggers are to be invoked, as
there is no vulnerability in the non-trigger case, and copying
memory would be an unnecessary inefficiency.

Reviewed By:
============
Andrei Elkin <email address hidden>

8171f9d... by Tuukka Pasanen <email address hidden>

MDEV-31423: Make sure that datadir is available with SySV-init script

Commit fixes Debian SySV-init script fail:
  /etc/init.d/mariadb: line 90: [: : integer expression expected
which happens if datadir is not changed in configuration which
makes it invisible when printing MariaDB config defaults.

Commit makes sure that there is some value if nothing else if in hand
use default /usr/lib/mysql or fail with correct error message if
directory is not present

bf0a54d... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-31416 ASAN errors in dict_v_col_t::detach upon adding key to virtual column

- InnoDB throws ASAN error while adding the index on virtual column
of system versioned table. InnoDB wrongly assumes that virtual
column collation type changes, creates new column with different
character set. This leads to failure while detaching the column
from indexes.

80585c9... by Marko Mäkelä

Merge 10.5 into 10.6

d3eefba... by Marko Mäkelä

MDEV-31355 fixup: Adjust one more test

The test gcol.gcol_purge would reliably hang on 10.6 on a
Microsoft Windows builder without this adjustment.
A similar adjustment was applied in
commit 3e40f9a7f3bbe82d96c8acccbb017deebfa00647
to the tests innodb.dml_purge and innodb.instant_alter_purge.

21031b2... by Marko Mäkelä

Suppress an occasional buffer pool warning

6882eea... by Marko Mäkelä

MDEV-30483 fixup: Declare the test plugin for Debian

c25b496... by Marko Mäkelä

MDEV-31382 SET GLOBAL innodb_undo_log_truncate=ON has no effect on logically empty undo logs

innodb_undo_log_truncate_update(): A callback function. If
SET GLOBAL innodb_undo_log_truncate=ON, invoke
srv_wake_purge_thread_if_not_active().

srv_wake_purge_thread_if_not_active(): If innodb_undo_log_truncate=ON,
always wake up the purge subsystem.

srv_do_purge(): If the history is empty, invoke
trx_purge_truncate_history() in order to free undo log pages.

trx_purge_truncate_history(): If head.trx_no==0, consider the
cached undo logs to be free.

trx_purge(): Remove the parameter "bool truncate" and let the
caller invoke trx_purge_truncate_history() directly.

Reviewed by: Vladislav Lesin

3e40f9a... by Marko Mäkelä

MDEV-31355 innodb_undo_log_truncate=ON fails to wait for purge of enough transaction history

purge_sys_t::sees(): Wrapper for view.sees().

trx_purge_truncate_history(): Invoke purge_sys.sees() instead of
comparing to head.trx_no, to determine if undo pages can be safely freed.

The test innodb.cursor-restore-locking was adjusted by Vladislav Lesin,
as was the the debug instrumentation in row_purge_del_mark().

Reviewed by: Vladislav Lesin