mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-30 14:34:22 +01:00
Fixes DELETE not emitting conditional jumps at all if the associated WhereTerm is a constant, e.g. ```sql limbo> create table t(x); limbo> explain DELETE FROM t WHERE 5-5; addr opcode p1 p2 p3 p4 p5 comment ---- ----------------- ---- ---- ---- ------------- -- ------- 0 Init 0 7 0 0 Start at 7 1 OpenWrite 0 2 0 0 root=2; t 2 Rewind 0 6 0 0 Rewind table t 3 RowId 0 1 0 0 r[1]=t.rowid 4 Delete 0 0 0 0 5 Next 0 3 0 0 6 Halt 0 0 0 0 7 Transaction 0 1 0 0 write=true 8 Goto 0 1 0 0 ``` I was adding more stuff to the simulator in a Branch of mine, and I caught this error with delete. Upstreaming the fix here. As we do with Update, I added the translation step for the `WhereTerms` of the query. Edit: Closes #1732. Closes #1733. Closes #1734. Closes #1735. Closes #1736. Closes #1738. Closes #1739. Closes #1740. Edit: Also pushes constant where term translation to `init_loop` for Update and Select as well. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #1746