-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
tidb allows NULL value to NOT NULL column #57435
Comments
To make things easy to copy-paste: select @@sql_mode;
create table t( pk int primary key not null auto_increment, data binary(12) not null);
insert into t(data) values (null);
select @@version; Looks like a MySQL 9.1.0:
TiDB v8.4.0:
So the issue here is that without any SQL mode set MySQL returns an error for 1048 and TiDB returns a warning. Note that MySQL 5.7.33 also returns an error, just like MySQL 8.0 and MySQL 9.1 |
Errror 1048 is known in the code as |
Extending the test to include
|
Maybe fixed by #55477. Let me verify it. |
So this is fixed in master:
|
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
Tidb should not allow insert of NULL value to NOT NULL column. See below mysql result:
3. What did you see instead (Required)
tidb allows insert of NULL value to NOT NULL column, it's incompatible with mysql
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: