Commit Graph

10179 Commits

Author SHA1 Message Date
pedrocarlo
0ef5ec007c remove cfg for MAP_ANONYMOUS 2025-10-13 18:05:18 -03:00
Jussi Saurio
c54e150a52 Merge 'Fix: Table entry is not removed from sqlite_schema when a table is dropped' from
Fixes #3682 .
Ignore case of table name when dropping table.

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

Closes #3683
2025-10-13 15:02:29 +03:00
Jussi Saurio
c12c1db275 Merge 'Simulator: persist files in sim memory IO for integrity check' from Pedro Muniz
If we don't persist the files, rusqlite will open an empty file and
perform integrity check on it.

Reviewed-by: bit-aloo (@Shourya742)

Closes #3676
2025-10-13 14:23:53 +03:00
Jussi Saurio
c2deee1ce5 Merge 'Simulator: ALTER TABLE' from Pedro Muniz
Adds `ALTER TABLE` to the simulator. Currently, there are no properties
that generate `ALTER TABLE`. The query is only generated in
`Property::Query` or in extension queries.
Conditions to generate `ALTER TABLE`:
- In differential testing, do not generate `ALTER COLUMN` as SQLite does
not support it.
- If there is only 1 column, or all columns are present in indexes, do
not generate a `DROP COLUMN` as it would be an error in the database
- if there are no tables, obviously do not generate `ALTER TABLE`
Some fixes:
- handle NULL generation in `GTValue` and `LTValue`, as we now have to
handle nulls due to `ADD COLUMN` adding cols with NULL
- correctly compare NULLs in `binary_compare`

Closes #3650
2025-10-13 14:16:49 +03:00
Pekka Enberg
bd97c117ed whopper: Remove debug printouts 2025-10-13 12:19:09 +03:00
Pekka Enberg
77492641db Merge 'Move all checksum tests behind the feature flag' from Avinash Sajjanshetty
Closes #3704
2025-10-13 11:46:56 +03:00
Avinash Sajjanshetty
4a29694475 rename checksums tests appropriately 2025-10-13 13:48:07 +05:30
Avinash Sajjanshetty
ee479d2e52 Move all checksum tests behind the feature flag 2025-10-13 13:47:25 +05:30
Pekka Enberg
9e7c1e9061 Merge 'core/vdbe: Improve IdxDelete error messages with context' from Pekka Enberg
We currently return the exact same error from two different IdxDelete
paths. Improve the messages with context about what we're doing to make
this error more debuggable.

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

Closes #3699
2025-10-13 10:19:08 +03:00
Pekka Enberg
9eeefa27e9 Merge 'stress: Add busy timeout support with 5 second default' from Pekka Enberg
Add `--busy-timeout` command-line option to turso-stress with a default
value of 5000 ms. This helps prevent spurious database busy errors
during concurrent stress testing and ensure that integrity checks are
not skipped because of concurrent writes.

Closes #3696
2025-10-13 10:19:01 +03:00
Pekka Enberg
49bf81ab8b Merge 'Add WINDOW functions to COMPAT.md' from Jussi Saurio
Closes #3701
2025-10-13 10:18:54 +03:00
Jussi Saurio
171bcd83ec COMPAT.MD: note about WINDOW functions 2025-10-13 10:16:13 +03:00
Pekka Enberg
2a02cafc73 core/vdbe: Improve IdxDelete error messages with context
We currently return the exact same error from two different IdxDelete
paths. Improve the messages with context about what we're doing to make
this error more debuggable.
2025-10-13 09:42:04 +03:00
Pekka Enberg
7b1b37095d stress: Add busy timeout support with 5 second default
Add `--busy-timeout` command-line option to turso-stress with a default
value of 5000 ms. This helps prevent spurious database busy errors
during concurrent stress testing and ensure that integrity checks are
not skipped because of concurrent writes.
2025-10-13 09:11:10 +03:00
Pekka Enberg
eb000c3d0f Merge 'core/translate: Add if alias and allow iff to have more arguments' from Pavan Nambi
closes #3689

Closes #3690
2025-10-13 08:53:00 +03:00
pedrocarlo
c0f35cc17d disable ALTER COLUMN due to incompatibility with SQLITE INTEGRITY CHECK 2025-10-13 02:34:43 -03:00
pedrocarlo
773fa28063 workaround in sqlite for schema changes become visible to other connections 2025-10-13 02:34:43 -03:00
pedrocarlo
dca1137f81 rusqlite stop trying to get rows when we error with InvalidColumnIndex 2025-10-13 02:34:43 -03:00
pedrocarlo
d99e3f590f ALTER TABLE should be added to is_ddl 2025-10-13 02:34:43 -03:00
pedrocarlo
5f65196115 fix load_bug 2025-10-13 02:34:43 -03:00
pedrocarlo
b6c5fee300 do not count certain interactions in the InteractionPlan and correctly report the length when shrinking 2025-10-13 02:34:43 -03:00
pedrocarlo
49e96afd39 generate ALTER COLUMN 2025-10-13 02:34:43 -03:00
pedrocarlo
a18a472685 add option to disable alter column for differential testing 2025-10-13 02:34:43 -03:00
pedrocarlo
ca8be11a56 fix binary compare in simulator by taking into account NULL for certain compare ops 2025-10-13 02:34:43 -03:00
pedrocarlo
703efaa724 adjust Properties to skip Alter Table in certain conditions 2025-10-13 02:34:43 -03:00
pedrocarlo
a149e55209 fix Drop Column to only be generated if no columns conflict in Indexes 2025-10-13 02:34:43 -03:00
pedrocarlo
9c2edbb8b7 create separate Index struct for sql generation 2025-10-13 02:04:15 -03:00
pedrocarlo
ab152890dd adjust generation of GTValue and LTValue to accomodate for Null Values 2025-10-13 02:04:15 -03:00
pedrocarlo
c072058e4b add Alter Table query generation in Sim 2025-10-13 02:04:15 -03:00
pedrocarlo
230755eb2e shadow for AlterTable 2025-10-13 02:04:15 -03:00
Pavan-Nambi
e1f23aeb2c fmt and add tests 2025-10-12 22:23:04 +05:30
Pavan-Nambi
3491e1f42e add if alais and allow iff to have more arguments 2025-10-12 22:17:35 +05:30
Pekka Enberg
7221f79a2f Merge 'Stop ignoring table's max value incase of a manual update in autoincrement.' from Pavan Nambi
closes https://github.com/tursodatabase/turso/issues/3664

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

Closes #3668
2025-10-12 18:38:13 +03:00
Pekka Enberg
487a1772fc Merge 'Fix disallow reserved prefixes in ALTER TABLE RENAME TO' from xmchx
Closes #3574

Closes #3663
2025-10-12 18:37:44 +03:00
Pekka Enberg
3fafc23d96 Merge 'Nyrkiö nightly: Reduce frequency to 1 per 24h' from Henrik Ingo
Also fix a missed path in sqlite3 tests

Closes #3685
2025-10-12 18:37:25 +03:00
Henrik Ingo
00bde0d52a Nyrkiö nightly: Reduce frequency to 1 per 24h
Also fix a missed path in sqlite3 tests
2025-10-12 13:46:26 +03:00
Pavan-Nambi
bd9ce7c485 add test 2025-10-12 15:58:10 +05:30
Pavan-Nambi
c59b0ffa65 fix(core/vdbe):pass largest value from table to op_new_rowid 2025-10-12 15:57:29 +05:30
rajajisai
9061024fad add test 2025-10-11 21:39:46 -04:00
rajajisai
6c082660ca convert table name to lower case 2025-10-11 21:39:41 -04:00
pedrocarlo
fafbdbfa9d persist files in sim memory io for integrity check 2025-10-11 15:03:22 -03:00
Preston Thorpe
99f2df3d70 Merge 'Fix cloning database with autoincrement primary keys' from
Ignore `sqlite_sequence` when dumping tables during cloning.
Fixes #3640.

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

Closes #3651
2025-10-11 13:33:15 -04:00
ultraman
5153e2aa32 Fix disallow reserved prefixes in ALTER TABLE RENAME TO 2025-10-11 16:30:25 +08:00
Pekka Enberg
fb1042187b Turso 0.3.0-pre.1 2025-10-10 19:25:58 +03:00
Pekka Enberg
4af61d8049 Merge 'core/btree: try to introduce trait for cursors' from Pere Diaz Bou
I've added a trait called `CursorTrait`. I know it's not a good name for
now, but I didn't know what tto change then enum `Cursor` to. This trait
wraps all common functionality, and some functionality that is yet too
specific that needs to be fixed.
This is needed in order to have layered cursors where for example,
MvccCursor will need a fallback BTreeCursor.

Closes #3660
2025-10-10 19:25:39 +03:00
pedrocarlo
f593080c2a add Query::AlterTable variant 2025-10-10 11:08:04 -03:00
pedrocarlo
2cc7947107 define alter table in sql_generation 2025-10-10 11:08:04 -03:00
Pere Diaz Bou
160a84250e core: add CursorTrait imports where needed 2025-10-10 15:04:15 +02:00
Pere Diaz Bou
b3ab51d66a core/vdbe: store cursor as a dyn CursorTrait 2025-10-10 15:04:15 +02:00
Pere Diaz Bou
d0d6db301b core/btree: CursorTrait 2025-10-10 15:04:15 +02:00