|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-12-18 14:39 UTC] andreas dot streichardt at 100days dot de
Description:
------------
The informix PDO extension supports the PDO persistent attribute. However it seems to only save the handle and will never check if it is still valid. Whenever the connection was closed (for example database server was shut down, timeouts or whatever) the (apache in this case) process is messed up and won't be able to handle any new informix connection to that dsn.
Executing any query on that broken connection will simply return false.
Test script:
---------------
<?php
$start = microtime(true);
$options = [];
$options[PDO::ATTR_PERSISTENT] = true;
$connection = new PDO('informix:host=ifxservdev;service=sqlexec;database=develop11;server=ifxsrv;protocol=onsoctcp;EnableScrollableCursors=1;DB_LOCALE=de_DE.cp1252;CLIENT_LOCALE=de_DE.utf8', 'develop', 'develop', $options);
var_dump(microtime(true) - $start);
$stmt = $connection->query("SELECT kd_nr, kd_ans1 FROM kunden");
var_dump(gettype($stmt), getmypid(), $connection->errorInfo());
Expected result:
----------------
float(1.5020370483398E-5) string(6) "object" int(27040) array(3) { [0]=> string(5) "00000" [1]=> int(0) [2]=> string(24) " ((null)[0] at (null):0)" }
Actual result:
--------------
float(1.5020370483398E-5) string(6) "object" int(27050) array(3) { [0]=> string(5) "00000" [1]=> int(0) [2]=> string(24) " ((null)[0] at (null):0)" }
(then restart database server)
float(1.4066696166992E-5) string(7) "boolean" int(27050) array(3) { [0]=> string(5) "08S01" [1]=> int(-11020) [2]=> string(129) "[Informix][Informix ODBC Driver]Communication link failure. (SQLPrepare[-11020] at /opt/PDO_INFORMIX-1.3.0/informix_driver.c:131)" }
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 17:00:01 2025 UTC |
We can still reproduce this issue, using latest Version of PDO Informix (svn revision 332869). We also tried with latest PHP Version 5.4.25. Apache is: Server version: Apache/2.2.22 (Unix) Server built: Nov 23 2012 17:12:23 Server's Module Magic Number: 20051115:30 Server loaded: APR 1.4.5, APR-Util 1.4.1 Compiled using: APR 1.4.5, APR-Util 1.4.1 Architecture: 32-bit Server MPM: Prefork threaded: no forked: yes (variable process count) We noticed that using your latest changes the additional issue we send you through the PMR (the non minimal testcase indicating a memory leak) is now crashing with a segmentation fault so maybe this version might even help you finding the memory leak. Interestingly the memleak test will only segfault when executed by a non super user: develop@vmdevelop:~/tmp/memleak> php test.php Speicherzugriffsfehler develop@vmdevelop:~/tmp/memleak> php test.php Speicherzugriffsfehler develop@vmdevelop:~/tmp/memleak> su Passwort: vmdevelop:/home/develop/tmp/memleak # php test.php vmdevelop:/home/develop/tmp/memleak # php test.php