title: connection error when executing multiple queries on RMySQL
body: <p>I m running the following code block 8 times, but with different queries in three different R scripts. I have already established the connection with the server.</p>
  
  <pre><code>rs&lt;-dbSendQuery(con,"select owner_name, owner_domain, count(*) as avg from kapsule,
  recview_history where recview_history.vsrc='em' and 
  recview_history.g_conf_id=kapsule.g_conf_id group by owner_name;")
  
  d&lt;-fetch(rs, n=0)
  d$test&lt;-apply(d,1,function(row) 1)
  dp&lt;-ddply(d, .(test), transform, percentile=ecdf(avg)(avg))
  write.csv(dp, file="/tmp/creator_data/embeds.csv")
  rm(rs)
  rm(d)
  rm(dp)
  </code></pre>
  
  <p>I m running this on a very large data set and hence after the first two csv's are created in each script, the script gives the following error.</p>
  
  <pre><code>Error in mysqlExecStatement(conn, statement, ...) :
  RS-DBI driver: (connection with pending rows, close resultSet before continuing)
  </code></pre>
  
  <p>when i ran the three scripts earlier on a smaller data set, they worked fine. Is the problem due to the large size of the data in the MySQL server? Any help in this regard will be duly appreciated. Thank you in advance.</p>