duckdb 0.3.3-dev1383.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-dev1383.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
@@ -171297,7 +171297,7 @@ void LocalTableStorage::InitializeScan(LocalScanState &state, TableFilterSet *ta
171297
171297
  // nothing to scan
171298
171298
  return;
171299
171299
  }
171300
- state.SetStorage(this);
171300
+ state.SetStorage(shared_from_this());
171301
171301
 
171302
171302
  state.chunk_index = 0;
171303
171303
  state.max_index = collection.ChunkCount() - 1;
@@ -171321,12 +171321,12 @@ LocalScanState::~LocalScanState() {
171321
171321
  SetStorage(nullptr);
171322
171322
  }
171323
171323
 
171324
- void LocalScanState::SetStorage(LocalTableStorage *new_storage) {
171325
- if (storage != nullptr) {
171324
+ void LocalScanState::SetStorage(shared_ptr<LocalTableStorage> new_storage) {
171325
+ if (storage) {
171326
171326
  D_ASSERT(storage->active_scans > 0);
171327
171327
  storage->active_scans--;
171328
171328
  }
171329
- storage = new_storage;
171329
+ storage = move(new_storage);
171330
171330
  if (storage) {
171331
171331
  storage->active_scans++;
171332
171332
  }
@@ -171440,7 +171440,7 @@ void LocalStorage::Append(DataTable *table, DataChunk &chunk) {
171440
171440
  auto entry = table_storage.find(table);
171441
171441
  LocalTableStorage *storage;
171442
171442
  if (entry == table_storage.end()) {
171443
- auto new_storage = make_unique<LocalTableStorage>(*table);
171443
+ auto new_storage = make_shared<LocalTableStorage>(*table);
171444
171444
  storage = new_storage.get();
171445
171445
  table_storage.insert(make_pair(table, move(new_storage)));
171446
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 "3093e74b1"
15
- #define DUCKDB_VERSION "v0.3.3-dev1383"
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
  };