From 3f4a0281c77bc998ff1a13d51491d3a888219f67 Mon Sep 17 00:00:00 2001 From: Steve Gallo Date: Fri, 25 Jan 2019 10:37:39 -0500 Subject: [PATCH] Improve debugging messages (#783) --- classes/ETL/Maintenance/ExecuteSql.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/classes/ETL/Maintenance/ExecuteSql.php b/classes/ETL/Maintenance/ExecuteSql.php index 1eecf6cca0..56c1e5b517 100644 --- a/classes/ETL/Maintenance/ExecuteSql.php +++ b/classes/ETL/Maintenance/ExecuteSql.php @@ -205,18 +205,15 @@ public function execute(EtlOverseerOptions $etlOverseerOptions) // does not support multiple SQL statements in a single query. $sqlStatementList = explode($delimiter, $sqlFileContents); + + // Trim each SQL statement and filter empty items (such as newlines) + + $sqlStatementList = array_filter(array_map('trim', $sqlStatementList)); $numSqlStatements = count($sqlStatementList); $numStatementsProcessed = 0; foreach ($sqlStatementList as $sql) { - // Skip empty queries - - $sql = trim($sql); - if ( "" == $sql ) { - continue; - } - // Remove comments from the SQL before executing for clarity. $commentPatterns = array(