Skip to content

Commit

Permalink
Merge pull request #9520 from bdarnell/sql-log
Browse files Browse the repository at this point in the history
sql: Log statements to event log earlier
  • Loading branch information
bdarnell authored Sep 24, 2016
2 parents 061d197 + e11034b commit 2fc8d2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sql/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,9 @@ func (e *Executor) execStmtInOpenTxn(
planMaker.evalCtx.SetTxnTimestamp(txnState.sqlTimestamp)
planMaker.evalCtx.SetStmtTimestamp(e.cfg.Clock.PhysicalTime())

session := planMaker.session
log.Event(session.context, stmt.String())

// TODO(cdo): Figure out how to not double count on retries.
e.updateStmtCounts(stmt)
switch s := stmt.(type) {
Expand Down Expand Up @@ -980,9 +983,6 @@ func (e *Executor) execStmtInOpenTxn(
return Result{PGTag: s.StatementTag()}, nil
}

session := planMaker.session
log.Event(session.context, stmt.String())

result, err := e.execStmt(stmt, planMaker, implicitTxn /* autoCommit */)
if err != nil {
if traceSQL {
Expand Down

0 comments on commit 2fc8d2f

Please sign in to comment.