mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-09 11:14:20 +01:00
Closes #2431 Discovered while fuzzing #2086 ## What We update `schema_version` whenever the schema changes ## Problem Probably unintentionally, we were calling `SetCookie` in a loop for each row in the target table, instead of only once at the end. This means 2 things: - For large `n`, this is a lot of unnecessary instructions - For `n==0`, `SetCookie` doesn't get called at all -> the schema won't get marked as having been updated -> conns can operate on a stale schema ## Fix Lift `SetCookie` out of the loop Reviewed-by: Preston Thorpe <preston@turso.tech> Closes #2432