MySQL Cache Mapping

This section discusses the data type mappings and restrictions for caches stored on MySQL.

MySQL removes trailing spaces from strings stored in a VARCHAR column and trailing 0x20 bytes from a VARBINARY column.
MySQL truncates millisecond data from TIME, DATETIME, and TIMESTAMP columns.
MySQL changes any NULL stored in a TIMESTAMP column into the current date. Use DATETIME to preserve NULL values.
TDV creates tables using the UTF8 character set to handle international characters properly. You can create the tables using other character sets based on your performance and character set needs.
Small variations in the least significant digits may be encountered when storing FLOAT and DOUBLE values due to the way the driver handles and database stores such data.

The following table shows the mapping from TDV data types to native types.

Data Type

Preferred Native Type

Other Allowed Native Types

BIGINT

BIGINT

DECIMAL(19+, 0), larger INTEGER types, VARCHAR(20+)

BINARY(n)

BLOB;
LONGBLOB [if n > 255]

TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB

BIT

BIT

DECIMAL(1+, 0), larger INTEGER types

BLOB

LONGBLOB

 

BOOLEAN

BIT

BIT, BOOL

CHAR(n)

CHAR(n);
LONGTEXT [if n > 255]

CHAR(n+), TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT

CLOB

CLOB

 

DATE

DATE

VARCHAR(10+)

DECIMAL(p,s)

DECIMAL(p,s);
TEXT [if p > 30]

DECIMAL(p+,s+), VARCHAR(p+3+), TINYTEXT, MEDIUMTEXT, LONGTEXT, INTEGER types with enough resolution

DOUBLE

DOUBLE

VARCHAR(24+)

FLOAT

FLOAT

VARCHAR(24+)

INTEGER

INTEGER

DECIMAL(10+, 0), larger INTEGER types, VARCHAR(20+)

NUMERIC(p,s)

NUMERIC(p,s);
TEXT [if p > 30]

DECIMAL(p+,s+), VARCHAR(p+3+), TINYTEXT, MEDIUMTEXT ,LONGTEXT, INTEGER types with enough resolution

SMALLINT

SMALLINT

DECIMAL(5+, 0), larger INTEGER types, VARCHAR(20+)

TIME

TIME

VARCHAR(15+)

TIMESTAMP

DATETIME

TIMESTAMP

TINYINT

TINYINT

DECIMAL(3+, 0), larger INTEGER types, VARCHAR(20+)

VARBINARY(n)

BLOB;
LONGBLOB [if n > 255]

TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB

VARCHAR(n)

VARCHAR(n); LONGTEXT [if n > 255]

VARCHAR(n+), TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT

XML

LONGTEXT

VARCHAR(*), TINYINT, TEXT, MEDIUMTEXT [Truncates data if column too small]