Commit Graph

17 Commits

Author SHA1 Message Date
AdrianAcala
7ca902979d Fix: Correctly update indexes when INTEGER PRIMARY KEY (rowid alias) changes (Issue #1897)
When an `UPDATE` statement modifies a table's `INTEGER PRIMARY KEY` (which acts as a `rowid` alias) alongside other indexed columns, the index entries were incorrectly retaining the old `rowid`. This led to stale index references, causing subsequent queries to return incorrect results.

This change ensures that when the `rowid` alias is part of the `SET` clause in an `UPDATE` statement, the new `rowid` value is used for generating and updating index records. This guarantees that all index entries correctly point to the updated row, resolving the data inconsistency.
2025-07-01 16:03:27 +00:00
Pekka Enberg
b87ce6d178 Merge 'Fix deleting previous rowid when rowid is in the Set Clause' from Pedro Muniz
Closes #1888 . This PR fixes UPDATE translation by not emitting an
ephemeral plan when we are doing a `RowIdEq` search. Also, we should
delete the previous rowid when the rowid is in the set clause.

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

Closes #1891
2025-06-30 11:58:05 +03:00
Pekka Enberg
9c1b7897ac Fix URLs to point to github.com/tursodatabase/turso 2025-06-30 11:23:53 +03:00
pedrocarlo
ae569fbd7d add test 2025-06-29 17:13:53 -03:00
pedrocarlo
b3351dc709 tests + adjustment to halt error message 2025-06-20 16:29:10 -03:00
pedrocarlo
eda9d20a0b tests 2025-06-20 16:28:10 -03:00
Pere Diaz Bou
814f68043d filter out sqlite3 executable too 2025-06-17 19:33:23 +02:00
Pere Diaz Bou
032337745b disable more tests without index 2025-06-17 19:33:23 +02:00
Jussi Saurio
30e4511d62 Merge 'NOT NULL constraint' from Anton Harniakou
Implements basic support for `NOT NULL` contraint check.

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

Closes #1675
2025-06-13 14:25:24 +03:00
Anton Harniakou
4b0b119f70 Add UPDATE tests 2025-06-11 14:24:35 +03:00
pedrocarlo
0da9d65d3e test 2025-06-10 12:07:38 -03:00
Jussi Saurio
51abeca896 Add regression test for updating indexes 2025-06-09 08:51:23 +03:00
pedrocarlo
39434fd20f return_io when restoring context 2025-06-01 03:07:16 -03:00
PThorpe92
2dec7b7255 Add more test cases for update 2025-03-23 20:12:10 -04:00
PThorpe92
4067c98848 Adjust update tests, remove unsupported syntax 2025-03-23 19:20:45 -04:00
PThorpe92
8f469f26b6 Add some additional tcl tests for update support 2025-03-23 17:08:15 -04:00
PThorpe92
dbfe94d677 Add initial tests for update support 2025-03-23 17:08:15 -04:00