executor: implement set transaction read only as of transaction#24766
executor: implement set transaction read only as of transaction#24766ti-chi-bot merged 13 commits intopingcap:masterfrom
Conversation
Signed-off-by: yisaer <disxiaofei@163.com>
|
/cc @xhebox |
executor/stale_txn_test.go
Outdated
|
|
||
| func (s *testStaleTxnSerialSuite) TestSetTransactionReadOnlyAsOf(c *C) { | ||
| tk := testkit.NewTestKit(c, s.store) | ||
| tk.MustExec(`SET TRANSACTION READ ONLY as of timestamp '2021-04-21 00:42:12'`) |
There was a problem hiding this comment.
Should support expression? our bound read is a function call.
There was a problem hiding this comment.
It is already supported, the testcase updated.
Signed-off-by: yisaer <disxiaofei@163.com>
|
/lgtm |
|
@xhebox: Thanks for your review. The bot only counts DetailsIn response to this:
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 ti-community-infra/tichi repository. |
…action_read_only_as_of
97b2c43 to
7f7643f
Compare
|
/label sig/sql-infra |
|
@Yisaer: The label(s) DetailsIn response to this:
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 ti-community-infra/tichi repository. |
|
/sig sql-infra |
sessionctx/variable/varsutil.go
Outdated
| } | ||
|
|
||
| // GoTimeToTS converts a Go time to uint64 timestamp. | ||
| func GoTimeToTS(t time.Time) uint64 { |
There was a problem hiding this comment.
I think this function is duplicated with oracle.GoTimeToTS, maybe we should remove it and use the latter.
b320672 to
8e32482
Compare
|
/lgtm |
executor/simple.go
Outdated
| e.ctx.GetSessionVars().SetInTxn(true) | ||
| return nil |
There was a problem hiding this comment.
Why do you set it and return? To walk around s.ReadOnly part?
| }, GetSession: func(s *SessionVars) (string, error) { | ||
| return s.TxnScope.GetVarValue(), nil | ||
| }}, | ||
| {Scope: ScopeSession, Name: TiDBTxnReadTS, Value: "", SetSession: func(s *SessionVars, val string) error { |
There was a problem hiding this comment.
Is this sysvar exposed to users?
There was a problem hiding this comment.
I think it is ok to exposed it.
There was a problem hiding this comment.
The problem is, users may also use this variable to set read ts.
54308ce to
8085f85
Compare
Signed-off-by: yisaer <disxiaofei@163.com> address the comment Signed-off-by: yisaer <disxiaofei@163.com> address the comment Signed-off-by: yisaer <disxiaofei@163.com>
8085f85 to
ce2df75
Compare
…action_read_only_as_of
Signed-off-by: yisaer <disxiaofei@163.com> address the comment Signed-off-by: yisaer <disxiaofei@163.com>
2cb8e67 to
6c938a7
Compare
|
/lgtm |
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by writing |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 6c938a7 |
e2b4d41 to
3c465d0
Compare
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 3c465d0 |
|
@Yisaer: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. DetailsInstructions 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 ti-community-infra/tichi repository. |
Signed-off-by: yisaer disxiaofei@163.com
What problem does this PR solve?
Issue Number: ref #21094
What is changed and how it works?
Implement
Set Transaction read only as of .....statement.Check List
Tests
Release note