duckdb 0.3.3-dev1379.0 → 0.3.3-dev1385.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.3.3-dev1379.0",
4
+ "version": "0.3.3-dev1385.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -169563,7 +169563,12 @@ void ValidityScanPartial(ColumnSegment &segment, ColumnScanState &state, idx_t s
169563
169563
  // the bitwise ops we use below don't work if the vector size is too small
169564
169564
  ValidityMask source_mask(input_data);
169565
169565
  for (idx_t i = 0; i < scan_count; i++) {
169566
- result_mask.Set(result_offset + i, source_mask.RowIsValid(start + i));
169566
+ if (!source_mask.RowIsValid(start + i)) {
169567
+ if (result_mask.AllValid()) {
169568
+ result_mask.Initialize(MaxValue<idx_t>(STANDARD_VECTOR_SIZE, result_offset + scan_count));
169569
+ }
169570
+ result_mask.SetInvalid(result_offset + i);
169571
+ }
169567
169572
  }
169568
169573
  #else
169569
169574
  // the code below does what the fallback code above states, but using bitwise ops:
@@ -171292,7 +171297,7 @@ void LocalTableStorage::InitializeScan(LocalScanState &state, TableFilterSet *ta
171292
171297
  // nothing to scan
171293
171298
  return;
171294
171299
  }
171295
- state.SetStorage(this);
171300
+ state.SetStorage(shared_from_this());
171296
171301
 
171297
171302
  state.chunk_index = 0;
171298
171303
  state.max_index = collection.ChunkCount() - 1;
@@ -171316,12 +171321,12 @@ LocalScanState::~LocalScanState() {
171316
171321
  SetStorage(nullptr);
171317
171322
  }
171318
171323
 
171319
- void LocalScanState::SetStorage(LocalTableStorage *new_storage) {
171320
- if (storage != nullptr) {
171324
+ void LocalScanState::SetStorage(shared_ptr<LocalTableStorage> new_storage) {
171325
+ if (storage) {
171321
171326
  D_ASSERT(storage->active_scans > 0);
171322
171327
  storage->active_scans--;
171323
171328
  }
171324
- storage = new_storage;
171329
+ storage = move(new_storage);
171325
171330
  if (storage) {
171326
171331
  storage->active_scans++;
171327
171332
  }
@@ -171435,7 +171440,7 @@ void LocalStorage::Append(DataTable *table, DataChunk &chunk) {
171435
171440
  auto entry = table_storage.find(table);
171436
171441
  LocalTableStorage *storage;
171437
171442
  if (entry == table_storage.end()) {
171438
- auto new_storage = make_unique<LocalTableStorage>(*table);
171443
+ auto new_storage = make_shared<LocalTableStorage>(*table);
171439
171444
  storage = new_storage.get();
171440
171445
  table_storage.insert(make_pair(table, move(new_storage)));
171441
171446
  } else {
package/src/duckdb.hpp CHANGED
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
13
  #define DUCKDB_AMALGAMATION_EXTENDED 1
14
- #define DUCKDB_SOURCE_ID "52d9a8b85"
15
- #define DUCKDB_VERSION "v0.3.3-dev1379"
14
+ #define DUCKDB_SOURCE_ID "cdfc389cb"
15
+ #define DUCKDB_VERSION "v0.3.3-dev1385"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -14435,9 +14435,9 @@ struct ColumnFetchState {
14435
14435
  struct LocalScanState {
14436
14436
  ~LocalScanState();
14437
14437
 
14438
- void SetStorage(LocalTableStorage *storage);
14438
+ void SetStorage(shared_ptr<LocalTableStorage> storage);
14439
14439
  LocalTableStorage *GetStorage() {
14440
- return storage;
14440
+ return storage.get();
14441
14441
  }
14442
14442
 
14443
14443
  idx_t chunk_index;
@@ -14446,7 +14446,7 @@ struct LocalScanState {
14446
14446
  TableFilterSet *table_filters;
14447
14447
 
14448
14448
  private:
14449
- LocalTableStorage *storage = nullptr;
14449
+ shared_ptr<LocalTableStorage> storage;
14450
14450
  };
14451
14451
 
14452
14452
  class RowGroupScanState {
@@ -14507,7 +14507,7 @@ class DataTable;
14507
14507
  class WriteAheadLog;
14508
14508
  struct TableAppendState;
14509
14509
 
14510
- class LocalTableStorage {
14510
+ class LocalTableStorage : public std::enable_shared_from_this<LocalTableStorage> {
14511
14511
  public:
14512
14512
  explicit LocalTableStorage(DataTable &table);
14513
14513
  ~LocalTableStorage();
@@ -14590,7 +14590,7 @@ private:
14590
14590
 
14591
14591
  private:
14592
14592
  Transaction &transaction;
14593
- unordered_map<DataTable *, unique_ptr<LocalTableStorage>> table_storage;
14593
+ unordered_map<DataTable *, shared_ptr<LocalTableStorage>> table_storage;
14594
14594
 
14595
14595
  void Flush(DataTable &table, LocalTableStorage &storage);
14596
14596
  };