Changes related to MySQL, changing queries that were built for SQLite