From da8aa2d44ecb5f4bff4a84d1dba9520343d79982 Mon Sep 17 00:00:00 2001 From: Sebastian Goll Date: Wed, 18 Dec 2024 16:26:15 +0100 Subject: [PATCH] Remove unnecessary space from DELETE that causes duplication --- CHANGELOG.md | 4 ++++ diesel/src/query_builder/delete_statement/mod.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b006453871c5..894ccd50956e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ in a way that makes the pools suitable for use in parallel tests. * Added `Json` and `Jsonb` support for the SQLite backend. * Fixed diesel thinking `a.eq_any(b)` was non-nullable even if `a` and `b` were nullable. +### Fixed + +* Use a single space instead of two spaces between `DELETE FROM`. + ## [2.2.2] 2024-07-19 ### Fixed diff --git a/diesel/src/query_builder/delete_statement/mod.rs b/diesel/src/query_builder/delete_statement/mod.rs index f69456f8a102..394771a6d0cc 100644 --- a/diesel/src/query_builder/delete_statement/mod.rs +++ b/diesel/src/query_builder/delete_statement/mod.rs @@ -259,7 +259,7 @@ where Ret: QueryFragment, { fn walk_ast<'b>(&'b self, mut out: AstPass<'_, 'b, DB>) -> QueryResult<()> { - out.push_sql("DELETE "); + out.push_sql("DELETE"); self.from_clause.walk_ast(out.reborrow())?; self.where_clause.walk_ast(out.reborrow())?; self.returning.walk_ast(out.reborrow())?;