Add test for schema ref in FROM

This commit is contained in:
Moritz Eyssen 2017-10-12 20:07:30 +02:00
parent 0d0ba53546
commit 09f821e383
1 changed files with 12 additions and 0 deletions

View File

@ -88,6 +88,18 @@ TEST(SelectDistinctTest) {
ASSERT_NULL(stmt->whereClause); ASSERT_NULL(stmt->whereClause);
} }
TEST(SelectSchemaTest) {
TEST_PARSE_SINGLE_SQL(
"SELECT grade FROM some_schema.students;",
kStmtSelect,
SelectStatement,
result,
stmt);
ASSERT(stmt->fromTable);
ASSERT_EQ(std::string(stmt->fromTable->schema), "some_schema");
}
TEST(SelectGroupDistinctTest) { TEST(SelectGroupDistinctTest) {
TEST_PARSE_SINGLE_SQL( TEST_PARSE_SINGLE_SQL(
"SELECT city, COUNT(name), COUNT(DISTINCT grade) FROM students GROUP BY city;", "SELECT city, COUNT(name), COUNT(DISTINCT grade) FROM students GROUP BY city;",