Redmine#4301: iteration through data container causes ProgrammingError