maria:bb-11.2-mdev-31117

Last commit made on 2023-08-23
Get this branch:
git clone -b bb-11.2-mdev-31117 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-11.2-mdev-31117
Repository:
lp:maria

Recent commits

b6a06de... by Yuchen Pei <email address hidden>

MDEV-31117 Fix spider connection info parsing

Spider connection string is a comma-separated parameter definitions,
where each definition is of the form "<param_title> <param_value>",
where <param_value> is quote delimited on both ends, with backslashes
acting as an escaping prefix.

Despite the simple syntax, the existing spider connection string
parser was poorly-written, complex, hard to reason and error-prone,
causing issues like the one described in MDEV-31117. For example it
treated param title the same way as param value when assigning, and
have nonsensical fields like delim_title_len and delim_title.

Thus as part of the bugfix, we clean up the spider comment connection
string parsing, including:

- Factoring out some code from the parsing function
- Simplify the struct `st_spider_param_string_parse`
- And any necessary changes caused by the above changes

73915d2... by Daniel Bartholomew <email address hidden>

bump the VERSION

8aa1a9e... by Nikita Malyavin

MDEV-31812 Add switch to old_mode to disable non-locking ALTER

Add LOCK_ALTER_TABE_COPY bit to old_mode. Disables online copy by default,
but still allows to force it with explicit lock=none

a1af525... by Nikita Malyavin

MDEV-31804 Assertion `thd->m_transaction_psi == __null' fails

... upon replicating online ALTER

When an online event is applied and slave_exec_mode is idempotent,
Write_rows_log_event::do_before_row_operations had reset
thd->lex->sql_command to SQLCOM_REPLACE.

This led to that a statement was detected as a row-type during binlogging,
and was logged as not standalone.

So the corresponding Gtid_log_event, when applied on replica, did not exit
early and created a new PSI transaction. Hence the difference with
non-online ALTER.

c373e6c... by Nikita Malyavin

Cleanup: make slave_exec_mode of its enum type and pack Log_event better

Pack these fields together:
event_owns_temp_buf
cache_type
slave_exec_mode
checksum_alg

Make them bitfields to fit a single 2-byte hole.

This saves 24 bytes per event.

SLAVE_EXEC_MODE_LAST_BIT is rewritten as

> SLAVE_EXEC_MODE_LAST= SLAVE_EXEC_MODE_IDEMPOTENT

to avoid a false-positive -Wbitfield-enum-conversion warning:
Bit-field 'slave_exec_mode' is not wide enough to store all enumerators of
'enum_slave_exec_mode'.

982b689... by Nikita Malyavin

MDEV-31838 Assertion fails upon replication online alter with MINIMAL row

Replica honors its own binlog_row_image value when it sets up read_set.
When a slave thread is applying replicated row events in parallel with the
running online alter, we need all columns to be read from the table
(for the online alter logged row event) not only those that were present in
the pre-image for the replicated row event.

Avoid shrinking the set when online alter is running, i.e. leave it all set

c4adaed... by Nikita Malyavin

MDEV-31781 ALTER TABLE ENGINE=s3 fails

s3 is read-only. No need to update to a read-only engine with LOCK=NONE.

30c965f... by Nikita Malyavin

MDEV-31777 ER_GET_ERRNO upon online alter on CONNECT table

Forbid Online for CONNECT.

44ca37e... by Nikita Malyavin

MDEV-31631 Adding auto-increment to table with history online misbehaves

Adding an auto_increment column online leads to an undefined behavior.
Basically any DEFAULTs that depend on a row order in the table, or on
the non-deterministic (in scope of the ALTER TABLE statement) function
is UB.

For example, NOW() is considered generally non-deterministic
(Item_func_now_utc is marked with VCOL_NON_DETERMINISTIC), but it's fixed
in scope of a single statement.

Same for any other function that depends only on the session/status vars
apart from its arguments.

Only two UB cases are known:
* adding new AUTO_INCREMENT column. Modifying the existing column may be
fine under certain circumstances, see MDEV-31058.
* adding new column with DEFAULT(nextval(...)). Modifying the existing
column is possible, since its value will be always present in the online
event, except for the NULL -> NOT NULL modification

e026a36... by Nikita Malyavin

MDEV-31776 Online ALTER reports the number of affected rows incorrectly

Add a new virtual function that will increase the inserted rows count
for the insert log event and decrease it for the delete event.

Reuses Rows_log_event::m_row_count on the replication side, which was only
set on the logging side.