Skip to content
Snippets Groups Projects
Commit 6ad7a033 authored by Bart Visscher's avatar Bart Visscher Committed by Jörn Friedrich Dreyer
Browse files

Oracle doesn't know & as bitwise AND

Conflicts:
	lib/public/share.php
parent b32d6d84
No related branches found
No related tags found
No related merge requests found
......@@ -662,13 +662,15 @@ class Share {
// Remove the permissions for all reshares of this item
if (!empty($ids)) {
$ids = "'".implode("','", $ids)."'";
// the binary operator & works on sqlite, mysql, postgresql and mssql
$sql = 'UPDATE `*PREFIX*share` SET `permissions` = `permissions` & ? WHERE `id` IN ('.$ids.')';
if (\OC_Config::getValue('dbtype', 'sqlite') === 'oci') {
// guess which dbms does not handle & and uses a function for this
$sql = 'UPDATE `*PREFIX*share` SET `permissions` = BITAND(`permissions`,?) WHERE `id` IN ('.$ids.')';
// TODO this should be done with Doctrine platform objects
if (\OC_Config::getValue( "dbtype") === 'oci') {
$andOp = 'BITAND(`permissions`, ?)';
} else {
$andOp = '`permissions` & ?';
}
\OC_DB::executeAudited($sql, array($permissions));
$query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = '.$andOp
.' WHERE `id` IN ('.$ids.')');
$query->execute(array($permissions));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment