diff --git a/manifest b/manifest index 18e3a64474..c142caead0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Implement\stype\saffinity\sfor\stable\sand\sindex\srecords\s(CVS\s1375) -D 2004-05-14T11:00:53 +C Delete\ssome\scode\sno\slonger\sin\suse\s(CVS\s1376) +D 2004-05-14T11:16:56 F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -63,11 +63,11 @@ F src/update.c 0441f8b64d616ef244583449e66c984e536c6c9b F src/utf.c fc799748d43fe1982d157b871e3e420a19c85d4f F src/util.c 58407b133dfe0b21af23e0aa89c058a2b3d8cb0f F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476 -F src/vdbe.c a6e1bfe1188f16783260a1fdc391ecc2c6a1dab6 +F src/vdbe.c 6966c271632b5cd38834a317f5d76a5fd19e5547 F src/vdbe.h 94457ca73bae972dc61bca33a4dccc2e6e14e2f8 F src/vdbeInt.h 03f4c3642482570a697a42a9bbb12908c6535bbe F src/vdbeaux.c d8dc16e7bfb6201a2e2e4c020ba813e295de717f -F src/where.c 292f3d3d056d69197573eceb5578d7ba905725df +F src/where.c 6957bbd333cc7ffa7b3878adbe67a095319daa54 F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242 F test/attach.test cb9b884344e6cfa5e165965d5b1adea679a24c83 F test/attach2.test 7c388dee63a4c1997695c3d41957f32ce784ac56 @@ -191,7 +191,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P f63fb6dd4e8e33d4c1983396b1a0305836ee4df7 -R 063a4d7caa30f9e2870f52d893366e1a +P dbfe6e93166d9557d66cab9dca7977baa3501e5e +R a8eff2b77c761d80a277edb0d70bc2f1 U danielk1977 -Z 458386d9c0f0338b7a617dad680da64b +Z ab53cfc07c82dc43990d58a3c73afce3 diff --git a/manifest.uuid b/manifest.uuid index be01826201..1ea9717d47 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dbfe6e93166d9557d66cab9dca7977baa3501e5e \ No newline at end of file +f24aedc2b0c401d8b714ba39b604d7caa7f6a430 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index 7f00e341bf..899d576f3b 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.288 2004/05/14 11:00:53 danielk1977 Exp $ +** $Id: vdbe.c,v 1.289 2004/05/14 11:16:56 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -2200,177 +2200,6 @@ case OP_MakeRecord: { break; } -/* Opcode: MakeKey P1 P2 P3 -** -** Convert the top P1 entries of the stack into a single entry suitable -** for use as the key in an index. The top P1 records are -** converted to strings and merged. The null-terminators -** are retained and used as separators. -** The lowest entry in the stack is the first field and the top of the -** stack becomes the last. -** -** If P2 is not zero, then the original entries remain on the stack -** and the new key is pushed on top. If P2 is zero, the original -** data is popped off the stack first then the new key is pushed -** back in its place. -** -** P3 is a string that is P1 characters long. Each character is either -** an 'n' or a 't' to indicates if the argument should be intepreted as -** numeric or text type. The first character of P3 corresponds to the -** lowest element on the stack. If P3 is NULL then all arguments are -** assumed to be of the numeric type. -** -** The type makes a difference in that text-type fields may not be -** introduced by 'b' (as described in the next paragraph). The -** first character of a text-type field must be either 'a' (if it is NULL) -** or 'c'. Numeric fields will be introduced by 'b' if their content -** looks like a well-formed number. Otherwise the 'a' or 'c' will be -** used. -** -** The key is a concatenation of fields. Each field is terminated by -** a single 0x00 character. A NULL field is introduced by an 'a' and -** is followed immediately by its 0x00 terminator. A numeric field is -** introduced by a single character 'b' and is followed by a sequence -** of characters that represent the number such that a comparison of -** the character string using memcpy() sorts the numbers in numerical -** order. The character strings for numbers are generated using the -** sqlite3RealToSortable() function. A text field is introduced by a -** 'c' character and is followed by the exact text of the field. The -** use of an 'a', 'b', or 'c' character at the beginning of each field -** guarantees that NULLs sort before numbers and that numbers sort -** before text. 0x00 characters do not occur except as separators -** between fields. -** -** See also: MakeIdxKey, SortMakeKey -*/ -/* Opcode: MakeIdxKey P1 P2 P3 -** -** Convert the top P1 entries of the stack into a single entry suitable -** for use as the key in an index. In addition, take one additional integer -** off of the stack, treat that integer as an eight-byte record number, and -** append the integer to the key. Thus a total of P1+1 entries are -** popped from the stack for this instruction and a single entry is pushed -** back. The first P1 entries that are popped are strings and the last -** entry (the lowest on the stack) is an integer record number. -** -** The converstion of the first P1 string entries occurs just like in -** MakeKey. Each entry is separated from the others by a null. -** The entire concatenation is null-terminated. The lowest entry -** in the stack is the first field and the top of the stack becomes the -** last. -** -** If P2 is not zero and one or more of the P1 entries that go into the -** generated key is NULL, then jump to P2 after the new key has been -** pushed on the stack. In other words, jump to P2 if the key is -** guaranteed to be unique. This jump can be used to skip a subsequent -** uniqueness test. -** -** P3 is a string that is P1 characters long. Each character is either -** an 'n' or a 't' to indicates if the argument should be numeric or -** text. The first character corresponds to the lowest element on the -** stack. If P3 is null then all arguments are assumed to be numeric. -** -** See also: MakeKey, SortMakeKey -*/ -case OP_MakeIdxKey2: -case OP_MakeKey2: { - char *zNewKey; - int nByte; - int nField; - int addRowid; - int i, j; - int containsNull = 0; - Mem *pRec; - char zTemp[NBFS]; - - addRowid = pOp->opcode==OP_MakeIdxKey; - nField = pOp->p1; - pRec = &pTos[1-nField]; - assert( pRec>=p->aStack ); - nByte = 0; - for(j=0, i=0; iflags; - int len; - char *z; - if( flags & MEM_Null ){ - nByte += 2; - containsNull = 1; - }else if( pOp->p3 && pOp->p3[j]=='t' ){ - Stringify(pRec); - pRec->flags &= ~(MEM_Int|MEM_Real); - nByte += pRec->n+1; - }else if( (flags & (MEM_Real|MEM_Int))!=0 || sqlite3IsNumber(pRec->z, 0) ){ - if( (flags & (MEM_Real|MEM_Int))==MEM_Int ){ - pRec->r = pRec->i; - }else if( (flags & (MEM_Real|MEM_Int))==0 ){ - pRec->r = sqlite3AtoF(pRec->z, 0); - } - Release(pRec); - z = pRec->zShort; - sqlite3RealToSortable(pRec->r, z); - len = strlen(z); - pRec->z = 0; - pRec->flags = MEM_Real; - pRec->n = len+1; - nByte += pRec->n+1; - }else{ - nByte += pRec->n+1; - } - } - if( nByte+sizeof(u32)>MAX_BYTES_PER_ROW ){ - rc = SQLITE_TOOBIG; - goto abort_due_to_error; - } - if( addRowid ) nByte += sizeof(i64); - if( nByte<=NBFS ){ - zNewKey = zTemp; - }else{ - zNewKey = sqliteMallocRaw( nByte ); - if( zNewKey==0 ) goto no_mem; - } - j = 0; - pRec = &pTos[1-nField]; - for(i=0; iflags & MEM_Null ){ - zNewKey[j++] = 'a'; - zNewKey[j++] = 0; - }else if( pRec->flags==MEM_Real ){ - zNewKey[j++] = 'b'; - memcpy(&zNewKey[j], pRec->zShort, pRec->n); - j += pRec->n; - }else{ - assert( pRec->flags & MEM_Str ); - zNewKey[j++] = 'c'; - memcpy(&zNewKey[j], pRec->z, pRec->n); - j += pRec->n; - } - } - if( addRowid ){ - i64 iKey; - pRec = &pTos[-nField]; - assert( pRec>=p->aStack ); - Integerify(pRec); - iKey = intToKey(pRec->i); - memcpy(&zNewKey[j], &iKey, sizeof(i64)); - popStack(&pTos, nField+1); - if( pOp->p2 && containsNull ) pc = pOp->p2 - 1; - }else{ - if( pOp->p2==0 ) popStack(&pTos, nField); - } - pTos++; - pTos->n = nByte; - if( nByte<=NBFS ){ - assert( zNewKey==zTemp ); - pTos->z = pTos->zShort; - memcpy(pTos->zShort, zTemp, nByte); - pTos->flags = MEM_Str | MEM_Short; - }else{ - pTos->z = zNewKey; - pTos->flags = MEM_Str | MEM_Dyn; - } - break; -} - /* Opcode: MakeKey P1 P2 P3 ** ** Convert the top P1 entries of the stack into a single entry suitable @@ -2510,32 +2339,6 @@ case OP_MakeIdxKey: { break; } -/* Opcode: IncrKey * * * -** -** The top of the stack should contain an index key generated by -** The MakeKey opcode. This routine increases the least significant -** byte of that key by one. This is used so that the MoveTo opcode -** will move to the first entry greater than the key rather than to -** the key itself. -** -*/ -case OP_IncrKey: { - assert( pTos>=p->aStack ); - /* The IncrKey opcode is only applied to keys generated by - ** MakeKey or MakeIdxKey and the results of those operands - ** are always dynamic strings or zShort[] strings. So we - ** are always free to modify the string in place. - */ - assert( pTos->flags & (MEM_Dyn|MEM_Short) ); - /* - ** FIX ME: This technique is now broken due to manifest types in index - ** keys. - */ - assert(0); - pTos->z[pTos->n-1]++; - break; -} - /* Opcode: Checkpoint P1 * * ** ** Begin a checkpoint. A checkpoint is the beginning of a operation that diff --git a/src/where.c b/src/where.c index 9d28c876ea..a148e1e1ad 100644 --- a/src/where.c +++ b/src/where.c @@ -12,7 +12,7 @@ ** This module contains C code that generates VDBE code used to process ** the WHERE clause of SQL statements. ** -** $Id: where.c,v 1.92 2004/05/14 11:00:53 danielk1977 Exp $ +** $Id: where.c,v 1.93 2004/05/14 11:16:56 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -803,16 +803,10 @@ WhereInfo *sqlite3WhereBegin( if( nColumn==pIdx->nColumn || pLevel->bRev ){ testOp = OP_IdxGT; }else{ -/* - sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - sqlite3VdbeAddOp(v, OP_IncrKey, 0, 0); - sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 1); -*/ testOp = OP_IdxGE; } if( pLevel->bRev ){ /* Scan in reverse order */ - /* sqlite3VdbeAddOp(v, OP_IncrKey, 0, 0); */ sqlite3VdbeAddOp(v, OP_MoveLt, pLevel->iCur, brk); sqlite3VdbeChangeP3(v, -1, "+", P3_STATIC); start = sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); @@ -1010,11 +1004,6 @@ WhereInfo *sqlite3WhereBegin( sqlite3VdbeAddOp(v, OP_Goto, 0, brk); sqlite3VdbeAddOp(v, OP_MakeKey, nCol, 0); sqlite3AddIdxKeyType(v, pIdx); -/* - if( leFlag ){ - sqlite3VdbeAddOp(v, OP_IncrKey, 0, 0); - } -*/ if( pLevel->bRev ){ sqlite3VdbeAddOp(v, OP_MoveLt, pLevel->iCur, brk); if( !geFlag ){ @@ -1071,11 +1060,6 @@ WhereInfo *sqlite3WhereBegin( sqlite3VdbeAddOp(v, OP_Goto, 0, brk); sqlite3VdbeAddOp(v, OP_MakeKey, nCol, 0); sqlite3AddIdxKeyType(v, pIdx); -/* - if( !geFlag ){ - sqlite3VdbeAddOp(v, OP_IncrKey, 0, 0); - } -*/ if( pLevel->bRev ){ pLevel->iMem = pParse->nMem++; sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 1);