fix a sql issue.