# xsql

sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,o,d.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELd;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;EXPLAIN
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('% *g,%d,%d',CURRENT_TIMESTAMP));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%c�%d', sqlite_version()));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET a=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;EXPLAIN
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%f',new.a<new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%e,%d,%d',new.a-new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%g,%d,%d',CURRENT_TIMESTAMP));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%q,%d,%d', ltrim(1,1),new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN
    WITH c(x) AS (values(1))    VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
  WITH c(x) AS (values(1)) 
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              o�d.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,ol.a,old.b,old.c,new.ad.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM rNSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE S-T c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c)OR true);
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b�new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old(a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a<new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%f',new.a<new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d'.new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d', round(1,1),new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d'.
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELd;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d'<new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d'ISNULL,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%f',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%f',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%e,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%e,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%f,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printa,old.b,old.c,new.a,new.b,new.c);
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
       VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE F9OM record;
  IN) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%g,%d,%d', round(1,1),new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%g,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%l,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
 REPLACE INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
 REPLACE INTO t1(a,b) VALUES(1,2)
   ON CONFLICT( c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%l,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%l,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%ld%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
   ON CONFLICT( c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%ld%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%ld%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);�  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
   ON CONFLICT( c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%n,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf( json_set(1,1,1),new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETEINSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%n,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
   ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%n,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%n,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%n,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%p,%d,%d', round(1,1),new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
   ON CONFLICT( c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%p,%d,%d', round(1,1),new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%p,%o,%d', julianday(1,1,1)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%p,%o,%o',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%p,%p,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%q,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%q,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%r,%d,%d', unicode(1),new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%T,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(9,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%r,%d,%d',new.a+new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%T,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(9,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%r,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%T,%D,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
   
DELETE FROM t1 WHERE a=7;
 INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(9,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%r,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%T,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(9,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(9,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%r,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(c,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%s,% *%d', julianday(1,1,1)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%s,%.*%d', julianday(1,1,1)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%s,%X,%X', julianday(1,1,1)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%s,%X,%d', julianday(1,1,1)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%s,%d,%d', julianday( 1=11)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%s,%d,%d', julianday(1,1,1)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT coalesce(1,1)record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%s,%d,%d', sqlite_version()));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%s,%q,%d', julianday(1,1,1)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%s,%z,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%u,%d,%d', julianday(1,1,1)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%w,%d,%d', julianday(1,1,1)));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM ecor record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf(DISTINCT'%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT DISTINCT* FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf(DISTINCT'%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,?)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf(DISTINCT'%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf(DISTINCT'%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf(NOT datetime(1,1,1),new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert'OR false,printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('bsert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
 EY, b in strftime( a,b1,1,1,1),old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('bsert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
 EY, b in strftime(1,1,?,1),old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('bsert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
 EY, b in strftime(1,?,1,1),old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('bsert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
 EY,$b in strftime(1,1,1,1),old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('bsert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d', a,b, b in             old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('bsert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d'IN EY, b in strftime(1,1,1,1),old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
  WITH c(x) AS (values(1)) 
        VALUES('before-insert',printf( trim(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf( glob(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
  WITH c(x) AS (values(1)) 
        VALUES('before-insert',printf( trim(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN INSERT INTO record(x,y)     VALUES('after-insert',printf( glob(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
  WITH c(x) AS (values(1)) 
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
  WITH c(x) AS (values(1)) 
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
       VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
   WITH c(x) AS (values(1))  VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE F9OM record;
  IN) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
  WITH c(x) AS (values(1)) 
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    WITH c(x) AS (values(1))    VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
  WITH c(x) AS (values(1)) 
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
  WITH c(x) AS (values(1)) 
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
  WITH c(x) AS (values(1))      VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
  WITH c(x) AS (values(1)) 
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
       VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE F9OM record;
  IN) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf( trim(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,ew.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                            d.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2) ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(c,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);EXPLAIN
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf( trim(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf( glob(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);EXPLAIN
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(c,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y �EXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('% *c�%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES( -11,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y �EXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('% *g,%d,%d',CURRENT_TIMESTAMP));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y �EXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%e,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y,TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(y,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y`TEXT);
  CREATE TZIGGER r1 BEFORE INSERdedN t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEG bm25(1)IN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));%  END;
  CREATE TRIGG1R r3 BEFORE UPDATE ON t1 BEO record(x,y)
        VALUES)
        VALUES('('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,pew.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    IN INTO record(x,y)
        VALUES('after-update'&printf('%d,%d,%d/%d,%d,%d',
         XT, y`TEXT);
  CREATE TZI                             old.a,old.b,old.c,new.a,new.b,new.c));
  END?
  INSERT INTO t1a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FDISTINCTROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO RE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x c DEFAULT 0);
  CREATE TABLE r TeXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO vecord(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.���������;
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                       !              old.a,old.b,old.c,new.a,new.b,new.c));

 END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SEL�* FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    N CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x,TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf( trim(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2�AFTER INSERT ON t1 BEGIN INSERT INTO record(x,y)     VALUES('after-insert',printf( glob(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x,TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(c,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(� TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE �ecord(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',pri >=(SELECT'%d,%d,%d',new,a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETEINSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b)
  SELECT 2, 'x' FROM t1 GRO INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHngest1.b<excluded.b;
  SELECT 2, 'x' FROM t1 GROUP BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1, 1=13,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b< c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(0,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(
),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(  "a","b""a","b"
),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(  -1,"b"
),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char( "a","b"
),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char( total(1)),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(12001,0,-01),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(12001,01-01),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(2.01,01-011),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(2001,01,011),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(2001,01-011),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(202001-01-0101,01-011),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char(?),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(1,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c= randomblob(12001-01-011);
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET a=excluded.b, c= randomblob(12001-01-011);
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c= randomblob(1)<<trim(1,1);
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c= randomblob(12001-01-011);
  SELECT *, 'x' FROM t1 ORDER BY a;ANALYZE


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c= randomblob(12001-01-011);
  SELECT *, 'x' FROM t1 ORDER BY a;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c= randomblob(12001-01-011);
  SELECT *, 'x' FROM t1 ORDER BY@a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c= randomblob(12001.01-011);
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c= randomblob(122001-01-01);
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE json_patch(1,1);
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b*excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b/excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT * /* */FROM t1 GROUP BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY  randomblob(1);


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY a,b,a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY a,b- "a","b"a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY abs(1), "a","b"a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY abs(1),c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY abs(1)MATCH a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY abs(B),a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY hex(1),a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY sqlite_source_id()-a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a LIMIT-1;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a, "a", avg(1)"b"b


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a, "�", a,b


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a, "�", avg(1)"b"b


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a, "�","b"b


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a, a,b,"b"b


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a,?


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a/-1;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY c, "a","b"b


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 OROT INDEXED BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, count(1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, count(1) 'x' FROM t1 GROUP BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, group_concat(?,1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, json_group_array(1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, json_group_array(1) 'x' FROM t1 GROUP BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, json_group_array(?) 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, json_group_array(?) 'x' FROM t1 ORDER BY json_group_array(1) a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, total(1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *,B a,b'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT -1 'x' FROM t1 GROUP BY 1,1


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT 1=1'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT 2, 'x' FROM t1 GROUP BY 1,1


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT 2, group_concat(1,1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT 2, group_concat(1,1) 'x' FROM t1 GROUP BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT ?1 'x' FROM t1 GROUP BY 1,1


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT A, `a` FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT B, 'x' FROM t1 GROUP BY a,b-a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT*, 'x' FROM t1 ORDER BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT?< 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT affinity(1)IN t1 OR avg(1)a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT avg(1) FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT avg(1) FROM t1 ORDER BY a LIMIT-1;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT hex(1) FROM t1 GROUP BY 1,1


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT sum(1) FROM t1 GROUP BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT zeroblob( `a`-01-011) A, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT zeroblob(2001 || 011) A, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT zeroblob(A) A,0'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT zeroblob(A) || 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT zeroblob(A)�A, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT#�, 'x' FROM t1 ORDER BY@a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;EXPLAIN
  SELECT affinity(1) t1 ORDER BY@a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(3,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY a,b-a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(3,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY abs(1),a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(3,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a LIMIT-1;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(3,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, json_group_array(?) 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(3,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT?< 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(quote(?),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,c) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b= sqlite_compileoption_get(1)<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(c,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excd.b, c=c+1 WHERE t1.b<exed.b;
  SELECT 1=1'x' FROM t1 ORDER BY a DESC


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(c,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY abs(1),a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(c,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY-a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(c,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, json_group_array(1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(c,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT?, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (SELECT(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (VALUES( a.b.b2, a.b11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (VALUES( a.b.b2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (VALUES(1, a,b2, "a","b"),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (VALUES(1, a.b2,11),(3, a.b2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (VALUES(1,COLLATE1),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (VALUES(1,COMMIT11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (VALUES(1,NOT INDEXED3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (VALUES(COLUMN2,NOT INDEXED2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx /* */AS (VALUES(�, a,b2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS ( WITH c(x) AS (values(1)) VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a,$b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS ( WITH �ׇ� AS (values(1)) VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (SELECT(1,8),(2, sqlite_compileoption_get(1)))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE max(1,1) ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (SELECT(1,8),(2, sqlite_compileoption_get(1)))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES /* */(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE sqlite_version() glob(1,1)LICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES /* */(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
IS `a` CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES /* */(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
ISNULL CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES /* */(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
NOTNULL OR true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES /* */(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
AND true OR true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES( /* */2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely(1)ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES( avg(1),11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE `a`e
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES( avg(1),11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
AND true    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES( avg(1),11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
AND true OR true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES( avg(1)COLLATE nocase,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
OR false    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES( coalesce(1,1),1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE CONFLICT<a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1, char(1)),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
OR false    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2, sqlite_compileoption_get(1)))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE max( -11,1) ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2, sqlite_compileoption_get(1)))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE max(1, datetime(1,1,1)) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2, sqlite_compileoption_get(1)))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE max(2001-01-011,1) ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2, sqlite_compileoption_get(1)))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
OR true    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2, sqlite_compileoption_get(?)))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, a=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array( -11),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(1,1)GLOB a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT -1 a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`
IS /* */NULL CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`
IS `a` CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`
ISNULL glob(1,1)a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely( abs(1)-011)ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely( json_type(1,1)) glob(1,1) DO UPa;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely( json_type(1<1)) DO UPa;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely( json_type(2001-01-011,1)) DO UPa;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely( json_type(B,1)) DO UPa;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely( replace(1,1,1)) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely(+json_type(1,1)) DO UPa;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely(2001-01 glob(1,1)-011)ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely(2001-01-0=1)ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely(2<01-01-011)ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE sqlite_version() glob 'a'(1,1)LICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE sqlite_version() glob sqlite_version()(1,1)LICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE sqlite_version() glob(1,1) glob(1,1)LICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE sqlite_version() glob:1,1)LICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE sqlite_version()>glob(1,1)LICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE sqlite_version()LICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
AND true    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
IS NOT`a` CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
IS `a`OR true CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
NOTNULL OR true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE+sqlite_version() glob(1,1)LICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(1,1) a, b FROM nx WHERE `a`e
  


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(1,1) a, b FROM nx WHERE group_concat(1,1)ICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(1,1)GLOB a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(1,1)GLOB json_array(1,1,1) a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(1,?) a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(1<1) a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE  (1)
AND (1)e    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE  (1)
AND [a]e    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE  (1)OR true
AND true    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE  1=1
AND true OR true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE randomblob(1) OR true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
 >= true OR true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
AND  1=1 OR true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
AND true AND true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
AND true IS true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
AND true OR true  ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),( json_replace(1,1,1),99))
  INSERT INTO t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
AND true OR true OR true  ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO maINin.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS EXCLUDI(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<uded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS EXCLUSI(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=EXCEPTt2.c+1 WHERE t2.b<uded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS INSTEAD SELECT a, b FROM nx WHERE  `a`COLLATE CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT  `a` FROM nx WHERE  `a`COLLATE CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT 1=1 true, b FROM nx WHERE true
OR true    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT 2001-01-01, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE  1=1<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT 20012001-01-01- "a","b" FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT 20012001-01-01-01-01, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET a=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT DISTINCT'a'b FROM nx WHERE changes()ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx GROUP BY","a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx LIMIT "a"ISNULL,"b"  ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx LIMIT true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x'LIMIT t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx LIMIT true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT 1=1'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx LIMIT true
OFFSET last_insert_rowid()


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx LIMIT-true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx ORDER BY 1=1;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx ORDER BY"," -1


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a` glob(1,1)COLLATE CONFLICT<a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C200/-01-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C2001 glob(1,1)-01-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C2001- affinity(1)01-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C2001- max(1,1)01-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C2001-01 glob(1,1)-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C2001-01-012001-01-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C2001-01E01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C2001-0E-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C2001-?1-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE CURRENT_TIMESTAMPC2001-01-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE NOT `a`
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE `a`+true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE changes()ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE json(1)  ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE json_replace(1,1,1)T(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE likely(1)ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE random()+ random()ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE sqlite_compileoption_get(1)UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE sqlite_version()LICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE strftime(1,1,1,1)-01-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE t (1)REGEXP CONFLICT(a) DO UPa;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b= last_insert_rowid() WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b% c=t2.c+1 WHERE t2.b|excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b% c=t2.c;1 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c%CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c&CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<txcluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+CURRENT_DATE/excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+CURRENT_DATE<excluded.b;
  SELECT *,CURRENT_DATE 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b/ c=t2.c+ time(1,1,1)<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
NOTNULL    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
OR true    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
REGEXP CONFLICT(a) DO UPa;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE+true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b% c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE+true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE+2 daysxcluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE+true
AND true    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE- `a`
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE-true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, json_ject(1)
    ON CONFLICT(a) DO UPDATE SET b=eded.b, c=t2.c+1 WHERE t2.b<eded.a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, round(1,1) b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b% c=t2.c+1 WHERE t2.b|excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, round(1,1) b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b|excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, sqlite_source_id() b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a,$b FROM nx WHERE@true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(1,1) a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(1,1) a��b FROM nx LIMIT true
    ON CONFLICT(a) DO UPDATE SET b=excd.b, c=t2.c+1 WHERE t2.b<excd.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT group_concat(?,1) a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT * /* */FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY+a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY@a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, count(1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, group_concat(?,1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, json_group_array(1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, total(1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT DISTINCT*, 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT NOT'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT avg(1) FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT sum(1) FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, zeroblob(1) b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random()IS@ULL a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random()ISNULL a, b FROM nx WHERE true
IS unlikely(1)T(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random()ISNULL a, b FROM nx WHERE true
ISNULL CONFLICT(a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT round(1,1) a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT@a,$b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT@aOR glob(1,1) true, b FROM nx WHERE true
OR true    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT@aOR true, b FROM nx WHERE true
OR  1=1    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT@aOR true, b FROM nx WHERE true
OR true OR true   ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT@aOR2001-01-01 true, b FROM nx WHERE true
OR true    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(2001-01-011,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE  `a`COLLATE C2001-01-01


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
ATTACH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT*, 'a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
DETACH nx(a,b) AS t1.ed.b;
  ;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);EXPLAIN
  INSERT INTO t1(a,b) VALUES(1, json_parse(1))
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(9,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, group_concat(1,1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(9,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, json_group_array(?) 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(9,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, total(1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(9,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT 2, group_concat(1,1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(9,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT?< 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(9,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT zeroblob(2001-01-011) A, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(9,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT zeroblob(A) A, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) WITH c(x) AS (values(1))  VALUES(1,2),(3,4);
  WITH nx(a,b) AS ( WITH c(x) AS ( WITH c(x) AS (values(1)) 11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) WITH c(x) AS (values(1))  VALUES(1,2),(3,4);
  WITH nx(a,b) AS ( WITH c(x) AS (values(1)) VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0); WITH c(x) AS (values(1)) 
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES( avg(1),11),( json_group_array(1),99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
 a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);EXPLAIN
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),( char( "a"
),1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0);EXPLAIN
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                      old.a, sqlite_compileoption_used(1)));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1 glob(1,1),2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;EXPLAIN
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update'<printf('%d,%d,%d/%d,%d,%d',
                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update'<printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2) ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,ol.a,old.b,old.c,new.ad.b,old.c,new.a,new.b,new.c�);
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM rNSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE S-T c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  CREATE TABLE record(x TEXT, y TEXT)WITHOUT ROWID;
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),( substr(1,1,1),15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE glob(1,1)ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b< c=t2.c+CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, strftime(1,1,1,1) b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT H);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d', ltrim(1,1)ISNULL));
  END;
  CREATE TRIGGER r2 AFTER INSEcT ON ERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-updUte',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSE6T INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b VALUES(1,2)
    ON CONFLICT(a) DO UPDATE� c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT �);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT-0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('% *c�%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES( -11,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT.0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf( trim(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf( glob(1,1),new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT.0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%l,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT.0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *,C'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT.0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT�0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%.*son%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CdNFLICT(a) DO1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c DEFAULT�0)WITHOUT ROWID;
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+CURRENT_DATE<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c char(1) DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c || +1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c char(1) DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b< c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c char(1) DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b< c=c;1 W;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c char(1) DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b< c=c<1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c char(1) DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(3,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b< c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c char(1) DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(c,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY c;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c char(1) DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c char(1) DEFAULT 0);
  INSERT INTO t1(c,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b< c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int, c char2001-01-01N CONFLICT(a) DO UPDATE SET b=excluded.b, c=t1.c+1 WHERE t1.b<exed.b;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b int,Cc DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b,int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(c,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;VACUUM


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b,int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y,TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,o,d.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;EXPLAIN
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELd;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM reco


sqltext:
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b,int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, group_concat(1,1) 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a INTEG�R PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);

DELETE FROM t1 WHERE a=7;
INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('bsert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)        VALUES('befo***********************re-update',printf('%d,%d,%d/%d,%d,%d',
 EY, b in strftime(1,1,1,1),old.b,old.c,new.a,new.b,new.c)�;
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
 T);

DE INSE CO-FLICT(a) DO UPDATE SET c=  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CO-FLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a INeEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,:::::::::::::::::::::::2),(3,4);
  WITH nx(a) AS (VREPLACE,8),(2,11),(3,1),(5)G(1,4),(1,99))
  INSERT INTO main.t1 7S t2��������������������������x WHERE true
OR true    ON�CONFL^CT(a) DO"UPDATE SET b=excluded.b,LOBt2.c+1 CHERE t2T *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a INnseER PRIMARY KEY, b int, c DEFAULT 0)WITHOUT ROWID;
  CREATE TABLE record(x CEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update'<printf('%d,%d,%d/%d,%d,%d',
                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2) ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a I�TEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c= randomblob(12001-01-011);
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a blobGER PRIMARY KEY, b INT, c DEFAULT 0);
  CREATE UNIQUE INDEX t1x1 ON t1(a+b);
  INSERT INTO t1(a,b) VALUES(7,8) ON CONFLICT(a+b) DO NOTHING;
  INSERT INTO t1(a,b) VALUES(8,7),(9,6) ON CONFLICT(a+b) DO NOTHING;
  SELECT DISTINCT? FROM t1;


sqltext:
  CREATE TABLE t1(a char(1) PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a char(1) PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, json_group_array(A) 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a char(1) PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a dNTEGR PRIMARY KEY, y int, c DEFAULT 0� CEATE TABE record(x TEXT, yTEXT);
  CREATE TRIGAER r1 BEFO� INSE{T ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('be^ore-insert'printf('%d, END;
  CREATE TRIGER T OOt1 BEGIN
 KNSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new TRI�GER r3 BE���������������������FORE UPDATE O��N t1 BEGIN
    IN�ERT INTO recor@x,y)
        VA t1(a,b) VALUES(1,2);
  DELETEd,%d,%d/%d,%      old.a,old.b,old.c,new.a,neb,new.c));
! END;  C_EATE TRIGGER r4 AFTER UPD�TE ON t1 ZEx,y)*        after-update',printf('%d,%e,%d/%d,%d,%X                                json_test1(1)d.b,old.c,nem.a,new.b,new.c);
  END;
  INSERT&INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) D SET c=t1.c+1;
  OLECT * FROM record;
  DELETE FROM re��rd;
  INSERT INTN�t1(a,b) VALUES(2,2)
   ON CONFLICT(a) D�ATE SET c=c+1 WHEEXTRETE<0;
  SELECT * FROM redord;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b INT, c DEFAULT 0);
  CREATE  /* */ INDEX t1x1 ON t1(a+b);
  INSERT INTO t1(a,b) VALUES(7,8) ON CONFLICT /* */DO NOTHING;
  INSERT INTO t1(a,b) VALUES(8,7),(9,6) ON CONFLICT /* */DO NOTHING;
  SELECT * FROM t1;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b INT, c DEFAULT 0);
  CREATE UNIQUE INDEX t1x1 ON t1(a+b);
  INSERT INTO t1(a,b) VALUES(7,8) ON CONFLICT /* */DO NOTHING;
  INSERT INTO t1(a,b) VALUES(8,7),(9,6) ON CONFLICT /* */DO NOTHING;
  SELECT * FROM t1;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b INT, c DEFAULT 0);
  CREATE UNIQUE INDEX t1x1 ON t1(a+b);
  INSERT INTO t1(a,b) VALUES(7,8) ON CONFLICT(a+b) DO NOTHING;
  INSERT INTO t1(a,b) VALUES(8,7),(9,6) ON CONFLICT(a+b) DO NOTHING;
  SELECT A FROM t1;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b UNIQUE DEFAULT 0);
  CREATE UNIQUE INDEX t1x1 ON t1(a+b);
  INSERT INTO t1(a,b) VALUES(7,8) ON CONFLICT(a+b) DO NOTHING;
  INSERT INTO t1(a,b) VALUES(8,7),(9,6) ON CONFLICT(a+b) DO NOTHING;
  SELECT DISTINCT* FROM t1;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b UNIQUE DEFAULT 0);
  CREATE UNIQUE INDEX t1x1 ON t1(a+b);
  INSERT INTO t1(a,b) VALUES(7,8) ON CONFLICT(a+b) DO NOTHING;
  INSERT INTO t1(a,b) VALUES(8,7),(9,6) ON CONFLICT(a+b) DO NOTHING;
  SELECT DISTINCT? FROM t1;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,% *%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,.2001-01-01)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE DELETE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;EXPLAIN
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,o,d.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELd;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                            "a","b",old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET a=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET a=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET a=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;VACUUM


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
      coalesce(1,1),old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET a=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES( sum(1),11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT*, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, max(1,1) 'x' FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *,2001-01-01 'x' FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT 2 `a`, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT @1 'x' FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT*, 'x' FROM t1 ORDER BY a, "a","b"b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT*, 'x' FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT*, likely(1) 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT DISTINCT@1 'x' FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT abs(1) FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(3,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  WITH nx(a,b) AS (VALUES(1,8),(2,11),(3,1),(2,15),(1,4),(1,99))
  INSERT INTO main.t1 AS t2(a,b) SELECT random() a, b FROM nx WHERE true
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=t2.c+1 WHERE t2.b<excluded.b;
  SELECT *, 'x' FROM t1 GROUP BY a;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(c,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b,int, c DEFA a,b0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b,int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a,b


sqltext:
  CREATE TABLE t1(a �NTEGER PRIMARY KEY, b,int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY int a;


sqltext:
  CREATE TABLE t1(a,CHECK(1)PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('bsert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%q,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a,I,TEGER PRIMARY KEY, b UNIQUE DEFAULT 0);
  CREATE UNIQUE INDEX t1x1 ON t1(a+b);
  INSERT INTO t1(a,b) VALUES(7,8) ON CONFLICT(a+b) DO NOTHING;
  INSERT INTO t1(a,b) VALUES(8,7),(9,6) ON CONFLICT(a+b) DO NOTHING;
  SELECT DISTINCT* FROM t1;


sqltext:
  CREATE TABLE t1(a,INT PRIMARY KEY, b int, c DEFAULT 0) WITHOUT ROWID;
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2) ON CONFLICT DO NOTHING;
  SELECT * FROM record;


sqltext:
  CREATE TABLE t1(a,INTEGER PR,MARY KEY, b INT, c DEFA a,b0);
  CREATE UNIQUE INDEX t1x1 ON t1(a+b);
  INSERT INTO t1(a,b) VALUES(7,8) ON CONFLICT(a+b) DO NOTHING;
  INSERT INTO t1(a,b) VALUES(8,7),(9,6) ON CONFLICT(a+b) DO NOTHING;
  SELECT DISTINCT* FROM t1;


sqltext:
  CREATE TABLE t1(a,INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  INSERT INTO t1(a,b) VALUES(1,2),(3,4);
  INSERT INTO t1(a,b) VALUES(1,8),(2,11),(3,1)
    ON CONFLICT(a) DO UPDATE SET b=excluded.b, c=c+1 WHERE t1.b<excluded.b;
  SELECT *, 'x' FROM t1 ORDER BY a;


sqltext:
  CREATE TABLE t1(a,INTEGER PRIMARY KEY, b,int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,o,d.b,old.c,new.a,new.b,new.c));
  END;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;EXPLAIN
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELd;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM reco


sqltext:
  CREATE TABLE t1(ages INTEGER PRIMARY KEY, b int, c DEFAULT 0);
  CREATE TABLE record(x TEXT, y TEXT);
  CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('befo�e-insert',printf('%d,%d,%d',new.a,new.b,new7c));
  END;
  CREATE TRIGGER p2 AFTER INSERs ON b1 BEGIN
    INSERT IN record(x,y)     VALUEUES('after-insert',printf('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGG7R r3 BEFORE UPDATE ON t1 BEGIN
    INSERT INTO r  old.a,old.b,old.;
  CREATEecord(x,y)
        VALUES('before-update',printf('%d,%d,%d/%d,%d,%d',
       �������������������������                       old.a,old.b,old.;
  CREATE TRIGGER r4 AFTER UPDATE ON t1 BEGIN
    INSERT INTO record(x,y)
        VALUES('afterMupdate',printf('%d,%d,%d%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERT INTO t1(a,b) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FOM record;
  I�SERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELEBT * FROM record;


sqltext:
  CREATE TABLE tR(a INTEGER PRIMARY KEY, bDEFAULT 0);
  CREATE TABLE record(x TEXT, y TE record(x,y)E TRIGGER r1 BEFORE INSERT ON t1 BEGIN
    INSERT INTO record(x,y)
       VALUES('before-insert',printf('%c�%d,%d',new.a,new.b,new.c));
  END;
  CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
    INSERT INTO record(x,y)     VALUES
'after-insert',printf('%d,%d,%d',ND;
  CREATE TRIGGER r3 BEFORE UPDATE ON t1 BEGIN
   update',printf('%d,%d,%d/%d,%d,%d',
                              old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  CREATE fRIGGER r4 GIN
    INSERT INTO record(x,y)
        VALUES('after-update',printf('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,old.c,new.a,new.b,new.c));
  END;
  INSERa INTO t1(a,b',
           ) VALUES(1,2);
  DELETE FROM record;
  INSERT INTO t1(a,b( VALUES(1,2)
    TN CONFLICT(a) DO UPDATE SET c=t1.c+1;
  SELECT * FROM record;
  DELETE FROM record;
  INSERT INTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a) DO UPDATE SET c=c+1 WHERE c<0;
  SELECT * FROM record;


sqltext:
  VALUES(1,2);
  CREATE TABLE t1(a INTEGER&PRt1(UES(1,2)IMecorARY KEi, b int, c DEFAULT 0);
TEXT);
  CREATE TRIGGER r1 BEFORE I3S avg(1)t1 BEGIN
   'INSERM INTO r�cord(x,y) json_insert(1,1,1)
        VALUEn('befUESREATE TRCASER r|| 4 �FTER Uore-insert',priEXT('%d,%d,%d',new.a,new.b,new.c));
  END;
  CREATE BEGIN
    INS.RT INTO record(x,y)     V0LUES('af(%d,%d,%d',new.a,new.b,new.c));
  END;
  REATE TRIGGER r3 NOTHINGBEFORE UPDc+1;
  ATE ON t1 BENNNNNNNNNNNNRT INTO reco,y)
        VALUES('before-updateLENDUES('af('%db%d,%d',new.a,n',
                              o�d.a,oYd*b,old.c,new.a,new.b,new.c));
  END;
  CND;
  INS('%d,%d,%d/%d,%d VALUESREATE TRCASER r|| 4 �FTER UPDATE O+ t1!BEGIN
    INSERT INTO record(x,y)
    VALUES('ad-update',prin�f('%d,%d,%d/%d,%d,%d',
                                      old.a,old.b,olq.c,new.a,ne('%d,%d,%d/%d,%d VALUES(1,2);
  DELETd;
  INSERT ecor t1(a,b) VALUES(1,2));
  END;
  CREAoE  O UPDATE SET c=t1.c+1;
  SHLET* FROM �����������cord;
  DELETE FROM record;
�����������������������  INSERT ;NTO t1(a,b) VALUES(1,2)
    ON CONFLICT(a)(FO UPDATE SET c=c+1 WHERE c<0;
 �SELECY * FROM record;


sqltext:
 ATTACH(+++++++++++++++++++x) AS �values(1))   b INRY KEY(a1b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS  ltrim(1,1)  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS ( lower(1))  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS ( mpileopt)  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS ( upper(1))  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS (@alues(1))  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS (TEMPORARY)  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS (TEM�ORARY)  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS (TE�PORARY)  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS (values(2001-01-011))  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS affinity(1)  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS nullif(1,1)  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS zeroblob(1)  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS �PRIMARY KEY  b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS �values(1))   b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 ATTACH(x) AS �values(1=) INRY cVnK(a,bT
) WITHOUT ROWID;
INSERT INTO rsiotG(a,b) uALUES(1,2),(3,4)(1,2)ITHOUT ROWID;
IcludITHING;


sqltext:
 ATTACH(x) AS-NOT(values(1))   b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT  json_array(1,1,1)HAVING ROWID;
IT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT 2001-01-01 WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT DISTINCT json_array(1,1,1) ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT group_concat(1,1)-json_group_array(1)ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_arr2001-01-01 -1)ID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_array_length( -1)ID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_array_length( json_set(1,1,1) -1)ID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_array_length( round(1,1) -1)ID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_array_length(),1)ID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_array_length(1 glob(1,1),1)ID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_array_length(1,1)ID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_array_length(?,1)ID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_parse(1)-json_group_array(1)ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_replace(  "a")ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_replace( )ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4UNION),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_replace( @1,1)ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_replace(1,?,1)ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT json_replace(1,?,1,?,1)ROWID;
INSERT It1(a,b) VALUES(1,2),(3��),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT sqlite_source_id()WHERE ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT substr(1,1,1)-json_group_array(1)ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
 WITH c(x) AS (values(1))   SELECT-json_group_array(2001-01-011)ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
#o a������������gecordesWWWW@WWWWWqWW ��WfWW��WWWWVWW TEXT�������  VALPEI:ARH��������WWWWWWAUTOINCR>MENTWWWWWiW RCURVALRENT�����ESeco'������T CURVALRENT�����ESeco'������TWWWWWWWWWWWW����(VA ����gecordesWWWW@WWWWWqWW R  URVCT���) DO NIM9���)T ��ES)1,2T���)?DO#��T


sqltext:
######
#RT UE#####
#RET  ####
#RE #RT UE#####
#RET  ####
#RE* .P,2)���CONFAVALAT/�����D(VAT UE#####
#RET ###
#RET>kT/I�;


sqltext:
######
#RT UE#####
#RET  ####
#REE:u7(a .@,2)�LE:u7* .P,2)���CONFAVALAT/�����D(VAT UE#####
#RET ###
#RET>kT/I�;


sqltext:
####N
#R/�����D(VA,oTHI�ALET ��UE####
#RE>>>`sez>>>>>2>>>>>>)���CONFLIClidVAVALAT/��#N
#R/ json_insert(1,1,1)�����D(VA


sqltext:
#######
#REAT�ime�LE u7(a UIQUE, b UNIQUE)5
#55GGGGG
,b)VALUGS(151),



,b


sqltext:
#######
#REAT ��D(LE u7(aEIGNORE, b#
#RecorEAT �LE u7(a UIQUE, b UN UNIQIE)55@OFULL�
ONFLICT((VAVALAINTO�������D(VAN@�;


sqltext:
#######
#REAT 
�LE u7(a UIQUE, b UNIQUE)555GGGG
,b)VALUGS(151),(EiC.P,2)���CONFLICT((VAVALAT/ ��������D(VANoTHI�;


sqltext:
#######
#RET UE#####
#RET �LE:r=(a .P,2)
#RET UE#####
#RET �LE:r=���CONFLI[z((VAVALAT/�����D(VA>oTHI�;


sqltext:
#######
#RET UE#####
#RET �LE:u7(a #####
#RET �LE:u7(a .P.P,2)	��CONFLICz((VAVALAT/�����3(VASSSSSSSSS


sqltext:
#######
#RET UE#####
#RET  ,as�_insert_rowid()�LE:u�(T �3E#####
#RE�T LE:u�z((VAVALATALAT/�����DVA>oTbI�####
#RET  ,as�_insert_rowid(;


sqltext:
########RET UE###P,2E:u7(a .P,2)���CONFLREt��UE#####
#REICZ((=AVALAT/�����D####
#RET�@###
#RET ��L(VF>oTHI�;


sqltext:
######�
#RET;U&####CTE noZ������������������ase#######
#RET U&#>##
#RETte U&#####
#����������R####
#RET
#LTERite�LE######
#RET U&#####
#UUUUUUUUUUUUUUUUUUU`UUUUULE�����D(VA>HI�;�


sqltext:
####�=#
#R��T<UE,1NOM��TV2)(VA���������.P#
#R��T<UE,TV2)(VA���������.P@)VAL6GS(1�C.P@CZ(y�����  ���� unlikely(1)���VNoeHI�;


sqltext:
#I3
�1��= (1
����3F4O t���� ���YU�����  � �T	���T	�����  A
  � �T	�� T	� int��$$$$$$$$$$@$$$$$$$$$$$�$��2$$$$����;


sqltext:
#REATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
#REATE TABLE t1(a,b,c DEFAULT 0,PRIMARY KEY(a,b));
INSERT INTO t1 AS nx(a,b) VALUES(1,2),(3,4),(7,8)
  ON CONFLICT(a,b) DO
    UPDATE SET c=(SELECT c FROM t2 WHERE (a,b)=(eded.a,exed.b));


sqltext:
#REATE TABLE t1(a,b,c,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM(data)ON CONFLICT(b,d) UPDATE


sqltext:
#REATE TABLE t2(x INTEGER PRIMARY KEY, y INT UNIQUE)/*WIT ROWID*/;
CREATE TABLE t3(a,b);
INSERT INTO t3 VALUES(1,2),(3,4),(1,5),( ?16,7),(3,1),(8,9),(6,11),(1,1);VACUUM;ANALYZE


sqltext:
#REATE TABLE t4(a INT, b INT);
CREATE UNIQUE INDEX t4a1 ON t4(a) WHERE b<?000;
CFLICT(a) DO NOTHING;


sqltext:
#REATE TABLE t9(a TEXT PRIMARY KEY, b INT DEFAULT 1);
PRAGMA count_changes=ON;
INSERT INTO t9(b) VALUES('abc'),('def'),('ghi' > @1='abc'),('jkl'),('abc'),('ghi')
    ON CONFLICT(a) DO UPDATE SET b=b+1;
PRAGMA count_changes=OFF;


sqltext:
#REATE TABLE t9(a TEXT PRIMARY KEY, b INT DEFAULT 1);
PRAGMA count_changes=ON;EXPLAIN QUERY PLAN VALUES('abc'IN(SELECT'def'))('g
 CT(a


sqltext:
#REATE Ta INT);
#REATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r. AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(vt1 SET a=5 WHERE a=4;
DELETE FRO


sqltext:
#REATE Ta TEXT PRIMARY KEY, b INT DEFAULT 1);
PRAGMA count_changes=NO;
INSERT INTO t9(a) VALUES('abc'),('def'),('ghi'),('abc'),('jkl'),('abc'),('ghi')
    ON CONFLICT(a) DO UPDATE SET b=b+1;
P


sqltext:
#REATE Ta TEXT PRIMARY KEY, b INT DEFAULT 1);
PRAGMA count_changes=ON;
INSERT INTO t9(a) VALUES('abc'),('def'),(''hi'),('abc'),('jkl'),('abc'),('ghi')
    ON CONFLICT(a) DO UPDATE SET b=b+1;
P


sqltext:
#REATE Ta TEXT PRIMARY KEY, b INT DEFAULT 1);
PRAGMA count_changes=ON;ANALYZE INTO t9(a)'abc'),('def'),('ghi'),('abc'),('jkl'),('abc'),('ghi')
    ON CONFLICT(a) DO UPDATE SET b=b+1;
P


sqltext:
#REATE Ta TEXT PRIMARY KEY, b INT DEFAULT 1);
PRAGMA count_changes=ON;EXPLAIN QUERY PLAN VALUES('abc'),('def'),('ghi'),('abc'),('jkl'),('abc'),('ghi')
    ON CONFLICT(a) DO UPDATE SET b=b+1;
P


sqltext:
#aEz>EX~Q�"1)t1(
#a�Q4"1)t1(
#t1o�1ILTBO NI wwwwwwwww [a]wwwwwwwwwwwwwwwwwwwc1)t1(
#a�Q4"1)t1(
#o�(3INT;


sqltext:
######
#R\3T UE#####
#R�����
#R\3T UE#####
#R���������ETNFLICz((VAVALAT/�����D(VA>oTHI�;


sqltext:
$$$$$$$��$$���������������������GROUPT$ENsCRT5A)INT$$�$$$$$&$8:8886Ns(�Ca
IT)'d8�-s(!!!! strftime(1,1,1,1)!!!(j�^EL�%$INTINTENsCIT5A(�INT$$ dlok�eENd;


sqltext:
--E 0,
  PrIMAR KEY(a,b)
) WITHOUATE TABLE t1(
 INDEXT,
  b INT UINT DEFAULT 0
  PrIMARY KEY(a,b)
) WrIMARY a,b)
) W1 count(1),2)8UNIONFLICT(a,b) DO NOTHING-


sqltext:
;SAVEPOINT
INS;END
CREATABLE t4(a INT, b INT);
CREATE UNIQUE INDEX t4a1 ON t4(a) WHERE b<1000;
CREA� UNIQUE INDEX t4a2 ON t4(a) WHERE b> j�n_remove(ALL)=2000;SAVEPOINT
INS;END


sqltext:
@EAABLE t1(T DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
@�(I0T ���3ALKdS(6: t1(aMARY ZY,d)*:��(112,3,������������� json(1)������������������4),(5,EINT�6�)*:(1,b,,EXADAT�INT����


sqltext:
BEGIN;nudedT��OTHIN PRISET t1
 da NF,
 ����w? UUT���LT 
,
  PVIMRINNERa,b)d P da NF,
 ����w?t1(
 da NT:
  bDONa)O��OTHING;


sqltext:
CREATE :::::::::�:::::::::::::: =E�json_patounts�
�NSERT INTO t3(z, Va+U  �frfT��������������fffffdedCkN LICT(a,k�DaIoT4 b1�


sqltext:
CREATE TABLE  a.bt1',
 �b INT UNIQUE,
  c INTDEFAfffffffffffffARY UE,
  c INTDEFAfKEY(a,b)
) WITHOUT ROWID;
INSERT INUE,
  c INT DEFAULT 0,
  Pt1'


sqltext:
CREATE TABLE @INT1(  a INTd  b \NT UNIQUE,
  c INT,DEFAULT 0,�  IMARY KEY(a,b)IES(1,2)3(3,4),(1,2)ONINT CONFLICT(a,b)(DOdNO5HING;


sqltext:
CREATE TABLE ABORTt1(a INT,b INTEGER, c TEXT, d BLOB, e ANY,
    UNIQUE(a) ON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);
CREATE UNIQUE INDEX t1e ON t1(e);
INSERT INTO t1(a,b,c,d,e) VALUES(1,2,'abc','b3',3.5);
INSERT INTO t1 VALUES(2,2,'xyz',NULL,4.25)
ON CONFLICT(b) DO UPDATE SET e=max(e,excluded.e);


sqltext:
CREATE TABLE ANALYZEt1(a,b,c,d,PRIMARY KEY(b,d));VACUUM
;ITH data(a,b,cINSERT INTO t1(a,b,c,d) SELECT * FROM data
ON CONFLICT(b,d) UPDATE SET


sqltext:
CREATE TABLE CASEt6(
  a INT UNIQUE ON CONFLICT fail,
  b INT UNIQUE ON CONFLICT replace,
  c INT UNIQUE ON CONFLICT fail,
  d INT UNIQUE ON CONFLICT replace
);
INSERT INTO t6(a,b,c,d) VALUES(1,2,3,4),(5,6,7,8),(1,100,110,120)
  ON CONFLICT(a) DO UPDATE SET a=1000;


sqltext:
CREATE TABLE CURRENT_DATREGEXP a INT,
  b INT UNTHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE CURRENT_TIMESTAMPt1(
  a INT,
  b INT UNIQUG,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUE6(1,2),(3,4),(1,2)ON CONFLICT(a,b) DEY(a,b)
) WITHOUT ROWIO NOTHING;


sqltext:
CREATE TABLE CURRENT_TIMESTAMPt1(a,b,c,d,PR json_test1(1));VACUUM
;ITH data(a,b,a,b,c,d) SELECT * FROM data
ON CONFLICT(b,d) UPDATE SET


sqltext:
CREATE TABLE S (VALUE,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,3,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM


sqltext:
CREATE TABLE S('
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(�,b) DO NOTHING;


sqltext:
CREATE TABLE SET�4(a INT, b INT);ANALYZE UNIQUE INDEX t4a1 ON t4(a) WHERE b<1000;
CNTO t4(a,b) VALUES(50,60) ON CONFLICT(a) DO NOTHING;


sqltext:
CREATE TABLE SQT�4(a INT, b INT);ANALYZE UNIQUE INDEX t4a1 ON t4(a) WHERE b<1000;
CNTO t4(a,b) VALUES(50,60) ON CONFLICT(a) DO NOTHING;


sqltext:
CREATE TABLE sq,ite_ion() INRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE sqlite_ion() INRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE s�(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b.�) WITHOUT RO,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE s�(x INTEGER PRIMARY KEY, y INT UNIQUE)/*WIT ROWID*/;
CREATE TABLE t3(a,b);
INSERT INTO t3 VALUES(1,2),(3,4),(1,5),( ?16,7),(3,1),(8,9),(6,11),(1,1);VACUUM;ANALYZE


sqltext:
CREATE TABLE s�(
  a INT UNIQUE ON CONFLICT fail,
  b INT UNIQUE ON CONFLICT replace,
  c INT UNIQUE ON CONFLICT fail,
  d INT UNIQUE ON CONFLICT replace
);
INSERT INTO t6(a,b,c,d) VALUES(1,2,3,4),(5,6,7,8),(1,100,110,1,0)
  ON CONFLICT(a) DO UPDATE SET a=1000;


sqltext:
CREATE TABLE t
(a,b,c,d,PRIMARY KEY(b,d));VACUUM
;ITH data(a,b,cINSERT INTO t1(a,b,c,d) SELECT * FROM data
ON CONFLICT(b,d) UPDATE SET


sqltext:
CREATE TABLE t(a,b) DO NOTHI1(
 aEXPLAIN INT,
  b INT UNIQULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
�NSERT INTO t1(a,b) VALUES#######################(1����������(1,2)ON CONFLICT(a,b) DO CROSSNOTHING;


sqltext:
CREATE TABLE t1(
  a COLLATE nocIQUE,
  c IN) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a COLLATE nocase  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;


sqltext:
CREATE TABLE t1(
  a DEFAULT 0XDEFAADDa,bNT UNIQUE,
  c INZ DEFAULT 0XDEFAADDa,b)
  WITHOUT ROWID:�INSERT1(a,b1,2)ON CONFLICN(a,b) DO NqTHING;


sqltext:
CREATE TABLE t1(
  a INT DEFAULT NT,
  b INT UNIQUE,
  c INT DEFAULT 0.
  DEFAULT KEY(aa,b) VALUES(12),(3,4),(1N CONFLICT(a7b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  COMMITb INT UNIQUE,
  c INT DEFAULT  -10.
 
   DEFAULT  -10.
 
  a INa INT,
  b INT UNIQBE,
  c IN3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b  REFERENCES
CURRENT_TIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b  intUNIQUE,
CERRENT_TIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b  intUNIQUE,
CURRENT_TIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b DEFAULT(1),
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b DEFAULT(1)COLLATE nocase,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b DEFERRABLE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b DEFERRABLE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b DESCLOBQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b DESCUNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INCOLLATE binary,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UFIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( @11, @1 ),(3,4),(1,ALUES( @11, @1 ),(3,4 NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c I  a ININT  b INT UNIQUE,NT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID+
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c I  a ININT  b INT UNIQUE,NT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3, 1=14),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c I  a ININT  b INT UNIQUE,NT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT /* */DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c I  a ININT  b INT UNIQUE,NT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;REPLACE INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c I  a ININT  b INT UNIQUE,NT DEFAULT 0,
  PRIMARY KEY(b,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INCURRENT_TIME
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT  'a''a'  PRIMARY KEY(a VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT  - /* abs(1) */1                  a,b(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHdNG;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT  -1               )  a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHdNG;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT  -1  PRIMARY KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT  -10.
 
  a INT,
  b INT UNIQBE,
  c IN3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT  -10.
  PRIMARY KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT ( json_group_array(*)) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT ( jsonrray(1)OR false) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT ( load_extension(1,1)OR true%Y) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHI


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT (?)  PRIMARY KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT (F)  PRIMARY KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0
  PRIMARY KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(?, ?1) WIT ROWID;,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(?AND false ROWID;,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(  "a","b""a", "a","b"OTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1( "a", "a","b"OTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1( "a","b"UES(NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1( `a` VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(_ROLLBACK,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(_ROW,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(_ROWIb) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( ?1
, @1(3,4),?1, ?1N CO


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( ?11, @1(3,4),?1, ?1 ?1O


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( ?11, @1(3,4),?1, ?12)ON CO


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( ?11, @1(3,4),?1, @1N CO


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( ?11,2),(3,4),( ?11,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( ?31,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( ?51,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( ?> 1>11,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( ?>>1=11,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( @11, @1 ),(3,4),( @11,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( @11, @12),( @1 ,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( @11, @12),( @13, @14),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( @11, @12),( @13,4),( @1)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( @11, @12),( @13,?),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( @11, @12),(3,4),(1, @12)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( abs( "a"),4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( abs( -11),4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( abs(-.11),4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( abs(?),4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum( char(1)),4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(2001-01-011%Y),4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(DISTINCT?),4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,  zeroblob(1))ON CONFLICT(a,b) DO NOTHING;"


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1, '  
1'),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1, ' -1 '),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1, '+  d''b'),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1, 'a''b'),(1,2)ON CONFLICT(a,b) DO NOTHING;REINDEX


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1, 'a''b'),(1,2)ON CONFLICT(a,b) DO NOTHING;REINDEX rtrim(1,1)


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1, 'e''b'),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1, a.b2),(3, a.b4),(1, a.b2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1, a.b2),(3, a.b4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,-'+  d''b'),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2)$(3,


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( 1=13,4),( 1=11,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( 1=13,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( ?33,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( ?=3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( hex( " json_group_array(1)a"),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( hex( -11),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( hex( ltrim(1,1)),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( hex( random() -11),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( hex(2001-01E011),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( hex(2001/01E011),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( hex(?),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(2 || 00150E-313,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(2001 || 50E-013,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(2001-01- count(
),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(2001-01- count(?),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(2001-01- count(DISTINCT
),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(2001-01-012001-01- count(1),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(200100E-313,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(200150E-313,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(200150E-323,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(200150E-333,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3, 1=14),(1, 1=12)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3, 1=14),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3, ?=4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,r) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON [ONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(json(?),2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,X'a''b


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,X'a7'b


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(2001-01-01-?11,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b)DEFAULT VALUES(1,2),


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(g,b) VALUES(1,2),(3,4),(1000000042)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(g,b) VALUES(1,2),(3,4),(?0000000,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;EXPLAIN
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;EXPLAIN
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT /* */DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWI�;4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROW�D;4),(1,2)ON CONFLICT(�,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b,b)
) WITHOUT ROWID+
INSERT INTO1(DO NOTHINGID;
INSERT INT


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b,b)
) WITHOUT ROWID;
INSERT INTO1(DO NOTHINGID;
INSERT INT


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,c)
) WITHOUT ROWID+4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,c)
) WITHOUT ROWID;REPLACE INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,c,b)
) WITHOUT ROWID;
INSERT INTO1(DO NOTHINGID;
INSERT INT


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(b,b)
) WITHOUT ROWID+
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(b,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT /* */DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(b,b)
) WITHOUT ROWID;ANALYZE INTO t1(ICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(b,b)
) WITHOUT ROWID;REPLACE INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMAR[ KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0,CONSTRAINT KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0. /* */
  PRIMARY KEY(aa,ALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 07777777777,
  PRIMARY KEY(b,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUEs(12001-01-01(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0X
  PEY(a,b)
) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0X0PRIMARY KEY) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0X0�FAULTa,b)
) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0XADD
  PEY(a,b)
) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0XADDPRIMARY KEY
) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0XDE2001-01-01) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0XDEFAADDa,b)
) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0Xd  PEY(a,b)
) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0Xd2001-01-01
) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT 0XdPRIMARY KEY) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT CURBENT_DATE KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT E,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( ?13,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT E,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT END0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT FAIL PRIMARY KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT FAIL0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT TRIGGER0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT TRIGGERIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT ���������������0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(aIb) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT+0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT+2 days
INSINTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT-0,
  PRIMARY KEY(a,b)
) WYTHOUT RO,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAULT.0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES.1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFAUc INT DEFAULT 0,
  PRIKARY KITHOUT ROWI:::::::::::::::::::::::::$::::1,2)�(s,4),(1,2)O��CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFERRABDE
  PRIMARY KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT DEFERRARLE
  PRIMARY KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT PRIMARY KEY  COLLATE nocase,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT PRIMARY KEY AUTOINCREMENT PRIMARY LUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT PRIMARY KEY COLLATE nocase COLLATE nocase,b) V3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT REFERENCES
  PEY(a, "a","b"DESC ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT REFERENCES
  PEY(a,b)
) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT REFERENCES
  PEY(a�b)REFERENCES ROWI);
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c INT REFERENCES
  PEY(a�b)REFERENCES ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c IN����������������T DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERs INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON C�ICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
  c NOT DEFERRABLE
  PRIMARY KEY(aa,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY( int
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(INb)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INCERT INTO t1(a,b) VALUES(1,2),(3,4),(1777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(INTOa,b) VALUES(1,2),(3,4),(1777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(INb) VALUES(1,2),(3,4),(777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( avg(1),4),(1777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES((0X07777777777777771,2),(3,4),(0X07777777777777777777,2)ON CONFLICT(a777777777777777,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(07777772001-01-01777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(0777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(0X07777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(0X7A7777777/7777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(0X7ADD77777/7777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(0X9DD77777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(0XADADD777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(0XADDA7777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1& -17 || 7777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1&-7777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1&77777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(17*7 || 777777777777E7,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(17*77777 || 77777777E7,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(17*77777777777777777E7,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(17*9227777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(17*9277777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(17*9777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1777777777 -1777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(17777777777/7777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(17777777777777E7777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1777777777777E77777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(177777777777E777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1777777E77777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(177E-77777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(177E77 || 7/7777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(177E77 || 777777777772001-01-017,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(177E77 || 7777777E7777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1E77&77777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(2001-01-01177E77 || 777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(?777777777777777777777,2;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(?,4),(0X777777777/7777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;REPLACE INTO t1(a,b) VALUES(1,2),(3,4),(1777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 ߜ߶NT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
 ߜ߶NT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
CURRECOLLATE nocaseNT_TIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
CURREND_TIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
CURRENTOTIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
CURRENT_DIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
CURRENT_TIMESTAMP,
  PRIMARY KEY(CURRENT_TIMESTAMPa,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,
CURRENT_TIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(CURRENT_TIMESTAMPa,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,CONSTRAINT
CURRENT_TIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQUE,CURRENT_TIMESTAMP
CURRENT_TIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQWITHOUT ROWIDUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNIQWITHOUT ROWIDUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -01 || 777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -11 || 77777777777777772001-01-0177777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -11 || 777777777777777772001-01-017777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -11 || 7777777777777777777.7,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -11 || 77777777777777777772001-01-0177,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -11 || 777777777777777777772001-01-017,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -11 || 777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -11 || 7777777777777777777772001-01-01,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -11 || 777777777777777777E77,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),( -11 |~ 777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1  | 777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1 -1 || 777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1 | -177777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1 || 77777777777777777772001-01-0177,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT UNYQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,  zeroblob(1))
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 -1,2001-01-014),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2001-2001-01-0101-011;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 -1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2-01-01-011;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 -1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2001-012001-01-01-011;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 -1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+20012001-01-01-01-011;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 MATCH-1, abs(1))ON CONFLICT(a,b) DO UPDATE SET c=c+2-01-01-011;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 MATCH-1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+1-01-01-011;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 MATCH-1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2-01-01- 1=1


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 MATCH-1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2-2001-01-0101-01-011;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 MATCH-1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2001-01-012001-01-011;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 MATCH-1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+22001-01-01-01-01-011;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c= likelihood(1,1)c+1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c%1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+ likely(1)1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;ANALYZE


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;ANALYZE a.b


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=~#1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET �=c+1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(2001-01-011,2),(3 MATCH-1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c= @1c+1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;EXPLAIN
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c= 1=1


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;EXPLAIN
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+B;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;REPLACE INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET b=c+B;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT E,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT END0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT F,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT TO0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT �,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;EXPLAIN
INSERT INTO t1(c,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+1;


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT+0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT DEFAULT-0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b INT,
  c INT EXCLUSIVE,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)
   ON CONFLICT(a,b) DO UPDATE SET c=c+1;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b vEACHarchar(1)COLLATE nocase,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1),
  :::::::EFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROW(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1),
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3, 1E44),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1),
  c INT DEFAULT E,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1),
  c INT DEFAULT E6D0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1),
  c INT DEFAULT E6D0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;REINDEX


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1),
  c INT DEFAULT END0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1)COLLATE nocase,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(1,2),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1)COLLATE nocase,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(1,4),(1,2)ON CONFLICT(a,b) DO NOTHING;REINDEX


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1)COLLATE nocase,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,22001-01-01),(1,4),(1,2)ON CONFLICT(a,b) DO NOTHING;REINDEX


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1)COLLATE nocase,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(9,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1)COLLATE nocase,
  c randomblob(1)COLLATE nocase,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1)COLLATE nocase,
  c randomblob(1)UNIQUE,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar(1)COLLATE nocase,
  c randoublob(1),
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b varchar,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)OG CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b varcharCURRENT_TIMESTAMP(1),
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b varcharEXPLAIN QUERY PLAN
  c randomblob(1),
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b,INT UNIQUE,
  c I  a ININT  b INT UNIQUE,NT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
  b,INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  a INT,
  b,INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(json(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;ANALYZE


sqltext:
CREATE TABLE t1(
  a INT,
  b,INT UNIQUE,
 INTINT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1777777777777777777777,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
ludedNT UNIQUE,
  B INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1 -1,2),($1=13,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
ludedNT UNIQUE,
  B INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( 1 -1,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
ludedNT UNIQUE,
  B INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( 1 -1,4),(2001-01-011,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
ludedNT UNIQUE,
  B INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( 1 MATCH-1,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
ludedNT UNIQUE,
  B INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),( 1=13,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
ludedNT UNIQUE,
  B INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),($1=13,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,
ludedNT UNIQUE,
  B INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;EXPLAIN
INSERT INTO t1(a,b) VALUES(1,2),( 1 -1,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,WITHOUT ROWIDUE,
  c INT DEFAULT 0,
  PRIMARY KEY(WITH
) WIT ROWID;,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,WITHOUT ROWIDUE,
  c INT DEFAULT 0,
  PRIMARY KEY(WITHOUTa,b)
) WIT ROWID;,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INT,WITHOUT ROWIDUE,
  c INT DUFAULT 0,
  PRIMARY KEY(a,b)
) WIT ROWID;,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INTCOMMIT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a INWITHOUT ROWIDIQUE,
 CURRENT_TIMESTAMP
  PRIMARY KEY(a,b)
) WIT ROWID;,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a IOT,
  b INT UNIQUE,
  c INT DEFAULT 0Xd3 PEY(a,b)
) WITHOUT ROWID;
INSERT1(a,b1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a IpT,
""f INT UNIQUE,
  c INT DEFAUL�,b)
) ROWID;
IN INTO t1(a,S) VALUES( sum(1%�))4),(1,2)ON CONFLICTEa,THING;


sqltext:
CREATE TABLE t1(
  a char 1)b INRY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a charCURREALLTIMESTAMP)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a,INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(2001-01-013,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a,INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(2001-01-013,4),(12001-01-01,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
  a,INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 -1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2001-0 glob(1,1)1;


sqltext:
CREATE TABLE t1(
  a,INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 -1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2001-01-01 -1


sqltext:
CREATE TABLE t1(
  a,INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 -1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2001-01-011;


sqltext:
CREATE TABLE t1(
  a,INT,
  b INT,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3 -1,4),(1,2)ON CONFLICT(a,b) DO UPDATE SET c=c+2001-2001-01-010 glob(1,1)1;


sqltext:
CREATE TABLE t1(
  a,bNT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT /* */DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(
  b�INT,
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(b,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(
 INT a INT DEFAULT 0,
  PINT DEFAULT 0,
  PRIMARY KEY(a,bLLATED;N V�N CONFLICT(a,dO NcTHWNG�


sqltext:
CREATE TABLE t1( "a","b",
  b INT UNIQUE,
  ) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES(1,2),(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1( [a]a,b,c,d,PRIMARY KEY(b,d));
WITH  [a](a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM data
ON CONFLICT(b,d) UPDATE


sqltext:
CREATE TABLE t1( a,ba,b,c DEFAULT 0,PRIMARY KEY(a,b));
INSERT INTO t1 AS nx(a,b) VALUES(1,2),(3,4),(7,8)
  ON CONFLICT(a,b) DO
    UPDATE SET c=(SELECT c NOTNULL WHERE (a<b))(e


sqltext:
CREATE TABLE t1( a,ba,b,c,d,PRIMARY KEY(d,c))WITHOUT ROWID;
CREATE UNIQUE INDEX t1bc ON t1(b,c);
INSERT INTO t1(a,b,c,d) VALUES(1,2,3,4),(5,6,7,8),(9,2,3,10),(11,12,13,14)
ON CONFLICT(c,b) DO UPDATE SET a=a+1000;
SELECT *, 'x' FROM t1 ORDER BY +a;VACUUM


sqltext:
CREATE TABLE t1( a,ba,b,c,d,PRIMARY KEY(d,c))WITHOUT ROWID;
CREATE UNIQUE INDEX t1bc ON t1(b,c);
INSERT INTO t1(a,b,c,d) VALUES(1,2,3,4),(5,6,7,8),(9,2,3,10),(11,12,13,14)
ON CONFLICT(c,b) DO UPDATE SET a=a+1000;
SELECT B, 'x' FROM t1 ORDER BY +a;


sqltext:
CREATE TABLE t1(A,b,c,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM (SELECT UP)UP


sqltext:
CREATE TABLE t1(A,b,c,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM (SELECT@UP) UP


sqltext:
CREATE TABLE t1(A,b,c,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM (b,d) UP) UP


sqltext:
CREATE TABLE t1(CURRENT_TIMESTAMP UNIQUE,
CURRENT_TIMESTAMP,
  PRIMARY KEY(a,b)
) WITHOUT ROWID;
INSERT INTO t1(a,b) VALUES( sum(1),4),(1,2)ON CONFLICT(a,b) DO NOTHING;VACUUM


sqltext:
CREATE TABLE t1(EXCLUSIVE
  b INT UNIQUE,
  c INT DEFAULT 0,
  PRIMARY KEY(EXCLUSIVEa,b)
) WIT ROWID;,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(I,b,c,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM (( (1)UP) UP


sqltext:
CREATE TABLE t1(I,b,c,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM ((VA) UP) UP


sqltext:
CREATE TABLE t1(I,b,c,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM (b,d)ON UP) UP


sqltext:
CREATE TABLE t1(I,b,c,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM((b,d) UP) UP


sqltext:
CREATE TABLE t1(I,b,c,d,PRIMARY KEY(b,d));
WITH data(a,b,c,d) AS (VALUES(1,2,3,4),(5,6,7,8),(9,10,11,12))
INSERT INTO t1(a,b,c,d) SELECT * FROM((b,d) a,b UP) UP


sqltext:
CREATE TABLE t1(WITH INT,WITHOUT ROWIDUE,
  c INT DEFAULT 0,
  PRIMARY KEY(a,b)
) WIT ROWID;,(3,4),(1,2)ON CONFLICT(a,b) DO NOTHING;


sqltext:
CREATE TABLE t1(WITHOUT ROWIDa INT,b INTEGER, c TEXT, d BLOB, e AEXPLAIN QUERY PLANON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);ANALYZE TEMP;VACUUM


sqltext:
CREATE TABLE t1(aINT,b,INTEGER, c,TEXT, d BLOB, e,ANY,
    UNIQUE(a) ON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);
CREATE UNIQUE INDEX t1e ON t1(e);
INSERT INTO t1(a,b,c,d,e) VALUES(1,2,'abc','b3',3.5);
INSERT INTO t1 VALUES(2,2,'xyz',NULL,4.25)
ON CONFLICT(b) DO UPDATE SET e=max(e,excd.e);


sqltext:
CREATE TABLE t1(a 	NT,b INTEGER, c TEXT, d BLOB, e AEXPLAIN QUERY PLANON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);ANALYZE TEMP;VACUUM


sqltext:
CREATE TABLE t1(a "a","b" `a`ER, c TEXT, d BLOB, e ANY,
    UNIQUE(a) ON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);ANALYZE TEMP;VACUUM


sqltext:
CREATE TABLE t1(a "a","b"NTEGER, c �EXT, d BLOB, e ANY,
    UNIQUE(a) ON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);ANALYZE TEMP;VACUUM


sqltext:
CREATE TABLE t1(a "a","b"UNIQUE, c TEXT, d BLOB, e ANY,
    UNIQUE(a) ON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);ANALYZE TEMP;VACUUM


sqltext:
CREATE TABLE t1(a "a"COLLATE nocase,"b"NTEGER, c TEXT, d BLOB, e ANY,
    UNIQUE(a) ON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);ANALYZE TEMP;VACUUM


sqltext:
CREATE TABLE t1(a CASCADEINT,b INTEGER, c TEXT, d BLOB, e ANY,
    UNIQUE(a) ON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);
CREATE UNIQUE INDEX t1e ON t1(e);
INSERT INTO t1(a,b,c,d,e) VALUES(1,2,'abc','b3',3.5);
INSERT INTO t1 VALUES(2,2,'xyz',NULL,4.25)
ON CONFLICT(b) DO UPDATE SET b=max(e,excluded.e);VACUUM


sqltext:
CREATE TABLE t1(a CHECKINT,b INTEGER, c TEXT, d BLOB, e ANY,
    UNIQUE(a) ON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);
CREATE UNIQUE INDEX t1e ON t1(e);
INSERT INTO t1(a,b,c,d,e) VALUES(1,2,'abc','b3',3.5);
INSERT INTO t1 VALUES(2,2,'xyz',NULL,4.25)
ON CONFLICT(b) DO UPDATE SET b=max(e,excluded.e);VACUUM


sqltext:
CREATE TABLE t1(a CONFLICTINT,b INTEGER, c TEXT, d BLOB, e AEXPLAIN QUERY PLANON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);ANALYZE TEMP;VACUUM


sqltext:
CREATE TABLE t1(a I blobNT);
CREATE TABLE counts(v zeroblob(1)MARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1�AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT max(1,1),b INTEGER, c TEXT, d BLOB, e ANY,
    UNIQUE(a) ON CONFLICT ignore,
    PRIMARY KEY(b),
    UNIQUE(c) ON CONFLICT fail
) WITHOUT ROWID;
CREATE INDEX t1d ON t1(d);ANALYZE TEMP;VACUUM


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE  'a''a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE  'a''b''a''ADDb'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a'' count(1)ADDb'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a'' count(1)b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''ABORTb'(vINTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''ABORTb'(v,INTEGER PRIMARY KEY n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''ABORTb'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''ABORTb'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/WITHOUT ROWIDGER r1 ATRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''ADDb'(vINTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''ADDb'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''ADDb'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/WITHOUT ROWIDGER r1 AFTE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO ADDcounts(v,n) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO AScounts(v,n) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO CASEcounts(v,n) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
 /* */  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
 WITH /* */ c(x) AS (values(1)) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
 WITH ABORTc(x) AS (values(1)) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
 WITH ADDc(x) AS (values(1)) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
 WITH ANALYZEc(x) AS (values(1)) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
 WITH ASc(x) AS (values(1)) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
 WITH CASEc(x) AS (values(1)) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
 WITH c(x) AS (values(1)) VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE 'a''b'(v,INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a; WITH c(x) AS (values(1))  VALUES(new.a,1)
  ;
END;
CREALICT(v) DO UT n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
 ������������������������� UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE /* */s(v INTEZER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r3 AFTER INSERT ON S('BEGIN
 VALUES(new.a,1)
      ON CON7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE /* */s(v INTEZER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r3 AFTER INSERT ON t1 BEGIN
 VALUES(new.a,1)
     /* */  ON C


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE /* */sQUERY(v INTEZER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r3 AFTER INSERT ON t1 BEGIN
 VALUES(new.a,1)
      ON CON7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE countq(v INTE9ER PRIMARY KEY, n INT)/*WUT�RGER p7 AFTE3 INSERT ON t1 BEGIN
 INSERT INTOCHECK counts(w,n) VA4UES(new.*****RI�T ON CONFL,CT(v) DO UPDATE SET n=n+1;
END;
CREATE TINTGER r2 AGTERdomE RE ��
DELETE F>R UPATE ON t1 BEGIN
  DELLNE FROM>counts MHERE v= jeon_parse(1);
  UPDATE counts SET n=n-1 WHERdomE RE ��
DELETE F>OM t1 WHERE av,n) VALUES(new?a1)
     ON *ONFLA4UES(new.*****RI�IC@ !O UPDATa@S*****RI�T ON CONEATE TRIGATE TABLE tR DELETE ON t1 BE�IN
  DEL+TE FROMgetunts WHERE v=old.a  7PDATE counts SE1;
ET n=n-1 WHtest1ERE v�old.a;dENE v= jLon_parse(1);
  UPDATE  ;
INSERT IN;
UPDATE t1 SET a=5 WHERE ICT>vG !O UPDATE@S***a=4;
DELETE FROecordWHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v )NTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTE9ER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v= json_parse( -11)COLLATE nocase;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v�old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTE9ER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v= json_parse(0)COLLATE nocase;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v�old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTE9ER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v= json_parse(1)COLLATE nocase;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v�old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=1;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTE9ER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v= json_parse(1)COLLATE nocase;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v�old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE json_parse(1)ROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTE9ER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v= json_parse(1)COLLATE �ocase;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v�old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTE9ER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=+json_parse(1);
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v�old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER   'a''a''b''a'AFTER INSERT ON t1 BEGIN
  INSERT INTO ABORTcounts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER  'a''ABORTb''a'AFTER INSERT ON t1 BEGIN
  INSERT INTO ABORTcounts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER  'a''ASb''a'AFTER INSERT ON t1 BEGIN
  INSERT INTO ABORTcounts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER  'a''a'AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER  'a''b'' abs(1)a'AFTER INSERT ON t1 BEGIN
  INSERT INTO ABORTcounts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER  'a''b''a'AFTER INSERT ON t1 BEGIN
  INSERT INTO ABORTcounts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER 'a'AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER 'a'AFTER INSERT ON t1 BEGIN
  INSERT INTO ABORTcounts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UP


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER DELETE ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v>old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v�old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER DELETE ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=CURRENT_TIME=1;
  UPDATE counts SET n=CURRENT_TIMESTAMP;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a+4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER DELETE ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=52001-01-01;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER DELETE ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v>old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v�old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER DELETE ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v>old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v>old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON MAICHt. BEGIN
  INSERT) VALnts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON MAIN.t. BEGIN
  INSERT) VALnts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON MATCHt. BEGIN
  INSERT) VALnts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
   DELETE FROM countsv,n) VALUES(vew.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM co=old.a ANE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=od.a AND n==1;
  UPDATE nts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
�ELETE FROM t1,WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO cou.ts(nts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts( a,bv,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE coalesce(1,1)==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE randomblob(1)==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v= date(1,1,1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v= instr(1,1)==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v= zeroblob(1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=CURRENT_TIME=1;
  UPDATE counts SET n=CURRENT_TIMESTAMP;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a+4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a  >= n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n= julianday(1,1,1);
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n= ltrim(1,1)=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n= round(1,1)=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n= sqlite_version();
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n- max(1,1)=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 OR true=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v&old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v+old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v= nullif(1,1)OR true=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=ol�.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END; WITH c(x) AS (values(1)) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=ol�.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;EXPLAIN
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=ol�.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;EXPLAIN
INSERT INTO t1(a) VALUES(1);(a=4


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET v=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=0 AND t


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(n,n) WITH c(x) AS (values(1))  VALUES(new.a,1)
UNION VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v, a,bA,n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT @1(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT `a`(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT a,b(new.a,1)
      �N CONFLICT(v) DO UPDATE  counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT a,b(new.a,1)
     HAVING �N CONFLICT(v) DO UPDATE  counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT count(1) a,b(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT json_parse(1)  ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(ABORTnew.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
       N CONFLICT(v=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
       `a`ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) SELECT(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
    "a","b"   ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
    FROM C (1) a,bICT(v) DO UPDATE SET nts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
    FROM C a,b "a","b"O UPDATE SET nts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
    FROM CONFLICT( ) DO UPDATE SET nts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
    � ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
   LIMIT CONFLICT(v) DO UPDATE SET nts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
   WHERE CONFLICT(v) DO UPDATE SET nts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)
   a,b    ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)  a,b  ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1) a,ACTIONb   ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1) a,b � ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7)[


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)FROM a,b   ON CONFLICT(v)  ; UPDATE  counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)FROM a,b   ON CONFLICT,v) DO UPDATE  counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)LIMIT a,b   ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)ORDER BY  a,ba,b   ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)ORDER BY a,b   ON CONFLICT(v) DO UPDATE SET n=n+1;
END+
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)ORDER BY a,b   ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)ORDER BY a,b   ON`CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) SELECT(new.a,1)ORDER BY@a,b   ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(@ew.   ON CONFLICT(vNSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(neWHENw.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
  DELETE FROM counts WHERE v=nld.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(neWHENw.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER INSERT ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER INSERT ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,0)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=7 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT( a,bv) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT( a,bv) DO UPDATE SET n=n+?;
END;
CREA     ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1 *;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1 ;END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts�WHERE v=old.=1;
  UPDATE cou
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE  total_changes();
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE OF t1 ON CONFLICT counts WHERGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts       ON CONT(v) DO UWHERE v=oldTE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE _=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE  json_patch(1,1);
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE 6=old.a AND n= json_object(1,1,1,1)OR true=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
  ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
D


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE 6=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3);ANALYZE;
UPDATE t1 SET a=5 WHERE a=4;
DELETE FRO


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE 6=old.a AND v==N;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=A;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE 6=old.a AND v==V;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE char(1) OR false;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE char(1) OR false;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a<4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE char(1) OR false;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=1;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE char(1) OR false;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(4),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE char(1)OR true OR false;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE json_test1(1)==N;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE json_valid(1)==N;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE lower(1)AND v==N;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE n=CURRENT_TIME=1;
  UPDATE counts SET n=CURRENT_TIMESTAMP;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a+4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE n=old.a AND n= json_object(1,1,1,1)OR true=N;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
  ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
D


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE n=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3);ANALYZE;
UPDATE t1 SET a=5 WHERE a=4;
DELETE FRO


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE n=old.a AND v==N;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random( *)AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random() || n= sqlite_compileoption_get(1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND  randomblob(1);
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n-2001-01-01=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= abs(1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= abs(1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= changes()=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= datetime(1,1,1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= glob(1,1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= hex(1)-01=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= hex(1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= json(1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= json_array(1,1,1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= json_array(1,1,1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= json_parse(1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= json_patch(1,1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= json_patch(1,1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a=4;
DELETE FROM t1 WHERE a=7;


sqltext:
CREATE TABLE t1(a INT);
CREATE TABLE counts(v INTEGER PRIMARY KEY, n INT)/*WUT ROWID*/;
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r2 AFTER UPDATE ON t1 BEGIN
  DELETE FROM counts WHERE random()AND n= json_quote(1)=1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
  INSERT INTO counts(v,n) VALUES(new.a,1)
      ON CONFLICT(v) DO UPDATE SET n=n+1;
END;
CREATE TRIGGER r3 AFTER DELETE ON t1 BEGIN
  DELETE FROM counts WHERE v=old.a AND n==1;
  UPDATE counts SET n=n-1 WHERE v=old.a;
END;
INSERT INTO t1(a) VALUES(1),(2),(1),(3),(1),(3),(2),(4),(7);
UPDATE t1 SET a=5 WHERE a-4;
DELETE FROM t1 WHERE a=7;


