SQLite Forum

Inconsistent output possibly due to affinity issue
Login
Hi all.

For query:

```SQL
CREATE TABLE v0 ( v2 REAL, v1 );
INSERT INTO v0 VALUES ( 10, 11 );
UPDATE v0 SET v1 = v2;

SELECT * FROM v0 WHERE v1 = 10 and v1 LIKE 10;
/* 10.0 | 10.0 */
SELECT v1 = 10 and v1 LIKE 10 FROM v0;
/* 0 */
```

The two SELECT statements return inconsistent results. We do not know whether this is a potential bug or an expected behavior due to affinity issue. 

The behavior is reproducible with Fossil: 708ce7ad8acee702d08d1987aa253b0bfc3fd97255d6e4153122b03eba337570. But it does not appear on stable release SQLite 3.31.1. 

Looking forward to your reply.