diff options
Diffstat (limited to 'phpBB/includes/db')
| -rw-r--r-- | phpBB/includes/db/db_tools.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/db/dbal.php | 35 | ||||
| -rw-r--r-- | phpBB/includes/db/firebird.php | 19 | ||||
| -rw-r--r-- | phpBB/includes/db/mssql.php | 11 | ||||
| -rw-r--r-- | phpBB/includes/db/mssql_odbc.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/db/mssqlnative.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/db/mysql.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/db/mysqli.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/db/oracle.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/db/postgres.php | 18 | ||||
| -rw-r--r-- | phpBB/includes/db/sqlite.php | 2 | 
11 files changed, 61 insertions, 36 deletions
| diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index 2cba11133a..b9cc229a45 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -2457,5 +2457,3 @@ class phpbb_db_tools  		return $this->_sql_run_sql($statements);  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 9b45c085a2..a61dc5f58a 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -458,6 +458,28 @@ class dbal  	}  	/** +	* Returns SQL string to cast a string expression to an int. +	* +	* @param  string $expression An expression evaluating to string +	* @return string             Expression returning an int +	*/ +	function cast_expr_to_bigint($expression) +	{ +		return $expression; +	} + +	/** +	* Returns SQL string to cast an integer expression to a string. +	* +	* @param  string $expression An expression evaluating to int +	* @return string             Expression returning a string +	*/ +	function cast_expr_to_string($expression) +	{ +		return $expression; +	} + +	/**  	* Run more than one insert statement.  	*  	* @param string $table table name to run the statements on @@ -721,8 +743,9 @@ class dbal  	function sql_report($mode, $query = '')  	{  		global $cache, $starttime, $phpbb_root_path, $user; +		global $request; -		if (empty($_REQUEST['explain'])) +		if (is_object($request) && !$request->variable('explain', false))  		{  			return false;  		} @@ -744,12 +767,10 @@ class dbal  				$mtime = explode(' ', microtime());  				$totaltime = $mtime[0] + $mtime[1] - $starttime; -				echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -					<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> +				echo '<!DOCTYPE html> +					<html dir="ltr">  					<head> -						<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -						<meta http-equiv="Content-Style-Type" content="text/css" /> -						<meta http-equiv="imagetoolbar" content="no" /> +						<meta charset="utf-8">  						<title>SQL Report</title>  						<link href="' . $phpbb_root_path . 'adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />  					</head> @@ -911,5 +932,3 @@ class dbal  * This variable holds the class name to use later  */  $sql_db = (!empty($dbms)) ? 'dbal_' . basename($dbms) : 'dbal'; - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 7e3f15ed1d..8acc84b1c0 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -493,6 +493,23 @@ class dbal_firebird extends dbal  	}  	/** +	* @inheritdoc +	*/ +	function cast_expr_to_bigint($expression) +	{ +		// Precision must be from 1 to 18 +		return 'CAST(' . $expression . ' as DECIMAL(18, 0))'; +	} + +	/** +	* @inheritdoc +	*/ +	function cast_expr_to_string($expression) +	{ +		return 'CAST(' . $expression . ' as VARCHAR(255))'; +	} + +	/**  	* return sql error array  	* @access private  	*/ @@ -565,5 +582,3 @@ class dbal_firebird extends dbal  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index 6899a73902..386b0a9a23 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -41,14 +41,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 != '')  		{ @@ -446,5 +439,3 @@ class dbal_mssql extends dbal  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 75a080b1b7..d17280c5a6 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -423,5 +423,3 @@ class dbal_mssql_odbc extends dbal  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php index 7fbc374e77..96b4c8a8c8 100644 --- a/phpBB/includes/db/mssqlnative.php +++ b/phpBB/includes/db/mssqlnative.php @@ -645,5 +645,3 @@ class dbal_mssqlnative extends dbal  		$this->query_options = $options;  	}  } - -?> diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 1e24c79577..d0537e2fe9 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -488,5 +488,3 @@ class dbal_mysql extends dbal  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 456ce906d0..d2781e96dd 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -489,5 +489,3 @@ class dbal_mysqli extends dbal  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 62b36aa8bf..e0d9370bd8 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -767,5 +767,3 @@ class dbal_oracle extends dbal  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index bb116e0763..959d8df139 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -389,6 +389,22 @@ class dbal_postgres extends dbal  	}  	/** +	* @inheritdoc +	*/ +	function cast_expr_to_bigint($expression) +	{ +		return 'CAST(' . $expression . ' as DECIMAL(255, 0))'; +	} + +	/** +	* @inheritdoc +	*/ +	function cast_expr_to_string($expression) +	{ +		return 'CAST(' . $expression . ' as VARCHAR(255))'; +	} + +	/**  	* return sql error array  	* @access private  	*/ @@ -481,5 +497,3 @@ class dbal_postgres extends dbal  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index 8de72fd394..88d92d1ff2 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -335,5 +335,3 @@ class dbal_sqlite extends dbal  		}  	}  } - -?>
\ No newline at end of file | 
