Improved AggInfo.aCol debugging output, intended to debug a problem with

LEFT JOIN flattening into an aggregate query with GROUP BY.

FossilOrigin-Name: e717e029bde4ee68b6ea77a68721c02ddb6e296f1d310a368137ea3c4164f68c
This commit is contained in:
drh 2022-07-26 14:37:04 +00:00
parent e6710e83fc
commit f4c291275b
4 changed files with 19 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C Add\sa\sOOM\sterm\sto\sa\ssingle\sassert()\sstatement.
D 2022-07-26T10:16:25.603
C Improved\sAggInfo.aCol\sdebugging\soutput,\sintended\sto\sdebug\sa\sproblem\swith\nLEFT\sJOIN\sflattening\sinto\san\saggregate\squery\swith\sGROUP\sBY.
D 2022-07-26T14:37:04.119
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -521,7 +521,7 @@ F src/date.c 272162554168e7af4976213850e1c4c5f33b964d299ceb0983f3d5cceba01d05
F src/dbpage.c 5808e91bc27fa3981b028000f8fadfdc10ce9e59a34ce7dc4e035a69be3906ec
F src/dbstat.c 861e08690fcb0f2ee1165eff0060ea8d4f3e2ea10f80dab7d32ad70443a6ff2d
F src/delete.c 13eca2beee5b758ed033a11230971310cc4a58fcd8f6bc33cad4f677c985e96c
F src/expr.c 1565349664995e930cc11217cc665875d8d3d3cae62c92805a67ab582befc92a
F src/expr.c ed5f44ba634193eaa9c603da52ab45a3acd3f23abf786ea0aff69a64da52d20f
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c d965ede15d8360c09ed59348940649ee647b192e784466837d7aefa836d1d91e
F src/func.c 8f72e88cccdee22185133c10f96ccd61dc34c5ea4b1fa9a73c237ef59b2e64f1
@ -570,7 +570,7 @@ F src/printf.c e99ee9741e79ae3873458146f59644276657340385ade4e76a5f5d1c25793764
F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c
F src/resolve.c efea4e5fbecfd6d0a9071b0be0d952620991673391b6ffaaf4c277b0bb674633
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
F src/select.c 2219591ff134d612e2e3e9d401665634bac45956f2c12100280c04efb0d99bb8
F src/select.c 7d385fbf6ba7f386f24d31ba6c508613131680ff4244b75046278a7ac85819c6
F src/shell.c.in 29749b34bbd19d0004fdb6f61f62659096e1c0b4dfb1ad2314e7fafbe9dd8d37
F src/sqlite.h.in be265991edca9aea69986758b58ba81cbf5ae403fe0c4ea1d0c9df0cdc8f25ed
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
@ -1981,8 +1981,11 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P f48bd8f85d86fd93329dda7ba57f468854a732b89e4126e9c5beec3495d24b31
R e7b7ace3206c3ff792140e3157349b46
P 217fc3ebd423e050508d6af97e0664f301824ef9a997ed2d302c006a41227917
R 05b53d25dc1ad05451162b3588f8e8f6
T *branch * flatten-left-join
T *sym-flatten-left-join *
T -sym-trunk *
U drh
Z f1efcdf9820c3825f4f57a8fb233e014
Z 41b04475f9d85a45d0a38cd9eef9070b
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
217fc3ebd423e050508d6af97e0664f301824ef9a997ed2d302c006a41227917
e717e029bde4ee68b6ea77a68721c02ddb6e296f1d310a368137ea3c4164f68c

View File

@ -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 ){

View File

@ -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++){