## 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 TRANSACTION;
PRAGMA case_sensitive_like = TRUE;
PRAGMA cache_spill = OFF;
.imposter off
SAVEPOINT sp279;
SAVEPOINT sp9047;
.echo on
SAVEPOINT sp6832;
.stats
ATTACH DATABASE '' || (':memory:') AS aux65;
-- PRAGMA pragma_list;
SAVEPOINT sp5608;
.check
PRAGMA fullsync != ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOt EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE [T1] (
  A VARCHAR(nullif(-(-(sinh(-(-(abs(-unistr(-(-(NULL))))))))), 'same')),
  X VARCHAR(cosh(julianday(lower(x'f4fdf1540342803d217b120f')))),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(date(x'9db076', 'start of month')),
  Y VARCHAR(jsonb_set(2147483647, '$.key', 2147483647)) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE NOT NOT (b IS NOT NULL UNION ALL SELECT b FROM r WHERE +b > 1) LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOT EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE +b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOT EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
DETACH DATABASE aux65;
ANALYZE t0;
CREATE TRIGGER IF NOT EXISTS trg_t1_664 BEFORE DELETE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(b) VALUES (NULL); END;
INSERT INTO t1 DEFAULT VALUES;
ANALYZE;
CREATE  VIEW IF NOT EXISTS v_t0_3180 AS SELECT z FROM t0;
INSERT INTO T1 VALUES (1, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, X = excluded.X;
REINDEX t1;
INSERT INTO T1 DEFAULT VALUES;
INSERT OR FAIL INTO T1 VALUES (-5, '');
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE a >= 2 ORDER BY b;
SELECT SUM(b) FROM t1;
WITH a AS (SELECT a FROM t1), b AS (SELECT a FROM a), c AS (SELECT a FROM b) SELECT * FROM c;
INSERT INTO T2 SELECT * FROM T2;
INSERT INTO T1 VALUES (NULL, 1) ON CONFLICT(A) DO UPDATE SET A = excluded.A, X = excluded.X;
UPDATE T2 SET Y = json_object('k', Y) WHERE rowid = 1;
ALTER TABLE T1 DROP COLUMN A;
SELECT * FROM t0 AS a JOIN T2 AS b ON a.rowid = b.rowid;
ROLLBACK TRANSACTION TO SAVEPOINT sp6832;
RELEASE SAVEPOINT sp6832;
SELECT * FROM T2 WHERE Y IN (SELECT Y FROM T2 WHERE 1/0 = 0);SELECT * FROM T2 WHERE Y IN (SELECT Y FROM T2 LIMIT -1);
INSERT INTO T1 SELECT * FROM T1;
INSERT INTO T2 DEFAULT VALUES;
INSERT INTO T1 VALUES (NULL, NULL);
ALTER TABLE t1 ADD COLUMN extra_3291 DATETIME DEFAULT '';
SAVEPOINT sp6832;
.stats
ATTACH DATABASE ':memory:' AS aux65;
-- PRAGMA pragma_list;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOt EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE [T1] (
  A VARCHAR(nullif(-(-(sinh(-(-(abs(-9223372036854775807)))))), 'same')),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY  a, abs(b);
CREATE TRIGGER IF NOT EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOT EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
DETACH DATABASE aux65;
ANALYZE t0;
CREATE TRIGGER IF NOT EXISTS trg_t1_664 BEFORE DELETE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(b) VALUES (NULL); END;
INSERT INTO t1 DEFAULT VALUES;
ANALYZE;
CREATE  VIEW IF NOT EXISTS v_t0_3180 AS SELECT z FROM t0;
INSERT INTO T1 VALUES (1, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, X = excluded.X;
REINDEX t1;
INSERT INTO T1 DEFAULT VALUES;
INSERT OR FAIL INTO T1 VALUES (-5, '');
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE a >= 2 ORDER BY b;
SELECT SUM(b) FROM t1;
WITH a AS (SELECT a FROM t1), b AS (SELECT a FROM a), c AS (SELECT a FROM b) SELECT * FROM c;
INSERT INTO T2 SELECT * FROM T2;
INSERT INTO T1 VALUES (NULL, 1) ON CONFLICT(A) DO UPDATE SET A = excluded.A, X = excluded.X;
UPDATE T2 SET Y = json_object('k', Y) WHERE rowid = 1;
ALTER TABLE T1 DROP COLUMN A;
SELECT * FROM t0 AS a JOIN T2 AS b ON a.rowid = b.rowid;
ROLLBACK TRANSACTION TO SAVEPOINT sp6832;
RELEASE SAVEPOINT sp6832;
SELECT * FROM T2 WHERE Y IN (SELECT Y FROM T2 WHERE 1/0 = 0);SELECT * FROM T2 WHERE Y IN (SELECT Y FROM T2 LIMIT -1);
INSERT INTO T1 SELECT * FROM T1;
INSERT INTO T2 DEFAULT VALUES;
INSERT INTO T1 VALUES (NULL, NULL);
ALTER TABLE t1 ADD COLUMN extra_3291 DATETIME DEFAULT '';
SAVEPOINT sp6832;
.stats
ATTACH DATABASE ':memory:' AS aux65;
-- PRAGMA pragma_list;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOt EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE [T1] (
  A VARCHAR(nullif(-(-(sinh(-(-(abs(-9223372036854775807)))))), 'same')),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOT EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOT EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
DETACH DATABASE aux65;
ANALYZE t0;
CREATE TRIGGER IF NOT EXISTS trg_t1_664 BEFORE DELETE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(b) VALUES (NULL); END;
INSERT INTO t1 DEFAULT VALUES;
ANALYZE;
CREATE  VIEW IF NOT EXISTS v_t0_3180 AS SELECT z FROM t0;
INSERT INTO T1 VALUES (1, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, X = excluded.X;
REINDEX t1;
INSERT INTO T1 DEFAULT VALUES;
INSERT OR FAIL INTO T1 VALUES (-5, '');
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE a >= 2 ORDER BY b;
SELECT SUM(b) FROM t1;
WITH a AS (SELECT a FROM t1), b AS (SELECT a FROM a), c AS (SELECT a FROM b) SELECT * FROM c;
INSERT INTO T2 SELECT * FROM T2;
INSERT INTO T1 VALUES (NULL, 1) ON CONFLICT(A) DO UPDATE SET A = excluded.A, X = excluded.X;
UPDATE T2 SET Y = json_object('k', Y) WHERE rowid = 1;
ALTER TABLE T1 DROP COLUMN A;
SELECT * FROM t0 AS a JOIN T2 AS b ON a.rowid = b.rowid;
ROLLBACK TRANSACTION TO SAVEPOINT sp6832;
RELEASE SAVEPOINT sp6832;
SELECT * FROM T2 WHERE Y IN (SELECT Y FROM T2 WHERE 1/0 = 0);SELECT * FROM T2 WHERE Y IN (SELECT Y FROM T2 LIMIT -1);
INSERT INTO T1 SELECT * FROM T1;
INSERT INTO T2 DEFAULT VALUES;
INSERT INTO T1 VALUES (NULL, NULL);
ALTER TABLE t1 ADD COLUMN extra_3291 DATETIME DEFAULT '';

ALTER TABLE t0 DROP COLUMN y;
ROLLBACK TO sp9047;
RELEASE sp9047;
ROLLBACK TRANSACTION TO SAVEPOINT sp279;
RELEASE SAVEPOINT sp279;
CREATE TEMP  VIEW IF NOT EXISTS v_t0_9813 AS SELECT z FROM t0;
ANALYZE T2;
CREATE TRIGGER IF NOT EXISTS trg_T_6213 AFTER DELETE ON T BEGIN INSERT INTO T(a) VALUES (NULL); END;
INSERT INTO t1 VALUES (NULL, NULL);
ALTER TABLE t0 ADD COLUMN extra_179 CHARACTER(20) COLLATE NOCASE;
ALTER TABLE t0 ADD COLUMN extra_7080 FLOA DEFAULT (random());
CREATE  INDEX IF NOT EXISTS idx_t0_8326 ON t0((z + 1)) WHERE z 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 t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_7120 AS SELECT a FROM T;
SELECT * FROM t0 WHERE y = (SELECT MAX(y) FROM t0 WHERE y = (SELECT MAX(y) FROM t0));
DROP TRIGGER IF EXISTS T2;
PRAGMA threads;
INSERT INTO t0 VALUES ('x', NULL, 1) ON CONFLICT(x) DO UPDATE SET x = excluded.x, y = excluded.y, z = excluded.z;
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b',1.0), ('a','c',-1.0), ('b','d',0.0);
SELECT
COALESCE(a,'e') AS d,
COALESCE(b,'f') AS e,
SUM(c) AS f
FROM T
GROUP BY a,b;
CREATE  VIEW IF NOT EXISTS v_T1_7206 AS SELECT X FROM T1;
INSERT OR FAIL INTO T1 VALUES ('x', 0);
CREATE TRIGGER IF NOT EXISTS trg_t1_7792 BEFORE INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T1 VALUES (NULL, 'x');
CREATE TRIGGER IF NOT EXISTS trg_T_1524 BEFORE UPDATE OF b ON T FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
VACUUM;
DELETE FROM t1 WHERE b IS NULL RETURNING *;
ALTER TABLE T RENAME COLUMN a TO a_r5583;
UPDATE T1 SET X = X + 1 WHERE X IS NOT NULL RETURNING *;
INSERT INTO T2 DEFAULT VALUES;
UPDATE T1 SET A = A + 1 WHERE A IS NOT NULL RETURNING *;
PRAGMA recursive_triggers = 0;
DROP TRIGGER IF EXISTS T2;
UPDATE T SET c = c + 1 WHERE c BETWEEN 0 AND 100;
UPDATE t1 SET a = CURRENT_TIMESTAMP WHERE a BETWEEN 0 AND 100;
ANALYZE;
ALTER TABLE t0 RENAME TO t0_r8330;
INSERT OR IGNORE INTO t1 VALUES (NULL, '');
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 t1;
PRAGMA trusted_schema;
ALTER TABLE t1 RENAME TO t1_r5316;
INSERT INTO t0 SELECT * FROM t0;
CREATE TABLE T (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) NOT NULL,
  C DOUBLE PRECISION
);
INSERT INTO T VALUES ('a', 'p', -1.7976931348623157e+308);
INSERT INTO T VALUES ('b', 'q', -0.000000001);
INSERT INTO T VALUES ('c', 'r', 0.0);
INSERT INTO T VALUES ('d', 's', 3.14159265358979);
INSERT INTO T VALUES ('e', 't', 1.7976931348623157e+308);
INSERT INTO T VALUES ('f', 't', 750.25);
SELECT B, AVG(C) AS D, MIN(C) AS E, MAX(C) AS F FROM T GROUP BY B;
WITH cte(a, b, c) AS (SELECT C, C, C FROM T) SELECT a, b, c FROM cte;
CREATE TRIGGER IF NOT EXISTS trg_T2_1850 AFTER UPDATE OF A ON T2 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO T1 DEFAULT VALUES;
ALTER TABLE t0 RENAME TO t0_r9779;
COMMIT TRANSACTION;
SELECT * FROM t0;
SELECT LAG(B, 1, NULL) OVER (ORDER BY B ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM T;
```

## Actual output

```sql
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA case_sensitive_like = TRUE;
PRAGMA cache_spill = OFF;
.imposter off
SAVEPOINT sp279;
SAVEPOINT sp9047;
.echo on
SAVEPOINT sp6832;
.stats
Memory Used:                         68544 (max 68544) bytes
Number of Outstanding Allocations:   126 (max 126)
Number of Pcache Overflow Bytes:     8464 (max 8464) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                37 (max 41)
Successful lookaside attempts:       62
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    9248 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   0 bytes
Statement Heap/Lookaside Usage:      0 bytes
Bytes received by read():            10665
Bytes sent to write():               166
Read() system calls:                 14
Write() system calls:                8
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
ATTACH DATABASE '' || (':memory:') AS aux65;
-- PRAGMA pragma_list;
SAVEPOINT sp5608;
.check
```

## Expectation

```sql
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA case_sensitive_like = TRUE;
PRAGMA cache_spill = OFF;
.imposter off
SAVEPOINT sp279;
SAVEPOINT sp9047;
.echo on
SAVEPOINT sp6832;
.stats
Memory Used:                         69360 (max 69360) bytes
Number of Outstanding Allocations:   136 (max 136)
Number of Pcache Overflow Bytes:     8472 (max 8472) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                53 (max 57)
Successful lookaside attempts:       78
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    9256 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   0 bytes
Statement Heap/Lookaside Usage:      0 bytes
Bytes received by read():            11185
Bytes sent to write():               173
Read() system calls:                 14
Write() system calls:                9
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
ATTACH DATABASE '' || (':memory:') AS aux65;
-- PRAGMA pragma_list;
SAVEPOINT sp5608;
.check
```

## Flag

```
-echo
```

