mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
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
This commit is contained in:
10
src/select.c
10
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);
|
||||
|
Reference in New Issue
Block a user