## 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 T (
  a INTEGER,
  b REAL
);
-- PRAGMA wal_checkpoint;

INSERT INTO T VALUES (1,1.5), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
CREATE TABLE T1 (
  a INTEGER,
  b REAL
);
CREATE TABLE T2 (
  a INTEGER,
  b REAL
);
INSERT INTO T1 VALUES (tan(sin(1)),1.0);
INSERT INTO T2 VALUES (1,-1.0),(2,9e999);
INSERT OR REPLACE INTO T1
SELECT * FROM T2;
SELECT * FROM T1;
ALTER TABLE T1 DROP COLUMN a;
DELETE FROM T2 WHERE 0;
SELECT * FROM T t1 RIGHT JOIN T t2 ON t1.a = (SELECT a FROM T WHERE a = t1.a);
INSERT INTO T2 DEFAULT VALUES;
SELECT FIRST_VALUE(a) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T;
PRAGMA trusted_schema;
SELECT * FROM T2 AS a RIGHT JOIN T1 AS b ON a.rowid = b.rowid;
```

## Actual output

```sql
2|-7.25
3|0.0
1.11893960318495|1.0
1|-1.0
2|Inf
1|1.5|1|1.5
1|1.5|2|-7.25
1|1.5|3|0.0
2|-7.25|1|1.5
2|-7.25|2|-7.25
2|-7.25|3|0.0
3|0.0|1|1.5
3|0.0|2|-7.25
3|0.0|3|0.0
1
1
1
1
1|-1.0|1.0
2|Inf|-1.0
||Inf
```

## Expectation

```sql
2|-7.25
3|0.0
1.11893960318495|1.0
1|-1.0
2|Inf
1|1.5|1|1.5
1|1.5|2|-7.25
1|1.5|3|0.0
2|-7.25|1|1.5
2|-7.25|2|-7.25
2|-7.25|3|0.0
3|0.0|1|1.5
3|0.0|2|-7.25
3|0.0|3|0.0
1
1
1
0
1|-1.0|1.0
2|Inf|-1.0
||Inf
```

## Flag

```

```

