Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions src/include/storage/irc_transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class IRCTransaction : public Transaction {
unordered_set<const ICTableEntry *> dirty_tables;
unordered_set<const ICTableEntry *> deleted_tables;
case_insensitive_set_t created_secrets;

case_insensitive_set_t looked_up_entries;
};

} // namespace duckdb
14 changes: 14 additions & 0 deletions src/storage/irc_schema_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,26 @@ namespace duckdb {
IRCSchemaSet::IRCSchemaSet(Catalog &catalog) : catalog(catalog) {
}

// we are sure the schema does not exist, we performed the head request and got a 404 response.
static bool SchemaDoesNotExist(case_insensitive_set_t &known_non_existent_schemas, const string &name) {
return known_non_existent_schemas.find(name) != known_non_existent_schemas.end();
}

optional_ptr<CatalogEntry> IRCSchemaSet::GetEntry(ClientContext &context, const string &name,
OnEntryNotFound if_not_found) {
lock_guard<mutex> l(entry_lock);
auto &ic_catalog = catalog.Cast<IRCatalog>();

auto &irc_transaction = IRCTransaction::Get(context, catalog);

auto verify_existence = irc_transaction.looked_up_entries.insert(name).second;
auto entry = entries.find(name);
if (entry != entries.end()) {
return entry->second.get();
}
if (!verify_existence) {
return nullptr;
}
if (entry == entries.end()) {
CreateSchemaInfo info;
if (!IRCAPI::VerifySchemaExistence(context, ic_catalog, name)) {
Expand Down
Loading