Skip to content

Commit

Permalink
Update vendored DuckDB sources to 31a6506
Browse files Browse the repository at this point in the history
  • Loading branch information
duckdblabs-bot committed Oct 17, 2024
1 parent 31a6506 commit 898a81e
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 31 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions src/duckdb/src/function/table/arrow_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,14 +765,12 @@ static void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowArraySca
case LogicalTypeId::BOOLEAN: {
//! Arrow bit-packs boolean values
//! Lets first figure out where we are in the source array
auto src_ptr = ArrowBufferData<uint8_t>(array, 1) +
GetEffectiveOffset(array, NumericCast<int64_t>(parent_offset), scan_state, nested_offset) / 8;
auto effective_offset =
GetEffectiveOffset(array, NumericCast<int64_t>(parent_offset), scan_state, nested_offset);
auto src_ptr = ArrowBufferData<uint8_t>(array, 1) + effective_offset / 8;
auto tgt_ptr = (uint8_t *)FlatVector::GetData(vector);
int src_pos = 0;
idx_t cur_bit = scan_state.chunk_offset % 8;
if (nested_offset != -1) {
cur_bit = NumericCast<idx_t>(nested_offset % 8);
}
idx_t cur_bit = effective_offset % 8;
for (idx_t row = 0; row < size; row++) {
if ((src_ptr[src_pos] & (1 << cur_bit)) == 0) {
tgt_ptr[row] = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/duckdb/src/function/table/version/pragma_version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DUCKDB_PATCH_VERSION
#define DUCKDB_PATCH_VERSION "3-dev13"
#define DUCKDB_PATCH_VERSION "3-dev23"
#endif
#ifndef DUCKDB_MINOR_VERSION
#define DUCKDB_MINOR_VERSION 1
Expand All @@ -8,10 +8,10 @@
#define DUCKDB_MAJOR_VERSION 1
#endif
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v1.1.3-dev13"
#define DUCKDB_VERSION "v1.1.3-dev23"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "8d3f8f8195"
#define DUCKDB_SOURCE_ID "1bb332c9c5"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
5 changes: 5 additions & 0 deletions src/duckdb/src/include/duckdb/common/multi_file_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ struct MultiFileReader {
static void PruneReaders(BIND_DATA &data, MultiFileList &file_list) {
unordered_set<string> file_set;

// Avoid materializing the file list if there's nothing to prune
if (!data.initial_reader && data.union_readers.empty()) {
return;
}

for (const auto &file : file_list.Files()) {
file_set.insert(file);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ class DuckTransaction : public Transaction {
reference_map_t<RowGroupCollection, shared_ptr<RowGroupCollection>> updated_collections;
//! Lock for the active_locks map
mutex active_locks_lock;
struct ActiveTableLock {
mutex checkpoint_lock_mutex; // protects access to the checkpoint_lock field in this class
weak_ptr<CheckpointLock> checkpoint_lock;
};
//! Active locks on tables
reference_map_t<DataTableInfo, weak_ptr<CheckpointLock>> active_locks;
reference_map_t<DataTableInfo, unique_ptr<ActiveTableLock>> active_locks;
};

} // namespace duckdb
2 changes: 1 addition & 1 deletion src/duckdb/src/planner/binder/query_node/plan_setop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ unique_ptr<LogicalOperator> Binder::CastLogicalOperatorToTypes(vector<LogicalTyp
for (auto &type : new_column_types) {
logical_get.returned_types[type.first] = type.second;
}
return op;
return std::move(op->children[0]);
}
}
}
Expand Down
29 changes: 15 additions & 14 deletions src/duckdb/src/transaction/duck_transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,23 +271,24 @@ unique_ptr<StorageLockKey> DuckTransaction::TryGetCheckpointLock() {
}

shared_ptr<CheckpointLock> DuckTransaction::SharedLockTable(DataTableInfo &info) {
lock_guard<mutex> l(active_locks_lock);
unique_lock<mutex> transaction_lock(active_locks_lock);
auto entry = active_locks.find(info);
if (entry != active_locks.end()) {
// found an existing lock
auto lock_weak_ptr = entry->second;
// check if it is expired
auto lock = lock_weak_ptr.lock();
if (lock) {
// not expired - return it
return lock;
}
if (entry == active_locks.end()) {
entry = active_locks.insert(entry, make_pair(std::ref(info), make_uniq<ActiveTableLock>()));
}
auto &active_table_lock = *entry->second;
transaction_lock.unlock(); // release transaction-level lock before acquiring table-level lock
lock_guard<mutex> table_lock(active_table_lock.checkpoint_lock_mutex);
auto checkpoint_lock = active_table_lock.checkpoint_lock.lock();
// check if it is expired (or has never been acquired yet)
if (checkpoint_lock) {
// not expired - return it
return checkpoint_lock;
}
// no existing lock - obtain it
auto table_lock = info.GetSharedLock();
auto checkpoint_lock = make_shared_ptr<CheckpointLock>(std::move(table_lock));
// insert it into the active locks and return it
active_locks.insert(make_pair(std::ref(info), checkpoint_lock));
checkpoint_lock = make_shared_ptr<CheckpointLock>(info.GetSharedLock());
// store it for future reference
active_table_lock.checkpoint_lock = checkpoint_lock;
return checkpoint_lock;
}

Expand Down
10 changes: 5 additions & 5 deletions src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,17 @@

#include "extension/icu/third_party/icu/i18n/wintzimpl.cpp"

#include "extension/icu/third_party/icu/i18n/double-conversion-strtod.cpp"

#include "extension/icu/third_party/icu/i18n/double-conversion-fast-dtoa.cpp"

#include "extension/icu/third_party/icu/i18n/double-conversion-bignum.cpp"

#include "extension/icu/third_party/icu/i18n/double-conversion-string-to-double.cpp"

#include "extension/icu/third_party/icu/i18n/double-conversion-double-to-string.cpp"
#include "extension/icu/third_party/icu/i18n/double-conversion-cached-powers.cpp"

#include "extension/icu/third_party/icu/i18n/double-conversion-bignum-dtoa.cpp"

#include "extension/icu/third_party/icu/i18n/double-conversion-strtod.cpp"
#include "extension/icu/third_party/icu/i18n/double-conversion-double-to-string.cpp"

#include "extension/icu/third_party/icu/i18n/double-conversion-cached-powers.cpp"
#include "extension/icu/third_party/icu/i18n/double-conversion-string-to-double.cpp"

0 comments on commit 898a81e

Please sign in to comment.