James K. Lowden wrote:
> I'm not sure how to manage the lifetime of ancillary data for a
> user-defined function added by sqlite3_create_function ().
> [...]
> Suppose xStep doesn't fail, but another query is executing
> simultaneously, also using the median() UDF.  I need one data structure
> per context.  I don't see support for that in the SQLite API.

http://www.sqlite.org/c3ref/aggregate_context.html

> Suppose sqlite3_realloc() fails during one xStep.  The
> computation will be invalidated.  Will xStep be called again after it
> raises an error?

xStep does not raise an error.  Set a flag, and return an error in
xFinish.

> Will xFinal be called?

Yes.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to