SQLite

View Ticket
Login
Ticket Hash: 7e07a3dbf5a8cd26e87418764625816f24f11046
Title: LIKELY() seems to cause unexpected affinity conversion for rowid
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-08-22 16:39:06
Version Found In: 3.29.0
User Comments:
mrigger added on 2019-08-22 14:34:30:

Consider the following test case:

CREATE TABLE t0 (c0);
INSERT INTO t0(c0) VALUES ('a');
SELECT * FROM t0 WHERE LIKELY(t0.rowid) <= '0'; -- unexpected: row is not fetched

Unexpectedly, no row is fetched. The expression LIKELY(t0.rowid) <= '0' should evaluate to TRUE:

SELECT LIKELY(t0.rowid) <= '0' FROM t0; -- 1