Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-06-20 19:42:02 +0400
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-06-20 19:42:02 +0400
commit761c7e9a513df166a093fa2a72bc43c6ecc5f479 (patch)
tree7304c46f04be4d3c100fe213203199f7214ca125 /lib/db.php
parentba7797e6a1ae0bdf571d2e861424e15d1909cf4c (diff)
backport oracle related changes, mostly comments, but also setup related fixes
Diffstat (limited to 'lib/db.php')
-rw-r--r--lib/db.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/db.php b/lib/db.php
index 02200636b4e..cd010d53104 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -406,14 +406,13 @@ class OC_DB {
$query = self::prepare('SELECT lastval() AS id');
$row = $query->execute()->fetchRow();
return $row['id'];
- }
- if( $type == 'mssql' || $type == 'oci' ) {
+ } else if( $type === 'mssql' || $type === 'oci') {
if($table !== null) {
$prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
$table = str_replace( '*PREFIX*', $prefix, $table );
}
return self::$connection->lastInsertId($table);
- }else{
+ } else {
if($table !== null) {
$prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
$suffix = OC_Config::getValue( "dbsequencesuffix", "_id_seq" );
@@ -545,6 +544,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 );
@@ -574,6 +578,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);