Sql Fix after 1087e5f5