-- Fixing bug [ 1871789 ] XQ: substitution fails
-- Fixing bug [ 1871789 ] XQ: substitution fails

   When introducing new thetajoin predicates we first generated
   a new thetajoin before adding the new predicate. This resulted
   in a schema that was off sync. Now we first add the predicate
   before creating the new thetajoin operator.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb