1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Fix a problem with ORDER BY and compound SELECT queries. (CVS 3995)

FossilOrigin-Name: af76928fc5891f9a222ac0c39f8b443a9707b9e3
This commit is contained in:
danielk1977
2007-05-14 16:50:48 +00:00
parent fa2bb6da24
commit a670b22641
4 changed files with 22 additions and 11 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.347 2007/05/14 15:49:44 danielk1977 Exp $
** $Id: select.c,v 1.348 2007/05/14 16:50:49 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -2000,7 +2000,7 @@ static int multiSelect(
assert( p->pRightmost==p );
assert( p->addrOpenEphm[2]>=0 );
addr = p->addrOpenEphm[2];
sqlite3VdbeChangeP2(v, addr, p->pEList->nExpr+2);
sqlite3VdbeChangeP2(v, addr, p->pOrderBy->nExpr+2);
pKeyInfo->nField = nOrderByExpr;
sqlite3VdbeChangeP3(v, addr, (char*)pKeyInfo, P3_KEYINFO_HANDOFF);
pKeyInfo = 0;