The following SQL run in a shell generates a segmentation fault:

<pre>create view v0 as select 0 as n;
create view v1 as select * from v0 union select * from v0;
create view v2 as select * from v1 union select * from v1;
create view v3 as select * from v2 union select * from v2;
create view v4 as select * from v3 union select * from v3;
create view v5 as select * from v4 union select * from v4;
create view v6 as select * from v5 union select * from v5;
create view v7 as select * from v6 union select * from v6;
create view v8 as select * from v7 union select * from v7;
create view v9 as select * from v8 union select * from v8;
create view v10 as select * from v9 union select * from v9;
create view v11 as select * from v10 union select * from v10;
create view v12 as select * from v11 union select * from v11;
create view v13 as select * from v12 union select * from v12;
create view v14 as select * from v13 union select * from v13;
create view v15 as select * from v14 union select * from v14;
create view v16 as select * from v15 union select * from v15;
create view v17 as select * from v16 union select * from v16;
create view v18 as select * from v17 union select * from v17;
create view v19 as select * from v18 union select * from v18;
create view v20 as select * from v19 union select * from v19;</pre>

This fault has been present in the code since version 2013-01-09 and early.