Test case:
create or alter view v_test (id, col)
as
select rdb$relation_id, 1 from rdb$relations;
commit;
-- reconnect;
create or alter view v_test (id)
as
select rdb$relation_id from rdb$relations
union all
select rdb$relation_id from rdb$relations;
commit; -- here the crash happens
This is a regression introduced while fixing
CORE-2386.