fix segfault in subquery_planner() when accessing parent_root
authorTomas Vondra <[email protected]>
Mon, 9 Jan 2017 21:10:56 +0000 (22:10 +0100)
committerTomas Vondra <[email protected]>
Mon, 9 Jan 2017 21:10:56 +0000 (22:10 +0100)
commit695d5ba977f5f78faa2e0cafd04401a5978196e5
treeb10b062d1b50519cfb0c00b22814bd0bb225948e
parent512af227199a480f74b2906ab534a07453e80c28
fix segfault in subquery_planner() when accessing parent_root

The check was moved at the very beginning, not realizing the pointer
may be NULL for outer-most queries. So evaluate the level explicitly.
src/backend/optimizer/plan/planner.c