Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 建表使用
long byte
类型时,TiDB 与 MySQL 表现不一致
【TiDB Environment】Test environment
【TiDB Version】v6.1.0
【Encountered Problem】
Create table statement:
CREATE TABLE t1 (col2 LONG BYTE) ENGINE=INNODB CHARACTER SET UTF8MB4;
- TiDB table structure is as follows
mysql> SHOW CREATE TABLE t1;
+-------+------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`col2` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
- MySQL 5.7.36 table structure is as follows
mysql> show create table t1;
+-------+---------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`col2` mediumblob
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+-------+---------------------------------------------------------------------------------+
1 row in set (0.00 sec)
This inconsistency causes the pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py::test_MySQLdb::test_LONG_BYTE
test case to fail.