Skip to content

Commit 5694c35

Browse files
author
James Cor
committed
rename to rowvalue
1 parent 9cfc833 commit 5694c35

File tree

16 files changed

+37
-116
lines changed

16 files changed

+37
-116
lines changed

server/handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ func (h *Handler) resultForDefaultIter2(ctx *sql.Context, c *mysql.Conn, iter sq
807807

808808
// TODO: send results instead of rows?
809809
// Read rows from iter and send them off
810-
var rowChan = make(chan sql.Row2, 512)
810+
var rowChan = make(chan sql.ValueRow, 512)
811811
eg.Go(func() (err error) {
812812
defer pan2err(&err)
813813
defer wg.Done()
@@ -870,11 +870,11 @@ func (h *Handler) resultForDefaultIter2(ctx *sql.Context, c *mysql.Conn, iter sq
870870
}
871871
resRow := make([]sqltypes.Value, len(row))
872872
for i, v := range row {
873-
if v.Val != nil || v.Val2 == nil {
873+
if v.Val != nil || v.WrappedVal == nil {
874874
resRow[i] = sqltypes.MakeTrusted(v.Typ, v.Val)
875875
continue
876876
}
877-
dVal, err := v.Val2.UnwrapAny(ctx)
877+
dVal, err := v.WrappedVal.UnwrapAny(ctx)
878878
if err != nil {
879879
return err
880880
}

sql/cache.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type rowsCache struct {
7474
memory Freeable
7575
reporter Reporter
7676
rows []Row
77-
rows2 []Row2
77+
rows2 []ValueRow
7878
}
7979

8080
func newRowsCache(memory Freeable, r Reporter) *rowsCache {
@@ -92,7 +92,7 @@ func (c *rowsCache) Add(row Row) error {
9292

9393
func (c *rowsCache) Get() []Row { return c.rows }
9494

95-
func (c *rowsCache) Add2(row2 Row2) error {
95+
func (c *rowsCache) Add2(row2 ValueRow) error {
9696
if !releaseMemoryIfNeeded(c.reporter, c.memory.Free) {
9797
return ErrNoMemoryAvailable.New()
9898
}
@@ -101,7 +101,7 @@ func (c *rowsCache) Add2(row2 Row2) error {
101101
return nil
102102
}
103103

104-
func (c *rowsCache) Get2() []Row2 {
104+
func (c *rowsCache) Get2() []ValueRow {
105105
return c.rows2
106106
}
107107

sql/core.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ func DebugString(nodeOrExpression interface{}) string {
464464
type Expression2 interface {
465465
Expression
466466
// Eval2 evaluates the given row frame and returns a result.
467-
Eval2(ctx *Context, row Row2) (Value, error)
467+
Eval2(ctx *Context, row ValueRow) (Value, error)
468468
// Type2 returns the expression type.
469469
Type2() Type2
470470
IsExpr2() bool

sql/expression/comparison.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ func (gt *GreaterThan) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
520520
return result == 1, nil
521521
}
522522

523-
func (gt *GreaterThan) Eval2(ctx *sql.Context, row sql.Row2) (sql.Value, error) {
523+
func (gt *GreaterThan) Eval2(ctx *sql.Context, row sql.ValueRow) (sql.Value, error) {
524524
l, ok := gt.Left().(sql.Expression2)
525525
if !ok {
526526
panic(fmt.Sprintf("%T does not implement sql.Expression2", gt.Left()))

sql/expression/get_field.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ func (p *GetField) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
149149
return row[p.fieldIndex], nil
150150
}
151151

152-
func (p *GetField) Eval2(ctx *sql.Context, row sql.Row2) (sql.Value, error) {
153-
if p.fieldIndex < 0 || p.fieldIndex >= row.Len() {
154-
return sql.Value{}, ErrIndexOutOfBounds.New(p.fieldIndex, row.Len())
152+
func (p *GetField) Eval2(ctx *sql.Context, row sql.ValueRow) (sql.Value, error) {
153+
if p.fieldIndex < 0 || p.fieldIndex >= len(row) {
154+
return sql.Value{}, ErrIndexOutOfBounds.New(p.fieldIndex, len(row))
155155
}
156156
return row[p.fieldIndex], nil
157157
}

sql/expression/literal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (*Literal) Children() []sql.Expression {
136136
return nil
137137
}
138138

139-
func (lit *Literal) Eval2(ctx *sql.Context, row sql.Row2) (sql.Value, error) {
139+
func (lit *Literal) Eval2(ctx *sql.Context, row sql.ValueRow) (sql.Value, error) {
140140
return lit.val2, nil
141141
}
142142

sql/expression/sort.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ func (s *Sorter) Less(i, j int) bool {
8686
return false
8787
}
8888

89-
// Sorter2 is a version of Sorter that operates on Row2
89+
// Sorter2 is a version of Sorter that operates on ValueRow
9090
type Sorter2 struct {
9191
LastError error
9292
Ctx *sql.Context
9393
SortFields []sql.SortField
94-
Rows []sql.Row2
94+
Rows []sql.ValueRow
9595
}
9696

9797
func (s *Sorter2) Len() int {

sql/expression/unresolved.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (*UnresolvedColumn) CollationCoercibility(ctx *sql.Context) (collation sql.
7171
return sql.Collation_binary, 7
7272
}
7373

74-
func (uc *UnresolvedColumn) Eval2(ctx *sql.Context, row sql.Row2) (sql.Value, error) {
74+
func (uc *UnresolvedColumn) Eval2(ctx *sql.Context, row sql.ValueRow) (sql.Value, error) {
7575
panic("unresolved column is a placeholder node, but Eval2 was called")
7676
}
7777

sql/memory.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ type Rows2Cache interface {
7070
// Add2 a new row to the cache. If there is no memory available, it will try to
7171
// free some memory. If after that there is still no memory available, it
7272
// will return an error and erase all the content of the cache.
73-
Add2(Row2) error
73+
Add2(ValueRow) error
7474
// Get2 gets all rows.
75-
Get2() []Row2
75+
Get2() []ValueRow
7676
}
7777

7878
// ErrNoMemoryAvailable is returned when there is no more available memory.

sql/plan/filter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (i *FilterIter) Next(ctx *sql.Context) (sql.Row, error) {
139139
}
140140
}
141141

142-
func (i *FilterIter) Next2(ctx *sql.Context) (sql.Row2, error) {
142+
func (i *FilterIter) Next2(ctx *sql.Context) (sql.ValueRow, error) {
143143
for {
144144
row, err := i.childIter2.Next2(ctx)
145145
if err != nil {

0 commit comments

Comments
 (0)