modify according to comments and add test in SQLSuite