Merge "database: Simplify selectSQLText() and fix USE INDEX bug"