reworking send_data for mysql in situations where a query won't fit into
memory