Skip to content

Commit

Permalink
Merge pull request #79 from samansmink/add-win-rtools
Browse files Browse the repository at this point in the history
Update DuckDB
  • Loading branch information
Mytherin authored Jan 17, 2024
2 parents 241497f + 4d4692a commit bff9c00
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 238 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ concurrency:
jobs:
duckdb-stable-build:
name: Build extension binaries
uses: duckdb/duckdb/.github/workflows/_extension_distribution.yml@6812703823d1d66566bc7eaac2b6e4b273c85333
uses: duckdb/duckdb/.github/workflows/_extension_distribution.yml@a056c8e0a29f2f38d245afeb9e48cc308711aa21
with:
vcpkg_commit: a42af01b72c28a8e1d7b48107b33e4f286a55ef6
duckdb_version: v0.9.2
duckdb_version: a056c8e0a2
extension_name: sqlite_scanner
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads'

duckdb-stable-deploy:
name: Deploy extension binaries
needs: duckdb-stable-build
uses: ./.github/workflows/_extension_deploy.yml
uses: duckdb/duckdb/.github/workflows/_extension_deploy.yml@a056c8e0a29f2f38d245afeb9e48cc308711aa21
secrets: inherit
with:
duckdb_version: v0.9.2
duckdb_version: a056c8e0a2
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' }}
deploy_versioned: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
123 changes: 0 additions & 123 deletions .github/workflows/_extension_deploy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "duckdb"]
path = duckdb
url = https://github.com/duckdb/duckdb
branch = master
branch = main
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ all: release
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJ_DIR := $(dir $(MKFILE_PATH))

TEST_PATH="/test/unittest"
DUCKDB_PATH="/duckdb"

# For non-MinGW windows the path is slightly different
ifeq ($(OS),Windows_NT)
ifneq ($(CXX),g++)
TEST_PATH="/test/Release/unittest.exe"
DUCKDB_PATH="/Release/duckdb.exe"
else
TEST_PATH="/test/unittest"
DUCKDB_PATH="/duckdb"
endif
endif

OSX_ARCH_FLAG=
Expand Down Expand Up @@ -59,7 +62,7 @@ release:

data/db/tpch.db: release
command -v sqlite3 || (command -v brew && brew install sqlite) || (command -v choco && choco install sqlite -y) || (command -v apt-get && apt-get install -y sqlite3) || echo "no sqlite3"
./build/release/$(DUCKDB_PATH) < data/sql/tpch-export.duckdb
./build/release/$(DUCKDB_PATH) < data/sql/tpch-export.duckdb || tree ./build/release || echo "neither tree not duck"
sqlite3 data/db/tpch.db < data/sql/tpch-create.sqlite

# Main tests
Expand Down
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 2827 files
90 changes: 0 additions & 90 deletions scripts/extension-upload.sh

This file was deleted.

9 changes: 5 additions & 4 deletions src/include/storage/sqlite_transaction_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@
#include "duckdb/transaction/transaction_manager.hpp"
#include "storage/sqlite_catalog.hpp"
#include "storage/sqlite_transaction.hpp"
#include "duckdb/common/reference_map.hpp"

namespace duckdb {

class SQLiteTransactionManager : public TransactionManager {
public:
SQLiteTransactionManager(AttachedDatabase &db_p, SQLiteCatalog &sqlite_catalog);

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

void Checkpoint(ClientContext &context, bool force = false) override;

private:
SQLiteCatalog &sqlite_catalog;
mutex transaction_lock;
unordered_map<Transaction *, unique_ptr<SQLiteTransaction>> transactions;
reference_map_t<Transaction, unique_ptr<SQLiteTransaction>> transactions;
};

} // namespace duckdb
4 changes: 2 additions & 2 deletions src/sqlite_stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ void SQLiteStatement::BindText(idx_t col, const string_t &value) {
}

template <>
void SQLiteStatement::Bind(idx_t col, nullptr_t value) {
void SQLiteStatement::Bind(idx_t col, std::nullptr_t value) {
SQLiteUtils::Check(sqlite3_bind_null(stmt, col + 1), db);
}

void SQLiteStatement::BindValue(Vector &col, idx_t c, idx_t r) {
auto &mask = FlatVector::Validity(col);
if (!mask.RowIsValid(r)) {
Bind<nullptr_t>(c, nullptr);
Bind<std::nullptr_t>(c, nullptr);
} else {
switch (col.GetType().id()) {
case LogicalTypeId::BIGINT:
Expand Down
16 changes: 8 additions & 8 deletions src/storage/sqlite_transaction_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ SQLiteTransactionManager::SQLiteTransactionManager(AttachedDatabase &db_p, SQLit
: TransactionManager(db_p), sqlite_catalog(sqlite_catalog) {
}

Transaction *SQLiteTransactionManager::StartTransaction(ClientContext &context) {
Transaction &SQLiteTransactionManager::StartTransaction(ClientContext &context) {
auto transaction = make_uniq<SQLiteTransaction>(sqlite_catalog, *this, context);
transaction->Start();
auto result = transaction.get();
auto &result = *transaction;
lock_guard<mutex> l(transaction_lock);
transactions[result] = std::move(transaction);
return result;
}

string SQLiteTransactionManager::CommitTransaction(ClientContext &context, Transaction *transaction) {
auto sqlite_transaction = (SQLiteTransaction *)transaction;
sqlite_transaction->Commit();
string 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();
}

void SQLiteTransactionManager::RollbackTransaction(Transaction *transaction) {
auto sqlite_transaction = (SQLiteTransaction *)transaction;
sqlite_transaction->Rollback();
void SQLiteTransactionManager::RollbackTransaction(Transaction &transaction) {
auto &sqlite_transaction = transaction.Cast<SQLiteTransaction>();
sqlite_transaction.Rollback();
lock_guard<mutex> l(transaction_lock);
transactions.erase(transaction);
}
Expand Down
2 changes: 1 addition & 1 deletion test/sql/storage/attach_describe.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CREATE TABLE s1.test(i BIGINT PRIMARY KEY, j BIGINT DEFAULT 42);
query IIIIII
DESCRIBE s1.test
----
i BIGINT YES NULL NULL NULL
i BIGINT YES PRI NULL NULL
j BIGINT YES NULL 42 NULL

query ITTTTT
Expand Down

0 comments on commit bff9c00

Please sign in to comment.