Skip to content

Commit

Permalink
*: use chunk.Row instead of types.DatumRow in test files (#7139)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp authored and winoros committed Jul 24, 2018
1 parent 5f7abc8 commit 3299f86
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 224 deletions.
34 changes: 17 additions & 17 deletions executor/pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type pkgTestSuite struct {
type MockExec struct {
baseExecutor

Rows []types.DatumRow
Rows []chunk.MutRow
curRowIdx int
}

Expand All @@ -31,8 +31,8 @@ func (m *MockExec) Next(ctx context.Context, chk *chunk.Chunk) error {
colTypes := m.retTypes()
for ; m.curRowIdx < len(m.Rows) && chk.NumRows() < m.maxChunkSize; m.curRowIdx++ {
curRow := m.Rows[m.curRowIdx]
for i := 0; i < len(curRow); i++ {
curDatum := curRow.GetDatum(i, colTypes[i])
for i := 0; i < curRow.Len(); i++ {
curDatum := curRow.ToRow().GetDatum(i, colTypes[i])
chk.AppendDatum(i, &curDatum)
}
}
Expand All @@ -58,24 +58,24 @@ func (s *pkgTestSuite) TestNestedLoopApply(c *C) {
outerSchema := expression.NewSchema(col0)
outerExec := &MockExec{
baseExecutor: newBaseExecutor(sctx, outerSchema, ""),
Rows: []types.DatumRow{
types.MakeDatums(1),
types.MakeDatums(2),
types.MakeDatums(3),
types.MakeDatums(4),
types.MakeDatums(5),
types.MakeDatums(6),
Rows: []chunk.MutRow{
chunk.MutRowFromDatums(types.MakeDatums(1)),
chunk.MutRowFromDatums(types.MakeDatums(2)),
chunk.MutRowFromDatums(types.MakeDatums(3)),
chunk.MutRowFromDatums(types.MakeDatums(4)),
chunk.MutRowFromDatums(types.MakeDatums(5)),
chunk.MutRowFromDatums(types.MakeDatums(6)),
}}
innerSchema := expression.NewSchema(col1)
innerExec := &MockExec{
baseExecutor: newBaseExecutor(sctx, innerSchema, ""),
Rows: []types.DatumRow{
types.MakeDatums(1),
types.MakeDatums(2),
types.MakeDatums(3),
types.MakeDatums(4),
types.MakeDatums(5),
types.MakeDatums(6),
Rows: []chunk.MutRow{
chunk.MutRowFromDatums(types.MakeDatums(1)),
chunk.MutRowFromDatums(types.MakeDatums(2)),
chunk.MutRowFromDatums(types.MakeDatums(3)),
chunk.MutRowFromDatums(types.MakeDatums(4)),
chunk.MutRowFromDatums(types.MakeDatums(5)),
chunk.MutRowFromDatums(types.MakeDatums(6)),
}}
outerFilter := expression.NewFunctionInternal(sctx, ast.LT, types.NewFieldType(mysql.TypeTiny), col0, con)
innerFilter := outerFilter.Clone()
Expand Down
Loading

0 comments on commit 3299f86

Please sign in to comment.