Fixed bug #13935: t3lib_fullsearch has a lot of hanging SQL record sets
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 29 Mar 2010 11:41:28 +0000 (11:41 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 29 Mar 2010 11:41:28 +0000 (11:41 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7218 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_fullsearch.php

index f1526b1..206f66d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-29  Christian Kuhn  <lolli@schwarzbu.ch>
+
+       * Fixed bug #13935: t3lib_fullsearch has a lot of hanging SQL record sets
+
 2010-03-29  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
 
        * Fixed bug #11696: External files with Umlauts/special chars in filename are not indexed
index f407950..bafd04d 100644 (file)
@@ -232,6 +232,7 @@ class t3lib_fullsearch {
 
                                $res = @$GLOBALS['TYPO3_DB']->sql_query($qCount);
                                if (!$GLOBALS['TYPO3_DB']->sql_error()) {
+                                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
                                        $dA = array();
                                        $dA['t2_data'] = serialize(array(
                                                'qC'=>$saveArr,
@@ -402,6 +403,7 @@ class t3lib_fullsearch {
                                        $output.= $GLOBALS['SOBE']->doc->section('SQL error',$out,0,1);
                                } else {
                                        $cPR = $this->getQueryResultCode($mQ,$res,$qGen->table);
+                                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
                                        $output.=$GLOBALS['SOBE']->doc->section($cPR['header'],$cPR['content'],0,1);
                                }
                        }
@@ -603,6 +605,7 @@ class t3lib_fullsearch {
                                                        $rowArr[]=$this->resultRowDisplay($row,$conf,$table);
                                                        $lrow=$row;
                                                }
+                                               $GLOBALS['TYPO3_DB']->sql_free_result($res);
                                                $out.='<table border="0" cellpadding="2" cellspacing="1">'.$this->resultRowTitles($lrow,$conf,$table).implode(chr(10),$rowArr).'</table>';
                                        }
                                        $out.='<HR>';
@@ -812,6 +815,7 @@ class t3lib_fullsearch {
                                        $theList .= $this->getTreeList($row['uid'], $depth-1, $begin-1, $perms_clause);
                                }
                        }
+                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
                }
                return $theList;
        }
@@ -917,6 +921,7 @@ class t3lib_fullsearch {
                                                                }
                                                        }
                                                }
+                                               $GLOBALS['TYPO3_DB']->sql_free_result($res);
                                        }
                                }
                        } else {
@@ -988,6 +993,7 @@ class t3lib_fullsearch {
                                                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                                        $this->tableArray[$from_table][] = $row;
                                                }
+                                               $GLOBALS['TYPO3_DB']->sql_free_result($res);
                                        }
                                        reset($this->tableArray[$from_table]);
                                        foreach ($this->tableArray[$from_table] as $key => $val) {