Closed zimulala closed 2 weeks ago
Please answer these questions before submitting your issue. Thanks!
set @@sql_mode=''; drop table if exists t1; create table t1(b tinyint default '11111111'); alter table t1 add column(c tinyint default '11111111');
MySQL 5.7.44 and MySQL 8.0.18
mysql> create table t1(c tinyint default '11111111'); ERROR 1067 (42000): Invalid default value for 'b' create table t1(b tinyint); mysql> alter table t1 add column(c tinyint default '11111111'); ERROR 1067 (42000): Invalid default value for 'c'
tidb> create table t1(b tinyint default '11111111'); Query OK, 0 rows affected, 1 warning (0.01 sec) tidb> show warnings; +---------+------+-------------------------------------+ | Level | Code | Message | +---------+------+-------------------------------------+ | Warning | 1690 | constant 11111111 overflows tinyint | +---------+------+-------------------------------------+ 1 row in set (0.00 sec) tidb> alter table t1 add column(c tinyint default '11111111'); Query OK, 0 rows affected, 1 warning (0.02 sec)
master
related https://github.com/pingcap/tidb/issues/51320
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
MySQL 5.7.44 and MySQL 8.0.18
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
master
related https://github.com/pingcap/tidb/issues/51320