maria:bb-10.6-MDEV-32682

Last commit made on 2023-11-07
Get this branch:
git clone -b bb-10.6-MDEV-32682 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-MDEV-32682
Repository:
lp:maria

Recent commits

8e4775b... by Sergey Petrunia

MDEV-32682: Assertion `range->rows >= s->found_records' failed in best_access_path

Fix the issue introduced in ec2574fd8f, fix for MDEV-31983:

get_quick_record_count() must set quick_count=0 when it got
IMPOSSIBLE_RANGE from test_quick_select.

Failure to do so will cause an assertion in 11.0, when the number of
quick select rows (0) is checked to be lower than the number of
found_records (which is capped up to 1).

b52b7b4... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-31851 Doublewrite recovery fixup

recv_dblwr_t::find_page(): Tablespace flags validity should be
checked only for page 0.

1fc2843... by Marko Mäkelä

MDEV-31826: File handle leak on failed IMPORT TABLESPACE

fil_space_t::drop(): If the caller is not interested in a
detached handle, close it immediately.

90e1148... by Sergei Golubchik

update C/C - compilation failure with gcc7 on s390x-sles-12

0cc809f... by Marko Mäkelä

MDEV-31826: Memory leak on failed IMPORT TABLESPACE

fil_delete_tablespace(): Invoke fil_space_free_low() directly.
This fixes up commit 39e3ca8bd25fc539ed08ff464e8a3189ff9f7fa3

6f09143... by Monty <email address hidden>

MDEV-32531 MSAN / Valgrind errors in Item_func_like::get_mm_leaf with temporal field

Added missing initializer

ab6139d... by Rex Johnston

MDEV-32612 Assertion `tab->select->quick' failed in test_if_skip_sort_order

Fixup for MDEV-31983, incorrect test for checking ability to use quick select.

Approved by Sergei Petrunia

5b53342... by Marko Mäkelä

MDEV-32588 InnoDB may hang when running out of buffer pool

buf_flush_LRU_list_batch(): Do not skip pages that are actually clean
but in buf_pool.flush_list due to the "lazy removal" optimization of
commit 22b62edaedddb1cabd5b855cdd39a5e90a5695a2, but try to evict them.
After acquiring buf_pool.flush_list_mutex, reread oldest_modification
to ensure that the block still remains in buf_pool.flush_list.

In addition to server hangs, this bug could also cause
InnoDB: Failing assertion: list.count > 0
in invocations of UT_LIST_REMOVE(flush_list, ...).

This fixes a regression that was caused by
commit a55b951e6082a4ce9a1f2ed5ee176ea7dbbaf1f2
and possibly made more likely to hit due to
commit aa719b5010c929132b4460b78113fbd07497d9c8.

39e3ca8... by Marko Mäkelä

MDEV-31826 InnoDB may fail to recover after being killed in fil_delete_tablespace()

InnoDB was violating the write-ahead-logging protocol when a file
was being deleted, like this:

1. fil_delete_tablespace() set the fil_space_t::STOPPING flag
2. The buf_flush_page_cleaner() thread discards some changed pages for
this tablespace advances the log checkpoint a little.
3. The server process is killed before fil_delete_tablespace() wrote
a FILE_DELETE record.
4. Recovery will try to apply log to pages of the tablespace, because
there was no FILE_DELETE record. This will fail, because some pages
that had been modified since the latest checkpoint had not been written
by the page cleaner.

Page writes must not be stopped before a FILE_DELETE record has been
durably written.

fil_space_t::drop(): Replaces fil_space_t::check_pending_operations().
Add the parameter detached_handle, and return a tablespace pointer
if this thread was the first one to stop I/O on the tablespace.

mtr_t::commit_file(): Remove the parameter detached_handle, and
move some handling to fil_space_t::drop().

fil_space_t: STOPPING_READS, STOPPING_WRITES: Separate flags for STOPPING.
We want to stop reads (and encryption) before stopping page writes.

fil_space_t::is_stopping_writes(), fil_space_t::get_for_write():
Special accessors for the write path.

fil_space_t::flush_low(): Ignore the STOPPING_READS flag and only
stop if STOPPING_WRITES is set, to avoid an infinite loop in
fil_flush_file_spaces(), which was occasionally repeated by
running the test encryption.create_or_replace.

Reviewed by: Vladislav Lesin
Tested by: Matthias Leich

ec2574f... by Rex Johnston

MDEV-31983 jointable materialization subquery optimization ignoring

...errors, then failing ASSERT.

UPDATE queries treat warnings as errors. In this case, an invalid
condition "datetime_key_col >= '2012-01'" caused warning-as-error inside
SQL_SELECT::test_quick_select().

The code that called test_quick_select() ignored this error and continued
join optimization. Then it eventually reached a thd->is_error() check
and failed to setup SJ-Materialization which failed an assert.

Fixed this by making SQL_SELECT::test_quick_select() return error in
its return value, and making any code that calls it to check for error
condition and abort the query if the error is returned.

Places in the code that didn't check for errors from
SQL_SELECT::test_quick_select but now do:
- get_quick_record_count() call in make_join_statistics(),
- test_if_skip_sort_order(),
- "Range checked for each record" code.

Extra error handling fixes and commit text wording by Sergei Petrunia,

Reviewed-by: Sergei Petrunia, Oleg Smirnov