maria:bb-11.5-MDEV-33677-galera

Last commit made on 2024-05-09
Get this branch:
git clone -b bb-11.5-MDEV-33677-galera https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-11.5-MDEV-33677-galera
Repository:
lp:maria

Recent commits

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

MDEV-33677 : Port Performance Schema for Galera from ES

Added performance schema tables for Galera.
This is a port of the code from ES 10.6.

Refs:
MENT-346 commit 86c06851
MENT-346 commit 10d0fcaf
MENT-1333 commit 2005adc3
MENT-347 commit aaca43b4
MENT-1370 commit 1f460e6b

e4afa61... by Brandon Nesterenko

MDEV-7850: Extend GTID Binlog Events with Thread Id

This patch augments Gtid_log_event with the user thread-id.
In particular that compensates for the loss of this info in
Rows_log_events.

Gtid_log_event::thread_id gets visible in mysqlbinlog output like

  #231025 16:21:45 server id 1 end_log_pos 537 CRC32 0x1cf1d963 GTID 0-1-2 ddl thread_id=10

as a 32 bit unsigned integer. Note this is a 32-bit value, as
the connection id can only be 32 bits (see MDEV-15089 for
details).

While the size of Gtid event has grown by 4 bytes
replication from OLD <-> NEW is not affected by it. This patch
also slightly changes the logic to convert Gtid events to Query
events for older replicas which don't support Gtid. Instead of
hard-coding the padding of the sys var section of the generated
Query event, the length to pad is dynamically calculated based
on the length of the Gtid event.

This work was started by the late Sujatha Sivakumar.
Brandon Nesterenko took it over, reviewed initial patches and
extended the work.

Also thanks to Andrei for his help in finalizing the fixes for
MDEV-33924, which were squashed into this patch.

Reviewed-by:
=============
Andrei Elkin <email address hidden>
Kristian Nielsen <email address hidden>

f151c5f... by Alexander Barkov

MDEV-34025 Virtual columns do not check assignment cast validity

It was possible to create virtual columns with incompatible
GENERATED ALWAYS expression data types:

  CREATE TABLE t1 (a INT, b POINT GENERATED ALWAYS AS (a));
  CREATE TABLE t1 (a POINT, b INT GENERATED ALWAYS AS (a));

These data type combinations are not allowed in other cases,
e.g. INSERT, UPDATE, SP variable assignment.

Fix:

Disallowing bad combinations of the column data type and its
GENERATED ALWAYS expression data type.

f582ea4... by Alexander Barkov

A cleanup for MDEV-12668 SRID is not preserved in UNION, VIEW, MIN, MAX

Fixing storage/mroonga according to MDEV-12668

001f93d... by Alexander Barkov

MDEV-12668 SRID is not preserved in UNION, VIEW, MIN, MAX

Fixing the problem that an operation involving a mix of
two or more GEOMETRY operands did not preserve their SRIDs.
Now SRIDs are preserved by hybrid functions, subqueries, TVCs, UNIONs, VIEWs.

Incompatible change:
  An attempt to mix two different SRIDs now raises an error.

Details:

- Adding a new class Type_extra_attributes. It's a generic
  container which can store very specific data type attributes.
  For now it can store one uint32 and one const pointer attribute
  (for GEOMETRY's SRID and for ENUM/SET TYPELIB respectively).
  In the future it can grow as needed.

  Type_extra_attributes will also be reused soon to store "const Type_zone*"
  pointers for the TIMESTAMP's "WITH TIME ZONE 'tz'" attribute
  (a timestamp data type with a fixed time zone independent from @@time_zone).
  The time zone attribute will be stored in exactly the same way like
  a TYPELIB pointer is stored by ENUM/SET.

- Removing Column_definition_attributes members "interval" and "srid".
  Deriving Column_definition_attributes from the generic attribute container
  Type_extra_attributes instead.

- Adding a new class Type_typelib_attributes, to store
  the TYPELIB of the ENUM and SET data types. Deriving Field_enum from it.
  Removing the member Field_enum::typelib.

- Adding a new class Type_geom_attributes, to store
  the GEOMETRY related attributes. Deriving Field_geom from it.
  Removing the member Field_geom::srid.

- Removing virtual methods:
    Field::get_typelib()
    Type_all_attributes::get_typelib() and
    Type_all_attributes::set_typelib()
  They were very specific to TYPELIB.
  Adding more generic virtual methods instead:
  * Field::type_extra_attributes() - to get extra attributes
  * Type_all_attributes::type_extra_attributes() - to get extra attributes
  * Type_all_attributes::type_extra_attributes_addr() - to set extra attributes

- Removing Item_type_holder::enum_set_typelib. Deriving Item_type_holder
  from the generic attribute container Type_extra_attributes instead.
  This makes it possible for UNION to preserve SRID
  (in addition to preserving TYPELIB).

- Deriving Item_hybrid_func from Type_extra_attributes.
  This makes it possible for hybrid functions (e.g. CASE, COALESCE,
  LEAST, GREATEST etc) to preserve SRID.

- Deriving Item_singlerow_subselect from Type_extra_attributes and
  overriding methods:
  * Item_cache::type_extra_attributes()
  * subselect_single_select_engine::fix_length_and_dec()
  * Item_singlerow_subselect::type_extra_attributes()
  * Item_singlerow_subselect::type_extra_attributes_addr()
  This is needed to preserve SRID in subqueries and TVCs

- Cleanup: fixing the data type of members
  * Binlog_type_info::m_enum_typelib
  * Binlog_type_info::m_set_typelib
  from "TYPELIB *" to "const TYPELIB *"

486d42d... by Sergey Petrunia

MDEV-18478 ANALYZE for statement should show selectivity of ICP, part#3

Fix the previous patch:
- Only enable handler_stats if thd->should_collect_handler_stats()==true.
- Make handler_index_cond_check() work when handler_stats are not enabled.

86e727b... by Dave Gosselin <email address hidden>

We rely on handler_stats pointing to a valid active_handler_stats
instance, for ICP accounting, which is created
during ha_handler_stats_reset(). Always invoke that method
during table init to ensure that the handler, regardless of
implementation, has the pointer set correctly

a11a101... by Dave Gosselin <email address hidden>

accrue statistics to correct handler

0940a96... by Sergey Petrunia

MDEV-18478 ANALYZE for statement should show selectivity of ICP, part#2

Part#2, variant 2: Make the printed r_ values in JSON output consistent.
After this patch, ANALYZE output has:

- r_index_rows (NEW) - Observed number of rows before ICP or Rowid Filtering
  checks. This is a per-scan average. like r_rows and "rows" are.

- r_rows (AS BEFORE) - Observed number of rows after ICP and Rowid Filtering.

- r_icp_filtered (NEW) - Observed selectivity of ICP condition.

- (AS BEFORE) observed selectivity of Rowid Filter is in
  $.rowid_filter.r_selectivity_pct

- r_total_filtered - Observed combined selectivity: fraction of rows left
  after applying ICP condition, Rowid Filter, and attached_condition.
  This is now comparable with "filtered" and is printed right after it.

- r_filtered (AS BEFORE) - Observed selectivity of "attached_condition".

Tabular ANALYZE output is not changed. Note that JSON's r_filtered and
r_rows have the same meanings as before and have the same meaning as in
tabular output.

e87d1e3... by Sergey Petrunia

MDEV-18478 ANALYZE for statement should show selectivity of ICP, part#1

(Based on the original patch by Jason Cu)

Part #1:
- Add ha_handler_stats::{icp_attempts,icp_match}, make
  handler_index_cond_check() increment them.
- ANALYZE FORMAT=JSON now prints r_icp_filtered based on these counters.