added special expression type for star selector
This commit is contained in:
parent
8e968ffb41
commit
e886ae1644
|
@ -138,7 +138,7 @@ select_statement:
|
||||||
|
|
||||||
|
|
||||||
select_list:
|
select_list:
|
||||||
'*' { $$ = new List<Expr*>(makeColumnRef("*")); }
|
'*' { $$ = new List<Expr*>(new Expr(eExprStar)); }
|
||||||
| expr_list;
|
| expr_list;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
typedef enum {
|
typedef enum {
|
||||||
eExprLiteralFloat,
|
eExprLiteralFloat,
|
||||||
eExprLiteralString,
|
eExprLiteralString,
|
||||||
|
eExprStar,
|
||||||
eExprColumnRef,
|
eExprColumnRef,
|
||||||
eExprFunctionRef,
|
eExprFunctionRef,
|
||||||
eExprPredicate
|
eExprPredicate
|
||||||
|
@ -15,6 +16,8 @@ typedef enum {
|
||||||
typedef struct Expr Expr;
|
typedef struct Expr Expr;
|
||||||
|
|
||||||
struct Expr {
|
struct Expr {
|
||||||
|
Expr(EExprType type) : type(type) {};
|
||||||
|
|
||||||
EExprType type;
|
EExprType type;
|
||||||
|
|
||||||
Expr* expr;
|
Expr* expr;
|
||||||
|
|
|
@ -56,7 +56,7 @@ void SelectTest2() {
|
||||||
SelectStatement* select = (SelectStatement*) stmt;
|
SelectStatement* select = (SelectStatement*) stmt;
|
||||||
|
|
||||||
ASSERT(select->select_list->size() == 1);
|
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 != NULL);
|
||||||
ASSERT(select->from_table->type == eTableSelect);
|
ASSERT(select->from_table->type == eTableSelect);
|
||||||
|
|
Loading…
Reference in New Issue