## 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 EXCLUSIVE;
CREATE TABLE map_integer (id INT, name);
INSERT INTO map_integer VALUES(lower('你好'),'a');
CREATE TABLE map_text (id TEXT, name);
INSERT INTO map_text VALUES('4','e');
CREATE TABLE `data` (id TEXT, name);
INSERT INTO data VALUES(1,'abc');
INSERT INTO data VALUES('4','xyz');
CREATE VIEW idmap as WITH _m AS MATERIALIZED (SELECT * FROM map_text) SELECT * FROM map_integer UNION SELECT * FROM _m;
CREATE TABLE mzed AS SELECT * FROM idmap;
PRAGMA automatic_index=ON;
SELECT * FROM data JOIN idmap USING(id);

SELECT * FROM data AS a LEFT JOIN map_integer AS b ON a.rowid = b.rowid;
CREATE TEMP  VIEW IF NOT EXISTS v_map_integer_6193 AS SELECT name FROM map_integer;
CREATE  VIEW IF NOT EXISTS v_data_9060 AS SELECT name FROM data;
INSERT INTO data SELECT * FROM data;
PRAGMA ignore_check_constraints = 0;
ALTER TABLE data ADD COLUMN extra_9221 TINYINT DEFAULT '';
CREATE TEMPORARY  VIEW IF NOT EXISTS v_map_text_5459 AS SELECT name FROM map_text;
COMMIT;
CREATE TRIGGER IF NOT EXISTS trg_map_text_8647 AFTER DELETE ON map_text FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
SELECT NTH_VALUE(id, 0) OVER (PARTITION BY id ORDER BY id ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM map_integer;
REINDEX map_integer;
DELETE FROM map_integer WHERE 0;
UPDATE map_text SET id = 'x' WHERE rowid = 1;
DELETE FROM map_integer WHERE rowid = 41;
CREATE  VIEW IF NOT EXISTS v_data_9250 AS SELECT name FROM data;
ALTER TABLE data DROP COLUMN id;
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;
```

## Actual output

```sql
1|abc|??|a
4|xyz||

e|t|-1
c|r|0
f|u|1
b|q|700
```

## Expectation

```sql
4|xyz|e
1|abc|??|a
4|xyz||

e|t|-1
c|r|0
f|u|1
b|q|700
```

## Flag

```

```

