aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/mssqlnative.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-12-07 18:11:38 -0600
committerNathan Guse <nathaniel.guse@gmail.com>2012-12-07 18:11:38 -0600
commit92ec214537d041076187cc013d08175e8cff3fe8 (patch)
tree24ccc13c2205faf1a2ba98ae159078ddbe1d90f4 /phpBB/includes/db/mssqlnative.php
parentb25efd744db56f7565453caccf26630404db07c7 (diff)
parent108a6c35a6d718166a8bfd17042cac5f2ccc6d20 (diff)
downloadforums-92ec214537d041076187cc013d08175e8cff3fe8.tar
forums-92ec214537d041076187cc013d08175e8cff3fe8.tar.gz
forums-92ec214537d041076187cc013d08175e8cff3fe8.tar.bz2
forums-92ec214537d041076187cc013d08175e8cff3fe8.tar.xz
forums-92ec214537d041076187cc013d08175e8cff3fe8.zip
Merge branch 'develop' of git://github.com/phpbb/phpbb3 into ticket/8323
Conflicts: phpBB/viewtopic.php
Diffstat (limited to 'phpBB/includes/db/mssqlnative.php')
-rw-r--r--phpBB/includes/db/mssqlnative.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index 8a4503f111..e9191fae8a 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -218,7 +218,6 @@ class dbal_mssqlnative extends dbal
$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,
@@ -260,6 +259,14 @@ class dbal_mssqlnative extends dbal
/**
* {@inheritDoc}
*/
+ public function sql_concatenate($expr1, $expr2)
+ {
+ return $expr1 . ' + ' . $expr2;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
function sql_buffer_nested_transactions()
{
return true;
@@ -304,13 +311,13 @@ class dbal_mssqlnative extends dbal
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)
@@ -322,22 +329,22 @@ class dbal_mssqlnative extends dbal
// 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);
}
@@ -410,7 +417,7 @@ class dbal_mssqlnative extends dbal
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -435,7 +442,7 @@ class dbal_mssqlnative extends dbal
unset($row['line2'], $row['line3']);
}
}
- return $row;
+ return (sizeof($row)) ? $row : false;
}
/**
@@ -470,7 +477,7 @@ class dbal_mssqlnative extends dbal
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}