Data type in AnalyticDB for MySQL V3.0 | Description | Data type in a MySQL tenant of OceanBase Database |
BOOLEAN | Valid values: 0 and 1. Storage size: 1 byte. 0: indicates false. 1: indicates true.
| BOOLEAN |
TINYINT | Value range: -128 to 127. Storage size: 1 byte. | TINYINT |
SMALLINT | Value range: -32768 to 32767. Storage size: 2 bytes. | SMALLINT |
INT or INTEGER | Value range: -2147483648 to 2147483647. Storage size: 4 bytes. | INT or INTEGER |
BIGINT | Value range: -9223372036854775808 to 9223372036854775807. Storage size: 8 bytes. | BIGINT |
FLOAT | Value range: -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to 3.402823466E+38. Technical standard: IEEE. Storage size: 4 bytes. | FLOAT |
DOUBLE | Value range: -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and 2.2250738585072014E-308 to 1.7976931348623157E+308. Technical standard: IEEE. Storage size: 8 bytes. | DOUBLE |
DECIMAL(m,d) or NUMERIC | m: the maximum precision of the number, which ranges from 1 to 1000. d: the number of decimal places on the right of the decimal point, whose value must be less than or equal to that of m. | DECIMAL(m,d) |
VARCHAR(n) | A VARCHAR value can be up to 16 MB in size. You do not need to specify the size when you use VARCHAR. | Non-primary key column and index column: VARCHAR(4094) Primary key column and index column: MEDIUMTEXT |
BINARY(n) | | Non-primary key column and index column: VARBINARY(4094) Primary key column and index column: MEDIUMBLOB |
DATE | Value range: '0001-01-01' to '9999-12-31'. Format: 'YYYY-MM-DD'. Storage size: 4 bytes. | DATE |
TIME | Value range: '00:00:00' to '23:59:59'. Format: 'HH:MM:SS'. Storage size: 8 bytes. | TIME(3) |
DATETIME | Value range: '0001-01-01 00:00:00.000' in UTC to '9999-12-31 23:59:59.999' in UTC. Format: 'YYYY-MM-DD HH:MM:SS'. Storage size: 8 bytes. | DATETIME(3) |
TIMESTAMP | Value range: '0100-01-01 00:00:00.000' in UTC to '9999-12-31 23:59:59.999' in UTC. Format: 'YYYY-MM-DD HH:MM:SS'. Storage size: 8 bytes. | TIMESTAMP(3) |
POINT | Geographic coordinates x and y. | POINT |
JSON | | JSON |