summaryrefslogtreecommitdiffstats
path: root/lib/private/db/adapteroci8.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-04 14:06:42 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-04 14:06:42 +0200
commitaebc330f269f3e88f2891cd13009cde2d50eb59a (patch)
tree7398bc68d581d01b18ba3e9e79c82491f1ecf871 /lib/private/db/adapteroci8.php
parentc62dc4fa80d622ed7651029e9ddff2a6c6327143 (diff)
parent800bf0769ff4ea63c5dcc77eaaf1bce669b73d13 (diff)
downloadnextcloud-server-aebc330f269f3e88f2891cd13009cde2d50eb59a.tar.gz
nextcloud-server-aebc330f269f3e88f2891cd13009cde2d50eb59a.zip
Merge branch 'master' into fixing-4011-master
Diffstat (limited to 'lib/private/db/adapteroci8.php')
-rw-r--r--lib/private/db/adapteroci8.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/private/db/adapteroci8.php b/lib/private/db/adapteroci8.php
new file mode 100644
index 00000000000..bc226e979ec
--- /dev/null
+++ b/lib/private/db/adapteroci8.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+
+namespace OC\DB;
+
+class AdapterOCI8 extends Adapter {
+ public function lastInsertId($table) {
+ if($table !== null) {
+ $suffix = '_SEQ';
+ $table = '"'.$table.$suffix.'"';
+ }
+ return $this->conn->realLastInsertId($table);
+ }
+
+ const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400";
+ public function fixupStatement($statement) {
+ $statement = str_replace( '`', '"', $statement );
+ $statement = str_ireplace( 'NOW()', 'CURRENT_TIMESTAMP', $statement );
+ $statement = str_ireplace( 'UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement );
+ return $statement;
+ }
+}