aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2023-02-15 19:53:08 +0000
committerdrh <>2023-02-15 19:53:08 +0000
commit6945ba787f11eb165ec9f25c359b4c91993643a5 (patch)
treeaf627b5e98d712c526eb959a00e07a0636d65d54 /src
parente3ec00ccb8ea49dbe8c99fd5e5967dadaddd9852 (diff)
downloadsqlite-6945ba787f11eb165ec9f25c359b4c91993643a5.tar.gz
sqlite-6945ba787f11eb165ec9f25c359b4c91993643a5.zip
Fix the subquery result column NULL-ifier so that it correctly handles
subquery columns past the 63rd column. FossilOrigin-Name: 77b220a7240425fa83e142ceef78505208e6e38d797070e146b9f7d255f753c7
Diffstat (limited to 'src')
-rw-r--r--src/select.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c
index 4958ddefe..dc187dfa6 100644
--- a/src/select.c
+++ b/src/select.c
@@ -5272,8 +5272,8 @@ static int disableUnusedSubqueryResultColumns(SrcItem *pItem){
nCol = pTab->nCol;
for(j=0; j<nCol; j++){
Select *pX;
- if( (MASKBIT(j) & pItem->colUsed)!=0 ) continue;
- if( MASKBIT(j)==0 ) break;
+ Bitmask m = j<BMS-1 ? MASKBIT(j) : TOPBIT;
+ if( (m & pItem->colUsed)!=0 ) continue;
for(pX=pSub; pX; pX=pX->pPrior) {
Expr *pY = pX->pEList->a[j].pExpr;
if( pY->op==TK_NULL ) continue;