"When I change the query to pull less data, I don't get this error."
Sounds like the problem I was having earlier where my program
would grow to insane sizes even though I thought I was fetching
individual rows. The truth is, I was downloading the entire
query into some DBI driver loading zone, and was fetching
rows from there.
Check with your DBI driver to see if you can switch it to
an incremental method. kschwab was helpful in pointing out
how do to this in MySQL.