Fix a planner issue where left and right children of join are the same relational expression, caused by a self-join query.