maria:bb-10.6-mdev32203

Last commit made on 2023-09-25
Get this branch:
git clone -b bb-10.6-mdev32203 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-mdev32203
Repository:
lp:maria

Recent commits

b0d30b1... by Monty <email address hidden>

MDEV-32203 Raise notes when an index cannot be used on data type mismatch

Raise notes if indexes cannot be used:
- in case of data type or collation mismatch (diferent error messages)
- in case if a table field was replaced to something else
  (e.g. Item_func_conv_charset) during a condition rewrite

Added option to write warnings and notes to the slow query log for
slow queries.

New variables added/changed:

- note_verbosity, with is a set of the following options:
  normal - All old notes
  unusable_keys - Print warnings about keys that cannot be used
                     for select, delete or update.
  explain - Print unusable_keys warnings for EXPLAIN querys

  The default is 'normal,explain'.

- log_slow_verbosity has a new option 'warnings'. If this is set
  then warnings and notes generated are printed in the slow query log
  (up to log_slow_max_warnings times per statement).

- log_slow_max_warnings - Max number of warnings written to
                            slow query log.

Other things:
- One can now use =ALL for any 'set' variable to set all options at once.
  For example using "note_verbosity=ALL" in a config file or
  "SET @@note_verbosity=ALL' in SQL.
- mysqldump will in the future use @@note_verbosity=""' instead of
  @sql_notes=0 to disable notes.
- Added "enum class Data_type_compatibility" and changing the return type
  of all Field::can_optimize*() methods from "bool" to this new data type.

Reviewer & Co-author: Alexander Barkov <email address hidden>
- The code that prints out the notes comes mainly from Alexander

59c4e13... by Monty <email address hidden>

Correction of receent PR in mroonga for 10.6 code

Updated ha_mroonga::storage_check_if_supported_inplace_alter to support
new ALTER TABLE flags.

This fixes failing tests:
mroonga/storage.alter_table_add_index_unique_duplicated
mroonga/storage.alter_table_add_index_unique_multiple_column_duplicated

cc5856f... by Monty <email address hidden>

squash! cf425fb554fcaae4dd7e6135cdc3da79f5f8bffc

Rename of tables was not handled in case of ALGORITHM=copy (old bug).

Fixed that we do not collect statistics for hidden hash columns
used by UNIQUE constraint on long values.
Fixed that we do not collect statistics for blob columns refered by
generated virtual columns. This was achived by storing the fields for
which we want to have statistics in table->has_value_set instead of
in table->read_set.

9d09d1c... by Monty <email address hidden>

Changed some malloc() calls to my_malloc()

- hostnames in hostname_cache added
- Some Galera (WSREP) allocations
- Table caches

a3f06e7... by Monty <email address hidden>

Added Myisam, Aria and InnoDB buffer pool to @@memory_used status variable

This makes it easier to see how much memory MariaDB server has allocated.
(For all memory allocations that goes through mysys)

cf425fb... by Monty <email address hidden>

MDEV-31957 Concurrent ALTER and ANALYZE collecting statistics can result in stale statistical data

Example of what causes the problem:
T1: ANALYZE TABLE starts to collect statistics
T2: ALTER TABLE starts by deleting statistics for all changed fields,
    then creates a temp table and copies data to it.
T1: ANALYZE ends and writes to the statistics tables.
T2: ALTER TABLE renames temp table in place of the old table.

Now the statistics from analyze matches the old deleted tables.

Fixed by waiting to delete old statistics until ALTER TABLE is
the only one using the old table and ensure that rename of columns
can handle swapping of column names.

rename_columns_in_stat_table() (former rename_column_in_stat_tables())
now takes a list of columns to rename. It uses the following algorithm
to update column_stats to be able to handle circular renames

- While there are columns to be renamed and it is the first loop or
  last rename loop did change something.
  - Loop over all columns to be renamed
    - Change column name in column_stat
      - If fail because of duplicate key
      - If this is first change attempt for this column
         - Change column name to a temporary column name
         - If there was a conflicting row, replace it with the current row.
    else
     - Remove entry from column list

- Loop over all remaining columns in the list
 - Remove the conflicting row
 - Change column from temporary name to final name in column_stat

Other things:
- Don't flush tables for every operation. Only flush when all updates
  are done.

Reviewer: Sergei Petrunia <email address hidden>

0f87091... by Yuchen Pei <email address hidden>

Merge branch '10.5' into 10.6

cf81626... by Yuchen Pei <email address hidden>

Merge branch '10.4' into 10.5

18990f0... by Yuchen Pei <email address hidden>

MDEV-32157 MDEV-28856 Spider: Tests, documentation, small fixes and cleanups

Removed some redundant hint related string literals from
spd_db_conn.cc

Clean up SPIDER_PARAM_*_[CHAR]LEN[S]

Adding tests covering monitoring_kind=2. What it does is that it reads
from mysql.spider_link_mon_servers with matching db_name, table_name,
link_id, and does not do anything about that...

How monitoring_* can be useful: in the deprecated spider high
availability feature, when one remote fails, spider will try another
remote, which apparently makes use of these table parameters.

A test covering the query_cache_sync table param. Some further tests
on some spider table params.

Wrapper should be case insensitive.

Code documentation on spider priority binary tree.

Add an assertion that static_key_cardinality is always -1. All tests
pass still

3b3200e... by Yuchen Pei <email address hidden>

MDEV-32157 MDEV-28856 Spider: drop server in tests

This helps eliminate "server exists" failures

Also, spider/bugfix.mdev_29676, when enabled after MDEV-29525 is
pushed will fail because we have not --recorded the result. But the
failure will only emerge when working on MDEV-31138 where we manually
re-enable this test, so let's worry about that then.