This is a Known Bug with Net::MySQL.
But the bigger question is why you are not using DBI and DBD::mysql? Those are time-tested, solid, and often recommended modules for MySQL work.
grep
| XP matters not. Look at me. Judge me by my XP, do you? |
| [reply] |
Indeed. Not using DBD::mysql because it doesn't compile on my system. If I can't fix it, I may resort to installing mysql from source and then trying DBD::mysql again...
| [reply] |
Wild guess: your problem is that you don't have the libmysqlclient development files installed. Search for a package named libmysqlclient-dev or something like that.
| [reply] |
What problems do you have compiling DBD::mysql? I'm quite sure one of us can help you resolve them.
grep
| XP matters not. Look at me. Judge me by my XP, do you? |
| [reply] |
Right... My earlier (in hindsight rather foolish) 'fix' for NET::MySQL didn't work :) A better solution would be to check whether the size of the packet is less than BUFFER_LENGTH (rather than the arbitrary 512 bytes as before) and if so not call recv again (in _get_record_by_serve). However I don't know if the buffer is always garanteed to be full where more data is yet to come. Another fix which I'm using at the moment is, since the last five bytes of the packet always seem to be "\xfe\0\0\x02\x00" for SELECT queries on empty tables, to change the funtion 'sub _has_next_packet' in MySQL.pm to this:
sub _has_next_packet
{
my $self = shift;
return substr($_[0], -5) !~ qr/(\xfe\0\0\x22\x00|\xfe\0\0\x02\x00)
+/;
}
My worry with this fix is that "\xfe\0\0\x02\x00" might on very rare occations be valid table data at the end of the packet... It would be nice to find a mysql doc with what all the end codes actually mean, so I can be 100% sure this is a safe fix..., but I've tried the above on my database and it works beautifully (for now) :) | [reply] [d/l] |