maria:bb-10.5-mdev-29447-31338

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

Branch merges

Branch information

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

Recent commits

d7b564d... 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.

0b61f4e... by Sergey Petrunia

Fix comment

bd076d4... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-31442 page_cleaner thread aborts while releasing the tablespace

- InnoDB shouldn't acquire the tablespace when it is being stopped
or closed

f7e9ac0... by Sergey Petrunia

MDEV-31449: Assertion s->table->opt_range_condition_rows <= s->found_records

Fix a typo in make_join_statistics(): when updating statistics for
derived table, set s->table->... not "table->..."

0e2e70c... by Sergey Petrunia

MDEV-31479: Inconsistency between MRR and SQL layer costs can cause poor query plan

(Same as
TODO-3938: best_access_path shows negative costs for mrr=on)

best_access_path() assumes that quick select cost includes
(quick->rows/TIME_FOR_COMPARE) as a cost of checking the attached
part of the WHERE condition.

It calls adjust_quick_cost() to subtract addition from quick's cost.

The problem was that DS-MRR cost formula didn't include this cost.
For very large tables, adjust_quick_cost() would produce a negative
cost which would cause assert in debug build or bad query plan choice
in release builds.

Approved-by: Monty <email address hidden>

841e905... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-31442 page_cleaner thread aborts while releasing the tablespace

After further I/O on a tablespace has been stopped
(for example due to DROP TABLE or an operation that
rebuilds a table), page cleaner thread tries to
flush the pending writes for the tablespace and
releases the tablespace reference even though it was not
acquired.

fil_space_t::flush(): Don't release the tablespace when it is
being stopped and closed

Thanks to Marko Mäkelä for suggesting this patch.

b307412... by Sergey Petrunia

MDEV-31380 post-fix: fix group_min_max.test with embedded and view-protocol

embedded doesn't have optimizer trace,
view-protocol doesn't work with long column names.

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

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