Add error handling that was missing in SELECT query
Add tests for MySQL and PostgreSQL dialects