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

Properly dequote column names in tables constructed by an aggregate SELECT.

FossilOrigin-Name: 7e0d3e9cb071873564b7916c022aba5cd9f3b8ebab9dba787ecd7113c5b7816a
This commit is contained in:
drh
2017-08-14 01:33:07 +00:00
parent 3c77a1e9f1
commit 1112cc797b
4 changed files with 29 additions and 10 deletions

View File

@@ -1710,7 +1710,9 @@ int sqlite3ColumnsFromExprList(
pColExpr = pColExpr->pRight;
assert( pColExpr!=0 );
}
if( pColExpr->op==TK_COLUMN && pColExpr->pTab!=0 ){
if( (pColExpr->op==TK_COLUMN || pColExpr->op==TK_AGG_COLUMN)
&& pColExpr->pTab!=0
){
/* For columns use the column name name */
int iCol = pColExpr->iColumn;
Table *pTab = pColExpr->pTab;