Forgot to add: My user-defined function uses C/C++ API provided by SQLite, and will be compiled into an extension (Windows dll).
On 1 May 2016 at 10:55, David Lee <mailtolky at gmail.com> wrote: > Hi, > > I am trying to implement a user-defined function (not aggregate > function) that takes two arguments. > > SQLite version is 3.8.11.1 > > - > > (1) According to the paragraph near the bottom of this help page > (https://www.sqlite.org/c3ref/value_blob.html) > >>> Please pay particular attention to the fact that the pointer returned from >>> sqlite3_value_blob(), sqlite3_value_text(), or sqlite3_value_text16() can >>> be invalidated by a subsequent call to sqlite3_value_bytes(), >>> sqlite3_value_bytes16(), sqlite3_value_text(), or sqlite3_value_text16(). > > If I get a pointer to the first argument via sqlite3_value_text16(), > and call it AGAIN to get a pointer to the second argument, does it > mean the first pointer will be invalidated? > > (2) Is there a built-in cleanup functions that I have to call for > these pointers? > > Thanks. > > David Lee.