Fixed a bug in the mysql query builder.