Skip to content

Commit

Permalink
*: tiny clean up (pingcap#3542)
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala authored Jun 26, 2017
1 parent e773fa5 commit eea5cb2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion server/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ func (cc *clientConn) Run() {
data, err := cc.readPacket()
if err != nil {
if terror.ErrorNotEqual(err, io.EOF) {
log.Error(errors.ErrorStack(err))
log.Error("[%d] read packet error, close this connection %s",
cc.connectionID, errors.ErrorStack(err))
}
return
}
Expand Down
4 changes: 2 additions & 2 deletions server/conn_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ func (cc *clientConn) handleStmtExecute(data []byte) (err error) {

flag := data[pos]
pos++
//now we only support CURSOR_TYPE_NO_CURSOR flag
// Now we only support CURSOR_TYPE_NO_CURSOR flag.
if flag != 0 {
return mysql.NewErrf(mysql.ErrUnknown, "unsupported flag %d", flag)
}

//skip iteration-count, always 1
// skip iteration-count, always 1
pos += 4

var (
Expand Down
3 changes: 1 addition & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ func NewServer(cfg *Config, driver IDriver) (*Server, error) {

// Run runs the server.
func (s *Server) Run() error {

// Start http api to report tidb info such as tps.
// Start HTTP API to report tidb info such as TPS.
if s.cfg.ReportStatus {
s.startStatusHTTP()
}
Expand Down
6 changes: 3 additions & 3 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ import (
type Session interface {
context.Context
Status() uint16 // Flag of current status, such as autocommit.
LastInsertID() uint64 // Last inserted auto_increment id.
LastInsertID() uint64 // LastInsertID is the last inserted auto_increment ID.
AffectedRows() uint64 // Affected rows by latest executed stmt.
Execute(sql string) ([]ast.RecordSet, error) // Execute a sql statement.
String() string // For debug
String() string // String is used to debug.
CommitTxn() error
RollbackTxn() error
// PrepareStmt executes prepare statement in binary protocol.
Expand Down Expand Up @@ -602,7 +602,7 @@ func (s *session) Execute(sql string) ([]ast.RecordSet, error) {
for i, rst := range rawStmts {
s.prepareTxnCtx()
startTS := time.Now()
// Some execution is done in compile stage, so we reset it before compile.
// Some executions are done in compile stage, so we reset them before compile.
executor.ResetStmtCtx(s, rst)
st, err1 := Compile(s, rst)
if err1 != nil {
Expand Down

0 comments on commit eea5cb2

Please sign in to comment.