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
remotes/origin/ldap_group_count
Andreas Fischer 12 years ago
parent f35eae6442
commit e3b0b40779
  1. 14
      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();

Loading…
Cancel
Save