duckdb 0.3.4-dev56.0 → 0.3.4-dev68.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.4-dev56.0",
4
+ "version": "0.3.4-dev68.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
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 "e11559378"
15
- #define DUCKDB_VERSION "v0.3.4-dev56"
14
+ #define DUCKDB_SOURCE_ID "ec827df5f"
15
+ #define DUCKDB_VERSION "v0.3.4-dev68"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -2473,6 +2473,13 @@ public:
2473
2473
  entry_idx = row_idx / BITS_PER_VALUE;
2474
2474
  idx_in_entry = row_idx % BITS_PER_VALUE;
2475
2475
  }
2476
+ //! Get an entry that has first-n bits set as valid and rest set as invalid
2477
+ static inline V EntryWithValidBits(idx_t n) {
2478
+ if (n == 0) {
2479
+ return V(0);
2480
+ }
2481
+ return ValidityBuffer::MAX_ENTRY >> (BITS_PER_VALUE - n);
2482
+ }
2476
2483
 
2477
2484
  //! RowIsValidUnsafe should only be used if AllValid() is false: it achieves the same as RowIsValid but skips a
2478
2485
  //! not-null check
@@ -2548,20 +2555,33 @@ public:
2548
2555
  }
2549
2556
  }
2550
2557
 
2551
- //! Marks "count" entries in the validity mask as invalid (null)
2558
+ //! Marks exactly "count" bits in the validity mask as invalid (null)
2552
2559
  inline void SetAllInvalid(idx_t count) {
2553
2560
  EnsureWritable();
2554
- for (idx_t i = 0; i < ValidityBuffer::EntryCount(count); i++) {
2561
+ if (count == 0) {
2562
+ return;
2563
+ }
2564
+ auto last_entry_index = ValidityBuffer::EntryCount(count) - 1;
2565
+ for (idx_t i = 0; i < last_entry_index; i++) {
2555
2566
  validity_mask[i] = 0;
2556
2567
  }
2568
+ auto last_entry_bits = count % static_cast<idx_t>(BITS_PER_VALUE);
2569
+ validity_mask[last_entry_index] = (last_entry_bits == 0) ? 0 : (ValidityBuffer::MAX_ENTRY << (last_entry_bits));
2557
2570
  }
2558
2571
 
2559
- //! Marks "count" entries in the validity mask as valid (not null)
2572
+ //! Marks exactly "count" bits in the validity mask as valid (not null)
2560
2573
  inline void SetAllValid(idx_t count) {
2561
2574
  EnsureWritable();
2562
- for (idx_t i = 0; i < ValidityBuffer::EntryCount(count); i++) {
2575
+ if (count == 0) {
2576
+ return;
2577
+ }
2578
+ auto last_entry_index = ValidityBuffer::EntryCount(count) - 1;
2579
+ for (idx_t i = 0; i < last_entry_index; i++) {
2563
2580
  validity_mask[i] = ValidityBuffer::MAX_ENTRY;
2564
2581
  }
2582
+ auto last_entry_bits = count % static_cast<idx_t>(BITS_PER_VALUE);
2583
+ validity_mask[last_entry_index] |=
2584
+ (last_entry_bits == 0) ? ValidityBuffer::MAX_ENTRY : ~(ValidityBuffer::MAX_ENTRY << (last_entry_bits));
2565
2585
  }
2566
2586
 
2567
2587
  inline bool IsMaskSet() const {