## 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 aux81;
BEGIN DEFERRED;
.schema !@#$%^&*()qwertyuiop[]\{}|asdfghjkl;':"zxcvbnm,./<>?
CREATE TABLE [T] (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -2147483648);
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE C BETWEEN -1000 AND 1000 ORDER BY C ASC;
PRAGMA trusted_schema = 1;
ATTACH DATABASE ':memory:' AS aux7;
CREATE TABLE artists (id integer NOT NULL PRIMARY KEY AUTOINCREMENT, name varchar(255));
CREATE TABLE albums ( id integer NOT NULL PRIMARY KEY AUTOINCREMENT, name varchar(255), artist_id integer REFERENCES artists);
INSERT INTO artists (name) VALUES ('Ar');
INSERT INTO albums (name, artist_id) VALUES ('Al', 1);
SELECT artists.* FROM artists INNER JOIN artists AS b ON (b.id = artists.id) WHERE (artists.id IN ( SELECT albums.artist_id FROM albums WHERE ((name = 'Al') AND (albums.artist_id IS NOT NULL) AND (albums.id IN ( SELECT id FROM ( SELECT albums.id, row_number() OVER (PARTITION BY albums.artist_id ORDER BY name) AS x FROM albums WHERE (name = 'Al') ) AS t1 WHERE (x = 1) )) AND (albums.id IN (1, 2))) ));

DETACH DATABASE aux7;
INSERT INTO artists VALUES (NULL, 1) ON CONFLICT(id) DO UPDATE SET id = excluded.id, name = excluded.name;
CREATE TRIGGER IF NOT EXISTS trg_albums_9678 AFTER DELETE ON albums FOR EACH ROW BEGIN INSERT INTO albums(id) VALUES (NULL); END;
DROP TRIGGER IF EXISTS albums;
CREATE TRIGGER IF NOT EXISTS trg_T_2726 BEFORE INSERT ON T BEGIN SELECT RAISE(IGNORE); END;
ALTER TABLE albums RENAME COLUMN artist_id TO artist_id_r2718;
PRAGMA vdbe_trace = OFF;
SELECT * FROM artists NATURAL JOIN artists;
ANALYZE albums;
ALTER TABLE artists ADD COLUMN extra_4610 SMALLINT DEFAULT 0;
COMMIT;
DETACH DATABASE aux81;
CREATE TRIGGER IF NOT EXISTS trg_artists_5965 AFTER INSERT ON artists BEGIN SELECT RAISE(FAIL, 'no'); END;
DELETE FROM artists WHERE rowid = -CAST('[1,2,3]' AS INT8);
DROP TABLE IF EXISTS albums;
SELECT NTH_VALUE(id, '@') OVER (ORDER BY id) FROM artists;
REINDEX;
SELECT * FROM albums WHERE id > (SELECT MAX(id) FROM albums);
SELECT COUNT(*) FILTER (WHERE artist_id IS NOT NULL), SUM(rowid) FILTER (WHERE artist_id > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(artist_id) FILTER (WHERE artist_id > 0 AND artist_id < 100), COUNT(*) FILTER (WHERE typeof(artist_id) = "text") FROM albums;
REINDEX albums;
SELECT COUNT(*) FILTER (WHERE name IS NOT NULL), SUM(rowid) FILTER (WHERE name > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(name) FILTER (WHERE name > 0 AND name < 100), COUNT(*) FILTER (WHERE typeof(name) = "text") FROM artists;
SELECT COUNT(name) FROM artists;
```

## 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
```

