Fixes #550: MySQL dialect doesn't work when connection is specified by using the QueryBuilder