From 9f300b3afa091aa2ea3de399b5430bc59b172cd7 Mon Sep 17 00:00:00 2001 From: poltawski Date: Sat, 27 Jun 2009 21:23:49 +0000 Subject: [PATCH] dml/sqllite MDL-19644 - add sql_bitxor compatibility fixes one unit test --- lib/dml/sqlite3_pdo_moodle_database.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/dml/sqlite3_pdo_moodle_database.php b/lib/dml/sqlite3_pdo_moodle_database.php index e3821cc723..921267afaf 100644 --- a/lib/dml/sqlite3_pdo_moodle_database.php +++ b/lib/dml/sqlite3_pdo_moodle_database.php @@ -368,4 +368,16 @@ class sqlite3_pdo_moodle_database extends pdo_moodle_database { public function sql_bitxor($int1, $int2) { return '( ~' . $this->sql_bitand($int1, $int2) . ' & ' . $this->sql_bitor($int1, $int2) . ')'; } + + /** + * 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) . ')'; + } } -- 2.39.5