-
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
ddl: fill in original default for extra writable columns in batch insert (#40198) #53053
ddl: fill in original default for extra writable columns in batch insert (#40198) #53053
Conversation
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
e1ff702
to
cfbc908
Compare
[LGTM Timeline notifier]Timeline:
|
/test build |
Signed-off-by: xhe <xw897002528@gmail.com>
[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
Needs 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 |
5e74466
into
pingcap:release-6.5-20230625-v6.5.3
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 ignore
statement without specifying columns doesn't fill in the origin default value.INSERT
actually 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