Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Disable the OR optimization for WITHOUT ROWID tables, since it relies on the use of rowids. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | omit-rowid |
Files: | files | file ages | folders |
SHA1: |
6055dad2ba2f9256b1f2d0a9e32ca00f |
User & Date: | drh 2013-11-06 12:05:57.372 |
Context
2013-11-06
| ||
12:56 | Improved ORDER BY optimization for WITHOUT ROWID tables. (check-in: 8f1709ff2d user: drh tags: omit-rowid) | |
12:05 | Disable the OR optimization for WITHOUT ROWID tables, since it relies on the use of rowids. (check-in: 6055dad2ba user: drh tags: omit-rowid) | |
11:46 | Remove an incorrect test case from conflict2.test. (check-in: 427612efc1 user: drh tags: omit-rowid) | |
Changes
Changes to src/where.c.
︙ | ︙ | |||
4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 | pWC = pBuilder->pWC; if( pWInfo->wctrlFlags & WHERE_AND_ONLY ) return SQLITE_OK; pWCEnd = pWC->a + pWC->nTerm; pNew = pBuilder->pNew; memset(&sSum, 0, sizeof(sSum)); pItem = pWInfo->pTabList->a + pNew->iTab; iCur = pItem->iCursor; for(pTerm=pWC->a; pTerm<pWCEnd && rc==SQLITE_OK; pTerm++){ if( (pTerm->eOperator & WO_OR)!=0 && (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0 ){ WhereClause * const pOrWC = &pTerm->u.pOrInfo->wc; | > | 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 | pWC = pBuilder->pWC; if( pWInfo->wctrlFlags & WHERE_AND_ONLY ) return SQLITE_OK; pWCEnd = pWC->a + pWC->nTerm; pNew = pBuilder->pNew; memset(&sSum, 0, sizeof(sSum)); pItem = pWInfo->pTabList->a + pNew->iTab; if( !HasRowid(pItem->pTab) ) return SQLITE_OK; iCur = pItem->iCursor; for(pTerm=pWC->a; pTerm<pWCEnd && rc==SQLITE_OK; pTerm++){ if( (pTerm->eOperator & WO_OR)!=0 && (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0 ){ WhereClause * const pOrWC = &pTerm->u.pOrInfo->wc; |
︙ | ︙ |
Changes to test/where8.test.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The focus # is testing of where.c. More specifically, the focus is the optimization # of WHERE clauses that feature the OR operator. # | < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The focus # is testing of where.c. More specifically, the focus is the optimization # of WHERE clauses that feature the OR operator. # set testdir [file dirname $argv0] source $testdir/tester.tcl # Test organization: # # where8-1.*: Tests to demonstrate simple cases work with a single table |
︙ | ︙ | |||
744 745 746 747 748 749 750 751 752 | SELECT a, x FROM tA LEFT JOIN tB ON ( a=1 AND b=2 AND c=3 AND d=4 AND e=5 AND f=6 AND g=7 AND h=8 AND i=1 AND j=2 AND k=3 AND l=4 AND m=5 AND n=6 AND o=7 AND (p = 1 OR p = 2 OR p = 3) ) } } {1 {}} finish_test | > > > > > > > > > | 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | SELECT a, x FROM tA LEFT JOIN tB ON ( a=1 AND b=2 AND c=3 AND d=4 AND e=5 AND f=6 AND g=7 AND h=8 AND i=1 AND j=2 AND k=3 AND l=4 AND m=5 AND n=6 AND o=7 AND (p = 1 OR p = 2 OR p = 3) ) } } {1 {}} # The OR optimization and WITHOUT ROWID # do_execsql_test where8-6.1 { CREATE TABLE t600(a PRIMARY KEY, b) WITHOUT rowid; CREATE INDEX t600b ON t600(b); INSERT INTO t600 VALUES('state','screen'),('exact','dolphin'),('green','mercury'); SELECT a, b, '|' FROM t600 WHERE a=='state' OR b='mercury' ORDER BY +a; } {green mercury | state screen |} finish_test |