Skip to content

Commit

Permalink
Change order of arguments in sql-connect in order to pass tests when …
Browse files Browse the repository at this point in the history
…a non-strandard port is used.
  • Loading branch information
weitzman committed Aug 28, 2014
1 parent b472956 commit 7861ec3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions commands/sql/sql.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1235,17 +1235,18 @@ function _drush_sql_get_credentials($db_spec = NULL) {
$parameters['host'] = $db_spec['host'];
}

if (!empty($db_spec['port'])) {
$parameters['port'] = $db_spec['port'];
}

// User is required. Drupal calls it 'username'. MySQL calls it 'user'.
$parameters['user'] = $db_spec['username'];

// EMPTY password is not the same as NO password, and is valid.
if (isset($db_spec['password'])) {
$parameters['password'] = $db_spec['password'];
}

if (!empty($db_spec['port'])) {
$parameters['port'] = $db_spec['port'];
}

break;

case 'pgsql':
Expand Down

0 comments on commit 7861ec3

Please sign in to comment.