Fix a planner issue where left and right children of join are the same relational expression, caused by a self-join query.
Fix excessive logging by creating a single point to create BasicDataSource, and if it is for hsqldb, setting a property to prevent hsqldb from reconfiguring java.util.logging.