aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-04-23 17:10:18 +0000
committerdrh <drh@noemail.net>2002-04-23 17:10:18 +0000
commit41202ccae26d0684996fd06edd553d142c43322c (patch)
treeda0f6f6e197c5bd67d4b0d36f6e2876326cd47b4 /src
parent60ea3720f24e7b08a5c5e58f019e72f22597d3a3 (diff)
downloadsqlite-41202ccae26d0684996fd06edd553d142c43322c.tar.gz
sqlite-41202ccae26d0684996fd06edd553d142c43322c.zip
Fix for ticket #22: In the code generator for compound SELECT statements, take
care not to generate column name headers if the output is an intermediate table. Otherwise the column headers are not generated correctly if a compound SELECT statement appears as an expression in part of the WHERE clause. (CVS 543) FossilOrigin-Name: a06d9acdd5af0dc69b3a4d024de082631254aead
Diffstat (limited to 'src')
-rw-r--r--src/select.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/select.c b/src/select.c
index 611e50151..0f2fc609a 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.78 2002/04/04 02:10:57 drh Exp $
+** $Id: select.c,v 1.79 2002/04/23 17:10:18 drh Exp $
*/
#include "sqliteInt.h"
@@ -712,7 +712,9 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
if( eDest!=priorOp ){
int iCont, iBreak, iStart;
assert( p->pEList );
- generateColumnNames(pParse, p->base, 0, p->pEList);
+ if( eDest==SRT_Callback ){
+ generateColumnNames(pParse, p->base, 0, p->pEList);
+ }
iBreak = sqliteVdbeMakeLabel(v);
iCont = sqliteVdbeMakeLabel(v);
sqliteVdbeAddOp(v, OP_Rewind, unionTab, iBreak);
@@ -765,7 +767,9 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
** tables.
*/
assert( p->pEList );
- generateColumnNames(pParse, p->base, 0, p->pEList);
+ if( eDest==SRT_Callback ){
+ generateColumnNames(pParse, p->base, 0, p->pEList);
+ }
iBreak = sqliteVdbeMakeLabel(v);
iCont = sqliteVdbeMakeLabel(v);
sqliteVdbeAddOp(v, OP_Rewind, tab1, iBreak);