diff --git a/GRDB/Core/DatabaseError.swift b/GRDB/Core/DatabaseError.swift index 653c019b9..5695eb12b 100644 --- a/GRDB/Core/DatabaseError.swift +++ b/GRDB/Core/DatabaseError.swift @@ -549,7 +549,7 @@ extension DatabaseError: CustomStringConvertible { description += ": \(message)" } if let sql { - description += " - while executing `\(sql)`" + description += " - while executing `\(sql.trimmedSQLStatement)`" } if publicStatementArguments, let arguments, !arguments.isEmpty { description += " with arguments \(arguments)" @@ -577,7 +577,7 @@ extension DatabaseError: CustomStringConvertible { description += ": \(message)" } if let sql { - description += " - while executing `\(sql)`" + description += " - while executing `\(sql.trimmedSQLStatement)`" } if let arguments, !arguments.isEmpty { description += " with arguments \(arguments)" diff --git a/Tests/GRDBTests/UpdateStatementTests.swift b/Tests/GRDBTests/UpdateStatementTests.swift index c14e8c6dd..faf20f676 100644 --- a/Tests/GRDBTests/UpdateStatementTests.swift +++ b/Tests/GRDBTests/UpdateStatementTests.swift @@ -388,7 +388,7 @@ class UpdateStatementTests : GRDBTestCase { XCTAssertEqual(error.description, """ SQLite error 21: Multiple statements found. To execute multiple statements, \ use Database.execute(sql:) or Database.allStatements(sql:) instead. \ - - while executing `UPDATE persons SET age = 1; UPDATE persons SET age = 2;` + - while executing `UPDATE persons SET age = 1; UPDATE persons SET age = 2` """) } }