Commit Graph

8353 Commits

Author SHA1 Message Date
Pere Diaz Bou
b8f83e1fc0 clippy and fmt stuff because if not pekka will tweet 2025-09-03 12:47:55 +02:00
Pere Diaz Bou
13c505109a core/mvcc: make commit_txn return on I/O 2025-09-02 17:07:38 +02:00
Pere Diaz Bou
f26e36b6de core/mvcc: test write concurrency
fix
2025-09-02 17:07:38 +02:00
Pekka Enberg
8f7e43b32b scripts/publish-crates.sh: Remove turso_sqlite3_parser package 2025-09-02 14:21:04 +03:00
Pekka Enberg
3f3125c4f4 Merge 'remove turso_sqlite3_parser from turso_parser' from Lâm Hoàng Phúc
Closes #2888
2025-09-02 14:20:39 +03:00
Pekka Enberg
8204fbc8ec simulator: Fix 64-bit offset build failures
Fix brekage from first merging commit d959319b ("Merge 'Use u64 for file
offsets in I/O and calculate such offsets in u64' from Preston Thorpe")
and then commit 6591b66c ("Merge 'Simulate I/O in memory' from Pedro
Muniz"), which was unaware of the changes.
2025-09-02 14:14:04 +03:00
TcMits
07feacbc76 remove turso_sqlite3_parser from turso_parser 2025-09-02 18:10:28 +07:00
Pekka Enberg
6591b66c3d Merge 'Simulate I/O in memory' from Pedro Muniz
Revives the `MemorySim` PR and fixes a page cache issue where we could
have a unlocked and unloaded page in the page cache after a FaultyQuery.
The page would continue in the cache and could affect other queries as
the `page_cache` is at the `Connection` level.
Depends on #2785

Closes #2693
2025-09-02 13:28:48 +03:00
Pekka Enberg
3ec6f37555 scripts: Add turso_sqlite3_parser back to publish-crates.sh
Turns out turso_parser depends on it.
2025-09-02 12:52:40 +03:00
Pekka Enberg
91a51c170e Fix up turso_parser version in Cargo.toml 2025-09-02 12:47:49 +03:00
Pekka Enberg
6c7936a016 Turso 0.1.5-pre.2 2025-09-02 12:45:41 +03:00
Pekka Enberg
adaf0bec6c scripts: Fix publish-crates.sh to publish new parser crate 2025-09-02 12:45:16 +03:00
Pekka Enberg
483cd92dab Drop removed Go bindings from Antithesis Dockerfile 2025-09-02 09:48:53 +03:00
Pekka Enberg
15d45e3f68 Merge 'Refactor encryption to manage authentication tag internally' from bit-aloo
This PR updates the internal encryption framework to handle
authentication tags explicitly rather than relying on the underlying
cipher libraries to append/verify them automatically.
closes: #2850

Reviewed-by: Avinash Sajjanshetty (@avinassh)

Closes #2858
2025-09-02 09:44:22 +03:00
Pekka Enberg
7189e98455 Merge 'Unify handling of grouped and ungrouped aggregations' from Piotr Rżysko
The initial commits fix issues and plug gaps between ungrouped and
grouped aggregations.
The final commit consolidates the code that emits `AggStep` to prevent
future disparities between the two.

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

Closes #2867
2025-09-02 09:11:40 +03:00
Pekka Enberg
0868af29df Merge 'core/printf: support for more basic substitution types' from Luiz Gustavo
Some progress working on `printf` support.
(relevant issue https://github.com/tursodatabase/turso/issues/885)
Implementation of the basic substitution types cited in the `TODO`
comment on the beginning of the file (%i, %x, %X, %o, %e, %E, %c). There
are some others in the sqlite spec which I will implement in a future
PR.
I tried to pay attention to the specific behaviors from sqlite as much
as possible while testing this, but if there's something I missed please
tell me.
Also, I see this code needs to be reorganized already, I'm still
thinking on the best approach to do that without affecting the
ergonomics of new implementations, I'm still learning Rust so this is
not obvious for me right now. I'm open to suggestions about it.

Closes #2868
2025-09-02 09:10:03 +03:00
Pekka Enberg
1f6ba4f822 Merge 'Fix sim-schema command ' from Pedro Muniz
Create the directory to store the schema if it does not exists

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

Closes #2882
2025-09-02 09:08:57 +03:00
Pekka Enberg
87d3f74e6e Merge 'Evict page from cache if page is unlocked and unloaded' from Pedro Muniz
Because we can abort a read_page completion, this means a page can be in
the cache but be unloaded and unlocked. However, if we do not evict that
page from the page cache, we will return an unloaded page later which
will trigger assertions later on. This is worsened by the fact that page
cache is not per `Statement`, so you can abort a completion in one
Statement, and trigger some error in the next one if we don't evict the
page in these circumstances.
Also, to propagate IO errors we need to return the Error from
IOCompletions on step.

Closes #2785
2025-09-02 09:08:12 +03:00
Pekka Enberg
d959319b42 Merge 'Use u64 for file offsets in I/O and calculate such offsets in u64' from Preston Thorpe
Using `usize` to compute file offsets caps us at ~16GB on 32-bit
systems. For example, with 4 KiB pages we can only address up to 1048576
pages; attempting the next page overflows a 32-bit usize and can wrap
the write offset, corrupting data. Switching our I/O APIs and offset
math to u64 avoids this overflow on 32-bit targets

Closes #2791
2025-09-02 09:06:49 +03:00
Pekka Enberg
cfaba4ab10 Merge 'Implement libSQL's ALTER COLUMN extension' from Levy A.
Implement `ALTER COLUMN` as described here:
https://github.com/tursodatabase/libsql/blob/main/libsql-
sqlite3/doc/libsql_extensions.md#altering-columns
- [x] Add `ALTER COLUMN` to parser
- [x] Implement `Insn::AlterColumn`
- [x] Add tests

Closes #2814
2025-09-02 09:06:03 +03:00
Pekka Enberg
da81e43f9a Merge 'Document how to use CDC' from Pavan Nambi
Fixes #2221

Reviewed-by: Nikita Sivukhin (@sivukhin)

Closes #2871
2025-09-02 09:04:44 +03:00
Pekka Enberg
149942abe4 Merge 'Return sqlite_version() without being initialized' from Preston Thorpe
needed to support opening in Gorm

Closes #2878
2025-09-02 09:04:25 +03:00
Pekka Enberg
a21d580f80 Merge 'Upgrade Rust version in simulator build Dockerfile' from Preston Thorpe
otherwise simulator profiles will not build as it uses the new if let
syntax

Closes #2880
2025-09-02 09:04:03 +03:00
pedrocarlo
72d697e0eb fix sim-schema command by creating directory if it not exists 2025-09-01 21:05:25 -03:00
pedrocarlo
51a54d3c33 Fd should be part of Operation struct 2025-09-01 16:53:07 -03:00
PThorpe92
be2807b61f Upgrade rust version in simulator build dockerfile 2025-09-01 14:56:05 -04:00
PThorpe92
e9b50b63fb Return sqlite_version() without being initialized 2025-09-01 13:36:41 -04:00
Preston Thorpe
f3d252d665 Merge 'Parse booleans to integer literals in expressions' from Preston Thorpe
Adds tests for edgecases for the insane cases where someone might want
to name a table `true` :)

Closes #2874
2025-09-01 13:36:29 -04:00
pedrocarlo
1eb1171f55 do not fault on Fsync until we correctly define the expected behaviour in the simulator 2025-09-01 14:12:11 -03:00
pedrocarlo
c158db072b inject fault in the IO Operation in the MemorySim 2025-09-01 14:12:11 -03:00
pedrocarlo
be855a8059 IOCompletions: abort other remaining completions if previous one errors 2025-09-01 14:12:11 -03:00
pedrocarlo
bd8cfe40f1 impl remove_file for MemoryIO + skip completion if finished 2025-09-01 14:12:11 -03:00
pedrocarlo
cc3488bba0 print path in stats for memory IO 2025-09-01 14:12:11 -03:00
pedrocarlo
ff51965c3e fix shrinking to not include some properties that are present in faulty query, but that are not relevant to the error 2025-09-01 14:12:11 -03:00
pedrocarlo
fd4e74929a Cli option to enable memory IO 2025-09-01 14:12:11 -03:00
pedrocarlo
117451fba1 impl WriteV for MemorySim 2025-09-01 14:12:11 -03:00
PThorpe92
b76f9b7733 Use eq_ignore_ascii_case in place of allocating new string in parser 2025-09-01 12:32:33 -04:00
PThorpe92
f02e02af75 Fix TCL test 2025-09-01 11:39:43 -04:00
PThorpe92
bd9d6aa168 Add edge-case tests for boolean literals 2025-09-01 11:27:43 -04:00
PThorpe92
46f5565faf Add more tests for boolean literals 2025-09-01 11:25:16 -04:00
PThorpe92
46182aa7ed add test for inserting boolean literals 2025-09-01 11:25:10 -04:00
PThorpe92
4bb2497d36 Parser: translate true and false to 0 and 1 literals 2025-09-01 11:24:12 -04:00
pedrocarlo
24c0d24be6 impl Truncate for MemorySim 2025-09-01 11:11:25 -03:00
pedrocarlo
40de4c0606 initial impl for MemorySim 2025-09-01 11:11:25 -03:00
pedrocarlo
c01449e71b add parking_lot to simulator 2025-09-01 11:11:25 -03:00
pedrocarlo
8c7da3a704 impl SimIO for SimulatorIO 2025-09-01 11:11:03 -03:00
pedrocarlo
bc707fd9be cleanup + comments 2025-09-01 11:10:40 -03:00
pedrocarlo
d8e9f145e6 create SimIO trait 2025-09-01 11:10:40 -03:00
pedrocarlo
53cfae1db4 return Error from step if IO failed 2025-09-01 11:10:39 -03:00
pedrocarlo
6f1eed7aca clippy 2025-09-01 11:10:39 -03:00