support for union all synax and fix transaction bugs