-
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
executor: fix a bug that can not insert null into a not null column in the empty SQL mode #21237
Conversation
Signed-off-by: wjhuang2016 <[email protected]>
tk.MustExec("create table t (id int NOT NULL DEFAULT 8);") | ||
tk.MustExec("SET sql_mode = '';") | ||
tk.MustExec("insert into t values (1), (NULL), (2);") | ||
tk.MustQuery("select * from t").Check(testkit.Rows("1", "0", "2")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the warning for this query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
insert into t values (1), (NULL), (2);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MySQL reports an error if insert NULL only ...
Signed-off-by: wjhuang2016 <[email protected]>
Signed-off-by: wjhuang2016 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
/run-all-tests |
@wjhuang2016 merge failed. |
/merge |
/run-all-tests |
@wjhuang2016 merge failed. |
/run-e2e-test |
/merge |
/run-all-tests |
/run-cherry-picker |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #27832 |
Signed-off-by: wjhuang2016 [email protected]
What problem does this PR solve?
Issue Number: close #11648
Problem Summary:
What is changed and how it works?
Set BadNullAsWarning to
True
if not StrictSQLMode.Related changes
Check List
Tests
Side effects
Release note