## 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
BEGIN IMMEDIATE;
CREATE TABLE T (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT NOT NULL,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', 3000);
INSERT INTO T VALUES ('b', 'q', 9223372036854775807);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('e', 'q', -9223372036854775808);
INSERT INTO T VALUES ('f', 'r', 0);
SELECT B, COUNT(*) AS D, SUM(C) AS E, AVG(C) AS F FROM T GROUP BY B HAVING SUM(C) > 0;
DROP TRIGGER IF EXISTS T;
COMMIT TRANSACTION;
SELECT * FROM T WHERE C NOT IN (SELECT C FROM T WHERE C IS NULL);
VACUUM main;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
```

## Actual output

```sql
SQLite version 3.39.0 2022-05-10 23:28:12
Enter ".help" for usage hints.
sqlite> sqlite>    ...>    ...>    ...>    ...>    ...> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> p|1|3000|3000.0
r|2|1700|850.0
sqlite> sqlite> sqlite> a|p|3000
b|q|9223372036854775807
c|r|1700
e|q|-9223372036854775808
f|r|0
sqlite> sqlite> sqlite> sqlite>
```

## Expectation

```sql
SQLite version 3.51.1 2025-11-28 17:28:25
Enter ".help" for usage hints.
sqlite> sqlite> (x1...> (x1...> (x1...> (x1...> (x1...> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> p|1|3000|3000.0
r|2|1700|850.0
sqlite> sqlite> sqlite> a|p|3000
b|q|9223372036854775807
c|r|1700
e|q|-9223372036854775808
f|r|0
sqlite> sqlite> sqlite> sqlite>
```

## Flag

```
-interactive
```

