-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.component/parserreport/customerCustomers have encountered this bug.Customers have encountered this bug.severity/moderatetype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Wrong default value for integer type cause error in tiflash: pingcap/tiflash#3157
mysql test> create table t (a int);
-- The type of column i is int, but the default value is set to "0.00"
mysql test> alter table t add column i int not null default 0.00;
mysql test> show create table t;
2. What did you expect to see? (Required)
+-------+-------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------+
| t | CREATE TABLE `t` ( |
| | `a` int(11) DEFAULT NULL, |
| | `i` int(11) NOT NULL DEFAULT '0' |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-------------------------------------------------------------+
3. What did you see instead (Required)
+-------+-------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------+
| t | CREATE TABLE `t` ( |
| | `a` int(11) DEFAULT NULL, |
| | `i` int(11) NOT NULL DEFAULT '0.00' |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-------------------------------------------------------------+
4. What is your TiDB version? (Required)
master
Defined2014
Metadata
Metadata
Assignees
Labels
affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.component/parserreport/customerCustomers have encountered this bug.Customers have encountered this bug.severity/moderatetype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.