-C :-)\s(CVS\s91)
-D 2000-06-09T14:14:33
+C added\sthe\sfcnt()\sfunction\sfor\stesting\s(CVS\s92)
+D 2000-06-11T23:50:13
F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4
F Makefile.in b5693de0513e32f6e51bf0d1c62ea0d6b9a6c5d6
F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958
F src/dbbe.c 4129779d7199c05200482046182f718a122f8c96
F src/dbbe.h a8a46f71238e0f09f3ec08fd9d1c8c7f4cdc49bf
F src/delete.c c267b93f7ccb5493b677fa18201880267c699aa8
-F src/expr.c 5790665132658362f1416755cc4060215c781e90
+F src/expr.c 81512e0ae54de0d347c9dbd7ed8928028f4e1b41
F src/insert.c ac4edfff474589c00b2490f206317dc5822122e5
F src/main.c e3297835b8e38ca726ac73f2c2bdb7cf08103197
F src/parse.y 6a3085fd8e2c477e73468e6d1a278cb72254c0c9
F src/select.c 3a12d76074fa57d7c39c4436bdeb8d7e1eb6fdf4
F src/shell.c 3f4afc39a36e4824e8aa262623fd03568874799e
F src/sqlite.h 58da0a8590133777b741f9836beaef3d58f40268
-F src/sqliteInt.h 0aac58ed2e9fe46f24411e2e012fe85cd3457129
+F src/sqliteInt.h 19954bd2f75632849b265b9d7163a67391ec5148
F src/tclsqlite.c 9f358618ae803bedf4fb96da5154fd45023bc1f7
F src/tokenize.c 344754f81b55da5b19ea9504dfa16a9de68cd5ba
F src/update.c d8d90df714bac99c68446a0c49f3d957ca6fc3c8
F src/util.c 38e4bb5edf6fa92e677698c45785bf73c69b9e9f
-F src/vdbe.c ec66bc50ac92f0cbb8582e503a8366231d3579ef
-F src/vdbe.h 8f79f57c66ce1030f6371ff067b326d627a52c6d
+F src/vdbe.c 00b2ab7e0c0df2ac6eb4bf659656afc30e76c66b
+F src/vdbe.h 5f58611b19799de2dbcdefa4eef33a255cfa8d0d
F src/where.c c9b90e7672f4662a83ef9a27a193020d69fe034c
F test/all.test 0950c135cab7e60c07bd745ccfad1476211e5bd7
F test/copy.test b77a1214bd7756f2849d5c4fa6e715c0ff0c34eb
F www/lang.tcl 1645e9107d75709be4c6099b643db235bbe0a151
F www/opcode.tcl 3cdc4bb2515fcfcbe853e3f0c91cd9199e82dadd
F www/sqlite.tcl 5420eab24b539928f80ea9b3088e2549d34f438d
-P aba926bb336d7ac28d7ca73db47185801e5d2c79
-R dd39acd153ed566c1b1c836be9a51d37
+P d573b431ed766db2d38672334a0c81faa1dde353
+R a071d3d9a4a3d2d16791159e4a3e2df8
U drh
-Z b881c0382203d92c75b521598ab53066
+Z beff43aecb1f6e4f53737f0253af3944
** But other routines are also provided to help in building up
** a program instruction by instruction.
**
-** $Id: vdbe.c,v 1.32 2000/06/09 14:14:34 drh Exp $
+** $Id: vdbe.c,v 1.33 2000/06/11 23:50:13 drh Exp $
*/
#include "sqliteInt.h"
#include <unistd.h>
Agg agg; /* Aggregate information */
int nSet; /* Number of sets allocated */
Set *aSet; /* An array of sets */
+ int nFetch; /* Number of OP_Fetch instructions executed */
};
/*
** this array, then copy and paste it into this file, if you want.
*/
static char *zOpName[] = { 0,
- "Open", "Close", "Fetch", "New",
- "Put", "Distinct", "Found", "NotFound",
- "Delete", "Field", "KeyAsData", "Key",
- "Rewind", "Next", "Destroy", "Reorganize",
- "ResetIdx", "NextIdx", "PutIdx", "DeleteIdx",
- "MemLoad", "MemStore", "ListOpen", "ListWrite",
- "ListRewind", "ListRead", "ListClose", "SortOpen",
- "SortPut", "SortMakeRec", "SortMakeKey", "Sort",
- "SortNext", "SortKey", "SortCallback", "SortClose",
- "FileOpen", "FileRead", "FileField", "FileClose",
- "AggReset", "AggFocus", "AggIncr", "AggNext",
- "AggSet", "AggGet", "SetInsert", "SetFound",
- "SetNotFound", "SetClear", "MakeRecord", "MakeKey",
- "Goto", "If", "Halt", "ColumnCount",
- "ColumnName", "Callback", "Integer", "String",
- "Null", "Pop", "Dup", "Pull",
- "Add", "AddImm", "Subtract", "Multiply",
- "Divide", "Min", "Max", "Like",
- "Glob", "Eq", "Ne", "Lt",
- "Le", "Gt", "Ge", "IsNull",
- "NotNull", "Negative", "And", "Or",
- "Not", "Concat", "Noop",
+ "Open", "Close", "Fetch", "Fcnt",
+ "New", "Put", "Distinct", "Found",
+ "NotFound", "Delete", "Field", "KeyAsData",
+ "Key", "Rewind", "Next", "Destroy",
+ "Reorganize", "ResetIdx", "NextIdx", "PutIdx",
+ "DeleteIdx", "MemLoad", "MemStore", "ListOpen",
+ "ListWrite", "ListRewind", "ListRead", "ListClose",
+ "SortOpen", "SortPut", "SortMakeRec", "SortMakeKey",
+ "Sort", "SortNext", "SortKey", "SortCallback",
+ "SortClose", "FileOpen", "FileRead", "FileField",
+ "FileClose", "AggReset", "AggFocus", "AggIncr",
+ "AggNext", "AggSet", "AggGet", "SetInsert",
+ "SetFound", "SetNotFound", "SetClear", "MakeRecord",
+ "MakeKey", "Goto", "If", "Halt",
+ "ColumnCount", "ColumnName", "Callback", "Integer",
+ "String", "Null", "Pop", "Dup",
+ "Pull", "Add", "AddImm", "Subtract",
+ "Multiply", "Divide", "Min", "Max",
+ "Like", "Glob", "Eq", "Ne",
+ "Lt", "Le", "Gt", "Ge",
+ "IsNull", "NotNull", "Negative", "And",
+ "Or", "Not", "Concat", "Noop",
};
/*
sqliteDbbeFetch(p->aTab[i].pTable, p->aStack[tos].n,
p->zStack[tos]);
}
+ p->nFetch++;
}
PopStack(p, 1);
break;
}
+ /* Opcode: Fcnt * * *
+ **
+ ** Push an integer onto the stack which is the total number of
+ ** OP_Fetch opcodes that have been executed by this virtual machine.
+ **
+ ** This instruction is used to implement the special fcnt() function
+ ** in the SQL dialect that SQLite understands. fcnt() is used for
+ ** testing purposes.
+ */
+ case OP_Fcnt: {
+ int i = ++p->tos;
+ if( NeedStack(p, p->tos) ) goto no_mem;
+ p->aStack[i].i = p->nFetch;
+ p->aStack[i].flags = STK_Int;
+ break;
+ }
+
/* Opcode: Distinct P1 P2 *
**
** Use the top of the stack as a key. If a record with that key
if( i>=0 && i<p->nTable && p->aTab[i].pTable!=0 ){
if( sqliteDbbeNextKey(p->aTab[i].pTable)==0 ){
pc = pOp->p2 - 1;
+ }else{
+ p->nFetch++;
}
}
break;