Fix harmless static-analyzer warnings.
FossilOrigin-Name: 32f33f356931242b59c01b5df7e180941231e3d9c91577ad33aa4a01e9d59092
This commit is contained in:
parent
d9403bc642
commit
7d4c94bc0f
@ -3783,7 +3783,7 @@ static int nodeReaderNext(NodeReader *p){
|
||||
return FTS_CORRUPT_VTAB;
|
||||
}
|
||||
blobGrowBuffer(&p->term, nPrefix+nSuffix, &rc);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( rc==SQLITE_OK && ALWAYS(p->term.a!=0) ){
|
||||
memcpy(&p->term.a[nPrefix], &p->aNode[p->iOff], nSuffix);
|
||||
p->term.n = nPrefix+nSuffix;
|
||||
p->iOff += nSuffix;
|
||||
@ -4177,7 +4177,11 @@ static int fts3TermCmp(
|
||||
int nCmp = MIN(nLhs, nRhs);
|
||||
int res;
|
||||
|
||||
res = (nCmp ? memcmp(zLhs, zRhs, nCmp) : 0);
|
||||
if( nCmp && ALWAYS(zLhs) && ALWAYS(zRhs) ){
|
||||
res = memcmp(zLhs, zRhs, nCmp);
|
||||
}else{
|
||||
res = 0;
|
||||
}
|
||||
if( res==0 ) res = nLhs - nRhs;
|
||||
|
||||
return res;
|
||||
@ -4821,7 +4825,7 @@ static int fts3IncrmergeHintLoad(Fts3Table *p, Blob *pHint){
|
||||
if( aHint ){
|
||||
blobGrowBuffer(pHint, nHint, &rc);
|
||||
if( rc==SQLITE_OK ){
|
||||
memcpy(pHint->a, aHint, nHint);
|
||||
if( ALWAYS(pHint->a!=0) ) memcpy(pHint->a, aHint, nHint);
|
||||
pHint->n = nHint;
|
||||
}
|
||||
}
|
||||
|
@ -438,8 +438,9 @@ static void jsonRenderNode(
|
||||
JsonString *pOut, /* Write JSON here */
|
||||
sqlite3_value **aReplace /* Replacement values */
|
||||
){
|
||||
assert( pNode!=0 );
|
||||
if( pNode->jnFlags & (JNODE_REPLACE|JNODE_PATCH) ){
|
||||
if( pNode->jnFlags & JNODE_REPLACE ){
|
||||
if( (pNode->jnFlags & JNODE_REPLACE)!=0 && ALWAYS(aReplace!=0) ){
|
||||
jsonAppendValue(pOut, aReplace[pNode->u.iReplace]);
|
||||
return;
|
||||
}
|
||||
|
@ -2200,7 +2200,7 @@ static int ChooseLeaf(
|
||||
|
||||
int nCell = NCELL(pNode);
|
||||
RtreeCell cell;
|
||||
RtreeNode *pChild;
|
||||
RtreeNode *pChild = 0;
|
||||
|
||||
RtreeCell *aCell = 0;
|
||||
|
||||
@ -2558,6 +2558,7 @@ static int updateMapping(
|
||||
pChild->pParent = pNode;
|
||||
}
|
||||
}
|
||||
if( NEVER(pNode==0) ) return SQLITE_ERROR;
|
||||
return xSetMapping(pRtree, iRowid, pNode->iNode);
|
||||
}
|
||||
|
||||
|
37
manifest
37
manifest
@ -1,5 +1,5 @@
|
||||
C Merge\sstatic-analyzer\swarning\sfixes\sand\sthe\snew\sSQLITE_OMIT_AUXILIARY_SAFETY_CHECKS\smacro.
|
||||
D 2021-10-04T18:59:02.285
|
||||
C Fix\sharmless\sstatic-analyzer\swarnings.
|
||||
D 2021-10-04T22:34:38.507
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -102,7 +102,7 @@ F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
|
||||
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
|
||||
F ext/fts3/fts3_unicode.c de426ff05c1c2e7bce161cf6b706638419c3a1d9c2667de9cb9dc0458c18e226
|
||||
F ext/fts3/fts3_unicode2.c 416eb7e1e81142703520d284b768ca2751d40e31fa912cae24ba74860532bf0f
|
||||
F ext/fts3/fts3_write.c 98edfd77aeb53afcb26d8de3ed0a87f16468ee05f84f8c1752e6e378c354cd7a
|
||||
F ext/fts3/fts3_write.c c93b1287721c2ef680186867ee1a6b5cc6659014aeffb542309101af72c77b81
|
||||
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
|
||||
F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
|
||||
F ext/fts3/tool/fts3cov.sh c331d006359456cf6f8f953e37f2b9c7d568f3863f00bb5f7eb87fea4ac01b73
|
||||
@ -306,7 +306,7 @@ F ext/misc/fileio.c 57fefd0efc535e62bb8b07fa146875171481da81a759bbfbe2fc91bab900
|
||||
F ext/misc/fossildelta.c 1240b2d3e52eab1d50c160c7fe1902a9bd210e052dc209200a750bbf885402d5
|
||||
F ext/misc/fuzzer.c eae560134f66333e9e1ca4c8ffea75df42056e2ce8456734565dbe1c2a92bf3d
|
||||
F ext/misc/ieee754.c 91a5594071143a4ab79c638fe9f059af1db09932faf2e704c3e29216a7d4f511
|
||||
F ext/misc/json1.c 6cfebb66a7568f8a17d67e676daba0a95efc3bc8f69c26998fc9519857bc5deb
|
||||
F ext/misc/json1.c f204a61f7c4436261dcb0423ff48395ac53fcfc44ea3a74a77a2a4f47b8c61e2
|
||||
F ext/misc/memstat.c 3017a0832c645c0f8c773435620d663855f04690172316bd127270d1a7523d4d
|
||||
F ext/misc/memtrace.c 7c0d115d2ef716ad0ba632c91e05bd119cb16c1aedf3bec9f06196ead2d5537b
|
||||
F ext/misc/memvfs.c 7dffa8cc89c7f2d73da4bd4ccea1bcbd2bd283e3bb4cea398df7c372a197291b
|
||||
@ -394,7 +394,7 @@ F ext/repair/test/checkindex01.test b530f141413b587c9eb78ff734de6bb79bc3515c3350
|
||||
F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c
|
||||
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
|
||||
F ext/rtree/geopoly.c d575f6c796fcb8066fb38e3d5c604b31a13867fbee2713ffb190eff31e7bc04d
|
||||
F ext/rtree/rtree.c 4e1ba7894720c33b710fb1c393a559c9faa1b0e238746006bb5d9c30a6238b2b
|
||||
F ext/rtree/rtree.c bd862b5368c60d3494bcdf6ded2fe743cf0b855a1b2ff4c5b71c82ea0694ecb1
|
||||
F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412
|
||||
F ext/rtree/rtree1.test 35c3bc0def71317b7601ee0d1149e7df2cd8fc4f13ec89a64761ac3f46ca123f
|
||||
F ext/rtree/rtree2.test 9d9deddbb16fd0c30c36e6b4fdc3ee3132d765567f0f9432ee71e1303d32603d
|
||||
@ -485,12 +485,12 @@ F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F src/alter.c a6afe961ef3544104fa635a0c3161bfe1a34382f32e2a28706993abadedbffed
|
||||
F src/analyze.c 979b6d2cdaca992a9c9f0818de55d08fb9a4e52929a509752b52d9fd23bb86d3
|
||||
F src/attach.c a514e81758ba7b3a3a0501faf70af6cfc509de8810235db726cfc9f25165e929
|
||||
F src/attach.c e5f9ab9700d545d49352db4865e9f4ba02085d244485729575b61da9fd3a7218
|
||||
F src/auth.c f4fa91b6a90bbc8e0d0f738aa284551739c9543a367071f55574681e0f24f8cf
|
||||
F src/backup.c 3014889fa06e20e6adfa0d07b60097eec1f6e5b06671625f476a714d2356513d
|
||||
F src/bitvec.c 17ea48eff8ba979f1f5b04cc484c7bb2be632f33
|
||||
F src/bitvec.c 7c849aac407230278445cb069bebc5f89bf2ddd87c5ed9459b070a9175707b3d
|
||||
F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6
|
||||
F src/btree.c ced03fe226a3a42b77b504afcd0a9da14da39b42fac5935988243803cf03bc14
|
||||
F src/btree.c 57c2ac124795303fb2358c29dcadbb9de67cf34b16896a555f2abdb5fd68833c
|
||||
F src/btree.h 74d64b8f28cfa4a894d14d4ed64fa432cd697b98b61708d4351482ae15913e22
|
||||
F src/btreeInt.h 7bc15a24a02662409ebcd6aeaa1065522d14b7fda71573a2b0568b458f514ae0
|
||||
F src/build.c ee6941680fa2ab0461d9be145a546f8659f6543af643ace0b44d08abdf85e001
|
||||
@ -501,7 +501,7 @@ F src/date.c 467848d8187382764e37fd7678d6825cdfb90d9e564648527ed832e999ea7b85
|
||||
F src/dbpage.c 8a01e865bf8bc6d7b1844b4314443a6436c07c3efe1d488ed89e81719047833a
|
||||
F src/dbstat.c 861e08690fcb0f2ee1165eff0060ea8d4f3e2ea10f80dab7d32ad70443a6ff2d
|
||||
F src/delete.c 3ce6af6b64c8b476de51ccc32da0cb3142d42e65754e1d8118addf65b8bcba15
|
||||
F src/expr.c b2d8333a1b4e320b5989a286924a2c7c63fc4f7668b2b0a570babe254c0089ef
|
||||
F src/expr.c ac2bc8eef596443dfe04c3510eefda5dfdda9dac65cc8fef5a80c69fb4c24815
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c 1905af1821b88321e1bb9d6a69e704495b6844a9b6c29398d40117cc251e893c
|
||||
F src/func.c 761a989e9b6a1f03cae05ef274f30881cb8f7ec816af2913b58dc18ac31ffd0e
|
||||
@ -513,7 +513,7 @@ F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
|
||||
F src/insert.c 16fa4b66709db6db5bb31475f2321d0a839269765aa2461a520c151c385e8b9d
|
||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||
F src/loadext.c 0aa9e7f08e168e3874cb54984408e3976dafdf5616d511952c425b5ac088ea3e
|
||||
F src/main.c b9e0b9ac6540f371d9284ea8275a7e6c1b652229efafac74be3e173f4cf16bf9
|
||||
F src/main.c 819f1e56cb8fc8d2d58cd5bbdbf60da0c48065a96a0d06617a5e5723ae2ddd05
|
||||
F src/malloc.c ef796bcc0e81d845d59a469f1cf235056caf9024172fd524e32136e65593647b
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c c12a42539b1ba105e3707d0e628ad70e611040d8f5e38cf942cee30c867083de
|
||||
@ -549,7 +549,7 @@ F src/printf.c 5901672228f305f7d493cbc4e7d76a61a5caecdbc1cd06b1f9ec42ea4265cf8d
|
||||
F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c
|
||||
F src/resolve.c b9e60afa56d0484ee573aba54d9e73603736236df33d2ae3421b4cd0367d907d
|
||||
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
|
||||
F src/select.c c4f14e9aaa2f7c821be721f79ee578a82d4efeef5797f9673feb82750582ae80
|
||||
F src/select.c c49365e313d8b5338665d21139a07d2481c0340a2daf2f56fab1d8d526c1182e
|
||||
F src/shell.c.in ac685e63c506fb2e39375c83347c88bff84dc48fa5d6a59f508d7d67951693a0
|
||||
F src/sqlite.h.in 4e977a5e2ed1a9e8987ff65a2cab5f99a4298ebf040ea5ff636e1753339ff45a
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
@ -621,13 +621,13 @@ F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937
|
||||
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
|
||||
F src/util.c 3f27a1eae01c8bbbb8cdef2f26bd8e6a2a7db08106ef7c3dcc990787a5da6e86
|
||||
F src/vacuum.c 454973a59fb20bb982efc2df568a098616db6328a0491b6e84e2e07f7333db45
|
||||
F src/vdbe.c f2a83da75711ee42b8986600ba870c71f57b49325d9b196c2097950871846983
|
||||
F src/vdbe.c e4ed1897b74a25989b17a27f7e4a9ee22d40a7ba2fddebca047ca5cc59d9676b
|
||||
F src/vdbe.h 25dabb25c7e157b84e59260cfb5b466c3ac103ede9f36f4db371332c47601abe
|
||||
F src/vdbeInt.h 38206c8dd6b60ff03d9fd4f626b1b4fd0eef7cdc44f2fc2c1973b0f932a3f26b
|
||||
F src/vdbeapi.c aa5aaf2c37676b83af5724c6cd8207a3064ed46a217fd180957f75ac84f7a2a5
|
||||
F src/vdbeaux.c 2f2f9b1c2b1d441ff5b34a6fb0874ecd7de0e34049a584bd9fb6c651846fd098
|
||||
F src/vdbeaux.c e7d3d85ac3c64522f5077b18c6f7ae725026727f74d852fef416180060275b15
|
||||
F src/vdbeblob.c 60a7694760e35b2bba166cf49eb6a1eb0b31581102b49de78008ca3032406065
|
||||
F src/vdbemem.c 0e830c2aab24241eed85bd4c8a5bd8c9b959081316477440bfffb35089ba7d0b
|
||||
F src/vdbemem.c f4dcedec564688c957c7ac27c5e90a884dd5499cf37eb7cc50e33853e5313c97
|
||||
F src/vdbesort.c cd5130f683706c1a43e165a74187745fb3351cb56052cf9dc91de820634bbde2
|
||||
F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf823
|
||||
F src/vdbevtab.c f99b275366c5fc5e2d99f734729880994ab9500bdafde7fae3b02d562b9d323c
|
||||
@ -638,7 +638,7 @@ F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
|
||||
F src/walker.c 7342becedf3f8a26f9817f08436bdf8b56ad69af83705f6b9320a0ad3092c2ac
|
||||
F src/where.c 5d669d7c31f53d18a413eed69899f11d6e92a400a7c982d90eb6d8d301c73afb
|
||||
F src/whereInt.h 9248161dd004f625ce5d3841ca9b99fed3fc8d61522cf76340fc5217dbe1375b
|
||||
F src/wherecode.c 0208553a0602146b5640747c0e3f7a8c785108c2d06a160b69f23491e9dc781e
|
||||
F src/wherecode.c af9bc0608f07f6582affb0e4f30f95815cca080feb5359c2acc4558b48500604
|
||||
F src/whereexpr.c e5fdac355deef93a821f03b90770f92f2be833e92bbdeff8ac1b6c2ae1f74356
|
||||
F src/window.c f27e34e896f84e0bedec32b027d4531f224971ce3e16f8e1d97a968875ddcec1
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
@ -1929,8 +1929,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 f2f279b2cc1c8b3b162058c33956be4037cd519715ac0c4290f10c58d2528f0a 15bbdf9ac840a220f384411d3025ef22f949d310194b60bca8e6d6a759e6042e
|
||||
R e4fec384b9b81dd75f2f9dbefbf1c470
|
||||
T +closed 15bbdf9ac840a220f384411d3025ef22f949d310194b60bca8e6d6a759e6042e
|
||||
P 5da112c02f9e8d0bcbed8bcf6bab9c227607a802e85c8f70b1ca628d24960dee
|
||||
R ed158196d4eb2672db00add61a3b4690
|
||||
U drh
|
||||
Z c20af47dd06bfe213e39442e78aafbf5
|
||||
Z 3cde4d92fbbfe00106b388617e0f0f8e
|
||||
|
@ -1 +1 @@
|
||||
5da112c02f9e8d0bcbed8bcf6bab9c227607a802e85c8f70b1ca628d24960dee
|
||||
32f33f356931242b59c01b5df7e180941231e3d9c91577ad33aa4a01e9d59092
|
@ -346,9 +346,9 @@ static void codeAttach(
|
||||
sName.pParse = pParse;
|
||||
|
||||
if(
|
||||
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
|
||||
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
|
||||
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))
|
||||
SQLITE_OK!=resolveAttachExpr(&sName, pFilename) ||
|
||||
SQLITE_OK!=resolveAttachExpr(&sName, pDbname) ||
|
||||
SQLITE_OK!=resolveAttachExpr(&sName, pKey)
|
||||
){
|
||||
goto attach_end;
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ int sqlite3BitvecBuiltinTest(int sz, int *aOp){
|
||||
sqlite3BitvecClear(0, 1, pTmpSpace);
|
||||
|
||||
/* Run the program */
|
||||
pc = 0;
|
||||
pc = i = 0;
|
||||
while( (op = aOp[pc])!=0 ){
|
||||
switch( op ){
|
||||
case 1:
|
||||
|
@ -3095,7 +3095,6 @@ static int lockBtree(BtShared *pBt){
|
||||
MemPage *pPage1; /* Page 1 of the database file */
|
||||
u32 nPage; /* Number of pages in the database */
|
||||
u32 nPageFile = 0; /* Number of pages in the database file */
|
||||
u32 nPageHeader; /* Number of pages in the database according to hdr */
|
||||
|
||||
assert( sqlite3_mutex_held(pBt->mutex) );
|
||||
assert( pBt->pPage1==0 );
|
||||
@ -3107,7 +3106,7 @@ static int lockBtree(BtShared *pBt){
|
||||
/* Do some checking to help insure the file we opened really is
|
||||
** a valid database file.
|
||||
*/
|
||||
nPage = nPageHeader = get4byte(28+(u8*)pPage1->aData);
|
||||
nPage = get4byte(28+(u8*)pPage1->aData);
|
||||
sqlite3PagerPagecount(pBt->pPager, (int*)&nPageFile);
|
||||
if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){
|
||||
nPage = nPageFile;
|
||||
@ -7687,11 +7686,10 @@ static int balance_nonroot(
|
||||
Pgno aPgno[NB+2]; /* Page numbers of new pages before shuffling */
|
||||
Pgno aPgOrder[NB+2]; /* Copy of aPgno[] used for sorting pages */
|
||||
u16 aPgFlags[NB+2]; /* flags field of new pages before shuffling */
|
||||
CellArray b; /* Parsed information on cells being balanced */
|
||||
CellArray b; /* Parsed information on cells being balanced */
|
||||
|
||||
memset(abDone, 0, sizeof(abDone));
|
||||
b.nCell = 0;
|
||||
b.apCell = 0;
|
||||
memset(&b, 0, sizeof(b));
|
||||
pBt = pParent->pBt;
|
||||
assert( sqlite3_mutex_held(pBt->mutex) );
|
||||
assert( sqlite3PagerIswriteable(pParent->pDbPage) );
|
||||
|
@ -4399,7 +4399,7 @@ expr_code_doover:
|
||||
sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ);
|
||||
}
|
||||
#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC
|
||||
if( pDef->funcFlags & SQLITE_FUNC_OFFSET ){
|
||||
if( (pDef->funcFlags & SQLITE_FUNC_OFFSET)!=0 && ALWAYS(pFarg!=0) ){
|
||||
Expr *pArg = pFarg->a[0].pExpr;
|
||||
if( pArg->op==TK_COLUMN ){
|
||||
sqlite3VdbeAddOp3(v, OP_Offset, pArg->iTable, pArg->iColumn, target);
|
||||
|
@ -1819,7 +1819,6 @@ int sqlite3CreateFunc(
|
||||
FuncDestructor *pDestructor
|
||||
){
|
||||
FuncDef *p;
|
||||
int nName;
|
||||
int extraFlags;
|
||||
|
||||
assert( sqlite3_mutex_held(db->mutex) );
|
||||
@ -1829,7 +1828,7 @@ int sqlite3CreateFunc(
|
||||
|| ((xFinal==0)!=(xStep==0)) /* Both or neither of xFinal and xStep */
|
||||
|| ((xValue==0)!=(xInverse==0)) /* Both or neither of xValue, xInverse */
|
||||
|| (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG)
|
||||
|| (255<(nName = sqlite3Strlen30( zFunctionName)))
|
||||
|| (255<sqlite3Strlen30(zFunctionName))
|
||||
){
|
||||
return SQLITE_MISUSE_BKPT;
|
||||
}
|
||||
|
@ -2362,7 +2362,7 @@ static CollSeq *multiSelectCollSeq(Parse *pParse, Select *p, int iCol){
|
||||
*/
|
||||
static KeyInfo *multiSelectOrderByKeyInfo(Parse *pParse, Select *p, int nExtra){
|
||||
ExprList *pOrderBy = p->pOrderBy;
|
||||
int nOrderBy = p->pOrderBy->nExpr;
|
||||
int nOrderBy = ALWAYS(pOrderBy!=0) ? pOrderBy->nExpr : 0;
|
||||
sqlite3 *db = pParse->db;
|
||||
KeyInfo *pRet = sqlite3KeyInfoAlloc(db, nOrderBy+nExtra, 1);
|
||||
if( pRet ){
|
||||
@ -3335,6 +3335,7 @@ static int multiSelectOrderBy(
|
||||
for(i=1; db->mallocFailed==0 && i<=p->pEList->nExpr; i++){
|
||||
struct ExprList_item *pItem;
|
||||
for(j=0, pItem=pOrderBy->a; j<nOrderBy; j++, pItem++){
|
||||
assert( pItem!=0 );
|
||||
assert( pItem->u.x.iOrderByCol>0 );
|
||||
if( pItem->u.x.iOrderByCol==i ) break;
|
||||
}
|
||||
@ -3361,6 +3362,7 @@ static int multiSelectOrderBy(
|
||||
struct ExprList_item *pItem;
|
||||
aPermute[0] = nOrderBy;
|
||||
for(i=1, pItem=pOrderBy->a; i<=nOrderBy; i++, pItem++){
|
||||
assert( pItem!=0 );
|
||||
assert( pItem->u.x.iOrderByCol>0 );
|
||||
assert( pItem->u.x.iOrderByCol<=p->pEList->nExpr );
|
||||
aPermute[i] = pItem->u.x.iOrderByCol - 1;
|
||||
|
@ -5456,7 +5456,7 @@ case OP_Delete: {
|
||||
/* Invoke the update-hook if required. */
|
||||
if( opflags & OPFLAG_NCHANGE ){
|
||||
p->nChange++;
|
||||
if( db->xUpdateCallback && HasRowid(pTab) ){
|
||||
if( db->xUpdateCallback && ALWAYS(pTab!=0) && HasRowid(pTab) ){
|
||||
db->xUpdateCallback(db->pUpdateArg, SQLITE_DELETE, zDb, pTab->zName,
|
||||
pC->movetoTarget);
|
||||
assert( pC->iDb>=0 );
|
||||
|
@ -1487,7 +1487,7 @@ char *sqlite3VdbeDisplayComment(
|
||||
if( zOpName[nOpName+1] ){
|
||||
int seenCom = 0;
|
||||
char c;
|
||||
zSynopsis = zOpName += nOpName + 1;
|
||||
zSynopsis = zOpName + nOpName + 1;
|
||||
if( strncmp(zSynopsis,"IF ",3)==0 ){
|
||||
sqlite3_snprintf(sizeof(zAlt), zAlt, "if %s goto P2", zSynopsis+3);
|
||||
zSynopsis = zAlt;
|
||||
|
@ -200,6 +200,7 @@ int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
|
||||
#ifndef SQLITE_OMIT_UTF16
|
||||
int rc;
|
||||
#endif
|
||||
assert( pMem!=0 );
|
||||
assert( !sqlite3VdbeMemIsRowSet(pMem) );
|
||||
assert( desiredEnc==SQLITE_UTF8 || desiredEnc==SQLITE_UTF16LE
|
||||
|| desiredEnc==SQLITE_UTF16BE );
|
||||
@ -332,6 +333,7 @@ static SQLITE_NOINLINE int vdbeMemAddTerminator(Mem *pMem){
|
||||
** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
|
||||
*/
|
||||
int sqlite3VdbeMemMakeWriteable(Mem *pMem){
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
assert( !sqlite3VdbeMemIsRowSet(pMem) );
|
||||
if( (pMem->flags & (MEM_Str|MEM_Blob))!=0 ){
|
||||
@ -356,6 +358,7 @@ int sqlite3VdbeMemMakeWriteable(Mem *pMem){
|
||||
#ifndef SQLITE_OMIT_INCRBLOB
|
||||
int sqlite3VdbeMemExpandBlob(Mem *pMem){
|
||||
int nByte;
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->flags & MEM_Zero );
|
||||
assert( (pMem->flags&MEM_Blob)!=0 || MemNullNochng(pMem) );
|
||||
testcase( sqlite3_value_nochange(pMem) );
|
||||
@ -383,6 +386,7 @@ int sqlite3VdbeMemExpandBlob(Mem *pMem){
|
||||
** Make sure the given Mem is \u0000 terminated.
|
||||
*/
|
||||
int sqlite3VdbeMemNulTerminate(Mem *pMem){
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
testcase( (pMem->flags & (MEM_Term|MEM_Str))==(MEM_Term|MEM_Str) );
|
||||
testcase( (pMem->flags & (MEM_Term|MEM_Str))==0 );
|
||||
@ -410,6 +414,7 @@ int sqlite3VdbeMemNulTerminate(Mem *pMem){
|
||||
int sqlite3VdbeMemStringify(Mem *pMem, u8 enc, u8 bForce){
|
||||
const int nByte = 32;
|
||||
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
assert( !(pMem->flags&MEM_Zero) );
|
||||
assert( !(pMem->flags&(MEM_Str|MEM_Blob)) );
|
||||
@ -445,6 +450,7 @@ int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
|
||||
sqlite3_context ctx;
|
||||
Mem t;
|
||||
assert( pFunc!=0 );
|
||||
assert( pMem!=0 );
|
||||
assert( pFunc->xFinalize!=0 );
|
||||
assert( (pMem->flags & MEM_Null)!=0 || pFunc==pMem->u.pDef );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
@ -595,6 +601,7 @@ static SQLITE_NOINLINE i64 memIntValue(Mem *pMem){
|
||||
}
|
||||
i64 sqlite3VdbeIntValue(Mem *pMem){
|
||||
int flags;
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
assert( EIGHT_BYTE_ALIGNMENT(pMem) );
|
||||
flags = pMem->flags;
|
||||
@ -623,6 +630,7 @@ static SQLITE_NOINLINE double memRealValue(Mem *pMem){
|
||||
return val;
|
||||
}
|
||||
double sqlite3VdbeRealValue(Mem *pMem){
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
assert( EIGHT_BYTE_ALIGNMENT(pMem) );
|
||||
if( pMem->flags & MEM_Real ){
|
||||
@ -655,6 +663,7 @@ int sqlite3VdbeBooleanValue(Mem *pMem, int ifNull){
|
||||
*/
|
||||
void sqlite3VdbeIntegerAffinity(Mem *pMem){
|
||||
i64 ix;
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->flags & MEM_Real );
|
||||
assert( !sqlite3VdbeMemIsRowSet(pMem) );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
@ -682,6 +691,7 @@ void sqlite3VdbeIntegerAffinity(Mem *pMem){
|
||||
** Convert pMem to type integer. Invalidate any prior representations.
|
||||
*/
|
||||
int sqlite3VdbeMemIntegerify(Mem *pMem){
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
assert( !sqlite3VdbeMemIsRowSet(pMem) );
|
||||
assert( EIGHT_BYTE_ALIGNMENT(pMem) );
|
||||
@ -696,6 +706,7 @@ int sqlite3VdbeMemIntegerify(Mem *pMem){
|
||||
** Invalidate any prior representations.
|
||||
*/
|
||||
int sqlite3VdbeMemRealify(Mem *pMem){
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
assert( EIGHT_BYTE_ALIGNMENT(pMem) );
|
||||
|
||||
@ -729,6 +740,7 @@ int sqlite3RealSameAsInt(double r1, sqlite3_int64 i){
|
||||
** as much of the string as we can and ignore the rest.
|
||||
*/
|
||||
int sqlite3VdbeMemNumerify(Mem *pMem){
|
||||
assert( pMem!=0 );
|
||||
testcase( pMem->flags & MEM_Int );
|
||||
testcase( pMem->flags & MEM_Real );
|
||||
testcase( pMem->flags & MEM_IntReal );
|
||||
@ -1080,6 +1092,7 @@ int sqlite3VdbeMemSetStr(
|
||||
int iLimit; /* Maximum allowed string or blob size */
|
||||
u16 flags = 0; /* New value for pMem->flags */
|
||||
|
||||
assert( pMem!=0 );
|
||||
assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
|
||||
assert( !sqlite3VdbeMemIsRowSet(pMem) );
|
||||
|
||||
|
@ -1234,7 +1234,7 @@ static void whereIndexExprTrans(
|
||||
for(iIdxCol=0; iIdxCol<pIdx->nColumn; iIdxCol++){
|
||||
i16 iRef = pIdx->aiColumn[iIdxCol];
|
||||
if( iRef==XN_EXPR ){
|
||||
assert( aColExpr->a[iIdxCol].pExpr!=0 );
|
||||
assert( aColExpr!=0 && aColExpr->a[iIdxCol].pExpr!=0 );
|
||||
x.pIdxExpr = aColExpr->a[iIdxCol].pExpr;
|
||||
if( sqlite3ExprIsConstant(x.pIdxExpr) ) continue;
|
||||
w.xExprCallback = whereIndexExprTransNode;
|
||||
|
Loading…
x
Reference in New Issue
Block a user