Test case for the bug when using rawsql