maria:bb-10.3-MDEV-16128

Last commit made on 2022-10-11
Get this branch:
git clone -b bb-10.3-MDEV-16128 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.3-MDEV-16128
Repository:
lp:maria

Recent commits

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

MDEV-16128: Server crash in Item_func::print_op on 2nd execution of PS

For some queries that involve tables with different but convertible
character sets for columns taking part in the query, repeatable
execution of such queries in PS mode or as part of a stored routine
would result in server abnormal termination.

For example,
  CREATE TABLE t1 (a2 varchar(10));
  CREATE TABLE t2 (u1 varchar(10) CHARACTER SET utf8);
  CREATE TABLE t3 (u2 varchar(10) CHARACTER SET utf8);
  PREPARE stmt FROM
    "SELECT t1.* FROM (t1 JOIN t2 ON (t2.u1 = t1.a2))
     WHERE (EXISTS (SELECT 1 FROM t3 WHERE t3.u2 = t1.a2))";

  EXECUTE stmt;
  EXECUTE stmt; <== Running this prepared statement the second time
                    results in server crash.

The reason of server crash is that an instance of the class
Item_func_conv_charset, that created for conversion of a column
from one character set to another, is allocated on execution
memory root but pointer to this instance is stored in an item
placed on prepared statement memory root. Below is calls trace to
the place where an instance of the class Item_func_conv_charset
is created.

setup_conds
 Item_func::fix_fields
  Item_bool_rowready_func2::fix_length_and_dec
   Item_func::setup_args_and_comparator
    Item_func_or_sum::agg_arg_charsets_for_comparison
     Item_func_or_sum::agg_arg_charsets
      Item_func_or_sum::agg_item_set_converter
       Item::safe_charset_converter

And the following trace shows the place where a pointer to
the instance of the class Item_func_conv_charset is passed
to the class Item_func_eq, that is created on a memory root of
the prepared statement.

Prepared_statement::execute
 mysql_execute_command
  execute_sqlcom_select
   handle_select
    mysql_select
     JOIN::optimize
      JOIN::optimize_inner
       convert_join_subqueries_to_semijoins
        convert_subq_to_sj

To fix the issue, switch to the Prepared Statement memory root
before calling the method Item_func::setup_args_and_comparator
in order to place any created Items on permanent memory root.
It may seem that such approach would result in a memory
leakage in case the parameter marker '?' is used in the query
as in the following example
  PREPARE stmt FROM
    "SELECT t1.* FROM (t1 JOIN t2 ON (t2.u1 = t1.a2))
     WHERE (EXISTS (SELECT 1 FROM t3 WHERE t3.u2 = ?))";
  EXECUTE stmt USING convert('A' using latin1);
but it wouldn't since for such case any of the parameter markers
is treated as a constant and no subquery to semijoin optimization
is performed.

7a28c82... by Zhibo Zhang <email address hidden>

MDEV-29183: Clarify mysqlbinlog command description (#2245)

The statement 'Verify checksum binlog events.' is confusing. Fix word order to make it clear.

c49ebd2... by Julius Goryavsky <email address hidden>

MDEV-21905: Galera test galera_var_notify_cmd causes hang

The problem is related to performing operations without switching
wsrep off, this commit fixes this and allows disabled tests.

e05ab0c... by Marko Mäkelä

Silence clang 13 -Wunused-but-set-variable for Bison

56b97ca... by Marko Mäkelä

MDEV-29742 heap number overflow

A previous fix in commit efd8af535a4fa4aa3dd89a325340b6eb648e1bc8
failed to cover ALTER TABLE.

PageBulk::isSpaceAvailable(): Check for record heap number overflow.

602124b... by Anel Husakovic <email address hidden>

Remove redudant defines USE_MB and USE_MB_IDENT

Reviewer: <email address hidden>

d099bca... by Jan Lindström

Test results updated.

09f7889... by Jan Lindström

MDEV-29706 : SIGSEGV in wsrep_TOI_begin on non-Galera builds

Do not allow setting wsrep_on=ON if no provider is set.

074e358... by midenok

MDEV-29697 Assertion failure in Diagnostics_area::set_ok_status
           upon CREATE OR REPLACE causing ER_UPDATE_TABLE_USED

Missed set return status to 1.

0779e2c... by midenok

MDEV-28576 RENAME COLUMN with NOCOPY algorithm leads to corrupt partitioned table

When f.ex. table is partitioned by HASH(a) and we rename column `a' to
`b' partitioning filter stays unchanged: HASH(a). That's the wrong
behavior.

The patch updates partitioning filter in accordance to the new columns
names. That includes partition/subpartition expression and
partition/subpartition field list.