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

*: Txn() function signature refactor and remove ActivePendingTxn() #8327

Merged
merged 2 commits into from
Nov 16, 2018

Conversation

tiancaiamao
Copy link
Contributor

What problem does this PR solve?

Clean up after #8260

What is changed and how it works?

  • change Txn() function signature to Txn(active bool)
  • ActivePendingTxn() is not used any more because Txn() does the work
  • change executor builder getStartTS() uint64 to getStartTS() (uint64, error)

Check List

Tests

  • No code

@zz-jason @jackysp @zimulala @winkyao

* change Txn() function signature to Txn(active bool)
* ActivePendingTxn() is not used any more because Txn() does the work
@@ -207,8 +207,6 @@ func (e *ExecuteExec) Build() error {
var err error
if IsPointGetWithPKOrUniqueKeyByAutoCommit(e.ctx, e.plan) {
err = e.ctx.InitTxnWithStartTS(math.MaxUint64)
} else {
err = e.ctx.ActivePendingTxn()
Copy link
Member

Choose a reason for hiding this comment

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

Is it missed in the last 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.

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@tiancaiamao tiancaiamao added the type/enhancement The issue or PR belongs to an enhancement. label Nov 15, 2018
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT2 Indicates that a PR has LGTM 2. label Nov 15, 2018
@zz-jason
Copy link
Member

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

/run-all-tests tidb-test=pr/650

@tiancaiamao
Copy link
Contributor Author

/run-integration-ddl-test tidb-test=pr/650

@tiancaiamao
Copy link
Contributor Author

/run-build

@shenli
Copy link
Member

shenli commented Nov 15, 2018

I can not get the point of this PR. And for the Tests, why do you say "No code". There are a bunch of code changes.

@tiancaiamao
Copy link
Contributor Author

tiancaiamao commented Nov 15, 2018

Txn(...bool) this function signature is terrible, it was introduced as a compromise because I want the minimal changes. @shenli

Basically, there is no logic changes in this PR, except what @jackysp has pointed out.

@tiancaiamao
Copy link
Contributor Author

/run-integration-ddl-test tidb-test=pr/650

@tiancaiamao
Copy link
Contributor Author

/rebuild

@tiancaiamao
Copy link
Contributor Author

/run-all-tests tidb-test=pr/650

@tiancaiamao
Copy link
Contributor Author

/run-integration-ddl-test tidb-test=pr/650

@tiancaiamao tiancaiamao merged commit 3742a0d into pingcap:master Nov 16, 2018
@tiancaiamao tiancaiamao deleted the refactor-txn branch November 16, 2018 03:10
tiancaiamao added a commit to tiancaiamao/tidb that referenced this pull request Dec 4, 2018
…ingcap#8327)

* change Txn() function signature to Txn(active bool)
* ActivePendingTxn() is not used any more because Txn() does the work
* change executor builder getStartTS() uint64 to getStartTS() (uint64, error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants