|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-06-09 12:46 UTC] info at sosulka dot ru
Description:
------------
Call to the function pg_last_error kill apache process. It continue working and eat so much resources. No reply to the user brouser.
Reproduce code:
---------------
function Query($query) {
if ($query == '') return 0;
$this->_Query = $query;
if (!$this->Connect()) return 0;
if ($this->_QueryId) $this->Free();
if ($this->mDebug) print 'Debug: query = ' . $query . "<br>\n";
$this->_QueryId = pg_query($this->_LinkId, $query);
$this->mRow = 0;
# !!!!!! next line error!!!
$this->mError = pg_last_error($this->_LinkId);
# !!!!!!
if (!$this->_QueryId) $this->_Halt("Invalid SQL: " . $query);
return $this->_QueryId;
}
Actual result:
--------------
It working, but sometimes this code kill apache!!! Session destroied.
This normal load:
-bash-2.05b$ uptime
2:34PM up 17 days, 22:44, 1 user, load averages: 0,00 0,00 0,00
This load after erorr:
-bash-2.05b$ uptime
2:34PM up 17 days, 22:44, 1 user, load averages: 30,00 30,00 30,00
and much
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 09:00:01 2025 UTC |
function _Halt($msg) { $this->mError = pg_last_error($this->_LinkId); if ($this->mErrHandler != '') { $text = "Database Error occured!\n\nQuery:\n" . $this->_Query . "\n\nError:\n" . $this->mError . "\n\nError No:\n" . $this->mErrno; $f = $this->mErrHandler; $f($text); } if ($this->mHaltOnError == 'no') return; $this->_HaltMsg($msg); if ($this->mHaltOnError != 'report') die('Session halted.'); } function _HaltMsg($msg) { print '<b>Database error:</b> ' . $msg . "<br>\n"; print '<b>PgSQL Error</b>: ' . $this->mErrno . ' (' . $this->mError . ")<br>\n"; }