## 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 max_page_count;
PRAGMA case_sensitive_like = OFF;
PRAGMA writable_schema = NO;
.quit
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a int, b int);
INSERT INTO t1 VALUES(1,2),(1,18),(2,19);
SELECT x, y FROM (SELECT 98 AS x, 99 AS y UNION SELECT a AS x, sum(b) AS y FROM t1 GROUP BY a) AS w WHERE y>=20 ORDER BY +x;
SELECT x, y FROM (SELECT a AS x, sum(b) AS y FROM t1 GROUP BY a UNION SELECT 98 AS x, 99 AS y) AS w WHERE y>=20 ORDER BY +x;

DROP VIEW IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL);
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
INSERT INTO T2 VALUES (NULL, NULL);
```

## Actual output

```sql
1073741823
```

## Expectation

```sql
4294967294
```

## Flag

```

```

