lp:maria

Owned by Maria-captains
Get this repository:
git clone https://git.launchpad.net/maria

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-4 and finished taking 9 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-1 and finished taking 6 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 13 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 13 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 10 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 5 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 14 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 13 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 9 minutes — see the log

Branches

Name Last Modified Last Commit
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.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.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.

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.

10.5-mdev-32403 2024-04-09 13:43:29 UTC
MDEV-32397, MDEV-32403 Crashes during join processing.

Author: Dave Gosselin
Author Date: 2024-04-03 17:16:25 UTC

MDEV-32397, MDEV-32403 Crashes during join processing.

Queries having the following form may cause a crash
  SELECT t1.a FROM ( SELECT a AS a1 FROM t1 ) dt
  JOIN t1 ON a1 LIKE EXISTS ( SELECT a + RAND () FROM t1 UNION SELECT a FROM t1);
because the table t1 has some JOIN cleanup operations performed prematurely
during the subselect.

In this particular case, the presence of RAND() makes the subquery
uncacheable, necessitating the need to execute the subquery multiple
times during join record evaluation. Each time the subquery runs, it
creates its own JOIN structure which has references to the table t1.
When the subquery completes, JOIN::cleanup and functions called by it
result in ha_end_keyread() being called on table t1. However, we are
not done with table t1 because the upper level `select t1.a from...`
query requires table t1 to be open. To solve this, we make the executor
aware of when we're in subqueries like this and delay JOIN cleanup
until the end of the query.

bb-11.2-release 2024-04-09 10:12:33 UTC
Merge branch '11.1' into 11.2

Author: Oleksandr "Sanja" Byelkin
Author Date: 2024-04-09 10:12:33 UTC

Merge branch '11.1' into 11.2

bb-10.4-mdev-29363-no-prop-subquery 2024-04-09 06:43:18 UTC
MDEV-29363 [demo] avoid equality propagation of items with subqueries

Author: Yuchen Pei
Author Date: 2024-04-09 06:43:18 UTC

MDEV-29363 [demo] avoid equality propagation of items with subqueries

We update one place to avoid equality propagation of items with
subqueries. It may not be thorough, but is sufficient for the
counterexample in this demo: simply run tests on
main.multiple_equality and notice how it fails in the MDEV-32539 case.

bb-10.5-MDEV-30646 2024-04-08 13:42:28 UTC
MDEV-30646: View created via JSON_ARRAYAGG returns incorrect json object

Author: Rucha Deodhar
Author Date: 2024-04-08 13:42:28 UTC

MDEV-30646: View created via JSON_ARRAYAGG returns incorrect json object

Analysis:
For the JSON typehandler ::type_handler_for_tmp_table() returns
plain VARCHAR. Hence so the VARCHAR field is created in the temporary table.
So 'is_json_type()' check in the append_json_value() fails and we end up
quoting the string additionally.
Fix:
Force treat it as json, because append_json_value() will of course always
append json.

bb-11.5-bar-MDEV-11339 2024-04-08 09:21:59 UTC
Fixup 2: MDEV-11339 Implement native UUID4 function

Author: Alexander Barkov
Author Date: 2024-04-05 06:18:28 UTC

Fixup 2: MDEV-11339 Implement native UUID4 function

Adding a template Item_func_uuid_vx to share the code
between the implementations of UUID() and UUIDv4().

bb-11.5-mdev-33734 2024-04-08 06:30:22 UTC
MDEV-33734 Improve the sequence increment inequality testing

Author: Yuchen Pei
Author Date: 2024-03-26 03:37:17 UTC

MDEV-33734 Improve the sequence increment inequality testing

We add an extra condition that makes the inequality testing in
SEQUENCE::increment_value() mathematically watertight, and we cast to
and from unsigned in potential underflow and overflow addition and
subtractions to avoid undefined behaviour.

Let's start by distinguishing between c++ expressions and mathematical
expressions. by c++ expression I mean an expression with the outcome
determined by the compiler/runtime. by mathematical expression I mean
an expression whose value is mathematically determined. So a c++
expression -9223372036854775806 - 1000 at worst can evaluate to any
value due to underflow. A mathematical expression -9223372036854775806
- 1000 evaluates to -9223372036854776806.

The problem boils down to how to write a c++ expression equivalent to
an mathematical expression x + y < z where x and z can take any values
of long long int, and y < 0 is also a long long int. Ideally we want
to avoid underflow, but I'm not sure how this can be done.

The correct c++ form should be (x + y < z || x < z - y || x < z).
Let M=9223372036854775808 i.e. LONGLONG_MAX + 1. We have

-M < x < M - 1
-M < y < 0
-M < z < M - 1

Let's consider the case where x + y < z is true as a mathematical
expression.

If the first disjunct underflows, i.e. the mathematical expression x
+ y < -M. If the arbitrary value resulting from the underflow causes
the c++ expression to hold too, then we are done. Otherwise we move
onto the next expression x < z - y. If there's no overflow in z
- y then we are done. If there's overflow i.e. z - y > M - 1,
and the c++ expression evals to false, then we are onto x < z.
There's no over or underflow here, and it will eval to true. To see
this, note that

x + y < -M means x < -M - y < -M - (-M) = 0
z - y > M - 1 means z > y + M - 1 > - M + M - 1 = -1
so x < z.

Now let's consider the case where x + y < z is false as a mathematical
expression.

The first disjunct will not underflow in this case, so we move to (x <
z - y). This will not overflow. To see this, note that

x + y >= z means z - y <= x < M - 1

So it evals to false too. And the third disjunct x < z also evals to
false because x >= z - y > z.

I suspect that in either case the expression x < z does not determine
the final value of the disjunction in the vast majority cases, which
is why we leave it as the final one in case of the rare cases of both
an underflow and an overflow happening.

Here's an example of both underflow and overflow happening and the
added inequality x < z saves the day:

x = - M / 2
y = - M / 2 - 1
z = M / 2

x + y evals to M - 1 which is > z
z - y evals to - M + 1 which is < x

We can do the same to test x + y > z where the increment y is positive:

(x > z - y || x + y > z || x > z)

And the same analysis applies to unsigned cases.

bb-10.4-mdev-33679 2024-04-08 04:25:17 UTC
MDEV-33679 Spider group by handler: skip on multiple equalities

Author: Yuchen Pei
Author Date: 2024-03-18 02:11:49 UTC

MDEV-33679 Spider group by handler: skip on multiple equalities

The spider group by handler is created in
JOIN::make_aggr_tables_info(), by which time calls to
substitute_for_best_equal_field() should have already removed all the
multiple equalities (i.e. Item_equal, with MULT_EQUAL_FUNC func_type).
Therefore, if there is still such items, it is deemed as an optimizer
bug and should be skipped.

bb-10.4-mdev-33728 2024-04-08 04:21:59 UTC
MDEV-33728 spider: remove use of MYSQL_VERSION_ID and MARIADB_BASE_VERSION

Author: Yuchen Pei
Author Date: 2024-03-20 03:03:52 UTC

MDEV-33728 spider: remove use of MYSQL_VERSION_ID and MARIADB_BASE_VERSION

change created by:

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

basically MDEV-27637, MDEV-27641, MDEV-27655

bb-10.4-mdev-28992 2024-04-08 04:15:34 UTC
MDEV-28992 Spider group by handler: Push down TIMESTAMPDIFF function

Author: Yuchen Pei
Author Date: 2024-03-19 23:36:25 UTC

MDEV-28992 Spider group by handler: Push down TIMESTAMPDIFF function

Also removed ITEM_FUNC_TIMESTAMPDIFF_ARE_PUBLIC.

Similar to pr#2225, with the testcase adapted from that patch:

--8<---------------cut here---------------start------------->8---
From 884f7c6df16236748ca975339e0b1c267e195309 Mon Sep 17 00:00:00 2001
From: "Norio Akagi (norakagi)" <norakagi@amazon.com>
Date: Wed, 3 Aug 2022 23:30:34 -0700
Subject: [PATCH] [MDEV-28992] Push down TIMESTAMP_DIFF in spider

This changes so that TIMESTAMP_DIFF function in a query is pushed down and works natively in Spider.
Instead of directly accessing item's member, now we can rely on a public accessor method to make it work.
Unit tests are added under spider.pushdown_timestamp_diff.

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.
--8<---------------cut here---------------end--------------->8---

bb-11.0-MDEV-31793-fix-loosescan-derived 2024-04-08 02:46:57 UTC
MDEV-31793 LooseScan join on derived table crashes

Author: Rex Johnston
Author Date: 2024-04-08 02:46:57 UTC

MDEV-31793 LooseScan join on derived table crashes

Test to see if not adding the offending key on the end has any consequences.

knielsen_xa_sched_minimal_fix 2024-04-06 18:03:07 UTC
MDEV-33668: More efficient XA dependency tracking in SQL driver thread

Author: Kristian Nielsen
Author Date: 2024-04-05 16:06:40 UTC

MDEV-33668: More efficient XA dependency tracking in SQL driver thread

Avoid linear scan of all recently queued XIDs in the SQL driver thread,
which might be expensive in XA-heavy workloads and large number of parallel
replication worker threads.

Instead keep a hash in the rpl_parallel_entry of where recently queued XIDs
were scheduled. This allows direct lookup of any potential scheduling
dependency.

Keep a list in each scheduling bucket of recently queued XIDs, and purge the
list (based on generations) when queueing next XA.

Also implement a more fine-grained dependency check based on sub_id
comparison. This can sometimes avoid a scheduling dependency that would
otherwise look necessary based solely on the generation check.

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

bb-10.4-MDEV-28621 2024-04-05 22:50:50 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.

10.4-MDEV-20094 2024-04-05 11:19:49 UTC
MDEV-20094 InnoDB blob allocation allocates extra extents

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2024-04-05 10:39:56 UTC

MDEV-20094 InnoDB blob allocation allocates extra extents

- InnoDB reserves the free extents unnecessarily during blob
page allocation even though btr_page_alloc() can handle
reserving the extent when the existing ran out of pages to be used.

bb-10.6-MDEV-33828-galera 2024-04-05 11:10:32 UTC
galera: wsrep-lib submodule update

Author: Julius Goryavsky
Author Date: 2024-04-05 11:10:32 UTC

galera: wsrep-lib submodule update

bb-10.5-MDEV-33216-galera 2024-04-05 11:04:55 UTC
MDEV-33216 stack-use-after-return in Wsrep_schema_impl::open_table()

Author: Daniele Sciascia
Author Date: 2024-01-10 13:34:12 UTC

MDEV-33216 stack-use-after-return in Wsrep_schema_impl::open_table()

Fix a case of stack-use-after-return reported by ASAN in
Wsrep_schema_impl::open_table(). This function has a stack allocated
TABLE_LIST object and return TABLE_LIST::table to the caller.
Changed the function to take a TABLE_LIST pointer as argument.

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

bb-10.6-MDEV-33216-galera 2024-04-05 10:56:59 UTC
MDEV-33216 stack-use-after-return in Wsrep_schema_impl::open_table()

Author: Daniele Sciascia
Author Date: 2024-01-10 13:34:12 UTC

MDEV-33216 stack-use-after-return in Wsrep_schema_impl::open_table()

Fix a case of stack-use-after-return reported by ASAN in
Wsrep_schema_impl::open_table(). This function has a stack allocated
TABLE_LIST object and return TABLE_LIST::table to the caller.
Changed the function to take a TABLE_LIST pointer as argument.

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

10.4-MDEV-14231 2024-04-05 10:51:51 UTC
MDEV-14231 MATCH() AGAINST( IN BOOLEAN MODE), results mismatch

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2024-04-05 09:45:22 UTC

MDEV-14231 MATCH() AGAINST( IN BOOLEAN MODE), results mismatch

st_mysql_ftparser_boolean_info(): Add variable position to
store the correct offset for the default fts parser.

Added plugin_debug.test, multiple_index.test from mysql-5.7

10.4-MDEV-14321 2024-04-05 10:50:15 UTC
MDEV-14321 MATCH() AGAINST( IN BOOLEAN MODE), results mismatch

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2024-04-05 09:45:22 UTC

MDEV-14321 MATCH() AGAINST( IN BOOLEAN MODE), results mismatch

st_mysql_ftparser_boolean_info(): Add variable position to
store the correct offset for the default fts parser.

Added plugin_debug.test, multiple_index.test from mysql-5.7

bb-11.5-bar-MDEV-33827 2024-04-05 03:10:35 UTC
MDEV-33827 UUID() returns a NULL-able result

Author: Alexander Barkov
Author Date: 2024-04-04 13:13:09 UTC

MDEV-33827 UUID() returns a NULL-able result

It was wrong to derive Item_func_uuid from Item_func_sys_guid,
because the former is a function returning the UUID data type,
while the latter is a string function returning VARCHAR.

As a result of the wrong hierarchy, Item_func_uuid erroneously derived
Item_str_func::fix_fields(), which contains this code:

  /*
    In Item_str_func::check_well_formed_result() we may set null_value
    flag on the same condition as in test() below.
  */
  if (thd->is_strict_mode())
    set_maybe_null();

This code is not relevant to UUID() at all.
A simple fix would be to set_maybe_null(false) in
Item_func_uuid::fix_length_and_dec(). However,
it'd fix only exactly this single consequence of the wrong
class hierarchy, and similar bugs could appear again in
the future. Moreover, we're going to add functions UUIDv4()
and UUIDv7() soon (in 11.6). So it's better to fix the class hierarchy
in the right way before adding these new functions.

Fix:

- Adding a new abstract class Item_fbt_func in the template
  in sql_type_fixedbin.h
- Deriving Item_typecast_fbt from Item_fbt_func
- Deriving Item_func_uuid from Item_fbt_func
- Adding a new helper class UUIDv1. It derives from UUID, and additionally
  initializes the value to "UUID version 1" right in the constructor.
  Note, the new coming soon SQL functions UUIDv4() and UUIDv7()
  will also have corresponding classes UUIDv4 and UUIDv7.

So now UUID() is a pure "returning UUID" function,
like CAST(expr AS UUID) used to be, without any unintentional
artifacts of functions returning VARCHAR/TEXT.

Cleanup:
- Removing the member Item_func_sys_guid::with_dashes,
  as it's not needed any more:
  * Item_func_sys_guid now does not have any descendants any more
  * Item_func_sys_guid::val_str() itself always displays without dashes

bb-10.5-monty 2024-04-04 14:12:09 UTC
MDEV-33749 hyphen in table name can cause galera certification failures

Author: sjaakola
Author Date: 2024-04-04 14:12:09 UTC

MDEV-33749 hyphen in table name can cause galera certification failures

Fix in this commit handles foreign key value appending into write set
so that db and table names are converted from the filepath format
to tablename format. This is compatible with key values appended from
elsewhere in the code base

There is a mtr test galera.galera_table_with_hyphen for regression testing

Reviewer: monty@mariadb.com

bb-11.4-vec-vicentiu 2024-04-04 07:08:40 UTC
Vec insert and search working on a multi-layer

Author: Vicențiu Ciorbaru
Author Date: 2024-02-23 09:46:46 UTC

Vec insert and search working on a multi-layer

11.0 2024-04-04 06:13:19 UTC
Merge 10.11 into 11.0

Author: Marko Mäkelä
Author Date: 2024-04-04 06:13:19 UTC

Merge 10.11 into 11.0

bb-10.11-MDEV-33799-mergefix 2024-04-03 19:21:43 UTC
MDEV-33799: mysql_manager_submit Segfault at Startup Still Possible During Re...

Author: Brandon Nesterenko
Author Date: 2024-04-01 15:46:50 UTC

MDEV-33799: mysql_manager_submit Segfault at Startup Still Possible During Recovery

MDEV-26473 fixed a segmentation fault at startup between the handle
manager thread and the binlog background thread, such that the
binlog background thread could be started and submit a job to the
handle manager, before it had initialized. Where MDEV-26473 made it
so the handle manager would initialize before the main thread
started the normal binary logs, it did not account for the recovery
case. That is, there is still a possibility of a segmentation fault
when a server is recovering using the binary logs such that it can
open the binary logs, start the binlog background thread, and submit
a job to the handle manager before it is initialized.

This patch fixes this by moving the initialization of the mysql
handler manager to happen prior to recovery.

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

bb-10.11-midenok 2024-04-03 13:49:44 UTC
Columnstore empty submodule fix 2

Author: midenok
Author Date: 2024-04-03 13:39:36 UTC

Columnstore empty submodule fix 2

Original problem was error when configuring without initialized
submodule Columnstore:

  The source directory

    /home/midenok/src/mariadb/10.6c/src/storage/columnstore/columnstore

  does not contain a CMakeLists.txt file.

The original fix disabled Columnstore build when PLUGIN_COLUMNSTORE
was not defined, but this seems to be wrong and any plugin should be
built if it is not explicitly disabled. This is expected by buildbots.

Thanks to Vladislav Vaintroub <vvaintroub@gmail.com> for the fix

bb-10.6-MDEV-33802-unique-cursor-restore 2024-04-03 11:24:11 UTC
MDEV-33802 Weird read view after ROLLBACK of another transaction

Author: Marko Mäkelä
Author Date: 2024-04-02 06:54:56 UTC

MDEV-33802 Weird read view after ROLLBACK of another transaction

Even after commit b8a671988954870b7db22e20d1a1409fd40f8e3d there
is an anomaly where a locking read could return inconsistent results.
If a locking read would have to wait for a record lock, then by the
definition of a read view, the modifications made by the current lock
holder cannot be visible in the read view. This is because the read
view must exclude any transactions that had not been committed at the
time when the read view was created.

lock_rec_convert_impl_to_expl_for_trx(), lock_rec_convert_impl_to_expl():
Return an unsafe-to-dereference pointer to a transaction that holds or
held the lock, or nullptr if the lock was available.

lock_clust_rec_modify_check_and_lock(),
lock_sec_rec_read_check_and_lock(),
lock_clust_rec_read_check_and_lock():
Return DB_RECORD_CHANGED if innodb_strict_isolation=ON and the
lock was being held by another transaction.

The test case, which is based on a bug report by Zhuang Liu,
covers the function lock_sec_rec_read_check_and_lock().

bb-11.5-mdev-22168 2024-04-02 10:04:15 UTC
test if the find_select_handler is actually working

Author: Alexey Botchkov
Author Date: 2024-04-02 10:04:15 UTC

test if the find_select_handler is actually working

    (expecially for the partition engine)
       Seems it implemented for the federatedex egngine only.

bb-11.5-bar-preview 2024-04-02 06:53:02 UTC
MDEV-33701 upgrades from 11.4 to 11.5 don't work

Author: Alexander Barkov
Author Date: 2024-03-29 09:28:40 UTC

MDEV-33701 upgrades from 11.4 to 11.5 don't work

A user variable and a literal with different collation
produce an illegal mix of collation error.
Rewriting the script to avoid such arguments.

bb-11.4-midenok 2024-04-01 23:51:18 UTC
MDEV-33125 CHECK TABLE does not recognize corruption

Author: midenok
Author Date: 2024-04-01 23:51:18 UTC

MDEV-33125 CHECK TABLE does not recognize corruption
after EXCHANGE WITHOUT VALIDATION on system-time partitioning

MDEV-21011 disabled this check if there is no INTERVAL on history
partitions as the rows may be in any history partition. Now we
reenable the check and allow this condition.

bb-10.5-MDEV-33010 2024-04-01 07:53:54 UTC
MDEV-33010 Condition with CHARSET()/COERCIBILITY() erroneously pushed into de...

Author: Oleg Smirnov
Author Date: 2024-04-01 07:03:46 UTC

MDEV-33010 Condition with CHARSET()/COERCIBILITY() erroneously pushed into derived table

Based on the current logic, objects of classes Item_func_charset and
Item_func_coercibility (responsible for CHARSET() and COERCIBILITY()
functions) are always considered const.
However, SQL syntax allows their use in a non-constant manner, such as
CHARSET(t1.a), COERCIBILITY(t1.a), and similar.

This "const-forcing" was introduced with
commit aa1002a35cefcc1851cbfb6b6b60463bda6f9aa3.

When those objects are erroneously deemed const, it could lead to
unwanted consequences like pushing down conditions to materialized
derived tables illegitimately.

This commits removes the "const-forcing" for Item_func_charset and
Item_func_coercibility, making them determine their constness in
the general way

bb-11.5-bar-MDEV-25829 2024-04-01 06:18:54 UTC
Cherry-picking from 10.5: MDEV-33788 HEX(COLUMN_CREATE(.. AS CHAR ...)) fails...

Author: Alexander Barkov
Author Date: 2024-03-28 10:01:43 UTC

Cherry-picking from 10.5: MDEV-33788 HEX(COLUMN_CREATE(.. AS CHAR ...)) fails with --view-protocol

Item_func_dyncol_create::print_arguments() printed only CHARSET clause
without COLLATE.

Therefore,

HEX(column_create(1,'1212' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin))

inside a VIEW changed to just:

HEX(column_create(1,'1212' AS CHAR CHARACTER SET utf8mb3))

which changed the collation ID seen in the HEX output.

Note, the collation ID inside column_create() is not really much important.
(It's only important what the character set is).
And for COLLATE, the more important thing is what's later written
in the AS clause of COLUMN_GET:

SELECT
   COLUMN_GET(
    column_create(1,'1212' AS CHAR CHARACTER SET utf8mb3 COLLATE utf8mb3_bin)
    column_nr AS type -- this type is more important
   );

Still, let's add the COLLATE clause into the COLUMN_CREATE() print output,
although it's not important for now for anything else than just the HEX output.
At least to make VIEW work in a more predictable way with HEX(COLUMN_CREATE()).

Also, in the future we can start using somehow the collation ID written inside
COLUMN_CREATE(), for example by making the `AS type` clause optional in
COLUMN_GET():
  COLUMN_GET(dyncol_blob, column_nr [AS type]);
instead of:
  COLUMN_GET(dyncol_blob, column_nr AS type);

SQL Server compatibility layer may need this for
the SQL_Variant data type support.

bb-11.5-all-builders 2024-03-30 15:17:22 UTC
A build of MDEV-33655 + MDEV-33449 + MDEV-32188 for better coverage

Author: Elena Stepanova
Author Date: 2024-03-30 15:17:22 UTC

A build of MDEV-33655 + MDEV-33449 + MDEV-32188 for better coverage

And for getting packages stored

bb-10.5-elenst 2024-03-30 12:58:50 UTC
Test commit

Author: Elena Stepanova
Author Date: 2024-03-30 12:58:50 UTC

Test commit

10.6-MDEV-33796-deadlock_in_subqueries_join 2024-03-29 12:02:44 UTC
MDEV-33796 innodb.deadlock_in_subqueries_join fails

Author: Vlad Lesin
Author Date: 2024-03-29 12:02:44 UTC

MDEV-33796 innodb.deadlock_in_subqueries_join fails

It looks like the following code is not strict enough for assuring that a
statement is locked:

let $wait_condition=
  SELECT count(*) = 1 FROM information_schema.processlist
  WHERE (state = 'Sending data' OR state = "Updating")
  AND (info LIKE 'delete from t2 where%' OR
       info LIKE 'UPDATE t2 SET pkey=pkey+10 WHERE%');
--source include/wait_condition.inc

Use debug syncpoints instead.

11.1 2024-03-28 10:15:36 UTC
Merge 11.0 into 11.1

Author: Marko Mäkelä
Author Date: 2024-03-28 10:15:36 UTC

Merge 11.0 into 11.1

bb-11.4-midenok-MDEV-20865 2024-03-27 19:56:10 UTC
MDEV-33780 Server crashes on renaming of table if table is locked

Author: midenok
Author Date: 2024-03-27 19:55:38 UTC

MDEV-33780 Server crashes on renaming of table if table is locked

Under LOCK TABLES there is no ticket for old_table.

bb-10.5-ycp 2024-03-27 02:41:44 UTC
MDEV-33731 Only iterate over m_locked_partitions in update_next_auto_inc_val()

Author: Yuchen Pei
Author Date: 2024-03-27 02:41:44 UTC

MDEV-33731 Only iterate over m_locked_partitions in update_next_auto_inc_val()

bb-10.4-ycp 2024-03-27 00:25:15 UTC
MDEV-33777 Spider: Correct checks for show index column numbers

Author: Yuchen Pei
Author Date: 2024-03-27 00:15:25 UTC

MDEV-33777 Spider: Correct checks for show index column numbers

It was updated for 10.6+ in MDEV-7317. Because a lower version spider
node may connect to a higher version data node, we need to change this
for 10.4 and 10.5 as well.

bb-10.5-mdev-33777 2024-03-27 00:15:25 UTC
MDEV-33777 Spider: Correct checks for show index column numbers

Author: Yuchen Pei
Author Date: 2024-03-27 00:15:25 UTC

MDEV-33777 Spider: Correct checks for show index column numbers

It was updated for 10.6+ in MDEV-7317. Because a lower version spider
node may connect to a higher version data node, we need to change this
for 10.4 and 10.5 as well.

bb-11.5-midenok 2024-03-26 11:20:05 UTC
MDEV-27293 Allow converting a versioned table from implicit

Author: midenok
Author Date: 2024-03-13 22:39:14 UTC

MDEV-27293 Allow converting a versioned table from implicit
           to explicit row_start/row_end columns

In case of adding both system fields of same type (length, unsigned
flag) as old implicit system fields do the rename of implicit system
fields to the ones specified in ALTER, remove SYSTEM_INVISIBLE flag in
that case. Correct PERIOD clause must be specified in ALTER as well.

bb-10.5-hf 2024-03-26 10:00:19 UTC
MDEV-33393 audit plugin do not report user did the action.

Author: Alexey Botchkov
Author Date: 2024-03-07 12:02:35 UTC

MDEV-33393 audit plugin do not report user did the action.

Specific test for the auditing plugin v1 instead of the rpl_auditing
test.

bb-10.6-MDEV-28621-v3-eliminate-carefully 2024-03-26 07:52:25 UTC
MDEV-28621: group by optimization incorrectly removing subquery

Author: Sergey Petrunia
Author Date: 2024-03-25 10:53:55 UTC

MDEV-28621: group by optimization incorrectly removing subquery

Try a different approach at removal: remove only "local" subqueries
for which we can't find any other references in the select list.

bb-10.6-MDEV-33136-galera 2024-03-26 05:46:20 UTC
MDEV-33136: Properly BF-abort user transactions with explicit locks

Author: Denis Protivensky
Author Date: 2024-02-06 08:55:04 UTC

MDEV-33136: Properly BF-abort user transactions with explicit locks

User transactions may acquire explicit MDL locks from InnoDB level
when persistent statistics is re-read for a table.
If such a transaction would be subject to BF-abort, it was improperly
detected as a system transaction and wouldn't get aborted.

The fix: Check if a transaction holding explicit MDL locks is a user
transaction in the MDL conflict handling code.

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

bb-10.6-MDEV-33509-galera 2024-03-26 05:45:46 UTC
MDEV-33509 Failed to apply write set with flags=(rollback|pa_unsafe)

Author: Daniele Sciascia
Author Date: 2024-03-21 13:03:19 UTC

MDEV-33509 Failed to apply write set with flags=(rollback|pa_unsafe)

Fix function `remove_fragment()` in wsrep_schema so that no error is
raised if the fragment to be removed is not found in the
wsrep_streaming_log table. This is necessary to handle the case where
streaming transaction in idle state is BF aborted. This may result in
the case where the rollbacker thread successfully removes the
transaction's fragments, followed by the applier's attempt to remove
the same fragments. Causing the node to leave the cluster after
reporting a "Failed to apply write set" error.

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

bb-10.5-MDEV-33509-galera 2024-03-26 05:44:20 UTC
MDEV-33509 Failed to apply write set with flags=(rollback|pa_unsafe)

Author: Daniele Sciascia
Author Date: 2024-03-21 13:03:19 UTC

MDEV-33509 Failed to apply write set with flags=(rollback|pa_unsafe)

Fix function `remove_fragment()` in wsrep_schema so that no error is
raised if the fragment to be removed is not found in the
wsrep_streaming_log table. This is necessary to handle the case where
streaming transaction in idle state is BF aborted. This may result in
the case where the rollbacker thread successfully removes the
transaction's fragments, followed by the applier's attempt to remove
the same fragments. Causing the node to leave the cluster after
reporting a "Failed to apply write set" error.

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

bb-11.5-mdev-33739 2024-03-26 03:57:56 UTC
MDEV-33739 Check field type of the first field in check_sequence_fields()

Author: Yuchen Pei
Author Date: 2024-03-22 04:29:41 UTC

MDEV-33739 Check field type of the first field in check_sequence_fields()

This avoids non-integral types breaking the call of
sequence_structure().

bb-11.5-ycp-mtr-ubsan-overflow 2024-03-26 03:52:16 UTC
remove "for ubsan" see what happens

Author: Yuchen Pei
Author Date: 2024-03-26 03:52:16 UTC

remove "for ubsan" see what happens

bb-10.6-MDEV-28621-delayed-elimination 2024-03-26 03:04:08 UTC
MDEV-28621 what if we delay actual subquery removal to the end of the optimi...

Author: Rex Johnston
Author Date: 2024-03-21 23:57:16 UTC

MDEV-28621 what if we delay actual subquery removal to the end of the optimization phase?

not sure this is the best way to do it, but at least is has the virtue
of being mildly cunning by leaving the actual subquery removal to end of
the optimization phase and untaging something for removal if we walk
into it earlier in the optimization.

bb-10.6-MDEV-30456-galera 2024-03-26 01:14:59 UTC
Re-enable MTR test galera_sr.GCF-1060

Author: Daniele Sciascia
Author Date: 2023-05-11 08:19:26 UTC

Re-enable MTR test galera_sr.GCF-1060

Test seems to pass reliably now.

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

bb-10.5-MDEV-30456-galera 2024-03-26 01:13:38 UTC
Re-enable MTR test galera_sr.GCF-1060

Author: Daniele Sciascia
Author Date: 2023-05-11 08:19:26 UTC

Re-enable MTR test galera_sr.GCF-1060

Test seems to pass reliably now.

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

scope_exit 2024-03-26 01:03:14 UTC
REfactor REPLACE!!!!

Author: Nikita Malyavin
Author Date: 2023-01-18 11:49:35 UTC

REfactor REPLACE!!!!

bb-10.5-MDEV-32633-galera 2024-03-25 13:40:55 UTC
MDEV-32633: Fix Galera cluster <-> native replication interaction

Author: Denis Protivensky
Author Date: 2024-03-25 13:40:55 UTC

MDEV-32633: Fix Galera cluster <-> native replication interaction

It's possible to establish Galera multi-cluster setups connected
through the native replication when every Galera cluster is configured
to have a separate domain ID.
For this setup to work, we need to replace domain ID values in generated
GTID events when they are written at transaction commit to the values
configured by Wsrep replication.

At the same time, it's possible that the GTID event already contains
a correct domain ID if it comes through the native replication from
another Galera cluster.
In this case, when such an event is applied either through a native
replication slave thread or through Wsrep applier, we write GTID event
on transaction start and avoid writing it during transaction commit.

The code contained multiple problems that were fixed:
- applying GTID events didn't work because it's applied without a
running server transaction and Wsrep transaction was not started
- GTID event generation on transaction start didn't contain proper
"standalone" and "is_transactional" flags that the original applied
GTID event contained
- condition determining that GTID event is written on transaction start
to avoid writing it on commit relied on the fact that the GTID event
is the first found in transaction/statement caches, which wasn't the
case and resulted in duplicate GTID events written
- instead of relying on the caches to find a GTID event, a simple check
is introduced that follows the exact rules for checking if event is
written at transaction start as described above
- the test case is improved to check that exact GTID events are
applied after two Galera clusters have synced.

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

bb-10.11-ycp 2024-03-25 02:17:24 UTC
MDEV-33220 Fix -wmaybe-uninitialized warnings for g++-13

Author: Yuchen Pei
Author Date: 2024-03-21 06:17:53 UTC

MDEV-33220 Fix -wmaybe-uninitialized warnings for g++-13

bb-11.5-mdev-31789 2024-03-25 01:51:13 UTC
MDEV-31789 Deprecate spider_casual_read

Author: Yuchen Pei
Author Date: 2024-02-21 01:19:26 UTC

MDEV-31789 Deprecate spider_casual_read

The corresponding table param was deprecated as part of MDEV-28861

bb-11.5-MDEV-33748 2024-03-22 20:32:31 UTC
MDEV-33748 get rid of pthread_key_t and pthread_get/setspecific APIs.

Author: VladislavVaintroub
Author Date: 2024-03-22 17:09:21 UTC

MDEV-33748 get rid of pthread_key_t and pthread_get/setspecific APIs.

Replaced with C-style _Thread_local(standard since C11), C++11 thread_local
or compiler-dependent equivalents.

thread_local is easier to use, does not require specfic order
of initialization/termination, unlike pthread thread specific variables.

It is also slightly faster to access these variables. This comes handy in
threadpool code, where a bunch of TLS variables are reset on every query.

bb-10.11-MDEV-33551-mergefix 2024-03-21 18:09:11 UTC
MDEV-33551: Semi-sync Wait Point AFTER_COMMIT Slow on Workloads with Heavy Co...

Author: Brandon Nesterenko
Author Date: 2024-02-27 19:11:06 UTC

MDEV-33551: Semi-sync Wait Point AFTER_COMMIT Slow on Workloads with Heavy Concurrency

When using semi-sync replication with
rpl_semi_sync_master_wait_point=AFTER_COMMIT, the performance of the
primary can significantly reduce compared to AFTER_SYNC's
performance for workloads with many concurrent users executing
transactions. This is because all connections on the primary share
the same cond_wait variable/mutex pair, so any time an ACK is
received from a replica, all waiting connections are awoken to check
if the ACK was for itself, which is done in mutual exclusion.

This patch changes this such that the waiting THD will use its own
local condition variable, and the ACK receiver thread only signals
connections which have been ACKed for wakeup. That is, the
THD::LOCK_wakeup_ready condition variable is re-used for this
purpose, and the Active_tranx queue nodes are extended to hold the
waiting thread, so it can be signalled once ACKed.

Additionally:

 1) Removed part of MDEV-11853 additions, which allowed suspended
connection threads awaiting their semi-sync ACKs to live until their
ACKs had been received. This part, however, wasn't needed. That is,
all that was needed was for the Ack_thread to survive. So now the
connection threads are killed during phase 1. Thereby
THD::is_awaiting_semisync_ack, and all its related code was removed.

 2) COND_binlog_send is repurposed to signal on the condition when
Active_tranx is emptied during clear_active_tranx_nodes.

 3) At master shutdown (when waiting for slaves), instead of the
main loop individually waiting for each ACK, await_slave_reply()
(renamed await_all_slave_replies()) just waits once for the
repurposed COND_binlog_send to signal it is empty.

 4) Test rpl_semi_sync_shutdown_await_ack is updates as following:
   4.1) Added test case (adapted from Kristian Nielsen) to ensure
that if a thread awaiting its ACK is killed while SHUTDOWN WAIT FOR
ALL SLAVES is issued, the primary will still wait for the ACK from
the killed thread.
   4.2) As connections which by-passed phase 1 of thread killing no
longer are delayed for kill until phase 2, we can no longer query
yes/no tx after receiving an ACK/timeout. The check for these
variables is removed.
   4.3) Comment descriptions are updated which mention that the
connection is alive; and adjusted to be the Ack_thread.

Reviewed By:
============
Kristian Nielsen <knielsen@knielsen-hq.org>

10.11-MDEV-33515-spinflag 2024-03-21 15:20:54 UTC
PMEM: Invoke mtr_t::finish_write via a function pointer

Author: Marko Mäkelä
Author Date: 2024-03-21 15:20:54 UTC

PMEM: Invoke mtr_t::finish_write via a function pointer

bb-11.2-growt 2024-03-20 17:59:55 UTC
perf measures

Author: Nikita Malyavin
Author Date: 2024-03-20 16:47:39 UTC

perf measures

10.11-MDEV-33515-spinlock 2024-03-20 13:36:44 UTC
MDEV-33515 attempt 1 (halving throughput on Haswell)

Author: Marko Mäkelä
Author Date: 2024-03-20 13:36:44 UTC

MDEV-33515 attempt 1 (halving throughput on Haswell)

Let us make log_sys.lsn_lock a pure spin lock, using the x86 instruction
xchg for acquisition. On a Haswell microarchitecture dual
Intel Xeon E5-2630 v4 at 256 virtual users, this is nearly halving the
throughput. But, the Linux kernel function native_queued_spin_lock_slowpath
surely gets replaced with lsn_delay().

review__knielsen_xa_sched_minimal_fix 2024-03-19 20:31:26 UTC
Review suggestion.

Author: Andrei
Author Date: 2024-03-19 20:31:26 UTC

Review suggestion.

As maybe_active_xid can expand in runtime and its extra allocated elements
may not be needed in a while, lets check for that and shrink
the size to a double of the initial one.

bb-10.5-MDEV-8578 2024-03-19 19:12:28 UTC
MDEV-8578: Wrong error code/message with enforce_storage_engine and

Author: Rucha Deodhar
Author Date: 2024-03-19 19:12:28 UTC

MDEV-8578: Wrong error code/message with enforce_storage_engine and
NO_ENGINE_SUBSTITUTION

Analysis:
When the error is hit, wrong error code is passed in my_error
Fix:
Pass a better error code.

bb-11.5-opentables 2024-03-19 14:22:23 UTC
Fix integer types

Author: Nikita Malyavin
Author Date: 2024-03-19 12:40:54 UTC

Fix integer types

101200 of 2398 results
This repository contains Public information 
Everyone can see this information.

Subscribers