1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Update the FTS3 extension to use sqlite3_result_pointer() and

sqlite3_value_pointer() for passing FTS3 cursor objects from the table
into functions such as snippet().

FossilOrigin-Name: 0fa2e170e5e078d155c98b212ade36bd8424502ae07f2d82ebf77a76f57586ba
This commit is contained in:
drh
2017-07-13 17:48:14 +00:00
parent 3fb406083a
commit d43748aa98
3 changed files with 12 additions and 12 deletions

View File

@ -3353,8 +3353,7 @@ static int fts3ColumnMethod(
switch( iCol-p->nColumn ){
case 0:
/* The special 'table-name' column */
sqlite3_result_blob(pCtx, &pCsr, sizeof(Fts3Cursor*), SQLITE_TRANSIENT);
sqlite3_result_subtype(pCtx, SQLITE_BLOB);
sqlite3_result_pointer(pCtx, pCsr);
break;
case 1:
@ -3572,9 +3571,10 @@ static int fts3FunctionArg(
sqlite3_value *pVal, /* argv[0] passed to function */
Fts3Cursor **ppCsr /* OUT: Store cursor handle here */
){
int rc = SQLITE_OK;
if( sqlite3_value_subtype(pVal)==SQLITE_BLOB ){
*ppCsr = *(Fts3Cursor**)sqlite3_value_blob(pVal);
int rc;
*ppCsr = (Fts3Cursor*)sqlite3_value_pointer(pVal);
if( (*ppCsr)!=0 ){
rc = SQLITE_OK;
}else{
char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc);
sqlite3_result_error(pContext, zErr, -1);