1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Allow virtual table implementations to overload function that use

a column of the virtual table as their first argument.  Untested. (CVS 3322)

FossilOrigin-Name: 12cc7af4b6b8b4f1a43d962fbafde8cba683a907
This commit is contained in:
drh
2006-07-08 17:06:43 +00:00
parent 4144905b53
commit b7f6f68f3a
10 changed files with 117 additions and 23 deletions

View File

@@ -373,6 +373,17 @@ void sqlite3VdbeJumpHere(Vdbe *p, int addr){
sqlite3VdbeChangeP2(p, addr, p->nOp);
}
/*
** If the input FuncDef structure is ephemeral, then free it. If
** the FuncDef is not ephermal, then do nothing.
*/
static void freeEphemeralFunction(FuncDef *pDef){
if( pDef && (pDef->flags & SQLITE_FUNC_EPHEM)!=0 ){
sqliteFree(pDef);
}
}
/*
** Delete a P3 value if necessary.
*/
@@ -391,10 +402,15 @@ static void freeP3(int p3type, void *p3){
}
case P3_VDBEFUNC: {
VdbeFunc *pVdbeFunc = (VdbeFunc *)p3;
freeEphemeralFunction(pVdbeFunc->pFunc);
sqlite3VdbeDeleteAuxData(pVdbeFunc, 0);
sqliteFree(pVdbeFunc);
break;
}
case P3_FUNCDEF: {
freeEphemeralFunction((FuncDef*)p3);
break;
}
case P3_MEM: {
sqlite3ValueFree((sqlite3_value*)p3);
break;