Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #104: make CREATE OR REPLACE TABLE work in SQLite catalog instead of throwing an exception #112

Merged
merged 1 commit into from
Sep 4, 2024
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
3 changes: 3 additions & 0 deletions src/storage/sqlite_schema_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ void SQLiteSchemaEntry::DropEntry(ClientContext &context, DropInfo &info) {
}
auto table = GetEntry(GetCatalogTransaction(context), info.type, info.name);
if (!table) {
if (info.if_not_found == OnEntryNotFound::RETURN_NULL) {
return;
}
throw InternalException("Failed to drop entry \"%s\" - could not find entry", info.name);
}
auto &transaction = SQLiteTransaction::Get(context, catalog);
Expand Down
21 changes: 21 additions & 0 deletions test/sql/storage/attach_create_or_replace.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# name: test/sql/storage/attach_create_or_replace.test
# description:
# group: [sqlite_storage]

require sqlite_scanner

statement ok
ATTACH '__TEST_DIR__/attach_unnest.sqlite' AS tmp (TYPE SQLITE);

statement ok
USE tmp;

statement ok
CREATE OR REPLACE TABLE xs AS SELECT unnest(['foo', 'bar', 'baz']) AS x;

query I
SELECT * FROM xs;
----
foo
bar
baz
Loading