diff options
author | F. Jason Park <jp@neverwas.me> | 2024-03-10 20:13:42 -0700 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2024-03-11 15:23:55 +0200 |
commit | db5915f30ba063b72b007d243fbd832e8a4e8961 (patch) | |
tree | 573d768e8ae5dc14ed813d1ee032a4d8de5e2831 /lisp/sqlite.el | |
parent | fe491173e8f839653cb22eea63a7261f4aa1dca9 (diff) | |
download | emacs-db5915f30ba063b72b007d243fbd832e8a4e8961.tar.gz emacs-db5915f30ba063b72b007d243fbd832e8a4e8961.tar.bz2 emacs-db5915f30ba063b72b007d243fbd832e8a4e8961.zip |
Fix 'with-sqlite-transaction'
* lisp/sqlite.el (with-sqlite-transaction): Tuck misplaced body
of else form back into feature-test control structure whence it
escaped. (Bug#67142)
* test/lisp/sqlite-tests.el: New file to accompany
test/src/sqlite-tests.el.
Diffstat (limited to 'lisp/sqlite.el')
-rw-r--r-- | lisp/sqlite.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/sqlite.el b/lisp/sqlite.el index 46e35ac18d8..efc5997fb5c 100644 --- a/lisp/sqlite.el +++ b/lisp/sqlite.el @@ -32,7 +32,8 @@ If BODY completes normally, commit the changes and return the value of BODY. If BODY signals an error, or transaction commit fails, roll -back the transaction changes." +back the transaction changes before allowing the signal to +propagate." (declare (indent 1) (debug (form body))) (let ((db-var (gensym)) (func-var (gensym)) @@ -48,8 +49,8 @@ back the transaction changes." (setq ,res-var (funcall ,func-var)) (setq ,commit-var (sqlite-commit ,db-var)) ,res-var) - (or ,commit-var (sqlite-rollback ,db-var)))) - (funcall ,func-var)))) + (or ,commit-var (sqlite-rollback ,db-var))) + (funcall ,func-var))))) (provide 'sqlite) |