You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEt1 (a int, b int(10) zerofill, c int(300) zerofill);
SHOW CREATE TABLE t1\G
INSERT INTO t1 VALUES (1,1,1);
SELECT*FROM t1;
2. What did you expect to see? (Required)
MySQL refuses display lengths greater than 255
Why is TiDB adding the unsigned attribute?
Why is the zerofill persisted in metadata when it is not supported (nor planned). For other noops, it will warn on table creation and drop the attribute. Being able to read it back in show create table makes it appear like it is working. See fulltext for a better behavior example:
tidb> CREATE TABLE t2 (a varchar(200), fulltext(a));
Query OK, 0 rows affected, 1 warning (0.00 sec)
tidb> show warnings;
+---------+------+------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------+
| Warning | 1214 | The used table type doesn't support FULLTEXT indexes |+---------+------+------------------------------------------------------+1 row in set (0.00 sec)tidb> show create table t2;+-------+-----------------------------------------------------------------------------------------------------------------+| Table | Create Table |+-------+-----------------------------------------------------------------------------------------------------------------+| t2 | CREATE TABLE `t2` ( `a` varchar(200) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |+-------+-----------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec)
Bug Report
TiDB does not support zerofill, see #6688 (this part is fine).
The problem is that the behavior is weird.
Credits to @espresso98 for the bug report.
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
unsigned
attribute?zerofill
persisted in metadata when it is not supported (nor planned). For other noops, it will warn on table creation and drop the attribute. Being able to read it back inshow create table
makes it appear like it is working. Seefulltext
for a better behavior example:3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: