Implemented mysql-specific iterator functionality

Added code to the iterator's buildSQL function to prevent the generation of the nested inner query on MySQL (since we're using INSERT...ON DUPLICATE UPDATE... to avoid the dupes).