session: cleanup an useless function (#19977)

This commit is contained in:
Jack Yu
2020-09-15 21:48:20 +08:00
committed by GitHub
parent aed24e46e2
commit f699bd81a2
2 changed files with 2 additions and 8 deletions

View File

@ -719,7 +719,8 @@ func (s *testSessionSuite) TestRetryCleanTxn(c *C) {
history := session.GetHistory(tk.Se)
stmtNode, err := parser.New().ParseOneStmt("insert retrytxn values (2, 'a')", "", "")
c.Assert(err, IsNil)
stmt, _ := session.Compile(context.TODO(), tk.Se, stmtNode)
compiler := executor.Compiler{Ctx: tk.Se}
stmt, _ := compiler.Compile(context.TODO(), stmtNode)
executor.ResetContextOfStmt(tk.Se, stmtNode)
history.Add(stmt, tk.Se.GetSessionVars().StmtCtx)
_, err = tk.Exec("commit")

View File

@ -175,13 +175,6 @@ func Parse(ctx sessionctx.Context, src string) ([]ast.StmtNode, error) {
return stmts, nil
}
// Compile is safe for concurrent use by multiple goroutines.
func Compile(ctx context.Context, sctx sessionctx.Context, stmtNode ast.StmtNode) (sqlexec.Statement, error) {
compiler := executor.Compiler{Ctx: sctx}
stmt, err := compiler.Compile(ctx, stmtNode)
return stmt, err
}
func recordAbortTxnDuration(sessVars *variable.SessionVars) {
duration := time.Since(sessVars.TxnCtx.CreateTime).Seconds()
if sessVars.TxnCtx.IsPessimistic {