Data types
PolarDB-X 1.0 supports four categories of data types: numeric, string, date and time, and JSON. Spatial data types are not supported.
For syntax, storage requirements, and value ranges for each type, see Data types in the MySQL 5.7 Reference Manual.
Supported categories
| Category | Description |
|---|---|
| Numeric | Integer types (TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT), fixed-point types (DECIMAL, NUMERIC), floating-point types (FLOAT, DOUBLE), and the BIT type |
| String | CHAR, VARCHAR, BINARY, VARBINARY, BLOB, TEXT, ENUM, and SET types |
| Date and time | DATE, TIME, DATETIME, TIMESTAMP, and YEAR types |
| JSON | The JSON type for storing JSON-formatted data |
Type notation
MySQL type definitions follow the form T(M[, D]), where:
Tis the data type (for example,INTorDECIMAL).Mis the maximum display width for integer types. For floating-point and fixed-point types,Mis the total number of digits (precision). For string types,Mis the maximum length.Dapplies to floating-point and fixed-point types and specifies the number of digits after the decimal point (scale).fspapplies toTIME,DATETIME, andTIMESTAMPtypes and represents fractional seconds precision. Valid values are 0 to 6.Square brackets (
[and]) indicate optional parts of a type definition.
MySQL compatibility
PolarDB-X 1.0 is compatible with MySQL 5.7 data types with the following exception:
Spatial data types are not supported. Types such as
GEOMETRY,POINT,LINESTRING, andPOLYGONare unavailable.
For all other data type behavior, PolarDB-X 1.0 follows MySQL 5.7 semantics. Consult the MySQL 5.7 Reference Manual for details on syntax, storage requirements, value ranges, and type-specific behavior.