Hi Igor,

On Tue, Jul 16, 2013 at 7:06 PM, Igor Tandetnik <i...@tandetnik.org> wrote:
> The metadata only survives a single iteration over the statement; in other
> words, it is cleared when you call sqlite3_reset (from the documentation:
> "SQLite will invoke the destructor function... when the SQL statement
> completes"). And you can't rebind the parameter in the middle of an
> iteration. So it looks like everything should work the way you want.

This is what I hoped, but I'm using the auxdata functions in an
extension I'm developing, and the behavior I'm experiencing is a bit
different.

At present I'm accessing the database from python, so I don't know the
exact moment when sqlite3_reset might get called, but from what I'm
seeing, things work as expected as long as literals are used. With
parameters binding, if the same query is repeatedly executed, it
behaves as if metadata were preserved (in my case this means that the
actual values passed to later queries are ignored and the results are
determined by the values passed to the first query execution).

In a test performed using APSW I disabled the statements cache and the
code behaved as expected also with parameters binding. This brought me
to think that the metadata associated to the parameters in a compiled
statement might be preserved until the statement is finalized, but I
will investigate things more in detail.

Best regards,
Riccardo
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to