Skip to content

Commit

Permalink
planner: fix the output and improve the test coverage radondb#525
Browse files Browse the repository at this point in the history
[summary]
fix the output and improve the test coverage
[test case]
src/planner/builder/builder_test.go
[patch codecov]
src/planner/builder/project.go 98.1%
  • Loading branch information
andyli029 committed Nov 13, 2019
1 parent 3911c8c commit eb85366
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/planner/builder/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ func TestSelectUnsupported(t *testing.T) {
"select a+1 from A group by a+1",
"select count(distinct *) from A",
"select t1.a from G",
"select S.id from A join B on B.id=A.id",
"select eeeee from A join B on B.id=A.id",
}
results := []string{
"unsupported: subqueries.in.select",
Expand Down Expand Up @@ -547,6 +549,8 @@ func TestSelectUnsupported(t *testing.T) {
"unsupported: group.by.[a + 1].type.should.be.colname",
"unsupported: syntax.error.at.'count(distinct *)'",
"unsupported: unknown.column.'t1.a'.in.exprs",
"unsupported: unknown.column.'S.id'.in.field.list",
"unsupported: unknown.column.'eeeee'.in.select.exprs",
}

log := xlog.NewStdLog(xlog.Level(xlog.PANIC))
Expand Down
2 changes: 1 addition & 1 deletion src/planner/builder/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func parseSelectExpr(expr *sqlparser.AliasedExpr, tbInfos map[string]*tableInfo)
}
} else {
if _, ok := tbInfos[tableName]; !ok {
return false, errors.Errorf("unsupported: unknown.column.'%s'.in.field.list", field)
return false, errors.Errorf("unsupported: unknown.column.'%s.%s'.in.field.list", tableName, field)
}
}

Expand Down

0 comments on commit eb85366

Please sign in to comment.