Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Make sure left joins still work even when the OR clause optimization fires. Ticket #1537. (CVS 2788) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
cbbeb9de0019a0b81318158711590078 |
User & Date: | drh 2005-11-26 14:08:08.000 |
Context
2005-11-26
| ||
14:24 | Disable the OR-clause optimization if it does not result in an index being used that would not have been used otherwise. In other words, do not convert OR clauses into an IN statement if it does not help the optimizer. (CVS 2789) (check-in: 7e7cfce0f8 user: drh tags: trunk) | |
14:08 | Make sure left joins still work even when the OR clause optimization fires. Ticket #1537. (CVS 2788) (check-in: cbbeb9de00 user: drh tags: trunk) | |
03:51 | Remove some vestiges of the old OS_TEST driver. (CVS 2787) (check-in: 008f676f20 user: drh tags: trunk) | |
Changes
Changes to src/where.c.
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | - + | ** This module contains C code that generates VDBE code used to process ** the WHERE clause of SQL statements. This module is reponsible for ** generating the code that loops through a table looking for applicable ** rows. Indices are selected and used to speed the search when doing ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** |
︙ | |||
527 528 529 530 531 532 533 534 535 536 537 538 539 540 | 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | + + + + + + + + + + | return 0; } *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0; *pnPattern = cnt; return 1; } #endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */ /* ** If the pBase expression originated in the ON or USING clause of ** a join, then transfer the appropriate markings over to derived. */ static void transferJoinMarkings(Expr *pDerived, Expr *pBase){ pDerived->flags |= pBase->flags & EP_FromJoin; pDerived->iRightJoinTable = pBase->iRightJoinTable; } /* ** The input to this routine is an WhereTerm structure with only the ** "pExpr" field filled in. The job of this routine is to analyze the ** subexpression and populate all the other fields of the WhereTerm ** structure. ** |
︙ | |||
686 687 688 689 690 691 692 693 694 695 696 697 698 699 | 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 | + | pDup = sqlite3Expr(TK_COLUMN, 0, 0, 0); if( pDup ){ pDup->iTable = iCursor; pDup->iColumn = iColumn; } pNew = sqlite3Expr(TK_IN, pDup, 0, 0); if( pNew ){ transferJoinMarkings(pNew, pExpr); pNew->pList = pList; }else{ sqlite3ExprListDelete(pList); } pTerm->pExpr = pNew; pTerm->flags |= TERM_DYNAMIC; exprAnalyze(pSrc, pMaskSet, pWC, idxTerm); |
︙ |
Added test/tkt1537.test.