-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 bad null error handling for insert statement when disabling the strict SQL mode #10161
Conversation
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #10161 +/- ##
===========================================
Coverage ? 77.9766%
===========================================
Files ? 407
Lines ? 83139
Branches ? 0
===========================================
Hits ? 64829
Misses ? 13511
Partials ? 4799 |
@@ -1767,8 +1767,13 @@ func (s *testSuite) TestSQLMode(c *C) { | |||
|
|||
tk.MustExec("set sql_mode = ''") | |||
tk.MustExec("insert t values ()") | |||
tk.MustQuery("show warnings").Check(testkit.Rows("Warning 1364 Field 'a' doesn't have a default value")) | |||
_, err = tk.Exec("insert t values (null)") |
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.
Can we have a insert ignore t values (null)
test? A warning is expected in non-strict mode
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.
PTAL @bb7133 .
LGTM |
LGTM |
…ling the strict SQL mode (pingcap#10161)
What problem does this PR solve?
Fix #10153 , disabling the strict SQL mode should not ignore the bad null error.
What is changed and how it works?
Fix it when resetting the context of the statement.
Check List
Tests
Code changes
Related changes