## 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 x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

SELECT * FROM tempx;
WITH cte(x) AS (VALUES(CAST(-5075860481212976019 AS NCHAR(55))),(2),(3)) SELECT * FROM cte WHERE x > 1;
PRAGMA automatic_index = 1;
PRAGMA page_size = 4096;
INSERT INTO x VALUES (NULL, NULL);
SELECT RANK() OVER (ORDER BY id ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM x;
```

## Actual output

```sql
1|1
1|t-first
2
3
1
2
```

## Expectation

```sql
1|1
1|t-first
-5075860481212976019
2
3
1
2
```

## Flag

```

```

