Skip to content
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: make the inserting errors more easier to understand (#24044) #26189

Closed
wants to merge 9 commits into from

Conversation

zoomxi
Copy link
Contributor

@zoomxi zoomxi commented Jul 13, 2021

What problem does this PR solve?

Issue Number: close #24044

Problem Summary: The error messages when inserting errors are not easy to understand

What is changed and how it works?

What's Changed: changed doDupRowUpdate function in insert.go

How it Works: convert the err message in doDupRowUpdate when get column value

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Release note

  • No release note

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 13, 2021
@zoomxi
Copy link
Contributor Author

zoomxi commented Jul 13, 2021

/cc @wjhuang2016 @lzmhhh123 @mmyj @wshwsh12 please give my PR a review, thanks

@github-actions github-actions bot added the sig/execution SIG execution label Jul 13, 2021
@@ -1020,7 +1020,7 @@ func (s *testStaleTxnSuite) TestStmtCtxStaleFlag(c *C) {
},
// assert select statement
{
sql: fmt.Sprintf("select * from t"),
sql: "select * from t",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's duplicate with #26096.

@@ -155,7 +155,7 @@ func (s *testCoprocessorSuite) TestBuildTasks(c *C) {
func (s *testCoprocessorSuite) TestSplitRegionRanges(c *C) {
// nil --- 'g' --- 'n' --- 't' --- nil
// <- 0 -> <- 1 -> <- 2 -> <- 3 ->
_, cluster, pdClient, err := testutils.NewMockTiKV("", nil)
_, cluster, pdClient, _ := testutils.NewMockTiKV("", nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -53,7 +53,7 @@ import (
type Tracker struct {
mu struct {
sync.Mutex
// The children memory trackers. If the Tracker is the Global Tracker, like executor.GlobalDiskUsageTracker,
// children memory trackers. If the Tracker is the Global Tracker, like executor.GlobalDiskUsageTracker,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why delete The here?
And this fix is uncorrelated with making the inserting errors more easier to understand, If it's necessary, I think we could be modified it in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the goword abort the commit unless modified it. is this change too small to create another PR?

Copy link
Member

@mmyj mmyj Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean that the goword checker makes git commit failed?

I think one PR to do one thing is better, it's no problem to create a small PR to fix a typo or make lint happy. However, fixing many typos in one PR is better. ^_^

Copy link
Contributor Author

@zoomxi zoomxi Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thank you for reply

@@ -95,7 +95,6 @@ func InitTracker(t *Tracker, label int, bytesLimit int64, action ActionOnExceed)
t.bytesSoftLimit = int64(float64(bytesLimit) * softScale)
t.maxConsumed = 0
t.isGlobal = false
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@mmyj
Copy link
Member

mmyj commented Jul 13, 2021

Please add a unit test.

@ichn-hu ichn-hu mentioned this pull request Jul 13, 2021
@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 13, 2021
@zoomxi zoomxi closed this Jul 13, 2021
@zoomxi zoomxi deleted the zoomxi/24044 branch July 15, 2021 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The error messages when inserting errors are not easy to understand
7 participants