Fixing up the testcase around SQL generation