removed tablecolumnref expression type

This commit is contained in:
Pedro 2014-11-17 14:54:38 +01:00
parent 541a666e32
commit 085397866e
3 changed files with 4 additions and 3 deletions

View File

@ -72,7 +72,7 @@ Expr* Expr::makeColumnRef(char* name) {
}
Expr* Expr::makeColumnRef(char* table, char* name) {
Expr* e = new Expr(kExprTableColumnRef);
Expr* e = new Expr(kExprColumnRef);
e->name = name;
e->table = table;
return e;

View File

@ -17,7 +17,6 @@ typedef enum {
kExprLiteralInt,
kExprStar,
kExprColumnRef,
kExprTableColumnRef,
kExprFunctionRef,
kExprOperator
} ExprType;
@ -79,7 +78,9 @@ struct Expr {
/**
* Convenience accessor methods
*/
inline bool isType(ExprType e_type) { return e_type == type; }
inline bool hasAlias() { return alias != NULL; }
inline bool hasTable() { return table != NULL; }
inline char* getName() {
if (alias != NULL) return alias;
else return name;

View File

@ -61,7 +61,7 @@ void printExpression(Expr* expr, uint num_indent) {
switch (expr->type) {
case kExprStar: inprint("*", 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 kExprLiteralInt: inprint(expr->ival, num_indent); break;
case kExprLiteralString: inprint(expr->name, num_indent); break;