diff options
author | Andreas Fischer <bantu@owncloud.com> | 2014-04-14 17:52:34 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-04-14 17:52:34 +0200 |
commit | e3b0b40779369457e849396f2dfee3a3d652114f (patch) | |
tree | 2350eddecfa47a23b725cbd9daca51276dee6cbb /core/command | |
parent | f35eae64423b6d0346a13ff04fe2106d27276d66 (diff) | |
download | nextcloud-server-e3b0b40779369457e849396f2dfee3a3d652114f.tar.gz nextcloud-server-e3b0b40779369457e849396f2dfee3a3d652114f.zip |
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
Diffstat (limited to 'core/command')
-rw-r--r-- | core/command/db/converttype.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php index cf0f4437f73..6ab2d893c60 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(); |