title: Strange MySQL error "Empty row packet body" when using mysql_fetch_object (PHP 5.3.3)
body: <p>I get a really strange, pointless and totally random error when I fetch rows from a resource (query) using PHP.</p>
  
  <p>My development machine is a Windows XP SP3 with Apache 2.2 while MySQL runs on a virtual machine, using ubuntu 10.04, with 768mb of ram, 100GB of HDD and 4 logic cores (Intel q6600). However this problem is not related to PHP on windows because I get the same error when I run the code on the database machine.</p>
  
  <p>I'm using <code>mysql</code> extension (not <code>mysqli</code> or <code>mysqlnd</code>), but looking around I founded a patch regarding this error related to mysqlnd extension, so, probably, I should try.</p>
  
  <p>The main problem is that when I execute this query (a really big query with a couple of derived table and more than 20 joins) and process results fast and all goes well, but when my code spent around 15/20 seconds to process a block of rows (I need build an object from a block of rows linked in a really particular way between them, I can't change this, database isn't mine, and make some PDF from this object) after a while (random time) I get this error "Empty row packet body".</p>
  
  <p>I use unbuffered queries to reduce memory consumption (if I enable buffering I get around 260MB of used memory) but this shouldn't be the problem.</p>