diff --git a/manifest b/manifest index 35ceb50b40..e12c95938f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\smany\sproblems\swith\smanifest\stypes\sand\scolumn\saffinity.\sMost\sthings\sare\nworking\snow.\s(CVS\s1392) -D 2004-05-18T09:58:07 +C Fix\smany\sproblems\swith\smanifest\stypes\sand\scolumn\saffinity.\sMost\sthings\sare\nworking\snow.\s(CVS\s1393) +D 2004-05-18T10:06:25 F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -23,15 +23,15 @@ F sqlite.def fc4f5734786fe4743cfe2aa98eb2da4b089edb5f F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2 F src/attach.c c315c58cb16fd6e913b3bfa6412aedecb4567fa5 F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79 -F src/btree.c bf8d9592b66fb9ba89a5be13fd99a7d8b8a67d7f -F src/btree.h 6f51ad0ffebfba71295fcacdbe86007512200050 +F src/btree.c f0ba709781624c3c4078f7f2a91e7a4df260bc15 +F src/btree.h b65140b5ae891f30d2a39e64b9f0343225553545 F src/btree_rb.c 9d7973e266ee6f9c61ce592f68742ce9cd5b10e5 F src/build.c 84a9b37700a18db370b9dbb77f1636df5cdf0290 F src/copy.c 4d2038602fd0549d80c59bda27d96f13ea9b5e29 F src/date.c 0eb0a89960bb45c7f7e768748605a7a97b0c8064 F src/delete.c a069dcc2ec0cc3487c8ababebc59a429b4556144 F src/encode.c a876af473d1d636faa3dca51c7571f2e007eea37 -F src/expr.c d39afb30c76c2f67fb5ffdfe530ed709c5009786 +F src/expr.c de3d86e98d9073399a8173610fb9f02d0e197aea F src/func.c cfbb7096efb58e2857e3b312a8958a12774b625a F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb @@ -42,14 +42,14 @@ F src/os.c ddcda92f7fd71b4513c57c1ec797917f206d504e F src/os.h fbb2f6595fc34fa351830d88fe1c6b85118f0383 F src/pager.c 6ff6b906427d4824099140776cb8768f922f3dc5 F src/pager.h 78a00ac280899bcba1a89dc51585dcae6b7b3253 -F src/parse.y d0258aa3cc8b0c5742b07b699d10fa98f3caea7d +F src/parse.y d2e226650738931c047c2562326ed05882af2330 F src/pragma.c fcbd8bc7f2cc1429758a042920e13c8738a6050c F src/printf.c ef750e8e2398ca7e8b58be991075f08c6a7f0e53 F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3 F src/select.c f376f3beade0e1e4808b3a393c13f5b30baecf74 F src/shell.c 0c4662e13bfbfd3d13b066c5859cc97ad2f95d21 F src/sqlite.h.in 799c5e726296ec7bc20e6407cdf4df0e0bc00c0c -F src/sqliteInt.h ac5fe07df6cf0a4c935e5a88bc14bc620e4f1591 +F src/sqliteInt.h 9e35491dc2fb88f792744d2e6c1cd172e0c28829 F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2 F src/tclsqlite.c fbf0fac73624ae246551a6c671f1de0235b5faa1 F src/test1.c 12ef76b8aaba4408422f21f269256b630d4dd627 @@ -58,14 +58,14 @@ F src/test3.c 0752af52c02d6b0053809ecf36adbdc81b90a402 F src/test4.c b3fab9aea7a8940a8a7386ce1c7e2157b09bd296 F src/test5.c eb39aac8fed61bd930b92613cd705c145244074a F src/tokenize.c e7536dd31205d5afb76c1bdc832dea009c7a3847 -F src/trigger.c 8df308e09113410bb895e88a2db65b55490268db +F src/trigger.c 11afe9abfba13a2ba142944c797c952e162d117f F src/update.c 0cc7291dd0e0f82cf93085e49c973e8ef9e51fd5 F src/utf.c fc799748d43fe1982d157b871e3e420a19c85d4f F src/util.c f9511ffba78e6cf71a28774c2820d7750b5bacdf F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476 F src/vdbe.c 5cc6e41f2c9f24bbbf591ca538c097c0f7b41a3d -F src/vdbe.h 94457ca73bae972dc61bca33a4dccc2e6e14e2f8 -F src/vdbeInt.h 311c2a046ea419781d0ef331198b7b0a65eebc92 +F src/vdbe.h 1d0d0b5741c7f46ab372a95a4305fed0ae09d466 +F src/vdbeInt.h b4ad3993c720eb80430aeff12d63f22eb4925e7d F src/vdbeaux.c 760105ceedb7bcfcd3f4dbba7a5500321612669b F src/where.c 5f480219a943b0fed1f6922d2fdbfba8616a9148 F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242 @@ -120,7 +120,7 @@ F test/pager2.test 7ff175a28484fd324df9315dfe35f6fb159910ec F test/pragma.test 06c4e51998dd68115ef7a60abeeff7accf198f83 F test/printf.test 46b3d07d59d871d0831b4a657f6dfcafe0574850 F test/progress.test 701b6115c2613128ececdfe1398a1bd0e1a4cfb3 x -F test/quick.test fa37bb9bf8f6a531b33f852284fa03f89a407697 +F test/quick.test 602cada4404580550bca5a7d233954e3da63a442 F test/quote.test 08f23385c685d3dc7914ec760d492cacea7f6e3d F test/rowid.test 863e6e75878cccf03d166fe52023f20e09508683 F test/select1.test 3bfcccd2eadcddbb07f1f5da6550aee8484ea4fb @@ -144,7 +144,7 @@ F test/trigger1.test 4538c1c7d6bbca5dfe619ea6e1682b07ece95b21 F test/trigger2.test 0767ab30cb5a2c8402c8524f3d566b410b6f5263 F test/trigger3.test a95ccace88291449f5eae7139ec438a42f90654d F test/trigger4.test 542afce45774e8f8e1130b96b8675f414d6e4bd8 -F test/types.test 5d877a84e148defced602e401ed6ef07778de237 +F test/types.test a16dad25e2a7591ddbca206b465a963953f5e10f F test/types2.test b9b528e5ec6c5d8ee149ff27d48a23ce3f6075d9 F test/unique.test 0e38d4cc7affeef2527720d1dafd1f6870f02f2b F test/update.test b29bd9061a1150426dab6959806fcc73a41b1217 @@ -192,7 +192,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P c1745f47ae6597953426c852559c3ba559b5ecd4 -R 02c7a45ac0cf509a83f0308e5e2e8fde +P a62872aacd544a1465b06e007153168663f3c83a +R a3d112b4c9fae17471c284b0b6484d54 U danielk1977 -Z 6d5d78b2c759d8987f601a926f92d5bb +Z 90517e42876f1a170b602612bd494c17 diff --git a/manifest.uuid b/manifest.uuid index fcc0512093..f01fba31c2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a62872aacd544a1465b06e007153168663f3c83a \ No newline at end of file +ad4a964158ba9ca9d221cf7ea0439577f3894890 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index b4a5dcb84f..cb91dc3a44 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btree.c,v 1.141 2004/05/16 16:24:37 drh Exp $ +** $Id: btree.c,v 1.142 2004/05/18 10:06:25 danielk1977 Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to @@ -1406,6 +1406,15 @@ create_cursor_exception: return rc; } +void sqlite3BtreeSetCompare( + BtCursor *pCur, + int(* xCmp)(void*,int,const void*,int,const void*), + void *pArg +){ + pCur->xCompare = xCmp ? xCmp : dfltCompare; + pCur->pArg = pArg; +} + /* ** Close a cursor. The read lock on the database file is released ** when the last cursor is closed. diff --git a/src/btree.h b/src/btree.h index d36f3aa52b..78fc61c597 100644 --- a/src/btree.h +++ b/src/btree.h @@ -13,7 +13,7 @@ ** subsystem. See comments in the source code for a detailed description ** of what each interface routine does. ** -** @(#) $Id: btree.h,v 1.47 2004/05/12 19:18:17 drh Exp $ +** @(#) $Id: btree.h,v 1.48 2004/05/18 10:06:25 danielk1977 Exp $ */ #ifndef _BTREE_H_ #define _BTREE_H_ @@ -73,6 +73,12 @@ int sqlite3BtreeCursor( BtCursor **ppCursor /* Returned cursor */ ); +void sqlite3BtreeSetCompare( + BtCursor *, + int(*)(void*,int,const void*,int,const void*), + void* +); + int sqlite3BtreeCloseCursor(BtCursor*); int sqlite3BtreeMoveto(BtCursor*, const void *pKey, i64 nKey, int *pRes); int sqlite3BtreeDelete(BtCursor*); diff --git a/src/expr.c b/src/expr.c index be2c265734..a0fff71d8e 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.121 2004/05/17 10:48:58 danielk1977 Exp $ +** $Id: expr.c,v 1.122 2004/05/18 10:06:25 danielk1977 Exp $ */ #include "sqliteInt.h" #include @@ -45,18 +45,18 @@ char const *sqlite3AffinityString(char affinity){ ** SELECT a AS b FROM t1 WHERE b; ** SELECT * FROM t1 WHERE (select a from t1); */ -static char exprAffinity(Expr *pExpr){ +char sqlite3ExprAffinity(Expr *pExpr){ if( pExpr->op==TK_AS ){ - return exprAffinity(pExpr->pLeft); + return sqlite3ExprAffinity(pExpr->pLeft); } if( pExpr->op==TK_SELECT ){ - return exprAffinity(pExpr->pSelect->pEList->a[0].pExpr); + return sqlite3ExprAffinity(pExpr->pSelect->pEList->a[0].pExpr); } return pExpr->affinity; } char sqlite3CompareAffinity(Expr *pExpr, char aff2){ - char aff1 = exprAffinity(pExpr); + char aff1 = sqlite3ExprAffinity(pExpr); if( aff1 && aff2 ){ /* Both sides of the comparison are columns. If one has numeric or ** integer affinity, use that. Otherwise use no affinity. @@ -85,7 +85,7 @@ static char comparisonAffinity(Expr *pExpr){ pExpr->op==TK_GT || pExpr->op==TK_GE || pExpr->op==TK_LE || pExpr->op==TK_NE ); assert( pExpr->pLeft ); - aff = exprAffinity(pExpr->pLeft); + aff = sqlite3ExprAffinity(pExpr->pLeft); if( pExpr->pRight ){ aff = sqlite3CompareAffinity(pExpr->pRight, aff); } @@ -121,7 +121,7 @@ int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity){ ** evaluates to NULL. */ static int binaryCompareP1(Expr *pExpr1, Expr *pExpr2, int jumpIfNull){ - char aff = exprAffinity(pExpr2); + char aff = sqlite3ExprAffinity(pExpr2); return (((int)sqlite3CompareAffinity(pExpr1, aff))<<8)+(jumpIfNull?1:0); } @@ -802,7 +802,7 @@ int sqlite3ExprResolveIds( if( sqlite3ExprResolveIds(pParse, pSrcList, pEList, pExpr->pLeft) ){ return 1; } - affinity = exprAffinity(pExpr->pLeft); + affinity = sqlite3ExprAffinity(pExpr->pLeft); /* Whether this is an 'x IN(SELECT...)' or an 'x IN()' ** expression it is handled the same way. A temporary table is @@ -828,7 +828,7 @@ int sqlite3ExprResolveIds( */ int iParm = pExpr->iTable + (((int)affinity)<<16); assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable ); - sqlite3Select(pParse, pExpr->pSelect, SRT_Set, iParm, 0, 0, 0); + sqlite3Select(pParse, pExpr->pSelect, SRT_Set, iParm, 0, 0, 0, 0); }else if( pExpr->pList ){ /* Case 2: expr IN (exprlist) ** @@ -874,7 +874,7 @@ int sqlite3ExprResolveIds( ** of the memory cell in iColumn. */ pExpr->iColumn = pParse->nMem++; - if( sqlite3Select(pParse, pExpr->pSelect, SRT_Mem, pExpr->iColumn,0,0,0) ){ + if(sqlite3Select(pParse, pExpr->pSelect, SRT_Mem,pExpr->iColumn,0,0,0,0)){ return 1; } break; diff --git a/src/parse.y b/src/parse.y index 9202a45a3b..952175ad5d 100644 --- a/src/parse.y +++ b/src/parse.y @@ -14,7 +14,7 @@ ** the parser. Lemon will also generate a header file containing ** numeric codes for all of the tokens. ** -** @(#) $Id: parse.y,v 1.113 2004/05/08 08:23:30 danielk1977 Exp $ +** @(#) $Id: parse.y,v 1.114 2004/05/18 10:06:25 danielk1977 Exp $ */ %token_prefix TK_ %token_type {Token} @@ -278,7 +278,7 @@ cmd ::= DROP VIEW nm(X). { //////////////////////// The SELECT statement ///////////////////////////////// // cmd ::= select(X). { - sqlite3Select(pParse, X, SRT_Callback, 0, 0, 0, 0); + sqlite3Select(pParse, X, SRT_Callback, 0, 0, 0, 0, 0); sqlite3SelectDelete(X); } diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 29aac804df..7f1bb00905 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.235 2004/05/17 10:48:58 danielk1977 Exp $ +** @(#) $Id: sqliteInt.h,v 1.236 2004/05/18 10:06:26 danielk1977 Exp $ */ #include "config.h" #include "sqlite.h" @@ -1191,7 +1191,7 @@ void sqlite3CreateIndex(Parse*,Token*,SrcList*,IdList*,int,Token*,Token*); void sqlite3DropIndex(Parse*, SrcList*); void sqlite3AddKeyType(Vdbe*, ExprList*); void sqlite3AddIdxKeyType(Vdbe*, Index*); -int sqlite3Select(Parse*, Select*, int, int, Select*, int, int*); +int sqlite3Select(Parse*, Select*, int, int, Select*, int, int*, char *aff); Select *sqlite3SelectNew(ExprList*,SrcList*,Expr*,ExprList*,Expr*,ExprList*, int,int,int); void sqlite3SelectDelete(Select*); @@ -1309,3 +1309,4 @@ void sqlite3TableAffinityStr(Vdbe *, Table *); char sqlite3CompareAffinity(Expr *pExpr, char aff2); char const *sqlite3AffinityString(char affinity); int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity); +char sqlite3ExprAffinity(Expr *pExpr); diff --git a/src/trigger.c b/src/trigger.c index 985b0b43cf..758513e4c6 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -189,7 +189,7 @@ void sqlite3FinishTrigger( { OP_String, 0, 0, 0 }, /* 3: table name */ { OP_Integer, 0, 0, 0 }, { OP_String, 0, 0, 0 }, /* 5: SQL */ - { OP_MakeRecord, 5, 0, 0 }, + { OP_MakeRecord, 5, 0, "tttit" }, { OP_PutIntKey, 0, 0, 0 }, }; int addr; @@ -615,7 +615,7 @@ static int codeTriggerProgram( Select * ss = sqlite3SelectDup(pTriggerStep->pSelect); assert(ss); assert(ss->pSrc); - sqlite3Select(pParse, ss, SRT_Discard, 0, 0, 0, 0); + sqlite3Select(pParse, ss, SRT_Discard, 0, 0, 0, 0, 0); sqlite3SelectDelete(ss); break; } diff --git a/src/vdbe.h b/src/vdbe.h index 7928dbe67d..393edcece2 100644 --- a/src/vdbe.h +++ b/src/vdbe.h @@ -15,7 +15,7 @@ ** or VDBE. The VDBE implements an abstract machine that runs a ** simple program to access and modify the underlying database. ** -** $Id: vdbe.h,v 1.75 2004/05/13 05:16:17 danielk1977 Exp $ +** $Id: vdbe.h,v 1.76 2004/05/18 10:06:26 danielk1977 Exp $ */ #ifndef _SQLITE_VDBE_H_ #define _SQLITE_VDBE_H_ @@ -94,7 +94,7 @@ void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1); void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2); void sqlite3VdbeChangeP3(Vdbe*, int addr, const char *zP1, int N); void sqlite3VdbeDequoteP3(Vdbe*, int addr); -int sqlite3VdbeFindOp(Vdbe*, int, int); +int sqlite3VdbeFindOp(Vdbe*, int, int, int); VdbeOp *sqlite3VdbeGetOp(Vdbe*, int); int sqlite3VdbeMakeLabel(Vdbe*); void sqlite3VdbeDelete(Vdbe*); @@ -108,6 +108,5 @@ void sqlite3VdbeTrace(Vdbe*,FILE*); void sqlite3VdbeCompressSpace(Vdbe*,int); int sqlite3VdbeReset(Vdbe*,char **); int sqliteVdbeSetVariables(Vdbe*,int,const char**); -int sqlite3VdbeKeyCompare(void*,int,const void*,int, const void*); #endif diff --git a/src/vdbeInt.h b/src/vdbeInt.h index 71765a5df7..bea4d07ed4 100644 --- a/src/vdbeInt.h +++ b/src/vdbeInt.h @@ -334,3 +334,5 @@ int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); int sqlite3VdbeIdxKeyCompare(Cursor*, int , const unsigned char*, int, int*); int sqlite3VdbeIdxRowid(BtCursor *, i64 *); int sqlite3MemCompare(Mem *, Mem *); +int sqlite3VdbeKeyCompare(void*,int,const void*,int, const void*); +int sqlite3VdbeRowCompare(void*,int,const void*,int, const void*); diff --git a/test/quick.test b/test/quick.test index 199aa696b7..a42c13e8a3 100644 --- a/test/quick.test +++ b/test/quick.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file runs all tests. # -# $Id: quick.test,v 1.11 2004/05/14 11:00:53 danielk1977 Exp $ +# $Id: quick.test,v 1.12 2004/05/18 10:06:26 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -45,7 +45,6 @@ lappend EXCLUDE version.test ;# uses the btree_meta API (not updated) # implementation. lappend EXCLUDE misc1.test lappend EXCLUDE capi2.test -lappend EXCLUDE sort.test lappend EXCLUDE where.test diff --git a/test/types.test b/test/types.test index 644e546665..ed6d2f6261 100644 --- a/test/types.test +++ b/test/types.test @@ -12,7 +12,7 @@ # it tests that the different storage classes (integer, real, text etc.) # all work correctly. # -# $Id: types.test,v 1.3 2004/05/16 22:55:28 danielk1977 Exp $ +# $Id: types.test,v 1.4 2004/05/18 10:06:26 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -199,7 +199,7 @@ do_test types-2.1.8 { do_test types-2.1.9 { set root [db eval {select rootpage from sqlite_master where name = 't1'}] record_sizes $root -} {3 3 3 4 4 6 6 10 10} +} {2 2 2 3 3 5 5 9 9} # Insert some reals. These should be 10 byte records. do_test types-2.2.1 { @@ -220,7 +220,7 @@ do_test types-2.2.2 { do_test types-2.2.3 { set root [db eval {select rootpage from sqlite_master where name = 't2'}] record_sizes $root -} {10 10 10} +} {9 9 9} # Insert a NULL. This should be a two byte record. do_test types-2.3.1 { @@ -239,7 +239,7 @@ do_test types-2.3.2 { do_test types-2.3.3 { set root [db eval {select rootpage from sqlite_master where name = 't3'}] record_sizes $root -} {2} +} {1} # Insert a couple of strings. do_test types-2.4.1 { @@ -264,7 +264,7 @@ do_test types-2.4.2 { do_test types-2.4.3 { set root [db eval {select rootpage from sqlite_master where name = 't4'}] record_sizes $root -} {13 504 500005} +} {11 502 500003} do_test types-2.5.1 { execsql {