SQLite

View Ticket
Login
2018-01-16
13:50 Fixed ticket [47b2581a]: Infinite loop on UPDATE plus 5 other changes (artifact: ceefd4de user: drh)
13:37
Fix a problem causing an infinite loop or other malfunction in some UPDATE statements with an OR term in the WHERE clause. Ticket [47b2581aa9bfecec] (check-in: feb2c2b6 user: dan tags: trunk)
12:54 New ticket [47b2581a] Infinite loop on UPDATE. (artifact: 0e79b53b user: drh)

Ticket Hash: 47b2581aa9bfececa7d95b2ef2aa433418c7a583
Title: Infinite loop on UPDATE
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2018-01-16 13:50:15
Version Found In: 3.21.0
User Comments:
drh added on 2018-01-16 12:54:28:

The UPDATE at the end of the following sequence of SQL statements enters an infinite loop.

CREATE TABLE t1(a,b);
CREATE INDEX t1b ON t1(a);
CREATE INDEX t1c ON t1(b);
INSERT INTO t1 VALUES(1,2);
UPDATE t1 SET a = a+2 WHERE a>0 OR b>0;

Bisecting shows that this problem was introduced by the single-pass update optimization of check-in [7ae6104a3e0d1d2] on 2017-01-11 and first released with version 3.17.0. The problem was discovered by Harald Klimach and reported on the SQLite mailing list.