Skip to content

Commit 91bc8e4

Browse files
scipiojrweitzman
authored andcommitted
Split table list returned by _drush_sql_get_db_table_list() correctly when on windows.
Exploding the newline-seperated string of table names only on newline characters (\n) leaves all corresponding carriage return (\r) chars behind. confusing all checks performed directly on the array, such as in_array. As e.g "sessions" != "sessions\r", $skip_tables oder $structure_tables will only contain the respective setting's last element.
1 parent aed5d04 commit 91bc8e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commands/sql/sql.drush.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ function _drush_sql_get_db_table_list($db_spec, $site_record = NULL) {
810810
'override-simulated' => TRUE,
811811
);
812812
$result = drush_invoke_process($target_site, 'sql-query', array($query), $options, $backend_options);
813-
$tables_raw = explode("\n", rtrim($result['output']));
813+
$tables_raw = preg_split('/\r\n|\r|\n/', rtrim($result['output']));
814814

815815
$tables = array();
816816
if (!empty($tables_raw)) {

0 commit comments

Comments
 (0)