aboutsummaryrefslogtreecommitdiff
path: root/src/vdbe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vdbe.c')
-rw-r--r--src/vdbe.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/vdbe.c b/src/vdbe.c
index 22967d41f..30b52aff5 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
-** $Id: vdbe.c,v 1.557 2006/06/13 15:00:55 danielk1977 Exp $
+** $Id: vdbe.c,v 1.558 2006/06/13 23:51:35 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -4593,17 +4593,19 @@ case OP_VOpen: {
** P1 is a cursor opened using VOpen. P2 is an address to jump to if
** the filtered result set is empty.
**
-** P3 points to enough free space to use to marshall the arguments.
+** P3 is either NULL or a string that was generated by the xBestIndex
+** method of the module. The interpretation of the P3 string is left
+** to the module implementation.
**
** This opcode invokes the xFilter method on the virtual table specified
-** by P1. The query plan parameter to xFilter is the top of the stack.
-** Next down on the stack is the argc parameter. Beneath the
+** by P1. The integer query plan parameter to xFilter is the top of the
+** stack. Next down on the stack is the argc parameter. Beneath the
** next of stack are argc additional parameters which are passed to
** xFilter as argv. The topmost parameter (i.e. 3rd element popped from
** the stack) becomes argv[argc-1] when passed to xFilter.
**
-** The query plan, argc, and all argv stack values are popped from the
-** stack before this instruction completes.
+** The integer query plan parameter, argc, and all argv stack values
+** are popped from the stack before this instruction completes.
**
** A jump is made to P2 if the result set after filtering would be
** empty.
@@ -4619,20 +4621,21 @@ case OP_VFilter: {
/* Grab the index number and argc parameters off the top of the stack. */
assert( (&pTos[-1])>=p->aStack );
- assert( pTos[0].flags&MEM_Blob && pTos[-1].flags==MEM_Int );
+ assert( (pTos[0].flags&MEM_Int)!=0 && pTos[-1].flags==MEM_Int );
nArg = pTos[-1].i;
/* Invoke the xFilter method if one is defined. */
if( pModule->xFilter ){
int res;
- int ii;
- Mem **apArg = (Mem **)pOp->p3;
- for(ii = 0; ii<nArg; ii++){
- apArg[ii] = &pTos[ii+1-2-nArg];
+ int i;
+ Mem **apArg = p->apArg;
+ for(i = 0; i<nArg; i++){
+ apArg[i] = &pTos[i+1-2-nArg];
+ storeTypeInfo(apArg[i], 0);
}
if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
- res = pModule->xFilter(pCur->pVtabCursor, pTos->z, pTos->n, nArg, apArg);
+ res = pModule->xFilter(pCur->pVtabCursor, pTos->i, pOp->p3, nArg, apArg);
if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
if( res==0 ){