Differences in local/sd99 sql, Fixes #6245