diff --git a/manifest b/manifest index e0c7eec100..14c75d3651 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Ensure\svacuum\shandles\stable\snames\swith\sspaces\sin\sthem.\s(CVS\s1491) -D 2004-05-29T10:43:07 +C Transform\sOP_HexBlob\sand\sOP_String8\sto\sOP_Blob\sand\sOP_String\sthe\sfirst\stime\sthey\sare\sexecuted.\s(CVS\s1492) +D 2004-05-29T11:24:50 F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -26,15 +26,15 @@ F src/attach.c c315c58cb16fd6e913b3bfa6412aedecb4567fa5 F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79 F src/btree.c 7832e4247f0d14dfe25dcf85647ddde71b614170 F src/btree.h b65140b5ae891f30d2a39e64b9f0343225553545 -F src/build.c f97826762d40dbde5f25ebaa009976078ba8b7ff +F src/build.c fd36c4a603e23df35aa7f57772d965e1865e39e0 F src/date.c 0eb922af5c5f5e2455f8dc2f98023ed3e04a857e F src/delete.c 72f8febf6170cda830f509c8f9dffbed3df3596c F src/encode.c a876af473d1d636faa3dca51c7571f2e007eea37 -F src/expr.c 1f7b853b097806ff6b0a3edd884c9b6675698745 +F src/expr.c 416e8970fd0f0b66ac8b4d9f58f6f73239e47568 F src/func.c 1fe0763675eb38b6e3992d3edfbec2271798b658 F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb -F src/insert.c dd117e8b3f50e943e6cf5fbcf4bbdc0b907b0b4c +F src/insert.c 0c7966dba4cd5698e393e824f162d520e96b1978 F src/legacy.c ad23746f15f67e34577621b1875f639c94839e1f F src/main.c 79f8142ee2dbf0e3b1f60251515fcf4a1339e784 F src/md5.c d2c738fedfb27f73cefcf2b0ac1f9f21894b073e @@ -49,10 +49,10 @@ F src/os_win.h 5d41af24caaef6c13a2d8e2399caa1c57d45c84d F src/pager.c 6ff6b906427d4824099140776cb8768f922f3dc5 F src/pager.h 78a00ac280899bcba1a89dc51585dcae6b7b3253 F src/parse.y facaa7d07885fb9d53ec8fd676705715d3942b0f -F src/pragma.c 0c17b613d719c62a0dbad659b7d8a6e7ce7e9733 +F src/pragma.c 84e778a73eb6a14c1a328d75f70355cb51c22803 F src/printf.c ef750e8e2398ca7e8b58be991075f08c6a7f0e53 F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3 -F src/select.c ee54bf2faa76f5e30832fd589a1f10c485047469 +F src/select.c 0297717eb7331604687c2e29c147d3a311359df1 F src/shell.c ed4d237b3e52a0a42512bfcc53530e46de20c28f F src/sqlite.h.in edc6408c7f53c2104f781a76b926036e17018ec9 F src/sqliteInt.h 01f9250ee3a1ab681b7ed91ad2b3748c2f230521 @@ -64,18 +64,18 @@ F src/test3.c 5e4a6d596f982f6f47a5f9f75ede9b4a3b739968 F src/test4.c 34848a9fd31aa65857b20a8bfc03aff77d8c3426 F src/test5.c 9a1f15133f6955f067c5246e564723b5f23ff221 F src/tokenize.c 50a87c7414de54a008427c9fed22e4e86efb6844 -F src/trigger.c 6a0751fd7d3d723f414ac1f877f16b1c0ba4722b -F src/update.c 96461bcf4e946697e83c09c77c7e61b545a2f66e +F src/trigger.c 258ed8f9583c6b80e5af401cb9cce345c0c689c3 +F src/update.c 259f06e7b22c684b2d3dda54a18185892d6e9573 F src/utf.c f8604999a54483533ac20a63879074f01b0df384 F src/util.c 4df9d9b0d930d81ec581bcb68748e7c48bdc8c7d F src/vacuum.c 82ce1fc8ecc2e1aa284c13fe38446709f9936c63 -F src/vdbe.c ea010d63dfdf84b7d23781144fe2cd11add2c1bd +F src/vdbe.c c9658279c8d46760afab9714fd988ef052d02b88 F src/vdbe.h e73f890e0f2a6c42b183d7d6937947930fe4fdeb F src/vdbeInt.h c2bcd6e5a6e6a3753e4c5a368629c3a625719bfc F src/vdbeapi.c 0c5d64c81871cb4fe5407e639604ee95738b6942 -F src/vdbeaux.c bbcf1bb953526130495b01b23751cf756cfed2fb +F src/vdbeaux.c 79dbad52ba653c0f26adcab1a054432669775b0d F src/vdbemem.c c97c145ff6d9fc5b4236704c04a65849117e6214 -F src/where.c efe5d25fe18cd7381722457898cd863e84097a0c +F src/where.c 444a7c3a8b1eb7bba072e489af628555d21d92a4 F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242 F test/attach.test 0dd7cf9bf9bc915bce2da4fb616c4ea9c3da64af F test/attach2.test 5472d442bb2ef1ee587e0ae7472bb68b52509a38 @@ -204,7 +204,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P 4feb4b9a71ce7a92924d2358a7ccecb4cca19223 -R 1c8a97ac5a9accf91dcf49ffc08fac99 +P 0a6689be843e695902fbfef863f128915545499e +R 1d952e495024dd4407d89b7b9acbc34c U danielk1977 -Z a1f2191b7711706a5263dea1c2c73086 +Z 654311e7b543692762f3cae151122ce2 diff --git a/manifest.uuid b/manifest.uuid index 4fbca860fd..05c6a5bd28 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0a6689be843e695902fbfef863f128915545499e \ No newline at end of file +3225de8902b0e7e60c4d9f3a5ef51bc74f57d364 \ No newline at end of file diff --git a/src/build.c b/src/build.c index ace0a6bc7f..5699c5d3d4 100644 --- a/src/build.c +++ b/src/build.c @@ -23,7 +23,7 @@ ** ROLLBACK ** PRAGMA ** -** $Id: build.c,v 1.199 2004/05/29 10:23:19 danielk1977 Exp $ +** $Id: build.c,v 1.200 2004/05/29 11:24:50 danielk1977 Exp $ */ #include "sqliteInt.h" #include @@ -618,7 +618,7 @@ void sqlite3StartTable( sqlite3OpenMasterTable(v, iDb); sqlite3VdbeAddOp(v, OP_NewRecno, 0, 0); sqlite3VdbeAddOp(v, OP_Dup, 0, 0); - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_PutIntKey, 0, 0); } } @@ -1080,25 +1080,25 @@ void sqlite3EndTable(Parse *pParse, Token *pEnd, Select *pSelect){ } p->tnum = 0; sqlite3VdbeAddOp(v, OP_Pull, 1, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, p->pSelect==0?"table":"view", P3_STATIC); - sqlite3VdbeOp3(v, OP_String, 0, 0, p->zName, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, p->zName, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, p->pSelect==0?"table":"view", P3_STATIC); + sqlite3VdbeOp3(v, OP_String8, 0, 0, p->zName, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, p->zName, 0); sqlite3VdbeAddOp(v, OP_Dup, 4, 0); if( pSelect ){ char *z = createTableStmt(p); n = z ? strlen(z) : 0; - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeChangeP3(v, -1, z, n); sqliteFree(z); }else{ if( p->pSelect ){ - sqlite3VdbeOp3(v, OP_String, 0, 0, "CREATE VIEW ", P3_STATIC); + sqlite3VdbeOp3(v, OP_String8, 0, 0, "CREATE VIEW ", P3_STATIC); }else{ - sqlite3VdbeOp3(v, OP_String, 0, 0, "CREATE TABLE ", P3_STATIC); + sqlite3VdbeOp3(v, OP_String8, 0, 0, "CREATE TABLE ", P3_STATIC); } assert( pEnd!=0 ); n = Addr(pEnd->z) - Addr(pParse->sNameToken.z) + 1; - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeChangeP3(v, -1, pParse->sNameToken.z, n); sqlite3VdbeAddOp(v, OP_Concat, 2, 0); } @@ -1392,7 +1392,7 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){ if( v ){ static VdbeOpList dropTable[] = { { OP_Rewind, 0, ADDR(10), 0}, - { OP_String, 0, 0, 0}, /* 1 */ + { OP_String8, 0, 0, 0}, /* 1 */ { OP_MemStore, 1, 1, 0}, { OP_MemLoad, 1, 0, 0}, /* 3 */ { OP_Column, 0, 2, 0}, @@ -1839,9 +1839,9 @@ void sqlite3CreateIndex( sqlite3OpenMasterTable(v, iDb); } sqlite3VdbeAddOp(v, OP_NewRecno, 0, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, "index", P3_STATIC); - sqlite3VdbeOp3(v, OP_String, 0, 0, pIndex->zName, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, pTab->zName, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, "index", P3_STATIC); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pIndex->zName, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0); sqlite3VdbeOp3(v, OP_CreateIndex, 0, iDb,(char*)&pIndex->tnum,P3_POINTER); pIndex->tnum = 0; if( pTblName ){ @@ -1852,10 +1852,10 @@ void sqlite3CreateIndex( sqlite3VdbeOp3(v, OP_OpenWrite, 1, 0, (char*)&pIndex->keyInfo, P3_KEYINFO); } - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); if( pStart && pEnd ){ sqlite3VdbeChangeP3(v, -1, "CREATE INDEX ", P3_STATIC); - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); n = Addr(pEnd->z) - Addr(pName->z) + 1; sqlite3VdbeChangeP3(v, -1, pName->z, n); sqlite3VdbeAddOp(v, OP_Concat, 2, 0); @@ -1944,7 +1944,7 @@ void sqlite3DropIndex(Parse *pParse, SrcList *pName){ if( v ){ static VdbeOpList dropIndex[] = { { OP_Rewind, 0, ADDR(9), 0}, - { OP_String, 0, 0, 0}, /* 1 */ + { OP_String8, 0, 0, 0}, /* 1 */ { OP_MemStore, 1, 1, 0}, { OP_MemLoad, 1, 0, 0}, /* 3 */ { OP_Column, 0, 1, 0}, diff --git a/src/expr.c b/src/expr.c index 02f254bd85..1e87ed8189 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.131 2004/05/28 08:21:06 drh Exp $ +** $Id: expr.c,v 1.132 2004/05/29 11:24:50 danielk1977 Exp $ */ #include "sqliteInt.h" #include @@ -867,7 +867,7 @@ int sqlite3ExprResolveIds( /* Evaluate the expression and insert it into the temp table */ sqlite3ExprCode(pParse, pE2); sqlite3VdbeOp3(v, OP_MakeKey, 1, 0, affStr, P3_STATIC); - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_PutStrKey, pExpr->iTable, 0); } } @@ -1107,7 +1107,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ case TK_RSHIFT: op = OP_ShiftRight; break; case TK_REM: op = OP_Remainder; break; case TK_FLOAT: op = OP_Real; break; - case TK_STRING: op = OP_String; break; + case TK_STRING: op = OP_String8; break; case TK_BLOB: op = OP_HexBlob; break; default: break; } @@ -1138,7 +1138,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ break; } case TK_NULL: { - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); break; } case TK_VARIABLE: { @@ -1259,7 +1259,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ addr = sqlite3VdbeCurrentAddr(v); sqlite3VdbeAddOp(v, OP_NotNull, -1, addr+4); /* addr + 0 */ sqlite3VdbeAddOp(v, OP_Pop, 2, 0); - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_Goto, 0, addr+7); sqlite3VdbeOp3(v, OP_MakeKey, 1, 0, affStr, P3_STATIC); /* addr + 4 */ sqlite3VdbeAddOp(v, OP_Found, pExpr->iTable, addr+7); @@ -1318,7 +1318,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ if( pExpr->pRight ){ sqlite3ExprCode(pParse, pExpr->pRight); }else{ - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); } sqlite3VdbeResolveLabel(v, expr_end_label); break; diff --git a/src/insert.c b/src/insert.c index 4741d968d1..d798102f4e 100644 --- a/src/insert.c +++ b/src/insert.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** -** $Id: insert.c,v 1.107 2004/05/26 10:11:06 danielk1977 Exp $ +** $Id: insert.c,v 1.108 2004/05/29 11:24:50 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -466,7 +466,7 @@ void sqlite3Insert( } } if( pColumn && j>=pColumn->nId ){ - sqlite3VdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); }else if( useTempTable ){ sqlite3VdbeAddOp(v, OP_Column, srcTab, j); }else if( pSelect ){ @@ -537,7 +537,7 @@ void sqlite3Insert( ** Whenever this column is read, the record number will be substituted ** in its place. So will fill this column with a NULL to avoid ** taking up data space with information that will never be used. */ - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); continue; } if( pColumn==0 ){ @@ -548,7 +548,7 @@ void sqlite3Insert( } } if( pColumn && j>=pColumn->nId ){ - sqlite3VdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); }else if( useTempTable ){ sqlite3VdbeAddOp(v, OP_Column, srcTab, j); }else if( pSelect ){ @@ -774,7 +774,7 @@ void sqlite3GenerateConstraintChecks( break; } case OE_Replace: { - sqlite3VdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); sqlite3VdbeAddOp(v, OP_Push, nCol-i, 0); break; } diff --git a/src/pragma.c b/src/pragma.c index 19552f2455..1c50d37aa0 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains code used to implement the PRAGMA command. ** -** $Id: pragma.c,v 1.33 2004/05/28 16:00:22 drh Exp $ +** $Id: pragma.c,v 1.34 2004/05/29 11:24:50 danielk1977 Exp $ */ #include "sqliteInt.h" #include @@ -380,11 +380,11 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ sqlite3ViewGetColumnNames(pParse, pTab); for(i=0; inCol; i++){ sqlite3VdbeAddOp(v, OP_Integer, i, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zName, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[i].zName, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[i].zType ? pTab->aCol[i].zType : "numeric", 0); sqlite3VdbeAddOp(v, OP_Integer, pTab->aCol[i].notNull, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[i].zDflt, P3_STATIC); sqlite3VdbeAddOp(v, OP_Integer, pTab->aCol[i].isPrimKey, 0); sqlite3VdbeAddOp(v, OP_Callback, 6, 0); @@ -408,7 +408,7 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ sqlite3VdbeAddOp(v, OP_Integer, i, 0); sqlite3VdbeAddOp(v, OP_Integer, cnum, 0); assert( pTab->nCol>cnum ); - sqlite3VdbeOp3(v, OP_String, 0, 0, pTab->aCol[cnum].zName, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[cnum].zName, 0); sqlite3VdbeAddOp(v, OP_Callback, 3, 0); } } @@ -430,7 +430,7 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ sqlite3VdbeSetColName(v, 2, "unique", P3_STATIC); while(pIdx){ sqlite3VdbeAddOp(v, OP_Integer, i, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, pIdx->zName, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pIdx->zName, 0); sqlite3VdbeAddOp(v, OP_Integer, pIdx->onError!=OE_None, 0); sqlite3VdbeAddOp(v, OP_Callback, 3, 0); ++i; @@ -460,10 +460,10 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ for(j=0; jnCol; j++){ sqlite3VdbeAddOp(v, OP_Integer, i, 0); sqlite3VdbeAddOp(v, OP_Integer, j, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, pFK->zTo, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, + sqlite3VdbeOp3(v, OP_String8, 0, 0, pFK->zTo, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[pFK->aCol[j].iFrom].zName, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, pFK->aCol[j].zCol, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pFK->aCol[j].zCol, 0); sqlite3VdbeAddOp(v, OP_Callback, 5, 0); } ++i; @@ -482,8 +482,8 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ if( db->aDb[i].pBt==0 ) continue; assert( db->aDb[i].zName!=0 ); sqlite3VdbeAddOp(v, OP_Integer, i, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, db->aDb[i].zName, 0); - sqlite3VdbeOp3(v, OP_String, 0, 0, + sqlite3VdbeOp3(v, OP_String8, 0, 0, db->aDb[i].zName, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, sqlite3BtreeGetFilename(db->aDb[i].pBt), 0); sqlite3VdbeAddOp(v, OP_Callback, 3, 0); } @@ -572,7 +572,7 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ { OP_MemLoad, 0, 0, 0}, { OP_Integer, 0, 0, 0}, { OP_Ne, 0, 0, 0}, /* 2 */ - { OP_String, 0, 0, "ok"}, + { OP_String8, 0, 0, "ok"}, { OP_Callback, 1, 0, 0}, }; @@ -600,9 +600,9 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ } sqlite3VdbeAddOp(v, OP_IntegrityCk, cnt, i); sqlite3VdbeAddOp(v, OP_Dup, 0, 1); - addr = sqlite3VdbeOp3(v, OP_String, 0, 0, "ok", P3_STATIC); + addr = sqlite3VdbeOp3(v, OP_String8, 0, 0, "ok", P3_STATIC); sqlite3VdbeAddOp(v, OP_Eq, 0, addr+6); - sqlite3VdbeOp3(v, OP_String, 0, 0, + sqlite3VdbeOp3(v, OP_String8, 0, 0, sqlite3MPrintf("*** in database %s ***\n", db->aDb[i].zName), P3_DYNAMIC); sqlite3VdbeAddOp(v, OP_Pull, 1, 0); @@ -635,10 +635,10 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ int k, jmp2; static VdbeOpList idxErr[] = { { OP_MemIncr, 0, 0, 0}, - { OP_String, 0, 0, "rowid "}, + { OP_String8, 0, 0, "rowid "}, { OP_Recno, 1, 0, 0}, - { OP_String, 0, 0, " missing from index "}, - { OP_String, 0, 0, 0}, /* 4 */ + { OP_String8, 0, 0, " missing from index "}, + { OP_String8, 0, 0, 0}, /* 4 */ { OP_Concat, 4, 0, 0}, { OP_Callback, 1, 0, 0}, }; @@ -661,8 +661,8 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ { OP_MemLoad, 2, 0, 0}, { OP_Eq, 0, 0, 0}, /* 7 */ { OP_MemIncr, 0, 0, 0}, - { OP_String, 0, 0, "wrong # of entries in index "}, - { OP_String, 0, 0, 0}, /* 10 */ + { OP_String8, 0, 0, "wrong # of entries in index "}, + { OP_String8, 0, 0, 0}, /* 10 */ { OP_Concat, 2, 0, 0}, { OP_Callback, 1, 0, 0}, }; diff --git a/src/select.c b/src/select.c index d0cbf3c009..9bb23b32bc 100644 --- a/src/select.c +++ b/src/select.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** -** $Id: select.c,v 1.181 2004/05/28 13:13:02 danielk1977 Exp $ +** $Id: select.c,v 1.182 2004/05/29 11:24:50 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -395,7 +395,7 @@ static int selectInnerLoop( sqlite3VdbeAddOp(v, OP_Distinct, distinct, sqlite3VdbeCurrentAddr(v)+3); sqlite3VdbeAddOp(v, OP_Pop, pEList->nExpr+1, 0); sqlite3VdbeAddOp(v, OP_Goto, 0, iContinue); - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_PutStrKey, distinct, 0); } @@ -406,7 +406,7 @@ static int selectInnerLoop( case SRT_Union: { sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT); sqlite3VdbeChangeP3(v, -1, aff, P3_STATIC); - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_PutStrKey, iParm, 0); break; } @@ -459,7 +459,7 @@ static int selectInnerLoop( aff = sqlite3CompareAffinity(pEList->a[0].pExpr, aff); affStr = sqlite3AffinityString(aff); sqlite3VdbeOp3(v, OP_MakeKey, 1, 0, affStr, P3_STATIC); - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_PutStrKey, (iParm&0x0000FFFF), 0); } sqlite3VdbeChangeP2(v, addr2, sqlite3VdbeCurrentAddr(v)); @@ -579,7 +579,7 @@ static void generateSortTail( sqlite3VdbeAddOp(v, OP_Pop, 1, 0); sqlite3VdbeAddOp(v, OP_Goto, 0, sqlite3VdbeCurrentAddr(v)+3); sqlite3VdbeOp3(v, OP_MakeKey, 1, 0, "n", P3_STATIC); - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_PutStrKey, (iParm&0x0000FFFF), 0); break; } @@ -2343,7 +2343,7 @@ int sqlite3Select( } } if( pGroupBy==0 ){ - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_AggFocus, 0, 0); } } @@ -2351,7 +2351,7 @@ int sqlite3Select( /* Initialize the memory cell to NULL */ if( eDest==SRT_Mem ){ - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_MemStore, iParm, 1); } diff --git a/src/trigger.c b/src/trigger.c index fa701e2d66..bb44998473 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -209,12 +209,12 @@ void sqlite3FinishTrigger( if( !db->init.busy ){ static VdbeOpList insertTrig[] = { { OP_NewRecno, 0, 0, 0 }, - { OP_String, 0, 0, "trigger" }, - { OP_String, 0, 0, 0 }, /* 2: trigger name */ - { OP_String, 0, 0, 0 }, /* 3: table name */ + { OP_String8, 0, 0, "trigger" }, + { OP_String8, 0, 0, 0 }, /* 2: trigger name */ + { OP_String8, 0, 0, 0 }, /* 3: table name */ { OP_Integer, 0, 0, 0 }, - { OP_String, 0, 0, "CREATE TRIGGER "}, - { OP_String, 0, 0, 0 }, /* 6: SQL */ + { OP_String8, 0, 0, "CREATE TRIGGER "}, + { OP_String8, 0, 0, 0 }, /* 6: SQL */ { OP_Concat, 2, 0, 0 }, { OP_MakeRecord, 5, 0, "tttit" }, { OP_PutIntKey, 0, 0, 0 }, @@ -474,10 +474,10 @@ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){ int base; static VdbeOpList dropTrigger[] = { { OP_Rewind, 0, ADDR(9), 0}, - { OP_String, 0, 0, 0}, /* 1 */ + { OP_String8, 0, 0, 0}, /* 1 */ { OP_Column, 0, 1, 0}, { OP_Ne, 0, ADDR(8), 0}, - { OP_String, 0, 0, "trigger"}, + { OP_String8, 0, 0, "trigger"}, { OP_Column, 0, 0, 0}, { OP_Ne, 0, ADDR(8), 0}, { OP_Delete, 0, 0, 0}, diff --git a/src/update.c b/src/update.c index 88c683f564..c38f09b869 100644 --- a/src/update.c +++ b/src/update.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** -** $Id: update.c,v 1.80 2004/05/26 10:11:06 danielk1977 Exp $ +** $Id: update.c,v 1.81 2004/05/29 11:24:50 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -279,7 +279,7 @@ void sqlite3Update( } for(i=0; inCol; i++){ if( i==pTab->iPKey ){ - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); continue; } j = aXRef[i]; @@ -363,7 +363,7 @@ void sqlite3Update( */ for(i=0; inCol; i++){ if( i==pTab->iPKey ){ - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); continue; } j = aXRef[i]; diff --git a/src/vdbe.c b/src/vdbe.c index 6199d02dcc..19ea33fc7e 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.346 2004/05/29 02:37:19 danielk1977 Exp $ +** $Id: vdbe.c,v 1.347 2004/05/29 11:24:50 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -694,15 +694,25 @@ case OP_Real: { break; } -#if 0 /* Opcode: String8 * * P3 ** -** This opcode does not exist at vdbe execution time. +** P3 points to a nul terminated UTF-8 string. This opcode is transformed +** into an OP_String before it is executed for the first time. */ case OP_String8: { - break; + pOp->opcode = OP_String; + + if( db->enc!=TEXT_Utf8 && pOp->p3 ){ + if( db->enc==TEXT_Utf16le ){ + pOp->p3 = sqlite3utf8to16le(pOp->p3, -1); + }else{ + pOp->p3 = sqlite3utf8to16be(pOp->p3, -1); + } + if( !pOp->p3 ) goto no_mem; + } + + /* Fall through to the next case, OP_String */ } -#endif /* Opcode: String * * P3 ** @@ -715,32 +725,44 @@ case OP_String: { if( pOp->p3 ){ pTos->flags = MEM_Str|MEM_Static|MEM_Term; pTos->z = pOp->p3; - pTos->n = strlen(pTos->z); - pTos->enc = TEXT_Utf8; - sqlite3VdbeChangeEncoding(pTos, db->enc); -/* if( db->enc==TEXT_Utf8 ){ pTos->n = strlen(pTos->z); }else{ pTos->n = sqlite3utf16ByteLen(pTos->z, -1); } pTos->enc = db->enc; -*/ }else{ pTos->flags = MEM_Null; } break; } -#if 0 /* Opcode: HexBlob * * P3 ** -** This opcode does not exist at vdbe execution time. +** P3 is an SQL hex encoding of a blob. The blob is pushed +** onto the vdbe stack. +** +** The first time this instruction executes, in transforms +** itself into a 'Blob' opcode with a binary blob as P3. */ case OP_HexBlob: { - break; + pOp->opcode = OP_Blob; + pOp->p1 = strlen(pOp->p3)/2; + if( pOp->p1 ){ + char *zBlob = sqlite3HexToBlob(pOp->p3); + if( !zBlob ) goto no_mem; + if( pOp->p3type==P3_DYNAMIC ){ + sqliteFree(pOp->p3); + } + pOp->p3 = zBlob; + pOp->p3type = P3_DYNAMIC; + }else{ + pOp->p3type = P3_STATIC; + pOp->p3 = ""; + } + + /* Fall through to the next case, OP_Blob. */ } -#endif /* Opcode: Blob P1 * P3 ** diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 4bb52261de..0652d70b6a 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -606,53 +606,6 @@ int sqlite3VdbeList( return rc; } -/* -** If pOp is an OP_HexBlob opcode, then transform it to an OP_Blob -** opcode. -*/ -static int translateOp(Op *pOp, u8 enc){ - - if( pOp->opcode==OP_HexBlob ){ - pOp->p1 = strlen(pOp->p3)/2; - if( pOp->p1 ){ - char *zBlob = sqlite3HexToBlob(pOp->p3); - if( !zBlob ) return SQLITE_NOMEM; - if( pOp->p3type==P3_DYNAMIC ){ - sqliteFree(pOp->p3); - } - pOp->p3 = zBlob; - pOp->p3type = P3_DYNAMIC; - }else{ - pOp->p3type = P3_STATIC; - pOp->p3 = ""; - } - pOp->opcode = OP_Blob; - } - - else if( pOp->opcode==OP_String8 ){ - if( pOp->p3 ){ - void *z = 0; - switch( enc ){ - case TEXT_Utf16be: - z = sqlite3utf8to16be(pOp->p3, -1); - if( !z ) return SQLITE_NOMEM; - break; - case TEXT_Utf16le: - z = sqlite3utf8to16be(pOp->p3, -1); - if( !z ) return SQLITE_NOMEM; - break; - } - if( z ){ - if( pOp->p3type==P3_DYNAMIC ) sqliteFree( pOp->p3 ); - - } - } - pOp->opcode = OP_String; - } - - return SQLITE_OK; -} - /* ** Prepare a virtual machine for execution. This involves things such ** as allocating stack space and initializing the program counter. @@ -724,12 +677,6 @@ void sqlite3VdbeMakeReady( } } #endif - if( !isExplain ){ - int i; - for(i=0; inOp; i++){ - translateOp(&p->aOp[i], p->db->enc); - } - } } diff --git a/src/where.c b/src/where.c index 29143aff6d..166e29927d 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.100 2004/05/20 22:16:30 drh Exp $ +** $Id: where.c,v 1.101 2004/05/29 11:24:50 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -704,7 +704,7 @@ WhereInfo *sqlite3WhereBegin( if( i>0 && (pTabList->a[i-1].jointype & JT_LEFT)!=0 ){ if( !pParse->nMem ) pParse->nMem++; pLevel->iLeftJoin = pParse->nMem++; - sqlite3VdbeAddOp(v, OP_String, 0, 0); + sqlite3VdbeAddOp(v, OP_String8, 0, 0); sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iLeftJoin, 1); }