views:

19

answers:

0

Hi to all,

i get a really strange, pointless and totally random error when i fetch rows from a resource (query) using PHP.

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 db machine.

I'm using mysql extension (not mysqli or mysqlnd), but looking around i founded a patch regarding this error related to mysqlnd extension, so, probably, i should try.

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 fastly 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, db isn't mine, and make some pdf from this object) after a while (random time) i get this error "Empty row packet body".

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.