diff options
author | drh <drh@noemail.net> | 2020-06-09 11:59:15 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2020-06-09 11:59:15 +0000 |
commit | e26d428a5900bb0cbfbb4e3857ff6343e7664cfe (patch) | |
tree | 5c1ba24588e6858fb63066c0bdc108cb6b7ec0c2 /src | |
parent | 5c10930fa9df10de8bc50859cf4289bf3ddb4d97 (diff) | |
download | sqlite-e26d428a5900bb0cbfbb4e3857ff6343e7664cfe.tar.gz sqlite-e26d428a5900bb0cbfbb4e3857ff6343e7664cfe.zip |
Improved tree-view debugging output for aggregate functions.
FossilOrigin-Name: b5711b4eead10ef4b0b61f2e2c54768d215a4105f6d47d2ea78991b6e53a6831
Diffstat (limited to 'src')
-rw-r--r-- | src/select.c | 1 | ||||
-rw-r--r-- | src/sqliteInt.h | 4 | ||||
-rw-r--r-- | src/treeview.c | 3 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/select.c b/src/select.c index 9e8af0cb1..96e44225f 100644 --- a/src/select.c +++ b/src/select.c @@ -6362,6 +6362,7 @@ int sqlite3Select( } pAggInfo->pNext = pParse->pAggList; pParse->pAggList = pAggInfo; + pAggInfo->selId = p->selId; memset(&sNC, 0, sizeof(sNC)); sNC.pParse = pParse; sNC.pSrcList = pTabList; diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 0b71ef42b..0cd33baa0 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2523,9 +2523,7 @@ struct AggInfo { int iDistinct; /* Ephemeral table used to enforce DISTINCT */ } *aFunc; int nFunc; /* Number of entries in aFunc[] */ -#ifdef SQLITE_DEBUG - int iAggMagic; /* Magic number when valid */ -#endif + u32 selId; /* Select to which this AggInfo belongs */ AggInfo *pNext; /* Next in list of them all */ }; diff --git a/src/treeview.c b/src/treeview.c index 8ae06261e..187f1a07d 100644 --- a/src/treeview.c +++ b/src/treeview.c @@ -582,8 +582,9 @@ void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 moreToFollow){ #endif } if( pExpr->op==TK_AGG_FUNCTION ){ - sqlite3TreeViewLine(pView, "AGG_FUNCTION%d %Q%s iAgg=%d agg=%p", + sqlite3TreeViewLine(pView, "AGG_FUNCTION%d %Q%s agg=%d[%d]/%p", pExpr->op2, pExpr->u.zToken, zFlgs, + pExpr->pAggInfo ? pExpr->pAggInfo->selId : 0, pExpr->iAgg, pExpr->pAggInfo); }else if( pExpr->op2!=0 ){ const char *zOp2; |