Fix missing escape of GROUP BY and ORDER BY clause.
Merge pull request #836 from jails/bug/database-escape

Fix missing escape of GROUP BY and ORDER BY clause.