## 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
ATTACH DATABASE ':memory:' AS aux65;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c INTEGER
);
INSERT INTO T VALUES (NULL,'a',NULL), (2,'b',1), (3,'c',2);
WITH RECURSIVE d(a,b,c,e) AS (
  SELECT *,1 FROM T WHERE c IS NULL
  UNION ALL
  SELECT T.a,T.b,T.c,d.e+1
  FROM T JOIN d ON T.c=d.a
)
SELECT * FROM d;
.timer on
CREATE TABLE T1 (
  A VARCHAR(-1445937777629738465),
  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;
SELECT * FROM T1 WHERE X < (SELECT MIN(X) FROM T1);
DETACH DATABASE aux65;
SELECT * FROM T2;
```

## Actual output

```sql
|a||1
Run Time: real 0.000 user 0.000144 sys 0.000000
Run Time: real 0.000 user 0.000082 sys 0.000000
Run Time: real 0.000 user 0.000021 sys 0.000000
Run Time: real 0.000 user 0.000014 sys 0.000000
Run Time: real 0.000 user 0.000013 sys 0.000000
a
b
b
Run Time: real 0.000 user 0.000036 sys 0.000000
Run Time: real 0.000 user 0.000044 sys 0.000000
Run Time: real 0.000 user 0.000008 sys 0.000000
b|k
Run Time: real 0.000 user 0.000010 sys 0.000000
```

## Expectation

```sql
|a||1
Run Time: real 0.000056 user 0.000064 sys 0.000000
Run Time: real 0.000032 user 0.000033 sys 0.000000
Run Time: real 0.000011 user 0.000011 sys 0.000000
Run Time: real 0.000006 user 0.000006 sys 0.000000
Run Time: real 0.000005 user 0.000005 sys 0.000000
a
b
b
Run Time: real 0.000016 user 0.000017 sys 0.000000
Run Time: real 0.000021 user 0.000022 sys 0.000000
Run Time: real 0.000005 user 0.000004 sys 0.000000
b|k
Run Time: real 0.000004 user 0.000005 sys 0.000000
```

## Flag

```

```

