Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch ticket-71e333e7 Excluding Merge-Ins
This is equivalent to a diff from d507648d82 to cdbfa66483
2012-12-08
| ||
21:51 | Refactor collating-sequence handling as a fix for ticket [71e333e7d2e642]. The Expr.pColl field is removed from the Expr object. The COLLATE operator now becomes a separate instance of Expr in the expression tree. The code generator looks up the correct collating function as needed, rather than referring to Expr.pColl. (check-in: 8542e6180d user: drh tags: trunk) | |
21:36 | Adjustments to the collating-sequence refactoring to facilitate full-coverage testing and to fix some minor issues found by TH3. (Closed-Leaf check-in: cdbfa66483 user: drh tags: ticket-71e333e7) | |
14:16 | Make sure WHERE clause constraints A=B and B=A work the same even with COLLATE clauses. (check-in: b3f5366811 user: drh tags: ticket-71e333e7) | |
2012-12-06
| ||
19:01 | Add the SQLITE_FCNTL_TEMPFILENAME file control that asks the underlying VFS to return a new temporary filename. Per request from NSS team at Mozilla. (check-in: 1a63b1d5fa user: drh tags: trunk) | |
15:15 | Add a test case that demonstrates ticket [71e333e7d2e642]. (check-in: cc6e0785df user: drh tags: ticket-71e333e7) | |
04:33 | For the sqlite3-all.c target, use backslashes when calling the splitter script via the MSVC makefile. (check-in: d507648d82 user: mistachkin tags: trunk) | |
04:19 | Bring the ancient malloc3.test file closer into relevance with the latest core code. (check-in: 9793a21c13 user: mistachkin tags: trunk) | |
Changes to src/build.c.
︙ | |||
2686 2687 2688 2689 2690 2691 2692 | 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 | - + - - - + | /* Figure out how many bytes of space are required to store explicitly ** specified collation sequence names. */ for(i=0; i<pList->nExpr; i++){ Expr *pExpr = pList->a[i].pExpr; if( pExpr ){ |
︙ | |||
2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 | 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 | + - - - - - - + + + - + | ** same column more than once cannot be an error because that would ** break backwards compatibility - it needs to be a warning. */ for(i=0, pListItem=pList->a; i<pList->nExpr; i++, pListItem++){ const char *zColName = pListItem->zName; Column *pTabCol; int requestedSortOrder; CollSeq *pColl; /* Collating sequence */ char *zColl; /* Collation sequence name */ for(j=0, pTabCol=pTab->aCol; j<pTab->nCol; j++, pTabCol++){ if( sqlite3StrICmp(zColName, pTabCol->zName)==0 ) break; } if( j>=pTab->nCol ){ sqlite3ErrorMsg(pParse, "table %s has no column named %s", pTab->zName, zColName); pParse->checkSchema = 1; goto exit_create_index; } pIndex->aiColumn[i] = j; |
︙ |
Changes to src/expr.c.
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + + - + | ** ** CREATE TABLE t1(a); ** SELECT * FROM t1 WHERE a; ** SELECT a AS b FROM t1 WHERE b; ** SELECT * FROM t1 WHERE (select a from t1); */ char sqlite3ExprAffinity(Expr *pExpr){ int op; pExpr = sqlite3ExprSkipCollate(pExpr); |
︙ | |||
52 53 54 55 56 57 58 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | - - + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + + - + - - - - + - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - + - - - - + + + + + - - - + - - + + + + + + + - | assert( pExpr->pTab && j<pExpr->pTab->nCol ); return pExpr->pTab->aCol[j].affinity; } return pExpr->affinity; } /* |
︙ | |||
215 216 217 218 219 220 221 | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | - + - - - + + - - + | CollSeq *sqlite3BinaryCompareCollSeq( Parse *pParse, Expr *pLeft, Expr *pRight ){ CollSeq *pColl; assert( pLeft ); |
︙ | |||
450 451 452 453 454 455 456 | 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | - - + - - - - + - - | if( pRoot==0 ){ assert( db->mallocFailed ); sqlite3ExprDelete(db, pLeft); sqlite3ExprDelete(db, pRight); }else{ if( pRight ){ pRoot->pRight = pRight; |
︙ | |||
718 719 720 721 722 723 724 | 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 | - + | if( 0==(flags&EXPRDUP_REDUCE) ){ nSize = EXPR_FULLSIZE; }else{ assert( !ExprHasAnyProperty(p, EP_TokenOnly|EP_Reduced) ); assert( !ExprHasProperty(p, EP_FromJoin) ); assert( (p->flags2 & EP2_MallocedToken)==0 ); assert( (p->flags2 & EP2_Irreducible)==0 ); |
︙ | |||
2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 | 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 | + | testcase( regFree2==0 ); codeCompare(pParse, pLeft, pRight, OP_Le, r1, r2, r4, SQLITE_STOREP2); sqlite3VdbeAddOp3(v, OP_And, r3, r4, target); sqlite3ReleaseTempReg(pParse, r3); sqlite3ReleaseTempReg(pParse, r4); break; } case TK_COLLATE: case TK_UPLUS: { inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); break; } case TK_TRIGGER: { /* If the opcode is TK_TRIGGER, then the expression is a reference |
︙ | |||
3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 | 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 | + + + + + + | case TK_UMINUS: zUniOp = "UMINUS"; break; case TK_UPLUS: zUniOp = "UPLUS"; break; case TK_BITNOT: zUniOp = "BITNOT"; break; case TK_NOT: zUniOp = "NOT"; break; case TK_ISNULL: zUniOp = "ISNULL"; break; case TK_NOTNULL: zUniOp = "NOTNULL"; break; case TK_COLLATE: { sqlite3ExplainExpr(pOut, pExpr->pLeft); sqlite3ExplainPrintf(pOut,".COLLATE(%s)",pExpr->u.zToken); break; } case TK_AGG_FUNCTION: case TK_CONST_FUNC: case TK_FUNCTION: { ExprList *pFarg; /* List of function arguments */ if( ExprHasAnyProperty(pExpr, EP_TokenOnly) ){ pFarg = 0; |
︙ | |||
3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 | 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 | + + + | static int evalConstExpr(Walker *pWalker, Expr *pExpr){ Parse *pParse = pWalker->pParse; switch( pExpr->op ){ case TK_IN: case TK_REGISTER: { return WRC_Prune; } case TK_COLLATE: { return WRC_Continue; } case TK_FUNCTION: case TK_AGG_FUNCTION: case TK_CONST_FUNC: { /* The arguments to a function have a fixed destination. ** Mark them this way to avoid generated unneeded OP_SCopy ** instructions. */ |
︙ | |||
3350 3351 3352 3353 3354 3355 3356 | 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 | - - - + + + + + | } } break; } } if( isAppropriateForFactoring(pExpr) ){ int r1 = ++pParse->nMem; |
︙ | |||
3769 3770 3771 3772 3773 3774 3775 | 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 | - + + + + + + + + + - + - - | } assert( !ExprHasAnyProperty(pA, EP_TokenOnly|EP_Reduced) ); assert( !ExprHasAnyProperty(pB, EP_TokenOnly|EP_Reduced) ); if( ExprHasProperty(pA, EP_xIsSelect) || ExprHasProperty(pB, EP_xIsSelect) ){ return 2; } if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 2; |
︙ |
Changes to src/fkey.c.
︙ | |||
507 508 509 510 511 512 513 514 515 516 517 518 | 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | + - + + + | pLeft = sqlite3Expr(db, TK_REGISTER, 0); if( pLeft ){ /* Set the collation sequence and affinity of the LHS of each TK_EQ ** expression to the parent key column defaults. */ if( pIdx ){ Column *pCol; const char *zColl; iCol = pIdx->aiColumn[i]; pCol = &pTab->aCol[iCol]; if( pTab->iPKey==iCol ) iCol = -1; pLeft->iTable = regData+iCol+1; pLeft->affinity = pCol->affinity; |
︙ |
Changes to src/insert.c.
︙ | |||
1270 1271 1272 1273 1274 1275 1276 | 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 | - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - | #ifndef SQLITE_OMIT_CHECK if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ ExprList *pCheck = pTab->pCheck; pParse->ckBase = regData; onError = overrideError!=OE_Default ? overrideError : OE_Abort; for(i=0; i<pCheck->nExpr; i++){ int allOk = sqlite3VdbeMakeLabel(v); |
︙ |
Changes to src/parse.y.
︙ | |||
811 812 813 814 815 816 817 | 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 | - + | } expr(A) ::= VARIABLE(X). { spanExpr(&A, pParse, TK_VARIABLE, &X); sqlite3ExprAssignVarNumber(pParse, A.pExpr); spanSet(&A, &X, &X); } expr(A) ::= expr(E) COLLATE ids(C). { |
︙ | |||
1136 1137 1138 1139 1140 1141 1142 | 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 | - + - - - - - + - - - - | %destructor idxlist {sqlite3ExprListDelete(pParse->db, $$);} %type idxlist_opt {ExprList*} %destructor idxlist_opt {sqlite3ExprListDelete(pParse->db, $$);} idxlist_opt(A) ::= . {A = 0;} idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;} idxlist(A) ::= idxlist(X) COMMA nm(Y) collate(C) sortorder(Z). { |
︙ |
Changes to src/resolve.c.
︙ | |||
63 64 65 66 67 68 69 70 71 72 73 74 75 76 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | + + + + + + + + + | ** Is equivalent to: ** ** SELECT random()%5 AS x, count(*) FROM tab GROUP BY random()%5 ** ** The result of random()%5 in the GROUP BY clause is probably different ** from the result in the result-set. We might fix this someday. Or ** then again, we might not... ** ** If the reference is followed by a COLLATE operator, then make sure ** the COLLATE operator is preserved. For example: ** ** SELECT a+b, c+d FROM t1 ORDER BY 1 COLLATE nocase; ** ** Should be transformed into: ** ** SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase; ** ** The nSubquery parameter specifies how many levels of subquery the ** alias is removed from the original expression. The usually value is ** zero but it might be more if the alias is contained within a subquery ** of the original expression. The Expr.op2 field of TK_AGG_FUNCTION ** structures must be increased by the nSubquery amount. */ |
︙ | |||
87 88 89 90 91 92 93 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | - - + + + - - - - - - - - - - - - - - + - - + + + + + + + + + | sqlite3 *db; /* The database connection */ assert( iCol>=0 && iCol<pEList->nExpr ); pOrig = pEList->a[iCol].pExpr; assert( pOrig!=0 ); assert( pOrig->flags & EP_Resolved ); db = pParse->db; |
︙ | |||
808 809 810 811 812 813 814 | 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 | - + - - + + - - - + + - - - + + + + + + + + + + | moreToDo = 0; pEList = pSelect->pEList; assert( pEList!=0 ); for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){ int iCol = -1; Expr *pE, *pDup; if( pItem->done ) continue; |
︙ | |||
938 939 940 941 942 943 944 | 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 | - + - + | /* If an AS-name match is found, mark this ORDER BY column as being ** a copy of the iCol-th result-set column. The subsequent call to ** sqlite3ResolveOrderGroupBy() will convert the expression to a ** copy of the iCol-th result-set expression. */ pItem->iOrderByCol = (u16)iCol; continue; } |
︙ |
Changes to src/select.c.
︙ | |||
1331 1332 1333 1334 1335 1336 1337 | 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 | - + | } *pnCol = nCol; *paCol = aCol; for(i=0, pCol=aCol; i<nCol; i++, pCol++){ /* Get an appropriate name for the column */ |
︙ | |||
2329 2330 2331 2332 2333 2334 2335 | 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 | - - + + - - + + + | if( pKeyMerge ){ pKeyMerge->aSortOrder = (u8*)&pKeyMerge->aColl[nOrderBy]; pKeyMerge->nField = (u16)nOrderBy; pKeyMerge->enc = ENC(db); for(i=0; i<nOrderBy; i++){ CollSeq *pColl; Expr *pTerm = pOrderBy->a[i].pExpr; |
︙ | |||
2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 | 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 | + | /* Implement the main merge loop */ sqlite3VdbeResolveLabel(v, labelCmpr); sqlite3VdbeAddOp4(v, OP_Permutation, 0, 0, 0, (char*)aPermute, P4_INTARRAY); sqlite3VdbeAddOp4(v, OP_Compare, destA.iSdst, destB.iSdst, nOrderBy, (char*)pKeyMerge, P4_KEYINFO_HANDOFF); sqlite3VdbeChangeP5(v, OPFLAG_PERMUTE); sqlite3VdbeAddOp3(v, OP_Jump, addrAltB, addrAeqB, addrAgtB); /* Release temporary registers */ if( regPrev ){ sqlite3ReleaseTempRange(pParse, regPrev, nOrderBy+1); } |
︙ | |||
2604 2605 2606 2607 2608 2609 2610 | 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 | - - - | if( pExpr->iColumn<0 ){ pExpr->op = TK_NULL; }else{ Expr *pNew; assert( pEList!=0 && pExpr->iColumn<pEList->nExpr ); assert( pExpr->pLeft==0 && pExpr->pRight==0 ); pNew = sqlite3ExprDup(db, pEList->a[pExpr->iColumn].pExpr, 0); |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
1674 1675 1676 1677 1678 1679 1680 | 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 | - | Expr *pLeft; /* Left subnode */ Expr *pRight; /* Right subnode */ union { ExprList *pList; /* Function arguments or in "<expr> IN (<expr-list)" */ Select *pSelect; /* Used for sub-selects and "<expr> IN (<select>)" */ } x; |
︙ | |||
1710 1711 1712 1713 1714 1715 1716 | 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 | - + | #define EP_Agg 0x0002 /* Contains one or more aggregate functions */ #define EP_Resolved 0x0004 /* IDs have been resolved to COLUMNs */ #define EP_Error 0x0008 /* Expression contains one or more errors */ #define EP_Distinct 0x0010 /* Aggregate function with DISTINCT keyword */ #define EP_VarSelect 0x0020 /* pSelect is correlated, not constant */ #define EP_DblQuoted 0x0040 /* token.z was originally in "..." */ #define EP_InfixFunc 0x0080 /* True for an infix function: LIKE, GLOB, etc */ |
︙ | |||
2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 | 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 | + | #define OPFLAG_APPEND 0x08 /* This is likely to be an append */ #define OPFLAG_USESEEKRESULT 0x10 /* Try to avoid a seek in BtreeInsert() */ #define OPFLAG_CLEARCACHE 0x20 /* Clear pseudo-table cache in OP_Column */ #define OPFLAG_LENGTHARG 0x40 /* OP_Column only used for length() */ #define OPFLAG_TYPEOFARG 0x80 /* OP_Column only used for typeof() */ #define OPFLAG_BULKCSR 0x01 /* OP_Open** used to open bulk cursor */ #define OPFLAG_P2ISREG 0x02 /* P2 to OP_Open** is a register number */ #define OPFLAG_PERMUTE 0x01 /* OP_Compare: use the permutation */ /* * Each trigger present in the database schema is stored as an instance of * struct Trigger. * * Pointers to instances of struct Trigger are stored in two ways. * 1. In the "trigHash" hash table (part of the sqlite3* that represents the |
︙ | |||
3018 3019 3020 3021 3022 3023 3024 | 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 | - - + + + | u8 sqlite3HexToInt(int h); int sqlite3TwoPartName(Parse *, Token *, Token *, Token **); const char *sqlite3ErrStr(int); int sqlite3ReadSchema(Parse *pParse); CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int); CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char*zName); CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr); |
︙ |
Changes to src/vdbe.c.
︙ | |||
418 419 420 421 422 423 424 | 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | - + + + | #endif #ifdef SQLITE_DEBUG /* ** Print the value of a register for tracing purposes: */ static void memTracePrint(FILE *out, Mem *p){ |
︙ | |||
1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 | 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 | + + + | n = pOp->p3; pIn1 = &aMem[pOp->p1]; pOut = &aMem[pOp->p2]; assert( pOut!=pIn1 ); while( 1 ){ sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem); Deephemeralize(pOut); #ifdef SQLITE_DEBUG pOut->pScopyFrom = 0; #endif REGISTER_TRACE(pOp->p2+pOp->p3-n, pOut); if( (n--)==0 ) break; pOut++; pIn1++; } break; } |
︙ | |||
1883 1884 1885 1886 1887 1888 1889 | 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 | - - - + + + - + + + + + + + | } /* Opcode: Permutation * * * P4 * ** ** Set the permutation used by the OP_Compare operator to be the array ** of integers in P4. ** |
︙ |
Changes to src/vdbeaux.c.
︙ | |||
862 863 864 865 866 867 868 | 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 | - - - - - - - - - - - - + + + + + + + + + + + + - - - - | int i, j; KeyInfo *pKeyInfo = pOp->p4.pKeyInfo; assert( pKeyInfo->aSortOrder!=0 ); sqlite3_snprintf(nTemp, zTemp, "keyinfo(%d", pKeyInfo->nField); i = sqlite3Strlen30(zTemp); for(j=0; j<pKeyInfo->nField; j++){ CollSeq *pColl = pKeyInfo->aColl[j]; |
︙ |
Changes to src/where.c.
︙ | |||
559 560 561 562 563 564 565 | 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | + - + - + - + - - + + + + + + + - - + + - - - + + + + + + | */ #define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;} /* ** Commute a comparison operator. Expressions of the form "X op Y" ** are converted into "Y op X". ** ** If left/right precendence rules come into play when determining the |
︙ | |||
652 653 654 655 656 657 658 | 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 | - + - + | /* Figure out the collation sequence required from an index for ** it to be useful for optimising expression pX. Store this ** value in variable pColl. */ assert(pX->pLeft); pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight); |
︙ | |||
1175 1176 1177 1178 1179 1180 1181 | 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 | - + | sqlite3 *db = pParse->db; /* Database connection */ if( db->mallocFailed ){ return; } pTerm = &pWC->a[idxTerm]; pMaskSet = pWC->pMaskSet; |
︙ | |||
1202 1203 1204 1205 1206 1207 1208 | 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 | - - + + | ** on left table of a LEFT JOIN. Ticket #3015 */ } pTerm->prereqAll = prereqAll; pTerm->leftCursor = -1; pTerm->iParent = -1; pTerm->eOperator = 0; if( allowedOp(op) && (pTerm->prereqRight & prereqLeft)==0 ){ |
︙ | |||
1231 1232 1233 1234 1235 1236 1237 | 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 | - + | pTerm->nChild = 1; pTerm->wtFlags |= TERM_COPIED; }else{ pDup = pExpr; pNew = pTerm; } exprCommute(pParse, pDup); |
︙ | |||
1310 1311 1312 1313 1314 1315 1316 | 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 | - + | ){ Expr *pLeft; /* LHS of LIKE/GLOB operator */ Expr *pStr2; /* Copy of pStr1 - RHS of LIKE/GLOB operator */ Expr *pNewExpr1; Expr *pNewExpr2; int idxNew1; int idxNew2; |
︙ | |||
1332 1333 1334 1335 1336 1337 1338 | 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 | - + + + - - + + + - - + + | if( c=='A'-1 ) isComplete = 0; /* EV: R-64339-08207 */ c = sqlite3UpperToLower[c]; } *pC = c + 1; } |
︙ | |||
1459 1460 1461 1462 1463 1464 1465 | 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 | - + - + | Index *pIdx, /* Index to match column of */ int iCol /* Column of index to match */ ){ int i; const char *zColl = pIdx->azColl[iCol]; for(i=0; i<pList->nExpr; i++){ |
︙ | |||
1511 1512 1513 1514 1515 1516 1517 | 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 | - + | ** can be ignored. If it does not, and the column does not belong to the ** same table as index pIdx, return early. Finally, if there is no ** matching "col=X" expression and the column is on the same table as pIdx, ** set the corresponding bit in variable mask. */ for(i=0; i<pDistinct->nExpr; i++){ WhereTerm *pTerm; |
︙ | |||
1563 1564 1565 1566 1567 1568 1569 | 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 | - + | pTab = pTabList->a[0].pTab; /* If any of the expressions is an IPK column on table iBase, then return ** true. Note: The (p->iTable==iBase) part of this test may be false if the ** current SELECT is a correlated sub-query. */ for(i=0; i<pDistinct->nExpr; i++){ |
︙ | |||
2849 2850 2851 2852 2853 2854 2855 | 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 | - + | int isMatch; /* ORDER BY term matches the index term */ const char *zColl; /* Name of collating sequence for i-th index term */ WhereTerm *pConstraint; /* A constraint in the WHERE clause */ /* If the next term of the ORDER BY clause refers to anything other than ** a column in the "base" table, then this index will not be of any ** further use in handling the ORDER BY. */ |
︙ | |||
2875 2876 2877 2878 2879 2880 2881 | 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 | - + | } /* Check to see if the column number and collating sequence of the ** index match the column number and collating sequence of the ORDER BY ** clause entry. Set isMatch to 1 if they both match. */ if( pOBExpr->iColumn==iColumn ){ if( zColl ){ |
︙ |
Changes to test/collate1.test.
︙ | |||
71 72 73 74 75 76 77 78 79 80 81 82 83 84 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | + | } {} do_test collate1-1.1 { execsql { SELECT c2 FROM collate1t1 ORDER BY 1; } } {{} 0x119 0x2D} do_test collate1-1.2 { breakpoint execsql { SELECT c2 FROM collate1t1 ORDER BY 1 COLLATE hex; } } {{} 0x2D 0x119} do_test collate1-1.3 { execsql { SELECT c2 FROM collate1t1 ORDER BY 1 COLLATE hex DESC; |
︙ |
Changes to test/distinct.test.
︙ | |||
164 165 166 167 168 169 170 | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | - + | 2 "b, a FROM t1" {} {B A b a} 3 "a, b, c FROM t1" {hash} {a b c A B C} 4 "a, b, c FROM t1 ORDER BY a, b, c" {btree} {A B C a b c} 5 "b FROM t1 WHERE a = 'a'" {} {b} 6 "b FROM t1" {hash} {b B} 7 "a FROM t1" {} {A a} 8 "b COLLATE nocase FROM t1" {} {b} |
︙ |
Changes to test/interrupt.test.
︙ | |||
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | + + - + | for {set i 1} {$i<$max_count-5} {incr i 1} { do_test interrupt-4.$i.1 { set ::sqlite_interrupt_count $::i catchsql $sql } {1 interrupted} } if {0} { # This doesn't work anymore since the collation factor is # no longer called during schema parsing. # Interrupt during parsing # do_test interrupt-5.1 { proc fake_interrupt {args} { db collate fake_collation no-op sqlite3_interrupt db return SQLITE_OK } db collation_needed fake_interrupt catchsql { CREATE INDEX fake ON fake1(a COLLATE fake_collation, b, c DESC); } } {1 interrupt} |
Changes to test/shared9.test.
︙ | |||
131 132 133 134 135 136 137 138 139 140 141 142 143 144 | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | + + + + + + + + + + + + + + + + + + + + + + + + | set ::invoked_mycollate_db1 0 db2 eval { INSERT INTO t1 VALUES('two'); } db2 close set ::invoked_mycollate_db1 } {0} forcedelete test.db test.db2 sqlite3 db1 test.db sqlite3 db2 test.db db1 collate mycollate mycollate_db1 db2 collate mycollate mycollate_db2 do_test 2.13 { set ::invoked_mycollate_db1 0 db1 eval { CREATE TABLE t1(a, CHECK (a COLLATE mycollate IN ('one', 'two', 'three'))); INSERT INTO t1 VALUES('one'); } db1 close set ::invoked_mycollate_db1 } {1} do_test 2.14 { set ::invoked_mycollate_db1 0 db2 eval { INSERT INTO t1 VALUES('two'); } db2 close set ::invoked_mycollate_db1 } {0} #------------------------------------------------------------------------- # This test verifies that a bug causing a busy-handler belonging to one # shared-cache connection to be executed as a result of an sqlite3_step() # on another has been fixed. # forcedelete test.db test.db2 |
︙ | |||
200 201 202 203 204 205 206 | 224 225 226 227 228 229 230 | - | } {} db1 close db2 close sqlite3_enable_shared_cache $::enable_shared_cache finish_test |
Changes to test/tkt2822.test.
︙ | |||
269 270 271 272 273 274 275 | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | - + + + + + + + + + + + | CREATE TABLE t7(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14, a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25); } catchsql { SELECT * FROM t7 ORDER BY 0; } } {1 {1st ORDER BY term out of range - should be between 1 and 25}} |
︙ |