When a CREATE TABLE or ALTER TABLE command is issued, MariaDB will silently change a column specification in the following cases:
To ease imports from other RDBMS's, MariaDB will also silently map the following data types:
Other Vendor Type | MariaDB Type |
---|---|
BOOL | TINYINT |
BOOLEAN | TINYINT |
CHARACTER VARYING(M) | VARCHAR(M) |
FIXED | DECIMAL |
FLOAT4 | FLOAT |
FLOAT8 | DOUBLE |
INT1 | TINYINT |
INT2 | SMALLINT |
INT3 | MEDIUMINT |
INT4 | INT |
INT8 | BIGINT |
LONG VARBINARY | MEDIUMBLOB |
LONG VARCHAR | MEDIUMTEXT |
LONG | MEDIUMTEXT |
MIDDLEINT | MEDIUMINT |
NUMERIC | DECIMAL |
Currently, all MySQL types are supported in MariaDB.
For type mapping between Cassandra and MariaDB, see Cassandra storage engine.
Silent changes in action:
CREATE TABLE SilenceIsGolden ( f1 TEXT CHARACTER SET binary, f2 VARCHAR(15) CHARACTER SET binary, f3 CHAR CHARACTER SET binary, f4 ENUM('x','y','z') CHARACTER SET binary, f5 VARCHAR (65536), f6 VARBINARY (65536), f7 INT1 ); Query OK, 0 rows affected, 2 warnings (0.31 sec) SHOW WARNINGS; +-------+------+-----------------------------------------------+ | Level | Code | Message | +-------+------+-----------------------------------------------+ | Note | 1246 | Converting column 'f5' from VARCHAR to TEXT | | Note | 1246 | Converting column 'f6' from VARBINARY to BLOB | +-------+------+-----------------------------------------------+ DESCRIBE SilenceIsGolden; +-------+-------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------------+------+-----+---------+-------+ | f1 | blob | YES | | NULL | | | f2 | varbinary(15) | YES | | NULL | | | f3 | binary(1) | YES | | NULL | | | f4 | enum('x','y','z') | YES | | NULL | | | f5 | mediumtext | YES | | NULL | | | f6 | mediumblob | YES | | NULL | | | f7 | tinyint(4) | YES | | NULL | | +-------+-------------------+------+-----+---------+-------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/silent-column-changes/