diff options
Diffstat (limited to 'phpBB/includes/db/mssql.php')
| -rw-r--r-- | phpBB/includes/db/mssql.php | 40 | 
1 files changed, 19 insertions, 21 deletions
| diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index 2dd95c2508..235c48d3f0 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -2,9 +2,8 @@  /**  *  * @package dbal -* @version $Id$  * @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2  *  */ @@ -49,14 +48,7 @@ class dbal_mssql extends dbal  		@ini_set('mssql.textlimit', 2147483647);  		@ini_set('mssql.textsize', 2147483647); -		if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.1', '>='))) -		{ -			$this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mssql_connect($this->server, $this->user, $sqlpassword, $new_link); -		} -		else -		{ -			$this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword) : @mssql_connect($this->server, $this->user, $sqlpassword); -		} +		$this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mssql_connect($this->server, $this->user, $sqlpassword, $new_link);  		if ($this->db_connect_id && $this->dbname != '')  		{ @@ -108,6 +100,14 @@ class dbal_mssql extends dbal  	}  	/** +	* {@inheritDoc} +	*/ +	public function sql_concatenate($expr1, $expr2) +	{ +		return $expr1 . ' + ' . $expr2; +	} + +	/**  	* SQL Transaction  	* @access private  	*/ @@ -147,12 +147,12 @@ class dbal_mssql extends dbal  			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) @@ -162,22 +162,22 @@ class dbal_mssql extends dbal  					$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);  			} @@ -242,7 +242,7 @@ class dbal_mssql 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);  		} @@ -279,7 +279,7 @@ class dbal_mssql extends dbal  			$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);  		} @@ -318,7 +318,7 @@ class dbal_mssql 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);  		} @@ -472,5 +472,3 @@ class dbal_mssql extends dbal  		}  	}  } - -?>
\ No newline at end of file | 
