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

Fix another instance of an incorrect value for KeyInfo.nXField on a

sorting index.  Ticket [f97c4637102a3ae72b79].

FossilOrigin-Name: 0077f64510f9b9ce90032df2696cb242d097ab84
This commit is contained in:
drh
2015-01-20 03:04:29 +00:00
parent 1cc70e2358
commit fe201effbe
3 changed files with 11 additions and 9 deletions

View File

@@ -543,7 +543,9 @@ static void pushOntoSorter(
pKI = pOp->p4.pKeyInfo;
memset(pKI->aSortOrder, 0, pKI->nField); /* Makes OP_Jump below testable */
sqlite3VdbeChangeP4(v, -1, (char*)pKI, P4_KEYINFO);
pOp->p4.pKeyInfo = keyInfoFromExprList(pParse, pSort->pOrderBy, nOBSat, 1);
testcase( pKI->nXField>2 );
pOp->p4.pKeyInfo = keyInfoFromExprList(pParse, pSort->pOrderBy, nOBSat,
pKI->nXField-1);
addrJmp = sqlite3VdbeCurrentAddr(v);
sqlite3VdbeAddOp3(v, OP_Jump, addrJmp+1, 0, addrJmp+1); VdbeCoverage(v);
pSort->labelBkOut = sqlite3VdbeMakeLabel(v);