|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-06 09:52 UTC] j8859 at clix dot pt
[2006-05-24 22:27 UTC] wez@php.net
[2006-05-26 13:41 UTC] j8859 at clix dot pt
[2006-05-28 10:59 UTC] j8859 at clix dot pt
[2006-12-04 15:12 UTC] iliaa@php.net
[2006-12-12 01:00 UTC] php-bugs at lists dot php dot net
[2008-09-03 20:12 UTC] arsukdeo at technocorp dot com
[2009-01-22 14:46 UTC] bsr at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 03:00:01 2025 UTC |
Description: ------------ This error also occurs with PHP 5.1.2, but with more frequency than with 5.1.3. It occurs only if I use PDO::ATTR_PERSISTENT => true, and it never occurs with PDO::ATTR_PERSISTENT => false. I have several databases in MySQL, several programs in PHP some using the classic MySQL functions, others using MySQLi, and one using PDO. This is the one which produces errors. The MySQL version is 5.0.18. Apache/1.3.34. If I do a MySQL Flush Tables, the error stops. With PHP 5.1.2 I also need to do an Apache restart to get the error stop occurring. The error never occurred with few MySQL tables opened. I do a diary crontab backup with mysqldump, over the night, and in the morning there are about 220 opened tables. Then, when I use my PDO application, I start getting "MySQL server has gone away" errors. I changed to PDO::ATTR_PERSISTENT => false and the error never happened. I changed back to PDO::ATTR_PERSISTENT => true and the error returned. I know this can be difficult for you to reproduce it, because it is not a deterministic error, but I'm sure there is an error. Reproduce code: --------------- $bd = new PDO(); $query = "SELECT * FROM mytable"; $inst = $this->prepare($query); if(!$inst) die ("ERROR: " . $query . ", " . __FILE__ . ", " . __LINE__); if(!$inst->execute()) { $inst->closeCursor(); return; } while($reg = $inst->fetch(PDO::FETCH_ASSOC)) { // Process $reg } $inst->closeCursor(); $bd = null;