View Bazaar branches
Get this repository:
git clone https://git.launchpad.net/maria

MariaDB has 15 active reviews. See all merge proposals.

Import details

Import Status: Reviewed

This repository is an import of the Git repository at https://github.com/MariaDB/server.git.

The next import is scheduled to run .

Last successful import was .

Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 11 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 10 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 12 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 9 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 14 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 12 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 15 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 12 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 14 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 14 minutes — see the log

Branches

Name Last Modified Last Commit
bb-11.5-mdev-30929-wait-and-die 2024-04-26 00:06:11 UTC
MDEV-30929 [demo] further debugging suggestions from andrei

Author: Yuchen Pei
Author Date: 2024-04-26 00:06:11 UTC

MDEV-30929 [demo] further debugging suggestions from andrei

bb-10.5-nikita-MDEV-30046 2024-04-25 22:09:59 UTC
multi_delete: fix unlikely -> likely

Author: Nikita Malyavin
Author Date: 2024-04-25 21:35:44 UTC

multi_delete: fix unlikely -> likely

bb-10.4-MDEV-28621-no-remove-unit 2024-04-25 20:08:31 UTC
MDEV-28621 group by optimization incorrectly removing subquery where subject ...

Author: Rex Johnston
Author Date: 2024-04-25 20:08:31 UTC

MDEV-28621 group by optimization incorrectly removing subquery where subject buried in a function

Minimal patch to stop crashes. Do not remove the unit/select_lex from tree of unit/select_lex.

bb-10.11-serg 2024-04-25 18:26:40 UTC
MDEV-33492 fix installation of rpm/deb packages

Author: Sergei Golubchik
Author Date: 2024-04-25 18:26:06 UTC

MDEV-33492 fix installation of rpm/deb packages

followup for 0271517495e2

bb-10.5-MDEV-33896-galera 2024-04-25 14:32:06 UTC
MDEV-33896 : Galera test failure on galera_3nodes.MDEV-29171

Author: =?utf-8?q?Jan_Lindstr=C3=B6m?=
Author Date: 2024-04-12 07:10:29 UTC

MDEV-33896 : Galera test failure on galera_3nodes.MDEV-29171

Based on logs we might start SST before donor has reached
Primary state. Because this test shutdowns all nodes we
need to make sure when we start nodes that previous nodes
have reached Primary state and joined the cluster.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>

10.5 2024-04-25 14:32:06 UTC
MDEV-33896 : Galera test failure on galera_3nodes.MDEV-29171

Author: =?utf-8?q?Jan_Lindstr=C3=B6m?=
Author Date: 2024-04-12 07:10:29 UTC

MDEV-33896 : Galera test failure on galera_3nodes.MDEV-29171

Based on logs we might start SST before donor has reached
Primary state. Because this test shutdowns all nodes we
need to make sure when we start nodes that previous nodes
have reached Primary state and joined the cluster.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>

10.4 2024-04-25 12:11:28 UTC
MDEV-33790 Incorrect DEFAULT expression evaluated in UPDATE

Author: Oleksandr "Sanja" Byelkin
Author Date: 2024-04-23 09:37:11 UTC

MDEV-33790 Incorrect DEFAULT expression evaluated in UPDATE

The problem was that Item_default_value::associate_with_target_field
assigned passed as argument field as an argument which changed argument
in case of default() call with certain field (i.e. deault(field)).

There is no way to get wrong field in constructor so we will not reassign
parameter.

bb-10.4-MDEV-33790 2024-04-25 12:11:28 UTC
MDEV-33790 Incorrect DEFAULT expression evaluated in UPDATE

Author: Oleksandr "Sanja" Byelkin
Author Date: 2024-04-23 09:37:11 UTC

MDEV-33790 Incorrect DEFAULT expression evaluated in UPDATE

The problem was that Item_default_value::associate_with_target_field
assigned passed as argument field as an argument which changed argument
in case of default() call with certain field (i.e. deault(field)).

There is no way to get wrong field in constructor so we will not reassign
parameter.

10.11 2024-04-25 10:47:23 UTC
sporadic failures of rpl.rpl_parallel_sbm

Author: Sergei Golubchik
Author Date: 2024-04-25 10:47:23 UTC

sporadic failures of rpl.rpl_parallel_sbm

the test waits for the event to get stuck on MASTER_DELAY,
but on a slow/overloaded slave the event might pass MASTER_DELAY
before the test starts waiting.

Wait for the event to get stuck on the LOCK TABLES (after MASTER_DELAY),
the event cannot avoid that,

10.6 2024-04-25 10:44:10 UTC
MDEV-33993 Possible server hang on DROP INDEX or RENAME INDEX

Author: Marko Mäkelä
Author Date: 2024-04-25 10:44:10 UTC

MDEV-33993 Possible server hang on DROP INDEX or RENAME INDEX

commit_try_norebuild(): Add the parameter statistics_exist,
similar to commit_try_rebuild(). If the InnoDB statistics tables
did not exist, we will not attempt to update statistics later on
during the transaction.

Thanks to Matthias Leich for originally reproducing this scenario.

10.4-MDEV-22855 2024-04-25 09:05:21 UTC
MDEV-22855 Assertion `!field->prefix_len || field->fixed_len == field->prefix...

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2024-04-25 08:40:00 UTC

MDEV-22855 Assertion `!field->prefix_len || field->fixed_len == field->prefix_len' failed in btr_node_ptr_max_size

Problem:
========
- InnoDB wrongly calulates the record size in
btr_node_ptr_max_size() when prefix index of
the column has to be stored externally.

Fix:
====
- InnoDB should add the maximum field size to
record size when the field is a fixed length one.

st-10.5-knielsen 2024-04-25 09:00:45 UTC
MDEV-33602: Sporadic test failure in rpl.rpl_gtid_stop_start

Author: Kristian Nielsen
Author Date: 2024-04-23 19:02:08 UTC

MDEV-33602: Sporadic test failure in rpl.rpl_gtid_stop_start

The test could fail with a duplicate key error because switching to non-GTID
mode could start at the wrong old-style position. The position could be
wrong when the previous GTID connect was stopped before receiving the fake
GTID list event which gives the old-style position corresponding to the GTID
connected position.

Work-around by injecting an extra event and syncing the slave before
switching to non-GTID mode.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>

bb-10.11-release 2024-04-25 06:08:18 UTC
Merge branch '10.6' into 10.11

Author: Oleksandr "Sanja" Byelkin
Author Date: 2024-04-25 06:08:18 UTC

Merge branch '10.6' into 10.11

bb-10.6-sst-galera 2024-04-24 22:24:35 UTC
galera SST scripts: parsing CN in certificates

Author: Julius Goryavsky
Author Date: 2024-04-24 22:13:02 UTC

galera SST scripts: parsing CN in certificates

This commit contains a fix for the code that extracts and parses
the CN (common name, domain name) record from certificates using
the openssl utility. This code is also made common to the rsync
and mariabackup scripts. There is also some systematization of
the use of 'printf' and 'echo' builtins/utilities.

bb-10.5-sst-galera 2024-04-24 22:23:33 UTC
galera SST scripts: parsing CN in certificates

Author: Julius Goryavsky
Author Date: 2024-04-24 22:13:02 UTC

galera SST scripts: parsing CN in certificates

This commit contains a fix for the code that extracts and parses
the CN (common name, domain name) record from certificates using
the openssl utility. This code is also made common to the rsync
and mariabackup scripts. There is also some systematization of
the use of 'printf' and 'echo' builtins/utilities.

bb-10.4-sst-galera 2024-04-24 22:13:26 UTC
galera SST scripts: parsing CN in certificates

Author: Julius Goryavsky
Author Date: 2024-04-24 22:13:02 UTC

galera SST scripts: parsing CN in certificates

This commit contains a fix for the code that extracts and parses
the CN (common name, domain name) record from certificates using
the openssl utility. This code is also made common to the rsync
and mariabackup scripts. There is also some systematization of
the use of 'printf' and 'echo' builtins/utilities.

bb-10.5-bar-MDEV-21058 2024-04-24 19:02:40 UTC
MDEV-21058 CREATE TABLE with generated column and RLIKE results in sigabrt

Author: Alexander Barkov
Author Date: 2024-04-24 12:54:00 UTC

MDEV-21058 CREATE TABLE with generated column and RLIKE results in sigabrt

Regexp_processor_pcre::fix_owner() called Regexp_processor_pcre::compile(),
which could fail on the regex syntax error in the pattern and put
an error into the diagnostics area. However, the callers:
  - Item_func_regex::fix_length_and_dec()
  - Item_func_regexp_instr::fix_length_and_dec()
still returned "false" in such cases, which made the code
crash later inside Diagnostics_area::set_ok_status().

Fix:

- Change the return type of fix_onwer() from "void" to "bool"
  and return "true" whenever an error is put to the DA
  (e.g. on the syntax error in the pattern).
- Fixing fix_length_and_dec() of the mentioned Item_func_xxx
  classes to return "true" if fix_onwer() returned "true".

bb-10.6-choose_next_log 2024-04-24 18:05:08 UTC
Testing the idea of purge_sys_t::choose_next_log() refactoring.

Author: Vlad Lesin
Author Date: 2024-04-24 18:05:08 UTC

Testing the idea of purge_sys_t::choose_next_log() refactoring.

bb-10.5-serg 2024-04-24 16:09:58 UTC
MDEV-20157 perfschema.stage_mdl_function failed in buildbot with wrong result

Author: Sergei Golubchik
Author Date: 2024-04-24 16:08:46 UTC

MDEV-20157 perfschema.stage_mdl_function failed in buildbot with wrong result

MDL wait consists of short 1 second waits (this is not configurable)
repeated until lock_wait_timeout is reached. The stage is changed
to Waiting and back every second. To have predictable result in the
test the query should filter all sequences of X, "Waiting for MDL", X,
leaving just X.

10.6-MDEV-33669 2024-04-24 14:23:13 UTC
MDEV-33669 mariabackup --backup hangs

Author: mariadb-DebarunBanerjee
Author Date: 2024-04-24 14:23:13 UTC

MDEV-33669 mariabackup --backup hangs

This is a server hang and not an issue with backup. While concurrent
DDLs in server gets in hanged state, mariabackup waits for DDLs to
finish trying to acquire MDL_BACKUP_BLOCK_DDL.

The server hang is serious in nature and caused by thread pool state
being incorrectly set to thread creation pending state while no creation
is actually pending. Once a thread pool reaches such state no new thread
gets created in the pool.

While it could possibly affect all thread pools in server, the innodb
thread pool is the victim in current bug where IO job gets blocked when
the pool is stuck with much less number of threads than intended.
Available workers are blocked in purge waiting for page lock to be
released by IO write (SX lock) causing a complete deadlock.

The issue is caused by the state variable m_thread_creation_pending
introduced by MDEV-31095: 9e62ab7aafbf. We check and set the variable
early while attempting to create a new thread in pool but fail to reset
it if we exit the flow for other reasons like maximum threads reached
or get into thread creation throttling path.

Fix: The simple fix is to make sure that the state is reset back in case
we don't actually attempt to create the thread.

10.11-MDEV-33087 2024-04-24 13:49:54 UTC
MDEV-33087 ALTER TABLE...ALGORITHM=COPY should build indexes more efficiently

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2024-04-24 13:49:54 UTC

MDEV-33087 ALTER TABLE...ALGORITHM=COPY should build indexes more efficiently

- During copy algorithm, InnoDB should use bulk insert operation
for row by row insert operation. By doing this, copy algorithm
can effectively build indexes. This optimization is disabled
for temporary table, versioning table and table which has
foreign key relation.

Introduced the variable innodb_alter_copy_bulk to allow
the bulk insert operation for copy alter operation
inside InnoDB. This is enabled by default

ha_innobase::extra(): HA_EXTRA_END_ALTER_COPY mode tries to apply
the buffered bulk insert operation, updates the non-persistent
table stats.

row_merge_bulk_t::write_to_index(): Update stat_n_rows after
applying the bulk insert operation

row_ins_clust_index_entry_low(): In case of copy algorithm,
switch to bulk insert operation.

copy_data_error_ignore(): Handles the error while copying
the data from source to target file.

bb-10.5-rucha 2024-04-24 13:35:41 UTC
MDEV-22141: JSON_REMOVE returns NULL on valid arguments

Author: Rucha Deodhar
Author Date: 2024-03-15 18:58:48 UTC

MDEV-22141: JSON_REMOVE returns NULL on valid arguments

Analysis:
When we scan json to get to a beginning according to the path, we end up
scanning json even if we have exhausted it. When eventually returns error.

Fix:
Continue scanning json only if we have not exhausted it and return result
accordingly.

bb-10.5-MDEV-22141 2024-04-24 13:03:34 UTC
MDEV-22141: JSON_REMOVE returns NULL on valid arguments

Author: Rucha Deodhar
Author Date: 2024-03-15 18:58:48 UTC

MDEV-22141: JSON_REMOVE returns NULL on valid arguments

Analysis:
When we scan json to get to a beginning according to the path, we end up
scanning json even if we have exhausted it. When eventually returns error.

Fix:
Continue scanning json only if we have not exhausted it and return result
accordingly.

11.4 2024-04-24 12:44:24 UTC
MDEV-33616 Tests failing on macOS

Author: Dave Gosselin
Author Date: 2024-04-15 16:15:04 UTC

MDEV-33616 Tests failing on macOS

compat/oracle.sp-inout now uses lowercase object names for test
compatibility with both case-insensitive and case-sensitive
filesystems.

bb-10.6-MDEV-28621-eliminate-in-optimization 2024-04-24 11:55:26 UTC
MDEV-28621: group by optimization incorrectly removing subquery

Author: Sergey Petrunia
Author Date: 2024-04-24 11:55:26 UTC

MDEV-28621: group by optimization incorrectly removing subquery

Test patch: Remove the subqueries at optimizer phase.
- The removed subqueries are still visible in EXPLAIN.
- The check whether a subquery is a candidate for conversion
  into semi-join now allows GROUP BY (but no aggregates, etc)
- There is only one meaningful query plan difference:
  subqueries that have child subqueries are considered expensive.

  A subquery that's cheap but has a removable GROUP BY was not
  considered expensive before. Now it is considered expensive.
  Looks like and edge case.

bb-10.5-MDEV-32287 2024-04-24 11:44:12 UTC
MDEV-32287: JSON_EXTRACT not returning multiple values for same path

Author: Rucha Deodhar
Author Date: 2024-03-18 18:34:47 UTC

MDEV-32287: JSON_EXTRACT not returning multiple values for same path

Analysis:
When scanning json and getting the exact path at each step, if a path
is reached, we end up adding the item in the result and immediately get the
next item which results in current path changing.
Fix:
Instead of immediately returning the item, count the occurences of the path
in argument and append in the result as needed.

10.6-MDEV-33817 2024-04-24 09:02:45 UTC
Use the correct table, and clean up unit test

Author: Marko Mäkelä
Author Date: 2024-04-24 09:02:45 UTC

Use the correct table, and clean up unit test

bb-11.5-MDEV-33924 2024-04-24 08:36:25 UTC
MDEV-33924: Gtid_log_event thread_id should be 32-bit

Author: Brandon Nesterenko
Author Date: 2024-04-18 21:45:27 UTC

MDEV-33924: Gtid_log_event thread_id should be 32-bit

In accordance with MDEV-15089, and to be consistent with
Query_log_event::thread_id, the Gtid_log_event::thread_id
should also be 32-bit when writing/reading to the binary
log.

bb-11.5-bar-MDEV-12668 2024-04-24 08:27:37 UTC
MDEV-12668 SRID is not preserved in UNION, VIEW, MIN, MAX

Author: Alexander Barkov
Author Date: 2024-04-23 08:57:36 UTC

MDEV-12668 SRID is not preserved in UNION, VIEW, MIN, MAX

Fixing the problem that an operation involving a mix of
two or more GEOMETRY operands did not preserve their SRIDs.
Now SRIDs are preserved by hybrid functions, subqueries, TVCs, UNIONs, VIEWs.

Incompatible change:
  An attempt to mix two different SRIDs now raises an error.

Details:

- Adding a new class Type_extra_attributes. It's a generic
  container which can store very specific data type attributes.
  For now it can store one uint32 and one const pointer attribute
  (for GEOMETRY's SRID and for ENUM/SET TYPELIB respectively).
  In the future it can grow as needed.

  Type_extra_attributes will also be reused soon to store "const Type_zone*"
  pointers for the TIMESTAMP's "WITH TIME ZONE 'tz'" attribute
  (a timestamp data type with a fixed time zone independent from @@time_zone).
  The time zone attribute will be stored in exactly the same way like
  a TYPELIB pointer is stored by ENUM/SET.

- Removing Column_definition_attributes members "interval" and "srid".
  Deriving Column_definition_attributes from the generic attribute container
  Type_extra_attributes instead.

- Adding a new class Type_typelib_attributes, to store
  the TYPELIB of the ENUM and SET data types. Deriving Field_enum from it.
  Removing the member Field_enum::typelib.

- Adding a new class Type_geom_attributes, to store
  the GEOMETRY related attributes. Deriving Field_geom from it.
  Removing the member Field_geom::srid.

- Removing virtual methods:
    Field::get_typelib()
    Type_all_attributes::get_typelib() and
    Type_all_attributes::set_typelib()
  They were very specific to TYPELIB.
  Adding more generic virtual methods instead:
  * Field::type_extra_attributes() - to get extra attributes
  * Type_all_attributes::type_extra_attributes() - to get extra attributes
  * Type_all_attributes::type_extra_attributes_addr() - to set extra attributes

- Removing Item_type_holder::enum_set_typelib. Deriving Item_type_holder
  from the generic attribute container Type_extra_attributes instead.
  This makes it possible for UNION to preserve SRID
  (in addition to preserving TYPELIB).

- Deriving Item_hybrid_func from Type_extra_attributes.
  This makes it possible for hybrid functions (e.g. CASE, COALESCE,
  LEAST, GREATEST etc) to preserve SRID.

- Deriving Item_singlerow_subselect from Type_extra_attributes and
  overriding methods:
  * Item_cache::type_extra_attributes()
  * subselect_single_select_engine::fix_length_and_dec()
  * Item_singlerow_subselect::type_extra_attributes()
  * Item_singlerow_subselect::type_extra_attributes_addr()
  This is needed to preserve SRID in subqueries and TVCs

- Cleanup: fixing the data type of members
  * Binlog_type_info::m_enum_typelib
  * Binlog_type_info::m_set_typelib
  from "TYPELIB *" to "const TYPELIB *"

bb-11.0-MDEV-27871 2024-04-24 06:19:35 UTC
Removing MDEV-27871 from tastcases because it is not a bug

Author: Lena Startseva
Author Date: 2024-04-24 06:19:35 UTC

Removing MDEV-27871 from tastcases because it is not a bug
Fix for v.11.0

bb-10.11-MDEV-27871 2024-04-24 06:12:54 UTC
Removing MDEV-27871 from tastcases because it is not a bug

Author: Lena Startseva
Author Date: 2024-04-24 04:16:39 UTC

 Removing MDEV-27871 from tastcases because it is not a bug
 Fix for v.10.11

bb-10.4-mdev-29363-cheap 2024-04-24 04:08:56 UTC
MDEV-29363 replace subqueries with their values before adding to item_equal

Author: Yuchen Pei
Author Date: 2024-04-24 04:08:56 UTC

MDEV-29363 replace subqueries with their values before adding to item_equal

The optimizer constructs multiple equalities, and swap them in during
equality propagation. In doing so, it may create multiple pointers to
the same item. When the item contain subqueries, bad things can
happen. For example, in pushdown of HAVING to WHERE, if the HAVING
conditions contain multiple equalities with a const subquery, the
subquery will not be excluded from pushdown into WHERE. And if there
are multiple pointers to the same subquery, it may unfix the subquery
and destroy and rebuild its join, which could cause further
use-after-free if there are external pointers to items in the
join (e.g. tmp table fields as in the main case in MDEV-29363).

This patch also fixes cases in MDEV-32424, MDEV-32608, MDEV-32539.

bb-11.5-mdev-30929-wait-and-retry 2024-04-24 00:49:17 UTC
[demo] spider.spider_fixes_part: wait and retry

Author: Yuchen Pei
Author Date: 2024-04-18 23:42:07 UTC

[demo] spider.spider_fixes_part: wait and retry

bb-10.11-MDEV-33967-handersocket-binlog-pkgtest 2024-04-24 00:12:33 UTC
MDEV-33967 hander socket writes do not result in binary log entries

Author: Daniel Black
Author Date: 2024-04-23 01:17:59 UTC

MDEV-33967 hander socket writes do not result in binary log entries

As handlersocket bypasses the sql layer that prepares and causes
binary log entries to be created, we need to do this in the
plugin directly to create binary log entries.

Reported thanks to Yutaro Iwasaki on Zulip.

11.5 2024-04-23 19:55:22 UTC
MDEV-18478 ANALYZE for statement should show selectivity of ICP, part#3

Author: Sergey Petrunia
Author Date: 2024-04-22 17:39:31 UTC

MDEV-18478 ANALYZE for statement should show selectivity of ICP, part#3

Fix the previous patch:
- Only enable handler_stats if thd->should_collect_handler_stats()==true.
- Make handler_index_cond_check() work when handler_stats are not enabled.

bb-11.5-MDEV-18478 2024-04-23 19:55:22 UTC
MDEV-18478 ANALYZE for statement should show selectivity of ICP, part#3

Author: Sergey Petrunia
Author Date: 2024-04-22 17:39:31 UTC

MDEV-18478 ANALYZE for statement should show selectivity of ICP, part#3

Fix the previous patch:
- Only enable handler_stats if thd->should_collect_handler_stats()==true.
- Make handler_index_cond_check() work when handler_stats are not enabled.

knielsen_mdev33602 2024-04-23 19:02:08 UTC
MDEV-33602: Sporadic test failure in rpl.rpl_gtid_stop_start

Author: Kristian Nielsen
Author Date: 2024-04-23 19:02:08 UTC

MDEV-33602: Sporadic test failure in rpl.rpl_gtid_stop_start

The test could fail with a duplicate key error because switching to non-GTID
mode could start at the wrong old-style position. The position could be
wrong when the previous GTID connect was stopped before receiving the fake
GTID list event which gives the old-style position corresponding to the GTID
connected position.

Work-around by injecting an extra event and syncing the slave before
switching to non-GTID mode.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>

bb-10.6-MDEV-27871 2024-04-23 15:53:58 UTC
Removing MDEV-27871 from tastcases because it is not a bug

Author: Lena Startseva
Author Date: 2024-04-23 15:53:58 UTC

Removing MDEV-27871 from tastcases because it is not a bug
Fix for v. 10.6

11.5-MDEV-33924 2024-04-23 15:26:08 UTC
MDEV-33924: Gtid_log_event thread_id should be 32-bit

Author: Brandon Nesterenko
Author Date: 2024-04-18 21:45:27 UTC

MDEV-33924: Gtid_log_event thread_id should be 32-bit

In accordance with MDEV-15089, and to be consistent with
Query_log_event::thread_id, the Gtid_log_event::thread_id
should also be 32-bit when writing/reading to the binary
log.

bb-10.5-MDEV-27871 2024-04-23 14:44:42 UTC
Removing MDEV-27871 from tastcases because it is not a bug

Author: Lena Startseva
Author Date: 2024-04-22 10:53:06 UTC

Removing MDEV-27871 from tastcases because it is not a bug

bb-10.6-MDEV-33896-galera 2024-04-23 12:52:22 UTC
MDEV-33896 : Galera test failure on galera_3nodes.MDEV-29171

Author: =?utf-8?q?Jan_Lindstr=C3=B6m?=
Author Date: 2024-04-12 07:10:29 UTC

MDEV-33896 : Galera test failure on galera_3nodes.MDEV-29171

Based on logs we might start SST before donor has reached
Primary state. Because this test shutdowns all nodes we
need to make sure when we start nodes that previous nodes
have reached Primary state and joined the cluster.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>

bb-10.6-monty 2024-04-23 11:12:31 UTC
Check and remove high stack usage

Author: Monty
Author Date: 2024-04-19 10:10:58 UTC

Check and remove high stack usage

I checked all stack overflow potential problems found with
gcc -Wstack-usage=16384
and
clang -Wframe-larger-than=16384 -no-inline

Fixes:
Added '#pragma clang diagnostic ignored "-Wframe-larger-than="'
  to a lot of function to where stack usage large but resonable.
- Added stack check warnings to BUILD scrips when using clang and debug.

Function changed to use malloc instead allocating things on stack:
- read_bootstrap_query() now allocates line_buffer (20000 bytes) with
  malloc() instead of using stack. This has a small performance impact
  but this is not releant for bootstrap.
- mroonga grn_select() used 65856 bytes on stack. Changed it to use
  malloc().
- Wsrep_schema::replay_transaction() and
  Wsrep_schema::recover_sr_transactions().
- Connect zipOpen3()

Not fixed:
- mroonga/vendor/groonga/lib/expr.c grn_proc_call() uses
  43712 byte on stack. However this is not easy to fix as the stack
  used is caused by a lot of code generated by defines.
- Most changes in mroonga/groonga where only adding of pragmas to disable
  stack warnings.
- rocksdb/options/options_helper.cc uses 20288 of stack space.
  (no reason to fix except to get rid of the compiler warning)
- Causes using alloca() where the allocation size is resonable.
- An issue in libmariadb (reported to connectors).

11.2 2024-04-23 10:31:41 UTC
MDEV-32973 SHOW TABLES LIKE shows temporary tables with non-matching names

Author: Sergei Golubchik
Author Date: 2024-04-22 20:51:23 UTC

MDEV-32973 SHOW TABLES LIKE shows temporary tables with non-matching names

* compare both db and table name
* use the correct charset

bb-11.2-serg 2024-04-23 10:31:41 UTC
MDEV-32973 SHOW TABLES LIKE shows temporary tables with non-matching names

Author: Sergei Golubchik
Author Date: 2024-04-22 20:51:23 UTC

MDEV-32973 SHOW TABLES LIKE shows temporary tables with non-matching names

* compare both db and table name
* use the correct charset

bb-10.4-mdev-31766-hf 2024-04-23 09:27:44 UTC
check if it breaks tests.

Author: Alexey Botchkov
Author Date: 2024-04-23 09:27:44 UTC

check if it breaks tests.

bb-10.6-MDEV-33769 2024-04-23 03:46:53 UTC
MDEV-33769: Memory leak found in the test main.rownum run with --ps-protocol ...

Author: Dmitry Shulga
Author Date: 2024-04-23 03:46:53 UTC

MDEV-33769: Memory leak found in the test main.rownum run with --ps-protocol against a server built with the option -DWITH_PROTECT_STATEMENT_MEMROOT

bb-10.5-MDEV-33967-handersocket-binlog-pkgtest 2024-04-23 01:18:01 UTC
MDEV-33967 hander socket writes do not result in binary log entries

Author: Daniel Black
Author Date: 2024-04-23 01:17:59 UTC

MDEV-33967 hander socket writes do not result in binary log entries

As handlersocket bypasses the sql layer that prepares and causes
binary log entries to be created, we need to do this in the
plugin directly to create binary log entries.

Reported thanks to Yutaro Iwasaki on Zulip.

bb-10.5-mdev-24610-memory-se 2024-04-23 00:56:19 UTC
MDEV-24610 MEMORY SE: check overflow in info calls with HA_STATUS_AUTO

Author: Yuchen Pei
Author Date: 2024-04-23 00:56:19 UTC

MDEV-24610 MEMORY SE: check overflow in info calls with HA_STATUS_AUTO

bb-11.5-MDEV-32188-timestamps 2024-04-22 19:27:24 UTC
fixup! f551fa75e13dd57b057117c570f2e2414ec6d500

Author: Monty
Author Date: 2024-04-22 14:42:09 UTC

fixup! f551fa75e13dd57b057117c570f2e2414ec6d500

bb-11.5-MDEV-33501-query-response-time 2024-04-22 15:26:15 UTC
squash! ddab8e0840f1b11c44bb05accae1291b1191aa1a

Author: Monty
Author Date: 2024-04-22 07:01:04 UTC

squash! ddab8e0840f1b11c44bb05accae1291b1191aa1a

- Use drop_table() instead of ha_drop_table() for internal temporary
  tables to avoid information_schema queries to be categorized as
  write queries.

bb-10.6-serg 2024-04-22 15:22:11 UTC
fix failing large_tests.maria_recover_encrypted

Author: Sergei Golubchik
Author Date: 2024-04-22 15:22:11 UTC

fix failing large_tests.maria_recover_encrypted

update results

bb-10.5-MDEV-33928-galera 2024-04-22 14:59:16 UTC
MDEV-33928 : Assertion failure on wsrep_thd_is_aborting

Author: =?utf-8?q?Jan_Lindstr=C3=B6m?=
Author Date: 2024-04-18 12:41:30 UTC

MDEV-33928 : Assertion failure on wsrep_thd_is_aborting

Problem was assertion assuming we always hold
THD::LOCK_thd_data mutex that is not true.
In most cases this is true but function is
also used from InnoDB lock manager and
there we can't take THD::LOCK_thd_data to
obey mutex ordering. Removed assertion as
wsrep transaction state can't change even
that case.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>

bb-11.5-timestamp 2024-04-22 14:42:09 UTC
fixup! f551fa75e13dd57b057117c570f2e2414ec6d500

Author: Monty
Author Date: 2024-04-22 14:42:09 UTC

fixup! f551fa75e13dd57b057117c570f2e2414ec6d500

bb-11.5-MDEV-33145-flush-global-status 2024-04-22 14:15:22 UTC
fixup MDEV-33145 Add FLUSH GLOBAL STATUS

Author: Elena Stepanova
Author Date: 2024-04-22 14:15:22 UTC

fixup MDEV-33145 Add FLUSH GLOBAL STATUS

Transferring commit c2213a6aae1ddc1cca5390e8b6eef9e102c2298e

bb-11.5-bar-MDEV-20610 2024-04-22 13:58:09 UTC
MDEV-20610 Assertion failed or btr_validate_index(..) in row_upd_sec_index_en...

Author: Alexander Barkov
Author Date: 2024-04-12 05:25:13 UTC

MDEV-20610 Assertion failed or btr_validate_index(..) in row_upd_sec_index_entry on a time_zone change

bb-11.5-monty 2024-04-22 13:41:25 UTC
fixup! 3a7a3e9b3be3504e1bfc32c931e14ed47a317d9b

Author: Monty
Author Date: 2024-04-22 13:41:25 UTC

fixup! 3a7a3e9b3be3504e1bfc32c931e14ed47a317d9b

bb-11.5-serg 2024-04-22 12:59:05 UTC
mysqltest: support MARIADB_OPT_RESTRICTED_AUTH

Author: Sergei Golubchik
Author Date: 2024-03-15 17:42:06 UTC

mysqltest: support MARIADB_OPT_RESTRICTED_AUTH

C/C 3.4 disables mysql_old_password by default, so

add an option for the `connect` command to support specifying
allowed authentication plugins (MARIADB_OPT_RESTRICTED_AUTH).

use it to enable mysql_old_password when needed for testing

bb-10.4-mdev-33892-hf 2024-04-22 12:47:33 UTC
Test case showing the problem.

Author: Alexey Botchkov
Author Date: 2024-04-22 12:47:33 UTC

Test case showing the problem.

bb-10.4-mdev-24610 2024-04-22 06:21:45 UTC
MDEV-24610 Check for partition auto increment overflow

Author: Yuchen Pei
Author Date: 2024-04-22 04:52:39 UTC

MDEV-24610 Check for partition auto increment overflow

When ha_partition::info() is called with a flag containing
HA_STATUS_AUTO, it may iterate partitions and call info() on them with
HA_STATUS_AUTO, and update its own auto increment value with the
maximum of the partitions.

When info() is called on the MEMORY SE, it could cause an overflow
when its internal auto increment value is already ULONGLONG_MAX,
thereby setting the table stats auto increment value to 0.

If such an overflow happens, we return an error in
ha_partition::info() indicating so.

Note that callsites of ha_partition::update_next_auto_inc_val(), which
calls ha_partition::info() with HA_STATUS_AUTO, do not handle any
returned error.

bb-10.5-mdev-24610 2024-04-22 04:52:39 UTC
MDEV-24610 Check for partition auto increment overflow

Author: Yuchen Pei
Author Date: 2024-04-22 04:52:39 UTC

MDEV-24610 Check for partition auto increment overflow

When ha_partition::info() is called with a flag containing
HA_STATUS_AUTO, it may iterate partitions and call info() on them with
HA_STATUS_AUTO, and update its own auto increment value with the
maximum of the partitions.

When info() is called on the MEMORY SE, it could cause an overflow
when its internal auto increment value is already ULONGLONG_MAX,
thereby setting the table stats auto increment value to 0.

If such an overflow happens, we return an error in
ha_partition::info() indicating so.

Note that callsites of ha_partition::update_next_auto_inc_val(), which
calls ha_partition::info() with HA_STATUS_AUTO, do not handle any
returned error.

bb-10.6-all-builders 2024-04-20 20:02:12 UTC
MDEV-33622 Server crashes when the UPDATE statement (which has duplicate key)...

Author: Elena Stepanova
Author Date: 2024-04-20 20:02:12 UTC

MDEV-33622 Server crashes when the UPDATE statement (which has duplicate key) is run after setting a low thread_stack

Added the missing test case

bb-10.5-bar-MDEV-20610 2024-04-20 19:49:09 UTC
MDEV-20610 Assertion failed or btr_validate_index(..) in row_upd_sec_index_en...

Author: Alexander Barkov
Author Date: 2024-04-12 05:25:13 UTC

MDEV-20610 Assertion failed or btr_validate_index(..) in row_upd_sec_index_entry on a time_zone change

bb-10.11-MDEV-33420-fix2 2024-04-20 01:51:31 UTC
HASHICORP_KEY_MANAGEMENT: MDEV-33420 post-fix

Author: Julius Goryavsky
Author Date: 2024-04-20 01:51:31 UTC

HASHICORP_KEY_MANAGEMENT: MDEV-33420 post-fix

Compilation correction after MDEV-33420.

bb-10.11-MDEV-33420-fix 2024-04-20 01:51:31 UTC
HASHICORP_KEY_MANAGEMENT: MDEV-33420 post-fix

Author: Julius Goryavsky
Author Date: 2024-04-20 01:51:31 UTC

HASHICORP_KEY_MANAGEMENT: MDEV-33420 post-fix

Compilation correction after MDEV-33420.

bb-11.5-MDEV-33625 2024-04-18 19:07:55 UTC
MDEV-33625 Add option --dir to mariadb-dump

Author: VladislavVaintroub
Author Date: 2024-03-04 22:12:34 UTC

MDEV-33625 Add option --dir to mariadb-dump

New option works just like --tab, wrt output (sql file for table definition
and tab-separated for data, same options, e.g --parallel)

Compared to --tab it allows --databases and --all-databases.
When --dir is used , it creates directory structure in the output directory,
pointed to by --dir. For every database to be dumped, there will be a
directory with database name.

All options that --tab supports, are also supported by --dir, in particular
--parallel

bb-11.5-bar-MDEV-31340 2024-04-18 11:22:10 UTC
reset cached client plugin when it's no longer needed

Author: Sergei Golubchik
Author Date: 2024-03-17 14:00:09 UTC

reset cached client plugin when it's no longer needed

it's a pointer into the net buffer, so it might be overwritten by the
next read or write. And the next plugin switch (in multi-auth) will
try to compare it (in send_plugin_request_packet) which is normally
harmless but fails the assert with Lex_ident::is_valid_ident()

bb-11.4-vec-vicentiu-hugo 2024-04-18 10:15:04 UTC
Bug fixes - on top of Hugo's patch

Author: Vicențiu Ciorbaru
Author Date: 2024-04-18 10:15:04 UTC

Bug fixes - on top of Hugo's patch

bb-11.5-mdev12404-extras 2024-04-18 08:35:59 UTC
MDEV-12404: Add assertions about Index Condition Pushdown use

Author: Sergey Petrunia
Author Date: 2024-03-13 08:53:31 UTC

MDEV-12404: Add assertions about Index Condition Pushdown use

Add assertions about limitations one has when using Index Condition
Pushdown:
- add handler::assert_icp_limitations()
- call this function from functions that may attempt violations.

Verified that assert_icp_limitations() as well as calls to it are
compiled away in release build.

bb-10.11-release-spider-fixup 2024-04-18 07:16:44 UTC
[merge fixup] spider: restore extern declarations of some vars

Author: Yuchen Pei
Author Date: 2024-04-18 07:16:44 UTC

[merge fixup] spider: restore extern declarations of some vars

How did they get removed during the merge?? The removal did not appear
in the resolution diff at all.

bb-11.5-mdev-30929-sleep 2024-04-18 01:25:41 UTC
[demo] spider.spider_fixes_part: sleep until not running?

Author: Yuchen Pei
Author Date: 2024-04-18 01:25:41 UTC

[demo] spider.spider_fixes_part: sleep until not running?

bb-10.11-MDEV-33420 2024-04-17 23:45:24 UTC
MDEV-33420: HASHICORP_KEY_MANAGEMENT fails on Windows with libcurl installed

Author: Anel Husakovic
Author Date: 2024-04-12 06:55:27 UTC

MDEV-33420: HASHICORP_KEY_MANAGEMENT fails on Windows with libcurl installed

- When `libcurl` is installed in path out of default path, like on
Windows, `include_directories` failed to find `curl/curl.h`.
- Fix `cmake` by using modern syntax with imported target and
`find_package`
- Fix warnings treated as the errors
  - Remove `HASHICORP_HAVE_EXCEPTIONS` macro and related code
- Add package to `Server` component in Windows
- Tested with `$ ./mysql-test/mtr --suite=vault`
- Closes PR #3068
- Reviewer: <wlad@mariadb.com>
            <julius.goryavsky@mariadb.com>

merge-10.11-MDEV-33668 2024-04-17 20:42:01 UTC
Restore thread existence check

Author: Brandon Nesterenko
Author Date: 2024-04-17 20:38:40 UTC

Restore thread existence check

bb-10.4-mdev-30727 2024-04-17 07:26:41 UTC
MDEV-30727 Check spider_hton_ptr in spider udfs

Author: Yuchen Pei
Author Date: 2024-04-17 07:26:41 UTC

MDEV-30727 Check spider_hton_ptr in spider udfs

We have to #undef my_error and find it from udfs when spider is not
installed.

bb-10.6-wlad 2024-04-16 22:23:00 UTC
MDEV-33840 - fixup.

Author: VladislavVaintroub
Author Date: 2024-04-16 20:04:59 UTC

MDEV-33840 - fixup.

Be more careful, when switching on/off maintenance timer.

As long as there are active tasks and not enough threads, this will now
trigger the periodic deadlock check.

Previously, pool could block, without timer even starting.

bb-10.5-mdev-30073-7 2024-04-16 22:17:44 UTC
MDEV-30073 Wrong result on 2nd execution of PS for query with NOT EXISTS

Author: Igor Babaev
Author Date: 2024-04-16 22:05:30 UTC

MDEV-30073 Wrong result on 2nd execution of PS for query with NOT EXISTS

This is a preliminary patch to check possible failures in buildbot.
Variant 7

bb-10.6-mdev33752 2024-04-16 09:40:47 UTC
MDEV-33752: EXPLAIN UPDATE acquires locks on table rows

Author: Sergey Petrunia
Author Date: 2024-04-16 09:40:47 UTC

MDEV-33752: EXPLAIN UPDATE acquires locks on table rows

Make EXPLAIN commands behave like SELECTs when it comes to locking:
- In the SQL parser, make EXPLAIN DELETE and EXPLAIN UPDATE not to
  request write MDL or table locks.
- Same as above in multi_delete_set_locks_and_link_aux_tables().
- InnoDB analyzes the return value of thd_sql_command() and sets its
  locking behavior accordingly.
  EXPLAIN UPDATE|DELETE have thd_sql_command()=SQLCOM_UPDATE|DELETE.
  Introduce also thd_sql_is_explain() and if that returns true, InnoDB
  now will work as if thd_sql_command()==SQLCOM_SELECT.

bb-10.5-release 2024-04-16 09:04:14 UTC
Merge branch '10.4' into 10.5

Author: Oleksandr "Sanja" Byelkin
Author Date: 2024-04-16 09:04:14 UTC

Merge branch '10.4' into 10.5

bb-10.5-wlad 2024-04-16 07:16:52 UTC
MDEV-16944 followup

Author: VladislavVaintroub
Author Date: 2024-04-16 07:16:52 UTC

MDEV-16944 followup

- Better comments for do_write_line
- Add EOL to the line to be printed like "echo" does

bb-11.4-MDEV-18478-v4-MDEV-12404 2024-04-16 01:09:28 UTC
remove unused function should_collect_handler_stats

Author: Dave Gosselin
Author Date: 2024-04-16 01:09:28 UTC

remove unused function should_collect_handler_stats

bb-10.4-MDEV-28621-reference-counter 2024-04-15 22:54:05 UTC
MDEV-28621 group by optimization incorrectly removing subquery where subject ...

Author: Rex Johnston
Author Date: 2024-04-03 00:55:24 UTC

MDEV-28621 group by optimization incorrectly removing subquery where subject buried in a function

A group by query optimization technique, where the a group by clause in
a subquery can be removed is incorrectly removing references to subquery
items that may be defined and used elsewhere.

This is the initial implementation of a reference counter in the unit
attached to an Item_subquery.

11.4-mdev-33616 2024-04-15 19:17:30 UTC
MDEV-33616 Tests failing on macOS

Author: Dave Gosselin
Author Date: 2024-04-15 19:17:30 UTC

MDEV-33616 Tests failing on macOS

These tests rely on THR_KEY_mysys but it is not initialized. On
Linux, the corresponding thread variable is null, but on macOS it has a
nonzero value. In all cases, initialize the variable explicitly. We could
call MY_INIT, however some memory is leaked on test program exit in that
case. Instead, factor just enough to be able to initialize THR_KEY_mysys
from the test code (as well as from the library code).

bb-11.5-MDEV-33151-userstat 2024-04-15 18:12:26 UTC
MDEV-33913 TABLE_STATISTICS increments ROWS_CHANGED twice upon UPDATE and doe...

Author: Elena Stepanova
Author Date: 2024-04-15 18:12:26 UTC

MDEV-33913 TABLE_STATISTICS increments ROWS_CHANGED twice upon UPDATE and does not count DELETE

bb-10.5-knielsen 2024-04-15 16:54:30 UTC
Fix windows build failure

Author: Kristian Nielsen
Author Date: 2024-04-15 16:54:30 UTC

Fix windows build failure

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>

11.4-macos-test-exclusion-mechanism 2024-04-15 15:57:07 UTC
MTR flag to mark tests as incompatible with macOS

Author: Dave Gosselin
Author Date: 2024-03-07 20:31:26 UTC

MTR flag to mark tests as incompatible with macOS

Introduces a new MTR include, not_mac.inc, which when included
at the top of a test, prevents that test from running on macOS.

bb-11.4-release 2024-04-15 08:12:29 UTC
and even more fixes

Author: Oleksandr "Sanja" Byelkin
Author Date: 2024-04-12 12:43:21 UTC

and even more fixes

11.4-mdev-32777 2024-04-12 19:13:31 UTC
MDEV-32777 DDL operations very slow under macOS

Author: Dave Gosselin
Author Date: 2024-03-18 17:03:33 UTC

MDEV-32777 DDL operations very slow under macOS

macOS is a development platform for our product but calls to
fcntl(F_FULLFSYNC) are too slow for developer needs. macOS offers
at least three different disk flush calls, making tradeoffs between
reliability and performance (see analysis notes on this MDEV).
On macOS only and as a compromise, we will back out the change to
call fcntl(F_FULLFSYNC), sacrificing a full flush in favor of more
performant writes.

bb-11.6-monty 2024-04-12 16:23:05 UTC
Added Lock_time_ms and Table_catalog columns to metadata_lock_info

Author: Monty
Author Date: 2024-04-12 15:59:59 UTC

Added Lock_time_ms and Table_catalog columns to metadata_lock_info

If compiled for debugging, LOCK_DURATION is also filled in.

10.11-monty 2024-04-12 15:59:59 UTC
Added Lock_time_ms and Table_catalog columns to metadata_lock_info

Author: Monty
Author Date: 2024-04-12 15:59:59 UTC

Added Lock_time_ms and Table_catalog columns to metadata_lock_info

If compiled for debugging, LOCK_DURATION is also filled in.

bb-10.5-MDEV-33677-galera 2024-04-11 12:56:40 UTC
MDEV-33677 : Port Performance Schema for Galera from ES

Author: Julius Goryavsky
Author Date: 2021-06-20 22:54:11 UTC

MDEV-33677 : Port Performance Schema for Galera from ES

Added performance schema tables for Galera.
This is a port of the code from ES 10.6

Refs:
MENT-346 commit 86c06851
MENT-346 commit 10d0fcaf
MENT-1333 commit 2005adc3
MENT-347 commit aaca43b4
MENT-1370 commit 1f460e6b

bb-10.4-MDEV-30732-galera 2024-04-11 12:26:39 UTC
MDEV-30732: additional changes after fix

Author: Julius Goryavsky
Author Date: 2024-04-10 04:32:06 UTC

MDEV-30732: additional changes after fix

bb-10.5-release-spider-fix 2024-04-11 00:09:40 UTC
[merge fix] MDEV-33728 redundant macros MYSQL_VERSION_ID etc.

Author: Yuchen Pei
Author Date: 2024-04-11 00:09:40 UTC

[merge fix] MDEV-33728 redundant macros MYSQL_VERSION_ID etc.

generated by

unifdef -DMYSQL_VERSION_ID=100500 -DMARIADB_BASE_VERSION -m storage/spider/spd_* storage/spider/ha_spider.* storage/spider/hs_client/*

bb-10.5-bar 2024-04-10 18:21:51 UTC
MDEV-32458 ASAN unknown-crash in Inet6::ascii_to_fbt when casting character s...

Author: Alexander Barkov
Author Date: 2024-04-10 13:58:36 UTC

MDEV-32458 ASAN unknown-crash in Inet6::ascii_to_fbt when casting character string to inet6

The condition checked the value of the leftmost byte before checking if
at least one byte is still available in the buffer.
Changing the order in the condition: check for a byte availability before
checking the byte value.

bb-10.5-andrei 2024-04-10 16:31:39 UTC
MDEV-31779 Server crash in Rows_log_event::update_sequence upon replaying bi...

Author: Andrei
Author Date: 2024-04-10 15:19:43 UTC

 MDEV-31779 Server crash in Rows_log_event::update_sequence upon replaying binary log

The crash at running mysqlbinlog on a SEQUENCE containing binlog file
was caused MDEV-29621 fixes that did not check which of the slave
or binlog applier executes a block introduced there.

The block is meaningful only for the parallel slave applier, so
it's safe to fix this bug with identified the actual applier and
skipping the block when it's the mysqlbinlog one.

knielsen_mdev32020 2024-04-10 14:12:20 UTC
MDEV-32020: Partial commit, start of slave-side XA replication

Author: Kristian Nielsen
Author Date: 2024-04-10 14:12:20 UTC

MDEV-32020: Partial commit, start of slave-side XA replication

The slave can replicate prepared xa data by simply binlogging the data.
The slave can apply the committed xa as normal trx, but preserving XID on the GTID.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>

bb-11.4-MDEV-30260-mergefix 2024-04-10 11:51:28 UTC
reb

Author: Brandon Nesterenko
Author Date: 2024-04-10 11:51:28 UTC

reb

bb-11.5-mdev-31609 2024-04-10 01:13:46 UTC
MDEV-31609 Send initial values of system variables in first OK packet

Author: Yuchen Pei
Author Date: 2024-03-01 01:59:21 UTC

MDEV-31609 Send initial values of system variables in first OK packet

Values of all session tracking system variables will be sent in the
first ok packet upon connection after successful authentication.

Also updated mtr to print session track info on connection (h/t Sergei
Golubchik) so that we can write mtr tests for this change.

bb-10.11-MDEV-30260-mergefix 2024-04-09 20:51:08 UTC
MDEV-30260: Slave crashed:reload_acl_and_cache during shutdown

Author: Brandon Nesterenko
Author Date: 2024-04-08 19:04:59 UTC

MDEV-30260: Slave crashed:reload_acl_and_cache during shutdown

The signal handler thread can use various different runtime
resources when processing a SIGHUP (e.g. master-info information)
due to calling into reload_acl_and_cache(). Currently, the shutdown
process waits for the termination of the signal thread after
performing cleanup. However, this could cause resources actively
used by the signal handler to be freed while reload_acl_and_cache()
is processing.

The specific resource that caused MDEV-30260 is a race condition for
the hostname_cache, such that mysqld would delete it in
clean_up()::hostname_cache_free(), before the signal handler would
use it in reload_acl_and_cache()::hostname_cache_refresh().

Another similar resource is the active_mi/master_info_index. There
was a race between its deletion by the main thread in end_slave(),
and their usage by the Signal Handler as a part of
Master_info_index::flush_all_relay_logs.read(active_mi) in
reload_acl_and_cache().

This patch fixes these race conditions by relocating where server
shutdown waits for the signal handler to die until after
server-level threads have been killed (i.e., as a last step of
close_connections()). With respect to the hostname_cache, active_mi
and master_info_cache, this ensures that they cannot be destroyed
while the signal handler is still active, and potentially using
them.

Additionally:

 1) This requires that Events memory is still in place for SIGHUP
handling's mysql_print_status(). So event deinitialization is moved
into clean_up(), but the event scheduler still needs to be stopped
in close_connections() at the same spot.

 2) The function kill_server_thread is no longer used, so it is
deleted

 3) The timeout to wait for the death of the signal thread was not
consistent with the comment. The comment mentioned up to 10 seconds,
whereas it was actually 0.01s. The code has been fixed to wait up to
10 seconds.

 4) A warning has been added if the signal handler thread fails to
exit in time.

 5) Added pthread_join() to end of wait_for_signal_thread_to_end()
if it hadn't ended in 10s with a warning. Note this also removes
the pthread_detached attribute from the signal_thread to allow
for the pthread_join().

Reviewed By:
===========
Vladislav Vaintroub <wlad@mariadb.com>
Andrei Elkin <andrei.elkin@mariadb.com>

bb-10.6-MDEV-30260-mergefix 2024-04-09 20:28:39 UTC
MDEV-30260: Slave crashed:reload_acl_and_cache during shutdown

Author: Brandon Nesterenko
Author Date: 2024-04-08 19:04:59 UTC

MDEV-30260: Slave crashed:reload_acl_and_cache during shutdown

The signal handler thread can use various different runtime
resources when processing a SIGHUP (e.g. master-info information)
due to calling into reload_acl_and_cache(). Currently, the shutdown
process waits for the termination of the signal thread after
performing cleanup. However, this could cause resources actively
used by the signal handler to be freed while reload_acl_and_cache()
is processing.

The specific resource that caused MDEV-30260 is a race condition for
the hostname_cache, such that mysqld would delete it in
clean_up()::hostname_cache_free(), before the signal handler would
use it in reload_acl_and_cache()::hostname_cache_refresh().

Another similar resource is the active_mi/master_info_index. There
was a race between its deletion by the main thread in end_slave(),
and their usage by the Signal Handler as a part of
Master_info_index::flush_all_relay_logs.read(active_mi) in
reload_acl_and_cache().

This patch fixes these race conditions by relocating where server
shutdown waits for the signal handler to die until after
server-level threads have been killed (i.e., as a last step of
close_connections()). With respect to the hostname_cache, active_mi
and master_info_cache, this ensures that they cannot be destroyed
while the signal handler is still active, and potentially using
them.

Additionally:

 1) This requires that Events memory is still in place for SIGHUP
handling's mysql_print_status(). So event deinitialization is moved
into clean_up(), but the event scheduler still needs to be stopped
in close_connections() at the same spot.

 2) The function kill_server_thread is no longer used, so it is
deleted

 3) The timeout to wait for the death of the signal thread was not
consistent with the comment. The comment mentioned up to 10 seconds,
whereas it was actually 0.01s. The code has been fixed to wait up to
10 seconds.

 4) A warning has been added if the signal handler thread fails to
exit in time.

 5) Added pthread_join() to end of wait_for_signal_thread_to_end()
if it hadn't ended in 10s with a warning. Note this also removes
the pthread_detached attribute from the signal_thread to allow
for the pthread_join().

Reviewed By:
===========
Vladislav Vaintroub <wlad@mariadb.com>
Andrei Elkin <andrei.elkin@mariadb.com>

bb-10.11-MDEV-33672-mergefix 2024-04-09 17:35:22 UTC
MDEV-33672: 10.11 Fix for Two Phase Alter Flags

Author: Brandon Nesterenko
Author Date: 2024-04-09 17:35:22 UTC

MDEV-33672: 10.11 Fix for Two Phase Alter Flags

Extends 89c907bd4f713b77e248f7c8e6247b5f3be18fb4 to account for
binlog_two_phase_alter flags in a Gtid log event. I.e., if the
FL_COMMIT_ALTER_E1 or FL_ROLLBACK_ALTER_E2 flags are set in the
event flags, yet the length of the event is too short to hold
the value, then set the event as invalid

bb-10.4-mdev-32401 2024-04-09 13:45:53 UTC
MDEV-32401: expression cache heap-use-after-free

Author: Dave Gosselin
Author Date: 2024-01-26 16:13:48 UTC

MDEV-32401: expression cache heap-use-after-free

Queries selecting a TEXT column by alias, then joining that with a subquery
referencing the same alias may invoke a subquery expression cache. Typically,
these caches expect to rely on heap memory for their backing temporary table,
but TEXT (and BLOB) types require an ARIA backing; in this case, a crash may
result. Such a query may look like:

SELECT t1.d FROM (SELECT c AS d FROM t0) AS t1 JOIN t0 ON (
  SELECT ORD((SELECT BIT_OR(d))) FROM t0 GROUP BY d
);

This patch checks if there are blob types present before attempting to create
the SQL expression cache and if so, it does not, leaving the associated item
cache transparent.

The Expression_cache_tmptable implements the Expression_cache using a temporary
table. During Expression_cache_tmptable::init, we expect the created temporary
table to have the heap handlerton. However, for the crash in this ticket, it
is created using the ARIA handlerton instead. This happens because the
Create_tmp_table::choose_engine selects the ARIA engine because the temporary
table's associated TABLE_SHARE indicates that there are BLOB fields present.
This is true because TEXT fields are handled in the same way as BLOB fields in
our system; in our grammar, both TEXT and BLOB types rely on the
type_handler_blob handler. After the temporary table is created and the engine
associated with it, we then invoke move_field on each field associated with
the TABLE_SHARE. However, once this is complete and we return to
Expression_cache_tmptable::init, we check to see that the heap hton is used as
expected and it is not: so we delete the temporary table. Unfortunately, this
leaves the pointers inside the Field objects dangling, and we crash later as
indicated in the stack traces on this ticket. Non-BLOB types avoid this
problem because they end up with a temporary table backed by the heap
handlerton.

1100 of 2368 results

Other repositories

Name Last Modified
lp:maria 2 hours ago
lp:~maria-captains/maria/+git/connector-c 2018-01-08
12 of 2 results
You can't create new repositories for MariaDB.