maria:bb-10.6-MDEV-32523

Last commit made on 2023-10-22
Get this branch:
git clone -b bb-10.6-MDEV-32523 https://git.launchpad.net/maria

Branch merges

Branch information

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

Recent commits

c41ace8... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-32523 ASAN errors or assertion failure in row_merge_buf_add

innobase_build_col_map_add(): InnoDB wrongly copies the old field
record into default value even when new field length has been changed.

4941ac9... by Sergey Petrunia

MDEV-32113: utf8mb3_key_col=utf8mb4_value cannot be used for ref

(Variant#3: Allow cross-charset comparisons, use a special
CHARSET_INFO to create lookup keys. Review input addressed.)

Equalities that compare utf8mb{3,4}_general_ci strings, like:

  WHERE ... utf8mb3_key_col=utf8mb4_value (MB3-4-CMP)

can now be used to construct ref[const] access and also participate
in multiple-equalities.
This means that utf8mb3_key_col can be used for key-lookups when
compared with an utf8mb4 constant, field or expression using '=' or
'<=>' comparison operators.

This is controlled by optimizer_switch='cset_narrowing=on', which is
OFF by default.

IMPLEMENTATION
Item value comparison in (MB3-4-CMP) is done using utf8mb4_general_ci.
This is valid as any utf8mb3 value is also an utf8mb4 value.

When making index lookup value for utf8mb3_key_col, we do "Charset
Narrowing": characters that are in the Basic Multilingual Plane (=BMP) are
copied as-is, as they can be represented in utf8mb3. Characters that are
outside the BMP cannot be represented in utf8mb3 and are replaced
with U+FFFD, the "Replacement Character".

In utf8mb4_general_ci, the Replacement Character compares as equal to any
character that's not in BMP. Because of this, the constructed lookup value
will find all index records that would be considered equal by the original
condition (MB3-4-CMP).

Approved-by: Monty <email address hidden>

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

MDEV-32476 LeakSanitizer errors in get_quick_select or Assertion ...

Problem was that JOIN_TAB::cleanup() was not run because
JOIN::top_join_tab_count was not set in case of early errors.

Fixed by setting JOIN::tab_join_tab_count when JOIN_TAB's are allocated.

Something that should eventually be fixed:
- Cleaning up JOIN_TAB's is now done in 3 different loops.
  JOIN_TAB::cleanup() is only doing a partial cleanup. Other cleanups
  are done outside of JOIN_TAB::cleanup().

The above should be fixed so that JOIN_TAB::cleanup() is freeing
everything related to it's own memory, including all its sub JOIN_ TAB's.
JOIN::cleanup() should only loop over all it's top JOIN_TAB's and call
JOIN_TAB::cleanup() on these.
This will greatly simplify and speedup the current code (as we now do some
cleanup's twice).

a1b6bef... by Monty <email address hidden>

Fixed crash in is_stat_table() when using hash joins.

Other usage if persistent statistics is checking 'stats_is_read' in
caller, which is why this was not noticed earlier.

Other things:
- Simplified no_stat_values_provided

6991b1c... by Marko Mäkelä

Merge 10.5 into 10.6

85751ed... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-31851 After crash recovery, undo tablespace fails to open

srv_all_undo_tablespaces_open(): While opening the extra unused
undo tablespaces, InnoDB should use ULINT_UNDEFINED instead of
SRV_SPACE_ID_UPPER_BOUND.

dbba1bb... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-31851 After crash recovery, undo tablespace fails to open

recv_recovery_from_checkpoint_start(): InnoDB should add the
redo log block header + trailer size while checking the log
sequence number in log file with log sequence number in the
system tablespace first page.

2d6dc65... by Marko Mäkelä

MDEV-32144 fixup

In commit 384eb570a654261639dc1fc73c347f0d3759f567 the debug check
was relaxed in trx_undo_header_create(), not in the intended function
trx_undo_write_xid().

cfd1788... by Marko Mäkelä

MDEV-32511: Race condition between checkpoint and page write

fil_aio_callback(): Invoke fil_node_t::complete_write() before
releasing any page latch, so that in case a log checkpoint is
executed roughly concurrently with the first write into a file
since the previous checkpoint, we will not miss a fdatasync()
or fsync() call to make the write durable.

bf7c6fc... by Marko Mäkelä

MDEV-32511 Assertion !os_aio_pending_writes() failed

In MemorySanitizer builds of 10.10 and 10.11, we would rather often
have the assertion fail in innodb_init() during mariadb-backup --prepare.
The assertion could also fail during InnoDB startup, but less often.

Before commit 685d958e38b825ad9829be311f26729cccf37c46 in 10.8 the
log file cleanup after a successfully applied backup is different,
and the os_aio_pending_writes() assertion is in srv0start.cc.

IORequest::write_complete(): Invoke node->complete_write() before
releasing the page latch, so that a log checkpoint that is about to
execute concurrently will not miss a fdatasync() or fsync() on the
file, in case this was the first write since the last such call.

create_log_file(), srv_start(): Replace the debug assertion with
a debug check. For all intents and purposes, all writes could have
been completed but some write_io_callback() may not have invoked
io_slots::release() yet.