ddl: fill in original default for extra writable columns in batch insert (#40198)#53053
Merged
ti-chi-bot[bot] merged 4 commits intopingcap:release-6.5-20230625-v6.5.3from May 7, 2024
Conversation
4 tasks
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
e1ff702 to
cfbc908
Compare
Defined2014
previously approved these changes
May 7, 2024
hawkingrei
previously approved these changes
May 7, 2024
[LGTM Timeline notifier]Timeline:
|
Contributor
|
/test build |
Signed-off-by: xhe <xw897002528@gmail.com>
Defined2014
previously approved these changes
May 7, 2024
Defined2014
approved these changes
May 7, 2024
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-6.5-20230625-v6.5.3 #53053 +/- ##
================================================================
Coverage ? 73.4130%
================================================================
Files ? 1080
Lines ? 346459
Branches ? 0
================================================================
Hits ? 254346
Misses ? 75690
Partials ? 16423 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #40198
Signed-off-by: YangKeao yangkeao@chunibyo.icu
What problem does this PR solve?
Issue Number: close #40192, close #50993
Problem Summary:
When a column is in write-only state, the
INSERT ignorestatement without specifying columns doesn't fill in the origin default value.INSERTactually works, because it appends, seetidb/table/tables/tables.go
Lines 798 to 813 in 95f0dc5
This case can also work well with unique index (if the origin default value is NULL) and NOT NULL.
It also avoids inserting more than 1 rows if the columns is NOT NULL and write-only (as the user cannot set a value for it). I doubt whether it is expected. (However, many other places depend on this behavior, and as I've tried, modifying this behavior is really scarying... I didn't touch it in this PR).
What is changed and how it works?
Append the origin default value if there are extra write-only column.
Check List
Tests
Release note