GNU bug report logs -
#61151
30.0.50; sqlite-more-p is confusing
Previous Next
Reported by: Helmut Eller <eller.helmut <at> gmail.com>
Date: Sun, 29 Jan 2023 14:53:02 UTC
Severity: normal
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Helmut Eller <eller.helmut <at> gmail.com>
> 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.
I'm not sure I understand why you need sqlite-more-p here.
sqlite-next returns nil when it hits the end, so it should be enough.
If we document this fact in the doc string of sqlite-next, would that
be good enough to satisfy your use cases?
This bug report was last modified 2 years and 112 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.