On Fri, Jun 13, 2014 at 7:20 PM, Eric Rubin-Smith <eas....@gmail.com> wrote:
> If I say sqlite_bind_text(...SQLITE_STATIC), I am promising that the buffer > is going to stick around for a while. How long am I promising that it will > stick around? Til the next statement reset()? Til the statement > finalize()? Til the database close()? > Until the statement is done with that specific value. My rule of thumb is: the bytes must outlive the step() call. After step(), the statement won't do anything with those bytes (won't read/inspect them) because it has no need to. i use SQLITE_STATIC quite a lot for non-static data (b/c copying bytes for this type of thing pains me greatly), and the only guaranty i've ever needed making is that the bytes outlive the step() which accesses them. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users