maria:bb-10.6-mdev30081-variant2

Last commit made on 2023-01-12
Get this branch:
git clone -b bb-10.6-mdev30081-variant2 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-mdev30081-variant2
Repository:
lp:maria

Recent commits

c8e7288... by Sergey Petrunia

MDEV-30081: Crash with split_materialized over a VIEW

Consider a view and use of Split Materialized optimization to read it:

  create view v1 as (SELECT ... id1 FROM t1 GROUP BY id1);
  SELECT ... LEFT JOIN v1 ON v1.id1 = tbl2.col

Split Materialized will need to construct ref access inside the view:

  t1.id1= {outer reference to tbl2.col}

It will do so by cloning both parts of the equality (v1.id1 =tbl2.col)
and then "pushing it down" into subquery by calling

  item->walk(&Item::set_fields_as_dependent_processor, parent_join->select_lex)

for both parts of the equality.
The problem was that left part of the equality was "v1.id1", namely an
Item_direct_view_ref, which did not implement
set_fields_as_dependent_processor() function.

Failure to do that resulted in Item_direct_view_ref reporting invalid
used_tables() in some cases (the case we've hit required that
Item_direct_view_ref is inside an outer join, and the column it refers
to is marked as constant)

Fixed by implementing Item_direct_ref::set_fields_as_dependent_processor().

56c9b0b... by Marko Mäkelä

Merge 10.5 into 10.6

17858e0... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-30179 mariabackup --backup fails with FATAL ERROR: ... failed
   to copy datafile

- Mariabackup fails to copy the undo log tablespace when it undergoes
truncation. So Mariabackup should detect the redo log which does
undo tablespace truncation and also backup should read the minimum
file size of the tablespace and ignore the error while reading.

- Throw error when innodb undo tablespace read failed, but backup
doesn't find the redo log for undo tablespace truncation

cad33de... by Daniel Black

MDEV-30344: Without wsrep needs wsrep{,_on}.h headers

In the Develop package because of their use from sql_class.h
which is the main file for THD needed by server plugins.

d0a534d... by shk

Fix synopses in mysys APIs

Since 7c58e97 the PSI_memory_key was added to some routines in the
mysys/. This commit fixes synopses of functions that were updated with
the PSI_memory_key parameter.

494acc1... by Monty <email address hidden>

MDEV-30325 Wrong result upon range query using index condition wrong result upon range query using index condition

This was caused by a bug in key_or() when SEL_ARG* key1 has been cloned
and is overlapping with SEL_ARG *key2

Cloning of SEL_ARG's happens only in very special cases, which is why this
bug has remained undetected for years.

It happend in the following query:

SELECT COUNT(*) FROM lineitem force index
(i_l_orderkey_quantity,i_l_shipdate) WHERE
l_shipdate < '1994-01-01' AND l_orderkey < 800 OR
l_quantity > 3 AND l_orderkey NOT IN ( 157, 1444 );

Because there are two different indexes that can be used and the code for
IN causes a 'tree_or', which causes all SEL_ARG's to be cloned.

Other things:
- While checking the code, I found a bug in SEL_ARG::SEL_ARG(SEL_ARG &arg)
 - This was incrementing next_key_part->use_count as part of creating a
   copy of an existing SEL_ARG.
   This is however not enough as the 'reverse operation' when the copy is
   not needed is 'key2_cpy.increment_use_count(-1)', which does something
   completely different.
   Fixed by calling increment_use_count(1) in SEL_ARG::SEL_ARG.

12a85c6... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-30346 Avoid block device required error in innodb_fts.misc_debug

- Returns DB_LOCK_WAIT_TIMEOUT for the stats_lock_fail
debug sync point

f8f7475... by Robin Newhouse <email address hidden>

MDEV-30344 MTR tests fail when built without WSREP

When building with -DWITH_WSREP=OFF, files required for MTR tests are
excluded and several tests fail. This is cause by a recent commit
7b44d0ba which attempted to resolve MDEV-23230.

Even when building without WSREP/Galera support some of the MTR include
files named *wsrep* are required by other tests.

Removing the following from the CMake install macros will avoid
excluding the MTR test .inc files:
`|include/((w.*)?wsrep.*|.*galera.*)\\.inc`

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.

fe38d7c... by Marko Mäkelä

Remove redundant statements from a test

d0603fc... by Monty <email address hidden>

MDEV-30240 Wrong result upon aggregate function with SQL_BUFFER_RESULT

The problem was that when storing rows into a temporary table,
MIN/MAX items that where marked as constants (as theire value had
been computed at start of query) would be reset.

Fixed by not reseting MIN/MAX items that are marked as const in
Item_sum_min_max::clear().