maria:bb-11.3-MDEV-25870

Last commit made on 2023-09-24
Get this branch:
git clone -b bb-11.3-MDEV-25870 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-11.3-MDEV-25870
Repository:
lp:maria

Recent commits

905c3d6... by VladislavVaintroub

MDEV-25870 followup - some Windows ARM64 improvements

- optimize atomic store64/load64 implementation.
- allow CRC32 optimization. Do not allow pmull yet, as this fails like in
  https://stackoverflow.com/questions/54048837/how-to-perform-polynomial-multiplication-using-arm64

e9573c0... by Nikita Malyavin

fix rdb_i_s.cc build

28b4037... by Nikita Malyavin

Merge branch '11.2' into 11.3

d75ef02... by Alexander Barkov

MDEV-32220 sql_yacc.yy: unify the drop_routine rule

- Removing two copies of the drop_routine.
  Adding a shared and much simplified version.

- Removing LEX metods:
      bool stmt_drop_function(const DDL_options_st &options,
                              const Lex_ident_sys_st &db,
                              const Lex_ident_sys_st &name);

      bool stmt_drop_function(const DDL_options_st &options,
                              const Lex_ident_sys_st &name);

      bool stmt_drop_procedure(const DDL_options_st &options,
                               sp_name *name);

  The code inside the methods was very similar.
  Adding one method instead:

      bool stmt_drop_routine(const Sp_handler *sph,
                          const DDL_options_st &options,
                          const Lex_ident_sys_st &db,
                          const Lex_ident_sys_st &name);

- Adding a new virtual method Sp_handler:sqlcom_drop().
  It helped to unify the code inside the new stmt_drop_routine().

1988512... by Alexander Barkov

MDEV-32219 Shift/reduce grammar conflict: GRANT .. ON FUNCTION

Resolving the shift/reduce conflict conflict in:

GRANT .. ON /*ambiguity*/ FUNCTION f1 TO foo@localhost;
GRANT ... ON /*ambiguity*/ [TABLE] function TO foo@localhost;

and in

REVOKE .. ON /*ambiguity*/ FUNCTION f1 TO foo@localhost;
REVOKE ... ON /*ambiguity*/ [TABLE] function TO foo@localhost;

using a new %prec directive.

8d9bc61... by Andrew Hutchings

Update mysqltest-break.test

This test does not work in embedded and I cannot see an obvious way of fixing that. The test not running in embedded is not the end of the world here.

9f8c5e0... by IGOR BALASHENKO

Add break statement in mysqltest

f5aae71... by Alexander Barkov

MDEV-31606 Refactor check_db_name() to get a const argument

Problem:
Under terms of MDEV-27490, we'll update Unicode version used
to compare identifiers to 14.0.0. Unlike in the old Unicode version,
in the new version a string can grow during lower-case. We cannot
perform check_db_name() inplace any more.

Change summary:

- Allocate memory to store lower-cased identifiers in memory root

- Removing check_db_name() performing both in-place lower-casing and validation
  at the same time. Splitting it into two separate stages:
  * creating a memory-root lower-cased copy of an identifier
    (using new MEM_ROOT functions and Query_arena wrapper methods)
  * performing validation on a constant string
    (using Lex_ident_fs methods)

Implementation details:

- Adding a mysys helper function to allocate lower-cased strings on MEM_ROOT:

    lex_string_casedn_root()

  and a Query_arena wrappers for it:

    make_ident_casedn()
    make_ident_opt_casedn()

- Adding a Query_arena method to perform both MEM_ROOT lower-casing and
  database name validation at the same time:

    to_ident_db_internal_with_error()

  This method is very close to the old (pre-11.3) check_db_name(),
  but performs lower-casing to a newly allocated MEM_ROOT
  memory (instead of performing lower-casing the original string in-place).

- Adding a Table_ident method which additionally handles derived table names:

    to_ident_db_internal_with_error()

- Removing the old check_db_name()

e987b93... by Sergey Petrunia

MDEV-31496: Make optimizer handle UCASE(varchar_col)=...

(Review input addressed)
(Added handling of UPDATE/DELETE and partitioning w/o index)

If the properties of the used collation allow, do the following
equivalent rewrites:

1. UPPER(key_col)=expr -> key_col=expr
   expr=UPPER(key_col) -> expr=key_col
   (also rewrite both sides of the equality at the same time)

2. UPPER(key_col) IN (constant-list) -> key_col IN (constant-list)

- Mark utf8mb{3,4}_general_ci as collations that allow this.
- Add optimizer_switch='sargable_casefold=ON' to control this.
  (ON by default in this patch)
- Cover the rewrite in Optimizer Trace, rewrite name is
  "sargable_casefold_removal".

eece7f1... by THIRUNARAYANAN BALATHANDAYUTHAPANI

- Rename the DBUG_EXECUTE_IF from sys_shrink_buffer_pool_full to
sys_shrink_buffer_pool to make it as generic name.