Hi,
I was browsing the code in commands/sql/sql.drush.inc and found what would appear to be a bug in the function _drush_sql_get_spec_from_settings. cvs tells me I'm using the same revision 1.17 of the file as that of the repo.
The code starting at line 370:
// Build a $db_spec from a given settings.php.
function _drush_sql_get_spec_from_settings($file, $prefix) {
// Reset global databases to whatever is defined in $file
global $databases, $db_url;
require $file;
// Translate the custom options for sql load into ones usually recognized (i.e. no prefix).
if ($database = drush_get_option($prefix . '_database')) {
drush_set_option('database', $value);
}
I'm guessing that the variable $value on the second-last line should be $database, no? It looks like a pretty straightforward mistake -- drush_get_option uses a variable named $value to store its return value.
The related code seems to indicate that it will just always default to the default database.
I only use one db so I'm not really set up to test this out but I wanted to let yall know.
Comments
Comment #1
intuited commentedWhoops, make that version 1.18.
Comment #2
moshe weitzman commentedCommitted. Thanks.