You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve LIKE/GLOB cache collisions, REGEXP error propagation, alias shadowing, and MVCC visibility bugs
Major fixes:
- LIKE/GLOB dynamic pattern cache collision: separate caches for LIKE vs GLOB,
include escape char in LIKE cache key, skip fast paths for backslash-escaped
patterns, fix trailing backslash handling in like_to_regex
- REGEXP error propagation: add matches_checked()/eval_bool_checked() that
return Result instead of swallowing errors. Propagate through FilteredResult,
all streaming wrappers, materialization helpers, subquery paths, DML write
paths, FFI, and the Rows iterator/advance API
- SELECT alias shadowing WHERE clause: build_alias_map_excluding() skips aliases
that shadow real table column names (including unqualified names from joins),
preventing incorrect WHERE clause rewriting
- MVCC visibility cache sentinel: change last_txn_id init from -1 to 0 in
sum_column/min_column/max_column, fixing incorrect aggregation results after
snapshot recovery (RECOVERY_TRANSACTION_ID = -1 collided with the sentinel)
- RowVec/RowIdVec pool re-entrancy: use try_borrow_mut() instead of
borrow_mut() to prevent RefCell panics on nested Drop
- View WHERE missing execution context: use RowFilter with ctx instead of
FilteredResult::with_defaults for parameterized predicates on views
- EXISTS index-probe missing context: apply execution context to cached
predicate filter before evaluation
- INSERT...SELECT atomicity: materialize source query before writes in
explicit transactions to prevent partial inserts on late runtime errors
- ScannerResult missing last_error(): bridge scanner.err() to QueryResult trait
- Parallel filter order preservation: use mark-and-extract (bool mask) instead
of try_reduce to maintain deterministic row order
- Rows close() on error: properly forward result.close() before setting closed
New test files for regression coverage of all fixed bugs.
Updated docs for LIKE ESCAPE, NOT variants, parameterized patterns, and
Node.js driver clone() API.
@@ -167,7 +169,7 @@ Controls the durability vs. performance trade-off:
167
169
168
170
| Mode | Value | Description |
169
171
|------|-------|-------------|
170
-
|`none`|`sync=none`| No fsync. Fastest, but data may be lost on crash |
172
+
|`none`|`sync=none`| No fsync. Fastest, data may be lost on crash |
171
173
|`normal`|`sync=normal`| Fsync on commit batches. Good balance (default) |
172
174
|`full`|`sync=full`| Fsync on every WAL write. Slowest, maximum durability |
173
175
@@ -185,9 +187,27 @@ Controls the durability vs. performance trade-off:
185
187
|`sync_interval_ms`|`10`| Minimum ms between syncs (normal mode) |
186
188
|`wal_compression`|`on`| LZ4 compression for WAL entries |
187
189
|`snapshot_compression`|`on`| LZ4 compression for snapshots |
188
-
|`compression`|-- | Set both `wal_compression` and `snapshot_compression`|
190
+
|`compression`|| Set both `wal_compression` and `snapshot_compression`|
189
191
|`compression_threshold`|`64`| Minimum bytes before compressing an entry |
190
192
193
+
## Cloning
194
+
195
+
`clone()` creates a new `Database` handle that shares the same underlying engine (data, indexes, transactions) but has its own executor and error state. Useful for concurrent access patterns such as worker threads.
196
+
197
+
```js
198
+
constdb=awaitDatabase.open('./mydata');
199
+
constdb2=db.clone();
200
+
201
+
// Both see the same data
202
+
awaitdb.execute('INSERT INTO users VALUES ($1, $2)', [1, 'Alice']);
203
+
constrow=db2.queryOneSync('SELECT * FROM users WHERE id = $1', [1]);
204
+
// { id: 1, name: 'Alice' }
205
+
206
+
// Each clone must be closed independently
207
+
awaitdb2.close();
208
+
awaitdb.close();
209
+
```
210
+
191
211
## Raw Query Format
192
212
193
213
`queryRaw` / `queryRawSync` return `{ columns: string[], rows: any[][] }` instead of an array of objects. Faster when you don't need named keys.
0 commit comments