## 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
SAVEPOINT sp9417;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  C INTEGER,
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES (('a' || ''), 'p', -2147483648);
INSERT INTO T VALUES ('b', 'q', 100);
INSERT INTO T VALUES ('b', 'r', 200);
INSERT INTO T VALUES ('c', 's', 300);
INSERT INTO T VALUES ('d', 't', 2147483647);
INSERT INTO T VALUES ('b', 't', 50);
SELECT A, COUNT(*) AS D, SUM(C) AS E FROM T GROUP BY A HAVING COUNT(*) IS 1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', 30, 300);

CREATE INDEX t1bc ON t1(b, c);

PRAGMA writable_schema = ON;

.imposter t1bc t2

SELECT * FROM t2;

SELECT b, c FROM t1 ORDER BY b, c;

.quit
PRAGMA ignore_check_constraints == TRUE;
ATTACH ':memory:' AS aux1;
CREATE TABLE t1(a,b); INSERT INTO t1 VALUES((x'832e1622dde31c76' * -9223372036854775808),'x1');
CREATE TABLE t2(a,b); INSERT INTO t2 VALUES(222,'x2');
CREATE TEMP TABLE t3(a,b); INSERT INTO t3 VALUES(333,'x3');
CREATE TABLE main.t4(a,b); INSERT INTO main.t4 VALUES(444,'x4');
CREATE TABLE aux1.t4(a,b); INSERT INTO aux1.t4 VALUES(555,'x5');
UPDATE t2 SET a=111;
UPDATE t3 SET a=111;
UPDATE t4 SET a=111;
SELECT * FROM (t1), (t2), (t3), (t4) WHERE t4.a=t3.a+111 AND t3.a=t2.a+111 AND t2.a=t1.a+111;

CREATE TEMP  VIEW IF NOT EXISTS v_t3_7666 AS SELECT a FROM t3;
DELETE FROM t3 WHERE b IS NULL;
SELECT * FROM t2;
WITH RECURSIVE fib(a,b,n) AS (VALUES(1,1,1) UNION ALL SELECT b, a+b, n+1 FROM fib WHERE n<46) SELECT a, n FROM fib;
WITH cte AS (SELECT * FROM t4 WHERE a IS NOT NULL) SELECT * FROM cte;
DELETE FROM t4 WHERE 0;
ALTER TABLE t4 DROP COLUMN b;
ALTER TABLE t1 RENAME COLUMN b TO b_r980;
CREATE  VIEW IF NOT EXISTS v_t2_9993 AS SELECT a FROM t2;
SELECT * FROM (SELECT * FROM t2 ORDER BY a) AS sub LIMIT 10;
SELECT * FROM t3 WHERE a = (SELECT GROUP_CONCAT(a) FROM t3);
INSERT OR ROLLBACK INTO t2 VALUES ('x', 'x');
ROLLBACK TO sp9417;
RELEASE sp9417;
ALTER TABLE T ADD COLUMN extra_1469 TEXT;
INSERT INTO T VALUES (NULL, NULL, NULL);
VACUUM main;
UPDATE t2 SET b = b + 1 RETURNING *;
PRAGMA reverse_unordered_selects = ON;
ALTER TABLE t2 RENAME COLUMN b TO b_r900;
VACUUM;
SELECT COUNT(b) FROM t2;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t4;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_217 ON T(lower(A)) WHERE A > 0;
ALTER TABLE t2 RENAME TO t2_r9522;
CREATE TABLE T1 (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C BIGINT
);
CREATE TABLE T2 (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10),
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', 9999999999999);
INSERT INTO T1 VALUES ('b', 'q', -9999999999999);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.C FROM T2 INNER JOIN T1 ON T2.A =	T1.A WHERE T1.C > -1000000000000;
CREATE  VIEW IF NOT EXISTS v_T1_6344 AS SELECT C FROM T1;
ANALYZE t4;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t3) SELECT * FROM cte;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t4_1247 AS SELECT b FROM t4;
```

## Actual output

```sql
a|1|-2147483648
c|1|300
d|1|2147483647
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
WARNING: writing to an imposter table will corrupt the "t1bc" index!
Braun|30|3
Wernher|10|1
von|20|2
Braun|30
Wernher|10
von|20
```

## Expectation

```sql
a|1|-2147483648
c|1|300
d|1|2147483647
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
Braun|30|3
Wernher|10|1
von|20|2
Braun|30
Wernher|10
von|20
```

## Flag

```

```

