Skip to content

Commit 928d251

Browse files
committed
vendor: Update vendored sources to duckdb/duckdb@0e84478
V1.2 histrionicus (duckdb/duckdb#16070)
1 parent cba94b6 commit 928d251

File tree

8 files changed

+21
-40
lines changed

8 files changed

+21
-40
lines changed

src/duckdb/src/catalog/catalog.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ CatalogException Catalog::CreateMissingEntryException(CatalogEntryRetriever &ret
692692
// however, if there is an exact match in another schema, we will always show it
693693
static constexpr const double UNSEEN_PENALTY = 0.2;
694694
auto unseen_entries = SimilarEntriesInSchemas(context, entry_name, type, unseen_schemas);
695-
set<string> suggestions;
695+
vector<string> suggestions;
696696
if (!unseen_entries.empty() && (unseen_entries[0].score == 1.0 || unseen_entries[0].score - UNSEEN_PENALTY >
697697
(entries.empty() ? 0.0 : entries[0].score))) {
698698
// the closest matching entry requires qualification as it is not in the default search path
@@ -703,19 +703,19 @@ CatalogException Catalog::CreateMissingEntryException(CatalogEntryRetriever &ret
703703
bool qualify_database;
704704
bool qualify_schema;
705705
FindMinimalQualification(retriever, catalog_name, schema_name, qualify_database, qualify_schema);
706-
auto qualified_name = unseen_entry.GetQualifiedName(qualify_database, qualify_schema);
707-
suggestions.insert(qualified_name);
706+
suggestions.push_back(unseen_entry.GetQualifiedName(qualify_database, qualify_schema));
708707
}
709708
} else if (!entries.empty()) {
710709
for (auto &entry : entries) {
711-
suggestions.insert(entry.name);
710+
suggestions.push_back(entry.name);
712711
}
713712
}
714713

715714
string did_you_mean;
715+
std::sort(suggestions.begin(), suggestions.end());
716716
if (suggestions.size() > 2) {
717-
string last = *suggestions.rbegin();
718-
suggestions.erase(last);
717+
auto last = suggestions.back();
718+
suggestions.pop_back();
719719
did_you_mean = StringUtil::Join(suggestions, ", ") + ", or " + last;
720720
} else {
721721
did_you_mean = StringUtil::Join(suggestions, " or ");

src/duckdb/src/function/table/version/pragma_version.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#ifndef DUCKDB_PATCH_VERSION
2-
#define DUCKDB_PATCH_VERSION "0"
2+
#define DUCKDB_PATCH_VERSION "4-dev5208"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
5-
#define DUCKDB_MINOR_VERSION 2
5+
#define DUCKDB_MINOR_VERSION 1
66
#endif
77
#ifndef DUCKDB_MAJOR_VERSION
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.2.0"
11+
#define DUCKDB_VERSION "v1.1.4-dev5208"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "5f5512b827"
14+
#define DUCKDB_SOURCE_ID "0e84478641"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/include/duckdb/main/extension_entries.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,6 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
522522
{"skewness", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
523523
{"sql_auto_complete", "autocomplete", CatalogType::TABLE_FUNCTION_ENTRY},
524524
{"sqlite_attach", "sqlite_scanner", CatalogType::TABLE_FUNCTION_ENTRY},
525-
{"sqlite_query", "sqlite_scanner", CatalogType::TABLE_FUNCTION_ENTRY},
526525
{"sqlite_scan", "sqlite_scanner", CatalogType::TABLE_FUNCTION_ENTRY},
527526
{"sqlsmith", "sqlsmith", CatalogType::TABLE_FUNCTION_ENTRY},
528527
{"sqrt", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
@@ -981,7 +980,6 @@ static constexpr ExtensionEntry EXTENSION_SETTINGS[] = {
981980
{"s3_url_style", "httpfs"},
982981
{"s3_use_ssl", "httpfs"},
983982
{"sqlite_all_varchar", "sqlite_scanner"},
984-
{"sqlite_debug_show_queries", "sqlite_scanner"},
985983
{"timezone", "icu"},
986984
{"unsafe_enable_version_guessing", "iceberg"},
987985
}; // END_OF_EXTENSION_SETTINGS

src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ struct CreateViewInfo : public CreateInfo {
4040
//! Gets a bound CreateViewInfo object from a SELECT statement and a view name, schema name, etc
4141
DUCKDB_API static unique_ptr<CreateViewInfo> FromSelect(ClientContext &context, unique_ptr<CreateViewInfo> info);
4242
//! Gets a bound CreateViewInfo object from a CREATE VIEW statement
43-
DUCKDB_API static unique_ptr<CreateViewInfo> FromCreateView(ClientContext &context, SchemaCatalogEntry &schema,
44-
const string &sql);
43+
DUCKDB_API static unique_ptr<CreateViewInfo> FromCreateView(ClientContext &context, const string &sql);
4544
//! Parse a SELECT statement from a SQL string
4645
DUCKDB_API static unique_ptr<SelectStatement> ParseSelect(const string &sql);
4746

src/duckdb/src/include/duckdb/planner/binder.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,6 @@ class Binder : public enable_shared_from_this<Binder> {
419419
const string BindCatalog(string &catalog_name);
420420
SchemaCatalogEntry &BindCreateSchema(CreateInfo &info);
421421

422-
vector<CatalogSearchEntry> GetSearchPath(Catalog &catalog, const string &schema_name);
423-
424422
LogicalType BindLogicalTypeInternal(const LogicalType &type, optional_ptr<Catalog> catalog, const string &schema);
425423

426424
unique_ptr<BoundQueryNode> BindSelectNode(SelectNode &statement, unique_ptr<BoundTableRef> from_table);

src/duckdb/src/parser/parsed_data/create_view_info.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ unique_ptr<CreateViewInfo> CreateViewInfo::FromSelect(ClientContext &context, un
8282
return info;
8383
}
8484

85-
unique_ptr<CreateViewInfo> CreateViewInfo::FromCreateView(ClientContext &context, SchemaCatalogEntry &schema,
86-
const string &sql) {
85+
unique_ptr<CreateViewInfo> CreateViewInfo::FromCreateView(ClientContext &context, const string &sql) {
8786
D_ASSERT(!sql.empty());
8887

8988
// parse the SQL statement
@@ -102,11 +101,9 @@ unique_ptr<CreateViewInfo> CreateViewInfo::FromCreateView(ClientContext &context
102101
}
103102

104103
auto result = unique_ptr_cast<CreateInfo, CreateViewInfo>(std::move(create_statement.info));
105-
result->catalog = schema.ParentCatalog().GetName();
106-
result->schema = schema.name;
107104

108-
auto view_binder = Binder::CreateBinder(context);
109-
view_binder->BindCreateViewInfo(*result);
105+
auto binder = Binder::CreateBinder(context);
106+
binder->BindCreateViewInfo(*result);
110107

111108
return result;
112109
}

src/duckdb/src/planner/binder/statement/bind_create.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ void Binder::BindCreateViewInfo(CreateViewInfo &base) {
158158
}
159159
view_binder->can_contain_nulls = true;
160160

161-
auto view_search_path = GetSearchPath(catalog, base.schema);
162-
view_binder->entry_retriever.SetSearchPath(std::move(view_search_path));
163-
164161
auto copy = base.query->Copy();
165162
auto query_node = view_binder->Bind(*base.query);
166163
base.query = unique_ptr_cast<SQLStatement, SelectStatement>(std::move(copy));

src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,6 @@ unique_ptr<BoundTableRef> Binder::BindWithReplacementScan(ClientContext &context
7979
return nullptr;
8080
}
8181

82-
vector<CatalogSearchEntry> Binder::GetSearchPath(Catalog &catalog, const string &schema_name) {
83-
vector<CatalogSearchEntry> view_search_path;
84-
auto &catalog_name = catalog.GetName();
85-
if (!schema_name.empty()) {
86-
view_search_path.emplace_back(catalog_name, schema_name);
87-
}
88-
auto default_schema = catalog.GetDefaultSchema();
89-
if (schema_name.empty() && schema_name != default_schema) {
90-
view_search_path.emplace_back(catalog.GetName(), default_schema);
91-
}
92-
return view_search_path;
93-
}
94-
9582
unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
9683
QueryErrorContext error_context(ref.query_location);
9784
// CTEs and views are also referred to using BaseTableRefs, hence need to distinguish here
@@ -291,8 +278,13 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
291278
subquery.column_name_alias = BindContext::AliasColumnNames(ref.table_name, view_names, ref.column_name_alias);
292279

293280
// when binding a view, we always look into the catalog/schema where the view is stored first
294-
auto view_search_path =
295-
GetSearchPath(view_catalog_entry.ParentCatalog(), view_catalog_entry.ParentSchema().name);
281+
vector<CatalogSearchEntry> view_search_path;
282+
auto &catalog_name = view_catalog_entry.ParentCatalog().GetName();
283+
auto &schema_name = view_catalog_entry.ParentSchema().name;
284+
view_search_path.emplace_back(catalog_name, schema_name);
285+
if (schema_name != DEFAULT_SCHEMA) {
286+
view_search_path.emplace_back(view_catalog_entry.ParentCatalog().GetName(), DEFAULT_SCHEMA);
287+
}
296288
view_binder->entry_retriever.SetSearchPath(std::move(view_search_path));
297289
// bind the child subquery
298290
view_binder->AddBoundView(view_catalog_entry);

0 commit comments

Comments
 (0)