| | @@ -135,11 +135,11 @@ |
| 135 | 135 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 136 | 136 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 137 | 137 | */ |
| 138 | 138 | #define SQLITE_VERSION "3.8.3" |
| 139 | 139 | #define SQLITE_VERSION_NUMBER 3008003 |
| 140 | | -#define SQLITE_SOURCE_ID "2013-12-17 16:32:56 93121d3097a43997af3c0de65bd9bd7663845fa2" |
| 140 | +#define SQLITE_SOURCE_ID "2013-12-23 11:33:32 25b8a1c9ba77df3b7c78cbce922cb593d661696d" |
| 141 | 141 | |
| 142 | 142 | /* |
| 143 | 143 | ** CAPI3REF: Run-Time Library Version Numbers |
| 144 | 144 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 145 | 145 | ** |
| | @@ -9098,11 +9098,11 @@ |
| 9098 | 9098 | #define OP_String 25 /* synopsis: r[P2]='P4' (len=P1) */ |
| 9099 | 9099 | #define OP_Null 26 /* synopsis: r[P2..P3]=NULL */ |
| 9100 | 9100 | #define OP_Blob 27 /* synopsis: r[P2]=P4 (len=P1) */ |
| 9101 | 9101 | #define OP_Variable 28 /* synopsis: r[P2]=parameter(P1,P4) */ |
| 9102 | 9102 | #define OP_Move 29 /* synopsis: r[P2@P3]=r[P1@P3] */ |
| 9103 | | -#define OP_Copy 30 /* synopsis: r[P2@P3]=r[P1@P3] */ |
| 9103 | +#define OP_Copy 30 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */ |
| 9104 | 9104 | #define OP_SCopy 31 /* synopsis: r[P2]=r[P1] */ |
| 9105 | 9105 | #define OP_ResultRow 32 /* synopsis: output=r[P1@P2] */ |
| 9106 | 9106 | #define OP_CollSeq 33 |
| 9107 | 9107 | #define OP_AddImm 34 /* synopsis: r[P1]=r[P1]+P2 */ |
| 9108 | 9108 | #define OP_MustBeInt 35 |
| | @@ -9263,11 +9263,11 @@ |
| 9263 | 9263 | |
| 9264 | 9264 | /* |
| 9265 | 9265 | ** Prototypes for the VDBE interface. See comments on the implementation |
| 9266 | 9266 | ** for a description of what each of these routines does. |
| 9267 | 9267 | */ |
| 9268 | | -SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(sqlite3*); |
| 9268 | +SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse*); |
| 9269 | 9269 | SQLITE_PRIVATE int sqlite3VdbeAddOp0(Vdbe*,int); |
| 9270 | 9270 | SQLITE_PRIVATE int sqlite3VdbeAddOp1(Vdbe*,int,int); |
| 9271 | 9271 | SQLITE_PRIVATE int sqlite3VdbeAddOp2(Vdbe*,int,int,int); |
| 9272 | 9272 | SQLITE_PRIVATE int sqlite3VdbeAddOp3(Vdbe*,int,int,int,int); |
| 9273 | 9273 | SQLITE_PRIVATE int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int); |
| | @@ -11003,10 +11003,11 @@ |
| 11003 | 11003 | u8 useSortingIdx; /* In direct mode, reference the sorting index rather |
| 11004 | 11004 | ** than the source table */ |
| 11005 | 11005 | int sortingIdx; /* Cursor number of the sorting index */ |
| 11006 | 11006 | int sortingIdxPTab; /* Cursor number of pseudo-table */ |
| 11007 | 11007 | int nSortingColumn; /* Number of columns in the sorting index */ |
| 11008 | + int mnReg, mxReg; /* Range of registers allocated for aCol and aFunc */ |
| 11008 | 11009 | ExprList *pGroupBy; /* The group by clause */ |
| 11009 | 11010 | struct AggInfo_col { /* For each column used in source tables */ |
| 11010 | 11011 | Table *pTab; /* Source table */ |
| 11011 | 11012 | int iTable; /* Cursor number of the source table */ |
| 11012 | 11013 | int iColumn; /* Column number within the source table */ |
| | @@ -12452,12 +12453,11 @@ |
| 12452 | 12453 | SQLITE_PRIVATE void sqlite3Error(sqlite3*, int, const char*,...); |
| 12453 | 12454 | SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3*, const char *z, int n); |
| 12454 | 12455 | SQLITE_PRIVATE u8 sqlite3HexToInt(int h); |
| 12455 | 12456 | SQLITE_PRIVATE int sqlite3TwoPartName(Parse *, Token *, Token *, Token **); |
| 12456 | 12457 | |
| 12457 | | -#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) || \ |
| 12458 | | - defined(SQLITE_DEBUG_OS_TRACE) |
| 12458 | +#if defined(SQLITE_TEST) |
| 12459 | 12459 | SQLITE_PRIVATE const char *sqlite3ErrName(int); |
| 12460 | 12460 | #endif |
| 12461 | 12461 | |
| 12462 | 12462 | SQLITE_PRIVATE const char *sqlite3ErrStr(int); |
| 12463 | 12463 | SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse); |
| | @@ -13776,10 +13776,13 @@ |
| 13776 | 13776 | Op *aOp; /* Space to hold the virtual machine's program */ |
| 13777 | 13777 | Mem *aMem; /* The memory locations */ |
| 13778 | 13778 | Mem **apArg; /* Arguments to currently executing user function */ |
| 13779 | 13779 | Mem *aColName; /* Column names to return */ |
| 13780 | 13780 | Mem *pResultSet; /* Pointer to an array of results */ |
| 13781 | +#ifdef SQLITE_DEBUG |
| 13782 | + Parse *pParse; /* Parsing context used to create this Vdbe */ |
| 13783 | +#endif |
| 13781 | 13784 | int nMem; /* Number of memory locations currently allocated */ |
| 13782 | 13785 | int nOp; /* Number of instructions in the program */ |
| 13783 | 13786 | int nOpAlloc; /* Number of slots allocated for aOp[] */ |
| 13784 | 13787 | int nLabel; /* Number of labels used */ |
| 13785 | 13788 | int *aLabel; /* Space to hold the labels */ |
| | @@ -15443,11 +15446,25 @@ |
| 15443 | 15446 | ** really care if the VFS receives and understands the information since it |
| 15444 | 15447 | ** is only a hint and can be safely ignored. The sqlite3OsFileControlHint() |
| 15445 | 15448 | ** routine has no return value since the return value would be meaningless. |
| 15446 | 15449 | */ |
| 15447 | 15450 | SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){ |
| 15448 | | - DO_OS_MALLOC_TEST(id); |
| 15451 | +#ifdef SQLITE_TEST |
| 15452 | + if( op!=SQLITE_FCNTL_COMMIT_PHASETWO ){ |
| 15453 | + /* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite |
| 15454 | + ** is using a regular VFS, it is called after the corresponding |
| 15455 | + ** transaction has been committed. Injecting a fault at this point |
| 15456 | + ** confuses the test scripts - the COMMIT comand returns SQLITE_NOMEM |
| 15457 | + ** but the transaction is committed anyway. |
| 15458 | + ** |
| 15459 | + ** The core must call OsFileControl() though, not OsFileControlHint(), |
| 15460 | + ** as if a custom VFS (e.g. zipvfs) returns an error here, it probably |
| 15461 | + ** means the commit really has failed and an error should be returned |
| 15462 | + ** to the user. */ |
| 15463 | + DO_OS_MALLOC_TEST(id); |
| 15464 | + } |
| 15465 | +#endif |
| 15449 | 15466 | return id->pMethods->xFileControl(id, op, pArg); |
| 15450 | 15467 | } |
| 15451 | 15468 | SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){ |
| 15452 | 15469 | (void)id->pMethods->xFileControl(id, op, pArg); |
| 15453 | 15470 | } |
| | @@ -23098,11 +23115,11 @@ |
| 23098 | 23115 | /* 25 */ "String" OpHelp("r[P2]='P4' (len=P1)"), |
| 23099 | 23116 | /* 26 */ "Null" OpHelp("r[P2..P3]=NULL"), |
| 23100 | 23117 | /* 27 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"), |
| 23101 | 23118 | /* 28 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"), |
| 23102 | 23119 | /* 29 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"), |
| 23103 | | - /* 30 */ "Copy" OpHelp("r[P2@P3]=r[P1@P3]"), |
| 23120 | + /* 30 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"), |
| 23104 | 23121 | /* 31 */ "SCopy" OpHelp("r[P2]=r[P1]"), |
| 23105 | 23122 | /* 32 */ "ResultRow" OpHelp("output=r[P1@P2]"), |
| 23106 | 23123 | /* 33 */ "CollSeq" OpHelp(""), |
| 23107 | 23124 | /* 34 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"), |
| 23108 | 23125 | /* 35 */ "MustBeInt" OpHelp(""), |
| | @@ -61170,11 +61187,12 @@ |
| 61170 | 61187 | */ |
| 61171 | 61188 | |
| 61172 | 61189 | /* |
| 61173 | 61190 | ** Create a new virtual database engine. |
| 61174 | 61191 | */ |
| 61175 | | -SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(sqlite3 *db){ |
| 61192 | +SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse *pParse){ |
| 61193 | + sqlite3 *db = pParse->db; |
| 61176 | 61194 | Vdbe *p; |
| 61177 | 61195 | p = sqlite3DbMallocZero(db, sizeof(Vdbe) ); |
| 61178 | 61196 | if( p==0 ) return 0; |
| 61179 | 61197 | p->db = db; |
| 61180 | 61198 | if( db->pVdbe ){ |
| | @@ -61182,10 +61200,13 @@ |
| 61182 | 61200 | } |
| 61183 | 61201 | p->pNext = db->pVdbe; |
| 61184 | 61202 | p->pPrev = 0; |
| 61185 | 61203 | db->pVdbe = p; |
| 61186 | 61204 | p->magic = VDBE_MAGIC_INIT; |
| 61205 | +#if SQLITE_DEBUG |
| 61206 | + p->pParse = pParse; |
| 61207 | +#endif |
| 61187 | 61208 | return p; |
| 61188 | 61209 | } |
| 61189 | 61210 | |
| 61190 | 61211 | /* |
| 61191 | 61212 | ** Remember the SQL string for a prepared statement. |
| | @@ -61301,10 +61322,19 @@ |
| 61301 | 61322 | #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS |
| 61302 | 61323 | pOp->zComment = 0; |
| 61303 | 61324 | #endif |
| 61304 | 61325 | #ifdef SQLITE_DEBUG |
| 61305 | 61326 | if( p->db->flags & SQLITE_VdbeAddopTrace ){ |
| 61327 | + int jj, kk; |
| 61328 | + Parse *pParse = p->pParse; |
| 61329 | + for(jj=kk=0; jj<SQLITE_N_COLCACHE; jj++){ |
| 61330 | + struct yColCache *x = pParse->aColCache + jj; |
| 61331 | + if( x->iLevel>pParse->iCacheLevel || x->iReg==0 ) continue; |
| 61332 | + printf(" r[%d]={%d:%d}", x->iReg, x->iTable, x->iColumn); |
| 61333 | + kk++; |
| 61334 | + } |
| 61335 | + if( kk ) printf("\n"); |
| 61306 | 61336 | sqlite3VdbePrintOp(0, i, &p->aOp[i]); |
| 61307 | 61337 | test_addop_breakpoint(); |
| 61308 | 61338 | } |
| 61309 | 61339 | #endif |
| 61310 | 61340 | #ifdef VDBE_PROFILE |
| | @@ -62022,11 +62052,21 @@ |
| 62022 | 62052 | if( c=='4' ) return pOp->p4.i; |
| 62023 | 62053 | return pOp->p5; |
| 62024 | 62054 | } |
| 62025 | 62055 | |
| 62026 | 62056 | /* |
| 62027 | | -** Compute a string for the "comment" field of a VDBE opcode listing |
| 62057 | +** Compute a string for the "comment" field of a VDBE opcode listing. |
| 62058 | +** |
| 62059 | +** The Synopsis: field in comments in the vdbe.c source file gets converted |
| 62060 | +** to an extra string that is appended to the sqlite3OpcodeName(). In the |
| 62061 | +** absence of other comments, this synopsis becomes the comment on the opcode. |
| 62062 | +** Some translation occurs: |
| 62063 | +** |
| 62064 | +** "PX" -> "r[X]" |
| 62065 | +** "PX@PY" -> "r[X..X+Y-1]" or "r[x]" if y is 0 or 1 |
| 62066 | +** "PX@PY+1" -> "r[X..X+Y]" or "r[x]" if y is 0 |
| 62067 | +** "PY..PY" -> "r[X..Y]" or "r[x]" if y<=x |
| 62028 | 62068 | */ |
| 62029 | 62069 | static int displayComment( |
| 62030 | 62070 | const Op *pOp, /* The opcode to be commented */ |
| 62031 | 62071 | const char *zP4, /* Previously obtained value for P4 */ |
| 62032 | 62072 | char *zTemp, /* Write result here */ |
| | @@ -62056,11 +62096,17 @@ |
| 62056 | 62096 | sqlite3_snprintf(nTemp-jj, zTemp+jj, "%d", v1); |
| 62057 | 62097 | if( strncmp(zSynopsis+ii+1, "@P", 2)==0 ){ |
| 62058 | 62098 | ii += 3; |
| 62059 | 62099 | jj += sqlite3Strlen30(zTemp+jj); |
| 62060 | 62100 | v2 = translateP(zSynopsis[ii], pOp); |
| 62061 | | - if( v2>1 ) sqlite3_snprintf(nTemp-jj, zTemp+jj, "..%d", v1+v2-1); |
| 62101 | + if( strncmp(zSynopsis+ii+1,"+1",2)==0 ){ |
| 62102 | + ii += 2; |
| 62103 | + v2++; |
| 62104 | + } |
| 62105 | + if( v2>1 ){ |
| 62106 | + sqlite3_snprintf(nTemp-jj, zTemp+jj, "..%d", v1+v2-1); |
| 62107 | + } |
| 62062 | 62108 | }else if( strncmp(zSynopsis+ii+1, "..P3", 4)==0 && pOp->p3==0 ){ |
| 62063 | 62109 | ii += 4; |
| 62064 | 62110 | } |
| 62065 | 62111 | } |
| 62066 | 62112 | jj += sqlite3Strlen30(zTemp+jj); |
| | @@ -62288,10 +62334,13 @@ |
| 62288 | 62334 | #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS |
| 62289 | 62335 | displayComment(pOp, zP4, zCom, sizeof(zCom)); |
| 62290 | 62336 | #else |
| 62291 | 62337 | zCom[0] = 0 |
| 62292 | 62338 | #endif |
| 62339 | + /* NB: The sqlite3OpcodeName() function is implemented by code created |
| 62340 | + ** by the mkopcodeh.awk and mkopcodec.awk scripts which extract the |
| 62341 | + ** information from the vdbe.c source text */ |
| 62293 | 62342 | fprintf(pOut, zFormat1, pc, |
| 62294 | 62343 | sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3, zP4, pOp->p5, |
| 62295 | 62344 | zCom |
| 62296 | 62345 | ); |
| 62297 | 62346 | fflush(pOut); |
| | @@ -67348,11 +67397,11 @@ |
| 67348 | 67397 | }while( n-- ); |
| 67349 | 67398 | break; |
| 67350 | 67399 | } |
| 67351 | 67400 | |
| 67352 | 67401 | /* Opcode: Copy P1 P2 P3 * * |
| 67353 | | -** Synopsis: r[P2@P3]=r[P1@P3] |
| 67402 | +** Synopsis: r[P2@P3+1]=r[P1@P3+1] |
| 67354 | 67403 | ** |
| 67355 | 67404 | ** Make a copy of registers P1..P1+P3 into registers P2..P2+P3. |
| 67356 | 67405 | ** |
| 67357 | 67406 | ** This instruction makes a deep copy of the value. A duplicate |
| 67358 | 67407 | ** is made of any string or blob constant. See also OP_SCopy. |
| | @@ -68691,11 +68740,11 @@ |
| 68691 | 68740 | /* This is the common case where the desired content fits on the original |
| 68692 | 68741 | ** page - where the content is not on an overflow page */ |
| 68693 | 68742 | VdbeMemRelease(pDest); |
| 68694 | 68743 | sqlite3VdbeSerialGet(pC->aRow+aOffset[p2], aType[p2], pDest); |
| 68695 | 68744 | }else{ |
| 68696 | | - /* This branch happens only when content is on overflow pages */ |
| 68745 | + /* This branch happens only when content is on overflow pages */ |
| 68697 | 68746 | t = aType[p2]; |
| 68698 | 68747 | if( ((pOp->p5 & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))!=0 |
| 68699 | 68748 | && ((t>=12 && (t&1)==0) || (pOp->p5 & OPFLAG_TYPEOFARG)!=0)) |
| 68700 | 68749 | || (len = sqlite3VdbeSerialTypeLen(t))==0 |
| 68701 | 68750 | ){ |
| | @@ -72809,11 +72858,11 @@ |
| 72809 | 72858 | sqlite3BtreeLeaveAll(db); |
| 72810 | 72859 | goto blob_open_out; |
| 72811 | 72860 | } |
| 72812 | 72861 | } |
| 72813 | 72862 | |
| 72814 | | - pBlob->pStmt = (sqlite3_stmt *)sqlite3VdbeCreate(db); |
| 72863 | + pBlob->pStmt = (sqlite3_stmt *)sqlite3VdbeCreate(pParse); |
| 72815 | 72864 | assert( pBlob->pStmt || db->mallocFailed ); |
| 72816 | 72865 | if( pBlob->pStmt ){ |
| 72817 | 72866 | Vdbe *v = (Vdbe *)pBlob->pStmt; |
| 72818 | 72867 | int iDb = sqlite3SchemaToIndex(db, pTab->pSchema); |
| 72819 | 72868 | |
| | @@ -78363,10 +78412,15 @@ |
| 78363 | 78412 | ** added to the column cache after this call are removed when the |
| 78364 | 78413 | ** corresponding pop occurs. |
| 78365 | 78414 | */ |
| 78366 | 78415 | SQLITE_PRIVATE void sqlite3ExprCachePush(Parse *pParse){ |
| 78367 | 78416 | pParse->iCacheLevel++; |
| 78417 | +#ifdef SQLITE_DEBUG |
| 78418 | + if( pParse->db->flags & SQLITE_VdbeAddopTrace ){ |
| 78419 | + printf("PUSH to %d\n", pParse->iCacheLevel); |
| 78420 | + } |
| 78421 | +#endif |
| 78368 | 78422 | } |
| 78369 | 78423 | |
| 78370 | 78424 | /* |
| 78371 | 78425 | ** Remove from the column cache any entries that were added since the |
| 78372 | 78426 | ** the previous N Push operations. In other words, restore the cache |
| | @@ -78376,10 +78430,15 @@ |
| 78376 | 78430 | int i; |
| 78377 | 78431 | struct yColCache *p; |
| 78378 | 78432 | assert( N>0 ); |
| 78379 | 78433 | assert( pParse->iCacheLevel>=N ); |
| 78380 | 78434 | pParse->iCacheLevel -= N; |
| 78435 | +#ifdef SQLITE_DEBUG |
| 78436 | + if( pParse->db->flags & SQLITE_VdbeAddopTrace ){ |
| 78437 | + printf("POP to %d\n", pParse->iCacheLevel); |
| 78438 | + } |
| 78439 | +#endif |
| 78381 | 78440 | for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){ |
| 78382 | 78441 | if( p->iReg && p->iLevel>pParse->iCacheLevel ){ |
| 78383 | 78442 | cacheEntryClear(pParse, p); |
| 78384 | 78443 | p->iReg = 0; |
| 78385 | 78444 | } |
| | @@ -78470,10 +78529,15 @@ |
| 78470 | 78529 | */ |
| 78471 | 78530 | SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse *pParse){ |
| 78472 | 78531 | int i; |
| 78473 | 78532 | struct yColCache *p; |
| 78474 | 78533 | |
| 78534 | +#if SQLITE_DEBUG |
| 78535 | + if( pParse->db->flags & SQLITE_VdbeAddopTrace ){ |
| 78536 | + printf("CLEAR\n"); |
| 78537 | + } |
| 78538 | +#endif |
| 78475 | 78539 | for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){ |
| 78476 | 78540 | if( p->iReg ){ |
| 78477 | 78541 | cacheEntryClear(pParse, p); |
| 78478 | 78542 | p->iReg = 0; |
| 78479 | 78543 | } |
| | @@ -79606,11 +79670,21 @@ |
| 79606 | 79670 | if( (flags & SQLITE_ECEL_FACTOR)!=0 && sqlite3ExprIsConstant(pExpr) ){ |
| 79607 | 79671 | sqlite3ExprCodeAtInit(pParse, pExpr, target+i, 0); |
| 79608 | 79672 | }else{ |
| 79609 | 79673 | int inReg = sqlite3ExprCodeTarget(pParse, pExpr, target+i); |
| 79610 | 79674 | if( inReg!=target+i ){ |
| 79611 | | - sqlite3VdbeAddOp2(pParse->pVdbe, copyOp, inReg, target+i); |
| 79675 | + VdbeOp *pOp; |
| 79676 | + Vdbe *v = pParse->pVdbe; |
| 79677 | + if( copyOp==OP_Copy |
| 79678 | + && (pOp=sqlite3VdbeGetOp(v, -1))->opcode==OP_Copy |
| 79679 | + && pOp->p1+pOp->p3+1==inReg |
| 79680 | + && pOp->p2+pOp->p3+1==target+i |
| 79681 | + ){ |
| 79682 | + pOp->p3++; |
| 79683 | + }else{ |
| 79684 | + sqlite3VdbeAddOp2(v, copyOp, inReg, target+i); |
| 79685 | + } |
| 79612 | 79686 | } |
| 79613 | 79687 | } |
| 79614 | 79688 | } |
| 79615 | 79689 | return n; |
| 79616 | 79690 | } |
| | @@ -83030,14 +83104,10 @@ |
| 83030 | 83104 | { |
| 83031 | 83105 | int rc = SQLITE_OK; |
| 83032 | 83106 | if( pExpr ){ |
| 83033 | 83107 | if( pExpr->op!=TK_ID ){ |
| 83034 | 83108 | rc = sqlite3ResolveExprNames(pName, pExpr); |
| 83035 | | - if( rc==SQLITE_OK && !sqlite3ExprIsConstant(pExpr) ){ |
| 83036 | | - sqlite3ErrorMsg(pName->pParse, "invalid name: \"%s\"", pExpr->u.zToken); |
| 83037 | | - return SQLITE_ERROR; |
| 83038 | | - } |
| 83039 | 83109 | }else{ |
| 83040 | 83110 | pExpr->op = TK_STRING; |
| 83041 | 83111 | } |
| 83042 | 83112 | } |
| 83043 | 83113 | return rc; |
| | @@ -89271,11 +89341,10 @@ |
| 89271 | 89341 | Vdbe *v = pParse->pVdbe; |
| 89272 | 89342 | int j; |
| 89273 | 89343 | Table *pTab = pIdx->pTable; |
| 89274 | 89344 | int regBase; |
| 89275 | 89345 | int nCol; |
| 89276 | | - Index *pPk; |
| 89277 | 89346 | |
| 89278 | 89347 | if( piPartIdxLabel ){ |
| 89279 | 89348 | if( pIdx->pPartIdxWhere ){ |
| 89280 | 89349 | *piPartIdxLabel = sqlite3VdbeMakeLabel(v); |
| 89281 | 89350 | pParse->iPartIdxTab = iDataCur; |
| | @@ -89285,20 +89354,13 @@ |
| 89285 | 89354 | *piPartIdxLabel = 0; |
| 89286 | 89355 | } |
| 89287 | 89356 | } |
| 89288 | 89357 | nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn; |
| 89289 | 89358 | regBase = sqlite3GetTempRange(pParse, nCol); |
| 89290 | | - pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab); |
| 89291 | 89359 | for(j=0; j<nCol; j++){ |
| 89292 | | - i16 idx = pIdx->aiColumn[j]; |
| 89293 | | - if( pPk ) idx = sqlite3ColumnOfIndex(pPk, idx); |
| 89294 | | - if( idx<0 || idx==pTab->iPKey ){ |
| 89295 | | - sqlite3VdbeAddOp2(v, OP_Rowid, iDataCur, regBase+j); |
| 89296 | | - }else{ |
| 89297 | | - sqlite3VdbeAddOp3(v, OP_Column, iDataCur, idx, regBase+j); |
| 89298 | | - sqlite3ColumnDefault(v, pTab, pIdx->aiColumn[j], -1); |
| 89299 | | - } |
| 89360 | + sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, pIdx->aiColumn[j], |
| 89361 | + regBase+j); |
| 89300 | 89362 | } |
| 89301 | 89363 | if( regOut ){ |
| 89302 | 89364 | const char *zAff; |
| 89303 | 89365 | if( pTab->pSelect |
| 89304 | 89366 | || OptimizationDisabled(pParse->db, SQLITE_IdxRealAsInt) |
| | @@ -93929,51 +93991,53 @@ |
| 93929 | 93991 | sqlite3VdbeAddOp4Int(v, OP_NoConflict, iThisCur, addrUniqueOk, |
| 93930 | 93992 | regIdx, pIdx->nKeyCol); |
| 93931 | 93993 | |
| 93932 | 93994 | /* Generate code to handle collisions */ |
| 93933 | 93995 | regR = (pIdx==pPk) ? regIdx : sqlite3GetTempRange(pParse, nPkField); |
| 93934 | | - if( HasRowid(pTab) ){ |
| 93935 | | - sqlite3VdbeAddOp2(v, OP_IdxRowid, iThisCur, regR); |
| 93936 | | - /* Conflict only if the rowid of the existing index entry |
| 93937 | | - ** is different from old-rowid */ |
| 93938 | | - if( isUpdate ){ |
| 93939 | | - sqlite3VdbeAddOp3(v, OP_Eq, regR, addrUniqueOk, regOldData); |
| 93940 | | - } |
| 93941 | | - }else{ |
| 93942 | | - int x; |
| 93943 | | - /* Extract the PRIMARY KEY from the end of the index entry and |
| 93944 | | - ** store it in registers regR..regR+nPk-1 */ |
| 93945 | | - if( (isUpdate || onError==OE_Replace) && pIdx!=pPk ){ |
| 93946 | | - for(i=0; i<pPk->nKeyCol; i++){ |
| 93947 | | - x = sqlite3ColumnOfIndex(pIdx, pPk->aiColumn[i]); |
| 93948 | | - sqlite3VdbeAddOp3(v, OP_Column, iThisCur, x, regR+i); |
| 93949 | | - VdbeComment((v, "%s.%s", pTab->zName, |
| 93950 | | - pTab->aCol[pPk->aiColumn[i]].zName)); |
| 93951 | | - } |
| 93952 | | - } |
| 93953 | | - if( isUpdate ){ |
| 93954 | | - /* If currently processing the PRIMARY KEY of a WITHOUT ROWID |
| 93955 | | - ** table, only conflict if the new PRIMARY KEY values are actually |
| 93956 | | - ** different from the old. |
| 93957 | | - ** |
| 93958 | | - ** For a UNIQUE index, only conflict if the PRIMARY KEY values |
| 93959 | | - ** of the matched index row are different from the original PRIMARY |
| 93960 | | - ** KEY values of this row before the update. */ |
| 93961 | | - int addrJump = sqlite3VdbeCurrentAddr(v)+pPk->nKeyCol; |
| 93962 | | - int op = OP_Ne; |
| 93963 | | - int regCmp = (pIdx->autoIndex==2 ? regIdx : regR); |
| 93964 | | - |
| 93965 | | - for(i=0; i<pPk->nKeyCol; i++){ |
| 93966 | | - char *p4 = (char*)sqlite3LocateCollSeq(pParse, pPk->azColl[i]); |
| 93967 | | - x = pPk->aiColumn[i]; |
| 93968 | | - if( i==(pPk->nKeyCol-1) ){ |
| 93969 | | - addrJump = addrUniqueOk; |
| 93970 | | - op = OP_Eq; |
| 93971 | | - } |
| 93972 | | - sqlite3VdbeAddOp4(v, op, |
| 93973 | | - regOldData+1+x, addrJump, regCmp+i, p4, P4_COLLSEQ |
| 93974 | | - ); |
| 93996 | + if( isUpdate || onError==OE_Replace ){ |
| 93997 | + if( HasRowid(pTab) ){ |
| 93998 | + sqlite3VdbeAddOp2(v, OP_IdxRowid, iThisCur, regR); |
| 93999 | + /* Conflict only if the rowid of the existing index entry |
| 94000 | + ** is different from old-rowid */ |
| 94001 | + if( isUpdate ){ |
| 94002 | + sqlite3VdbeAddOp3(v, OP_Eq, regR, addrUniqueOk, regOldData); |
| 94003 | + } |
| 94004 | + }else{ |
| 94005 | + int x; |
| 94006 | + /* Extract the PRIMARY KEY from the end of the index entry and |
| 94007 | + ** store it in registers regR..regR+nPk-1 */ |
| 94008 | + if( pIdx!=pPk ){ |
| 94009 | + for(i=0; i<pPk->nKeyCol; i++){ |
| 94010 | + x = sqlite3ColumnOfIndex(pIdx, pPk->aiColumn[i]); |
| 94011 | + sqlite3VdbeAddOp3(v, OP_Column, iThisCur, x, regR+i); |
| 94012 | + VdbeComment((v, "%s.%s", pTab->zName, |
| 94013 | + pTab->aCol[pPk->aiColumn[i]].zName)); |
| 94014 | + } |
| 94015 | + } |
| 94016 | + if( isUpdate ){ |
| 94017 | + /* If currently processing the PRIMARY KEY of a WITHOUT ROWID |
| 94018 | + ** table, only conflict if the new PRIMARY KEY values are actually |
| 94019 | + ** different from the old. |
| 94020 | + ** |
| 94021 | + ** For a UNIQUE index, only conflict if the PRIMARY KEY values |
| 94022 | + ** of the matched index row are different from the original PRIMARY |
| 94023 | + ** KEY values of this row before the update. */ |
| 94024 | + int addrJump = sqlite3VdbeCurrentAddr(v)+pPk->nKeyCol; |
| 94025 | + int op = OP_Ne; |
| 94026 | + int regCmp = (pIdx->autoIndex==2 ? regIdx : regR); |
| 94027 | + |
| 94028 | + for(i=0; i<pPk->nKeyCol; i++){ |
| 94029 | + char *p4 = (char*)sqlite3LocateCollSeq(pParse, pPk->azColl[i]); |
| 94030 | + x = pPk->aiColumn[i]; |
| 94031 | + if( i==(pPk->nKeyCol-1) ){ |
| 94032 | + addrJump = addrUniqueOk; |
| 94033 | + op = OP_Eq; |
| 94034 | + } |
| 94035 | + sqlite3VdbeAddOp4(v, op, |
| 94036 | + regOldData+1+x, addrJump, regCmp+i, p4, P4_COLLSEQ |
| 94037 | + ); |
| 94038 | + } |
| 93975 | 94039 | } |
| 93976 | 94040 | } |
| 93977 | 94041 | } |
| 93978 | 94042 | |
| 93979 | 94043 | /* Generate code that executes if the new index entry is not unique */ |
| | @@ -99669,11 +99733,10 @@ |
| 99669 | 99733 | } |
| 99670 | 99734 | }else if( eDest!=SRT_Exists ){ |
| 99671 | 99735 | /* If the destination is an EXISTS(...) expression, the actual |
| 99672 | 99736 | ** values returned by the SELECT are not required. |
| 99673 | 99737 | */ |
| 99674 | | - sqlite3ExprCacheClear(pParse); |
| 99675 | 99738 | sqlite3ExprCodeExprList(pParse, pEList, regResult, |
| 99676 | 99739 | (eDest==SRT_Output)?SQLITE_ECEL_DUP:0); |
| 99677 | 99740 | } |
| 99678 | 99741 | nColumn = nResultCol; |
| 99679 | 99742 | |
| | @@ -100636,11 +100699,11 @@ |
| 100636 | 100699 | ** If an error occurs, return NULL and leave a message in pParse. |
| 100637 | 100700 | */ |
| 100638 | 100701 | SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse *pParse){ |
| 100639 | 100702 | Vdbe *v = pParse->pVdbe; |
| 100640 | 100703 | if( v==0 ){ |
| 100641 | | - v = pParse->pVdbe = sqlite3VdbeCreate(pParse->db); |
| 100704 | + v = pParse->pVdbe = sqlite3VdbeCreate(pParse); |
| 100642 | 100705 | #ifndef SQLITE_OMIT_TRACE |
| 100643 | 100706 | if( v ){ |
| 100644 | 100707 | sqlite3VdbeAddOp0(v, OP_Trace); |
| 100645 | 100708 | } |
| 100646 | 100709 | #endif |
| | @@ -102894,18 +102957,27 @@ |
| 102894 | 102957 | */ |
| 102895 | 102958 | static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){ |
| 102896 | 102959 | Vdbe *v = pParse->pVdbe; |
| 102897 | 102960 | int i; |
| 102898 | 102961 | struct AggInfo_func *pFunc; |
| 102899 | | - if( pAggInfo->nFunc+pAggInfo->nColumn==0 ){ |
| 102900 | | - return; |
| 102901 | | - } |
| 102962 | + int nReg = pAggInfo->nFunc + pAggInfo->nColumn; |
| 102963 | + if( nReg==0 ) return; |
| 102964 | +#ifdef SQLITE_DEBUG |
| 102965 | + /* Verify that all AggInfo registers are within the range specified by |
| 102966 | + ** AggInfo.mnReg..AggInfo.mxReg */ |
| 102967 | + assert( nReg==pAggInfo->mxReg-pAggInfo->mnReg+1 ); |
| 102902 | 102968 | for(i=0; i<pAggInfo->nColumn; i++){ |
| 102903 | | - sqlite3VdbeAddOp2(v, OP_Null, 0, pAggInfo->aCol[i].iMem); |
| 102969 | + assert( pAggInfo->aCol[i].iMem>=pAggInfo->mnReg |
| 102970 | + && pAggInfo->aCol[i].iMem<=pAggInfo->mxReg ); |
| 102904 | 102971 | } |
| 102972 | + for(i=0; i<pAggInfo->nFunc; i++){ |
| 102973 | + assert( pAggInfo->aFunc[i].iMem>=pAggInfo->mnReg |
| 102974 | + && pAggInfo->aFunc[i].iMem<=pAggInfo->mxReg ); |
| 102975 | + } |
| 102976 | +#endif |
| 102977 | + sqlite3VdbeAddOp3(v, OP_Null, 0, pAggInfo->mnReg, pAggInfo->mxReg); |
| 102905 | 102978 | for(pFunc=pAggInfo->aFunc, i=0; i<pAggInfo->nFunc; i++, pFunc++){ |
| 102906 | | - sqlite3VdbeAddOp2(v, OP_Null, 0, pFunc->iMem); |
| 102907 | 102979 | if( pFunc->iDistinct>=0 ){ |
| 102908 | 102980 | Expr *pE = pFunc->pExpr; |
| 102909 | 102981 | assert( !ExprHasProperty(pE, EP_xIsSelect) ); |
| 102910 | 102982 | if( pE->x.pList==0 || pE->x.pList->nExpr!=1 ){ |
| 102911 | 102983 | sqlite3ErrorMsg(pParse, "DISTINCT aggregates must have exactly one " |
| | @@ -102947,11 +103019,10 @@ |
| 102947 | 103019 | int addrHitTest = 0; |
| 102948 | 103020 | struct AggInfo_func *pF; |
| 102949 | 103021 | struct AggInfo_col *pC; |
| 102950 | 103022 | |
| 102951 | 103023 | pAggInfo->directMode = 1; |
| 102952 | | - sqlite3ExprCacheClear(pParse); |
| 102953 | 103024 | for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){ |
| 102954 | 103025 | int nArg; |
| 102955 | 103026 | int addrNext = 0; |
| 102956 | 103027 | int regAgg; |
| 102957 | 103028 | ExprList *pList = pF->pExpr->x.pList; |
| | @@ -103480,10 +103551,11 @@ |
| 103480 | 103551 | */ |
| 103481 | 103552 | memset(&sNC, 0, sizeof(sNC)); |
| 103482 | 103553 | sNC.pParse = pParse; |
| 103483 | 103554 | sNC.pSrcList = pTabList; |
| 103484 | 103555 | sNC.pAggInfo = &sAggInfo; |
| 103556 | + sAggInfo.mnReg = pParse->nMem+1; |
| 103485 | 103557 | sAggInfo.nSortingColumn = pGroupBy ? pGroupBy->nExpr+1 : 0; |
| 103486 | 103558 | sAggInfo.pGroupBy = pGroupBy; |
| 103487 | 103559 | sqlite3ExprAnalyzeAggList(&sNC, pEList); |
| 103488 | 103560 | sqlite3ExprAnalyzeAggList(&sNC, pOrderBy); |
| 103489 | 103561 | if( pHaving ){ |
| | @@ -103494,10 +103566,11 @@ |
| 103494 | 103566 | assert( !ExprHasProperty(sAggInfo.aFunc[i].pExpr, EP_xIsSelect) ); |
| 103495 | 103567 | sNC.ncFlags |= NC_InAggFunc; |
| 103496 | 103568 | sqlite3ExprAnalyzeAggList(&sNC, sAggInfo.aFunc[i].pExpr->x.pList); |
| 103497 | 103569 | sNC.ncFlags &= ~NC_InAggFunc; |
| 103498 | 103570 | } |
| 103571 | + sAggInfo.mxReg = pParse->nMem; |
| 103499 | 103572 | if( db->mallocFailed ) goto select_end; |
| 103500 | 103573 | |
| 103501 | 103574 | /* Processing for aggregates with GROUP BY is very different and |
| 103502 | 103575 | ** much more complex than aggregates without a GROUP BY. |
| 103503 | 103576 | */ |
| | @@ -105398,11 +105471,11 @@ |
| 105398 | 105471 | pCol->affinity, &pValue); |
| 105399 | 105472 | if( pValue ){ |
| 105400 | 105473 | sqlite3VdbeChangeP4(v, -1, (const char *)pValue, P4_MEM); |
| 105401 | 105474 | } |
| 105402 | 105475 | #ifndef SQLITE_OMIT_FLOATING_POINT |
| 105403 | | - if( iReg>=0 && pTab->aCol[i].affinity==SQLITE_AFF_REAL ){ |
| 105476 | + if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){ |
| 105404 | 105477 | sqlite3VdbeAddOp1(v, OP_RealAffinity, iReg); |
| 105405 | 105478 | } |
| 105406 | 105479 | #endif |
| 105407 | 105480 | } |
| 105408 | 105481 | } |
| | @@ -105822,14 +105895,14 @@ |
| 105822 | 105895 | ** be used eliminates some redundant opcodes. |
| 105823 | 105896 | */ |
| 105824 | 105897 | newmask = sqlite3TriggerColmask( |
| 105825 | 105898 | pParse, pTrigger, pChanges, 1, TRIGGER_BEFORE, pTab, onError |
| 105826 | 105899 | ); |
| 105827 | | - sqlite3VdbeAddOp3(v, OP_Null, 0, regNew, regNew+pTab->nCol-1); |
| 105900 | + /*sqlite3VdbeAddOp3(v, OP_Null, 0, regNew, regNew+pTab->nCol-1);*/ |
| 105828 | 105901 | for(i=0; i<pTab->nCol; i++){ |
| 105829 | 105902 | if( i==pTab->iPKey ){ |
| 105830 | | - /*sqlite3VdbeAddOp2(v, OP_Null, 0, regNew+i);*/ |
| 105903 | + sqlite3VdbeAddOp2(v, OP_Null, 0, regNew+i); |
| 105831 | 105904 | }else{ |
| 105832 | 105905 | j = aXRef[i]; |
| 105833 | 105906 | if( j>=0 ){ |
| 105834 | 105907 | sqlite3ExprCode(pParse, pChanges->a[j].pExpr, regNew+i); |
| 105835 | 105908 | }else if( 0==(tmask&TRIGGER_BEFORE) || i>31 || (newmask&(1<<i)) ){ |
| | @@ -105839,10 +105912,12 @@ |
| 105839 | 105912 | ** a new.* reference in a trigger program. |
| 105840 | 105913 | */ |
| 105841 | 105914 | testcase( i==31 ); |
| 105842 | 105915 | testcase( i==32 ); |
| 105843 | 105916 | sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, i, regNew+i); |
| 105917 | + }else{ |
| 105918 | + sqlite3VdbeAddOp2(v, OP_Null, 0, regNew+i); |
| 105844 | 105919 | } |
| 105845 | 105920 | } |
| 105846 | 105921 | } |
| 105847 | 105922 | |
| 105848 | 105923 | /* Fire any BEFORE UPDATE triggers. This happens before constraints are |
| | @@ -111951,10 +112026,11 @@ |
| 111951 | 112026 | */ |
| 111952 | 112027 | if( pTerm==0 |
| 111953 | 112028 | && saved_nEq==saved_nSkip |
| 111954 | 112029 | && saved_nEq+1<pProbe->nKeyCol |
| 111955 | 112030 | && pProbe->aiRowEst[saved_nEq+1]>=18 /* TUNING: Minimum for skip-scan */ |
| 112031 | + && (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK |
| 111956 | 112032 | ){ |
| 111957 | 112033 | LogEst nIter; |
| 111958 | 112034 | pNew->u.btree.nEq++; |
| 111959 | 112035 | pNew->u.btree.nSkip++; |
| 111960 | 112036 | pNew->aLTerm[pNew->nLTerm++] = 0; |
| | @@ -119669,12 +119745,11 @@ |
| 119669 | 119745 | |
| 119670 | 119746 | /* |
| 119671 | 119747 | ** Return a static string containing the name corresponding to the error code |
| 119672 | 119748 | ** specified in the argument. |
| 119673 | 119749 | */ |
| 119674 | | -#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) || \ |
| 119675 | | - defined(SQLITE_DEBUG_OS_TRACE) |
| 119750 | +#if defined(SQLITE_TEST) |
| 119676 | 119751 | SQLITE_PRIVATE const char *sqlite3ErrName(int rc){ |
| 119677 | 119752 | const char *zName = 0; |
| 119678 | 119753 | int i, origRc = rc; |
| 119679 | 119754 | for(i=0; i<2 && zName==0; i++, rc &= 0xff){ |
| 119680 | 119755 | switch( rc ){ |
| | @@ -121247,10 +121322,12 @@ |
| 121247 | 121322 | #ifdef SQLITE_DEFAULT_LOCKING_MODE |
| 121248 | 121323 | db->dfltLockMode = SQLITE_DEFAULT_LOCKING_MODE; |
| 121249 | 121324 | sqlite3PagerLockingMode(sqlite3BtreePager(db->aDb[0].pBt), |
| 121250 | 121325 | SQLITE_DEFAULT_LOCKING_MODE); |
| 121251 | 121326 | #endif |
| 121327 | + |
| 121328 | + if( rc ) sqlite3Error(db, rc, 0); |
| 121252 | 121329 | |
| 121253 | 121330 | /* Enable the lookaside-malloc subsystem */ |
| 121254 | 121331 | setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside, |
| 121255 | 121332 | sqlite3GlobalConfig.nLookaside); |
| 121256 | 121333 | |
| | @@ -131579,61 +131656,74 @@ |
| 131579 | 131656 | } |
| 131580 | 131657 | |
| 131581 | 131658 | /* Step 2 */ |
| 131582 | 131659 | switch( z[1] ){ |
| 131583 | 131660 | case 'a': |
| 131584 | | - stem(&z, "lanoita", "ate", m_gt_0) || |
| 131585 | | - stem(&z, "lanoit", "tion", m_gt_0); |
| 131661 | + if( !stem(&z, "lanoita", "ate", m_gt_0) ){ |
| 131662 | + stem(&z, "lanoit", "tion", m_gt_0); |
| 131663 | + } |
| 131586 | 131664 | break; |
| 131587 | 131665 | case 'c': |
| 131588 | | - stem(&z, "icne", "ence", m_gt_0) || |
| 131589 | | - stem(&z, "icna", "ance", m_gt_0); |
| 131666 | + if( !stem(&z, "icne", "ence", m_gt_0) ){ |
| 131667 | + stem(&z, "icna", "ance", m_gt_0); |
| 131668 | + } |
| 131590 | 131669 | break; |
| 131591 | 131670 | case 'e': |
| 131592 | 131671 | stem(&z, "rezi", "ize", m_gt_0); |
| 131593 | 131672 | break; |
| 131594 | 131673 | case 'g': |
| 131595 | 131674 | stem(&z, "igol", "log", m_gt_0); |
| 131596 | 131675 | break; |
| 131597 | 131676 | case 'l': |
| 131598 | | - stem(&z, "ilb", "ble", m_gt_0) || |
| 131599 | | - stem(&z, "illa", "al", m_gt_0) || |
| 131600 | | - stem(&z, "iltne", "ent", m_gt_0) || |
| 131601 | | - stem(&z, "ile", "e", m_gt_0) || |
| 131602 | | - stem(&z, "ilsuo", "ous", m_gt_0); |
| 131677 | + if( !stem(&z, "ilb", "ble", m_gt_0) |
| 131678 | + && !stem(&z, "illa", "al", m_gt_0) |
| 131679 | + && !stem(&z, "iltne", "ent", m_gt_0) |
| 131680 | + && !stem(&z, "ile", "e", m_gt_0) |
| 131681 | + ){ |
| 131682 | + stem(&z, "ilsuo", "ous", m_gt_0); |
| 131683 | + } |
| 131603 | 131684 | break; |
| 131604 | 131685 | case 'o': |
| 131605 | | - stem(&z, "noitazi", "ize", m_gt_0) || |
| 131606 | | - stem(&z, "noita", "ate", m_gt_0) || |
| 131607 | | - stem(&z, "rota", "ate", m_gt_0); |
| 131686 | + if( !stem(&z, "noitazi", "ize", m_gt_0) |
| 131687 | + && !stem(&z, "noita", "ate", m_gt_0) |
| 131688 | + ){ |
| 131689 | + stem(&z, "rota", "ate", m_gt_0); |
| 131690 | + } |
| 131608 | 131691 | break; |
| 131609 | 131692 | case 's': |
| 131610 | | - stem(&z, "msila", "al", m_gt_0) || |
| 131611 | | - stem(&z, "ssenevi", "ive", m_gt_0) || |
| 131612 | | - stem(&z, "ssenluf", "ful", m_gt_0) || |
| 131613 | | - stem(&z, "ssensuo", "ous", m_gt_0); |
| 131693 | + if( !stem(&z, "msila", "al", m_gt_0) |
| 131694 | + && !stem(&z, "ssenevi", "ive", m_gt_0) |
| 131695 | + && !stem(&z, "ssenluf", "ful", m_gt_0) |
| 131696 | + ){ |
| 131697 | + stem(&z, "ssensuo", "ous", m_gt_0); |
| 131698 | + } |
| 131614 | 131699 | break; |
| 131615 | 131700 | case 't': |
| 131616 | | - stem(&z, "itila", "al", m_gt_0) || |
| 131617 | | - stem(&z, "itivi", "ive", m_gt_0) || |
| 131618 | | - stem(&z, "itilib", "ble", m_gt_0); |
| 131701 | + if( !stem(&z, "itila", "al", m_gt_0) |
| 131702 | + && !stem(&z, "itivi", "ive", m_gt_0) |
| 131703 | + ){ |
| 131704 | + stem(&z, "itilib", "ble", m_gt_0); |
| 131705 | + } |
| 131619 | 131706 | break; |
| 131620 | 131707 | } |
| 131621 | 131708 | |
| 131622 | 131709 | /* Step 3 */ |
| 131623 | 131710 | switch( z[0] ){ |
| 131624 | 131711 | case 'e': |
| 131625 | | - stem(&z, "etaci", "ic", m_gt_0) || |
| 131626 | | - stem(&z, "evita", "", m_gt_0) || |
| 131627 | | - stem(&z, "ezila", "al", m_gt_0); |
| 131712 | + if( !stem(&z, "etaci", "ic", m_gt_0) |
| 131713 | + && !stem(&z, "evita", "", m_gt_0) |
| 131714 | + ){ |
| 131715 | + stem(&z, "ezila", "al", m_gt_0); |
| 131716 | + } |
| 131628 | 131717 | break; |
| 131629 | 131718 | case 'i': |
| 131630 | 131719 | stem(&z, "itici", "ic", m_gt_0); |
| 131631 | 131720 | break; |
| 131632 | 131721 | case 'l': |
| 131633 | | - stem(&z, "laci", "ic", m_gt_0) || |
| 131634 | | - stem(&z, "luf", "", m_gt_0); |
| 131722 | + if( !stem(&z, "laci", "ic", m_gt_0) ){ |
| 131723 | + stem(&z, "luf", "", m_gt_0); |
| 131724 | + } |
| 131635 | 131725 | break; |
| 131636 | 131726 | case 's': |
| 131637 | 131727 | stem(&z, "ssen", "", m_gt_0); |
| 131638 | 131728 | break; |
| 131639 | 131729 | } |
| | @@ -131670,13 +131760,15 @@ |
| 131670 | 131760 | if( z[2]=='a' ){ |
| 131671 | 131761 | if( m_gt_1(z+3) ){ |
| 131672 | 131762 | z += 3; |
| 131673 | 131763 | } |
| 131674 | 131764 | }else if( z[2]=='e' ){ |
| 131675 | | - stem(&z, "tneme", "", m_gt_1) || |
| 131676 | | - stem(&z, "tnem", "", m_gt_1) || |
| 131677 | | - stem(&z, "tne", "", m_gt_1); |
| 131765 | + if( !stem(&z, "tneme", "", m_gt_1) |
| 131766 | + && !stem(&z, "tnem", "", m_gt_1) |
| 131767 | + ){ |
| 131768 | + stem(&z, "tne", "", m_gt_1); |
| 131769 | + } |
| 131678 | 131770 | } |
| 131679 | 131771 | } |
| 131680 | 131772 | break; |
| 131681 | 131773 | case 'o': |
| 131682 | 131774 | if( z[0]=='u' ){ |
| | @@ -131691,12 +131783,13 @@ |
| 131691 | 131783 | if( z[0]=='m' && z[2]=='i' && m_gt_1(z+3) ){ |
| 131692 | 131784 | z += 3; |
| 131693 | 131785 | } |
| 131694 | 131786 | break; |
| 131695 | 131787 | case 't': |
| 131696 | | - stem(&z, "eta", "", m_gt_1) || |
| 131697 | | - stem(&z, "iti", "", m_gt_1); |
| 131788 | + if( !stem(&z, "eta", "", m_gt_1) ){ |
| 131789 | + stem(&z, "iti", "", m_gt_1); |
| 131790 | + } |
| 131698 | 131791 | break; |
| 131699 | 131792 | case 'u': |
| 131700 | 131793 | if( z[0]=='s' && z[2]=='o' && m_gt_1(z+3) ){ |
| 131701 | 131794 | z += 3; |
| 131702 | 131795 | } |
| 131703 | 131796 | |