Skip to main content
Common Reference

dropsqlmode.js Filter

Different releases of MySQL occasionally add/remove various sql_modes, and in doing so if replicating between different versions, you may receive errors during replication as MySQL will reject unknown sql_modes.

This filter was specifically added to handle replication between MySQL 5.7 and MySQL 8 where a number of sql_modes were removed.

Pre-configured filter namedropsqlmode
JavaScript Filter Filetungsten-replicator/support/filters-javascript/dropsqlmode.js
Property prefixreplicator.filter.dropsqlmode
Stage compatibilityq-to-dbms
tpm Option compatibilitysvc-applier-filters
Data compatibilityAny event

Parameters

ParameterTypeDefaultDescription
modesstringSee below| separated string of sql_modes to drop

By default, the filter is configured to drop the following sql_modes: NO_AUTO_CREATE_USER,NO_FIELD_OPTIONS,NO_KEY_OPTIONS,NO_TABLE_OPTIONS

If you wish to add/remove sql_modes from this list, you will need to override the property as follows:

property=replicator.filter.dropsqlmode.modes=NO_AUTO_CREATE_USER|NO_FIELD_OPTIONS|NO_KEY_OPTIONS|NO_TABLE_OPTIONS| TIME_TRUNCATE_FRACTIONAL