-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
session, util: update session to use new APIs #22652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
session/tidb_test.go
Outdated
@@ -141,26 +141,7 @@ func removeStore(c *C, dbPath string) { | |||
|
|||
func exec(se Session, sql string, args ...interface{}) (sqlexec.RecordSet, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us eliminate this function as it is only used in mustExec
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look in a followup PR. For now it looks like we are not getting into Execute/ExecuteInternal in the tests.
Well, maybe we don't need to change all the test code, as long as it does not affect the removal of the deprecated API. |
I've reverted the tests so that they are still using |
LGTM |
/merge |
/run-all-tests |
@morgo merge failed. |
/run-unit-test |
Oh, I've met that kind of DATA RACE before... |
How do you think about creating a new session like:
|
session/session.go
Outdated
@@ -2644,22 +2633,26 @@ var builtinGlobalVariable = []string{ | |||
|
|||
var ( | |||
loadCommonGlobalVarsSQLOnce sync.Once | |||
loadCommonGlobalVarsSQL string | |||
loadCommonGlobalVarsStmt ast.StmtNode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DATA RACE is caused by here, in the test cases, multiple test case run loadCommonGlobalVariablesIfNeeded
and they will use astNode.Accept(vistor)
(which is not read-only operation) in statement rewriter.
/run-all-tests |
/merge |
/run-all-tests |
/merge |
/run-all-tests |
@morgo merge failed. |
/run-tics-test |
/merge |
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #22804 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0-rc in PR #22805 |
* cherry pick #22652 to release-5.0-rc Signed-off-by: ti-srebot <ti-srebot@pingcap.com> * fix merge conflicts * fix merge * remove needless check Co-authored-by: Morgan Tocker <tocker@gmail.com> Co-authored-by: Ti Chi Robot <71242396+ti-chi-bot@users.noreply.github.com>
What problem does this PR solve?
Part of https://github.com/pingcap/tidb-test/issues/1152
Problem Summary:
This fixes the session package to use the new APIs. It is expected to be backward compatible and covered by existing tests.
The bootstrap tasks between versions were not updated, as I'm not sure they will be accurately covered by unit tests to detect regressions.
What is changed and how it works?
New API usage.
Related changes
Check List
Tests
Side effects
Release note