MySQL 8.4.0
Source Code Documentation
cs::util::ColumnFilterInboundFunctionalIndexes Class Reference

One use case for filtering relates to hidden generated columns. More...

#include <column_filter_inbound_func_indexes.h>

Inheritance diagram for cs::util::ColumnFilterInboundFunctionalIndexes:
[legend]

Static Public Member Functions

static bool is_filter_needed (THD const &thd, TABLE *table, table_def const *tabledef)
 Is this filter needed given context passed in the parameters. More...
 

Private Member Functions

bool filter_column (TABLE const *table, size_t column_index) override
 

Additional Inherited Members

- Public Member Functions inherited from cs::util::ColumnFilter
virtual ~ColumnFilter ()=default
 

Detailed Description

One use case for filtering relates to hidden generated columns.

These type of columns are used to support functional indexes and are not meant to be replicated nor included in the serialization/deserialization of binlog events. Moreover, since hidden generated columns are always placed at the end of the field set, replication would break for cases where replicas have extra columns, if they were not excluded from replication:

 SOURCE TABLE `t`                REPLICA TABLE `t`
 +----+----+----+------+------+  +----+----+----+-----+------+------+
 | C1 | C2 | C3 | HGC1 | HGC2 |  | C1 | C2 | C3 | EC1 | HGC1 | HGC2 |
 +----+----+----+------+------+  +----+----+----+-----+------+------+

In the above example, the extra column EC1 in the replica will be paired with the hidden generated column HGC1 of the source, if hidden generated columns were to be replicated. With filtering enabled for hidden generated columns, applier will observe the columns as follows:

 SOURCE TABLE `t`                REPLICA TABLE `t`
 +----+----+----+                +----+----+----+-----+
 | C1 | C2 | C3 |                | C1 | C2 | C3 | EC1 |
 +----+----+----+                +----+----+----+-----+

Inbound states we are receiving something from the source and filtering that data.

Member Function Documentation

◆ filter_column()

bool cs::util::ColumnFilterInboundFunctionalIndexes::filter_column ( TABLE const *  table,
size_t  column_index 
)
overrideprivatevirtual

◆ is_filter_needed()

bool cs::util::ColumnFilterInboundFunctionalIndexes::is_filter_needed ( THD const &  thd,
TABLE table,
table_def const *  tabledef 
)
static

Is this filter needed given context passed in the parameters.

Parameters
thdthe thread objected associated to filter
tablethe table where the columns are being iterated
tabledefthe source table definition if applicable
Returns
true if the filter should be used
false if the filter is not needed

The documentation for this class was generated from the following files: