emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61151: closed (30.0.50; sqlite-more-p is confusing)


From: GNU bug Tracking System
Subject: bug#61151: closed (30.0.50; sqlite-more-p is confusing)
Date: Thu, 02 Feb 2023 19:50:02 +0000

Your message dated Thu, 02 Feb 2023 21:49:00 +0200
with message-id <83edr7x2z7.fsf@gnu.org>
and subject line Re: bug#61151: 30.0.50; sqlite-more-p is confusing
has caused the debbugs.gnu.org bug report #61151,
regarding 30.0.50; sqlite-more-p is confusing
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
61151: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61151
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; sqlite-more-p is confusing Date: Sun, 29 Jan 2023 15:52:34 +0100
This code

  (let* ((db (sqlite-open))
         (stmt (sqlite-select db "values ('a',0), ('b',1)" nil 'set))
         (rows '()))
    (while (sqlite-more-p stmt)
      (push (sqlite-next stmt) rows))
    rows)

returns: (nil ("b" 1) ("a" 0))

I would expect: (("b" 1) ("a" 0))

I think it would be more natural, if sqlite-more-p would return false
before sqlite-next returns nil the first time.

Helmut



In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.16.0) of 2023-01-29 built on caladan
Repository revision: 254c75fc2935e7edef079166d90b231278115a2f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-xpm=ifavailable --with-jpeg=ifavailable
 --with-gif=ifavailable --with-tiff=ifavailable'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSELINUX
LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 GTK3
ZLIB



--- End Message ---
--- Begin Message --- Subject: Re: bug#61151: 30.0.50; sqlite-more-p is confusing Date: Thu, 02 Feb 2023 21:49:00 +0200
> From: Helmut Eller <eller.helmut@gmail.com>
> Cc: 61151@debbugs.gnu.org
> Date: Mon, 30 Jan 2023 07:57:09 +0100
> 
> On Sun, Jan 29 2023, Eli Zaretskii wrote:
> 
> >> On Sun, Jan 29 2023, Eli Zaretskii wrote:
> >> 
> >> >> However, sqlite-next seems to return nil once, but then it starts over.
> >> >
> >> > This should be easy to fix.
> >> 
> >> The documentation[1] also says: 
> >> 
> >>   SQLITE_DONE means that the statement has finished executing
> >>   successfully. sqlite3_step() should not be called again on this
> >>   virtual machine without first calling sqlite3_reset() to reset the
> >>   virtual machine back to its initial state.
> >> 
> >> So this would seems like prudent fix.
> >
> > What is "this"?  Signaling an error after sqlite-next returns nil?  Or
> > something else?
> 
> I meant to not call sqlite3_step again after that it has returned
> SQLITE_DONE.  Either by returning nil or signaling an error.

I went with the former.

I also documented that it returns nil when the statement finishes
execution.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]