slave_type_conversions

Overview

Configures how data type conversions are handled when row-based binary log events are applied. When set to the empty string, data types must match exactly, and no conversions are allowed.

USAGE

DETAILS

The slave_type_conversions system variable configures how data type conversions are handled when row-based binary log events are applied. Statement-based binary log events are not impacted by this system variable.

The slave_type_conversions system variable can impact anything that uses row-based binary log events, including MariaDB ReplicationMariaDB Replication, Galera ClusterGalera Cluster, and Point-in-time recovery (PITR)Point-in-time recovery (PITR).

Value

Description

ALL_NON_LOSSY

All safe conversions (no data loss) are allowed.

ALL_LOSSY

All lossy conversions are allowed, such as BIGINT to INT. This does not mean that safe conversions (lossless) are also allowed.

ALL_NON_LOSSY,ALL_LOSSY

All conversions are allowed, both lossy and lossless.

"" (an empty string)

The server returns an error if the table definition between the primary and replica differs and replication stops.

SYNONYMS

SCHEMA

PARAMETERS

Command-line

--slave_type_conversions={ALL_LOSSY|ALL_NON_LOSSY}

Configuration file

Supported

Dynamic

Yes

Scope

Global

Data Type

SET (ALL_LOSSY, ALL_NON_LOSSY)

Product Default Value

"" (an empty string)

SKYSQL

Cloud

SkySQL Topology

ES Ver

Service Default

AWS

Multi-Node Analytics

10.6

"" (an empty string)

Single Node Analytics

10.6

"" (an empty string)

Replicated Transactions

10.4

"" (an empty string)

10.5

"" (an empty string)

10.6

"" (an empty string)

Single Node Transactions

10.4

"" (an empty string)

10.5

"" (an empty string)

10.6

"" (an empty string)

GCP

Multi-Node Analytics

10.6

"" (an empty string)

Single Node Analytics

10.6

"" (an empty string)

Replicated Transactions

10.4

"" (an empty string)

10.5

"" (an empty string)

10.6

"" (an empty string)

Single Node Transactions

10.4

"" (an empty string)

10.5

"" (an empty string)

10.6

"" (an empty string)

Cloud

SkySQL Topology

ES Ver

Service Default

AWS

ColumnStore Data Warehouse

10.6

"" (an empty string)

Enterprise Server With Replica(s)

10.4

"" (an empty string)

10.5

"" (an empty string)

10.6

"" (an empty string)

Enterprise Server Single Node

10.4

"" (an empty string)

10.5

"" (an empty string)

10.6

"" (an empty string)

GCP

ColumnStore Data Warehouse

10.6

"" (an empty string)

Enterprise Server With Replica(s)

10.4

"" (an empty string)

10.5

"" (an empty string)

10.6

"" (an empty string)

Enterprise Server Single Node

10.4

"" (an empty string)

10.5

"" (an empty string)

10.6

"" (an empty string)

PRIVILEGES

EXAMPLES

Set in a Configuration File

A configuration file can persistently set the global value:

[mariadb]
slave_type_conversions='ALL_NON_LOSSY,ALL_LOSSY'

After changing a configuration file, the server must be restarted. To change the global value without a server restart, set it with SET GLOBAL too.

Set Dynamically with SET GLOBAL

SET GLOBAL can dynamically set the global value:

SET GLOBAL slave_type_conversions = 'ALL_NON_LOSSY';

This operation requires the SUPER privilege.

When the server is restarted, the change does not persist. To make the change persist on restart, set it in a configuration file too.

Set on the Command-line

When MariaDB Server (mariadbd) is started via the command-line, the --slave-type-conversions command-line option can set the global value:

$ mariadbd .. --slave-type-conversions='ALL_NON_LOSSY' ..

Show Value with SHOW VARIABLES

Use the SHOW GLOBAL VARIABLES SQL statement to show the global value:

SHOW GLOBAL VARIABLES
   LIKE 'slave_type_conversions';

Since this system variable is only global scope, SHOW VARIABLES and SHOW SESSION VARIABLES also show the global value.

Query Value using @@global

In SELECT and other SQL statements, @@global can be queried for the global value:

SELECT @@global.slave_type_conversions;

Since this system variable is only global scope, @@session can't be queried for this variable.

Query Information Schema

The information_schema.SYSTEM_VARIABLES table can be queried to obtain details about the system variable:

SELECT *
FROM information_schema.SYSTEM_VARIABLES
WHERE VARIABLE_NAME LIKE 'slave_type_conversions';

The information_schema.GLOBAL_VARIABLES table can be queried to obtain the global value:

SELECT *
FROM information_schema.GLOBAL_VARIABLES
WHERE VARIABLE_NAME LIKE 'slave_type_conversions';

This system variable is only global scope, so the information_schema.SESSION_VARIABLES table can also be queried to obtain the global value:

SELECT *
FROM information_schema.SESSION_VARIABLES
WHERE VARIABLE_NAME LIKE 'slave_type_conversions';

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.08 Enterprise

  • Present starting in MariaDB Enterprise Server 23.08.0.

23.07 Enterprise

  • Present starting in MariaDB Enterprise Server 23.07.0.

10.6 Enterprise

  • Present starting in MariaDB Enterprise Server 10.6.4-1.

10.6 Community

  • Present starting in MariaDB Community Server 10.6.0.

10.5 Enterprise

  • Present starting in MariaDB Enterprise Server 10.5.3-1.

10.5 Community

  • Present starting in MariaDB Community Server 10.5.0.

10.4 Enterprise

  • Present starting in MariaDB Enterprise Server 10.4.6-1.

10.4 Community

  • Present starting in MariaDB Community Server 10.4.0.

10.3 Enterprise

  • Present starting in MariaDB Enterprise Server 10.3.16-1.

10.3 Community

  • Present starting in MariaDB Community Server 10.3.0.

10.2 Enterprise

  • Present starting in MariaDB Enterprise Server 10.2.25-1.

10.2 Community

  • Present starting in MariaDB Community Server 10.2.0.

Release Series

History

23.08 Enterprise

  • Present starting in MariaDB Enterprise Server 23.08.0.

23.07 Enterprise

  • Present starting in MariaDB Enterprise Server 23.07.0.

10.6 Enterprise

  • Present starting in MariaDB Enterprise Server 10.6.4-1.

10.5 Enterprise

  • Present starting in MariaDB Enterprise Server 10.5.3-1.

10.4 Enterprise

  • Present starting in MariaDB Enterprise Server 10.4.6-1.

EXTERNAL REFERENCES