summaryrefslogtreecommitdiffstats
path: root/lib/db.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/db.php')
-rw-r--r--lib/db.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/db.php b/lib/db.php
index cd96bcf9d31..a6b81aaba69 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -460,7 +460,7 @@ class OC_DB {
$row = $result->fetchRow();
self::raiseExceptionOnError($row, 'fetching row for insertid failed');
return $row['id'];
- } else if( $type === 'mssql') {
+ } else if( $type === 'mssql' || $type === 'oci') {
if($table !== null) {
$prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
$table = str_replace( '*PREFIX*', $prefix, $table );
@@ -594,6 +594,11 @@ class OC_DB {
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
self::connectScheme();
+
+ if(OC_Config::getValue('dbtype', 'sqlite')==='oci') {
+ //set dbname, it is unset because oci uses 'service' to connect
+ self::$schema->db->database_name=self::$schema->db->dsn['username'];
+ }
// read file
$content = file_get_contents( $file );
@@ -617,6 +622,12 @@ class OC_DB {
$content = str_replace( '<default>0000-00-00 00:00:00</default>',
'<default>CURRENT_TIMESTAMP</default>', $content );
}
+ if(OC_Config::getValue('dbtype', 'sqlite')==='oci') {
+ unset($previousSchema['charset']); //or MDB2 tries SHUTDOWN IMMEDIATE
+ $oldname = $previousSchema['name'];
+ $previousSchema['name']=OC_Config::getValue( "dbuser", $oldname );
+ //TODO check identifiers are at most 30 chars long
+ }
file_put_contents( $file2, $content );
$op = self::$schema->updateDatabase($file2, $previousSchema, array(), false);