8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 13 种数据类型 / 13.9 使用其他数据库引擎的数据类型
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 84%

13.9 使用其他数据库引擎的数据类型13.9 Using Data Types from Other Database Engines

为了方便使用为其他供应商的 SQL 实现编写的代码,MySQL 将数据类型映射如下表所示。这些映射使从其他数据库系统导入表定义到 MySQL 更加容易。To facilitate the use of code written for SQL implementations from other vendors, MySQL maps data types as shown in the following table. These mappings make it easier to import table definitions from other database systems into MySQL.

数据类型映射发生在表创建时,之后原始类型规格将被丢弃。如果使用其他供应商的类型创建表然后发出 DESCRIBE tbl_name 语句,MySQL 将使用等效的 MySQL 类型报告表结构。例如:Data type mapping occurs at table creation time, after which the original type specifications are discarded. If you create a table with types used by other vendors and then issue a DESCRIBE tbl_name statement, MySQL reports the table structure using the equivalent MySQL types. For example:

mysql> CREATE TABLE t (a BOOL, b FLOAT8, c LONG VARCHAR, d NUMERIC);
Query OK, 0 rows affected (0.00 sec)

mysql> DESCRIBE t;
+-------+---------------+------+-----+---------+-------+
| Field | Type          | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| a     | tinyint(1)    | YES  |     | NULL    |       |
| b     | double        | YES  |     | NULL    |       |
| c     | mediumtext    | YES  |     | NULL    |       |
| d     | decimal(10,0) | YES  |     | NULL    |       |
+-------+---------------+------+-----+---------+-------+
4 rows in set (0.01 sec)