We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug ArchiveRestoreCommands::importDatabase() https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/ArchiveRestoreCommands.php#L576
ArchiveRestoreCommands::importDatabase()
It tries to ensure that the database is exists and it is empty.
if ($isDbExist && !$sql->drop($sql->listTablesQuoted())) { throw new Exception( dt('Failed to drop database !database.', ['!database' => $databaseSpec['database']]) ); } elseif (!$sql->createdb(true)) { throw new Exception( dt('Failed to create database !database.', ['!database' => $databaseSpec['database']]) ); }
I think the problem with the code above is that:
$isDbExists === true
$sql->drop()
if ()
false
elseif (!$sql->createdb(true))
Actual behavior Wrong exception with misleading error message.
Workaround
if ($isDbExist && !$sql->drop($sql->listTablesQuoted())) { throw new Exception( dt('Failed to drop database !database.', ['!database' => $databaseSpec['database']]) ); } if (!$isDbExist && !$sql->createdb(true)) { throw new Exception( dt('Failed to create database !database.', ['!database' => $databaseSpec['database']]) ); }
The text was updated successfully, but these errors were encountered:
Fix drush-ops#5639. ArchiveRestoreCommands::importDatabase problem wi…
f0793e9
…th DB drop or create logic
166af7a
No branches or pull requests
Describe the bug
ArchiveRestoreCommands::importDatabase()
https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/ArchiveRestoreCommands.php#L576
It tries to ensure that the database is exists and it is empty.
I think the problem with the code above is that:
$isDbExists === true
$sql->drop()
is also successful, that means the overallif ()
isfalse
elseif (!$sql->createdb(true))
Actual behavior
Wrong exception with misleading error message.
Workaround
System Configuration
The text was updated successfully, but these errors were encountered: