On 12/14/2015 3:09 PM, Bart Smissaert wrote:
> It could be either a pointer to sqlite3_value_text of sqlite3_value*

No it can't be. sqlite3_result_text takes a char*, not a sqlite3_value* 
or a const unsigned char*(*)(sqlite3_value*)

If you are saying that you plan to obtain the character pointer by 
calling sqlite3_value_text, then pass that exact pointer to 
sqlite3_result_text, then I would suggest you use sqlite3_result_value 
instead: it takes sqlite3_value* directly. If you insist on 
round-tripping through sqlite3_value_text, then you must pass 
SQLITE_TRANSIENT for the last parameter - the pointer returned by 
sqlite3_value_text is only guaranteed to be valid until the custom 
function returns.

> or it could be a pointer to a locally declared variable

In this case, you would also use SQLITE_TRANSIENT.
-- 
Igor Tandetnik

Reply via email to