Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,10 @@ func (h *Handler) resultForDefaultIter(ctx *sql.Context, c *mysql.Conn, schema s
defer wg.Done()
for {
if r == nil {
r = &sqltypes.Result{Fields: resultFields}
r = &sqltypes.Result{
Fields: resultFields,
Rows: make([][]sqltypes.Value, 0, rowsBatch),
}
}
if r.RowsAffected == rowsBatch {
if err := resetCallback(r, more); err != nil {
Expand Down
8 changes: 5 additions & 3 deletions sql/analyzer/costed_index_scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ func costedIndexLookup(ctx *sql.Context, n sql.Node, a *Analyzer, iat sql.IndexA
ret = plan.NewTableAlias(aliasName, ret)
}

a.Log("new indexed table: %s/%s/%s", ita.Index().Database(), ita.Index().Table(), ita.Index().ID())
a.Log("index stats cnt: %d", stats.RowCount())
a.Log("index stats histogram: %s", stats.Histogram().DebugString())
if a.Debug {
a.Log("new indexed table: %s/%s/%s", ita.Index().Database(), ita.Index().Table(), ita.Index().ID())
a.Log("index stats cnt: %d", stats.RowCount())
a.Log("index stats histogram: %s", stats.Histogram().DebugString())
}

// excluded from tree + not included in index scan => filter above scan
if len(filters) > 0 {
Expand Down