From acd4c695801d38b048c05a14e3841028d89aa992 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 7 Mar 2002 02:02:51 +0000 Subject: [PATCH] Fix a bug in the sorting of compound selects. (CVS 423) FossilOrigin-Name: 0a51323561b7235d46621d9fa25c7111b81c528f --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/select.c | 9 +++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 3410682fb0..d8678cb7f7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Beta\s2\s(CVS\s422) -D 2002-03-06T22:04:21 +C Fix\sa\sbug\sin\sthe\ssorting\sof\scompound\sselects.\s(CVS\s423) +D 2002-03-07T02:02:51 F Makefile.in 50f1b3351df109b5774771350d8c1b8d3640130d F Makefile.template 89e373b2dad0321df00400fa968dc14b61a03296 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0 @@ -37,7 +37,7 @@ F src/pager.h 6fddfddd3b73aa8abc081b973886320e3c614f0e F src/parse.y f7483ccff7b8f16d3655df59775d85b62b06897e F src/printf.c 300a90554345751f26e1fc0c0333b90a66110a1d F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe -F src/select.c 49c78aa0c96dda036846937b516658536db98b56 +F src/select.c 1288243cacdee338ee49e3e30fcda1a701a0c8c8 F src/shell.c b3454229599246b944cdb5b95753af3fca5d8bb0 F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e F src/sqlite.h.in a9b5772604265f98f3120573ef29e37b9d917216 @@ -130,7 +130,7 @@ F www/speed.tcl 83457b2bf6bb430900bd48ca3dd98264d9a916a5 F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279 F www/tclsqlite.tcl 829b393d1ab187fd7a5e978631b3429318885c49 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 -P 161c0c5f5db66815e4345c9b5f7a600c03a67475 -R 3e03ae5c01680d33425f0072c8b68c25 +P 6c3fb5470ea94bfc99833ff1c78981262c9165eb +R a428e07eeafc44ccfa53fd5fc16636e0 U drh -Z 96d5d728f7e04cc6a1fbcba0b35bb16e +Z dfcc0ce535d59118c84662d1f3390a20 diff --git a/manifest.uuid b/manifest.uuid index 23bce36c11..3671c86de0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6c3fb5470ea94bfc99833ff1c78981262c9165eb \ No newline at end of file +0a51323561b7235d46621d9fa25c7111b81c528f \ No newline at end of file diff --git a/src/select.c b/src/select.c index 280d99ebc8..c82443faa7 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.74 2002/03/03 18:59:41 drh Exp $ +** $Id: select.c,v 1.75 2002/03/07 02:02:51 drh Exp $ */ #include "sqliteInt.h" @@ -1196,8 +1196,7 @@ int sqliteSelect( /* ORDER BY is ignored if we are not sending the result to a callback. */ if( eDest!=SRT_Callback ){ - sqliteExprListDelete(p->pOrderBy); - pOrderBy = p->pOrderBy = 0; + pOrderBy = 0; } /* At this point, we should have allocated all the cursors that we @@ -1291,7 +1290,9 @@ int sqliteSelect( p, i, &isAgg); pTabList = p->pSrc; pWhere = p->pWhere; - pOrderBy = p->pOrderBy; + if( eDest==SRT_Callback ){ + pOrderBy = p->pOrderBy; + } pGroupBy = p->pGroupBy; pHaving = p->pHaving; isDistinct = p->isDistinct; -- 2.47.3