[Pkg-owncloud-commits] [owncloud] 44/153: Do not quote table names on Oracle. They appear to be already quoted.
David Prévot
taffit at moszumanska.debian.org
Tue May 27 03:05:33 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit e3b0b40779369457e849396f2dfee3a3d652114f
Author: Andreas Fischer <bantu at owncloud.com>
Date: Mon Apr 14 17:52:34 2014 +0200
Do not quote table names on Oracle. They appear to be already quoted.
Without this commit, Oracle complains as follows:
[Doctrine\DBAL\DBALException]
An exception occurred while executing 'INSERT INTO "oc_appconfig" ("""appid""",
"""configkey""", """configvalue""") VALUES (?, ?, ?)' with params ["core",
"installedat", "1396972927.537"]:
ORA-01741: illegal zero-length identifier
---
core/command/db/converttype.php | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php
index cf0f443..6ab2d89 100644
--- a/core/command/db/converttype.php
+++ b/core/command/db/converttype.php
@@ -193,7 +193,7 @@ class ConvertType extends Command {
return $schemaManager->listTableNames();
}
- protected function copyTable(Connection $fromDB, Connection $toDB, $table, OutputInterface $output) {
+ protected function copyTable(Connection $fromDB, Connection $toDB, $table, InputInterface $input, OutputInterface $output) {
/** @var $progress \Symfony\Component\Console\Helper\ProgressHelper */
$progress = $this->getHelperSet()->get('progress');
$query = 'SELECT COUNT(*) FROM '.$table;
@@ -204,9 +204,13 @@ class ConvertType extends Command {
$progress->setRedrawFrequency($count > 100 ? 5 : 1);
while($row = $statement->fetch()) {
$progress->advance();
- $data = array();
- foreach ($row as $columnName => $value) {
- $data[$toDB->quoteIdentifier($columnName)] = $value;
+ if ($input->getArgument('type') === 'oci') {
+ $data = $row;
+ } else {
+ $data = array();
+ foreach ($row as $columnName => $value) {
+ $data[$toDB->quoteIdentifier($columnName)] = $value;
+ }
}
$toDB->insert($table, $data);
}
@@ -220,7 +224,7 @@ class ConvertType extends Command {
// copy table rows
foreach($tables as $table) {
$output->writeln($table);
- $this->copyTable($fromDB, $toDB, $table, $output);
+ $this->copyTable($fromDB, $toDB, $table, $input, $output);
}
if ($type == 'pgsql') {
$sequences = $toDB->getSchemaManager()->listSequences();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list