-
Notifications
You must be signed in to change notification settings - Fork 6k
executor: fix INSERT IGNORE + STRICT Mode + DST transition. #61440
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 INSERT IGNORE + STRICT Mode + DST transition. #61440
Conversation
Hi @mjonss. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
Pull Request Overview
This PR fixes the behavior when combining INSERT IGNORE with STRICT mode during a DST transition by adjusting the erroneous timestamp and ensuring the row is inserted with a warning instead of being skipped.
- Added integration tests to verify the correct behavior.
- Updated expected test outputs in result files.
- Adjusted error handling logic in pkg/executor/insert_common.go to give IGNORE precedence over STRICT mode.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/integrationtest/t/executor/insert.test | Added integration test for INSERT IGNORE with DST transition case. |
tests/integrationtest/r/executor/insert.result | Updated expected result output for the new behavior. |
pkg/executor/insert_common.go | Changed error handling logic to account for ignore flag priority. |
Comments suppressed due to low confidence (1)
pkg/executor/insert_common.go:329
- [nitpick] Consider renaming 'ignoreErr' to a more descriptive name such as 'shouldIgnoreError' to clarify its purpose in determining whether to convert errors to warnings.
if !e.ignoreErr && e.Ctx().GetSessionVars().SQLMode.HasStrictMode() {
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #61440 +/- ##
================================================
+ Coverage 73.1533% 73.6095% +0.4562%
================================================
Files 1727 1729 +2
Lines 479773 482535 +2762
================================================
+ Hits 350970 355192 +4222
+ Misses 107279 105851 -1428
+ Partials 21524 21492 -32
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
/ok-to-test |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, YangKeao The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #61439
Problem Summary:
In #61337 there was a missed case, where INSERT IGNORE and STRICT mode was combined, which resulted in not inserting a row, when it should have been adjusted and inserted.
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.