## 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
ATTACH DATABASE ':memory:' AS aux57;
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))/round(-9223372036854775809)
  AS INTEGER
) AS c
FROM T;
PRAGMA vdbe_debug = OFF;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (-(-(timediff(-instr(NULL, NULL), 6905746167837027873))), 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', /* if(0, {v}, 0, {v}) */ 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)))) application_id = ',';
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (-NULL,json_valid(1.5, 6)), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
PRAGMA read_uncommitted = FALSE;
WITH cte AS (SELECT b FROM T UNION SELECT b FROM T) SELECT * FROM cte;
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;

SELECT COUNT(*) FROM T;
INSERT INTO T VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
SELECT * FROM T;
PRAGMA query_only;
ALTER TABLE T RENAME TO T_r407;
UPDATE T SET a = NULL WHERE 1;
ALTER TABLE T RENAME COLUMN b TO b_r5239;
ALTER TABLE T DROP COLUMN b;
ALTER TABLE T ADD COLUMN extra_7854 DATETIME DEFAULT NULL;
SELECT * FROM (SELECT * FROM t1) AS t1 JOIN (SELECT * FROM t1) AS t2 ON t1.b = t2.b;
END;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
SELECT b,a,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
SELECT * FROM T WHERE b <= ANY (SELECT b FROM T);
VACUUM main;
ANALYZE T;
SELECT LAG(c, c) OVER (ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
REINDEX T;
INSERT INTO T DEFAULT VALUES;
PRAGMA query_only = OFF;
WITH cte(a, b) AS (VALUES(1, "a"),(2, "b"),(3, "c")) SELECT * FROM cte;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_3010 ON t1(a) WHERE
a > 0;
ANALYZE;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE 1/0 = 0);SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 LIMIT -1);
VACUUM;
ALTER TABLE t1 RENAME TO t1_r1192;
DROP TRIGGER IF EXISTS T;
WITH cte AS (SELECT * FROM T WHERE c IN (SELECT c FROM T LIMIT 5)) SELECT * FROM cte;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T) RETURNING *;
SELECT * FROM (SELECT * FROM T ORDER BY b) AS sub LIMIT 10;
PRAGMA data_version;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
ALTER TABLE T ADD COLUMN extra_7767 DOUB DEFAULT 0;
SELECT * FROM T2 CROSS JOIN T2;
UPDATE T1 SET X = 'x' WHERE 1;
ALTER TABLE T1 DROP COLUMN A;
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))/round(-9223372036854775809)
  AS INTEGER
) AS c
FROM T;
PRAGMA vdbe_debug = OFF;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (-(-(timediff(-instr(NULL, NULL), 6905746167837027873))), 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', /* if(0, {v}, 0, {v}) */ 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)))) application_id = ',';
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (-NULL,json_valid(1.5, 6)), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
PRAGMA read_uncommitted = FALSE;
WITH cte AS (SELECT b FROM T UNION SELECT b FROM T) SELECT * FROM cte;
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;

SELECT COUNT(*) FROM T;
INSERT INTO T VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
SELECT * FROM T;
PRAGMA query_only;
ALTER TABLE T RENAME TO T_r407;
UPDATE T SET a = NULL WHERE 1;
ALTER TABLE T RENAME COLUMN b TO b_r5239;
ALTER TABLE T DROP COLUMN b;
ALTER TABLE T ADD COLUMN extra_7854 DATETIME DEFAULT NULL;
SELECT * FROM (SELECT * FROM t1) AS t1 JOIN (SELECT * FROM t1) AS t2 ON t1.b = t2.b;
END;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
SELECT b,a,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
SELECT * FROM T WHERE b <= ANY (SELECT b FROM T);
VACUUM main;
ANALYZE T;
SELECT LAG(c, c) OVER (ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
REINDEX T;
INSERT INTO T DEFAULT VALUES;
PRAGMA query_only = OFF;
WITH cte(a, b) AS (VALUES(1, "a"),(2, "b"),(3, "c")) SELECT * FROM cte;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_3010 ON t1(a) WHERE
a > 0;
ANALYZE;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE 1/0 = 0);SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 LIMIT -1);
VACUUM;
ALTER TABLE t1 RENAME TO t1_r1192;
DROP TRIGGER IF EXISTS T;
WITH cte AS (SELECT * FROM T WHERE c IN (SELECT c FROM T LIMIT 5)) SELECT * FROM cte;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T) RETURNING *;
SELECT * FROM (SELECT * FROM T ORDER BY b) AS sub LIMIT 10;
PRAGMA data_version;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
ALTER TABLE T ADD COLUMN extra_7767 DOUB DEFAULT 0;
SELECT * FROM T2 CROSS JOIN T2;
UPDATE T1 SET X = 'x' WHERE 1;
ALTER TABLE T1 DROP COLUMN A;
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))/round(-9223372036854775809)
  AS INTEGER
) AS c
FROM T;
PRAGMA vdbe_debug = OFF;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (-(-(timediff(-instr(NULL, NULL), 6905746167837027873))), 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', /* if(0, {v}, 0, {v}) */ 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)))) application_id = ',';
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (-NULL,json_valid(1.5, 6)), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
PRAGMA read_uncommitted = FALSE;
WITH cte AS (SELECT b FROM T UNION SELECT b FROM T) SELECT * FROM cte;
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;

SELECT COUNT(*) FROM T;
INSERT INTO T VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
SELECT * FROM T;
PRAGMA query_only;
ALTER TABLE T RENAME TO T_r407;
UPDATE T SET a = NULL WHERE 1;
ALTER TABLE T RENAME COLUMN b TO b_r5239;
ALTER TABLE T DROP COLUMN b;
ALTER TABLE T ADD COLUMN extra_7854 DATETIME DEFAULT NULL;
SELECT * FROM (SELECT * FROM t1) AS t1 JOIN (SELECT * FROM t1) AS t2 ON t1.b = t2.b;
END;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
SELECT b,a,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
SELECT * FROM T WHERE b <= ANY (SELECT b FROM T);
VACUUM main;
ANALYZE T;
SELECT LAG(c, c) OVER (ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
REINDEX T;
INSERT INTO T DEFAULT VALUES;
PRAGMA query_only = OFF;
WITH cte(a, b) AS (VALUES(1, "a"),(2, "b"),(3, "c")) SELECT * FROM cte;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_3010 ON t1(a) WHERE
a > 0;
ANALYZE;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE 1/0 = 0);SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 LIMIT -1);
VACUUM;
ALTER TABLE t1 RENAME TO t1_r1192;
DROP TRIGGER IF EXISTS T;
WITH cte AS (SELECT * FROM T WHERE c IN (SELECT c FROM T LIMIT 5)) SELECT * FROM cte;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T) RETURNING *;
SELECT * FROM (SELECT * FROM T ORDER BY b) AS sub LIMIT 10;
PRAGMA data_version;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
ALTER TABLE T ADD COLUMN extra_7767 DOUB DEFAULT 0;
SELECT * FROM T2 CROSS JOIN T2;
UPDATE T1 SET X = 'x' WHERE 1;
ALTER TABLE T1 DROP COLUMN A;
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))/round(-9223372036854775809)
  AS INTEGER
) AS c
FROM T;
PRAGMA vdbe_debug = OFF;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (-(-(timediff(-instr(NULL, NULL), 6905746167837027873))), 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', /* if(0, {v}, 0, {v}) */ 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)))) application_id = ',';
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (-NULL,json_valid(1.5, 6)), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
PRAGMA read_uncommitted = FALSE;
WITH cte AS (SELECT b FROM T UNION SELECT b FROM T) SELECT * FROM cte;
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;

SELECT COUNT(*) FROM T;
INSERT INTO T VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
SELECT * FROM T;
PRAGMA query_only;
ALTER TABLE T RENAME TO T_r407;
UPDATE T SET a = NULL WHERE 1;
ALTER TABLE T RENAME COLUMN b TO b_r5239;
ALTER TABLE T DROP COLUMN b;
ALTER TABLE T ADD COLUMN extra_7854 DATETIME DEFAULT NULL;
SELECT * FROM (SELECT * FROM t1) AS t1 JOIN (SELECT * FROM t1) AS t2 ON t1.b = t2.b;
END;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
SELECT b,a,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
SELECT * FROM T WHERE b <= ANY (SELECT b FROM T);
VACUUM main;
ANALYZE T;
SELECT LAG(c, c) OVER (ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
REINDEX T;
INSERT INTO T DEFAULT VALUES;
PRAGMA query_only = OFF;
WITH cte(a, b) AS (VALUES(1, "a"),(2, "b"),(3, "c")) SELECT * FROM cte;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_3010 ON t1(a) WHERE
a > 0;
ANALYZE;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE 1/0 = 0);SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 LIMIT -1);
VACUUM;
ALTER TABLE t1 RENAME TO t1_r1192;
DROP TRIGGER IF EXISTS T;
WITH cte AS (SELECT * FROM T WHERE c IN (SELECT c FROM T LIMIT 5)) SELECT * FROM cte;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T) RETURNING *;
SELECT * FROM (SELECT * FROM T ORDER BY b) AS sub LIMIT 10;
PRAGMA data_version;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
ALTER TABLE T ADD COLUMN extra_7767 DOUB DEFAULT 0;
SELECT * FROM T2 CROSS JOIN T2;
UPDATE T1 SET X = 'x' WHERE 1;
ALTER TABLE T1 DROP COLUMN A;
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))/round(-9223372036854775809)
  AS INTEGER
) AS c
FROM T;
PRAGMA vdbe_debug = OFF;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (-(-(timediff(-instr(NULL, NULL), 6905746167837027873))), 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', /* if(0, {v}, 0, {v}) */ 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)))) application_id = ',';
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (-NULL,json_valid(1.5, 6)), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
PRAGMA read_uncommitted = FALSE;
WITH cte AS (SELECT b FROM T UNION SELECT b FROM T) SELECT * FROM cte;
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;

SELECT COUNT(*) FROM T;
INSERT INTO T VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
SELECT * FROM T;
PRAGMA query_only;
ALTER TABLE T RENAME TO T_r407;
UPDATE T SET a = NULL WHERE 1;
ALTER TABLE T RENAME COLUMN b TO b_r5239;
ALTER TABLE T DROP COLUMN b;
ALTER TABLE T ADD COLUMN extra_7854 DATETIME DEFAULT NULL;
SELECT * FROM (SELECT * FROM t1) AS t1 JOIN (SELECT * FROM t1) AS t2 ON t1.b = t2.b;
END;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
SELECT b,a,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
SELECT * FROM T WHERE b <= ANY (SELECT b FROM T);
VACUUM main;
ANALYZE T;
SELECT LAG(c, c) OVER (ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
REINDEX T;
INSERT INTO T DEFAULT VALUES;
PRAGMA query_only = OFF;
WITH cte(a, b) AS (VALUES(1, "a"),(2, "b"),(3, "c")) SELECT * FROM cte;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_3010 ON t1(a) WHERE
a > 0;
ANALYZE;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE 1/0 = 0);SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 LIMIT -1);
VACUUM;
ALTER TABLE t1 RENAME TO t1_r1192;
DROP TRIGGER IF EXISTS T;
WITH cte AS (SELECT * FROM T WHERE c IN (SELECT c FROM T LIMIT 5)) SELECT * FROM cte;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T) RETURNING *;
SELECT * FROM (SELECT * FROM T ORDER BY b) AS sub LIMIT 10;
PRAGMA data_version;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
ALTER TABLE T ADD COLUMN extra_7767 DOUB DEFAULT 0;
SELECT * FROM T2 CROSS JOIN T2;
UPDATE T1 SET X = 'x' WHERE 1;
ALTER TABLE T1 DROP COLUMN A;
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))/round(-9223372036854775809)
  AS INTEGER
) AS c
FROM T;
PRAGMA vdbe_debug = OFF;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (-(-(timediff(-instr(NULL, NULL), 6905746167837027873))), 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', /* if(0, {v}, 0, {v}) */ 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)))) application_id = ',';
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (-NULL,json_valid(1.5, 6)), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
PRAGMA read_uncommitted = FALSE;
WITH cte AS (SELECT b FROM T UNION SELECT b FROM T) SELECT * FROM cte;
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;

SELECT COUNT(*) FROM T;
INSERT INTO T VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
SELECT * FROM T;
PRAGMA query_only;
ALTER TABLE T RENAME TO T_r407;
UPDATE T SET a = NULL WHERE 1;
ALTER TABLE T RENAME COLUMN b TO b_r5239;
ALTER TABLE T DROP COLUMN b;
ALTER TABLE T ADD COLUMN extra_7854 DATETIME DEFAULT NULL;
SELECT * FROM (SELECT * FROM t1) AS t1 JOIN (SELECT * FROM t1) AS t2 ON t1.b = t2.b;
END;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
SELECT b,a,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
SELECT * FROM T WHERE b <= ANY (SELECT b FROM T);
VACUUM main;
ANALYZE T;
SELECT LAG(c, c) OVER (ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
REINDEX T;
INSERT INTO T DEFAULT VALUES;
PRAGMA query_only = OFF;
WITH cte(a, b) AS (VALUES(1, "a"),(2, "b"),(3, "c")) SELECT * FROM cte;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_3010 ON t1(a) WHERE
a > 0;
ANALYZE;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE 1/0 = 0);SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 LIMIT -1);
VACUUM;
ALTER TABLE t1 RENAME TO t1_r1192;
DROP TRIGGER IF EXISTS T;
WITH cte AS (SELECT * FROM T WHERE c IN (SELECT c FROM T LIMIT 5)) SELECT * FROM cte;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T) RETURNING *;
SELECT * FROM (SELECT * FROM T ORDER BY b) AS sub LIMIT 10;
PRAGMA data_version;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
ALTER TABLE T ADD COLUMN extra_7767 DOUB DEFAULT 0;
SELECT * FROM T2 CROSS JOIN T2;
UPDATE T1 SET X = 'x' WHERE 1;
ALTER TABLE T1 DROP COLUMN A;
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))/round(-9223372036854775809)
  AS INTEGER
) AS c
FROM T;
PRAGMA vdbe_debug = OFF;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (-(-(timediff(-instr(NULL, NULL), 6905746167837027873))), 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', /* if(0, {v}, 0, {v}) */ 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)))) application_id = ',';
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (-NULL,json_valid(1.5, 6)), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
PRAGMA read_uncommitted = FALSE;
WITH cte AS (SELECT b FROM T UNION SELECT b FROM T) SELECT * FROM cte;
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;

SELECT COUNT(*) FROM T;
INSERT INTO T VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
SELECT * FROM T;
PRAGMA query_only;
ALTER TABLE T RENAME TO T_r407;
UPDATE T SET a = NULL WHERE 1;
ALTER TABLE T RENAME COLUMN b TO b_r5239;
ALTER TABLE T DROP COLUMN b;
ALTER TABLE T ADD COLUMN extra_7854 DATETIME DEFAULT NULL;
SELECT * FROM (SELECT * FROM t1) AS t1 JOIN (SELECT * FROM t1) AS t2 ON t1.b = t2.b;
END;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
SELECT b,a,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
SELECT * FROM T WHERE b <= ANY (SELECT b FROM T);
VACUUM main;
ANALYZE T;
SELECT LAG(c, c) OVER (ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
REINDEX T;
INSERT INTO T DEFAULT VALUES;
PRAGMA query_only = OFF;
WITH cte(a, b) AS (VALUES(1, "a"),(2, "b"),(3, "c")) SELECT * FROM cte;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_3010 ON t1(a) WHERE
a > 0;
ANALYZE;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE 1/0 = 0);SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 LIMIT -1);
VACUUM;
ALTER TABLE t1 RENAME TO t1_r1192;
DROP TRIGGER IF EXISTS T;
WITH cte AS (SELECT * FROM T WHERE c IN (SELECT c FROM T LIMIT 5)) SELECT * FROM cte;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T) RETURNING *;
SELECT * FROM (SELECT * FROM T ORDER BY b) AS sub LIMIT 10;
PRAGMA data_version;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
ALTER TABLE T ADD COLUMN extra_7767 DOUB DEFAULT 0;
SELECT * FROM T2 CROSS JOIN T2;
UPDATE T1 SET X = 'x' WHERE 1;
ALTER TABLE T1 DROP COLUMN A;
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))/round(-9223372036854775809)
  AS INTEGER
) AS c
FROM T;
PRAGMA vdbe_debug = OFF;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (-(-(timediff(-instr(NULL, NULL), 6905746167837027873))), 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', /* if(0, {v}, 0, {v}) */ 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)))) application_id = ',';
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (-NULL,json_valid(1.5, 6)), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
PRAGMA read_uncommitted = FALSE;
WITH cte AS (SELECT b FROM T UNION SELECT b FROM T) SELECT * FROM cte;
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;

SELECT COUNT(*) FROM T;
INSERT INTO T VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
SELECT * FROM T;
PRAGMA query_only;
ALTER TABLE T RENAME TO T_r407;
UPDATE T SET a = NULL WHERE 1;
ALTER TABLE T RENAME COLUMN b TO b_r5239;
ALTER TABLE T DROP COLUMN b;
ALTER TABLE T ADD COLUMN extra_7854 DATETIME DEFAULT NULL;
SELECT * FROM (SELECT * FROM t1) AS t1 JOIN (SELECT * FROM t1) AS t2 ON t1.b = t2.b;
END;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
SELECT b,a,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
SELECT * FROM T WHERE b <= ANY (SELECT b FROM T);
VACUUM main;
ANALYZE T;
SELECT LAG(c, c) OVER (ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
REINDEX T;
INSERT INTO T DEFAULT VALUES;
PRAGMA query_only = OFF;
WITH cte(a, b) AS (VALUES(1, "a"),(2, "b"),(3, "c")) SELECT * FROM cte;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_3010 ON t1(a) WHERE
a > 0;
ANALYZE;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE 1/0 = 0);SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 LIMIT -1);
VACUUM;
ALTER TABLE t1 RENAME TO t1_r1192;
DROP TRIGGER IF EXISTS T;
WITH cte AS (SELECT * FROM T WHERE c IN (SELECT c FROM T LIMIT 5)) SELECT * FROM cte;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T) RETURNING *;
SELECT * FROM (SELECT * FROM T ORDER BY b) AS sub LIMIT 10;
PRAGMA data_version;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
ALTER TABLE T ADD COLUMN extra_7767 DOUB DEFAULT 0;
SELECT * FROM T2 CROSS JOIN T2;
UPDATE T1 SET X = 'x' WHERE 1;
ALTER TABLE T1 DROP COLUMN A;

SELECT * FROM (SELECT a FROM T WHERE a IS NOT NULL) AS sub;
DETACH DATABASE aux57;
```

## Actual output

```sql
a|0
b|0
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
von|20|2
Braun|30
von|20
```

## Expectation

```sql

```

## Flag

```

```

