Commit Graph

9483 Commits

Author SHA1 Message Date
PThorpe92
33538a1ebf Add some tests for UPSERT with partial indexes 2025-09-20 18:32:50 -04:00
PThorpe92
03149bc92d Remove unused imports 2025-09-20 18:32:37 -04:00
PThorpe92
62ee68e4dd Fix INSERT/UPSERT to properly handle and/or reject partial indexes 2025-09-20 18:32:03 -04:00
PThorpe92
51fb801d87 Fix partial index handling in insert to properly map rowid to insertion key 2025-09-20 17:44:28 -04:00
PThorpe92
93d24d2b50 Use new bind_where_expr helper method in emitter 2025-09-20 17:43:50 -04:00
PThorpe92
421b5b7bae Use new index.validate_where_expr and bind_where_expr methods on index create 2025-09-20 17:42:50 -04:00
PThorpe92
1ed3fc52f7 Add method to validate the Where Expr from a partial index 2025-09-20 17:41:56 -04:00
PThorpe92
0f771ecb5d Fix tests to assert for UNIQUE constraint failed: table.col_name instead of idx name 2025-09-20 15:02:38 -04:00
PThorpe92
6dc7d04c5a Replace translate_epxr with translate_condition_expr and fix constraint error 2025-09-20 15:02:06 -04:00
PThorpe92
281344434f Remove unused import 2025-09-20 14:38:50 -04:00
PThorpe92
340b95aa8b Apply PR review suggestions, add comments to partial indexes 2025-09-20 14:38:50 -04:00
PThorpe92
21f6455190 Fix clippy warnings and tests 2025-09-20 14:38:50 -04:00
PThorpe92
f4258b8b08 Just use raw pointer instead of cloning JoinedTable in emitter 2025-09-20 14:38:49 -04:00
PThorpe92
6d8bf009f1 Add some comments 2025-09-20 14:38:49 -04:00
PThorpe92
67cb59d9a7 Add UPDATE tests for partial index behavior 2025-09-20 14:38:49 -04:00
PThorpe92
2d952feae3 Add DELETE behavior tests for partial indexes 2025-09-20 14:38:49 -04:00
PThorpe92
635273f782 Prevent using a partial index as a scan driver 2025-09-20 14:38:48 -04:00
PThorpe92
4c6917f849 Add testing for partial indexes 2025-09-20 14:38:48 -04:00
PThorpe92
51f970a263 Support partial indexes in INSERT/UPDATE/DELETE 2025-09-20 14:38:48 -04:00
PThorpe92
a0f574d279 Add where_clause expr field to Index 2025-09-20 14:38:47 -04:00
PThorpe92
864d113037 Remove dumb comment 2025-09-20 14:38:47 -04:00
Preston Thorpe
25754cb0e4 Merge 'Pragma busy timeout' from Nikita Sivukhin
Expose busy_timeout added in #3067 as a `PRAGMA busy_timeout=<ms
duration>`
https://www.sqlite.org/pragma.html#pragma_busy_timeout

Reviewed-by: Avinash Sajjanshetty (@avinassh)
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #3224
2025-09-20 14:36:29 -04:00
Avinash Sajjanshetty
0597ea722a Add encryption throughput test 2025-09-20 21:56:58 +05:30
pedrocarlo
0e702fbec2 check FaultyQuery depending tables when shrinking 2025-09-20 12:01:07 -03:00
pedrocarlo
021d5d272a refactor shadowing code to take into account snapshot isolation 2025-09-20 12:01:07 -03:00
pedrocarlo
6b0011f477 in shriking remove unnecessary begin commit queries 2025-09-20 11:52:15 -03:00
pedrocarlo
0293c32616 disable integrity check and indexes when using mvcc 2025-09-20 11:52:15 -03:00
pedrocarlo
850dbc75a2 adjust shrinking to keep previous interactions if there are no depending tables 2025-09-20 11:52:15 -03:00
pedrocarlo
c3cdb0e0fd add begin concurrent before each statement with mvcc 2025-09-20 11:52:15 -03:00
pedrocarlo
13f36880f8 adjust generation code to use the context from the current connection index instead of the whole database 2025-09-20 11:52:15 -03:00
pedrocarlo
c4843d6a6e refactor SimulatorEnv to hold committed tables and separate connection tables for snapshot isolation 2025-09-20 11:52:15 -03:00
pedrocarlo
30538e7898 modify Begin struct 2025-09-20 11:52:15 -03:00
Pavan-Nambi
c9ab268bf5 remove extra checks for int column autoincr 2025-09-20 12:59:14 +05:30
Pavan-Nambi
294db6de2d Prevent sqlite_sequence updates from overwriting last_insert_rowid 2025-09-20 12:36:30 +05:30
Pavan-Nambi
6de280789e revert pager changes 2025-09-20 10:59:16 +05:30
Pavan-Nambi
0de92cd7fb update compat.md that we have memmax 2025-09-20 10:54:59 +05:30
Pavan-Nambi
16072de4f6 use Arc not rc and add auto_increment to window 2025-09-20 10:53:48 +05:30
Samuel Marks
d2cd48d9e4 [sqlite3/tests/compat/mod.rs] Use canonical path to fix temp path on macOS ; rename to resolve binding connascence 2025-09-19 20:40:11 -05:00
Nikita Sivukhin
57e52077be add link to the docs 2025-09-19 16:48:43 +04:00
Nikita Sivukhin
c63c820bb7 add busy_timeout pragma 2025-09-19 16:48:12 +04:00
Preston Thorpe
6b273af7e9 Merge 'translate/optimize: centralize AST/expr traversal' from Preston Thorpe
Previously we were rewriting/traversing the AST in a couple different
places, each of these added kinda ad-hoc as we needed them. This
attempts to do the binding of column references as well as the rewriting
of anonymous `Expr::Variable` -> `__param_N` that we use to maintain the
order of bound variables, also normalizes the Qualified Name's.
Also we previously weren't accepting Variable (or at least they wouldn't
work) in places like `LIMIT ? OFFSET ?`, which this PR adds.
I kinda want to keep refactoring translation a bit, and try to break
plan building up into more easy-to-digest chunks.. but I will resist the
urge right now as it's definitely not high priority pre-beta

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #3210
2025-09-19 08:03:39 -04:00
Preston Thorpe
20493441e0 Merge 'prevent alter table with materialized views' from Glauber Costa
I don't want to even think about the complexity involved in making sure
that materialized views are still sane after the base table(s) are
altered.

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #3223
2025-09-19 08:01:58 -04:00
Pekka Enberg
9dda5a6263 Merge 'bugfix: clear reserved space for a reused page' from Avinash Sajjanshetty
fixes #3184

Closes #3198
2025-09-19 14:16:24 +03:00
Glauber Costa
8300d0390e prevent alter table with materialized views
I don't want to even think about the complexity involved in making sure
that materialized views are still sane after the base table(s) are
altered.
2025-09-19 05:59:46 -05:00
Pekka Enberg
2307cf03be Merge 'core/mvcc: Wrap LogicalLog in RwLock' from Pekka Enberg
Closes #3215
2025-09-19 13:40:40 +03:00
Pekka Enberg
69d4745aa0 Merge 'Support JOINs in DBSP materialized views' from Glauber Costa
This PR introduces the final major operator: the JOIN operator.
Many things need to be fixed before we can properly support them, and we
handle those. In particular, JOINs always generate qualified column
statements, but we were not handling them correctly at all in the
operators. Not a problem for linear circuits, but fatal for JOINs.
The operator.rs file also becomes incredibly complex with not one, but
two stateful operator. So it is now broken apart.

Closes #3207
2025-09-19 13:40:21 +03:00
Jussi Saurio
c5ebb0ef63 Merge 'mvcc: remove unused code related to is_logical_log()' from Jussi Saurio
is always logical log

Closes #3220
2025-09-19 13:31:34 +03:00
Nikita Sivukhin
c24e5219d2 remove log file 2025-09-19 14:24:42 +04:00
Nikita Sivukhin
cfc8728774 fix clippy 2025-09-19 14:15:04 +04:00
Jussi Saurio
6a07d56742 Merge 'Put the unused variable behind a flag as intended' from Avinash Sajjanshetty
I keep getting these warnings and it slightly annoys me:
```rust
warning: unused variable: `overflow_cell_count_before`
    --> core/storage/btree.rs:3634:29
     |
3634 |                         let overflow_cell_count_before = parent_contents.overflow_cells.len();
     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_overflow_cell_count_before`
     |
     = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `overflow_cell_count_after`
    --> core/storage/btree.rs:3641:29
     |
3641 |                         let overflow_cell_count_after = parent_contents.overflow_cells.len();
     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_overflow_cell_count_after`

```

Reviewed-by: Nikita Sivukhin (@sivukhin)

Closes #3219
2025-09-19 12:58:57 +03:00