Skip to content

Commit

Permalink
Merge branch 'main' into busytimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mytherin committed Feb 12, 2024
2 parents dd814d2 + 078cd16 commit e299990
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ concurrency:
jobs:
duckdb-stable-build:
name: Build extension binaries
uses: duckdb/duckdb/.github/workflows/_extension_distribution.yml@a056c8e0a29f2f38d245afeb9e48cc308711aa21
uses: duckdb/duckdb/.github/workflows/_extension_distribution.yml@0e784765f6f87bd1ce9034afcce1e7f89fcd8777
with:
vcpkg_commit: a42af01b72c28a8e1d7b48107b33e4f286a55ef6
duckdb_version: a056c8e0a2
duckdb_version: 0e784765f6
extension_name: sqlite_scanner
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads'

duckdb-stable-deploy:
name: Deploy extension binaries
needs: duckdb-stable-build
uses: duckdb/duckdb/.github/workflows/_extension_deploy.yml@a056c8e0a29f2f38d245afeb9e48cc308711aa21
uses: duckdb/duckdb/.github/workflows/_extension_deploy.yml@0e784765f6f87bd1ce9034afcce1e7f89fcd8777
secrets: inherit
with:
duckdb_version: 4f040413468b2fee84ce4d124dfb058378db1456
duckdb_version: 0e784765f6
extension_name: sqlite_scanner
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads'
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ifeq ($(GEN),ninja)
FORCE_COLOR=-DFORCE_COLORED_OUTPUT=1
endif

BUILD_FLAGS=-DEXTENSION_STATIC_BUILD=1 -DBUILD_EXTENSIONS="tpch" ${OSX_ARCH_FLAG}
BUILD_FLAGS=-DEXTENSION_STATIC_BUILD=1 -DBUILD_EXTENSIONS="tpch" ${OSX_ARCH_FLAG} -DDUCKDB_EXPLICIT_PLATFORM='${DUCKDB_PLATFORM}'

CLIENT_FLAGS :=

Expand Down
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 281 files
2 changes: 1 addition & 1 deletion src/include/storage/sqlite_schema_entry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SQLiteTransaction;

class SQLiteSchemaEntry : public SchemaCatalogEntry {
public:
SQLiteSchemaEntry(Catalog &catalog);
SQLiteSchemaEntry(Catalog &catalog, CreateSchemaInfo &info);

public:
optional_ptr<CatalogEntry> CreateTable(CatalogTransaction transaction, BoundCreateTableInfo &info) override;
Expand Down
2 changes: 1 addition & 1 deletion src/include/storage/sqlite_transaction_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SQLiteTransactionManager : public TransactionManager {
SQLiteTransactionManager(AttachedDatabase &db_p, SQLiteCatalog &sqlite_catalog);

Transaction &StartTransaction(ClientContext &context) override;
string CommitTransaction(ClientContext &context, Transaction &transaction) override;
ErrorData CommitTransaction(ClientContext &context, Transaction &transaction) override;
void RollbackTransaction(Transaction &transaction) override;

void Checkpoint(ClientContext &context, bool force = false) override;
Expand Down
5 changes: 3 additions & 2 deletions src/sqlite_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

namespace duckdb {

static unique_ptr<Catalog> SQLiteAttach(StorageExtensionInfo *storage_info, AttachedDatabase &db, const string &name,
AttachInfo &info, AccessMode access_mode) {
static unique_ptr<Catalog> SQLiteAttach(StorageExtensionInfo *storage_info, ClientContext &context,
AttachedDatabase &db, const string &name, AttachInfo &info,
AccessMode access_mode) {
SQLiteOpenOptions options;
options.access_mode = access_mode;
for(auto &entry : info.options) {
Expand Down
9 changes: 6 additions & 3 deletions src/storage/sqlite_catalog.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "storage/sqlite_catalog.hpp"
#include "duckdb/parser/parsed_data/create_schema_info.hpp"
#include "duckdb/storage/database_size.hpp"
#include "sqlite_db.hpp"
#include "storage/sqlite_schema_entry.hpp"
#include "storage/sqlite_transaction.hpp"
#include "sqlite_db.hpp"
#include "duckdb/storage/database_size.hpp"
#include "duckdb/common/exception/transaction_exception.hpp"

namespace duckdb {

Expand All @@ -17,7 +19,8 @@ SQLiteCatalog::~SQLiteCatalog() {
}

void SQLiteCatalog::Initialize(bool load_builtin) {
main_schema = make_uniq<SQLiteSchemaEntry>(*this);
CreateSchemaInfo info;
main_schema = make_uniq<SQLiteSchemaEntry>(*this, info);
}

optional_ptr<CatalogEntry> SQLiteCatalog::CreateSchema(CatalogTransaction transaction, CreateSchemaInfo &info) {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/sqlite_schema_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace duckdb {

SQLiteSchemaEntry::SQLiteSchemaEntry(Catalog &catalog) : SchemaCatalogEntry(catalog, DEFAULT_SCHEMA, true) {
SQLiteSchemaEntry::SQLiteSchemaEntry(Catalog &catalog, CreateSchemaInfo &info) : SchemaCatalogEntry(catalog, info) {
}

SQLiteTransaction &GetSQLiteTransaction(CatalogTransaction transaction) {
Expand Down
4 changes: 2 additions & 2 deletions src/storage/sqlite_transaction_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Transaction &SQLiteTransactionManager::StartTransaction(ClientContext &context)
return result;
}

string SQLiteTransactionManager::CommitTransaction(ClientContext &context, Transaction &transaction) {
ErrorData SQLiteTransactionManager::CommitTransaction(ClientContext &context, Transaction &transaction) {
auto &sqlite_transaction = transaction.Cast<SQLiteTransaction>();
sqlite_transaction.Commit();
lock_guard<mutex> l(transaction_lock);
transactions.erase(transaction);
return string();
return ErrorData();
}

void SQLiteTransactionManager::RollbackTransaction(Transaction &transaction) {
Expand Down
12 changes: 6 additions & 6 deletions test/sql/storage/attach_schema_functions.test
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ CREATE INDEX i_index ON s.main.integers(j)
statement ok
CREATE VIEW s.v1 AS SELECT 42 AS a;

query IIIII
SELECT * REPLACE (trim(split(sql, '(')[1]) AS sql) FROM sqlite_master ORDER BY 1, 2
query IIII
SELECT * EXCLUDE (sql) FROM sqlite_master ORDER BY 1, 2
----
index i_index integers 0 CREATE INDEX i_index ON integers
index sqlite_autoindex_integers_1 integers 0 NULL
table integers integers 0 CREATE TABLE integers
view v1 v1 0 CREATE VIEW v1
index i_index integers 0
index sqlite_autoindex_integers_1 integers 0
table integers integers 0
view v1 v1 0

query IIII
SELECT database_name, table_name, has_primary_key, estimated_size FROM duckdb_tables()
Expand Down

0 comments on commit e299990

Please sign in to comment.