(ITS#7158) Fix a crash in back-sql