aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/share
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-19 17:18:22 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-11-23 11:44:08 +0100
commit9f690216913fffc6b4c93545492ea26905a5fe61 (patch)
tree6955d15d53978297bfaf12c3b6f3b558ef8d07e9 /lib/private/share
parent79bbda994bb8dd2231f68f57785237f79f86f6c7 (diff)
downloadnextcloud-server-9f690216913fffc6b4c93545492ea26905a5fe61.tar.gz
nextcloud-server-9f690216913fffc6b4c93545492ea26905a5fe61.zip
lastInsertId() is properly working with Oracle if the table name is properly passed in
Diffstat (limited to 'lib/private/share')
-rw-r--r--lib/private/share/share.php17
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index d377708a268..6aac0d6264d 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -2332,22 +2332,7 @@ class Share extends Constants {
$id = false;
if ($result) {
- $id = \OC::$server->getDatabaseConnection()->lastInsertId();
- // Fallback, if lastInterId() doesn't work we need to perform a select
- // to get the ID (seems to happen sometimes on Oracle)
- if (!$id) {
- $getId = \OC_DB::prepare('
- SELECT `id`
- FROM`*PREFIX*share`
- WHERE `uid_owner` = ? AND `item_target` = ? AND `item_source` = ? AND `stime` = ?
- ');
- $r = $getId->execute(array($shareData['uidOwner'], $shareData['itemTarget'], $shareData['itemSource'], $shareData['shareTime']));
- if ($r) {
- $row = $r->fetchRow();
- $id = $row['id'];
- }
- }
-
+ $id = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*share');
}
return $id;