1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fix a bug in subquery generation when the subquery is a compound select.

Also added new tests to cover this case. (CVS 435)

FossilOrigin-Name: aaf7fd4cef04d3d70a0444aad1b606bfc663c3e8
This commit is contained in:
drh
2002-03-23 00:31:29 +00:00
parent 545c23dc42
commit 1cc3d75f69
7 changed files with 76 additions and 21 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.76 2002/03/14 14:33:31 drh Exp $
** $Id: select.c,v 1.77 2002/03/23 00:31:29 drh Exp $
*/
#include "sqliteInt.h"
@ -610,6 +610,13 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
v = sqliteGetVdbe(pParse);
if( v==0 ) return 1;
/* Create the destination temporary table if necessary
*/
if( eDest==SRT_TempTable ){
sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0);
eDest = SRT_Table;
}
/* Process the UNION or INTERSECTION
*/
base = pParse->nTab;