Fix for cursors in ZigZag Merge Join queries.