<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
Hello Prasad,<br>
<br>
There is an serious bug in the changeset #14217 relating to the
mysqli support.<br>
There was a change in \include\database\PearDatabase.php in
function function disconnect().<br>
<a class="moz-txt-link-freetext" href="http://trac.vtiger.com/cgi-bin/trac.cgi/changeset/14217">http://trac.vtiger.com/cgi-bin/trac.cgi/changeset/14217</a><br>
<br>
function disconnect() {<br>
$this->println("ADODB disconnect");<br>
if(isset($this->database)){<br>
if($this->dbType == "mysql"){<br>
mysql_close($this->database);<br>
<b><font color="#ff0000"> } else
if($this->dbType=="mysqli"){<br>
mysqli_close($this->database);</font></b><br>
} else {<br>
$this->database->disconnect();<br>
}<br>
unset($this->database);<br>
}<br>
}<br>
<br>
The red lines shows the added, new lines. The command <b><font
color="#ff0000"> mysqli_close($this->database);</font></b>
unfortunately wrong.<br>
<br>
The right command would be: according to the ...\libraries\adodb\drivers\adodb-mysqli.inc.php
line ~ 669 <br>
// returns true or false<br>
function _close()<br>
{<br>
@mysqli_close($this->_connectionID);<br>
$this->_connectionID = false;<br>
}<br>
<br>
---------------------------<br>
<b>The right command</b> to close mysqli database is: <font
color="#3333ff"><b>mysqli_close($this->database->_connectionID);</b></font>
<br>
<br>
It really closes the database. The modification from the changeset
#14217 will not close the database but will give a worning:<br>
Warning: mysqli_close() expects parameter 1 to be mysqli, object
given in ....\include\database\PearDatabase.php on line 875 <br>
<br>
And in the debugging/developing settings, <i><b>vtiger </b></i>will
echo this warning message even to the JSON output of
Vtiger_Response(), so all AJAX responses could be broken. My AJAX in
my CustomModule was broken and I hunted the cause for 2 days and I
have found it in the above described.<br>
<br>
Note: Analogous to the mysqli, may the
mysql_close($this->database) would be also wrong.<br>
<br>
Kindest regards:<br>
Istvan<br>
<br>
<br>
<div class="moz-signature">-- <br>
üdvözlettel:<br>
<br>
<b>Holbok István</b><br>
<br>
+3670-342-0900<br>
<b>e-mail:</b> <a class="moz-txt-link-abbreviated" href="mailto:holbok@gmail.com">holbok@gmail.com</a><br>
<b>SkyPe:</b> holboki<br>
<br>
</div>
</body>
</html>