summaryrefslogtreecommitdiffstats
path: root/lib/private/DB/OracleConnection.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-01 16:56:34 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-07-05 13:01:19 +0200
commit15eec7b83c6198a124c2720e8ecc988605428f54 (patch)
tree62f47bb629b621b883efb17c02194972ba20a71f /lib/private/DB/OracleConnection.php
parentefa52ec1113eeccbd3935a8c96ea23c47ca190ab (diff)
downloadnextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.tar.gz
nextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.zip
Start migrations
Fixme: - Install and update of apps - No revert on live systems (debug only) - Service adjustment to our interface - Loading via autoloader Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/DB/OracleConnection.php')
-rw-r--r--lib/private/DB/OracleConnection.php23
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/private/DB/OracleConnection.php b/lib/private/DB/OracleConnection.php
index 08d71365172..51faf21970c 100644
--- a/lib/private/DB/OracleConnection.php
+++ b/lib/private/DB/OracleConnection.php
@@ -30,9 +30,14 @@ class OracleConnection extends Connection {
* Quote the keys of the array
*/
private function quoteKeys(array $data) {
- $return = array();
+ $return = [];
+ $c = $this->getDatabasePlatform()->getIdentifierQuoteCharacter();
foreach($data as $key => $value) {
- $return[$this->quoteIdentifier($key)] = $value;
+ if ($key[0] !== $c) {
+ $return[$this->quoteIdentifier($key)] = $value;
+ } else {
+ $return[$key] = $value;
+ }
}
return $return;
}
@@ -41,7 +46,9 @@ class OracleConnection extends Connection {
* {@inheritDoc}
*/
public function insert($tableName, array $data, array $types = array()) {
- $tableName = $this->quoteIdentifier($tableName);
+ if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
+ $tableName = $this->quoteIdentifier($tableName);
+ }
$data = $this->quoteKeys($data);
return parent::insert($tableName, $data, $types);
}
@@ -50,7 +57,9 @@ class OracleConnection extends Connection {
* {@inheritDoc}
*/
public function update($tableName, array $data, array $identifier, array $types = array()) {
- $tableName = $this->quoteIdentifier($tableName);
+ if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
+ $tableName = $this->quoteIdentifier($tableName);
+ }
$data = $this->quoteKeys($data);
$identifier = $this->quoteKeys($identifier);
return parent::update($tableName, $data, $identifier, $types);
@@ -60,9 +69,11 @@ class OracleConnection extends Connection {
* {@inheritDoc}
*/
public function delete($tableExpression, array $identifier, array $types = array()) {
- $tableName = $this->quoteIdentifier($tableExpression);
+ if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
+ $tableExpression = $this->quoteIdentifier($tableExpression);
+ }
$identifier = $this->quoteKeys($identifier);
- return parent::delete($tableName, $identifier);
+ return parent::delete($tableExpression, $identifier);
}
/**