Skip to content

Commit

Permalink
sessionctx/variable: fix field(History) typo in TransactionContext (
Browse files Browse the repository at this point in the history
  • Loading branch information
lonng authored and ngaut committed Dec 7, 2018
1 parent d9e02b7 commit f72769c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion executor/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (e *SimpleExec) executeBegin(ctx context.Context, s *ast.BeginStmt) error {
// If BEGIN is the first statement in TxnCtx, we can reuse the existing transaction, without the
// need to call NewTxn, which commits the existing transaction and begins a new one.
txnCtx := e.ctx.GetSessionVars().TxnCtx
if txnCtx.Histroy != nil {
if txnCtx.History != nil {
err := e.ctx.NewTxn(ctx)
if err != nil {
return errors.Trace(err)
Expand Down
4 changes: 2 additions & 2 deletions session/tidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ func runStmt(ctx context.Context, sctx sessionctx.Context, s sqlexec.Statement)

// GetHistory get all stmtHistory in current txn. Exported only for test.
func GetHistory(ctx sessionctx.Context) *StmtHistory {
hist, ok := ctx.GetSessionVars().TxnCtx.Histroy.(*StmtHistory)
hist, ok := ctx.GetSessionVars().TxnCtx.History.(*StmtHistory)
if ok {
return hist
}
hist = new(StmtHistory)
ctx.GetSessionVars().TxnCtx.Histroy = hist
ctx.GetSessionVars().TxnCtx.History = hist
return hist
}

Expand Down
4 changes: 2 additions & 2 deletions sessionctx/variable/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type TransactionContext struct {
DirtyDB interface{}
Binlog interface{}
InfoSchema interface{}
Histroy interface{}
History interface{}
SchemaVersion int64
StartTS uint64
Shard *int64
Expand Down Expand Up @@ -134,7 +134,7 @@ func (tc *TransactionContext) Cleanup() {
//tc.InfoSchema = nil; we cannot do it now, because some operation like handleFieldList depend on this.
tc.DirtyDB = nil
tc.Binlog = nil
tc.Histroy = nil
tc.History = nil
tc.TableDeltaMap = nil
}

Expand Down

0 comments on commit f72769c

Please sign in to comment.