added special expression type for star selector

This commit is contained in:
Pedro 2014-10-22 17:46:52 +02:00
parent 8e968ffb41
commit e886ae1644
3 changed files with 5 additions and 2 deletions

View File

@ -138,7 +138,7 @@ select_statement:
select_list:
'*' { $$ = new List<Expr*>(makeColumnRef("*")); }
'*' { $$ = new List<Expr*>(new Expr(eExprStar)); }
| expr_list;

View File

@ -7,6 +7,7 @@
typedef enum {
eExprLiteralFloat,
eExprLiteralString,
eExprStar,
eExprColumnRef,
eExprFunctionRef,
eExprPredicate
@ -15,6 +16,8 @@ typedef enum {
typedef struct Expr Expr;
struct Expr {
Expr(EExprType type) : type(type) {};
EExprType type;
Expr* expr;

View File

@ -56,7 +56,7 @@ void SelectTest2() {
SelectStatement* select = (SelectStatement*) stmt;
ASSERT(select->select_list->size() == 1);
ASSERT_STR(select->select_list->at(0)->name, "*");
ASSERT(select->select_list->at(0)->type == eExprStar);
ASSERT(select->from_table != NULL);
ASSERT(select->from_table->type == eTableSelect);