From: poltawski Date: Sat, 27 Jun 2009 21:22:03 +0000 (+0000) Subject: dml/sqllite MDL-19644 - add sql_bitxor compatibility X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0661894ccf964a30cb3a3f4564c3acff6b13f4a6;p=moodle.git dml/sqllite MDL-19644 - add sql_bitxor compatibility fixes one unit test --- diff --git a/lib/dml/sqlite3_pdo_moodle_database.php b/lib/dml/sqlite3_pdo_moodle_database.php index 430b18185c..2e9cd0cb01 100644 --- a/lib/dml/sqlite3_pdo_moodle_database.php +++ b/lib/dml/sqlite3_pdo_moodle_database.php @@ -355,4 +355,16 @@ class sqlite3_pdo_moodle_database extends pdo_moodle_database { } return implode('||', $elements); } + + /** + * Returns the SQL text to be used in order to perform one bitwise XOR operation + * between 2 integers. + * + * @param integer int1 first integer in the operation + * @param integer int2 second integer in the operation + * @return string the piece of SQL code to be used in your statement. + */ + public function sql_bitxor($int1, $int2) { + return '( ~' . $this->sql_bitand($int1, $int2) . ' & ' . $this->sql_bitor($int1, $int2) . ')'; + } }