## 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
PRAGMA analysis_limit;
PRAGMA vdbe_listing = OFF;
PRAGMA max_page_count;
.system echo "mwahaha i am root"
CREATE	TABLE t5(a INT, b INT);
CREATE UNIQUE INDEX t5x ON t5(a+b);
INSERT INTO t5(a,b) VALUES(0,0),(1,0),(1,1),(0,3);
CREATE TEMP TABLE out AS SELECT DISTINCT a+b FROM t5;
CREATE TABLE t6a(x INTEGER PRIMARY KEY);
INSERT INTO t6a VALUES(1);
CREATE TABLE t6b(y INTEGER PRIMARY KEY);
INSERT INTO t6b VALUES(2),(3);
SELECT DISTINCT x, x FROM t6a, t6b;
SELECT * FROM out ORDER BY 1;

SELECT * FROM t6b AS a LEFT JOIN t6a AS b ON a.rowid = b.rowid;
WITH cte AS (SELECT * FROM t6b WHERE y = (SELECT MAX(y) FROM t6b)) SELECT * FROM cte;
```

## Actual output

```sql
0
1073741823
mwahaha i am root
1|1
0
1
2
3
2|
3|
3
```

## Expectation

```sql
0
4294967294
mwahaha i am root
1|1
0
1
2
3
2|
3|
3
```

## Flag

```

```

