## 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
PRAGMA synchronous = '' || ('3');
PRAGMA wal_checkpoint('PASSIVE');
-- NTH_VALUE({c}, 2)

CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
-- -nullvalue "NU11"

INSERT INTO T VALUES (atan2(1, 1),2.0,10.5), (1,-3.5,20.25), (2,9e999,-1.0);
WITH d AS (SELECT a,SUM(b*c) AS e FROM T GROUP BY a) SELECT * FROM d;
BEGIN EXCLUSIVE;
ATTACH DATABASE ':memory:' AS aux19;
CREATE TABLE t1(a DATETIME PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (substr(ceiling((-(-(1)) * 1)), 100), ('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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
UPDATE T SET b = json_object('k', b) WHERE 1;
UPDATE t2 SET b = 'x' WHERE b BETWEEN 0 AND 100;
CREATE  VIEW IF NOT EXISTS v_t2_1374 AS SELECT a FROM t2;
SELECT * FROM (SELECT * FROM t2) AS t1 JOIN (SELECT * FROM t2) AS t2 ON t1.b = t2.b;
SELECT GROUP_CONCAT(x) FROM t920;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_2418 ON t2(lower(a)) WHERE a IS NOT NULL;
CREATE TABLE t1(a DATETIME PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (substr(1, 100), ('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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * /* json_tree({v}, '$.obj') */ FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) /**/ AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
UPDATE T SET b = json_object('k', b) WHERE 1;
UPDATE t2 SET b = 'x' WHERE b BETWEEN 0 AND 100;
CREATE  VIEW IF NOT EXISTS v_t2_1374 AS SELECT a FROM t2;
SELECT * FROM (SELECT * FROM t2) AS t1 JOIN (SELECT * FROM t2) AS t2 ON t1.b = t2.b;
SELECT GROUP_CONCAT(x) FROM t920;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_2418 ON t2(lower(a)) WHERE a IS NOT NULL;
CREATE TABLE t1(a DATETIME PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (substr(1, 100), ('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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
UPDATE T SET b = json_object('k', b) WHERE 1;
UPDATE t2 SET b = 'x' WHERE b BETWEEN 0 AND 100;
CREATE  VIEW IF NOT EXISTS v_t2_1374 AS SELECT a FROM t2;
SELECT * FROM (SELECT * FROM t2) AS t1 JOIN (SELECT * FROM t2) AS t2 ON t1.b = t2.b;
SELECT GROUP_CONCAT(x) FROM t920;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_2418 ON t2(lower(a)) WHERE a IS NOT NULL;
CREATE TABLE t1(a DATETIME PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (substr(1, 100), ('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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
UPDATE T SET b = json_object('k', b) WHERE 1;
UPDATE t2 SET b = 'x' WHERE b BETWEEN 0 AND 100;
CREATE  VIEW IF NOT EXISTS v_t2_1374 AS SELECT a FROM t2;
SELECT * FROM (SELECT * FROM t2) AS t1 JOIN (SELECT * FROM t2) AS t2 ON t1.b = t2.b;
SELECT GROUP_CONCAT(x) FROM t920;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_2418 ON t2(lower(a)) WHERE a IS NOT NULL;
CREATE TABLE t1(a DATETIME PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (substr(1, 100), ('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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
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
SAVEPOINT sp5525;
-- changes()

PRAGMA compile_options;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE TABLE t2(a, b);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b','-'), ('a','c',-1222056731234344303), ('b','b',4.75);
SELECT a,
SUM(CASE WHEN b!='b' THEN c ELSE 0 END) AS d,
SUM(CASE WHEN b='c' THEN c ELSE 0 END) AS e
FROM T
GROUP BY a;
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 JOIN agg2 ON t1.y==agg2.m WHERE NOT NOT (t1.x IN (1,2,3)) ;
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
PRAGMA fullsync = 0;
CREATE  INDEX IF NOT EXISTS idx_t2_788 ON t2(lower(a)) WHERE +a > 0;
ALTER TABLE t1 RENAME COLUMN y TO y_r8132;
DELETE FROM t920 WHERE +x > (SELECT AVG(x) FROM t920) RETURNING *;
SELECT * FROM t2;
ALTER TABLE t920 ADD COLUMN extra_3469 NCHAR(55) DEFAULT 0;
SELECT * FROM T;
SELECT AVG(b) FROM t2;
DELETE FROM t2 WHERE +a > (SELECT AVG(a) FROM t2);
RELEASE sp5525;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT a, (SELECT MAX(a) FROM t2) AS max_val FROM t2;
INSERT INTO t2 SELECT * FROM t2;
INSERT INTO t920 SELECT * FROM t920;
UPDATE T SET b = json_object('k', b) WHERE 1;
UPDATE t2 SET b = 'x' WHERE b BETWEEN 0 AND 100;
CREATE  VIEW IF NOT EXISTS v_t2_1374 AS SELECT a FROM t2;
SELECT * FROM (SELECT * FROM t2) AS t1 JOIN (SELECT * FROM t2) AS t2 ON t1.b = t2.b;
SELECT GROUP_CONCAT(x) FROM t920;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_2418 ON t2(lower(a)) WHERE a IS NOT NULL;
UPDATE T SET a = CURRENT_TIMESTAMP;
ALTER TABLE t920 RENAME TO t920_r7385;
WITH a AS (SELECT x FROM t1), b AS (SELECT COUNT(*) AS cnt FROM a) SELECT * FROM b;
INSERT OR ABORT INTO t2 VALUES (0, 0);
WITH cte AS (SELECT z, LAG(z) OVER (ORDER BY z) AS prev FROM t1) SELECT * FROM cte;
CREATE  INDEX IF NOT EXISTS idx_t1_5378 ON t1((z + 1)) WHERE z > 0;
SELECT * FROM T;
UPDATE t1 SET x = json_object('k', x) WHERE rowid = 1 RETURNING *;
REINDEX;
INSERT INTO t920 VALUES (1) ON CONFLICT(x) DO UPDATE SET x = excluded.x;
DETACH DATABASE aux19;
ALTER TABLE t2 RENAME COLUMN b TO b_r9054;
COMMIT TRANSACTION;
INSERT OR FAIL INTO t1 VALUES ('x', 'x', NULL);
CREATE TRIGGER IF NOT EXISTS trg_t2_1866 AFTER UPDATE ON t2 BEGIN SELECT RAISE(FAIL, 'no'); END;
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 t2 ADD COLUMN extra_9820 DOUBLE PRECISION DEFAULT (abs(random()) % 1000);
REINDEX;
PRAGMA temp_store = '0';
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6930 ON t1(z) WHERE z IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_t920_9649 AFTER INSERT ON t920 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT MAX(x) OVER (ORDER BY x ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t920;
ALTER TABLE t920 RENAME TO t920_r9094;
INSERT INTO T VALUES (NULL, NULL, NULL);
SELECT AVG(x) FROM t1;
ANALYZE T;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T) RETURNING *;
WITH a AS (SELECT x FROM t920), b AS (SELECT x FROM t920) SELECT * FROM a JOIN b ON a.x = b.x;
SELECT * FROM t2;
INSERT INTO T SELECT * FROM T;
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;
INSERT OR FAIL INTO T2 VALUES ('x', '');
INSERT INTO t920 DEFAULT VALUES;
DELETE FROM t920 WHERE x IS NULL RETURNING *;
```

## 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
```

