## 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 DEFERRED;
.shell echo "please let me pass i will do anything uwu"
ATTACH DATABASE ':memory:' AS aux55;
.version
PRAGMA encoding = 'UTF-16be';
PRAGMA checkpoint_fullsync = TRUE;
PRAGMA query_only = TRUE;
PRAGMA fullsync = FALSE;
.timer on
CREATE TABLE T (
  A VARCHAR(concat_ws('|', NULL, NULL, NULL)),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
ANALYZE T;
UPDATE T SET B = 71 RETURNING *;
.version
PRAGMA encoding = 'UTF-16be';
PRAGMA checkpoint_fullsync = TRUE;
PRAGMA query_only = TRUE;
PRAGMA fullsync = FALSE;
.timer on
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
ANALYZE T;
UPDATE T SET B = 71 RETURNING *;
.version
PRAGMA encoding = 'UTF-16be';
PRAGMA checkpoint_fullsync = TRUE;
PRAGMA query_only = TRUE;
PRAGMA fullsync = FALSE;
.timer on
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
ANALYZE T;
UPDATE T SET B = 71 RETURNING *;

DETACH DATABASE aux55;
COMMIT;
CREATE TRIGGER IF NOT EXISTS trg_T_1462 AFTER UPDATE OF B ON T BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO T VALUES (NULL, 1) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B;
ANALYZE T;
SELECT COUNT(*) FROM T;
SELECT * FROM T WHERE B IN (SELECT B FROM T WHERE B IS NULL);
CREATE  VIEW IF NOT EXISTS v_T_8110 AS SELECT B FROM T;
```

## Actual output

```sql
3.39.0 2022-05-10 23:28:12 764b71267e0b31ff7eaf2a0def7526a1a02dce4d5b456dea060d97ed342ealt1
```

## Expectation

```sql
3.51.1 2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88 (64-bit)
```

## Flag

```
-version
```

