oracle does not need sequence suffix, manually set database name to allow fetching db schema, don't shutdown db - we are using utf8 to connect
This commit is contained in:
parent
8edb56de05
commit
dcdabac04d
13
lib/db.php
13
lib/db.php
|
@ -460,7 +460,7 @@ class OC_DB {
|
||||||
$row = $result->fetchRow();
|
$row = $result->fetchRow();
|
||||||
self::raiseExceptionOnError($row, 'fetching row for insertid failed');
|
self::raiseExceptionOnError($row, 'fetching row for insertid failed');
|
||||||
return $row['id'];
|
return $row['id'];
|
||||||
} else if( $type === 'mssql') {
|
} else if( $type === 'mssql' || $type === 'oci') {
|
||||||
if($table !== null) {
|
if($table !== null) {
|
||||||
$prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
|
$prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
|
||||||
$table = str_replace( '*PREFIX*', $prefix, $table );
|
$table = str_replace( '*PREFIX*', $prefix, $table );
|
||||||
|
@ -594,6 +594,11 @@ class OC_DB {
|
||||||
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
|
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
|
||||||
|
|
||||||
self::connectScheme();
|
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
|
// read file
|
||||||
$content = file_get_contents( $file );
|
$content = file_get_contents( $file );
|
||||||
|
@ -617,6 +622,12 @@ class OC_DB {
|
||||||
$content = str_replace( '<default>0000-00-00 00:00:00</default>',
|
$content = str_replace( '<default>0000-00-00 00:00:00</default>',
|
||||||
'<default>CURRENT_TIMESTAMP</default>', $content );
|
'<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 );
|
file_put_contents( $file2, $content );
|
||||||
$op = self::$schema->updateDatabase($file2, $previousSchema, array(), false);
|
$op = self::$schema->updateDatabase($file2, $previousSchema, array(), false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue