## Summary
<!--Explain briefly what goes wrong and explain why you believe this is a bug and not the intended behavior of SQLite (if it is not a crash).-->**No review yet**

## Minimized query

```sql
CREATE TABLE t1(a, b, c);
INSERT INTO t1 VALUES(1,'aaa','bbb');
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 VALUES(2,'ccc','ddd');
SELECT DISTINCT a AS x, b||c AS y FROM t1 WHERE y IN ('aaabbb','xxx');
SELECT DISTINCT a AS x, b||c AS y FROM t1 WHERE +y='aaabbb';

CREATE  INDEX IF NOT EXISTS idx_t1_6751 ON t1(b);
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
WITH a AS (SELECT * FROM t1), b AS (SELECT * FROM a), c AS (SELECT * FROM b), d AS (SELECT * FROM c) SELECT * FROM d;
```

## Actual output

```sql
SQLite version 3.39.0 2022-05-10 23:28:12
Enter ".help" for usage hints.
sqlite> sqlite> sqlite> sqlite> sqlite> 1|aaabbb
sqlite> 1|aaabbb
sqlite> sqlite> sqlite> 1|aaa|bbb|1|aaa|bbb
1|aaa|bbb|1|aaa|bbb
2|ccc|ddd|2|ccc|ddd
sqlite> 1|aaa|bbb
1|aaa|bbb
2|ccc|ddd
sqlite>
```

## Expectation

```sql
SQLite version 3.51.1 2025-11-28 17:28:25
Enter ".help" for usage hints.
sqlite> sqlite> sqlite> sqlite> sqlite> 1|aaabbb
sqlite> 1|aaabbb
sqlite> sqlite> sqlite> 1|aaa|bbb|1|aaa|bbb
1|aaa|bbb|1|aaa|bbb
2|ccc|ddd|2|ccc|ddd
sqlite> 1|aaa|bbb
1|aaa|bbb
2|ccc|ddd
sqlite>
```

## Flag

```
-interactive
```

