On Thu, Dec 17, 2009 at 10:15:35AM -0500, Nicolas Rivera scratched on the wall:
> Jay --
>
> Are you saying that:
>
> (a) sqlite3_complete("") returns 0 in your system and therefore I must  
> be doing something wrong,
>
> (b) or sqlite3_complete("") does return 1 and it is a bug?

  I didn't test it. 
  
  All I'm saying is that if an empty string returns true, and there
  isn't some other weird issue going on, then this behavior is contrary
  to the API call specification (which is even stronger than being
  contrary to the documentation).  I was only offering support that
  this does, at first, appear to be an actual bug, and not a differing
  interpretation of the general call documentation.

> If I am doing something wrong, does anyone have an idea of what it could be?

  It doesn't sound like it.

   -j

>> On 12/16/2009 5:22 PM, Jay A. Kreibich wrote:
>>
>> On Wed, Dec 16, 2009 at 04:52:16PM -0500, Nicolas Rivera scratched on the 
>> wall:
>>   
>>> Thanks for your reply Dr. Hipp.
>>>
>>> I just ran those, and they do return 0.
>>>
>>> But I am confused.  The documentation says:
>>> "These routines return 1 if the input string appears to be a complete 
>>> SQL statement. A statement is judged to be complete if it ends with a 
>>> semicolon token and is not a prefix of a well-formed CREATE TRIGGER  
>>> statement."
>>> (http://www.hwaci.com/sw/sqlite/c3ref/complete.html)
>>>     
>>> I guess a statement is also judged to be complete if it is the empty  
>>> string -- which does not end with a semicolon token.
>>
>>   That seems wrong; empty string should return a 0 as the string does
>>   not contain "one or more non-whitespace tokens."
>>
>>     http://sqlite.org/hlr10000.html#H10511
>>
>>     H10511: A successful evaluation of sqlite3_complete() or
>>     sqlite3_complete16() functions shall return a numeric 1 if and only
>>     if the input string contains one or more non-whitespace tokens and
>>     the last non-whitespace token in is a semicolon that is not in the
>>     middle of a CREATE TRIGGER statement. 
>>
>>    -j
>>
>>
>>   

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to