Commit cb9c4958 authored by alexpott's avatar alexpott

Issue #2504417 followup by dawehner, daffie: Fix...

Issue #2504417 followup by dawehner, daffie: Fix Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::testGetQualifiedMapTablePrefix()
parent 48d0043b
...@@ -71,7 +71,15 @@ public function __construct(\PDO $connection, array $connection_options) { ...@@ -71,7 +71,15 @@ public function __construct(\PDO $connection, array $connection_options) {
// Only attach the database once. // Only attach the database once.
if (!isset($this->attachedDatabases[$prefix])) { if (!isset($this->attachedDatabases[$prefix])) {
$this->attachedDatabases[$prefix] = $prefix; $this->attachedDatabases[$prefix] = $prefix;
$this->query('ATTACH DATABASE :database AS :prefix', array(':database' => $connection_options['database'] . '-' . $prefix, ':prefix' => $prefix)); if ($connection_options['database'] === ':memory:') {
// In memory database use ':memory:' as database name. According to
// http://www.sqlite.org/inmemorydb.html it will open a unique
// database so attaching it twice is not a problem.
$this->query('ATTACH DATABASE :database AS :prefix', array(':database' => $connection_options['database'], ':prefix' => $prefix));
}
else {
$this->query('ATTACH DATABASE :database AS :prefix', array(':database' => $connection_options['database'] . '-' . $prefix, ':prefix' => $prefix));
}
} }
// Add a ., so queries become prefix.table, which is proper syntax for // Add a ., so queries become prefix.table, which is proper syntax for
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment