Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions src/duckdb/src/common/virtual_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ vector<OpenFileInfo> VirtualFileSystem::Glob(const string &path, FileOpener *ope
}

void VirtualFileSystem::RegisterSubSystem(unique_ptr<FileSystem> fs) {
// Sub-filesystem number is not expected to be huge, also filesystem registration should be called infrequently.
const auto &name = fs->GetName();
for (auto sub_system = sub_systems.begin(); sub_system != sub_systems.end(); sub_system++) {
if (sub_system->get()->GetName() == name) {
throw InvalidInputException("Filesystem with name %s has already been registered, cannot re-register!",
name);
}
}
sub_systems.push_back(std::move(fs));
}

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-dev372"
#define DUCKDB_PATCH_VERSION "0-dev383"
#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-dev372"
#define DUCKDB_VERSION "v1.5.0-dev383"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "2259ad7316"
#define DUCKDB_SOURCE_ID "07d170f87e"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
23 changes: 12 additions & 11 deletions src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,6 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
result->bound_columns = std::move(names);
return std::move(result);
}
} else {
// remember that we did not find a CTE
if (ref.schema_name.empty() && CTEExists(ref.table_name)) {
throw BinderException(
error_context,
"Circular reference to CTE \"%s\", There are two possible solutions. \n1. use WITH RECURSIVE to "
"use recursive CTEs. \n2. If "
"you want to use the TABLE name \"%s\" the same as the CTE name, please explicitly add "
"\"SCHEMA\" before table name. You can try \"main.%s\" (main is the duckdb default schema)",
ref.table_name, ref.table_name, ref.table_name);
}
}

// not a CTE
Expand Down Expand Up @@ -241,6 +230,18 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
}
}

// remember that we did not find a CTE, but there is a CTE with the same name
// this means that there is a circular reference
// Otherwise, re-throw the original exception
if (found_ctes.empty() && ref.schema_name.empty() && CTEExists(ref.table_name)) {
throw BinderException(
error_context,
"Circular reference to CTE \"%s\", There are two possible solutions. \n1. use WITH RECURSIVE to "
"use recursive CTEs. \n2. If "
"you want to use the TABLE name \"%s\" the same as the CTE name, please explicitly add "
"\"SCHEMA\" before table name. You can try \"main.%s\" (main is the duckdb default schema)",
ref.table_name, ref.table_name, ref.table_name);
}
// could not find an alternative: bind again to get the error
// note: this will always throw when using DuckDB as a catalog, but a second look-up might succeed
// in catalogs that do not have transactional DDL
Expand Down