session: cleanup an useless function (#19977)
This commit is contained in:
@ -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")
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user