From 15eec7b83c6198a124c2720e8ecc988605428f54 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 1 Jun 2017 16:56:34 +0200 Subject: 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 --- lib/private/DB/OracleConnection.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'lib/private/DB/OracleConnection.php') 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); } /** -- cgit v1.2.3