aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Webster <noxwizard@phpbb.com>2013-10-14 16:37:23 -0500
committerPatrick Webster <noxwizard@phpbb.com>2013-10-14 16:37:23 -0500
commit76ddf1ca4143f38f3bf8fc6aabdb3fa302d6ed40 (patch)
tree29deb20a2bf6c902aa3bbea73ea02cf87e4ef369
parent40932c26eaa7cddd0731b136a77c9bad704b69e0 (diff)
downloadforums-76ddf1ca4143f38f3bf8fc6aabdb3fa302d6ed40.tar
forums-76ddf1ca4143f38f3bf8fc6aabdb3fa302d6ed40.tar.gz
forums-76ddf1ca4143f38f3bf8fc6aabdb3fa302d6ed40.tar.bz2
forums-76ddf1ca4143f38f3bf8fc6aabdb3fa302d6ed40.tar.xz
forums-76ddf1ca4143f38f3bf8fc6aabdb3fa302d6ed40.zip
[ticket/11918] Make sql_freeresult() consistent across all DB drivers
PHPBB3-11918
-rw-r--r--phpBB/phpbb/db/driver/firebird.php2
-rw-r--r--phpBB/phpbb/db/driver/mssql.php6
-rw-r--r--phpBB/phpbb/db/driver/mssql_odbc.php2
-rw-r--r--phpBB/phpbb/db/driver/mssqlnative.php3
-rw-r--r--phpBB/phpbb/db/driver/mysql.php2
-rw-r--r--phpBB/phpbb/db/driver/oracle.php2
-rw-r--r--phpBB/phpbb/db/driver/postgres.php2
-rw-r--r--phpBB/phpbb/db/driver/sqlite.php2
8 files changed, 11 insertions, 10 deletions
diff --git a/phpBB/phpbb/db/driver/firebird.php b/phpBB/phpbb/db/driver/firebird.php
index 2df5eaf369..aef75eab15 100644
--- a/phpBB/phpbb/db/driver/firebird.php
+++ b/phpBB/phpbb/db/driver/firebird.php
@@ -398,7 +398,7 @@ class firebird extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
- if ($cache && $cache->sql_exists($query_id))
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php
index 4d2cd287da..50096deded 100644
--- a/phpBB/phpbb/db/driver/mssql.php
+++ b/phpBB/phpbb/db/driver/mssql.php
@@ -318,14 +318,14 @@ class mssql extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
- if ($cache && $cache->sql_exists($query_id))
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
- if (isset($this->open_queries[$query_id]))
+ if (isset($this->open_queries[(int) $query_id]))
{
- unset($this->open_queries[$query_id]);
+ unset($this->open_queries[(int) $query_id]);
return @mssql_free_result($query_id);
}
diff --git a/phpBB/phpbb/db/driver/mssql_odbc.php b/phpBB/phpbb/db/driver/mssql_odbc.php
index 9db34a69fb..b9881035c0 100644
--- a/phpBB/phpbb/db/driver/mssql_odbc.php
+++ b/phpBB/phpbb/db/driver/mssql_odbc.php
@@ -305,7 +305,7 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
$query_id = $this->query_result;
}
- if ($cache && $cache->sql_exists($query_id))
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php
index e6002fe1a3..aade311bcb 100644
--- a/phpBB/phpbb/db/driver/mssqlnative.php
+++ b/phpBB/phpbb/db/driver/mssqlnative.php
@@ -471,7 +471,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
$query_id = $this->query_result;
}
- if ($cache->sql_exists($query_id))
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
@@ -481,6 +481,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
unset($this->open_queries[(int) $query_id]);
return @sqlsrv_free_stmt($query_id);
}
+
return false;
}
diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php
index c76126763d..d215453ccb 100644
--- a/phpBB/phpbb/db/driver/mysql.php
+++ b/phpBB/phpbb/db/driver/mysql.php
@@ -289,7 +289,7 @@ class mysql extends \phpbb\db\driver\mysql_base
$query_id = $this->query_result;
}
- if ($cache && $cache->sql_exists($query_id))
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php
index 5dfab21455..4fba654d1e 100644
--- a/phpBB/phpbb/db/driver/oracle.php
+++ b/phpBB/phpbb/db/driver/oracle.php
@@ -621,7 +621,7 @@ class oracle extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
- if ($cache && $cache->sql_exists($query_id))
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php
index 7a98b90c73..9cbb1ecb07 100644
--- a/phpBB/phpbb/db/driver/postgres.php
+++ b/phpBB/phpbb/db/driver/postgres.php
@@ -350,7 +350,7 @@ class postgres extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
- if ($cache && $cache->sql_exists($query_id))
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/phpbb/db/driver/sqlite.php b/phpBB/phpbb/db/driver/sqlite.php
index a548fd2618..55a33284f2 100644
--- a/phpBB/phpbb/db/driver/sqlite.php
+++ b/phpBB/phpbb/db/driver/sqlite.php
@@ -261,7 +261,7 @@ class sqlite extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
- if ($cache && $cache->sql_exists($query_id))
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}