mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
[ticket/11015] Fixup some things from the big merge
PHPBB3-11015
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -206,7 +206,7 @@ class phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
@@ -256,7 +256,7 @@ class phpbb_db_driver
|
||||
$this->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
|
||||
if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
|
||||
if (!is_object($query_id) && $cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchfield($query_id, $field);
|
||||
}
|
||||
@@ -766,8 +766,8 @@ class phpbb_db_driver
|
||||
|
||||
// Show complete SQL error and path to administrators only
|
||||
// Additionally show complete error on installation or if extended debug mode is enabled
|
||||
// The DEBUG_EXTRA constant is for development only!
|
||||
if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA'))
|
||||
// The DEBUG constant is for development only!
|
||||
if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG'))
|
||||
{
|
||||
$message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';
|
||||
}
|
||||
|
@@ -148,13 +148,13 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->last_query_text = $query;
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if ($this->query_result === false)
|
||||
@@ -249,7 +249,7 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
|
||||
$this->sql_error($query);
|
||||
}
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
@@ -267,17 +267,17 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
|
||||
}
|
||||
}
|
||||
|
||||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
if ($cache_ttl)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
else if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
@@ -330,7 +330,7 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
@@ -396,7 +396,7 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
}
|
||||
|
@@ -137,12 +137,12 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if ($this->query_result === false)
|
||||
@@ -152,7 +152,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
|
||||
$this->sql_error($query);
|
||||
}
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
@@ -160,14 +160,14 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
|
||||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
else if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
@@ -232,7 +232,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
@@ -269,7 +269,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
@@ -308,7 +308,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
}
|
||||
|
@@ -155,13 +155,13 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->last_query_text = $query;
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if ($this->query_result === false)
|
||||
@@ -171,22 +171,22 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
|
||||
$this->sql_error($query);
|
||||
}
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
|
||||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
if ($cache_ttl)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
else if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
@@ -252,7 +252,7 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
@@ -293,7 +293,7 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
}
|
||||
|
@@ -216,7 +216,6 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
|
||||
$this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
|
||||
|
||||
//connect to database
|
||||
error_reporting(E_ALL);
|
||||
$this->db_connect_id = sqlsrv_connect($this->server, array(
|
||||
'Database' => $this->dbname,
|
||||
'UID' => $this->user,
|
||||
@@ -310,13 +309,13 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->last_query_text = $query;
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if ($this->query_result === false)
|
||||
@@ -328,22 +327,22 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
|
||||
// reset options for next query
|
||||
$this->query_options = array();
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
|
||||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
if ($cache_ttl)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
else if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
@@ -416,7 +415,7 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
@@ -476,7 +475,7 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
}
|
||||
|
@@ -165,12 +165,12 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if ($this->query_result === false)
|
||||
@@ -180,22 +180,22 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
|
||||
$this->sql_error($query);
|
||||
}
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
|
||||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
if ($cache_ttl)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
else if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
@@ -247,7 +247,7 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
@@ -268,7 +268,7 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
@@ -296,7 +296,7 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
}
|
||||
|
@@ -172,12 +172,12 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if ($this->query_result === false)
|
||||
@@ -187,17 +187,17 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
|
||||
$this->sql_error($query);
|
||||
}
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
|
||||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
if ($cache_ttl)
|
||||
{
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
else if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
@@ -249,7 +249,7 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
|
||||
if (!is_object($query_id) && $cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
@@ -276,7 +276,7 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
|
||||
if (!is_object($query_id) && $cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
@@ -304,7 +304,7 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
|
||||
if (!is_object($query_id) && $cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
}
|
||||
|
@@ -234,13 +234,13 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->last_query_text = $query;
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if ($this->query_result === false)
|
||||
@@ -411,22 +411,22 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
|
||||
}
|
||||
}
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
|
||||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
if ($cache_ttl)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
else if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
@@ -471,7 +471,7 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
@@ -523,7 +523,7 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
@@ -592,7 +592,7 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
}
|
||||
|
@@ -187,13 +187,13 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->last_query_text = $query;
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if ($this->query_result === false)
|
||||
@@ -203,22 +203,22 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
|
||||
$this->sql_error($query);
|
||||
}
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
|
||||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
if ($cache_ttl)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
else if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
@@ -278,7 +278,7 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
@@ -299,7 +299,7 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
@@ -348,7 +348,7 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
}
|
||||
|
@@ -110,12 +110,12 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if ($this->query_result === false)
|
||||
@@ -125,22 +125,22 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
|
||||
$this->sql_error($query);
|
||||
}
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
|
||||
if ($cache_ttl && method_exists($cache, 'sql_save'))
|
||||
if ($cache_ttl)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
$cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
else if (defined('DEBUG'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
@@ -212,7 +212,7 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
if ($cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user