## 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
.read commands.sql
PRAGMA vdbe_addoptrace = TRUE;
.lint
ATTACH DATABASE ':memory:' AS aux9;
.echo on
PRAGMA automatic_index = NO;
ATTACH DATABASE ':memory:' AS aux83;
BEGIN EXCLUSIVE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (asin(-json_quote(datetime(cosh(octet_length('Hello'))))) ->> -(-(-(char(1, 2, 3, 4, 5) + 0.0))), '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;
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;
.imposter t1bc t2

WITH _m AS MATERIALIZED (SELECT * FROM T2) SELECT * FROM t2;
SELECT b, c FROM t1 ORDER BY b, c;
.quit
PRAGMA recursive_triggers = OFF;
PRAGMA ignore_check_constraints != FALSE;
PRAGMA wal_autocheckpoint;
PRAGMA pragma_list;
.sha3sum
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','2020-01-01'), ('b','2026-01-01');
SELECT a,
CAST(
  (julianday('now')-julianday(b))/-if(-2814635466794726270, 2360804486672605089)
  AS INTEGER
) AS c
FROM T;
CREATE /**/ TABLE T1 (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C INTEGER
);
CREATE TABLE _m (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10) NOT NULL UNIQUE,
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', -2147483648);
INSERT INTO T1 VALUES ('b', 'q', 2147483647);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.B, T1.C FROM T2, T1 WHERE T2.A = T1.A AND T1.C >= 0;
SELECT SUM(b) OVER  (ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
ALTER TABLE T RENAME TO T_r3912;
PRAGMA vdbe_trace = 0;
CREATE  INDEX IF NOT EXISTS idx_T_6324 ON T(a COLLATE NOCASE) WHERE a > 0;
INSERT INTO T SELECT * FROM T;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM T;
ALTER TABLE T1 RENAME TO T1_r9774;
CREATE TRIGGER IF NOT EXISTS trg_T1_9214 AFTER UPDATE ON T1 FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'abort'); END;
PRAGMA page_size;
SELECT * FROM T1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
SELECT GROUP_CONCAT(b, '|') FROM T;
SELECT COUNT(*) FROM T2;
SELECT * FROM T2 AS a JOIN T1 AS b ON a.rowid = b.rowid;
ROLLBACK;
WITH RECURSIVE multi(a, b) AS (VALUES(1, 1.0) UNION ALL SELECT a+1, b*0.5 /**/ FROM multi WHERE a<48) SELECT * FROM multi;
ALTER TABLE T RENAME COLUMN a TO a_r1923;
SELECT * FROM _m;
ALTER TABLE _m DROP COLUMN X;
ALTER TABLE _m DROP COLUMN X;
WITH RECURSIVE r AS (SELECT * FROM T1 LIMIT 1 UNION ALL SELECT t.* FROM T1 t JOIN r ON t.B = r.B LIMIT 10) SELECT * FROM r;
INSERT INTO _m VALUES (NULL, NULL);
DETACH DATABASE aux83;
REINDEX T;
CREATE  VIEW IF NOT EXISTS v_T1_1238 AS SELECT A FROM T1;
ALTER TABLE t1 ADD COLUMN extra_3847 DATE NOT NULL DEFAULT 0;
SELECT * FROM T1 AS a JOIN T AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = b + 1 WHERE 1 RETURNING *;
ALTER TABLE _m DROP COLUMN A;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_5390 ON t1(lower(a)) WHERE a > /* iif(1, {v}, {v}) */ 0;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE d < 0);
PRAGMA full_column_names = TRUE;
SELECT LAG(X, 2) OVER (PARTITION BY X ORDER BY X ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM _m;
WITH cte AS (SELECT a FROM T) SELECT * FROM cte;
INSERT OR FAIL INTO t1 VALUES (NULL, 'x', NULL, 5);
DELETE FROM t1 WHERE b IS NULL RETURNING *;
CREATE  INDEX IF NOT EXISTS idx_T1_3128 ON T1(A COLLATE NOCASE);
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T1_1435 AS SELECT A FROM T1;
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 T1;
INSERT INTO _m SELECT * FROM _m;
CREATE  VIEW IF NOT EXISTS v__m_2373 AS SELECT X FROM _m;
DETACH DATABASE aux9;
INSERT INTO t1 VALUES (NULL, NULL, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T WHERE a = (SELECT SUM(a) FROM T);
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T);
SELECT * FROM _m AS a LEFT JOIN t1 AS b ON a.rowid = b.rowid;
CREATE  VIEW IF NOT EXISTS v_t1_4826 AS SELECT a FROM t1;
WITH cte AS (SELECT CASE WHEN b IS NULL THEN 0 ELSE b END AS val FROM T) SELECT * FROM cte;
ANALYZE;
ALTER TABLE T1 ADD COLUMN extra_313 INT2 DEFAULT '';
SELECT COUNT(*) FILTER (WHERE X IS NOT NULL), SUM(rowid) FILTER (WHERE X > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(X) FILTER (WHERE X > 0 AND X < 100), COUNT(*) FILTER (WHERE typeof(X) = "text") FROM _m;
WITH cte AS (SELECT b FROM T) SELECT * FROM cte;
DELETE FROM t1 WHERE 0 RETURNING *;
INSERT INTO _m SELECT * FROM _m;
SELECT * FROM T WHERE a > ANY (SELECT a FROM T);
VACUUM main;
PRAGMA vdbe_listing = YES;
```

## Actual output

```sql
SQLite version 3.39.0 2022-05-10 23:28:12
Enter ".help" for usage hints.
sqlite> 1
sqlite> sqlite> sqlite> sqlite> sqlite> PRAGMA automatic_index = NO;
sqlite> ATTACH DATABASE ':memory:' AS aux83;
sqlite> BEGIN EXCLUSIVE;
sqlite> CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
sqlite> sqlite> INSERT INTO t1 VALUES (2, 'von', 20, 200);
sqlite> INSERT INTO t1 VALUES (3, 'Braun', 30, 300);
sqlite> CREATE INDEX t1bc ON t1(b, c);
sqlite> PRAGMA writable_schema = ON;
sqlite>    ...>    ...>    ...>    ...> CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
sqlite> INSERT INTO T VALUES ('a', 'p');
sqlite> INSERT INTO T VALUES ('a', 'q');
sqlite> INSERT INTO T VALUES ('b', 'q');
sqlite> INSERT INTO T VALUES ('c', 'r');
sqlite> INSERT INTO T VALUES ('b', 'r');
sqlite> INSERT INTO T VALUES ('b', 't');
sqlite> SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
q|2
r|2
p|1
t|1
sqlite> .imposter t1bc t2
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
WARNING: writing to an imposter table will corrupt the "t1bc" index!
sqlite> 
sqlite> WITH _m AS MATERIALIZED (SELECT * FROM T2) SELECT * FROM t2;
Braun|30|3
von|20|2
sqlite> SELECT b, c FROM t1 ORDER BY b, c;
Braun|30
von|20
sqlite> .quit
```

## Expectation

```sql

```

## Flag

```
-interactive
```

