aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/select.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/select.c b/src/select.c
index 49d179cf2..f22527585 100644
--- a/src/select.c
+++ b/src/select.c
@@ -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.408 2008/01/23 15:44:51 danielk1977 Exp $
+** $Id: select.c,v 1.409 2008/01/23 17:13:41 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -1676,15 +1676,15 @@ static int processCompoundOrderBy(
while( pSelect && moreToDo ){
moreToDo = 0;
for(i=0; i<pOrderBy->nExpr; i++){
- int iCol;
+ int iCol = -1;
Expr *pE, *pDup;
if( pOrderBy->a[i].done ) continue;
pE = pOrderBy->a[i].pExpr;
pDup = sqlite3ExprDup(db, pE);
- if( pDup==0 ){
- return 1;
+ if( !db->mallocFailed ){
+ assert(pDup);
+ iCol = matchOrderByTermToExprList(pParse, pSelect, pDup, i+1, 1, 0);
}
- iCol = matchOrderByTermToExprList(pParse, pSelect, pDup, i+1, 1, 0);
sqlite3ExprDelete(pDup);
if( iCol<0 ){
return 1;