maria:bb-11.3-MDEV-31496-sargable-casefold

Last commit made on 2023-08-16
Get this branch:
git clone -b bb-11.3-MDEV-31496-sargable-casefold https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-11.3-MDEV-31496-sargable-casefold
Repository:
lp:maria

Recent commits

f43752a... by Sergey Petrunia

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

(Review input addressed)
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".

ffc0886... by Sergei Golubchik

update results for new UUID sorting

it checks the version and activates after 11.2.0.
Now result files are the same as in 11.1

66f0f2f... by Sergei Golubchik

bump the VERSION

4e87081... by Sergei Golubchik

cleanup: remove useless check

create_table_impl() doesn't need to search for a temporary table
when the table_name is like #sql-xxx

80439e6... by Anel Husakovic <email address hidden>

MDEV-31618: Server crashes in process_i_s_table_temporary_tables/get_all_tables after alter in rename query

Any TMP_TABLE_SHARE must always have at least one TABLE instance.
So whenever a temporary TABLE that is marked for reopen is closed,
reopen it at once if its TMP_TABLE_SHARE list of tables becomes empty.

de57da7... by Anel Husakovic <email address hidden>

MDEV-28351: Assertion `this->file->children_attached' failed in ha_myisammrg::info

- Fix MSAN uninitialized value error, obtained by calling handlerton's
`info()`, and referencing uninitialized `errkey`.
- Reviewer: <email address hidden>

82d9d72... by Anel Husakovic <email address hidden>

MDEV-31618: Server crashes in process_i_s_table_temporary_tables/get_all_tables

- Pre-open temporary table on sequence creation.
- Without this patch, if rename alter is done on the temporary sequence,
  and after that `create replace`, since table is not preopened and
  alter rename marked the table as reopen, and such table is deleted in
  the `find_temporary_table()` leaving the share without the table, that
  causes `show tables` to fail
- Closes PR #2685
- Reviewer: <email address hidden>

62decb5... by Sergei Golubchik

MDEV-12459 post-review fixes

* IS_USER_TEMP_TABLE() was misleading, name didn't match the code
* list of temp tables was rescanned number_of_databases times
* some temporary tables were not shown (from nonexistent databases)
* some temporary tables were shown more than once (e.g. after self-joins)
* sys.table_exists() - avoid querying I_S twice
* fix handling of temporary MERGE tables - it's pointless to fully open
  them, they're not in thd->temporary_tables, so they simply fail to
  open and are skipped. Relax the assertion instead.

1fb4828... by Anel Husakovic <email address hidden>

MDEV-28343: sys.create_synonym_db fails with ER_VIEW_SELECT_TMPTABLE when schema contains temporary tables

- MDEV-28342 raised the error in case temporary table shadows base table
- Now we are allowed to shadow base tables with temporary tables and
`sys.create_synonym_db()` can easily check for existance of temporary table and
ignore view creation, since it is not supported to create view from
temporary table.

Reviewed-by: <email address hidden>,
             <email address hidden>

91bfc76... by Monty <email address hidden>

MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info

Reviewed-by: <email address hidden>