#28763 [Fbk->NoF]: Tidy extension causing aborted MySQL connections
| From: | php-bugs at lists dot php dot net | Date: | Mon, 21 Jun 2004 23:00:04 +0000 |
| Subject: | #28763 [Fbk->NoF]: Tidy extension causing aborted MySQL connections | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-61191@lists.php.net to get a copy of this message | ||
ID: 28763
Updated by: php-bugs@lists.php.net
Reported By: johnfivealive at hotmail dot com
-Status: Feedback
+Status: No Feedback
Bug Type: Unknown/Other Function
Operating System: Fedora Core 2
PHP Version: 5.0.0RC3
New Comment:
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
Previous Comments:
------------------------------------------------------------------------
[2004-06-14 01:39:11] curt@php.net
Check you mysql settings:
http://dev.mysql.com/doc/mysql/en/Communication_errors.html
------------------------------------------------------------------------
[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