ID: 28763 Updated by: [EMAIL PROTECTED] Reported By: johnfivealive at hotmail dot com -Status: Open +Status: Feedback Bug Type: Unknown/Other Function Operating System: Fedora Core 2 PHP Version: 5.0.0RC3 New Comment:
Check you mysql settings: http://dev.mysql.com/doc/mysql/en/Communication_errors.html Previous Comments: ------------------------------------------------------------------------ [2004-06-13 18:02:35] johnfivealive at hotmail dot com Description: ------------ Whenever I execute a MySQL query I call my escapeString function to escape strings properly before inserting them into the database. When I call the tidy_repair_string function from my escapeString function, I start seeing the following error in the MySQL error log: Aborted connection 199 to db: 'logik' user: 'logik' host: `localhost' (Got an error reading communication packets) This error only seems to occur when I'm attempting to execute a lot of queries in succession, for example importing a large XML file into my database. I think there is some bug between PHP and the Tidy extension. Perhaps Tidy is taking too long to return or their are some thread synchronization issues which are causing MySQL to malfunction. I'm pretty sure it is the Tidy extension that is causing problems here because when I comment out the call to tidy_repair_string my program works with no problems whatsoever. Tidy info as reported by phpinfo(): tidy Tidy support enabled libTidy Release 1st June 2004 Extension Version 2.0-dev ($Id: tidy.c,v 1.53 2004/05/28 20:32:52 john Exp $) Reproduce code: --------------- This is how I'm calling tidy_repair_string: public static function tidyString( $string ) { $tidyOptions = array( "bare" => true, "break-before-br" => true, "char-encoding" => "latin1", "clean" => true, "doctype" => "omit", "drop-proprietary-attributes" => true, "logical-emphasis" => false, "output-xhtml" => true, "quote-ampersand" => true, "show-body-only" => true, "word-2000" => true, "wrap" => 0 ); // Get rid of all funky characters return tidy_repair_string( $string, $tidyOptions ); // PHP 5 } Expected result: ---------------- Tidy should work in sequence with MySQL queries. Actual result: -------------- The correct string is returned, but when queries need to be executed quickly and in succession things start getting erratic and MySQL says: Aborted connection 199 to db: 'logik' user: 'logik' host: `localhost' (Got an error reading communication packets) Also PHP outputs the following warning: Warning: Unknown list entry type in request shutdown (18545152) in Unknown on line 0 Other times, the script never finishes executing, thus no output is produced, warnings or otherwise. There are also MySQL warnings, but these are a result of Tidy not returning the correct string, or perhaps not returning in time. When I don't call the tidy function, there are not warnings or problems. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28763&edit=1
