Fix an use-after-statement-closed error with USING PERIODIC COMMIT
Merge pull request #3706 from jakub-/user-after-statement-closed

Fix an use-after-statement-closed error with USING PERIODIC COMMIT
Merge 2.1-maint in master
Return no plan from expand/join if the subgraphs cannot be planned (i.e., they are not in the cache)
Exhaustive planner can plan cartesian products