1 | #include "duckdb/planner/expression_binder/where_binder.hpp" |
---|---|
2 | |
3 | using namespace duckdb; |
4 | using namespace std; |
5 | |
6 | WhereBinder::WhereBinder(Binder &binder, ClientContext &context) : ExpressionBinder(binder, context) { |
7 | target_type = SQLType(SQLTypeId::BOOLEAN); |
8 | } |
9 | |
10 | BindResult WhereBinder::BindExpression(ParsedExpression &expr, idx_t depth, bool root_expression) { |
11 | switch (expr.GetExpressionClass()) { |
12 | case ExpressionClass::DEFAULT: |
13 | return BindResult("WHERE clause cannot contain DEFAULT clause"); |
14 | case ExpressionClass::WINDOW: |
15 | return BindResult("WHERE clause cannot contain window functions!"); |
16 | default: |
17 | return ExpressionBinder::BindExpression(expr, depth); |
18 | } |
19 | } |
20 | |
21 | string WhereBinder::UnsupportedAggregateMessage() { |
22 | return "WHERE clause cannot contain aggregates!"; |
23 | } |
24 |