aboutsummaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Service/TagStat.php
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 15:42:09 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 15:42:09 +0000
commitae8ca8442e93a6e5cb3f1257df0efa3ff1602656 (patch)
tree6c4f5fc9b332975c96ff5621ce3c1a56911ecc4a /src/SemanticScuttle/Service/TagStat.php
parent21db3ef6daeaa4d0da05a7e89c30244e9caff0fd (diff)
downloadsemanticscuttle-ae8ca8442e93a6e5cb3f1257df0efa3ff1602656.tar.gz
semanticscuttle-ae8ca8442e93a6e5cb3f1257df0efa3ff1602656.tar.bz2
Fix *all* unfreed results in unit tests - this was a hard task, but worth it
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@414 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'src/SemanticScuttle/Service/TagStat.php')
-rw-r--r--src/SemanticScuttle/Service/TagStat.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/SemanticScuttle/Service/TagStat.php b/src/SemanticScuttle/Service/TagStat.php
index f925bfc..642a83c 100644
--- a/src/SemanticScuttle/Service/TagStat.php
+++ b/src/SemanticScuttle/Service/TagStat.php
@@ -30,7 +30,10 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_DbService
$query.= " AND relationType = '". $relationType ."'";
$query.= " AND uId = '".$uId."'";
- return $this->db->sql_numrows($this->db->sql_query($query));
+ $dbres = $this->db->sql_query($query);
+ $rows = $this->db->sql_numrows($dbres);
+ $this->db->sql_freeresult($dbres);
+ return $rows;
}
function getNbDescendants($tag1, $relationType, $uId) {
@@ -41,6 +44,7 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_DbService
$dbresults =& $this->db->sql_query($query);
$row = $this->db->sql_fetchrow($dbresults);
+ $this->db->sql_freeresult($dbresults);
if($row['nb'] == null) {
return 0;
} else {
@@ -56,6 +60,7 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_DbService
$dbresults =& $this->db->sql_query($query);
$row = $this->db->sql_fetchrow($dbresults);
+ $this->db->sql_freeresult($dbresults);
if($row['depth'] == null) {
return 0;
} else {
@@ -71,6 +76,7 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_DbService
$dbresults =& $this->db->sql_query($query);
$row = $this->db->sql_fetchrow($dbresults);
+ $this->db->sql_freeresult($dbresults);
if($row['nbupdate'] == null) {
return 0;
} else {
@@ -84,7 +90,10 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_DbService
$query.= " AND relationType = '". $relationType ."'";
$query.= " AND uId = '".$uId."'";
- return $this->db->sql_numrows($this->db->sql_query($query))>0;
+ $dbres = $this->db->sql_query($query);
+ $rows = $this->db->sql_numrows($dbres);
+ $this->db->sql_freeresult($dbres);
+ return $rows > 0;
}
function createStat($tag1, $relationType, $uId) {
@@ -136,6 +145,7 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_DbService
foreach($rowset as $row) {
$this->updateStat($row['tag1'], '>', $row['uId']);
}
+ $this->db->sql_freeresult($dbresult);
}
function setNbDescendants($tag1, $relationType, $uId, $nb) {
@@ -147,7 +157,7 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_DbService
$query.= " WHERE tag1 = '" .$tag1 ."'";
$query.= " AND relationType = '". $relationType ."'";
$query.= " AND uId = '".$uId."'";
- $this->db->sql_query($query);
+ $this->db->sql_freeresult($this->db->sql_query($query));
}
function setMaxDepth($tag1, $relationType, $uId, $depth) {