title: How to set MYSQL_ATTR_USE_BUFFERED_QUERY attribute in Drupal way?
body: <p>I have site on D7 / Bluehost which was throwing me an error that said: </p>
  
  <blockquote>
    <p>"cannot execute queries while other unbuffered queries are active" </p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>"you may enable query buffering by setting the
    PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute"</p>
  </blockquote>
  
  <p>So, in the emergency I add this line to database.inc (line 306) and worked:</p>
  
  <pre><code>$this-&gt;setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
  </code></pre>
  
  <p>So, rigth now the site is running fine, but I don't know how to fix this problem the Drupal Way. I know it's not good to modify core or a module.</p>
  
  <p>I don't know how to set an attribute to a PDO connection without modifying core or modules. </p>
  
  <p>Do you know an elegant solution?</p>