aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2022-07-26 14:37:04 +0000
committerdrh <>2022-07-26 14:37:04 +0000
commitf4c291275b6cb345afad5feb4f8ecb88ab356e4c (patch)
treea41003ef38c720bd6e53afb9f7ea8a03c69fa1ee /src
parente6710e83fcec5678f059aec7dcd2e20aacfacbdd (diff)
downloadsqlite-f4c291275b6cb345afad5feb4f8ecb88ab356e4c.tar.gz
sqlite-f4c291275b6cb345afad5feb4f8ecb88ab356e4c.zip
Improved AggInfo.aCol debugging output, intended to debug a problem with
LEFT JOIN flattening into an aggregate query with GROUP BY. FossilOrigin-Name: e717e029bde4ee68b6ea77a68721c02ddb6e296f1d310a368137ea3c4164f68c
Diffstat (limited to 'src')
-rw-r--r--src/expr.c2
-rw-r--r--src/select.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c
index 32d655a75..5f2068d26 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -4088,7 +4088,7 @@ expr_code_doover:
pCol->iSorterColumn, target);
if( pCol->iColumn<0 ){
VdbeComment((v,"%s.rowid",pTab->zName));
- }else{
+ }else if( pTab!=0 ){
VdbeComment((v,"%s.%s",
pTab->zName, pTab->aCol[pCol->iColumn].zCnName));
if( pTab->aCol[pCol->iColumn].affinity==SQLITE_AFF_REAL ){
diff --git a/src/select.c b/src/select.c
index fe30e96ce..d9e0e8769 100644
--- a/src/select.c
+++ b/src/select.c
@@ -7418,8 +7418,13 @@ int sqlite3Select(
sqlite3TreeViewExprList(0, pMinMaxOrderBy, 0, "ORDERBY");
}
for(ii=0; ii<pAggInfo->nColumn; ii++){
- sqlite3DebugPrintf("agg-column[%d] iMem=%d\n",
- ii, pAggInfo->aCol[ii].iMem);
+ struct AggInfo_col *pCol = &pAggInfo->aCol[ii];
+ sqlite3DebugPrintf(
+ "agg-column[%d] pTab=%s iTable=%d iColumn=%d iMem=%d"
+ " iSorterColumn=%d\n",
+ ii, pCol->pTab ? pCol->pTab->zName : "NULL",
+ pCol->iTable, pCol->iColumn, pCol->iMem,
+ pCol->iSorterColumn);
sqlite3TreeViewExpr(0, pAggInfo->aCol[ii].pCExpr, 0);
}
for(ii=0; ii<pAggInfo->nFunc; ii++){