diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-06-26 21:40:31 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-06-28 15:48:49 +0200 |
commit | 6ad7a0336f58685f18454fd622395cf25d6908c1 (patch) | |
tree | e8434184909b5499bd9c80f545cc78d0c3370a79 | |
parent | b32d6d84878798b78afa757c4d8a068a84ab9513 (diff) | |
download | nextcloud-server-6ad7a0336f58685f18454fd622395cf25d6908c1.tar.gz nextcloud-server-6ad7a0336f58685f18454fd622395cf25d6908c1.zip |
Oracle doesn't know & as bitwise AND
Conflicts:
lib/public/share.php
-rw-r--r-- | lib/public/share.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/public/share.php b/lib/public/share.php index f40cd0d77fa..304cb7239eb 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -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)); } } } |