aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2023-09-30 16:50:17 +0000
committerdrh <>2023-09-30 16:50:17 +0000
commitd8f26350a0831acec6fe51f637f73aa48a9b091e (patch)
treebf7ef032b2bc623017f344e3049474efa11d22fc /src
parent7e86d3fc6961dc64a45cfefd6ceeea375167ffc4 (diff)
downloadsqlite-d8f26350a0831acec6fe51f637f73aa48a9b091e.tar.gz
sqlite-d8f26350a0831acec6fe51f637f73aa48a9b091e.zip
Restore the trunk version of sqlite3_user_data(). Fix the xColumn for virtual
tables so that the sqlite3_context contains a valid but NULL user data pointer. FossilOrigin-Name: 15ffd932fecc82a5791b2024f55d2ec80887e8eb7345de68d6f5cac4912cfbe8
Diffstat (limited to 'src')
-rw-r--r--src/vdbe.c3
-rw-r--r--src/vdbeapi.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/vdbe.c b/src/vdbe.c
index 646313650..f2d94237a 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -8290,6 +8290,7 @@ case OP_VColumn: { /* ncycle */
const sqlite3_module *pModule;
Mem *pDest;
sqlite3_context sContext;
+ FuncDef nullFunc;
VdbeCursor *pCur = p->apCsr[pOp->p1];
assert( pCur!=0 );
@@ -8307,6 +8308,8 @@ case OP_VColumn: { /* ncycle */
memset(&sContext, 0, sizeof(sContext));
sContext.pOut = pDest;
sContext.enc = encoding;
+ nullFunc.pUserData = 0;
+ sContext.pFunc = &nullFunc;
assert( pOp->p5==OPFLAG_NOCHNG || pOp->p5==0 );
if( pOp->p5 & OPFLAG_NOCHNG ){
sqlite3VdbeMemSetNull(pDest);
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 6b32506f9..91843f563 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -845,7 +845,7 @@ int sqlite3_step(sqlite3_stmt *pStmt){
** pointer to it.
*/
void *sqlite3_user_data(sqlite3_context *p){
- return (p && p->pFunc) ? p->pFunc->pUserData : 0;
+ return p->pFunc->pUserData;
}
/*