removed tablecolumnref expression type
This commit is contained in:
parent
541a666e32
commit
085397866e
|
@ -72,7 +72,7 @@ Expr* Expr::makeColumnRef(char* name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Expr* Expr::makeColumnRef(char* table, char* name) {
|
Expr* Expr::makeColumnRef(char* table, char* name) {
|
||||||
Expr* e = new Expr(kExprTableColumnRef);
|
Expr* e = new Expr(kExprColumnRef);
|
||||||
e->name = name;
|
e->name = name;
|
||||||
e->table = table;
|
e->table = table;
|
||||||
return e;
|
return e;
|
||||||
|
|
|
@ -17,7 +17,6 @@ typedef enum {
|
||||||
kExprLiteralInt,
|
kExprLiteralInt,
|
||||||
kExprStar,
|
kExprStar,
|
||||||
kExprColumnRef,
|
kExprColumnRef,
|
||||||
kExprTableColumnRef,
|
|
||||||
kExprFunctionRef,
|
kExprFunctionRef,
|
||||||
kExprOperator
|
kExprOperator
|
||||||
} ExprType;
|
} ExprType;
|
||||||
|
@ -79,7 +78,9 @@ struct Expr {
|
||||||
/**
|
/**
|
||||||
* Convenience accessor methods
|
* Convenience accessor methods
|
||||||
*/
|
*/
|
||||||
|
inline bool isType(ExprType e_type) { return e_type == type; }
|
||||||
inline bool hasAlias() { return alias != NULL; }
|
inline bool hasAlias() { return alias != NULL; }
|
||||||
|
inline bool hasTable() { return table != NULL; }
|
||||||
inline char* getName() {
|
inline char* getName() {
|
||||||
if (alias != NULL) return alias;
|
if (alias != NULL) return alias;
|
||||||
else return name;
|
else return name;
|
||||||
|
|
|
@ -61,7 +61,7 @@ void printExpression(Expr* expr, uint num_indent) {
|
||||||
switch (expr->type) {
|
switch (expr->type) {
|
||||||
case kExprStar: inprint("*", num_indent); break;
|
case kExprStar: inprint("*", num_indent); break;
|
||||||
case kExprColumnRef: inprint(expr->name, num_indent); break;
|
case kExprColumnRef: inprint(expr->name, num_indent); break;
|
||||||
case kExprTableColumnRef: inprint(expr->table, expr->name, num_indent); break;
|
// case kExprTableColumnRef: inprint(expr->table, expr->name, num_indent); break;
|
||||||
case kExprLiteralFloat: inprint(expr->fval, num_indent); break;
|
case kExprLiteralFloat: inprint(expr->fval, num_indent); break;
|
||||||
case kExprLiteralInt: inprint(expr->ival, num_indent); break;
|
case kExprLiteralInt: inprint(expr->ival, num_indent); break;
|
||||||
case kExprLiteralString: inprint(expr->name, num_indent); break;
|
case kExprLiteralString: inprint(expr->name, num_indent); break;
|
||||||
|
|
Loading…
Reference in New Issue