Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: use chunk.Row instead of types.DatumRow in test files #7139

Merged
merged 3 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
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