1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Apply the correct affinity transformations when pulling values off of the

sorter index used for GROUP BY.  Ticket [e0c2ad1aa8a9c691]

FossilOrigin-Name: 101f7dea75a203f1f3aa422a607ef701eb0901ba4d5e8d1075cd350454a61956
This commit is contained in:
drh
2020-03-10 11:50:43 +00:00
parent 088489e8d9
commit 0c76e892d9
4 changed files with 20 additions and 8 deletions

View File

@@ -3791,8 +3791,12 @@ expr_code_doover:
assert( pCol->iMem>0 );
return pCol->iMem;
}else if( pAggInfo->useSortingIdx ){
Table *pTab = pCol->pTab;
sqlite3VdbeAddOp3(v, OP_Column, pAggInfo->sortingIdxPTab,
pCol->iSorterColumn, target);
if( ALWAYS(pTab) && pCol->iColumn>=0 ){
sqlite3ColumnDefault(v, pTab, pCol->iColumn, target);
}
return target;
}
/* Otherwise, fall thru into the TK_COLUMN case */