SQLite Forum

"expr" syntax diagram differs from behaviour
Login

"expr" syntax diagram differs from behaviour

(1.1) Originally by Richard PArkins (rparkins) with edits by Richard Hipp (drh) on 2021-01-28 14:50:04 from 1.0 [link] [source]

The syntax diagram for expressions at https://www.sqlite.org/lang_expr.html shows that if IN is followed by a list of expressions (rather than any of the other options allowed) the list must be nonempty: it could just as easily have allowed an empty list as for a function argument list.

In fact the actual behaviour of sqlite 3.28.0 is to accept an empty list, and the value of expression IN () is zero, since whatever the expression is, it isn't in the list.

It isn't a major problem, but either the syntax diagram or the code is wrong.

(2) By Richard Hipp (drh) on 2021-01-28 15:15:30 in reply to 1.1 [source]

The syntax diagram for expressions ... shows that if IN is followed by a list of expressions ... the list must be nonempty

I see a direct path from the "(" to the ")" with no intermediate symbols. How is that not an empty list?

(3) By Richard PArkins (rparkins) on 2021-02-08 06:20:18 in reply to 2 [link] [source]

Sorry about that, you're right. I didn't spot the bypass above select-stmt.