Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sometimes it will success when adding a column with invalid default value #47870

Open
lcwangchao opened this issue Oct 20, 2023 · 0 comments
Open
Labels
affects-7.5 component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@lcwangchao
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set sql_mode='';
create table t1(a int);
alter table t1 add column (b int unsigned default '-1');

2. What did you expect to see? (Required)

Same with MySQL, an error should be reported:

mysql> alter table t1 add column (b int unsigned default '-1');
ERROR 1067 (42000): Invalid default value for 'b'

3. What did you see instead (Required)

Tidb success when adding a column with default value '-1'

4. What is your TiDB version? (Required)

master, I think it affects all TiDB versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant