From: drh Date: Tue, 8 Mar 2016 01:32:30 +0000 (+0000) Subject: Add the ALLBITS macro as a shorthand for "(Bitmask)(-1)". X-Git-Tag: version-3.12.0~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8426e36c8f55d4b73892afd4c81aa67d2735ced3;p=thirdparty%2Fsqlite.git Add the ALLBITS macro as a shorthand for "(Bitmask)(-1)". FossilOrigin-Name: 91bd619d27e4d91510a187bbb88de961a31c8a2e --- diff --git a/manifest b/manifest index 773add8218..4cdc82a8c0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\sNEVER()\sto\sthe\scode\sgenerator.\s\sChange\sthe\sparameter\sname\s"mExtra"\nto\s"mPrereq"\sin\sthe\squery\splanner,\sto\smore\sclosely\sreflect\sits\smeaning. -D 2016-03-08T01:11:51.292 +C Add\sthe\sALLBITS\smacro\sas\sa\sshorthand\sfor\s"(Bitmask)(-1)". +D 2016-03-08T01:32:30.559 F Makefile.in f53429fb2f313c099283659d0df6f20f932c861f F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc df0bf9ff7f8b3f4dd9fb4cc43f92fe58f6ec5c66 @@ -353,7 +353,7 @@ F src/shell.c 5e0ab1e708dc294330ccd8230536e1801f60822e F src/sqlite.h.in 0235586b3fb639e85998d495c90f007657fd82af F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d -F src/sqliteInt.h 8c32c1f4566c577cfb8e1c96e56f61e8b3e780d7 +F src/sqliteInt.h 4c7b8501b37eb768a5457b01cb9a9a5505f3fd85 F src/sqliteLimit.h 7b28cf72cbd52f178bfc97ea266445e351f2cd24 F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9 @@ -410,7 +410,7 @@ F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c F src/tokenize.c 3d338cdd00d916ce8a05c397001d64ed58e6fe1c F src/treeview.c e4b41a37530a191579d3c53142cc44ee2eb99373 F src/trigger.c e14840ee0c3e549e758ec9bf3e4146e166002280 -F src/update.c a7eeeaffad59c6506f01303a071dac11de8269ca +F src/update.c 56b3db7edff0110360a12b76af97c39ebe3ea8b8 F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c F src/util.c 12800a93f0664f41575f96799eb881a786d565e6 F src/vacuum.c feb1eabb20987983d9350cad98299b21fa811f52 @@ -428,7 +428,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 F src/wal.c 10deb6b43887662691e5f53d10b3c171c401169b F src/wal.h 2f7c831cf3b071fa548bf2d5cac640846a7ff19c F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354 -F src/where.c 3787158e3b365eec7553d6f1d6596b7fa64ea6de +F src/where.c e4d2d0ea8403339db188e75b75ca44fff225abba F src/whereInt.h 93297d56edd137b7ea004490690fb6e2ce028a34 F src/wherecode.c 863aedf086131743763c1960637fde904eadc442 F src/whereexpr.c fb87944b1254234e5bba671aaf6dee476241506a @@ -1454,7 +1454,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 9805f6f85211dcb5a0ab3ceca204e6f2e48530ea -R ee7409507ed80149a169811d9e037a32 +P 721ae51e443647291f3a8f7f2128aa410fee2682 +R 06f3b1fde5a5e4d09bcfebd9ae1525b6 U drh -Z 2ec5edc1158dca51232e491f1a3a4594 +Z acf689ff3c45ad889c44d18cadd3bf9c diff --git a/manifest.uuid b/manifest.uuid index 4c968a7a8f..78794d5451 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -721ae51e443647291f3a8f7f2128aa410fee2682 \ No newline at end of file +91bd619d27e4d91510a187bbb88de961a31c8a2e \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index e9aab2e1bd..ff4dbd4864 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2353,6 +2353,7 @@ struct IdList { */ #define MASKBIT(n) (((Bitmask)1)<<(n)) #define MASKBIT32(n) (((unsigned int)1)<<(n)) +#define ALLBITS ((Bitmask)-1) /* ** The following structure describes the FROM clause of a SELECT statement. diff --git a/src/update.c b/src/update.c index 2a436b9701..9b351662e2 100644 --- a/src/update.c +++ b/src/update.c @@ -268,7 +268,7 @@ void sqlite3Update( ** case, set all bits of the colUsed mask (to ensure that the virtual ** table implementation makes all columns available). */ - pTabList->a[0].colUsed = IsVirtual(pTab) ? (Bitmask)-1 : 0; + pTabList->a[0].colUsed = IsVirtual(pTab) ? ALLBITS : 0; hasFK = sqlite3FkRequired(pParse, pTab, aXRef, chngKey); diff --git a/src/where.c b/src/where.c index 9ed2d561cb..7510839791 100644 --- a/src/where.c +++ b/src/where.c @@ -2771,9 +2771,9 @@ static int whereLoopAddBtree( */ static int whereLoopAddVirtualOne( WhereLoopBuilder *pBuilder, - Bitmask mPrereq, /* Mask of tables that must be used. */ - Bitmask mUsable, /* Mask of usable prereqs */ - u16 mExclude, /* Exclude terms for this operator */ + Bitmask mPrereq, /* Mask of tables that must be used. */ + Bitmask mUsable, /* Mask of usable tables */ + u16 mExclude, /* Exclude terms using these operators */ sqlite3_index_info *pIdxInfo, /* Populated object for xBestIndex */ int *pbIn /* OUT: True if plan uses an IN(...) op */ ){ @@ -2941,7 +2941,7 @@ static int whereLoopAddVirtual( pNew = pBuilder->pNew; pSrc = &pWInfo->pTabList->a[pNew->iTab]; assert( IsVirtual(pSrc->pTab) ); - p = allocateIndexInfo(pParse, pWC, mUnusable, pSrc,pBuilder->pOrderBy); + p = allocateIndexInfo(pParse, pWC, mUnusable, pSrc, pBuilder->pOrderBy); if( p==0 ) return SQLITE_NOMEM_BKPT; pNew->rSetup = 0; pNew->wsFlags = WHERE_VIRTUALTABLE; @@ -2954,7 +2954,7 @@ static int whereLoopAddVirtual( } /* First call xBestIndex() with all constraints usable. */ - rc = whereLoopAddVirtualOne(pBuilder, mPrereq, (Bitmask)(-1), 0, p, &bIn); + rc = whereLoopAddVirtualOne(pBuilder, mPrereq, ALLBITS, 0, p, &bIn); mBest = pNew->prereq & ~mPrereq; /* If the call to xBestIndex() with all terms enabled produced a plan @@ -2971,7 +2971,7 @@ static int whereLoopAddVirtual( /* If the plan produced by the earlier call uses an IN(...) term, call ** xBestIndex again, this time with IN(...) terms disabled. */ if( rc==SQLITE_OK && bIn ){ - rc = whereLoopAddVirtualOne(pBuilder,mPrereq,(Bitmask)-1,WO_IN,p,&bIn); + rc = whereLoopAddVirtualOne(pBuilder, mPrereq, ALLBITS, WO_IN, p, &bIn); mBestNoIn = pNew->prereq & ~mPrereq; if( mBestNoIn==0 ){ seenZero = 1; @@ -2983,7 +2983,7 @@ static int whereLoopAddVirtual( ** in the set of terms that apply to the current virtual table. */ while( rc==SQLITE_OK ){ int i; - Bitmask mNext = (Bitmask)(-1); + Bitmask mNext = ALLBITS; assert( mNext>0 ); for(i=0; imPrev && mThisprereq==mPrereq ){ @@ -4280,7 +4280,7 @@ WhereInfo *sqlite3WhereBegin( } } if( pWInfo->pOrderBy==0 && (db->flags & SQLITE_ReverseOrder)!=0 ){ - pWInfo->revMask = (Bitmask)(-1); + pWInfo->revMask = ALLBITS; } if( pParse->nErr || NEVER(db->mallocFailed) ){ goto whereBeginError;