diff options
| author | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:09:11 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:09:11 +0100 |
| commit | 35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40 (patch) | |
| tree | 098e3b3e043f6c3e31c9c922287f76e5ec726e03 /phpBB/includes/db | |
| parent | 3b46681652ad0c235ccdcafc449c3d759335df17 (diff) | |
| parent | 05b5dc316779f67641e17859d5c69f296b24288d (diff) | |
| download | forums-35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40.tar forums-35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40.tar.gz forums-35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40.tar.bz2 forums-35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40.tar.xz forums-35a62ed0085df6d767f38d6fbd0e02b8f0fbfc40.zip | |
Merge commit 'release-3.0.7-RC2'
Diffstat (limited to 'phpBB/includes/db')
| -rw-r--r-- | phpBB/includes/db/dbal.php | 18 | ||||
| -rw-r--r-- | phpBB/includes/db/firebird.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/db/oracle.php | 5 |
3 files changed, 28 insertions, 0 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index a962696bb8..eeddf1f41b 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -430,6 +430,24 @@ class dbal } /** + * Run binary OR operator on DB column. + * Results in sql statement: "{$column_name} | (1 << {$bit}) {$compare}" + * + * @param string $column_name The column name to use + * @param int $bit The value to use for the OR operator, will be converted to (1 << $bit). Is used by options, using the number schema... 0, 1, 2...29 + * @param string $compare Any custom SQL code after the check (for example "= 0") + */ + function sql_bit_or($column_name, $bit, $compare = '') + { + if (method_exists($this, '_sql_bit_or')) + { + return $this->_sql_bit_or($column_name, $bit, $compare); + } + + return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : ''); + } + + /** * Run more than one insert statement. * * @param string $table table name to run the statements on 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 diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 63cdb7126d..55b3599800 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -622,6 +622,11 @@ class dbal_oracle extends dbal return 'BITAND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : ''); } + function _sql_bit_or($column_name, $bit, $compare = '') + { + return 'BITOR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : ''); + } + /** * return sql error array * @access private |
