maria:10.4-MDEV-14959

Last commit made on 2023-05-24
Get this branch:
git clone -b 10.4-MDEV-14959 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
10.4-MDEV-14959
Repository:
lp:maria

Recent commits

35e4347... by Dmitry Shulga <email address hidden>

MDEV-14959: Control over memory allocated for SP/PS

Use sp_head::executed_counter only for debug output. The decision
to mark sp_head's mem_root as read only is performed based on
the fact that every SP instruction has been executed at least once.

d8721f0... by Dmitry Shulga <email address hidden>

MDEV-14959: Control over memory allocated for SP/PS

Moved calculation a number of reserved items before call
select_lex->setup_ref_array() in order to avoid allocation of
SP memory on third invocation.

591d9ad... by Dmitry Shulga <email address hidden>

MDEV-14959: Control over memory allocated for SP/PS

Support for mem_root protection on read only for SP.
Memory root of a stored route is marked as read only after
the second execution.

5952a11... by Dmitry Shulga <email address hidden>

MDEV-14959: Support for mem_root protection on read only.

Memory root of Prepared statements is marked as read only after
the second execution.

b7b8a9e... by Rucha Deodhar <email address hidden>

MDEV-23187: Assorted assertion failures in json_find_path with certain
collations

Fix by Alexey Botchkov

The 'value_len' is calculated wrong for the multibyte charsets. In the
read_strn() function we get the length of the string with the final ' " '
character. So have to subtract it's length from the value_len. And the
length of '1' isn't correct for the ucs2 charset (must be 2).

996b040... by Angelique Sklavounos

MDEV-30232: Increase timeouts to fix sporadic fails

8810b1e... by Andrew Hutchings

Fix Connect compile issue

2ff01e7... by Mikhail Chalov <email address hidden>

Fix insecure use of strcpy, strcat and sprintf in Connect

Old style C functions `strcpy()`, `strcat()` and `sprintf()` are vulnerable to
security issues due to lacking memory boundary checks. Replace these in the
Connect storage engine with safe new and/or custom functions such as
`snprintf()` `safe_strcpy()` and `safe_strcat()`.

With this change FlawFinder and other static security analyzers report 287
fewer findings.

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.

b3cdb61... by Alexander Barkov

MDEV-31250 ROW variables do not get assigned from subselects

ROW variables did not get assigned from subselects in these contexts:

BEGIN
  DECLARE r ROW TYPE OF t1;
  SET r=(SELECT * FROM t1 WHERE a=1);
END;

BEGIN
  DECLARE r ROW TYPE OF t1 DEFAULT (SELECT * FROM t1 WHERE a=1);
END;

All fields of the ROW variable remained NULL.

0474466... by Igor Babaev

MDEV-31240 Crash with condition pushable into derived and containing outer reference

This bug could affect queries containing a subquery over splittable derived
tables and having an outer references in its WHERE clause. If such subquery
contained an equality condition whose left part was a reference to a column
of the derived table and the right part referred only to outer columns
then the server crashed in the function st_join_table::choose_best_splitting()
The crashing code was added in the commit ce7ffe61d836fe9f0cfc1087f058bc40d66e5cfb
that made the code of the function sensitive to presence of the flag
OUTER_REF_TABLE_BIT in the KEYUSE_EXT::needed_in_prefix fields.

The field needed_in_prefix of the KEYUSE_EXT structure should not contain
table maps with OUTER_REF_TABLE_BIT or RAND_TABLE_BIT.

Note that this fix is quite conservative: for affected queries it just
returns the query plans that were used before the above mentioned commit.
In fact the equalities causing crashes should be pushed into derived tables
without any usage of split optimization.

Approved by Sergei Petrunia <email address hidden>