Oracle doesn't know & as bitwise AND

This commit is contained in:
Bart Visscher 2013-06-26 21:40:31 +02:00
parent 0c680b46cd
commit 3b31afb2a7
1 changed files with 7 additions and 1 deletions

View File

@ -662,7 +662,13 @@ class Share {
// Remove the permissions for all reshares of this item
if (!empty($ids)) {
$ids = "'".implode("','", $ids)."'";
$query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = `permissions` & ?'
// TODO this should be done with Doctrine platform objects
if (\OC_Config::getValue( "dbtype") === 'oci') {
$andOp = 'BITAND(`permissions`, ?)';
} else {
$andOp = '`permissions` & ?';
}
$query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = '.$andOp
.' WHERE `id` IN ('.$ids.')');
$query->execute(array($permissions));
}