Commit graph

77797 commits

Author SHA1 Message Date
Dave Gosselin
34a909806c MDEV-35765 ST_OVERLAPS wrong result when dim(geom1) <> dim(geom2)
Validates that the two geometries passed to ST_OVERLAPS have the
same number of dimensions.
2025-01-23 15:39:00 -05:00
Marko Mäkelä
d4da659b43 MDEV-35854: Simplify dict_get_referenced_table()
innodb_convert_name(): Convert a schema or table name to
my_charset_filename compatible format.

dict_table_lookup(): Replaces dict_get_referenced_table().
Make the callers responsible for invoking innodb_convert_name().

innobase_casedn_str(): Remove. Let us invoke my_casedn_str() directly.

dict_table_rename_in_cache(): Do not duplicate a call to
dict_mem_foreign_table_name_lookup_set().

innobase_convert_to_filename_charset(): Defined static in the only
compilation unit that needs it.

dict_scan_id(): Remove the constant parameters
table_id=FALSE, accept_also_dot=TRUE. Invoke strconvert() directly.

innobase_convert_from_id(): Remove; only called from dict_scan_id().

innobase_convert_from_table_id(): Remove (dead code).

table_name_t::dblen(), table_name_t::basename(): In non-debug builds,
tolerate names that may miss a '/' separator.

Reviewed by: Debarun Banerjee
2025-01-23 14:38:08 +02:00
Marko Mäkelä
98dbe3bfaf Merge 10.5 into 10.6 2025-01-20 09:57:37 +02:00
ParadoxV5
cbb24d9aa5 MDEV-35646: Limit pseudo_thread_id to UINT32_MAX
Although the `my_thread_id` type is 64 bits, binlog format specs
limits it to 32 bits in practice. (See also: MDEV-35706)

The writable SQL variable `pseudo_thread_id` didn’t realize this though
and had a range of `ULONGLONG_MAX` (at least `UINT64_MAX` in C/C++).
It consequentially accepted larger values silently, but only the lower
32 bits of whom gets binlogged; this could lead to inconsistency.

Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
2025-01-18 17:27:54 -07:00
Sergei Golubchik
782c4b94f0 MDEV-25654 only force HA_KEY_ALG_HASH for fast alter partition
not for any ALTER TABLE without ALTER_CHANGE_COLUMN.

This fixes galera_sr.MDEV-28971 test

followup for 0dcd30197a
2025-01-18 15:11:12 +01:00
Sergei Golubchik
b87c1b06dc MDEV-29968 update test results
followup for 350cc77fee
2025-01-18 08:10:49 +01:00
Sergei Golubchik
a69da0c31e MDEV-19761 Before Trigger not processed for Not Null Columns if no explicit value and no DEFAULT
it's incorrect to zero out table->triggers->extra_null_bitmap
before a statement, because if insert uses an explicit field list
and omits a field that has no default value, the field should
get NULL implicitly. So extra_null_bitmap should have 1s for all
fields that have no defaults

* create extra_null_bitmap_init and initialize it as above
* copy extra_null_bitmap_init to extra_null_bitmap for inserts
* still zero out extra_null_bitmap for updates/deletes where
  all fields definitely have a value
* make not_null_fields_have_null_values() to send
  ER_NO_DEFAULT_FOR_FIELD for fields with no default and no value,
  otherwise creation of a trigger with an empty body would change the
  error message
2025-01-17 23:42:56 +01:00
Alexander Barkov
350cc77fee MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
Item:print_for_table_def() uses QT_TO_SYSTEM_CHARSET to print
the DEFAULT expression into FRM file during CREATE TABLE.
Therefore, the expression is encoded in utf8 in FRM.

get_field_default_value() erroneously used field->charset() to
print the DEFAULT expression at SHOW CREATE TABLE time.

Fixing get_field_default_value() to use &my_charset_utf8mb4_general_ci instead.
This makes DEFAULT work in the way way with:

- virtual column expressions:

    if (field->vcol_info)
    {
      StringBuffer<MAX_FIELD_WIDTH> str(&my_charset_utf8mb4_general_ci);
      field->vcol_info->print(&str);

- check constraint expressions:

    if (field->check_constraint)
    {
      StringBuffer<MAX_FIELD_WIDTH> str(&my_charset_utf8mb4_general_ci);
      field->check_constraint->print(&str);

Additional cleanup:
Fixing system_charset_info to &my_charset_utf8mb4_general_ci in a few
places to make non-BMP characters work in DEFAULT, virtual column,
check constraint expressions.
2025-01-17 15:39:55 +04:00
Marko Mäkelä
f521b8ac21 MDEV-35723: applying non-zero offset to null pointer in INSERT
row_mysql_read_blob_ref(): Correctly handle what Field_blob::store()
generates for length=0.
2025-01-17 12:34:03 +02:00
Alexander Barkov
c69fb1a627 MDEV-35864 UBSAN: "applying zero offset to null pointer" when using a Field_set with empty values
The val_buffer variable can come to Field_set::val_str()
with the Ptr member equal to nullptr. This caused UBSAN errors
"applying zero offset to null pointer" in my_strnncollsp_simple()
and other strnncollsp() virtual implementations. Fixing the code to
make sure its Ptr is not equal to nullptr.
2025-01-17 14:05:48 +04:00
Vladislav Vaintroub
df602ff7fa Fix main.stack on Windows
A part of the test, that tests that a frame of recursive SP takes the
same amount of stack, relies on the fact that 3 calls to that
SP are executed in the same OS thread. This is not guaranteed with
threadpool(not with Windows native threadpool, anyway)

Fix the test to execute SP calls in the same thread, as semicolon-separated
batched command.
2025-01-16 23:04:59 +01:00
Thirunarayanan Balathandayuthapani
a6ab0e6c0b MDEV-34898 Doublewrite recovery of innodb_checksum_algorithm=full_crc32 encrypted pages does not work
- Use file_key_management encryption plugin instead of
example_key_management_plugin for the encryption.doublewrite_debug
test case
2025-01-16 18:14:49 +05:30
Marko Mäkelä
b82abc7163 MDEV-35701 trx_t::autoinc_locks causes unnecessary dynamic memory allocation
trx_t::autoinc_locks: Use small_vector<lock_t*,4> in order to avoid any
dynamic memory allocation in the most common case (a statement is
holding AUTO_INCREMENT locks on at most 4 tables or partitions).

lock_cancel_waiting_and_release(): Instead of removing elements from
the middle, simply assign nullptr, like lock_table_remove_autoinc_lock().

The added test innodb.auto_increment_lock_mode covers the dynamic memory
allocation as well as nondeterministically (occasionally) covers
the out-of-order lock release in lock_table_remove_autoinc_lock().

Reviewed by: Debarun Banerjee
2025-01-15 16:55:01 +02:00
Sergei Petrunia
a5174aaffb MDEV-35828: Assertion fails in alloc_root() when memory causes it to call itself
(Variant 2: use stack for buffers)
my_malloc_size_cb_func() has a call to thd->alloc() to produce an error message.
thd->alloc() calls alloc_root(), so one can end up with this stack trace:

  alloc_root()
  THD::alloc()
  my_malloc_size_cb_func()
  my_malloc()
  alloc_root()

where alloc_root() calls itself. This is a problem, as alloc_root() is not
reenterable.

Fixed this by switching my_malloc_size_cb_func() to use space on the stack
instead.
2025-01-15 12:34:25 +02:00
Aleksey Midenkov
0fa1a7cc6a MDEV-28130 MariaDB SEGV issue at tree_search_next
In case of error last_pos points to null_element and there is no any
other children. tree_search_next() walks the children from last_pos
until the leaves (null_element) ignoring the case the topmost parent
in search state is the leaf itself.
2025-01-14 18:56:14 +03:00
Aleksey Midenkov
ab90eaad79 MDEV-22695 Server crashes in heap_rnext upon DELETE from a HEAP table
Quick read record uses different handler (H1) for finding records. It
cannot use ha_delete_row() handler (H2) as it is different search
mode: inited == INDEX for H1, inited == RND for H2. So, read handler
H1 uses index while write handler H2 uses random access.

For going next record in H1 there is info->last_pos optimization for
stepping index via tree_search_next(). This optimization can work with
deleted rows only if delete is conducted in the same handler, there
is:

67      int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
68                         const uchar *record, uchar *recpos, int flag)
69      {
...
74        if (flag)
75          info->last_pos= NULL; /* For heap_rnext/heap_rprev */

But this cannot work for different handler. So, last_pos in H1 after
delete in H2 contains stale info->parents array and last_pos points
into that parents. In the specific test case last_pos' parent is
already freed node and tree_search_next() steps into it.

The fix invalidates local savings of info->parents and info->last_pos
based on key_version. Record deletion increments share->key_version in
H2, so in H1 we know the tree might be changed.

Another good measure would be to use H1 for delete. But this is bigger
refactoring than just bug fixing.
2025-01-14 18:56:13 +03:00
Aleksey Midenkov
4a58d1085d MDEV-35612 EXCHANGE PARTITION does not work for tables with unique blobs
mysql_compare_tables() failed because of no long hash index generated
fields in prepared tmp_create_info. In comparison we should skip these
fields in the original table by:

  1. skipping INVISIBLE_SYSTEM fields;

  2. getting key_info from table->s instead of table as TABLE_SHARE
     contains unwrapped key_info.
2025-01-14 18:56:13 +03:00
Aleksey Midenkov
78c192644c MDEV-35343 unexpected replace behaviour when long unique index on
system versioned table

For versioned table REPLACE first tries to insert a row, if it gets
duplicate key error and optimization is possible it does UPDATE +
INSERT history. If optimization is not possible it goes normal branch
for UPDATE to history and repeats the cycle of INSERT.

The failure was in normal branch when we tried UPDATE to history but
such history already exists from previous cycles. There is no such
failures in optimized branch because vers_insert_history_row() already
ignores duplicates.

The fix ignores duplicate errors for UPDATE to history and does DELETE
instead.
2025-01-14 18:56:13 +03:00
Aleksey Midenkov
0dcd30197a MDEV-25654 Unexpected ER_CRASHED_ON_USAGE and Assertion
`limit >= trx_id' failed in purge_node_t::skip

For fast alter partition ALTER lost hash fields in frm field
count. mysql_prepare_create_table() did not call add_hash_field()
because the logic of ALTER-ing field types implies automatic
promotion/demotion to/from hash index. So we don't pass hash algorithm
to mysql_prepare_create_table() and let it decide itself, but it
cannot decide it correctly for fast alter partition.

So now mysql_prepare_alter_table() is a bit more sophisticated on what
to pass in the algorithm. If not changed any fields it will force
mysql_prepare_create_table() to re-add hash fields by setting
HA_KEY_ALG_HASH.

The problem with the original logic is mysql_prepare_alter_table()
does not care 100% about hash property so the decision is blurred
between mysql_prepare_alter_table() and mysql_prepare_create_table().
2025-01-14 18:56:13 +03:00
Aleksey Midenkov
0cf2176b79 MDEV-34033 Exchange partition with virtual columns fails
MDEV-28127 did is_equal() which compared vcol expressions
literally. But another table vcol expression is not equal because of
different table name.

We implement another comparison method is_identical() which respects
different table name in vcol comparison. If any field item points to
table_A and compared field item points to table_B, such items are
treated as equal in (table_A, table_B) comparison. This is done by
cloning table_B expression and renaming any table_B entries to table_A
in it.
2025-01-14 18:56:13 +03:00
Aleksey Midenkov
92383f8db1 MDEV-26891 Segfault in Field::register_field_in_read_map upon INSERT
DELAYED with virtual columns

Segfault was cause by two different copies of same Field instance in
prepared delayed insert. One was made by
Delayed_insert::get_local_table() (see make_new_field()). That copy
went through parse_vcol_defs() and received new vcol_info->expr.

Another one was made by copy_keys_from_share() by this code:

        /*
          We are using only a prefix of the column as a key:
          Create a new field for the key part that matches the index
        */
        field= key_part->field=field->make_new_field(root, outparam, 0);
        field->field_length= key_part->length;

So, key_part and table got different objects of same field and the
crash was because key_part->field->vcol_info->expr is NULL.

The fix does update_keypart_vcol_info() to update vcol_info->expr in
key_part->field.

Cleanup: memdup_vcol() is static inline instead of macro + check OOM.
2025-01-14 18:56:13 +03:00
Denis Protivensky
901c6c7ab6 MDEV-33064: Sync trx->wsrep state from THD on trx start
InnoDB transactions may be reused after committed:
- when taken from the transaction pool
- during a DDL operation execution

In this case wsrep flag on trx object is cleared, which may cause wrong
execution logic afterwards (wsrep-related hooks are not run).

Make trx->wsrep flag initialize from THD object only once on InnoDB transaction
start and don't change it throughout the transaction's lifetime.
The flag is reset at commit time as before.

Unconditionally set wsrep=OFF for THD objects that represent InnoDB background
threads.

Make Wsrep_schema::store_view() operate in its own transaction.

Fix streaming replication transactions' fragments rollback to not switch
THD->wsrep value during transaction's execution
(use THD->wsrep_ignore_table as a workaround).

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-14 02:17:22 +01:00
Brandon Nesterenko
d8c841d0d4 MDEV-35096: History is stored in different partitions on different nodes when using SYSTEM VERSION
Row-injection updates don’t correctly set the historical partition
for tables with system versioning and system_time partitions. This
results in inconsistencies between the master and slave when
replicating transactions that target such tables (i.e. the primary
server would correctly distribute archived rows amongst its
partitions, whereas the replica would have all archived rows in a
single partition). The function
partition_info::vers_set_hist_part(THD*) is used to set the
partition; however, its initial check for
vers_require_hist_part(THD*) returns false, bypassing the rest of
the function (which sets up the partition to use). This is because
the actual check uses the LEX sql_command (via
LEX::vers_history_generating()) to determine if the command is valid
to generate history. Row injections don’t have sql_commands though.

This patch provides a fix which extends the check in
vers_history_generating() to additionally allow row injections to be
history generating (via the function LEX::is_stmt_row_injection()).

Special thanks to Jan Lindstrom <jan.lindstrom@galeracluster.com>
for his work in reproducing the bug, and providing an initial test
case.

Reviewed By
============
Kristian Nielsen <knielsen@knielsen-hq.org>
Aleksey Midenkov <midenok@mariadb.com>
2025-01-13 15:59:07 -07:00
Jan Lindström
133e26fd7d MDEV-34924 : gtid_slave_pos table neven been deleted on non replica nodes (wsrep_gtid_mode = 1)
Problem was caused by MDEV-31413 commit 277968aa where
mysql.gtid_slave_pos table was replicated by Galera.
However, as not all nodes in Galera cluster are replica
nodes, rows were not deleted from table.

In this fix this is corrected so that mysql.gtid_slave_pos
table is not replicated by Galera. Instead when Galera
node receives GTID event and wsrep_gtid_mode=1, this event
is stored to mysql.gtid_slave_pos table.

Added test case galera_2primary_replica for 2 async
primaries replicating to galera cluster.

Added test case galera_circular_replication where
async primary replicates to galera cluster and
one of the galera cluster nodes is master
to async replica.

Modified test case galera_restart_replica to monitor
gtid positions and rows in mysql.gtid_pos_table.
2025-01-13 19:14:26 +01:00
Marko Mäkelä
fe2f237768 MDEV-35808 Test case to handle undo tablespace truncation in Mariabackup
This is the test case from commit 46aaf328ce
(MDEV-35830) to cover backup_undo_trunc() in the regression tests of
earlier major versions of mariadb-backup.
2025-01-13 17:43:58 +02:00
Alexander Barkov
1327f40f96 MDEV-35596 Assertion `type_handler()->result_type() ==
value.type_handler()->result_type()' failed in
virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t)

Adding mtr tests forgotten in the previous commit.
2025-01-13 17:51:51 +04:00
Yuchen Pei
f862fe8b2b
MDEV-35641 bring call to use_all_columns() forward when reading from mysql.servers
TABLE::use_all_columns turn on all bits of read_set, which is
interpreted by innodb as a request to read all columns. Without doing
so before calling init_read_record(), innodb will not retrieve any
columns if mysql.servers table has been altered to use innodb as the
engine, and any foreign servers stored in the table are "lost".
2025-01-13 11:56:19 +11:00
Xiaochuan Cui
6e86fe0063 MDEV-35528: mariadb-binlog cannot process more than 1 logfiles when --stop-datetime is specified
Fix regression introduced by commits 9588526 which attempted to address
MDEV-27037. With the regression, mariadb-binlog cannot process multiple
log files when --stop-datetime is specified.

The change is to keep recording timestamp of last processed event, and
after all log files are processed, if the last recorded timestamp has not
reached specified --stop-datetime, it will emit a warning. This applies
when processing local log files, or log files from remote servers.

All new code of the whole pull request, including one or several files that are
either new files or modified ones, are contributed under the BSD-new license. I
am contributing on behalf of my employer Amazon Web Services, Inc.

Co-authored-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
2025-01-12 11:03:10 -07:00
Sergei Golubchik
addc828363 Merge branch '10.5' into 10.6 2025-01-09 10:15:53 +01:00
Sergei Golubchik
90bd638159 32-bit rdiff fixes 2025-01-09 10:00:36 +01:00
Sergei Golubchik
c478b1ba08 MDEV-35598 foreign key error is unnecessary truncated
truncate it at 512 bytes (max allowed by the protocol), not 192
2025-01-09 10:00:36 +01:00
Sergei Golubchik
d26b47dfd4 MDEV-35550 main.log_slow test failure: expects count(*) 5 got 4
when testing MDEV-34539 create a table specifically for the test,
don't use a system table as a shortcut to save a couple of lines.

followup for 8d813f080b
2025-01-09 10:00:36 +01:00
Sergei Golubchik
deb20fb751 MDEV-32919 Cannot select particular field from IS.tables in case table needs upgrade from MySQL 5.7
use the same condition in
fill_schema_table_from_frm() when open_table_from_share() fails, as in
fill_schema_table_from_frm() when tdc_aquire_share() fails and as in
fill_schema_table_from_open() when open_table_from_share() fails
2025-01-09 10:00:36 +01:00
Sergei Golubchik
a0e5dd5433 mysqltest: fix --sorted_results
only sort actual results not warnings or metadata
also work for vertical results
warnings are sorted separately
2025-01-09 10:00:36 +01:00
Sergei Golubchik
b79723ffe3 MDEV-35384 Table performance_schema.session_status and other two tables are not shown in information_schema.tables for normal users
get_all_tables() skipped tables if the user has no privileges on
the schema itself and no granted privilege on any tables in the schema.

that is, it was skipping performance_schema tables (privileges
on them aren't explicitly granted, but internally hard-coded)

To fix:

* extend ACL_internal_table_access::check() method with
  `bool any_combination_will_do`
* fix all perfschema privilege checks to take it into account.
* don't reuse table_acl_check object for all tables, initialize it
  for every table otherwise GRANT_INTERNAL_INFO will leak
* remove incorrect privilege check from get_all_tables()
2025-01-09 10:00:35 +01:00
Sergei Golubchik
0706c01b88 cleanup: innodb.innodb_information_schema
don't disable query/result log unless the output is unstable.

and even then don't, but replace away unstable parts.
2025-01-09 10:00:35 +01:00
Sergei Golubchik
725b5e7794 MDEV-35335 implicit commit at START TRANSACTION doesn't reset characteristics 2025-01-09 10:00:35 +01:00
Oleg Smirnov
505b7127c9 MDEV-32411 Item_sum arguments incorrectly reset to temp table fields which causes crash
The issue is caused by a logic error in Item_sum::get_tmp_table_item() method:
it resets arguments of the item to point to the result fields during
change_ref_to_tmp_fields() call. However, Item_sum arguments must not be modified.
It is enough for Item_sum objects to call ancestor's implementation
Item::get_tmp_table_item().

This fix is in accordance with MySQL commit 2e3dc09087c24798c90e05163ed3d931f6b93db3

Reviewer: Oleksandr Byelkin <sanja@mariadb.com>
2025-01-09 11:35:09 +07:00
Marko Mäkelä
6d4841ae26 MDEV-35647 Possible hang during CREATE TABLE…SELECT error handling
ha_innobase::delete_table(): Clear trx->dict_operation_lock_mode
after, not before invoking trx->rollback(), so that
row_undo_mod_parse_undo_rec() will be invoked with dict_locked=true
and dict_sys_t::freeze() will not be invoked for loading a table
definition. Inside dict_sys_t::freeze(), an assertion !have_any()
would fail when the current thread is already holding the latch.

This fixes up commit c5fd9aa562 (MDEV-25919).

Reviewed by: Debarun Banerjee
2025-01-08 13:29:16 +02:00
Marko Mäkelä
b251cb6a4f Merge 10.5 into 10.6 2025-01-08 08:48:21 +02:00
Sergei Golubchik
3bf8b60caf clarify the message when filesort is aborted by LIMIT ROWS EXAMINED 2025-01-07 16:31:39 +01:00
Sergei Golubchik
9508a44c37 enforce no trailing \n in Diagnostic_area messages
that is in my_error(), push_warning(), etc
2025-01-07 16:31:39 +01:00
Sergei Golubchik
9f9072c344 MDEV-34733 main.mysqld--help-aria test failure: feedback plugin: failed to retrieve the MAC address
* replace the message away in the test result
* remove "feedback plugin:" prefix, it's a server message, not plugin's
* downgrade to the warning, because
   1) it's not a failure, no operation was aborted, server still works
   2) it's something actionable, so not a [Note] either
2025-01-07 16:31:39 +01:00
Sergei Golubchik
828b928fce MDEV-35651 NO_UNSIGNED_SUBTRACTION does not work for multiple unsigned integers
restore correct unsigned-unsigned logic

followup for 031f11717d
2025-01-07 16:31:39 +01:00
Thirunarayanan Balathandayuthapani
f8cf493290 MDEV-34898 Doublewrite recovery of innodb_checksum_algorithm=full_crc32 encrypted pages does not work
- InnoDB fails to recover the full crc32 encrypted page from
doublewrite buffer. The reason is that buf_dblwr_t::recover()
fails to identify the space id from the page because the page has
been encrypted from FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION bytes.

Fix:
===
buf_dblwr_t::recover(): preserve any pages whose space_id
does not match a known tablespace. These could be encrypted pages
of tablespaces that had been created with
innodb_checksum_algorithm=full_crc32.

buf_page_t::read_complete(): If the page looks corrupted and the
tablespace is encrypted and in full_crc32 format, try to
restore the page from doublewrite buffer.

recv_dblwr_t::recover_encrypted_page(): Find the page which
has the same page number and try to decrypt the page using
space->crypt_data. After decryption, compare the space id.
Write the recovered page back to the file.
2025-01-07 19:33:56 +05:30
Julius Goryavsky
fd9a11d8a5 MDEV-35749: Add support for --use-memory option for SST with mariabackup
Mariabackup (mariadb-backup) supports the --use-memory option that
sets the buffer pool size for innodb. However, current SST scripts
do not use this option. This commit adds support for this option,
the value for which can be specified via the "use_memory" parameter
in the configuration file in the [sst], [mariabackup] or [xtrabackup]
sections (supported only for compatibility with old configurations).

In addition, if the innodb_buffer_pool_size option is specified in
the user configuration (in the main server configuration sections)
or passed to the SST scripts or the server via arguments, its value
is also passed to mariadb-backup as the value for the --use-memory
option.

A new section name [mariabackup] has also been added, which can
be used instead of the deprecated [xtrabackup] (the section name
"mariabackup" was specified in the documentation, but was not
actually supported by SST scripts before this commit).
2025-01-06 01:43:42 +01:00
Sergei Golubchik
6abbfdef7a sporadic failures of binlog_encryption.rpl_parallel_gco_wait_kill
CURRENT_TEST: binlog_encryption.rpl_parallel_gco_wait_kill
mysqltest: In included file "./suite/rpl/t/rpl_parallel_gco_wait_kill.test":
included from /home/buildbot/amd64-ubuntu-2004-debug/build/mysql-test/suite/binlog_encryption/rpl_parallel_gco_wait_kill.test at line 2:
At line 334: Can't initialize replace from 'replace_result $thd_id THD_ID'

An sql thread can reach the "Slave has read all relay log" state
and then start reading relay log again. Let's use a more generic
pattern to retrieve the sql thread ID even if it's not
in the "read all relay log" state.
2025-01-05 16:40:12 +02:00
Monty
88d9348dfc Remove dates from all rdiff files 2025-01-05 16:40:11 +02:00
Monty
87ee1e75bc MDEV-35643 Add support for MySQL 8.0 binlog events
MDEV-29533 Crash when MariaDB is replica of MySQL 8.0

MySQL 8.0 has added the following new events in the MySQL binary log

PARTIAL_UPDATE_ROWS_EVENT
TRANSACTION_PAYLOAD_EVENT
HEARTBEAT_LOG_EVENT_V2

- PARTIAL_UPDATE_ROWS_EVENT is used by MySQL to generate update
  statements using JSON_SET, JSON_REPLACE and JSON_REMOVE to make
  update of JSON columns more efficient.  These events can be
  disabled by setting 'binlog-row-value-options=""'
- TRANSACTION_PAYLOAD_EVENT is used by MySQL to signal that a
  row event is compressed. It an be disably by setting
  'binlog_transaction_compression=0'.
- HEARTBEAT_LOG_EVENT_V2 is written to the binary log many times
  per seconds. It can be ignored by the server.

What this patch does:

- If PARTIAL_UPDATE_ROWS_EVENT or TRANSACTION_PAYLOAD_EVENT is found,
  the server will stop with an error message of how to disable the
  MySQL server to generate such events.
- HEARTBEAT_LOG_EVENT_V2 events are ignored.
- mariadb-binlog will write the name of the new events.
- mariadb-binlog will stop if PARTIAL_UPDATE_ROWS_EVENT or
  TRANSACTION_PAYLOAD_EVENT is found, unless --force is given.
- Fixes a crash in mariadb-binlog if a character set unknown to
  MariaDB is found. (MDEV-29533)

From Kristian Nielsen:
- Add test case for MySQL 8.0 to MariaDB replication and fixed a
  a small typo in post_header_len initialization.

Reviewer: knielsen@mariadb.org
2025-01-05 16:40:11 +02:00
Monty
47a5eed437 Added status variable "Max_memory_used" to SHOW STATUS
This shows the maximum memory allocations used by the current connection.
The value for @@global.max_memory_used is 0 as we are not collecting this
value as it would cause a notable performance issue registering this for
all threads for every memory allocation

Reviewed-by: Sergei Golubchik <serg@mariadb.org>
2025-01-05 16:40:11 +02:00