From 81ae38b9d9224cab067a19eefdfe57e9f4e7fefd Mon Sep 17 00:00:00 2001 From: Yue Yi Date: Mon, 14 Jul 2025 13:57:19 +0800 Subject: [PATCH] Fix 'sqlite-mode-delete' with NULL field values * lisp/sqlite-mode.el (sqlite-mode-delete): Support NULL field values (bug#79011). (cherry picked from commit 9153f1f3bb5c86878bedc0be6f5a1cd60a0e88f4) --- lisp/sqlite-mode.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/sqlite-mode.el b/lisp/sqlite-mode.el index a4b96b02b48..82d5cc80a2c 100644 --- a/lisp/sqlite-mode.el +++ b/lisp/sqlite-mode.el @@ -204,9 +204,12 @@ (format "delete from \"%s\" where %s" (cdr table) (string-join - (mapcar (lambda (column) - (format "\"%s\" = ?" (car (split-string column " ")))) - (cons "rowid" (sqlite-mode--column-names (cdr table)))) + (cl-mapcar (lambda (column value) + (format "\"%s\" %s ?" + (car (split-string column " ")) + (if value "=" "is"))) + (cons "rowid" (sqlite-mode--column-names (cdr table))) + row) " and ")) row) (delete-region (line-beginning-position) (progn (forward-line 1) (point))))) -- 2.39.5