should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
# name: test/sql/extensions/allowed_directories_install.test
# description: Test extension installation with allowed_directories setting
# group: [extensions]
statement ok
set extension_directory='__TEST_DIR__/extension_dir'
statement ok
SET allowed_directories=['__TEST_DIR__', 'http://', 'https://'];
statement ok
SET enable_external_access=false;
# error messsage `Failed to download extension` means duckdb
statement error
INSTALL bogus FROM 'http://not.existent';
----
Failed to download extension
# now switch the extension directory to one that is not in the allowed_directories list
statement ok
set extension_directory='/tmp'
# duckdb will throw permission error because /tmp is not allowed
statement error
INSTALL bogus FROM 'http://not.existent';
----
Permission Error: Cannot access directory

View File

@@ -0,0 +1,30 @@
# name: test/sql/extensions/checked_load.test
# description: Test metadata checks on load
# group: [extensions]
statement error
LOAD 'README.md';
----
The file is not a DuckDB extension. The metadata at the end of the file is invalid
statement ok
SET allow_extensions_metadata_mismatch=true;
# This is the error thrown by dlopen
statement error
LOAD 'README.md';
----
Error: Extension "README.md" could not be loaded
statement error
LOAD 'data/csv/no_opt.csv';
----
is not a DuckDB extension. Valid DuckDB extensions must be at least 512 bytes
statement ok
SET allow_unsigned_extensions=false;
statement error
LOAD 'README.md';
----
The file is not a DuckDB extension. The metadata at the end of the file is invalid

View File

@@ -0,0 +1,27 @@
# name: test/sql/extensions/sqlite_alter_table_add_pk.test
# description: Test that altering the table to add a primary key throws a not implemented exception.
# group: [extensions]
require-env LOCAL_EXTENSION_REPO
require sqlite_scanner
statement ok
SET autoinstall_known_extensions=true;
statement ok
SET autoload_known_extensions=true;
statement ok
ATTACH '__TEST_DIR__/my_sqlite' AS sqlite_db (TYPE SQLITE);
statement ok
CREATE TABLE sqlite_db.main.tbl (i INT);
statement ok
INSERT INTO sqlite_db.main.tbl VALUES (1);
statement error
ALTER TABLE sqlite_db.main.tbl ADD PRIMARY KEY (i);
----
<REGEX>:Not implemented Error.*BindAlterAddIndex not supported by this catalog.*

View File

@@ -0,0 +1,21 @@
# name: test/sql/extensions/version_is_valid_sqlite.test
# description: Test version metadata on load
# group: [extensions]
require-env LOCAL_EXTENSION_REPO
require sqlite_scanner
statement ok
SET autoinstall_known_extensions=true;
statement ok
SET autoload_known_extensions=true;
statement ok
SET GLOBAL sqlite_all_varchar = true;
query I
SELECT count(*) FROM duckdb_extensions() WHERE extension_version != '' AND extension_name == 'sqlite_scanner';
----
1