added special expression type for star selector
This commit is contained in:
parent
8e968ffb41
commit
e886ae1644
|
@ -138,7 +138,7 @@ select_statement:
|
|||
|
||||
|
||||
select_list:
|
||||
'*' { $$ = new List<Expr*>(makeColumnRef("*")); }
|
||||
'*' { $$ = new List<Expr*>(new Expr(eExprStar)); }
|
||||
| expr_list;
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue