Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Jan Hudec
On Thu, Sep 15, 2011 at 18:58:00 +0100, Tim Streater wrote: > On 15 Sep 2011 at 18:21, Jay A. Kreibich wrote: > > Why? It is a function call. One would expect all the parameters to > > be evaluated, and then the function called. In almost all languages, > > short-circuit

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Tim Streater
On 15 Sep 2011 at 18:21, Jay A. Kreibich wrote: > On Thu, Sep 15, 2011 at 11:13:57AM -0500, Puneet Kishor scratched on the wall: > >> While your suggested documentation won't harm, and will likely help, >> actually the above does suggest to me a short-circuit-ish kind of >>

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Jay A. Kreibich
On Thu, Sep 15, 2011 at 11:13:57AM -0500, Puneet Kishor scratched on the wall: > While your suggested documentation won't harm, and will likely help, > actually the above does suggest to me a short-circuit-ish kind of > logic from the assertion that "The coalesce() function returns a > copy of

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Sam Carleton
On Thu, Sep 15, 2011 at 12:24 PM, Simon Slavin wrote: > > On 15 Sep 2011, at 5:00pm, Sam Carleton wrote: > >> I don't mean to be difficult, but I simply don't get any indication of >> how exactly COALESCE actually functions from this description: >> >> "coalesce(X,Y,...)    

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Simon Slavin
On 15 Sep 2011, at 5:00pm, Sam Carleton wrote: > I don't mean to be difficult, but I simply don't get any indication of > how exactly COALESCE actually functions from this description: > > "coalesce(X,Y,...)The coalesce() function returns a copy of its first > non-NULL argument, or NULL if

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Puneet Kishor
On Sep 15, 2011, at 11:00 AM, Sam Carleton wrote: > On Thu, Sep 15, 2011 at 10:05 AM, Simon Slavin wrote: >> >> Documentation for COALESCE is here: >> >> http://www.sqlite.org/lang_corefunc.html >> >> It does not say whether it does short-circuit evaluation but the

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Sam Carleton
On Thu, Sep 15, 2011 at 10:05 AM, Simon Slavin wrote: > > Documentation for COALESCE is here: > > http://www.sqlite.org/lang_corefunc.html > > It does not say whether it does short-circuit evaluation but the description > does imply testing one by one, rather than

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Simon Slavin
On 15 Sep 2011, at 2:57pm, Alexey Pechnikov wrote: > Richard, is the future documented anywhere? Heh. I assume you meant to type 'feature'. Documentation for COALESCE is here: http://www.sqlite.org/lang_corefunc.html It does not say whether it does short-circuit evaluation but the

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Alexey Pechnikov
Richard, is the future documented anywhere? 2011/9/15 Richard Hipp : > On Thu, Sep 15, 2011 at 8:08 AM, Igor Tandetnik wrote: > >> Richard Hipp wrote: >> > On Wed, Sep 14, 2011 at 9:03 PM, Sam Carleton < >> scarle...@miltonstreet.com>wrote:

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Sam Carleton
On Thu, Sep 15, 2011 at 6:38 AM, Richard Hipp wrote: > On Wed, Sep 14, 2011 at 9:03 PM, Sam Carleton >wrote: > > > Forgive me, fore I have forgotten the term used to describe the behavior > if > > a C if statement where it stops executing on the

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Richard Hipp
On Thu, Sep 15, 2011 at 8:08 AM, Igor Tandetnik wrote: > Richard Hipp wrote: > > On Wed, Sep 14, 2011 at 9:03 PM, Sam Carleton < > scarle...@miltonstreet.com>wrote: > > > >> Forgive me, fore I have forgotten the term used to describe the behavior > if > >>

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Igor Tandetnik
Richard Hipp wrote: > On Wed, Sep 14, 2011 at 9:03 PM, Sam Carleton > wrote: > >> Forgive me, fore I have forgotten the term used to describe the behavior if >> a C if statement where it stops executing on the first false statement, >> but... Does

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Richard Hipp
On Wed, Sep 14, 2011 at 9:03 PM, Sam Carleton wrote: > Forgive me, fore I have forgotten the term used to describe the behavior if > a C if statement where it stops executing on the first false statement, > but... Does coalesce do that? > "Short-circuit evaluation"

Re: [sqlite] Does coalesce terminate early?

2011-09-14 Thread Igor Tandetnik
On 9/14/2011 9:03 PM, Sam Carleton wrote: Forgive me, fore I have forgotten the term used to describe the behavior if a C if statement where it stops executing on the first false statement, but... Does coalesce do that? The word you are looking for is "short-circuit", and no, unfortunately,

[sqlite] Does coalesce terminate early?

2011-09-14 Thread Sam Carleton
Forgive me, fore I have forgotten the term used to describe the behavior if a C if statement where it stops executing on the first false statement, but... Does coalesce do that? I have to put together a query that has a coalesce such that if the row from the table is null, it then does a