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