Skip to content

Commit

Permalink
chore: Update vendored sources to duckdb/duckdb@e117c34
Browse files Browse the repository at this point in the history
Merge pull request duckdb/duckdb#9932 from taniabogatsch/attach-schema-bug
Merge pull request duckdb/duckdb#9933 from brianwyka/duckdbnative-close-resource
  • Loading branch information
krlmlr committed Dec 14, 2023
1 parent ec14a14 commit 2d04926
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 26 deletions.
20 changes: 10 additions & 10 deletions src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp
Expand Up @@ -302,7 +302,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::RenameColumn(ClientContext &context, Re
create_info->constraints.push_back(std::move(copy));
}
auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}

Expand Down Expand Up @@ -331,7 +331,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::AddColumn(ClientContext &context, AddCo
create_info->columns.AddColumn(std::move(col));

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto new_storage =
make_shared<DataTable>(context, *storage, info.new_column, *bound_create_info->bound_defaults.back());
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, new_storage);
Expand Down Expand Up @@ -463,7 +463,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::RemoveColumn(ClientContext &context, Re
UpdateConstraintsOnColumnDrop(removed_index, adjusted_indices, info, *create_info, dropped_column_is_generated);

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
if (columns.GetColumn(LogicalIndex(removed_index)).Generated()) {
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}
Expand Down Expand Up @@ -498,7 +498,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::SetDefault(ClientContext &context, SetD
}

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}

Expand Down Expand Up @@ -526,7 +526,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::SetNotNull(ClientContext &context, SetN
create_info->constraints.push_back(make_uniq<NotNullConstraint>(not_null_idx));
}
auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);

// Early return
if (has_not_null) {
Expand Down Expand Up @@ -557,7 +557,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::DropNotNull(ClientContext &context, Dro
}

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}

Expand Down Expand Up @@ -633,7 +633,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::ChangeColumnType(ClientContext &context
AlterBinder expr_binder(*binder, context, *this, bound_columns, info.target_type);
auto expression = info.expression->Copy();
auto bound_expression = expr_binder.Bind(expression);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
vector<column_t> storage_oids;
for (idx_t i = 0; i < bound_columns.size(); i++) {
storage_oids.push_back(columns.LogicalToPhysical(bound_columns[i]).index);
Expand Down Expand Up @@ -668,7 +668,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::AddForeignKeyConstraint(ClientContext &
make_uniq<ForeignKeyConstraint>(info.pk_columns, info.fk_columns, std::move(fk_info)));

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);

return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}
Expand All @@ -691,7 +691,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::DropForeignKeyConstraint(ClientContext
}

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);

return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}
Expand All @@ -706,7 +706,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::Copy(ClientContext &context) const {
}

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}

Expand Down
4 changes: 2 additions & 2 deletions src/duckdb/src/function/table/version/pragma_version.cpp
@@ -1,8 +1,8 @@
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v0.9.3-dev1253"
#define DUCKDB_VERSION "v0.9.3-dev1257"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "3abc5eb228"
#define DUCKDB_SOURCE_ID "e117c34a62"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/duckdb/src/include/duckdb/planner/binder.hpp
Expand Up @@ -112,8 +112,6 @@ class Binder : public std::enable_shared_from_this<Binder> {
unique_ptr<BoundCreateTableInfo> BindCreateTableInfo(unique_ptr<CreateInfo> info);
unique_ptr<BoundCreateTableInfo> BindCreateTableInfo(unique_ptr<CreateInfo> info, SchemaCatalogEntry &schema);

vector<unique_ptr<Expression>> BindCreateIndexExpressions(TableCatalogEntry &table, CreateIndexInfo &info);

void BindCreateViewInfo(CreateViewInfo &base);
SchemaCatalogEntry &BindSchema(CreateInfo &info);
SchemaCatalogEntry &BindCreateFunctionInfo(CreateInfo &info);
Expand Down
Expand Up @@ -95,7 +95,7 @@ unique_ptr<AlterStatement> Transformer::TransformAlter(duckdb_libpgquery::PGAlte
}
case duckdb_libpgquery::PG_AT_DropConstraint:
default:
throw NotImplementedException("ALTER TABLE option not supported yet!");
throw NotImplementedException("No support for that ALTER TABLE option yet!");
}
}

Expand Down
11 changes: 0 additions & 11 deletions src/duckdb/src/planner/binder/statement/bind_create_table.cpp
Expand Up @@ -305,15 +305,4 @@ unique_ptr<BoundCreateTableInfo> Binder::BindCreateTableInfo(unique_ptr<CreateIn
return BindCreateTableInfo(std::move(info), schema);
}

vector<unique_ptr<Expression>> Binder::BindCreateIndexExpressions(TableCatalogEntry &table, CreateIndexInfo &info) {
auto index_binder = IndexBinder(*this, this->context, &table, &info);
vector<unique_ptr<Expression>> expressions;
expressions.reserve(info.expressions.size());
for (auto &expr : info.expressions) {
expressions.push_back(index_binder.Bind(expr));
}

return expressions;
}

} // namespace duckdb

0 comments on commit 2d04926

Please sign in to comment.