-C Fix\scompilation\sproblem\sin\stest5.c\s(CVS\s1318)
-D 2004-05-07T01:50:37
+C Trying\sto\ssynchronize\sthe\stest3.c\smodule\swith\sthe\snew\sbtree.c\scode.\s(CVS\s1319)
+D 2004-05-07T02:26:28
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F src/tclsqlite.c 3a5f8192ed5279a68610102a92a3a9f0cdd09e68
F src/test1.c 9aa62b89d420e6763b5e7ae89a47f6cf87370477
F src/test2.c 9d611c45e1b07039a2bd95f5ea73178362b23229
-F src/test3.c 7d06add423e4a90ec1a2e8d02006f82081109558
+F src/test3.c 3965c323b3a84b1a93e43b412e2c38cd3e3a8e6e
F src/test4.c 6e3e31acfaf21d66420fc35fda5b17dc0000cc8d
F src/test5.c 3ff0565057b8d23e20092d5c6c0b7cb0d932c51e
F src/tokenize.c 6676b946fd8825b67ab52140af4fdc57a70bda48
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P 71260ff7f7030f56c292b43f83a213c65c9a184e
-R 194b5ad3e3513e70d086b1bb91cc9406
-U danielk1977
-Z f28618267aa956a5d19b9055b43e3bc5
+P 49c3c86c17bcd8132216791d7a1a17e2c6256206
+R 121265b7ada7abd612209a97396c18a3
+U drh
+Z cd14b2dc0ebca94dac5f612d17c68cb1
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test3.c,v 1.24 2004/05/04 17:27:28 drh Exp $
+** $Id: test3.c,v 1.25 2004/05/07 02:26:28 drh Exp $
*/
#include "sqliteInt.h"
#include "pager.h"
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
- rc = sqliteBtreeDelete(pCur);
+ rc = sqlite3BtreeDelete(pCur);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
- rc = sqliteBtreeInsert(pCur, argv[2], strlen(argv[2]),
+ rc = sqlite3BtreeInsert(pCur, argv[2], strlen(argv[2]),
argv[3], strlen(argv[3]));
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
- rc = sqliteBtreeNext(pCur, &res);
+ rc = sqlite3BtreeNext(pCur, &res);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
- rc = sqliteBtreePrevious(pCur, &res);
+ rc = sqlite3BtreePrevious(pCur, &res);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
- rc = sqliteBtreeFirst(pCur, &res);
+ rc = sqlite3BtreeFirst(pCur, &res);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
- rc = sqliteBtreeLast(pCur, &res);
+ rc = sqlite3BtreeLast(pCur, &res);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
return SQLITE_OK;
}
+/*
+** Usage: btree_keysize ID
+**
+** Return the number of bytes of key.
+*/
+static int btree_keysize(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+ u64 n64;
+ u32 n;
+ char zBuf[50];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ sqlite3BtreeKeySize(pCur, &n64);
+ n = (u32)n64
+ sprintf(zBuf, "%u", n);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
/*
** Usage: btree_key ID
**
){
BtCursor *pCur;
int rc;
- int n;
+ u64 n;
char *zBuf;
if( argc!=2 ){
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
- sqliteBtreeKeySize(pCur, &n);
+ sqlite3BtreeKeySize(pCur, &n);
zBuf = malloc( n+1 );
rc = sqliteBtreeKey(pCur, 0, n, zBuf);
if( rc!=n ){
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
sqliteBtreeDataSize(pCur, &n);
zBuf = malloc( n+1 );
- rc = sqliteBtreeData(pCur, 0, n, zBuf);
+ rc = sqlite3BtreeData(pCur, 0, n, zBuf);
if( rc!=n ){
char zMsg[100];
free(zBuf);
const char **argv /* Text of each argument */
){
BtCursor *pCur;
- int n1, n2;
+ int n2;
+ u32 n1;
char zBuf[50];
if( argc!=2 ){
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
- sqliteBtreeKeySize(pCur, &n1);
- sqliteBtreeDataSize(pCur, &n2);
+ sqlite3BtreeKeySize(pCur, &n1);
+ sqlite3BtreeDataSize(pCur, &n2);
sprintf(zBuf, "%d", n1+n2);
Tcl_AppendResult(interp, zBuf, 0);
return SQLITE_OK;
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
- rc = sqliteBtreeCursorDump(pCur, aResult);
+ rc = sqlite3BtreeCursorDump(pCur, aResult);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
}
Tcl_LinkVar(interp, "pager_refinfo_enable", (char*)&pager_refinfo_enable,
TCL_LINK_INT);
- Tcl_LinkVar(interp, "btree_native_byte_order",(char*)&btree_native_byte_order,
- TCL_LINK_INT);
return TCL_OK;
}