Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2007cec
Update vendored DuckDB sources to 5657cbdc0b
duckdblabs-bot Oct 4, 2025
6a14da4
Update vendored DuckDB sources to b3c8acdc0e
duckdblabs-bot Oct 7, 2025
0b478d3
Update vendored DuckDB sources to f793ea27c6
duckdblabs-bot Oct 8, 2025
45e0299
Update vendored DuckDB sources to 353406bd7f
duckdblabs-bot Oct 9, 2025
0eda34b
Update vendored DuckDB sources to 9d77bcf518
duckdblabs-bot Oct 11, 2025
f10aea5
Update vendored DuckDB sources to 2762f1aa72
duckdblabs-bot Oct 12, 2025
2088ae4
Update vendored DuckDB sources to 7621d1bad9
duckdblabs-bot Oct 14, 2025
855724b
Update vendored DuckDB sources to 746404c6aa
duckdblabs-bot Oct 15, 2025
81d6e16
Update vendored DuckDB sources to 5d422e423e
duckdblabs-bot Oct 16, 2025
b3f1929
Update vendored DuckDB sources to f256271bbc
duckdblabs-bot Oct 17, 2025
498da86
Update vendored DuckDB sources to 50acc16a8d
duckdblabs-bot Oct 18, 2025
457acae
Update vendored DuckDB sources to d921f4d6ba
duckdblabs-bot Oct 19, 2025
f24aa46
Update vendored DuckDB sources to c8906e701e
duckdblabs-bot Oct 22, 2025
7565c88
Update vendored DuckDB sources to bfc1fc8800
duckdblabs-bot Oct 25, 2025
80341dc
Update vendored DuckDB sources to ee49c5b308
duckdblabs-bot Oct 28, 2025
a0eaba7
Update vendored DuckDB sources to 4ff549de0d
duckdblabs-bot Oct 29, 2025
d1c6fb9
Update vendored DuckDB sources to c8906e701e
duckdblabs-bot Oct 29, 2025
a476351
Update vendored DuckDB sources to 620e685c6d
duckdblabs-bot Nov 5, 2025
f320879
Update vendored DuckDB sources to 963000678a
duckdblabs-bot Nov 6, 2025
bdbfad9
Update vendored DuckDB sources to d573b275ce
duckdblabs-bot Nov 7, 2025
9989217
Update vendored DuckDB sources to 44b706b2b7
duckdblabs-bot Nov 8, 2025
b762a52
Update vendored DuckDB sources to 5511fb39ac
duckdblabs-bot Nov 11, 2025
4e7f155
Update vendored DuckDB sources to 39f5583f99
duckdblabs-bot Nov 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update vendored DuckDB sources to f793ea27c6
  • Loading branch information
duckdblabs-bot committed Nov 11, 2025
commit 0b478d3cebef078e635b5ecacf8839e5e88f6ac5
7 changes: 4 additions & 3 deletions src/duckdb/src/common/enum_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3624,19 +3624,20 @@ const StringUtil::EnumStringLiteral *GetQueryNodeTypeValues() {
{ static_cast<uint32_t>(QueryNodeType::SET_OPERATION_NODE), "SET_OPERATION_NODE" },
{ static_cast<uint32_t>(QueryNodeType::BOUND_SUBQUERY_NODE), "BOUND_SUBQUERY_NODE" },
{ static_cast<uint32_t>(QueryNodeType::RECURSIVE_CTE_NODE), "RECURSIVE_CTE_NODE" },
{ static_cast<uint32_t>(QueryNodeType::CTE_NODE), "CTE_NODE" }
{ static_cast<uint32_t>(QueryNodeType::CTE_NODE), "CTE_NODE" },
{ static_cast<uint32_t>(QueryNodeType::STATEMENT_NODE), "STATEMENT_NODE" }
};
return values;
}

template<>
const char* EnumUtil::ToChars<QueryNodeType>(QueryNodeType value) {
return StringUtil::EnumToString(GetQueryNodeTypeValues(), 5, "QueryNodeType", static_cast<uint32_t>(value));
return StringUtil::EnumToString(GetQueryNodeTypeValues(), 6, "QueryNodeType", static_cast<uint32_t>(value));
}

template<>
QueryNodeType EnumUtil::FromString<QueryNodeType>(const char *value) {
return static_cast<QueryNodeType>(StringUtil::StringToEnum(GetQueryNodeTypeValues(), 5, "QueryNodeType", value));
return static_cast<QueryNodeType>(StringUtil::StringToEnum(GetQueryNodeTypeValues(), 6, "QueryNodeType", value));
}

const StringUtil::EnumStringLiteral *GetQueryResultTypeValues() {
Expand Down
6 changes: 3 additions & 3 deletions src/duckdb/src/function/table/version/pragma_version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DUCKDB_PATCH_VERSION
#define DUCKDB_PATCH_VERSION "0-dev722"
#define DUCKDB_PATCH_VERSION "0-dev732"
#endif
#ifndef DUCKDB_MINOR_VERSION
#define DUCKDB_MINOR_VERSION 5
Expand All @@ -8,10 +8,10 @@
#define DUCKDB_MAJOR_VERSION 1
#endif
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v1.5.0-dev722"
#define DUCKDB_VERSION "v1.5.0-dev732"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "b3c8acdc0e"
#define DUCKDB_SOURCE_ID "f793ea27c6"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ class InsertionOrderPreservingMap {
map.resize(nz);
}

void clear() { // NOLINT: match stl API
map.clear();
}

void insert(const string &key, V &&value) { // NOLINT: match stl API
if (contains(key)) {
return;
Expand Down
3 changes: 2 additions & 1 deletion src/duckdb/src/include/duckdb/parser/query_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ enum class QueryNodeType : uint8_t {
SET_OPERATION_NODE = 2,
BOUND_SUBQUERY_NODE = 3,
RECURSIVE_CTE_NODE = 4,
CTE_NODE = 5
CTE_NODE = 5,
STATEMENT_NODE = 6
};

struct CommonTableExpressionInfo;
Expand Down
1 change: 1 addition & 0 deletions src/duckdb/src/include/duckdb/parser/query_node/list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
#include "duckdb/parser/query_node/cte_node.hpp"
#include "duckdb/parser/query_node/select_node.hpp"
#include "duckdb/parser/query_node/set_operation_node.hpp"
#include "duckdb/parser/query_node/statement_node.hpp"
42 changes: 42 additions & 0 deletions src/duckdb/src/include/duckdb/parser/query_node/statement_node.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//===----------------------------------------------------------------------===//
// DuckDB
//
// duckdb/parser/query_node/statement_node.hpp
//
//
//===----------------------------------------------------------------------===//

#pragma once

#include "duckdb/parser/parsed_expression.hpp"
#include "duckdb/parser/query_node.hpp"
#include "duckdb/parser/sql_statement.hpp"

namespace duckdb {

class StatementNode : public QueryNode {
public:
static constexpr const QueryNodeType TYPE = QueryNodeType::STATEMENT_NODE;

public:
explicit StatementNode(SQLStatement &stmt_p);

SQLStatement &stmt;

public:
const vector<unique_ptr<ParsedExpression>> &GetSelectList() const override;
//! Convert the query node to a string
string ToString() const override;

bool Equals(const QueryNode *other) const override;
//! Create a copy of this SelectNode
unique_ptr<QueryNode> Copy() const override;

//! Serializes a QueryNode to a stand-alone binary blob
//! Deserializes a blob back into a QueryNode

void Serialize(Serializer &serializer) const override;
static unique_ptr<QueryNode> Deserialize(Deserializer &source);
};

} // namespace duckdb
1 change: 1 addition & 0 deletions src/duckdb/src/include/duckdb/parser/tokens.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class SelectNode;
class SetOperationNode;
class RecursiveCTENode;
class CTENode;
class StatementNode;

//===--------------------------------------------------------------------===//
// Expressions
Expand Down
8 changes: 4 additions & 4 deletions src/duckdb/src/include/duckdb/planner/bind_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace duckdb {
class Binder;
class LogicalGet;
class BoundQueryNode;
struct BoundStatement;

class StarExpression;

Expand Down Expand Up @@ -105,11 +105,11 @@ class BindContext {
const vector<LogicalType> &types, vector<ColumnIndex> &bound_column_ids,
optional_ptr<StandardEntry> entry, virtual_column_map_t virtual_columns);
//! Adds a table view with a given alias to the BindContext.
void AddView(idx_t index, const string &alias, SubqueryRef &ref, BoundQueryNode &subquery, ViewCatalogEntry &view);
void AddView(idx_t index, const string &alias, SubqueryRef &ref, BoundStatement &subquery, ViewCatalogEntry &view);
//! Adds a subquery with a given alias to the BindContext.
void AddSubquery(idx_t index, const string &alias, SubqueryRef &ref, BoundQueryNode &subquery);
void AddSubquery(idx_t index, const string &alias, SubqueryRef &ref, BoundStatement &subquery);
//! Adds a subquery with a given alias to the BindContext.
void AddSubquery(idx_t index, const string &alias, TableFunctionRef &ref, BoundQueryNode &subquery);
void AddSubquery(idx_t index, const string &alias, TableFunctionRef &ref, BoundStatement &subquery);
//! Adds a binding to a catalog entry with a given alias to the BindContext.
void AddEntryBinding(idx_t index, const string &alias, const vector<string> &names,
const vector<LogicalType> &types, StandardEntry &entry);
Expand Down
27 changes: 16 additions & 11 deletions src/duckdb/src/include/duckdb/planner/binder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct PivotColumnEntry;
struct UnpivotEntry;
struct CopyInfo;
struct CopyOption;
struct BoundSetOpChild;

template <class T, class INDEX_TYPE>
class IndexVector;
Expand Down Expand Up @@ -403,23 +404,25 @@ class Binder : public enable_shared_from_this<Binder> {

unique_ptr<QueryNode> BindTableMacro(FunctionExpression &function, TableMacroCatalogEntry &macro_func, idx_t depth);

unique_ptr<BoundCTENode> BindMaterializedCTE(CommonTableExpressionMap &cte_map);
unique_ptr<BoundCTENode> BindCTE(CTENode &statement);
BoundStatement BindCTE(CTENode &statement);

unique_ptr<BoundQueryNode> BindNode(SelectNode &node);
unique_ptr<BoundQueryNode> BindNode(SetOperationNode &node);
unique_ptr<BoundQueryNode> BindNode(RecursiveCTENode &node);
unique_ptr<BoundQueryNode> BindNode(CTENode &node);
unique_ptr<BoundQueryNode> BindNode(QueryNode &node);
BoundStatement BindNode(SelectNode &node);
BoundStatement BindNode(SetOperationNode &node);
BoundStatement BindNode(RecursiveCTENode &node);
BoundStatement BindNode(CTENode &node);
BoundStatement BindNode(QueryNode &node);
BoundStatement BindNode(StatementNode &node);

unique_ptr<LogicalOperator> VisitQueryNode(BoundQueryNode &node, unique_ptr<LogicalOperator> root);
unique_ptr<LogicalOperator> CreatePlan(BoundRecursiveCTENode &node);
unique_ptr<LogicalOperator> CreatePlan(BoundCTENode &node);
unique_ptr<LogicalOperator> CreatePlan(BoundCTENode &node, unique_ptr<LogicalOperator> base);
unique_ptr<LogicalOperator> CreatePlan(BoundSelectNode &statement);
unique_ptr<LogicalOperator> CreatePlan(BoundSetOperationNode &node);
unique_ptr<LogicalOperator> CreatePlan(BoundQueryNode &node);

BoundSetOpChild BindSetOpChild(QueryNode &child);
unique_ptr<BoundSetOperationNode> BindSetOpNode(SetOperationNode &statement);

unique_ptr<BoundTableRef> BindJoin(Binder &parent, TableRef &ref);
unique_ptr<BoundTableRef> Bind(BaseTableRef &ref);
unique_ptr<BoundTableRef> Bind(BoundRefWrapper &ref);
Expand Down Expand Up @@ -489,8 +492,8 @@ class Binder : public enable_shared_from_this<Binder> {
JoinType join_type = JoinType::INNER,
unique_ptr<Expression> condition = nullptr);

unique_ptr<LogicalOperator> CastLogicalOperatorToTypes(vector<LogicalType> &source_types,
vector<LogicalType> &target_types,
unique_ptr<LogicalOperator> CastLogicalOperatorToTypes(const vector<LogicalType> &source_types,
const vector<LogicalType> &target_types,
unique_ptr<LogicalOperator> op);

BindingAlias FindBinding(const string &using_column, const string &join_side);
Expand Down Expand Up @@ -522,7 +525,9 @@ class Binder : public enable_shared_from_this<Binder> {

LogicalType BindLogicalTypeInternal(const LogicalType &type, optional_ptr<Catalog> catalog, const string &schema);

unique_ptr<BoundQueryNode> BindSelectNode(SelectNode &statement, unique_ptr<BoundTableRef> from_table);
BoundStatement BindSelectNode(SelectNode &statement, unique_ptr<BoundTableRef> from_table);
unique_ptr<BoundSelectNode> BindSelectNodeInternal(SelectNode &statement);
unique_ptr<BoundSelectNode> BindSelectNodeInternal(SelectNode &statement, unique_ptr<BoundTableRef> from_table);

unique_ptr<LogicalOperator> BindCopyDatabaseSchema(Catalog &source_catalog, const string &target_database_name);
unique_ptr<LogicalOperator> BindCopyDatabaseData(Catalog &source_catalog, const string &target_database_name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class BoundSubqueryExpression : public Expression {
//! The binder used to bind the subquery node
shared_ptr<Binder> binder;
//! The bound subquery node
unique_ptr<BoundQueryNode> subquery;
BoundStatement subquery;
//! The subquery type
SubqueryType subquery_type;
//! the child expressions to compare with (in case of IN, ANY, ALL operators)
Expand Down
15 changes: 0 additions & 15 deletions src/duckdb/src/include/duckdb/planner/expression_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <functional>

namespace duckdb {
class BoundQueryNode;
class BoundTableRef;

class ExpressionIterator {
Expand Down Expand Up @@ -47,18 +46,4 @@ class ExpressionIterator {
}
};

class BoundNodeVisitor {
public:
virtual ~BoundNodeVisitor() = default;

virtual void VisitBoundQueryNode(BoundQueryNode &op);
virtual void VisitBoundTableRef(BoundTableRef &ref);
virtual void VisitExpression(unique_ptr<Expression> &expression);

protected:
// The VisitExpressionChildren method is called at the end of every call to VisitExpression to recursively visit all
// expressions in an expression tree. It can be overloaded to prevent automatically visiting the entire tree.
virtual void VisitExpressionChildren(Expression &expression);
};

} // namespace duckdb
1 change: 1 addition & 0 deletions src/duckdb/src/include/duckdb/planner/logical_operator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class LogicalOperator {

public:
virtual vector<ColumnBinding> GetColumnBindings();
virtual idx_t GetRootIndex();
static string ColumnBindingsToString(const vector<ColumnBinding> &bindings);
void PrintColumnBindings();
static vector<ColumnBinding> GenerateColumnBindings(idx_t table_idx, idx_t column_count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class BoundCTENode : public BoundQueryNode {
string ctename;

//! The cte node
unique_ptr<BoundQueryNode> query;
BoundStatement query;
//! The child node
unique_ptr<BoundQueryNode> child;
BoundStatement child;
//! Index used by the set operation
idx_t setop_index;
//! The binder used by the query side of the CTE
Expand All @@ -39,7 +39,7 @@ class BoundCTENode : public BoundQueryNode {

public:
idx_t GetRootIndex() override {
return child->GetRootIndex();
return child.plan->GetRootIndex();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class BoundRecursiveCTENode : public BoundQueryNode {

bool union_all;
//! The left side of the set operation
unique_ptr<BoundQueryNode> left;
BoundStatement left;
//! The right side of the set operation
unique_ptr<BoundQueryNode> right;
BoundStatement right;
//! Target columns for the recursive key variant
vector<unique_ptr<Expression>> key_targets;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@
#include "duckdb/planner/bound_query_node.hpp"

namespace duckdb {

struct BoundSetOpChild {
unique_ptr<BoundQueryNode> node;
shared_ptr<Binder> binder;
//! Exprs used by the UNION BY NAME operations to add a new projection
vector<unique_ptr<Expression>> reorder_expressions;
};
struct BoundSetOpChild;

//! Bound equivalent of SetOperationNode
class BoundSetOperationNode : public BoundQueryNode {
Expand All @@ -29,6 +23,7 @@ class BoundSetOperationNode : public BoundQueryNode {
public:
BoundSetOperationNode() : BoundQueryNode(QueryNodeType::SET_OPERATION_NODE) {
}
~BoundSetOperationNode() override;

//! The type of set operation
SetOperationType setop_type = SetOperationType::NONE;
Expand All @@ -46,4 +41,18 @@ class BoundSetOperationNode : public BoundQueryNode {
}
};

struct BoundSetOpChild {
unique_ptr<BoundSetOperationNode> bound_node;
BoundStatement node;
shared_ptr<Binder> binder;
//! Original select list (if this was a SELECT statement)
vector<unique_ptr<ParsedExpression>> select_list;
//! Exprs used by the UNION BY NAME operations to add a new projection
vector<unique_ptr<Expression>> reorder_expressions;

const vector<string> &GetNames();
const vector<LogicalType> &GetTypes();
idx_t GetRootIndex();
};

} // namespace duckdb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class BoundSubqueryRef : public BoundTableRef {
static constexpr const TableReferenceType TYPE = TableReferenceType::SUBQUERY;

public:
BoundSubqueryRef(shared_ptr<Binder> binder_p, unique_ptr<BoundQueryNode> subquery)
BoundSubqueryRef(shared_ptr<Binder> binder_p, BoundStatement subquery)
: BoundTableRef(TableReferenceType::SUBQUERY), binder(std::move(binder_p)), subquery(std::move(subquery)) {
}

//! The binder used to bind the subquery
shared_ptr<Binder> binder;
//! The bound subquery node (if any)
unique_ptr<BoundQueryNode> subquery;
BoundStatement subquery;
};
} // namespace duckdb
43 changes: 43 additions & 0 deletions src/duckdb/src/parser/query_node/statement_node.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include "duckdb/parser/query_node/statement_node.hpp"

namespace duckdb {

StatementNode::StatementNode(SQLStatement &stmt_p) : QueryNode(QueryNodeType::STATEMENT_NODE), stmt(stmt_p) {
}

const vector<unique_ptr<ParsedExpression>> &StatementNode::GetSelectList() const {
throw InternalException("StatementNode has no select list");
}
//! Convert the query node to a string
string StatementNode::ToString() const {
return stmt.ToString();
}

bool StatementNode::Equals(const QueryNode *other_p) const {
if (!QueryNode::Equals(other_p)) {
return false;
}
if (this == other_p) {
return true;
}
auto &other = other_p->Cast<StatementNode>();
return RefersToSameObject(stmt, other.stmt);
}

//! Create a copy of this SelectNode
unique_ptr<QueryNode> StatementNode::Copy() const {
return make_uniq<StatementNode>(stmt);
}

//! Serializes a QueryNode to a stand-alone binary blob
//! Deserializes a blob back into a QueryNode

void StatementNode::Serialize(Serializer &serializer) const {
throw InternalException("StatementNode cannot be serialized");
}

unique_ptr<QueryNode> StatementNode::Deserialize(Deserializer &source) {
throw InternalException("StatementNode cannot be deserialized");
}

} // namespace duckdb
Loading