From e2188f0b0f16292391b72e081a71b29263c8f15b Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 7 May 2018 11:37:34 +0000 Subject: [PATCH] Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic. FossilOrigin-Name: 374d8e264487b0437a8d995ced1bc026a92d495a2d0568f65f033e9ebe11d0e2 --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/shell.c.in | 2 +- src/where.c | 2 +- src/whereInt.h | 4 +--- src/wherecode.c | 4 +--- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index 75de358840..5ce3d3060f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Backout\schange\s[05fee1a21ea398f1e4d6f1cf3]\sbecause\sit\sdoes\snot\stake\sinto\naccount\sthe\sLD_LIBRARY_PATH\senvironment\svariable\sused\sby\sdl_open(). -D 2018-05-07T02:50:38.426 +C Fix\sharmless\scompiler\swarnings\sassociated\swith\sthe\snew\sEXPLAIN\sQUERY\sPLAN\slogic. +D 2018-05-07T11:37:34.277 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F Makefile.in 5ce9343cba9c189046f1afe6d2bcc1f68079439febc05267b98aec6ecc752439 @@ -494,7 +494,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384 F src/resolve.c 6415381a0e9d22c0e7cba33ca4a53f81474190862f5d4838190f5eb5b0b47bc9 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac F src/select.c a35d462ee7a3c0856ad7a9d9c8921fbf3d91d911a8f39ad9d61302eb43b24a71 -F src/shell.c.in 29309f2ab656c8817fbc3b7910b9af8464557b91cba75277a03669399c8e2730 +F src/shell.c.in e41979d8bf60d3e27220bf4b4adc819254e1d24ce176089a8d14c96228efd961 F src/sqlite.h.in 469aed42e75193b7f5d88d812befa961c04746869475f96fcf434c9f67079f66 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 83a3c4ce93d650bedfd1aa558cb85a516bd6d094445ee989740827d0d944368d @@ -577,9 +577,9 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 F src/wal.c aa9cffc7a2bad6b826a86c8562dd4978398720ed41cb8ee7aa9d054eb8b456a0 F src/wal.h 8de5d2d3de0956d6f6cb48c83a4012d5f227b8fe940f3a349a4b7e85ebcb492a F src/walker.c da987a20d40145c0a03c07d8fefcb2ed363becc7680d0500d9c79915591f5b1f -F src/where.c aa94ef44ef36763817ca952e68c03db7eee5e2d4f1f0c3a98823a58c074157bd -F src/whereInt.h 2610cb87dd95509995b63decc674c60f2757697a206cfe0c085ee53d9c43cfff -F src/wherecode.c 300f945eb4552fb82ccf237b34dccb22f47522882faa9adcc04388e6e3f1d4b0 +F src/where.c d89b1aa56a75a572cd60ad27ec0fe5958d5f98b0f4391a89c72811287be7c439 +F src/whereInt.h cbae2bcd37cfebdb7812a8b188cdb19634ced2b9346470d1c270556b0c33ea53 +F src/wherecode.c 414ec42097b295febcae9c8803cf627580ad9005de1d8bc3afad3d3127f0eb86 F src/whereexpr.c e90b2e76dcabc81edff56633bf281bc01d93b71e0c81482dc06925ce39f5844a F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd @@ -1727,7 +1727,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 5d61e75f32de09c81dbe844443209f063cccb005d60b846900de5b023643fc3b -R b7e54ff139c007de5ac3db8f0e73a2f9 +P b348d1193a7a3ed4d3e656b6cc95a41f87eae29222e0723850a5eb5ffabffd00 +R d09bdc73f56d4d80e2806c4c66a4e25a U drh -Z 77e1a082dc787694600210821f90bcd3 +Z 7e3b1491b97d0e22d20f39d7466da090 diff --git a/manifest.uuid b/manifest.uuid index a119648e0b..a55df92ede 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b348d1193a7a3ed4d3e656b6cc95a41f87eae29222e0723850a5eb5ffabffd00 \ No newline at end of file +374d8e264487b0437a8d995ced1bc026a92d495a2d0568f65f033e9ebe11d0e2 \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index 7675b3832d..73db9f8e93 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -1722,7 +1722,7 @@ static void eqp_render_level(ShellState *p, int iEqpId){ pNext = eqp_next_row(p, iEqpId, pRow); z = pRow->zText; utf8_printf(p->out, "%s%s%s\n", p->sGraph.zPrefix, pNext ? "|--" : "`--", z); - if( nsGraph.zPrefix)-7 ){ + if( n<(int)sizeof(p->sGraph.zPrefix)-7 ){ memcpy(&p->sGraph.zPrefix[n], pNext ? "| " : " ", 4); eqp_render_level(p, pRow->iEqpId); p->sGraph.zPrefix[n] = 0; diff --git a/src/where.c b/src/where.c index d76d9f81e2..0965f4170f 100644 --- a/src/where.c +++ b/src/where.c @@ -4988,7 +4988,7 @@ WhereInfo *sqlite3WhereBegin( } #endif addrExplain = sqlite3WhereExplainOneScan( - pParse, pTabList, pLevel, ii, pLevel->iFrom, wctrlFlags + pParse, pTabList, pLevel, wctrlFlags ); pLevel->addrBody = sqlite3VdbeCurrentAddr(v); notReady = sqlite3WhereCodeOneLoopStart(pWInfo, ii, notReady); diff --git a/src/whereInt.h b/src/whereInt.h index 90929576e0..4b6213af31 100644 --- a/src/whereInt.h +++ b/src/whereInt.h @@ -467,12 +467,10 @@ int sqlite3WhereExplainOneScan( Parse *pParse, /* Parse context */ SrcList *pTabList, /* Table list this loop refers to */ WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */ - int iLevel, /* Value for "level" column of output */ - int iFrom, /* Value for "from" column of output */ u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */ ); #else -# define sqlite3WhereExplainOneScan(u,v,w,x,y,z) 0 +# define sqlite3WhereExplainOneScan(u,v,w,x) 0 #endif /* SQLITE_OMIT_EXPLAIN */ #ifdef SQLITE_ENABLE_STMT_SCANSTATUS void sqlite3WhereAddScanStatus( diff --git a/src/wherecode.c b/src/wherecode.c index df45bd73e5..9a0227a871 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -122,8 +122,6 @@ int sqlite3WhereExplainOneScan( Parse *pParse, /* Parse context */ SrcList *pTabList, /* Table list this loop refers to */ WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */ - int iLevel, /* Value for "level" column of output */ - int iFrom, /* Value for "from" column of output */ u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */ ){ int ret = 0; @@ -1956,7 +1954,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( if( pSubWInfo ){ WhereLoop *pSubLoop; int addrExplain = sqlite3WhereExplainOneScan( - pParse, pOrTab, &pSubWInfo->a[0], iLevel, pLevel->iFrom, 0 + pParse, pOrTab, &pSubWInfo->a[0], 0 ); sqlite3WhereAddScanStatus(v, pOrTab, &pSubWInfo->a[0], addrExplain);