## 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
.imposter
.progress coalesce(1, 2, 3)
PRAGMA case_sensitive_like = FALSE;
.imposter off
.exit
CREATE TABLE main.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');
WITH _m AS MATERIALIZED (SELECT * FROM `t1`) SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
CREATE TABLE _m(a INTEGER PRIMARY KEY, b);
CREATE VIRTUAL TABLE t2 USING rtree(id,x0,x1);
INSERT INTO t1 VALUES(x'cf0556f859e1f11bad9e','apple'),(2.718281828459045,'fig'),(3,'pear');
INSERT INTO t2 VALUES(1,1.0,2.0),(2,2.0,3.0),(3,1.5,3.5);
CREATE TRIGGER r1 AFTER UPDATE ON t1 BEGIN
  DELETE FROM t2 WHERE NOT NOT (+id = OLD.a) ;
END;
ALTER TABLE t1 RENAME TO t3;
UPDATE t3 SET b='peach' WHERE +a=2;

CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_9781 AS SELECT b FROM t1;
INSERT OR FAIL INTO t1 VALUES ('', -10);
CREATE  INDEX IF NOT EXISTS idx_t1_1008 ON t1(lower(a)) WHERE a > 0;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_1931 AS SELECT b FROM t1;
DROP VIEW IF EXISTS t1;
SELECT MIN(b) OVER (ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
ALTER TABLE T ADD COLUMN extra_6658 VARCHAR(255) DEFAULT 0;
SELECT SUM(A) FROM T;
INSERT INTO T VALUES ('x', NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B;

SELECT COUNT(*) FROM T;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION SELECT x+1 FROM cnt WHERE x<5) SELECT * FROM cnt;
CREATE TRIGGER IF NOT EXISTS trg_T_8153 BEFORE UPDATE OF B ON T BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t1 VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
INSERT INTO T VALUES (NULL, NULL);
ANALYZE T;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c INTEGER
);
INSERT INTO T VALUES (1,'a',NULL), (2,'b',1), (3,'c',2);
WITH RECURSIVE d(a,b,c,e) AS (
  SELECT *,1 FROM T WHERE c IS NULL
  UNION ALL
  SELECT T.a,T.b,T.c,d.e+1
  FROM T JOIN d ON T.c=d.a
)
SELECT * FROM d;
.imposter off
.exit
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;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
CREATE VIRTUAL TABLE t2 USING rtree(id,x0,x1);
INSERT INTO t1 VALUES(x'cf0556f859e1f11bad9e','apple'),(2.718281828459045,'fig'),(3,'pear');
INSERT INTO t2 VALUES(1,1.0,2.0),(2,2.0,3.0),(3,1.5,3.5);
CREATE TRIGGER r1 AFTER UPDATE ON t1 BEGIN
  DELETE FROM t2 WHERE +id = OLD.a;
END;
ALTER TABLE t1 RENAME TO t3;
UPDATE t3 SET b='peach' WHERE a=2;

CREATE	TEMPORARY  VIEW IF NOT EXISTS v_t1_9781 AS SELECT b FROM t1;
INSERT OR FAIL INTO t1 VALUES ('', -10);
CREATE  INDEX IF NOT EXISTS idx_t1_1008 ON t1(lower(a)) WHERE a > 0;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_1931 AS SELECT b FROM t1;
DROP VIEW IF EXISTS t1;
SELECT MIN(b) OVER (ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
ALTER TABLE T ADD COLUMN extra_6658 VARCHAR(255) DEFAULT 0;
SELECT SUM(A) FROM T;
INSERT INTO T VALUES ('x', NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B;

SELECT COUNT(*) FROM T;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION SELECT x+1 FROM cnt WHERE x<5) SELECT * FROM cnt;
CREATE TRIGGER IF NOT EXISTS trg_T_8153 BEFORE UPDATE OF B ON T BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t1 VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
INSERT INTO T VALUES (NULL, NULL);
ANALYZE T;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c INTEGER
);
INSERT INTO T VALUES (1,'a',NULL), (2,'b',1), (3,'c',2);
WITH RECURSIVE d(a,b,c,e) AS (
  SELECT *,1 FROM T WHERE c IS NULL
  UNION ALL
  SELECT T.a,T.b,T.c,d.e+1
  FROM T JOIN d ON T.c=d.a
)
SELECT * FROM d;
.imposter off
.exit
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;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
CREATE VIRTUAL TABLE t2 USING rtree(id,x0,x1);
INSERT INTO t1 VALUES(x'cf0556f859e1f11bad9e','apple'),(2.718281828459045,'fig'),(3,'pear');
INSERT INTO t2 VALUES(1,1.0,2.0),(2,2.0,3.0),(3,1.5,3.5);
CREATE TRIGGER r1 AFTER UPDATE ON t1 BEGIN
  DELETE FROM t2 WHERE +id = OLD.a;
END;
ALTER TABLE t1 RENAME TO t3;
UPDATE t3 SET b='peach' WHERE a=2;

CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_9781 AS SELECT b FROM t1;
INSERT OR FAIL INTO t1 VALUES ('', -10);
CREATE  INDEX IF NOT EXISTS idx_t1_1008 ON t1(lower(a)) WHERE a > 0;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_1931 AS SELECT b FROM t1;
DROP VIEW IF EXISTS t1;
SELECT MIN(b) OVER (ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
ALTER TABLE T ADD COLUMN extra_6658 VARCHAR(255) DEFAULT 0;
SELECT SUM(A) FROM T;
INSERT INTO T VALUES ('x', NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B;

SELECT COUNT(*) FROM T;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION SELECT x+1 FROM cnt WHERE x<5) SELECT * FROM cnt;
CREATE TRIGGER IF NOT EXISTS trg_T_8153 BEFORE UPDATE OF B ON T BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t1 VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
INSERT INTO T VALUES (NULL, NULL);
ANALYZE T;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c INTEGER
);
INSERT INTO T VALUES (1,'a',NULL), (2,'b',1), (3,'c',2);
WITH RECURSIVE d(a,b,c,e) AS (
  SELECT *,1 FROM T WHERE c IS NULL
  UNION ALL
  SELECT T.a,T.b,T.c,d.e+1
  FROM T JOIN d ON T.c=d.a
)
SELECT * FROM d;
.imposter off
.exit
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;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
CREATE VIRTUAL TABLE t2 USING rtree(id,x0,x1);
INSERT INTO t1 VALUES(x'cf0556f859e1f11bad9e','apple'),(2.718281828459045,'fig'),(3,'pear');
INSERT INTO t2 VALUES(1,1.0,2.0),(2,2.0,3.0),(3,1.5,3.5);
CREATE TRIGGER r1 AFTER UPDATE ON t1 BEGIN
  DELETE FROM t2 WHERE +id = OLD.a;
END;
ALTER TABLE t1 RENAME TO t3;
UPDATE t3 SET b='peach' WHERE a=2;

CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_9781 AS SELECT b FROM t1;
INSERT OR FAIL INTO t1 VALUES ('', -10);
CREATE  INDEX IF NOT EXISTS idx_t1_1008 ON t1(lower(a)) WHERE a > 0;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_1931 AS SELECT b FROM t1;
DROP VIEW IF EXISTS t1;
SELECT MIN(b) OVER (ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
ALTER TABLE T ADD COLUMN extra_6658 VARCHAR(255) DEFAULT 0;
SELECT SUM(A) FROM T;
INSERT INTO T VALUES ('x', NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B;

SELECT COUNT(*) FROM T;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION SELECT x+1 FROM cnt WHERE x<5) SELECT * FROM cnt;
CREATE TRIGGER IF NOT EXISTS trg_T_8153 BEFORE UPDATE OF B ON T BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t1 VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
INSERT INTO T VALUES (NULL, NULL);
ANALYZE T;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c INTEGER
);
INSERT INTO T VALUES (1,'a',NULL), (2,'b',1), (3,'c',2);
WITH RECURSIVE d(a,b,c,e) AS (
  SELECT *,1 FROM T WHERE c IS NULL
  UNION ALL
  SELECT T.a,T.b,T.c,d.e+1
  FROM T JOIN d ON T.c=d.a
)
SELECT * FROM d;
.imposter off
.exit
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;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
CREATE VIRTUAL TABLE t2 USING rtree(id,x0,x1);
INSERT INTO t1 VALUES(x'cf0556f859e1f11bad9e','apple'),(2.718281828459045,'fig'),(3,'pear');
INSERT INTO t2 VALUES(1,1.0,2.0),(2,2.0,3.0),(3,1.5,3.5);
CREATE TRIGGER r1 AFTER UPDATE ON t1 BEGIN
  DELETE FROM t2 WHERE +id = OLD.a;
END;
ALTER TABLE t1 RENAME TO t3;
UPDATE t3 SET b='peach' WHERE a=2;

CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_9781 AS SELECT b FROM t1;
INSERT OR FAIL INTO t1 VALUES ('', -10);
CREATE  INDEX IF NOT EXISTS idx_t1_1008 ON t1(lower(a)) WHERE a > 0;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_1931 AS SELECT b FROM t1;
DROP VIEW IF EXISTS t1;
SELECT MIN(b) OVER (ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
ALTER TABLE T ADD COLUMN extra_6658 VARCHAR(255) DEFAULT 0;
SELECT SUM(A) FROM T;
INSERT INTO T VALUES ('x', NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B;

SELECT COUNT(*) FROM T;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION SELECT x+1 FROM cnt WHERE x<5) SELECT * FROM cnt;
CREATE TRIGGER IF NOT EXISTS trg_T_8153 BEFORE UPDATE OF B ON T BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t1 VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
INSERT INTO T VALUES (NULL, NULL);
ANALYZE T;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c INTEGER
);
INSERT INTO T VALUES (1,'a',NULL), (2,'b',1), (3,'c',2);
WITH RECURSIVE d(a,b,c,e) AS (
  SELECT *,1 FROM T WHERE c IS NULL
  UNION ALL
  SELECT T.a,T.b,T.c,d.e+1
  FROM T JOIN d ON T.c=d.a
)
SELECT * FROM d;
.imposter off
.exit
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;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
CREATE VIRTUAL TABLE t2 USING rtree(id,x0,x1);
INSERT INTO t1 VALUES(x'cf0556f859e1f11bad9e','apple'),(2.718281828459045,'fig'),(3,'pear');
INSERT INTO t2 VALUES(1,1.0,2.0),(2,2.0,3.0),(3,1.5,3.5);
CREATE TRIGGER r1 AFTER UPDATE ON t1 BEGIN
  DELETE FROM t2 WHERE +id = OLD.a;
END;
ALTER TABLE t1 RENAME TO t3;
UPDATE t3 SET b='peach' WHERE a=2;

CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_9781 AS SELECT b FROM t1;
INSERT OR FAIL INTO t1 VALUES ('', -10);
CREATE  INDEX IF NOT EXISTS idx_t1_1008 ON t1(lower(a)) WHERE a > 0;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_1931 AS SELECT b FROM t1;
DROP VIEW IF EXISTS t1;
SELECT MIN(b) OVER (ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
ALTER TABLE T ADD COLUMN extra_6658 VARCHAR(255) DEFAULT 0;
SELECT SUM(A) FROM T;
INSERT INTO T VALUES ('x', NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B;

SELECT COUNT(*) FROM T;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION SELECT x+1 FROM cnt WHERE x<5) SELECT * FROM cnt;
CREATE TRIGGER IF NOT EXISTS trg_T_8153 BEFORE UPDATE OF B ON T BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t1 VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
INSERT INTO T VALUES (NULL, NULL);
ANALYZE T;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c INTEGER
);
INSERT INTO T VALUES (1,'a',NULL), (2,'b',1), (3,'c',2);
WITH RECURSIVE d(a,b,c,e) AS (
  SELECT *,1 FROM T WHERE c IS NULL
  UNION ALL
  SELECT T.a,T.b,T.c,d.e+1
  FROM T JOIN d ON T.c=d.a
)
SELECT * FROM d;

DELETE FROM T WHERE 0;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<1) SELECT * FROM cnt;
ALTER TABLE _m RENAME TO _m_r4682;
ALTER TABLE T RENAME COLUMN c TO c_r1074;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM T;
SELECT COUNT(*) FROM T;
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 _m;
SELECT * FROM t1 WHERE b = (SELECT COUNT(*) FROM t1);
INSERT OR IGNORE INTO t1 VALUES ('x', '');
INSERT INTO _m VALUES (NULL, NULL);
INSERT OR FAIL INTO T VALUES (-6, 'x', '');
WITH cte AS (SELECT * FROM T WHERE a IN (SELECT a FROM T LIMIT 5)) SELECT * FROM cte;
DELETE FROM t1 WHERE 1;
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;
ALTER TABLE t1 RENAME COLUMN a TO a_r4258;
ANALYZE;
UPDATE T SET b = b + 1 WHERE b IS NOT NULL;
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 T;
INSERT OR REPLACE INTO t1 VALUES ('', 9);
PRAGMA reverse_unordered_selects = YES;
```

## Actual output

```sql
Usage: /home/test/sqlite3-src/build/sqlite3 [OPTIONS] FILENAME [SQL]
FILENAME is the name of an SQLite database. A new database is created
if the file does not previously exist.
OPTIONS include:
   -append              append the database to the end of the file
   -ascii               set output mode to 'ascii'
   -bail                stop after hitting an error
   -batch               force batch I/O
   -box                 set output mode to 'box'
   -column              set output mode to 'column'
   -cmd COMMAND         run "COMMAND" before reading stdin
   -csv                 set output mode to 'csv'
   -deserialize         open the database using sqlite3_deserialize()
   -echo                print commands before execution
   -init FILENAME       read/process named file
   -[no]header          turn headers on or off
   -help                show this message
   -html                set output mode to HTML
   -interactive         force interactive I/O
   -json                set output mode to 'json'
   -line                set output mode to 'line'
   -list                set output mode to 'list'
   -lookaside SIZE N    use N entries of SZ bytes for lookaside memory
   -markdown            set output mode to 'markdown'
   -maxsize N           maximum size for a --deserialize database
   -memtrace            trace all memory allocations and deallocations
   -mmap N              default mmap size set to N
   -newline SEP         set output row separator. Default: '\n'
   -nofollow            refuse to open symbolic links to database files
   -nonce STRING        set the safe-mode escape nonce
   -nullvalue TEXT      set text string for NULL values. Default ''
   -pagecache SIZE N    use N slots of SZ bytes each for page cache memory
   -quote               set output mode to 'quote'
   -readonly            open the database read-only
   -safe                enable safe-mode
   -separator SEP       set output column separator. Default: '|'
   -stats               print memory stats before each finalize
   -table               set output mode to 'table'
   -tabs                set output mode to 'tabs'
   -version             show SQLite version
   -vfs NAME            use NAME as the default VFS
```

## Expectation

```sql

```

## Flag

```
-help
```

