From 1990ee2d4c7bad6f45a1f9fc9e473d3b3b66c132 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 14 Aug 2008 18:38:41 +0000 Subject: Correctly return results for nested cached queries (Bug #31445 - Patch by faw) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8758 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/firebird.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/db/firebird.php') diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index d23d1866c1..4382d891d0 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -238,7 +238,7 @@ class dbal_firebird extends dbal return false; } - return ($this->query_result) ? $this->query_result : false; + return ($this->query_result !== false) ? $this->query_result : false; } /** -- cgit v1.2.1 From e81eb70aedd6105904854a5ce2233f4fe14eae80 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 2 Sep 2008 13:27:37 +0000 Subject: Refine fix for #31445 originally committed in r8758 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8809 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/firebird.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/db/firebird.php') diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 4382d891d0..6765f2af48 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -238,7 +238,7 @@ class dbal_firebird extends dbal return false; } - return ($this->query_result !== false) ? $this->query_result : false; + return $this->query_result; } /** -- cgit v1.2.1 From 2fcd96ca72741bdfb36c24a0af9dd8230b5a828f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 4 Sep 2008 12:01:47 +0000 Subject: Ok, story real database server info, as well as caching it Store it on installation too - allows us to check the db version used on installation and used currently to warn the user about incompatibilities git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8814 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/firebird.php | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/db/firebird.php') diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 6765f2af48..0157238fcd 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -37,26 +37,42 @@ class dbal_firebird extends dbal $this->persistency = $persistency; $this->user = $sqluser; $this->server = $sqlserver . (($port) ? ':' . $port : ''); - $this->dbname = $database; + $this->dbname = str_replace('\\', '/', $database); - $this->db_connect_id = ($this->persistency) ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3); + // There are three possibilities to connect to an interbase db + if (!$this->server) + { + $use_database = $this->dbname; + } + else if (strpos($this->server, '//') === 0) + { + $use_database = $this->server . $this->dbname; + } + else + { + $use_database = $this->server . ':' . $this->dbname; + } + + $this->db_connect_id = ($this->persistency) ? @ibase_pconnect($use_database, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3); - $this->service_handle = (function_exists('ibase_service_attach')) ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false; + $this->service_handle = (function_exists('ibase_service_attach') && $this->server) ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false; return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } /** * Version information about used database + * @param bool $raw if true, only return the fetched sql_server_version + * @return string sql server version */ - function sql_server_info() + function sql_server_info($raw = false) { if ($this->service_handle !== false && function_exists('ibase_server_info')) { return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION); } - return 'Firebird/Interbase'; + return ($raw) ? '2.0' : 'Firebird/Interbase'; } /** -- cgit v1.2.1 From 2c1d80c75a3f41517090004e59f1e04a21437cc8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 2 Oct 2008 12:04:12 +0000 Subject: Remove NUL-Bytes directly in request_var() for strings and within the custom DBAL sql_escape() functions (MSSQL, Firebird, Oracle) (reported by AdhostMikeSw) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8967 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/firebird.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/db/firebird.php') diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 0157238fcd..3b31942a8b 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -425,7 +425,7 @@ class dbal_firebird extends dbal */ function sql_escape($msg) { - return str_replace("'", "''", $msg); + return str_replace(array("'", "\0"), array("''", ''), $msg); } /** -- cgit v1.2.1 From 09ad10a734c0993f9465e6ac3463951251602fc6 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 12 Aug 2009 15:00:47 +0000 Subject: ok, i am very sorry, but this needs to be fixed. Generally, our config table is not really suited for holding large datasets. Because feed settings for the forums to enable news feeds and excluded forums rely on the forums itself we have decided to introduce a forum_options table where custom options can be stored. Additionally, for this to work across all DBMS we support, we added a new method to the DBAL for the bitwise AND operator. Also moved the forum/topic feed template variable to the location where they belong to (forum and topic view) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9965 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/firebird.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/includes/db/firebird.php') diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 3b31942a8b..f5e8595382 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -446,6 +446,11 @@ class dbal_firebird extends dbal return $data; } + function _sql_bit_and($column_name, $bit, $compare = '') + { + return 'BIN_AND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : ''); + } + /** * return sql error array * @access private -- cgit v1.2.1 From b4baa6a0941aa32db06ddabc56612616fe75605f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 13 Aug 2009 15:25:20 +0000 Subject: Lifted minimum requirement for Firebird DBMS from 2.0+ to 2.1+. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9970 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/firebird.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/db/firebird.php') diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index f5e8595382..fb1ef44c55 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -20,7 +20,7 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** * Firebird/Interbase Database Abstraction Layer -* Minimum Requirement is Firebird 2.0 +* Minimum Requirement is Firebird 2.1 * @package dbal */ class dbal_firebird extends dbal @@ -72,7 +72,7 @@ class dbal_firebird extends dbal return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION); } - return ($raw) ? '2.0' : 'Firebird/Interbase'; + return ($raw) ? '2.1' : 'Firebird/Interbase'; } /** -- cgit v1.2.1 From c6e176d88edb882a1cc02a4f6d83114554b38121 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 15 Feb 2010 15:04:44 +0000 Subject: Add sql_bit_or() dbal method. Add ability to enable quick reply in all forums. -- Voila ;-) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10491 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/firebird.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/includes/db/firebird.php') diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index fb1ef44c55..e554b0f2fb 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -451,6 +451,11 @@ class dbal_firebird extends dbal return 'BIN_AND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : ''); } + function _sql_bit_or($column_name, $bit, $compare = '') + { + return 'BIN_OR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : ''); + } + /** * return sql error array * @access private -- cgit v1.2.1