Added patch from 'cavendish' releasing previous result resources in resultSet(). Closes #4801

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7374 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mark_story 2008-07-29 23:29:26 +00:00
parent 96b5a6fa87
commit 4267a4f631
2 changed files with 6 additions and 0 deletions

View file

@ -427,6 +427,9 @@ class DboMysql extends DboSource {
* @param unknown_type $results
*/
function resultSet(&$results) {
if (isset($this->results) && is_resource($this->results) && $this->results != $results) {
mysql_free_result($this->results);
}
$this->results =& $results;
$this->map = array();
$num_fields = mysql_num_fields($results);

View file

@ -405,6 +405,9 @@ class DboMysqli extends DboSource {
* @param unknown_type $results
*/
function resultSet(&$results) {
if (isset($this->results) && is_resource($this->results) && $this->results != $results) {
mysqli_free_result($this->results);
}
$this->results =& $results;
$this->map = array();
$num_fields = mysqli_num_fields($results);