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

Evaluate expressions only once when the same expression is used in both the

result set and in the ORDER BY clause.

FossilOrigin-Name: c2f3bbad778504681b39ab9399a1eb3c1a35ab3f
This commit is contained in:
drh
2015-08-26 14:01:41 +00:00
parent 0576bc59a7
commit 5579d59fb3
8 changed files with 93 additions and 26 deletions

View File

@@ -432,7 +432,13 @@ void sqlite3TreeViewExprList(
}else{
sqlite3TreeViewLine(pView, "%s", zLabel);
for(i=0; i<pList->nExpr; i++){
int j = pList->a[i].u.x.iOrderByCol;
if( j ){
sqlite3TreeViewPush(pView, 0);
sqlite3TreeViewLine(pView, "iOrderByCol=%d", j);
}
sqlite3TreeViewExpr(pView, pList->a[i].pExpr, i<pList->nExpr-1);
if( j ) sqlite3TreeViewPop(pView);
}
}
sqlite3TreeViewPop(pView);