func (session *Session) handleStmtQuery(stmt *mysql.Stmt, data []byte) error { var rows mysql.Rows var err error if len(data) > 0 { rows, err = stmt.Query(driver.RawStmtParams(data)) } else { rows, err = stmt.Query() } if err != nil { return session.handleMySQLError(err) } return session.writeRows(rows) }
func (session *Session) handleStmtExec(stmt *mysql.Stmt, data []byte) error { var rs mysql.Result var err error if len(data) > 0 { rs, err = stmt.Exec(driver.RawStmtParams(data)) } else { rs, err = stmt.Exec() } if err != nil { return session.handleMySQLError(err) } return session.fc.WriteOK(rs) }