-- This script exercises various create index statements
-- to see what sqlite recognises as a column name.
drop table if exists results;
create table results('create index','select','using index','sort column');
drop table if exists a; -- data to sort
create table a("123",col1,"abort","null", "add");
insert into a values('<not sorted>','zzz','zzz','zzz','zzz');
insert into a values(123,'zzz','zzz','zzz','zzz');
insert into a values('abort','zzz','abort','zzz','zzz');
insert into a values('add','zzz','zzz','zzz','add');
insert into a values('col1','col1','zzz','zzz','zzz');
insert into a values('null','zzz','zzz','null','zzz');
insert into a values('{where matched}','{where matched}',
                     '{where matched}','{where matched}','{where matched}');
drop table if exists b; -- expression to test
create table b(x,y,z integer primary key);
drop table if exists c; -- create index statement
create table c(x,y integer primary key);
drop table if exists d; -- select statement
create table d(x,y integer primary key);
drop table if exists e; -- error message
create table e(x,y,z integer primary key);
-- table h is never actually created
-- 123
replace into b values('123','123',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 123
replace into b values('123','''123''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 123
replace into b values('123','"123"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 123
replace into b values('123','`123`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- '123'
replace into b values('''123''','''123''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- '123'
replace into b values('''123''','"123"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- "123"
replace into b values('"123"','"123"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- `123`
replace into b values('`123`','`123`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- [123]
replace into b values('[123]','[123]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (123)
replace into b values('(123)','(123)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (123)
replace into b values('(123)','(''123'')',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (123)
replace into b values('(123)','("123")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (123)
replace into b values('(123)','(`123`)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('123')
replace into b values('(''123'')','(123)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('123')
replace into b values('(''123'')','(''123'')',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('123')
replace into b values('(''123'')','("123")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('123')
replace into b values('(''123'')','(`123`)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ("123")
replace into b values('("123")','("123")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (`123`)
replace into b values('(`123`)','(`123`)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ([123])
replace into b values('([123])','([123])',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||123
replace into b values('''a''||123','''a''||123',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||123
replace into b values('''a''||123','''a''||''123''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||123
replace into b values('''a''||123','''a''||"123"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||123
replace into b values('''a''||123','''a''||`123`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'123'
replace into b values('''a''||''123''','''a''||''123''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'123'
replace into b values('''a''||''123''','''a''||"123"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||"123"
replace into b values('''a''||"123"','''a''||"123"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||`123`
replace into b values('''a''||`123`','''a''||`123`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||[123]
replace into b values('''a''||[123]','''a''||[123]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- col1
replace into b values('col1','col1',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- col1
replace into b values('col1','''col1''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'col1'
replace into b values('''col1''','''col1''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'col1'
replace into b values('''col1''','"col1"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- "col1"
replace into b values('"col1"','"col1"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- `col1`
replace into b values('`col1`','`col1`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- [col1]
replace into b values('[col1]','[col1]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (col1)
replace into b values('(col1)','(col1)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('col1')
replace into b values('(''col1'')','(''col1'')',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('col1')
replace into b values('(''col1'')','("col1")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ("col1")
replace into b values('("col1")','("col1")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (`col1`)
replace into b values('(`col1`)','(`col1`)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ([col1])
replace into b values('([col1])','([col1])',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||col1
replace into b values('''a''||col1','''a''||col1',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'col1'
replace into b values('''a''||''col1''','''a''||''col1''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'col1'
replace into b values('''a''||''col1''','''a''||"col1"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||"col1"
replace into b values('''a''||"col1"','''a''||"col1"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||`col1`
replace into b values('''a''||`col1`','''a''||`col1`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||[col1]
replace into b values('''a''||[col1]','''a''||[col1]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- abort
replace into b values('abort','abort',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- abort
replace into b values('abort','''abort''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- abort
replace into b values('abort','"abort"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'abort'
replace into b values('''abort''','''abort''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'abort'
replace into b values('''abort''','"abort"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- "abort"
replace into b values('"abort"','"abort"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- `abort`
replace into b values('`abort`','`abort`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- [abort]
replace into b values('[abort]','[abort]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (abort)
replace into b values('(abort)','(abort)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (abort)
replace into b values('(abort)','(''abort'')',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (abort)
replace into b values('(abort)','("abort")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('abort')
replace into b values('(''abort'')','(''abort'')',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('abort')
replace into b values('(''abort'')','("abort")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ("abort")
replace into b values('("abort")','("abort")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (`abort`)
replace into b values('(`abort`)','(`abort`)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ([abort])
replace into b values('([abort])','([abort])',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||abort
replace into b values('''a''||abort','''a''||abort',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||abort
replace into b values('''a''||abort','''a''||''abort''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||abort
replace into b values('''a''||abort','''a''||"abort"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'abort'
replace into b values('''a''||''abort''','''a''||''abort''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'abort'
replace into b values('''a''||''abort''','''a''||"abort"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||"abort"
replace into b values('''a''||"abort"','''a''||"abort"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||`abort`
replace into b values('''a''||`abort`','''a''||`abort`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||[abort]
replace into b values('''a''||[abort]','''a''||[abort]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- add
replace into b values('add','add',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- add
replace into b values('"add"','add',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- add
replace into b values('add','''add''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- add
replace into b values('add','"add"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'add'
replace into b values('''add''','''add''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'add'
replace into b values('''add''','"add"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- "add"
replace into b values('"add"','"add"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- `add`
replace into b values('`add`','`add`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- [add]
replace into b values('[add]','[add]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (add)
replace into b values('(add)','(add)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (add)
replace into b values('(add)','(''add'')',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (add)
replace into b values('(add)','("add")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('add')
replace into b values('(''add'')','(''add'')',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('add')
replace into b values('(''add'')','("add")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ("add")
replace into b values('("add")','("add")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (`add`)
replace into b values('(`add`)','(`add`)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ([add])
replace into b values('([add])','([add])',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||add
replace into b values('''a''||add','''a''||add',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||add
replace into b values('''a''||add','''a''||''add''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||add
replace into b values('''a''||add','''a''||"add"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'add'
replace into b values('''a''||''add''','''a''||''add''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'add'
replace into b values('''a''||''add''','''a''||"add"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||"add"
replace into b values('''a''||"add"','''a''||"add"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||`add`
replace into b values('''a''||`add`','''a''||`add`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||[add]
replace into b values('''a''||[add]','''a''||[add]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- null
replace into b values('null','null',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- null
replace into b values('null','''null''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- null
replace into b values('null','"null"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'null'
replace into b values('''null''','''null''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'null'
replace into b values('''null''','"null"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- "null"
replace into b values('"null"','"null"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- `null`
replace into b values('`null`','`null`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- [null]
replace into b values('[null]','[null]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (null)
replace into b values('(null)','(null)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (null)
replace into b values('(null)','(''null'')',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (null)
replace into b values('(null)','("null")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('null')
replace into b values('(''null'')','(''null'')',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ('null')
replace into b values('(''null'')','("null")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ("null")
replace into b values('("null")','("null")',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- (`null`)
replace into b values('(`null`)','(`null`)',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ([null])
replace into b values('([null])','([null])',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||null
replace into b values('''a''||null','''a''||null',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||null
replace into b values('''a''||null','''a''||''null''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||null
replace into b values('''a''||null','''a''||"null"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'null'
replace into b values('''a''||''null''','''a''||''null''',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||'null'
replace into b values('''a''||''null''','''a''||"null"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||"null"
replace into b values('''a''||"null"','''a''||"null"',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||`null`
replace into b values('''a''||`null`','''a''||`null`',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- 'a'||[null]
replace into b values('''a''||[null]','''a''||[null]',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- action
replace into b values('action','action',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- after
replace into b values('after','after',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- all
replace into b values('all','all',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- alter
replace into b values('alter','alter',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- analyze
replace into b values('analyze','analyze',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- and
replace into b values('and','and',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- as
replace into b values('as','as',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- asc
replace into b values('asc','asc',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- attach
replace into b values('attach','attach',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- autoincrement
replace into b values('autoincrement','autoincrement',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- before
replace into b values('before','before',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- begin
replace into b values('begin','begin',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- between
replace into b values('between','between',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- by
replace into b values('by','by',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- cascade
replace into b values('cascade','cascade',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- case
replace into b values('case','case',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- check
replace into b values('check','check',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- collate
replace into b values('collate','collate',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- column
replace into b values('column','column',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- commit
replace into b values('commit','commit',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- conflict
replace into b values('conflict','conflict',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- constraint
replace into b values('constraint','constraint',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- create
replace into b values('create','create',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- cross
replace into b values('cross','cross',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- current_date
replace into b values('current_date','current_date',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- current_time
replace into b values('current_time','current_time',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- current_timestamp
replace into b values('current_timestamp','current_timestamp',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- database
replace into b values('database','database',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- default
replace into b values('default','default',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- deferrable
replace into b values('deferrable','deferrable',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- deferred
replace into b values('deferred','deferred',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- delete
replace into b values('delete','delete',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- desc
replace into b values('desc','desc',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- detach
replace into b values('detach','detach',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- distinct
replace into b values('distinct','distinct',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- drop
replace into b values('drop','drop',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- each
replace into b values('each','each',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- else
replace into b values('else','else',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- end
replace into b values('end','end',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- escape
replace into b values('escape','escape',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- except
replace into b values('except','except',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- exclusive
replace into b values('exclusive','exclusive',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- exists
replace into b values('exists','exists',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- explain
replace into b values('explain','explain',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- fail
replace into b values('fail','fail',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- for
replace into b values('for','for',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- foreign
replace into b values('foreign','foreign',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- from
replace into b values('from','from',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- full
replace into b values('full','full',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- glob
replace into b values('glob','glob',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- group
replace into b values('group','group',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- having
replace into b values('having','having',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- if
replace into b values('if','if',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- ignore
replace into b values('ignore','ignore',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- immediate
replace into b values('immediate','immediate',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- in
replace into b values('in','in',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- index
replace into b values('index','index',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- indexed
replace into b values('indexed','indexed',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- initially
replace into b values('initially','initially',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- inner
replace into b values('inner','inner',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- insert
replace into b values('insert','insert',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- instead
replace into b values('instead','instead',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- intersect
replace into b values('intersect','intersect',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- into
replace into b values('into','into',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- is
replace into b values('is','is',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- isnullreplace into b values('isnull','isnull',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- join
replace into b values('join','join',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- key
replace into b values('key','key',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- left
replace into b values('left','left',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- like
replace into b values('like','like',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- limit
replace into b values('limit','limit',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- match
replace into b values('match','match',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- natural
replace into b values('natural','natural',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- no
replace into b values('no','no',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- not
replace into b values('not','not',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- notnull
replace into b values('notnull','notnull',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- of
replace into b values('of','of',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- offset
replace into b values('offset','offset',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- on
replace into b values('on','on',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- or
replace into b values('or','or',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- order
replace into b values('order','order',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- outer
replace into b values('outer','outer',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- plan
replace into b values('plan','plan',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- pragma
replace into b values('pragma','pragma',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- primary
replace into b values('primary','primary',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- query
replace into b values('query','query',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- raise
replace into b values('raise','raise',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- recursive
replace into b values('recursive','recursive',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- references
replace into b values('references','references',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- regexp
replace into b values('regexp','regexp',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- reindex
replace into b values('reindex','reindex',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- release
replace into b values('release','release',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- rename
replace into b values('rename','rename',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- replace
replace into b values('replace','replace',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- restrict
replace into b values('restrict','restrict',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- right
replace into b values('right','right',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- rollback
replace into b values('rollback','rollback',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- row
replace into b values('row','row',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- savepoint
replace into b values('savepoint','savepoint',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- select
replace into b values('select','select',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- set
replace into b values('set','set',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- table
replace into b values('table','detach',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- temp
replace into b values('temp','temp',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- temporary
replace into b values('temporary','temporary',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- then
replace into b values('then','then',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- to
replace into b values('to','to',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- transaction
replace into b values('transaction','transaction',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- trigger
replace into b values('trigger','trigger',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- union
replace into b values('union','union',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- unique
replace into b values('unique','unique',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- update
replace into b values('update','update',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- using
replace into b values('using','using',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- vacuum
replace into b values('vacuum','vacuum',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- values
replace into b values('values','values',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- values
replace into b values('values','values',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- view
replace into b values('view','view',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- virtual
replace into b values('virtual','virtual',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- when
replace into b values('when','when',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- where
replace into b values('where','where',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- with
replace into b values('with','with',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- without
replace into b values('without','without',1);
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)||');',1);
replace into d values('select "123" from a order by '
 ||(select y from b)||';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''order by failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a order by '||(select y from b)||' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
drop table if exists f; -- result of explain query plan
drop index if exists g; -- index to test
replace into c values('create index g on a('||(select x from b)
 ||')where '||(select y from b) ||'=''{where matched}'';',1);
replace into d values('select "123" from a where '
 ||(select y from b)||'=''{where matched}'';',1);
replace into e values('create index failed',exec('f',(select x from c)),1);
values(exec('h', case (select y from e) isnull
 when 1 then 'replace into e values(''where failed'',exec(''f'','
  ||'''explain query plan ''||(select x from d)||'';''),1);'
 else '--' end));
values(exec('h', case (select y from e) isnull
 when 1 then 'insert into results values((select x from c),(select x from d),'
  ||'case exists (select * from f where detail like ''%INDEX%'')'
  ||' when 1 then ''Yes'' else ''No'' end,'
  ||'(select "123" from a where '||(select y from b)
  ||'=''{where matched}'' limit 1));'
 else 'insert into results values((select x from c),(select x from d),'
  ||'(select x from e),(select y from e));'end));
-- tidy up
drop table if exists a;
drop table if exists b;
drop table if exists c;
drop table if exists d;
drop table if exists e;
drop table if exists f;
drop index if exists g;
select * from results;