1#include "duckdb/planner/expression_binder/constant_binder.hpp"
2
3using namespace duckdb;
4using namespace std;
5
6ConstantBinder::ConstantBinder(Binder &binder, ClientContext &context, string clause)
7 : ExpressionBinder(binder, context), clause(clause) {
8}
9
10BindResult ConstantBinder::BindExpression(ParsedExpression &expr, idx_t depth, bool root_expression) {
11 switch (expr.GetExpressionClass()) {
12 case ExpressionClass::COLUMN_REF:
13 return BindResult(clause + " cannot contain column names");
14 case ExpressionClass::SUBQUERY:
15 return BindResult(clause + " cannot contain subqueries");
16 case ExpressionClass::DEFAULT:
17 return BindResult(clause + " cannot contain DEFAULT clause");
18 case ExpressionClass::WINDOW:
19 return BindResult(clause + " cannot contain window functions!");
20 default:
21 return ExpressionBinder::BindExpression(expr, depth);
22 }
23}
24
25string ConstantBinder::UnsupportedAggregateMessage() {
26 return clause + "cannot contain aggregates!";
27}
28