| 1 | #include "duckdb/planner/expression_binder/insert_binder.hpp" |
|---|---|
| 2 | |
| 3 | #include "duckdb/planner/expression/bound_default_expression.hpp" |
| 4 | |
| 5 | using namespace duckdb; |
| 6 | using namespace std; |
| 7 | |
| 8 | InsertBinder::InsertBinder(Binder &binder, ClientContext &context) : ExpressionBinder(binder, context) { |
| 9 | } |
| 10 | |
| 11 | BindResult InsertBinder::BindExpression(ParsedExpression &expr, idx_t depth, bool root_expression) { |
| 12 | switch (expr.GetExpressionClass()) { |
| 13 | case ExpressionClass::DEFAULT: |
| 14 | return BindResult("DEFAULT is not allowed here!"); |
| 15 | case ExpressionClass::WINDOW: |
| 16 | return BindResult("INSERT statement cannot contain window functions!"); |
| 17 | default: |
| 18 | return ExpressionBinder::BindExpression(expr, depth); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | string InsertBinder::UnsupportedAggregateMessage() { |
| 23 | return "INSERT statement cannot contain aggregates!"; |
| 24 | } |
| 25 |