summaryrefslogtreecommitdiffstats
path: root/lib/private/db/adapteroci8.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-10-02 18:23:59 +0200
committerBart Visscher <bartv@thisnet.nl>2013-10-02 18:23:59 +0200
commita90ea2c069998d378ec49825ce53b7651a459c1a (patch)
tree7b1afe4ef7dd5509f25c4be7829aa6834877a979 /lib/private/db/adapteroci8.php
parent5db98aadd30b9f1218dda8f836acca0062ce1d9f (diff)
parent551e80979046358b9cbc8a0f8db0ff9cdf919e33 (diff)
downloadnextcloud-server-a90ea2c069998d378ec49825ce53b7651a459c1a.tar.gz
nextcloud-server-a90ea2c069998d378ec49825ce53b7651a459c1a.zip
Merge remote-tracking branch 'origin/master' into setup
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;
+ }
+}