From 67254bd23a98db836b06ec89169a6fad92373d40 Mon Sep 17 00:00:00 2001 From: plach Date: Fri, 1 Sep 2017 14:42:02 +0200 Subject: [PATCH] Ensure "sql-cli" command sets an error on non-zero child process exit status. (#2925) --- commands/sql/sql.drush.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/sql/sql.drush.inc b/commands/sql/sql.drush.inc index 23ab737db6..1cba628618 100644 --- a/commands/sql/sql.drush.inc +++ b/commands/sql/sql.drush.inc @@ -444,7 +444,11 @@ function drush_sql_drop() { function drush_sql_cli() { drush_sql_bootstrap_further(); $sql = drush_sql_get_class(); - return !(bool)drush_shell_proc_open($sql->connect()); + $result = !drush_shell_proc_open($sql->connect()); + if (!$result) { + drush_set_error('DRUSH_SQL_CLI_ERROR', dt('SQL client error occurred.')); + } + return $result; } /**