(ITS#5252) Several SQL Bugs in back-sql