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

MariaDB has 18 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-1e3bde-prod-lp-code-import-14 and finished taking 7 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 7 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 7 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 5 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 10 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 3 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 4 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 3 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 3 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 4 minutes — see the log

Branches

Name Last Modified Last Commit
bb-10.10-MDEV-29181 2022-08-11 22:03:50 UTC
MDEV-29181 Potential corruption on FK update on a table with vcol index

Author: Nikita Malyavin
Author Date: 2022-08-11 22:03:50 UTC

MDEV-29181 Potential corruption on FK update on a table with vcol index

vc_templ->mysql_table concept is completely broken.
This table pointer persists with a global access and can be overwritten by
arbitrary thread. Like it wasn't enough, it also could become invalid after
eviction from tc cache.

This new solution simply does the following:
* Sets up a referenced table list in TABLE instance (sql_base.cc)
* Iterates through it along with dict_table_t::referenced_set
  (row_upd_check_references_constraints)
* Passes corresponding prebuilt through a call chain to
  row_ins_foreign_check_on_constraint
* Sets up newly created upd_node_t::prebuilt field and uses it accordingly
  is cascade update.

10.7-selectivity 2022-08-11 21:47:48 UTC
TEMPORARY PUSH: Changing all cost calculation to be given in ms

Author: Monty
Author Date: 2022-08-11 10:05:23 UTC

TEMPORARY PUSH: Changing all cost calculation to be given in ms

- Added tests/check_costs.pl, a tool to verify optimizer cost calculations.
  - Most costs has been found with this program. All steps to calculate
    the new costs are documented in Docs/optimizer.costs
- User optimizer_cost variables are given in usec (as individual
  costs can be very small). Internally they are stored in ms.
- Changed DISK_READ_COST (was DISK_SEEK_BASE_COST) from a hard disk cost
  (9 ms) to common SSD cost (400MB/sec).
- Changed the following handler functions to return IO_AND_CPU_COST.
  This makes it easy to apply different cost modifiers in ha_..time()
  functions for io and cpu costs.
  - scan_time()
  - rndpos_time()
  - keyread_time()
- Enhanched keyread_time() to calculate the full cost of reading of a set
  of keys with a given number of ranges and optionall number of blocks that
  need to be accessed.
- Removed read_time() as keyread_time() + rndpos_time() is the same thing.
- Added the following new optimizer_variables:
  - optimizer_scan_lookup_cost
  - optimizer_row_lookup_cost
  - optimizer_index_lookup_cost
  - optimizer_disk_read_cost
- Added include/my_tracker.h ; Useful include file to quickly test costs
  of a function.
- Tuned sequence and heap engine costs (rest will be done in an updated
  commit)

bb-10.3-anel-MDEV-28455-temporary-grant-2 2022-08-11 10:05:07 UTC
MDEV-28455: CREATE TEMPORARY TABLES privilege is insufficient for SHOW COLUMNS

Author: Anel Husakovic
Author Date: 2022-07-04 13:27:36 UTC

MDEV-28455: CREATE TEMPORARY TABLES privilege is insufficient for SHOW COLUMNS

=========== Problem =============
- Invocation of `show column <temporary_tabel>` returns empty result,
even though user has *all* (`CREATE TEMPORARY TABLE`) grants.
- Invocation of `show [index,column] <tabel>` calls `SQLCOM_SELECT` as an `lex->sql_command` during `mysql_execute_command`.
- The function `check_table_access()` get called which is optimized for `show` commands,
  that is appending artificial `SELECT_ACL` (int 1) grant in order to call `check_show_access()`.
- `check_show_access()` is optimized for IS tables (`STATISTICS` and `COLUMN` for `show index` and `show column` respectively),
  that is calling `check_access()` and `check_grant()` for underlying table - so the user needs to have SELECT_ACL privilege on table level.
  There is special handling of temporary tables by setting `table->grant` to `TMP_TABLE_ACL` (int 12351), which includes all DML privileges (SELECT_ACL, and so on).
- When calling function pointer for `show index` (`get_schema_stat_record`) there is no checking of acces/grant/column.
- When calling function pointer for `show column` (`get_schema_column_record`) there is access check and column grant check.
- For the table (in this case temporary table) `show column` command is failing since column access is determined by bitwise operation of table grant privilege and `COL_ACLS`(int 2055).

=========== Solution =============
- Optimize call of `check_access()` only on table level, not for all
fields
- Append `REFERENCES_ACL` to be consistent with `COL_ACL` for temporary
table
- Note that `check_access()` that was called in early phase just checks for SELECT_ACL, but doesn't store the result, so one can think that calling the `check_access()` is redudant, but we have to call it in order to get table ACLs.
- Besides that, one solution is to check if the table is temporary and skip column grant
- Second solution is to check if the table is temporary and append `TMP_TABLE_ACL`, that is the superset of `COL_ACLS` to the `tables->grant.privilege`and check for column grants.

=========== Additionally =============
- Update comments for function `check_table_access` arguments

Reviewed by: <vicentiu@mariadb.org>

10.3 2022-08-11 09:31:15 UTC
MDEV-27151: JSON_VALUE() does not parse NULL properties properly

Author: Rucha Deodhar
Author Date: 2022-08-01 14:09:09 UTC

MDEV-27151: JSON_VALUE() does not parse NULL properties properly

Analysis: JSON_VALUE() returns "null" string instead of NULL pointer.
Fix: When the type is JSON_VALUE_NULL (which is also a scalar) set
null_value to true and return 0 instead of returning string.

bb-10.3-MDEV-27151 2022-08-11 09:31:15 UTC
MDEV-27151: JSON_VALUE() does not parse NULL properties properly

Author: Rucha Deodhar
Author Date: 2022-08-01 14:09:09 UTC

MDEV-27151: JSON_VALUE() does not parse NULL properties properly

Analysis: JSON_VALUE() returns "null" string instead of NULL pointer.
Fix: When the type is JSON_VALUE_NULL (which is also a scalar) set
null_value to true and return 0 instead of returning string.

bb-10.9-MDEV-29212 2022-08-11 08:17:25 UTC
MDEV-29212: json_overlaps() does not check nested key-value pair correctly

Author: Rucha Deodhar
Author Date: 2022-07-30 11:26:18 UTC

MDEV-29212: json_overlaps() does not check nested key-value pair correctly

Analysis: JSON_OVERLAPS() does not check nested key-value pair completely.
If there is nested object, then it only scans and validates if two json values
overlap until one of the value (which is of type object) is exhausted.
This does not really check if the two values of keys are exacly the same, instead
it only checks if key-value pair of one is present in key-value pair of the
other
Fix: Normalize the values (which are of type object) and compare
using string compare. This will validate if two values
are exactly the same.

10.9 2022-08-11 08:17:25 UTC
MDEV-29212: json_overlaps() does not check nested key-value pair correctly

Author: Rucha Deodhar
Author Date: 2022-07-30 11:26:18 UTC

MDEV-29212: json_overlaps() does not check nested key-value pair correctly

Analysis: JSON_OVERLAPS() does not check nested key-value pair completely.
If there is nested object, then it only scans and validates if two json values
overlap until one of the value (which is of type object) is exhausted.
This does not really check if the two values of keys are exacly the same, instead
it only checks if key-value pair of one is present in key-value pair of the
other
Fix: Normalize the values (which are of type object) and compare
using string compare. This will validate if two values
are exactly the same.

bb-10.10-release 2022-08-10 13:05:12 UTC
MDEV-23149 Server crashes in my_convert / ErrConvString::ptr / Item_char_type...

Author: Sergei Golubchik
Author Date: 2022-08-09 12:21:38 UTC

MDEV-23149 Server crashes in my_convert / ErrConvString::ptr / Item_char_typecast::check_truncation_with_warn

10.10 part

bb-10.9-release 2022-08-10 11:57:24 UTC
Merge branch '10.8' into 10.9

Author: Oleksandr "Sanja" Byelkin
Author Date: 2022-08-10 11:57:24 UTC

Merge branch '10.8' into 10.9

bb-10.8-release 2022-08-10 11:36:20 UTC
Merge branch '10.7' into 10.8

Author: Oleksandr "Sanja" Byelkin
Author Date: 2022-08-10 11:36:20 UTC

Merge branch '10.7' into 10.8

bb-10.3-serg 2022-08-10 11:27:01 UTC
update a global_suppressions() list

Author: Sergei Golubchik
Author Date: 2022-08-10 11:27:01 UTC

update a global_suppressions() list

followup for "remove invalid options from warning messages"

bb-10.7-release 2022-08-10 11:25:05 UTC
Merge branch '10.6' into 10.7

Author: Oleksandr "Sanja" Byelkin
Author Date: 2022-08-10 11:25:05 UTC

Merge branch '10.6' into 10.7

bb-10.6-release 2022-08-10 11:24:31 UTC
MDEV-29222 - Fix mysqld_safe script

Author: Addison G
Author Date: 2022-08-02 04:35:48 UTC

MDEV-29222 - Fix mysqld_safe script

The mysqld_safe script was using bad grep options.

The line that was fixed was likely meant to be 2 separate grep commands,
piped into each other, with each one removing any lines that matched.

The `-E` option was unneeded, as the command is not using regex.

10.6 2022-08-10 10:37:52 UTC
MDEV-29222 - Fix mysqld_safe script

Author: Addison G
Author Date: 2022-08-02 04:35:48 UTC

MDEV-29222 - Fix mysqld_safe script

The mysqld_safe script was using bad grep options.

The line that was fixed was likely meant to be 2 separate grep commands,
piped into each other, with each one removing any lines that matched.

The `-E` option was unneeded, as the command is not using regex.

bb-10.6-vicentiu 2022-08-10 10:37:52 UTC
MDEV-29222 - Fix mysqld_safe script

Author: Addison G
Author Date: 2022-08-02 04:35:48 UTC

MDEV-29222 - Fix mysqld_safe script

The mysqld_safe script was using bad grep options.

The line that was fixed was likely meant to be 2 separate grep commands,
piped into each other, with each one removing any lines that matched.

The `-E` option was unneeded, as the command is not using regex.

bb-10.5-release 2022-08-10 10:24:31 UTC
Merge branch '10.4' into 10.5

Author: Oleksandr "Sanja" Byelkin
Author Date: 2022-08-10 10:24:31 UTC

Merge branch '10.4' into 10.5

bb-10.4-release 2022-08-10 10:21:08 UTC
Merge branch '10.3' into bb-10.4-release

Author: Oleksandr "Sanja" Byelkin
Author Date: 2022-08-10 10:21:08 UTC

Merge branch '10.3' into bb-10.4-release

bb-10.3-release 2022-08-10 09:20:58 UTC
Do not check symbol returned (or not and so there is some garbadge) by mb_wc(...

Author: Nayuta Yanagisawa
Author Date: 2022-08-10 08:40:37 UTC

Do not check symbol returned (or not and so there is some garbadge) by mb_wc() if mb_wc() failed

bb-10.10-MDEV-28883 2022-08-09 17:12:07 UTC
MDEV-24660 MYSQL_BIN_LOG::cleanup(): Assertion `b->xid_count == 0'

Author: Andrei
Author Date: 2022-08-09 16:28:49 UTC

MDEV-24660 MYSQL_BIN_LOG::cleanup(): Assertion `b->xid_count == 0'

The assert fired at shutdown time to indicate a missed decrement to
the count. The counter could not have been decremented because
the binlog background thread had already gone.

Fixed with relocation the binlog background thread exit in the server
shutdown module.

bb-10.3-vicentiu-typos 2022-08-09 16:13:17 UTC
Update docs INSTALL BINARY to mention mariadb tar file instead

Author: fluesvamp
Author Date: 2022-08-02 23:29:58 UTC

Update docs INSTALL BINARY to mention mariadb tar file instead

bb-10.7-MDEV-28400 2022-08-09 11:22:53 UTC
MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert()

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-08-09 11:22:53 UTC

MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert()

- Skip the undo logging only for the newly added partition.

bb-10.11-anel 2022-08-09 10:31:02 UTC
MDEV-28453: SHOW commands are inconsistent for temporary tables

Author: Anel Husakovic
Author Date: 2022-05-11 08:54:16 UTC

MDEV-28453: SHOW commands are inconsistent for temporary tables

- Added logic to function `fill_schema_table_names`(function responsible for `show
table` command) in order to bypass `ha_table_exists()` in case where
shadowing of base table exists and by setting
correct string in type field of `show table` command. It is up to the
caller to mark that temporary tables should be checked what is done in
function `get_all_tables()`

- Reviewed by: <>

bb-10.10-anel 2022-08-09 10:31:02 UTC
MDEV-28453: SHOW commands are inconsistent for temporary tables

Author: Anel Husakovic
Author Date: 2022-05-11 08:54:16 UTC

MDEV-28453: SHOW commands are inconsistent for temporary tables

- Added logic to function `fill_schema_table_names`(function responsible for `show
table` command) in order to bypass `ha_table_exists()` in case where
shadowing of base table exists and by setting
correct string in type field of `show table` command. It is up to the
caller to mark that temporary tables should be checked what is done in
function `get_all_tables()`

- Reviewed by: <>

bb-10.10-danielblack-uca-dump-in-deb 2022-08-09 08:41:30 UTC
Deb: uca-dump make as not-installed

Author: Daniel Black
Author Date: 2022-08-09 08:41:30 UTC

Deb: uca-dump make as not-installed

bb-10.11-MDEV-27128 2022-08-09 07:02:31 UTC
work in progress

Author: Rucha Deodhar
Author Date: 2022-08-03 20:31:56 UTC

work in progress

bb-10.6-MDEV-29250 2022-08-08 18:59:56 UTC
MDEV-29250 InnoDB: Failing assertion: table->get_ref_count() == 0

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-08-05 19:46:21 UTC

MDEV-29250 InnoDB: Failing assertion: table->get_ref_count() == 0

Reason:
======
 This issue is caused by race condition between fulltext DDL and
purge thread. DDL sets the signal to stop the purge thread to
process the new undo log records and wait for the ongoing
processed FTS table undo log records to finish.

But in dict_acquire_mdl_shared(),InnoDB release all innodb
table related locks before acquiring the mdl. At the same time,
DDL assumes that there are no purge threads working on fts table.

There is a possiblity that purge thread can skip processing the
valid undo log records if it checks purge_sys.must_wait_FTS() twice
in different places.

Solution:
==========

Add the purge_sys.must_wait_FTS() check in dict_acquire_mdl_shared()
to avoid the purge thread processing undo log records.

dict_open_table_on_id(): return -1 if the purge thread has to
wait

dict_acquire_mdl_shared(): Added 1 new parameters to indicate that
purge thread invoking the function, return -1 if the purge
thread has to wait.

bb-10.6-MDEV-27700 2022-08-08 16:43:40 UTC
MDEV-27700 ASAN: Heap_use_after_free in btr_search_drop_page_hash_index()

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-08-05 11:53:53 UTC

MDEV-27700 ASAN: Heap_use_after_free in btr_search_drop_page_hash_index()

Reason:
=======
Race condition between btr_search_drop_hash_index() and
btr_search_lazy_free(). One thread does resizing of buffer pool
and clears the ahi on all pages in the buffer pool, frees the
index and table while removing the last reference. At the same time,
other thread access index->heap in btr_search_drop_hash_index().

Solution:
=========
Acquire the respective ahi latch before checking index->freed()

btr_search_drop_page_hash_index(): Added new parameter to indicate
that drop ahi entries only if the index is marked as freed

btr_search_check_marked_free_index(): Acquire all ahi latches and
return true if the index was freed

bb-10.3-anel-MDEV-28548-missing_db_name_error_message-v2 2022-08-08 12:45:22 UTC
MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB

Author: Anel Husakovic
Author Date: 2022-07-16 12:39:17 UTC

MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB

- Added missing information about database of corresponding table for various types of commands
- Update some typos

- Reviewed by: <>

bb-10.10-MDEV-25292 2022-08-08 12:33:51 UTC
MDEV-28933 Review

Author: midenok
Author Date: 2022-08-05 15:13:00 UTC

MDEV-28933 Review

bb-10.3-ora_fix 2022-08-08 12:00:21 UTC
fix of MDEV-12325 patch: symetric changes in sql_yacc_ora

Author: Oleksandr "Sanja" Byelkin
Author Date: 2022-08-08 12:00:21 UTC

fix of MDEV-12325 patch: symetric changes in sql_yacc_ora

bb-10.10-andrei 2022-08-08 09:44:01 UTC
MDEV-29078. Merge to 10.10 to account MDEV-19801.

Author: Andrei
Author Date: 2022-08-08 09:44:01 UTC

MDEV-29078. Merge to 10.10 to account MDEV-19801.

Also a new test comment line gets corrected.

bb-10.3-monty 2022-08-08 08:19:55 UTC
Fixed that sp-no-valgrind.test is disabled on valgrind builds (not runs)

Author: Monty
Author Date: 2022-08-06 12:06:22 UTC

Fixed that sp-no-valgrind.test is disabled on valgrind builds (not runs)

bb-10.7-bar-MDEV-29159 2022-08-05 18:23:40 UTC
MDEV-29159 Patch for MDEV-28918 introduces more inconsistency than it solves,...

Author: Alexander Barkov
Author Date: 2022-08-02 12:23:08 UTC

MDEV-29159 Patch for MDEV-28918 introduces more inconsistency than it solves, breaks usability

1. Store assignment failures on incompatible data types now raise errors if:
- STRICT_ALL_TABLES or STRICT_TRANS_TABLES sql_mode is used, and
- IGNORE is not used

Otherwise, only a warning is raised and the statement continues.

2. Changing the error/warning test as follows:

-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `db`.`t`.`col`

so in case of a big table it's easier to see which column has the problem.
The new error text is also applied to SP variables.

10.7 2022-08-05 18:23:40 UTC
MDEV-29159 Patch for MDEV-28918 introduces more inconsistency than it solves,...

Author: Alexander Barkov
Author Date: 2022-08-02 12:23:08 UTC

MDEV-29159 Patch for MDEV-28918 introduces more inconsistency than it solves, breaks usability

1. Store assignment failures on incompatible data types now raise errors if:
- STRICT_ALL_TABLES or STRICT_TRANS_TABLES sql_mode is used, and
- IGNORE is not used

Otherwise, only a warning is raised and the statement continues.

2. Changing the error/warning test as follows:

-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `db`.`t`.`col`

so in case of a big table it's easier to see which column has the problem.
The new error text is also applied to SP variables.

bb-10.4-MDEV-22230 2022-08-05 10:31:10 UTC
MDEV-22230 : Unexpected ER_ERROR_ON_RENAME upon DROP non-existing FOREIGN KEY...

Author: Jan Lindström
Author Date: 2022-08-05 10:31:10 UTC

MDEV-22230 : Unexpected ER_ERROR_ON_RENAME upon DROP non-existing FOREIGN KEY with ALGORITHM=COPY

If we are dropping a foreign key and expect it to exists,
we should check does it exists and if not report a error in early
stage i.e. in mysql_prepare_alter_table.

bb-10.6-wlad 2022-08-04 22:13:34 UTC
Fix warning in cmake 3.24

Author: Vladislav Vaintroub
Author Date: 2022-08-04 22:13:34 UTC

Fix warning in cmake 3.24

New cmake policy CMP0135 generates warning for pcre

bb-10.5-mdev29242 2022-08-04 14:10:20 UTC
MDEV-29242: Assertion `computed_weight == weight' failed SEL_ARG::verify_weight

Author: Sergey Petrunia
Author Date: 2022-08-04 09:51:32 UTC

MDEV-29242: Assertion `computed_weight == weight' failed SEL_ARG::verify_weight

Make SEL_ARG::make_root() maintain SEL_ARG::weight.

Also, an unrelated change: fix dbug_print_sel_arg() to correctly
print SQL NULL for the right endpoint.

10.5 2022-08-04 14:10:20 UTC
MDEV-29242: Assertion `computed_weight == weight' failed SEL_ARG::verify_weight

Author: Sergey Petrunia
Author Date: 2022-08-04 09:51:32 UTC

MDEV-29242: Assertion `computed_weight == weight' failed SEL_ARG::verify_weight

Make SEL_ARG::make_root() maintain SEL_ARG::weight.

Also, an unrelated change: fix dbug_print_sel_arg() to correctly
print SQL NULL for the right endpoint.

bb-10.10-bar-uca14 2022-08-04 12:58:41 UTC
Switching to the latest libmariadb

Author: Alexander Barkov
Author Date: 2022-08-04 12:58:41 UTC

Switching to the latest libmariadb

with "Libmariadb changes for MDEV-27009 Add UCA-14.0.0 collations"

10.4 2022-08-04 10:13:31 UTC
Merge branch '10.3' into 10.4

Author: Oleksandr "Sanja" Byelkin
Author Date: 2022-08-04 10:13:31 UTC

Merge branch '10.3' into 10.4

10.6-MDEV-27700 2022-08-04 06:28:49 UTC
MDEV-27700 ASAN: heap-use-after-free in btr_search_drop_page_hash_index(buf_...

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-08-04 06:28:49 UTC

MDEV-27700 ASAN: heap-use-after-free in btr_search_drop_page_hash_index(buf_block_t*)

 - Race condition happens between btr_search_lazy_free() and
btr_search_drop_page_hash_index(). btr_search_lazy_free() frees
the index heap and btr_search_drop_page_hash_index() does
index->freed() after freeing the heap.

10.10 2022-08-03 17:25:43 UTC
MDEV-27161: Add option for SQL thread to limit maximum execution time per que...

Author: Brandon Nesterenko
Author Date: 2022-06-27 18:29:10 UTC

MDEV-27161: Add option for SQL thread to limit maximum execution time per query replicated

New Feature:
============
This patch adds a new system variable, @@slave_max_statement_time,
which limits the execution time of s slave’s events that implements
an equivalent to @@max_statement_time for slave applier.

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

bb-10.10-MDEV-27161 2022-08-03 17:25:43 UTC
MDEV-27161: Add option for SQL thread to limit maximum execution time per que...

Author: Brandon Nesterenko
Author Date: 2022-06-27 18:29:10 UTC

MDEV-27161: Add option for SQL thread to limit maximum execution time per query replicated

New Feature:
============
This patch adds a new system variable, @@slave_max_statement_time,
which limits the execution time of s slave’s events that implements
an equivalent to @@max_statement_time for slave applier.

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

bb-10.3-mdev23809 2022-08-03 16:40:02 UTC
MDEV-23809: Server crash in JOIN_CACHE::free ...: part #2

Author: Sergey Petrunia
Author Date: 2022-08-03 14:55:45 UTC

MDEV-23809: Server crash in JOIN_CACHE::free ...: part #2

Part #2: make sure we allocate space for two JOIN_TABs that
use temporary tables.
The dbug_join_tab_array_size is still set to catch cases where
we try to access more JOIN_TAB object than we thought we would have.

st-10.3-thiru 2022-08-03 15:05:12 UTC
MDEV-27282 InnoDB: Failing assertion: !query->intersection

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-07-20 08:44:43 UTC

MDEV-27282 InnoDB: Failing assertion: !query->intersection

- query->intersection fails to get freed if the query exceeds
innodb_ft_result_cache_limit

- errors from init_ftfuncs were not propogated by delete command

This is taken from percona/percona-server@ef2c0bcb9a34aeb06de0058d7c2a2969416b35a7

bb-10.5-serg 2022-08-03 11:31:48 UTC
RHEL9 disables SHA1 signatures in openssl

Author: Sergei Golubchik
Author Date: 2022-08-03 11:31:48 UTC

RHEL9 disables SHA1 signatures in openssl

with its 0049-Selectively-disallow-SHA1-signatures.patch
in the openssl source rpm.

let's allow them for now, this fixes tls_version and tls_version1 tests.

bb-10.3-thiru 2022-08-03 05:20:29 UTC
MDEV-27282 InnoDB: Failing assertion: !query->intersection

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-07-20 08:44:43 UTC

MDEV-27282 InnoDB: Failing assertion: !query->intersection

- query->intersection fails to get freed if the query exceeds
innodb_ft_result_cache_limit

- errors from init_ftfuncs were not propogated by delete command

This is taken from percona/percona-server@ef2c0bcb9a34aeb06de0058d7c2a2969416b35a7

bb-10.6-midenok 2022-08-02 22:26:12 UTC
Review 2: ER_WRONG_VALUE instead of ER_VERS_WRONG_ROW_END

Author: midenok
Author Date: 2022-08-02 22:09:58 UTC

Review 2: ER_WRONG_VALUE instead of ER_VERS_WRONG_ROW_END

bb-10.5-wlad 2022-08-02 21:23:13 UTC
On Marko Mäkela's request, comment and partially rewrite tpool::cache.

Author: Vladislav Vaintroub
Author Date: 2022-08-02 20:19:39 UTC

On Marko Mäkela's request, comment and partially rewrite tpool::cache.

It could be better (according to Marko) to use array
instead of std::vector for m_cache, and track the size explicitly.
So this is done here.

Also simplify tpool::cache by removing features that were not unused
- cache_notification_mode (was planned as optimization for certain
  scenarios, never used)
- 'blocking' parameter in cache::get() - was always set to true.

bb-10.3-igor 2022-08-02 19:29:24 UTC
MDEV-28617 Crash with INSERT...SELECT using derived table in GROUP BY clause

Author: Igor Babaev
Author Date: 2022-08-02 03:52:10 UTC

MDEV-28617 Crash with INSERT...SELECT using derived table in GROUP BY clause

This bug manifested itself for INSERT...SELECT and DELETE statements whose
WHERE condition used an IN/ANY/ALL predicand or a EXISTS predicate with
such grouping subquery that:
 - its GROUP BY clause could be eliminated,
 - the GROUP clause contained a subquery over a mergeable derived table
   referencing the updated table.

The bug ultimately caused a server crash when the prepare phase of the
statement processing was executed. This happened after removal redundant
subqueries used in the eliminated GROUP BY clause from the statement tree.
The function that excluded the subqueries from the did not do it properly.
As a result the specification of any derived table contained in a removed
subquery was not marked as excluded.

Approved by Oleksandr Byelkin <sanja@mariadb.com>

preview-10.10-MDEV-27246-allowlist-galera 2022-08-02 14:25:04 UTC
Fixed regression on SST tests. We incorrectly used my_thread_end(), which

Author: Jan Lindström
Author Date: 2022-06-12 07:39:15 UTC

Fixed regression on SST tests. We incorrectly used my_thread_end(), which
sets mysys_var pointer to NULL, so the next THD::THD will crash.
Removed my_thread_init()/end() pairs and because
Wsrep_allowlist_service::allowlist_cb is not always called from a
new thread added a thread to do so.

Fix co-authored by Sergei Golubchik <serg@mariadb.org>
and mkaruza <mario.karuza@galeracluster.com>

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>

10.8 2022-08-02 05:52:57 UTC
Merge 10.7 into 10.8

Author: Marko Mäkelä
Author Date: 2022-08-02 05:52:57 UTC

Merge 10.7 into 10.8

bb-10.4-MDEV-27624 2022-08-01 14:54:38 UTC
MDEV-27624 Wrong result for left join, 'not exists' and join buffers

Author: Oleg Smirnov
Author Date: 2022-08-01 14:54:32 UTC

MDEV-27624 Wrong result for left join, 'not exists' and join buffers

Cause:
When linked join buffers are employed to process nested outer joins
there is a problem with applying the 'not exists' optimization:
the match flag used for outer joins is not propagated among linked
join buffers. This leads to incorrect results when the 'not exists'
optimization is applied to a nested outer join.

Solution:
Disable applying the 'not exists' optimization for linked join buffers

10.3-MDEV-28968-v2-galera 2022-08-01 11:47:29 UTC
MDEV-28758: Mariabackup copies binary logs to backup directory

Author: Julius Goryavsky
Author Date: 2022-07-19 11:26:19 UTC

MDEV-28758: Mariabackup copies binary logs to backup directory

This commit restores defaults and functionality regarding binlogs
to the way it was prior to MDEV-27524. The mariabackup utility no
longer saves binlogs files as part of a backup without the --galera-info
option. However, since we use --galera-info during SST, the behavior
of mariabackup changes and, in combination with GTIDs support enabled,
mariabackup transfers one (most recent) binlog file obtained after
FLUSH BINARY LOGS. In other cases, binlogs are not transferred during
SST in mariabackup mode. As for SST in the rsync mode, it works the
same way as before MDEV-27524 - by default it transfers one last
binlog file.

The --sst-max-binlogs option for mariabackup and the sst_max_binlogs
parameter in the [sst] / server sections are no longer supported for
SST via mariabackup.

bb-10.7-thiru 2022-08-01 09:14:55 UTC
MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert()

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-08-01 09:14:55 UTC

MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert()

- Change partition does undo logging of all rows unnecessarily and
it invokes bulk insert during DDL. Better to avoid the logging of undo
records during copy of the parititon.

bb-10.6-danielblack-MDEV-28592-plugin-disks 2022-08-01 08:02:06 UTC
MDEV-28592 - failing disks.disks test case to show impact

Author: Daniel Black
Author Date: 2022-08-01 05:32:27 UTC

MDEV-28592 - failing disks.disks test case to show impact

bb-10.6-MDEV-13013 2022-08-01 06:48:18 UTC
MDEV-13013 InnoDB unnecessarily extends data files

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-08-01 06:48:18 UTC

MDEV-13013 InnoDB unnecessarily extends data files

    - While creating a new InnoDB segment, allocates the extent
before allocating the inode or page allocation even though
the pages are present in fragment segment. This patch does
reserve the extent when InnoDB ran out of fragment pages
in the tablespace.

bb-10.6-MDEV-28315 2022-08-01 05:41:17 UTC
MDEV-28315 Fix ASAN stack-buffer-overflow in String::copy_aligned

Author: Norio Akagi
Author Date: 2022-07-06 09:23:09 UTC

MDEV-28315 Fix ASAN stack-buffer-overflow in String::copy_aligned

Starting since this commit 36cdd5c there is an ASAN
stack-buffer-overflow error because we append a NULL terminator
beyond the length of memory allocated.

bb-10.10-MDEV-25704 2022-07-31 12:54:37 UTC
use my_random_bytes() that correctly detects error conditions

Author: Sergei Golubchik
Author Date: 2022-07-29 17:39:55 UTC

use my_random_bytes() that correctly detects error conditions

bb-10.10-MDEV-28632 2022-07-31 08:39:51 UTC
wip version for explicit_def_ts

Author: Sergei Golubchik
Author Date: 2022-07-31 08:19:06 UTC

wip version for explicit_def_ts

bb-10.3-danielblack-disks-check 2022-07-31 03:42:33 UTC
disks plugin: getmntent_r required to build properly

Author: Daniel Black
Author Date: 2022-07-31 03:41:59 UTC

disks plugin: getmntent_r required to build properly

Without this it fails on AIX and possibly some BSDs.

Fixes: 0ee5cf837e3a0464acc20db2a2aee0adaff3f2ac

10.10-MDEV-28632-old-master-fix 2022-07-29 22:38:12 UTC
Potential fix for rpl.rpl_old_master_29078.test

Author: Brandon Nesterenko
Author Date: 2022-07-29 22:38:12 UTC

Potential fix for rpl.rpl_old_master_29078.test

bb-10.10-MDEV-19801-testfix 2022-07-29 21:43:25 UTC
MDEV-19801 Fix rpl.rpl_delayed_slave

Author: Brandon Nesterenko
Author Date: 2022-07-29 21:43:25 UTC

MDEV-19801 Fix rpl.rpl_delayed_slave

bb-10.3-MDEV-13013 2022-07-29 15:14:45 UTC
MDEV-13013 InnoDB unnecessarily extends data files

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-07-28 13:35:17 UTC

MDEV-13013 InnoDB unnecessarily extends data files

- While creating a new InnoDB segment, allocates the extent
before allocating the inode or page allocation even though
the pages are present in fragment segment. This patch does
reserve the extent when InnoDB ran out of fragment pages
in the tablespace.

bb-10.3-danielblack-MDEV-18702 2022-07-29 10:19:45 UTC
MDEV-18702 mysqldump: add variable 'max-statement-time'

Author: MikeG
Author Date: 2022-07-29 06:07:42 UTC

MDEV-18702 mysqldump: add variable 'max-statement-time'

With a global non-default max-statement-time of a time interval that exceed
the query time mysqldump queries when doing a backup.

To solve both, add a max-statement-time option, defaulting to 0 (unlimited time).

Also like mariabackup, set the session wait_timeout=2147483. The
time/processing between mysqldump times isn't expected to get that
close ever, but let's adopt the standard of mariabackup as no-one has
challenged it has having a detrimental effect.

bb-10.3-georg 2022-07-29 05:40:00 UTC
Test fixes:

Author: Georg Richter
Author Date: 2022-07-29 05:40:00 UTC

Test fixes:

Since fix for CONC-603 (wrong error handling in TLS read/write) in case
of a read/write error client doesn't return always error 2013 (server
has gone away), so in addition we need to check for error 2026
(TLS/SSL error) and 5014 (write error).

bb-10.3-MDEV-29008 2022-07-29 05:19:33 UTC
MDEV-29008 Server crash or assertion `field' failed in spider_db_open_item_id...

Author: Nayuta Yanagisawa
Author Date: 2022-07-28 12:24:57 UTC

MDEV-29008 Server crash or assertion `field' failed in spider_db_open_item_ident / group by handler

ha_spider::field_exchange() returns NULL and that results in a crash
or a assertion failure in spider_db_open_item_ident().

In the first place, there seems to be no need to call field_exchange()
for printing an identity (column name with alias). Thus, we simply
remove the call.

bb-10.10-ddl-nikita 2022-07-29 02:39:23 UTC
MDEV-29068 Cascade foreign key updates do not apply in online alter

Author: Nikita Malyavin
Author Date: 2022-07-21 23:18:21 UTC

MDEV-29068 Cascade foreign key updates do not apply in online alter

Foreign key cascade operations are still implemented through innodb.

Add support for online logging in row_ins_foreign_check_on_constraint.

upd_node_t::sql_is_online_alter is added to reuse cascade->row and
cascade->upd_row.

bb-10.10-igor 2022-07-29 00:52:47 UTC
MDEV-29189 Crash of the second execution of SF using DELETE/UPDATE

Author: Igor Babaev
Author Date: 2022-07-29 00:52:47 UTC

MDEV-29189 Crash of the second execution of SF using DELETE/UPDATE

This bug caused a crash of the server at the second execution of a stored
function that used DELETE or UPDATE statement if the first execution
of this function reported an error encountered after the prepare phase.
This happened because in such cases the executed DELETE/UPDATE statement
remained marked as prepared. As a result the second execution of SF missed
the prepare phase for the statement altogether and the statement could not
be executed properly.

Approved by Oleksandr Byelkin <sanja@mariadb.com>

bb-10.10-MDEV-27105 2022-07-28 15:18:40 UTC
don't use ssl for windows named pipes - it doesn't work

Author: Sergei Golubchik
Author Date: 2022-06-17 19:20:43 UTC

don't use ssl for windows named pipes - it doesn't work

bb-10.3-wlad 2022-07-28 14:05:37 UTC
Exclude irrelevant system check from Windows compilation

Author: Vladislav Vaintroub
Author Date: 2022-07-28 14:05:37 UTC

Exclude irrelevant system check from Windows compilation

VS generators are rather slow when it comes to system checks.
Let's exclude more irrelevant check from compilation.

Also, give cached cmake variable a proper descriptive name.

bb-10.5-MDEV-24819 2022-07-28 09:14:01 UTC
MDEV-24819 Optimizer uses wrong parameter evaluating TRP_GROUP_MIN_MAX

Author: Oleg Smirnov
Author Date: 2022-07-27 14:25:34 UTC

MDEV-24819 Optimizer uses wrong parameter evaluating TRP_GROUP_MIN_MAX

When evaluating GROUP_MIN_MAX access (also known as Loose Index Scan)
the optimizer considers applying QUICK_RANGE_SELECT object to the
constructed TRP_GROUP_MIN_MAX object. To do that the optimizer
evaluates param->quick_rows[cur_index] which has been set before
while evaluating Index Merge access. But Loose Index Scan cannot be
combined with Index Merge access so evaluating param->quick_rows is not
valid here. The correct parameter to evaluate possibility of
QUICK_RANGE_SELECT is param->table->opt_range[cur_index].rows.

bb-10.10-MDEV-27104 2022-07-27 22:53:21 UTC
fix func_encrypt_nossl test to work as it was supposed to

Author: Sergei Golubchik
Author Date: 2022-07-18 09:43:57 UTC

fix func_encrypt_nossl test to work as it was supposed to

it is designed for no-ssl builds, since 5.5 it's only embedded

bb-10.10-optimizer-features 2022-07-26 17:37:41 UTC
MDEV-28929: Plan selection takes forever with MDEV-28852 ...

Author: Sergey Petrunia
Author Date: 2022-07-19 11:13:17 UTC

MDEV-28929: Plan selection takes forever with MDEV-28852 ...
Part #2: Extend heuristic pruning to use multiple tables as the
"Model tables".

Before the patch, heuristic pruning uses only one "Model table":
The table which had the best cost AND record became the "Model table".
After that, if a table's cost and record were both worse than
those of the Model Table, the table would be pruned away.

This didn't work well when the first table (the optimizer sorts them
by record_count) had low record_count but relatively high cost: nothing
could be pruned afterwards.

The patch adds the two additional "Model tables": one with the least
cost and the other with the least record_count.
(In both cases, a table can be pruned away if BOTH its cost and
record_count are worse than those of a Model table)

The new pruning is active when the number of tables to consider for
the prefix is higher than @@optimizer_extra_pruning_depth.

One can see the new pruning in the Optimizer Trace as
- "pruned_by_heuristic":"min_record_count", or
- "pruned_by_heuristic":"min_read_time".
Old heuristic pruning shows as "pruned_by_heuristic":1.

bb-10.3-MDEV-26247 2022-07-26 16:10:53 UTC
MDEV-26247 Spider: Valid LEFT JOIN results in ERROR 1064

Author: Nayuta Yanagisawa
Author Date: 2022-07-22 06:06:23 UTC

MDEV-26247 Spider: Valid LEFT JOIN results in ERROR 1064

The current implementation of Spider's GROUP BY handler cannot
handle some type of queries yet. Thus, we disable the handler for
the queries.

This is tentative fix and more and more queries should be handled
by smart handlers.

bb-10.10-MDEV-28632-review 2022-07-26 16:09:46 UTC
MDEV-29078. Review contribution/notes.

Author: Andrei
Author Date: 2022-07-26 16:09:46 UTC

MDEV-29078. Review contribution/notes.

1. The new test needs an absolute TZ for SELECTing
2. The client mysqlbinlog also is better off to be aware of OLD binlog
   so it won't generate automatic
    SET @@explicit_defaults_for_timestamp = 0
   in this case.
   The SET should be left out to the user (like it is for the OLD
   slave's global explicit_defaults_for_timestamp that should be
   configured accordingly to the master).

bb-10.6-andrei 2022-07-26 13:01:14 UTC
MDEV-28609 refine gtid-strict-mode to ignore same server-id gtid from the past

Author: Andrei
Author Date: 2022-06-30 12:46:19 UTC

MDEV-28609 refine gtid-strict-mode to ignore same server-id gtid from the past

... on semisync slave

To provide semisync master crash-recovery the same server-id transactions
were made to accept for execution on the semisync slave when the strict gtid
mode (see MDEV-27760).
That however caused out-of-order error on a master's transaction
server of the circular setup.
The error was fair in the sense of the gtid strict mode rule as indeed
under the condition of the circular setup the replicated transaction
already exists in the local binlog.

This is fixed by the commit to ignore on the gtid strict mode semisync
slave those gtids that exist in the slave's binlog that effectively restores
the default same-server-id ignore policy.
At the same time the fixes complies with MDEV-21117 semisync slave recovery
to accept the same server-id transactions that do not exist in local binlog.

bb-10.6-danielblack-MDEV-29141-rseg_ext_p2 2022-07-26 08:41:40 UTC
MDEV-29166: reduce locking of innodb trx_sys_t::history_*

Author: Daniel Black
Author Date: 2022-07-26 08:41:37 UTC

MDEV-29166: reduce locking of innodb trx_sys_t::history_*

Acquire and release locks in trx_sys_t::history_* one by one so
we reduce the risk of deadlock with a process that acquires a
later segement and then aquires and earlier segment.

While doing this means that the accuracy of the returned history
length could be off by a factor, but by the time we release from
these microfunctions, the rseg locks are released, so the history
value is out of date by the time the calling function access it already.

reasons why not are https://jira.mariadb.org/browse/MDEV-29141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Pushing for test purposes only at the momement.

bb-10.5-andrei 2022-07-26 07:46:01 UTC
MDEV-28948 FLUSH BINARY LOGS waits/hangs on mysql_mutex_unlock(&LOCK_index)

Author: Andrei
Author Date: 2022-07-24 17:43:45 UTC

MDEV-28948 FLUSH BINARY LOGS waits/hangs on mysql_mutex_unlock(&LOCK_index)

The hang may be caused by a 1pc branch that was fixed by MDEV-26031 in
10.6 and up. That commit did not look relevant in 10.5 and below
so was not pushed to the low branches.

To possibly tackle the reported issue
the MDEV-26031 is backported now with a test that
unlike 10.6 does not expose the former bug in 10.5.
It is only needed for checking a refined logics
inside MYSQL_BIN_LOG::write_transaction_to_binlog.
The latter is made to do away with xid-unlogging (which is suspected
to have been at fault) for xid-less transaction.

bb-10.7-MDEV-28242 2022-07-26 05:55:56 UTC
MDEV-28679 After upgrade to 10.7.3-1 with enabled data-at-rest encryption un...

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2022-07-26 05:55:32 UTC

MDEV-28679 After upgrade to 10.7.3-1 with enabled data-at-rest encryption unable to restore dump file.

- InnoDB bulk insert fails to use encryption buffer for encrypting
the temporary log file. Declare the m_crypt_block, m_crypt_pfx in
row_merge_bulk_t to be used for encrypting the temporary file.

bb-10.7-21087-merge 2022-07-26 02:33:32 UTC
MDEV-21087/MDEV-21433: ER_SLAVE_INCIDENT arrives at slave without failure spe...

Author: Brandon Nesterenko
Author Date: 2019-12-17 09:53:55 UTC

MDEV-21087/MDEV-21433: ER_SLAVE_INCIDENT arrives at slave without failure specifics

Problem:
=======

This patch addresses two issues:

 1. An incident event can be incorrectly reported for transactions
which are rolled back successfully. That is, an incident event
should only be generated for failed “non-transactional transactions”
(i.e., those which modify non-transactional tables) because they
cannot be rolled back.

 2. When the mariadb slave (error) stops at receiving the incident
event there's no description of what led to it. Neither in the event
nor in the master's error log.

Solution:
========

Before reporting an incident event for a transaction, first validate
that it is “non-transactional” (i.e. cannot be safely rolled back).
To determine if a transaction is non-transactional,
  lex->stmt_accessed_table(LEX::STMT_WRITES_NON_TRANS_TABLE)
is used because it is set previously in
THD::decide_logging_format().

Additionally, when an incident event is written, write an error
message to the server’s error log to indicate the underlying issue.

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

bb-10.5-21087-merge 2022-07-26 02:07:17 UTC
MDEV-21087/MDEV-21433: ER_SLAVE_INCIDENT arrives at slave without failure spe...

Author: Brandon Nesterenko
Author Date: 2019-12-17 09:53:55 UTC

MDEV-21087/MDEV-21433: ER_SLAVE_INCIDENT arrives at slave without failure specifics

Problem:
=======

This patch addresses two issues:

 1. An incident event can be incorrectly reported for transactions
which are rolled back successfully. That is, an incident event
should only be generated for failed “non-transactional transactions”
(i.e., those which modify non-transactional tables) because they
cannot be rolled back.

 2. When the mariadb slave (error) stops at receiving the incident
event there's no description of what led to it. Neither in the event
nor in the master's error log.

Solution:
========

Before reporting an incident event for a transaction, first validate
that it is “non-transactional” (i.e. cannot be safely rolled back).
To determine if a transaction is non-transactional,
  lex->stmt_accessed_table(LEX::STMT_WRITES_NON_TRANS_TABLE)
is used because it is set previously in
THD::decide_logging_format().

Additionally, when an incident event is written, write an error
message to the server’s error log to indicate the underlying issue.

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

bb-10.4-21087-merge 2022-07-26 01:34:35 UTC
MDEV-21087/MDEV-21433: ER_SLAVE_INCIDENT arrives at slave without failure spe...

Author: Brandon Nesterenko
Author Date: 2019-12-17 09:53:55 UTC

MDEV-21087/MDEV-21433: ER_SLAVE_INCIDENT arrives at slave without failure specifics

Problem:
=======

This patch addresses two issues:

 1. An incident event can be incorrectly reported for transactions
which are rolled back successfully. That is, an incident event
should only be generated for failed “non-transactional transactions”
(i.e., those which modify non-transactional tables) because they
cannot be rolled back.

 2. When the mariadb slave (error) stops at receiving the incident
event there's no description of what led to it. Neither in the event
nor in the master's error log.

Solution:
========

Before reporting an incident event for a transaction, first validate
that it is “non-transactional” (i.e. cannot be safely rolled back).
To determine if a transaction is non-transactional,
  lex->stmt_accessed_table(LEX::STMT_WRITES_NON_TRANS_TABLE)
is used because it is set previously in
THD::decide_logging_format().

Additionally, when an incident event is written, write an error
message to the server’s error log to indicate the underlying issue.

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

bb-10.3-rpl_row_img_sequence 2022-07-25 17:50:53 UTC
Buildbot testing for rpl_row_img_sequence test

Author: Brandon Nesterenko
Author Date: 2022-07-05 13:12:49 UTC

Buildbot testing for rpl_row_img_sequence test

Cherry picking from potentially "safe" commit in the past

bb-10.4-wlad 2022-07-25 11:27:23 UTC
Fixes for WolfSSL 5.4.0

Author: Vladislav Vaintroub
Author Date: 2022-07-25 11:27:23 UTC

Fixes for WolfSSL 5.4.0

bb-10.11-spetrunia 2022-07-25 09:10:31 UTC
MDEV-28926 Add time spent on query optimizer to JSON ANALYZE (#2193)

Author: Luis Eduardo Oliveira Lizardo
Author Date: 2022-07-18 15:48:01 UTC

MDEV-28926 Add time spent on query optimizer to JSON ANALYZE (#2193)

* Add query optimizer timer to ANALYZE FORMAT=JSON

* Adapt tests and results

* Change logic to always close the writer after printing query blocks

preview-10.11-mdev-28926 2022-07-25 09:10:31 UTC
MDEV-28926 Add time spent on query optimizer to JSON ANALYZE (#2193)

Author: Luis Eduardo Oliveira Lizardo
Author Date: 2022-07-18 15:48:01 UTC

MDEV-28926 Add time spent on query optimizer to JSON ANALYZE (#2193)

* Add query optimizer timer to ANALYZE FORMAT=JSON

* Adapt tests and results

* Change logic to always close the writer after printing query blocks

10.11 2022-07-25 09:09:29 UTC
Merge branch '10.10' into 10.11

Author: Sergey Petrunia
Author Date: 2022-07-25 09:09:29 UTC

Merge branch '10.10' into 10.11

bb-10.10-spetrunia3 2022-07-25 08:44:10 UTC
Revert the commit with MDEV-28926: Add time spent on query optimizer to JSON ...

Author: Sergey Petrunia
Author Date: 2022-07-25 08:44:10 UTC

Revert the commit with MDEV-28926: Add time spent on query optimizer to JSON ANALYZE

It will go into 10.11.

Author: Luis Eduardo Oliveira Lizardo <108760288+mariadb-LuisLizardo@users.noreply.github.com>
Date: Mon Jul 18 17:48:01 2022 +0200

    MDEV-28926 Add time spent on query optimizer to JSON ANALYZE (#2193)

    * Add query optimizer timer to ANALYZE FORMAT=JSON

    * Adapt tests and results

    * Change logic to always close the writer after printing query blocks

preview-10.10-MDEV-7487-semijoin_for_update_delete 2022-07-25 01:01:56 UTC
MDEV-28883 Re-design the upper level of handling UPDATE and DELETE statements...

Author: Daniel Black
Author Date: 2022-07-19 00:49:48 UTC

MDEV-28883 Re-design the upper level of handling UPDATE and DELETE statements (postfix)

Correct -Winconsistent-missing-override(s):

Warnings were:

In file included from sql/sql_delete.cc:27:
sql/sql_delete.h:54:28: warning: 'get_dml_prelocking_strategy' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  DML_prelocking_strategy *get_dml_prelocking_strategy()
                           ^
sql/sql_cmd.h:394:36: note: overridden virtual function is here
  virtual DML_prelocking_strategy *get_dml_prelocking_strategy() = 0;
                                   ^
1 warning generated.
[682/735] Building CXX object sql/CMakeFiles/sql.dir/sql_truncate.cc.o
In file included from sql/sql_truncate.cc:31:
sql/sql_delete.h:54:28: warning: 'get_dml_prelocking_strategy' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  DML_prelocking_strategy *get_dml_prelocking_strategy()
                           ^
sql/sql_cmd.h:394:36: note: overridden virtual function is here
  virtual DML_prelocking_strategy *get_dml_prelocking_strategy() = 0;
                                   ^
1 warning generated.

bb-10.4-mdev-27595-hf 2022-07-24 19:32:51 UTC
Fix to quiet the compiler on Windows.

Author: Alexey Botchkov
Author Date: 2022-07-08 09:54:10 UTC

Fix to quiet the compiler on Windows.

bb-10.10-MDEV-16329 2022-07-24 11:34:39 UTC
MDEV-28816 Assertion `wsrep_thd_is_applying(thd)' failed in int wsrep_ignored...

Author: Sergei Golubchik
Author Date: 2022-07-24 11:34:39 UTC

MDEV-28816 Assertion `wsrep_thd_is_applying(thd)' failed in int wsrep_ignored_error_code(Log_event*, int)

wsrep expected that any Rows_log_event::do_apply_event() failures
can only happen in the applier thread, because no other thread ever
applies row events. With online alter it's no longer true.

preview-10.10-misc 2022-07-23 05:58:19 UTC
MDEV-29154: Excessive warnings upon a call to RANDOM_BYTES

Author: Daniel Black
Author Date: 2022-07-23 05:58:13 UTC

MDEV-29154: Excessive warnings upon a call to RANDOM_BYTES

Bring the 5 warnings of select random_bytes(cast('x' as unsigned)+1);
back to two. 1 for Item_func_random_bytes::fix_length_and_dec and
one from Item_func_random_bytes::val_str.

The warnings are from args[0]->val_int().

bb-10.4-midenok 2022-07-20 14:40:45 UTC
MDEV-21540 Initialization of already inited long unique index on reorganize p...

Author: midenok
Author Date: 2022-07-20 14:40:45 UTC

MDEV-21540 Initialization of already inited long unique index on reorganize partition

Handler for existing partition was already index-inited at the
beginning of copy_partitions().

In the case of REORGANIZE PARTITION we fill new partition by calling
its ha_write_row() (handler is storage engine of new partition). From
that we go through the below conditions:

    if (this->inited == RND)
      table->clone_handler_for_update();
    handler *h= table->update_handler ? table->update_handler : table->file;

First, the above misses the meaning of this->inited check. Now it is
new partition and this handler is not inited. So, we assign
table->file which is ha_partition and is really not known to be inited
or not. It is supposed (this == table->file), otherwise we are
out of the logic for using update_handler. This patch adds DBUG_ASSERT
for that.

Second, we call check_duplicate_long_entries() for table->file and
that calls ha_partition::index_init() which calls index_init() for
each partition's handler. But the existing parititions' handlers was
already inited in copy_partitions() and we fail on assertion.

The fix implies that we don't need check_duplicate_long_entries()
per-partition as we've already done check_duplicate_long_entries() for
ha_partition. For REORGANIZE PARTITION that means existing row was
already checked at previous INSERT/UPDATE commands, so no need to
check it again (see NOTE in handler::ha_write_row()).

The fix also optimizes ha_update_row() so
check_duplicate_long_entries_update() is not called per-partition
considering it was already called for ha_partition. Besides,
per-partition duplicate check is not really usable.

bb-10.4-MDEV-27233-2 2022-07-20 00:36:11 UTC
MDEV-27233 Server hangs when using --init-file which loads Spider and creates...

Author: Nayuta Yanagisawa
Author Date: 2022-04-25 09:29:01 UTC

MDEV-27233 Server hangs when using --init-file which loads Spider and creates a Spider table

Spider waits until the server initialization is complete
(i.e., mysqld_server_started == 1) before creating the Spider system
tables like mysql.spider_XX. Spider also wait until the tables are
created before instantiating ha_spider.

This results in dead lock when Spider is loaded and a non-system
Spider table is created by --in-file because queries passed by
--in-file are executed during the server initialization
(i.e., mysqld_server_started == 0).

In the first place, there seems to be no need for Spider to wait until
the server initialization is completed before creating the system
tables. Thus, we simply remove that synchronization.

bb-10.10-spetrunia2 2022-07-19 12:19:54 UTC
MDEV-28929: Plan selection takes forever with MDEV-28852 ...

Author: Sergey Petrunia
Author Date: 2022-07-19 11:13:17 UTC

MDEV-28929: Plan selection takes forever with MDEV-28852 ...
Part #2: Extend heuristic pruning to use multiple tables as the
"Model tables".

Before the patch, heuristic pruning uses only one "Model table":
The table which had the best cost AND record became the "Model table".
After that, if a table's cost and record were both worse than
those of the Model Table, the table would be pruned away.

This didn't work well when the first table (the optimizer sorts them
by record_count) had low record_count but relatively high cost: nothing
could be pruned afterwards.

The patch adds the two additional "Model tables": one with the least
cost and the other with the least record_count.
(In both cases, a table can be pruned away if BOTH its cost and
record_count are worse than those of a Model table)

The new pruning is active when the number of tables to consider for
the prefix is higher than @@optimizer_extra_pruning_depth.

One can see the new pruning in the Optimizer Trace as
- "pruned_by_heuristic":"min_record_count", or
- "pruned_by_heuristic":"min_read_time".
Old heuristic pruning shows as "pruned_by_heuristic":1.

bb-10.10-mdev28929-v4 2022-07-19 12:19:54 UTC
MDEV-28929: Plan selection takes forever with MDEV-28852 ...

Author: Sergey Petrunia
Author Date: 2022-07-19 11:13:17 UTC

MDEV-28929: Plan selection takes forever with MDEV-28852 ...
Part #2: Extend heuristic pruning to use multiple tables as the
"Model tables".

Before the patch, heuristic pruning uses only one "Model table":
The table which had the best cost AND record became the "Model table".
After that, if a table's cost and record were both worse than
those of the Model Table, the table would be pruned away.

This didn't work well when the first table (the optimizer sorts them
by record_count) had low record_count but relatively high cost: nothing
could be pruned afterwards.

The patch adds the two additional "Model tables": one with the least
cost and the other with the least record_count.
(In both cases, a table can be pruned away if BOTH its cost and
record_count are worse than those of a Model table)

The new pruning is active when the number of tables to consider for
the prefix is higher than @@optimizer_extra_pruning_depth.

One can see the new pruning in the Optimizer Trace as
- "pruned_by_heuristic":"min_record_count", or
- "pruned_by_heuristic":"min_read_time".
Old heuristic pruning shows as "pruned_by_heuristic":1.

bb-10.3-MDEV-28758-galera 2022-07-19 11:26:19 UTC
MDEV-28758: Mariabackup copies binary logs to backup directory

Author: Julius Goryavsky
Author Date: 2022-07-19 11:26:19 UTC

MDEV-28758: Mariabackup copies binary logs to backup directory

This commit restores defaults and functionality regarding binlogs
to the way it was prior to MDEV-27524. The mariabackup utility no
longer saves binlogs files as part of a backup without the --galera-info
option. However, since we use --galera-info during SST, the behavior
of mariabackup changes and, in combination with GTIDs support enabled,
mariabackup transfers one (most recent) binlog file obtained after
FLUSH BINARY LOGS. In other cases, binlogs are not transferred during
SST in mariabackup mode. As for SST in the rsync mode, it works the
same way as before MDEV-27524 - by default it transfers one last
binlog file.

The --sst-max-binlogs option for mariabackup and the sst_max_binlogs
parameter in the [sst] / server sections are no longer supported for
SST via mariabackup.

bb-10.3-midenok 2022-07-18 23:06:14 UTC
Fix

Author: midenok
Author Date: 2022-07-18 23:06:03 UTC

Fix

bb-10.3-MDEV-17124 2022-07-18 13:42:10 UTC
MDEV-17124: mariadb 10.1.34, views and prepared statements: ERROR 1615 (HY00...

Author: Oleksandr "Sanja" Byelkin
Author Date: 2019-04-17 13:50:59 UTC

MDEV-17124: mariadb 10.1.34, views and prepared statements: ERROR 1615 (HY000): Prepared statement needs to be re-prepared

The problem is that if table definition cache (TDC) is full of real tables
which are in tables cache, view definition can not stay there so will be
removed by its own underlying tables.
In situation above old mechanism of detection matching definition in PS
and current version always require reprepare and so prevent executing
the PS.

One work around is to increase TDC, other - improve version check for
views/triggers (which is done here). Now in suspicious cases we check:
 - timestamp (ms) of the view to be sure that version really have changed;
 - time (ms) of creation of a trigger related to time (ms) of statement
   preparation.

1100 of 1425 results

Other repositories

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