aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/oracle.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-06-22 18:08:38 +0200
committerTristan Darricau <github@nicofuma.fr>2014-06-22 18:16:21 +0200
commit2276c1c0f246a39dee8d0e979c89e8de0ee7a5de (patch)
tree2fa3ad4b6eaab11defa6ce3accc9ef95bca71bbb /phpBB/phpbb/db/driver/oracle.php
parentafe9d3c3f39ca1c69146778882f2b0250dfa3ed7 (diff)
downloadforums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.tar
forums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.tar.gz
forums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.tar.bz2
forums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.tar.xz
forums-2276c1c0f246a39dee8d0e979c89e8de0ee7a5de.zip
[ticket/12387] Cleanup *_free_result call and remove @ on that call
PHPBB3-12387
Diffstat (limited to 'phpBB/phpbb/db/driver/oracle.php')
-rw-r--r--phpBB/phpbb/db/driver/oracle.php57
1 files changed, 37 insertions, 20 deletions
diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php
index bfc5373e35..0dfd8484ee 100644
--- a/phpBB/phpbb/db/driver/oracle.php
+++ b/phpBB/phpbb/db/driver/oracle.php
@@ -431,6 +431,11 @@ class oracle extends \phpbb\db\driver\driver
$this->sql_report('stop', $query);
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
@@ -491,10 +496,10 @@ class oracle extends \phpbb\db\driver\driver
return $cache->sql_fetchrow($query_id);
}
- if ($query_id !== false)
+ if ($query_id)
{
$row = array();
- $result = @ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS);
+ $result = ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS);
if (!$result || !$row)
{
@@ -542,7 +547,7 @@ class oracle extends \phpbb\db\driver\driver
return $cache->sql_rowseek($rownum, $query_id);
}
- if ($query_id === false)
+ if (!$query_id)
{
return false;
}
@@ -575,18 +580,24 @@ class oracle extends \phpbb\db\driver\driver
{
$query = 'SELECT ' . $tablename[1] . '_seq.currval FROM DUAL';
$stmt = @ociparse($this->db_connect_id, $query);
- @ociexecute($stmt, OCI_DEFAULT);
+ if ($stmt)
+ {
+ $success = @ociexecute($stmt, OCI_DEFAULT);
- $temp_result = @ocifetchinto($stmt, $temp_array, OCI_ASSOC + OCI_RETURN_NULLS);
- @ocifreestatement($stmt);
+ if ($success)
+ {
+ $temp_result = ocifetchinto($stmt, $temp_array, OCI_ASSOC + OCI_RETURN_NULLS);
+ ocifreestatement($stmt);
- if ($temp_result)
- {
- return $temp_array['CURRVAL'];
- }
- else
- {
- return false;
+ if ($temp_result)
+ {
+ return $temp_array['CURRVAL'];
+ }
+ else
+ {
+ return false;
+ }
+ }
}
}
}
@@ -614,7 +625,7 @@ class oracle extends \phpbb\db\driver\driver
if (isset($this->open_queries[(int) $query_id]))
{
unset($this->open_queries[(int) $query_id]);
- return @ocifreestatement($query_id);
+ return ocifreestatement($query_id);
}
return false;
@@ -770,14 +781,20 @@ class oracle extends \phpbb\db\driver\driver
$endtime = $endtime[0] + $endtime[1];
$result = @ociparse($this->db_connect_id, $query);
- $success = @ociexecute($result, OCI_DEFAULT);
- $row = array();
-
- while (@ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ $success = @ociexecute($result, OCI_DEFAULT);
+ if ($success)
+ {
+ $row = array();
+
+ while (ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ @ocifreestatement($result);
+ }
}
- @ocifreestatement($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];