MySQL 8.4.0
Source Code Documentation
|
One use case for filtering relates to hidden generated columns. More...
#include <column_filter_inbound_func_indexes.h>
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 |
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.
|
overrideprivatevirtual |
Implements cs::util::ColumnFilter.
|
static |
Is this filter needed given context passed in the parameters.
thd | the thread objected associated to filter |
table | the table where the columns are being iterated |
tabledef | the source table definition if applicable |