aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-03-23 00:31:29 +0000
committerdrh <drh@noemail.net>2002-03-23 00:31:29 +0000
commit1cc3d75f69c12c8bb3a82670b5c6d2d432d3ef6c (patch)
tree262e38af6fa17f5defbcc1d727068a31f6065270 /src
parent545c23dc4235f22549bf714658dc39f5ad1e5630 (diff)
downloadsqlite-1cc3d75f69c12c8bb3a82670b5c6d2d432d3ef6c.tar.gz
sqlite-1cc3d75f69c12c8bb3a82670b5c6d2d432d3ef6c.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/select.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c
index 41e5da555..d7f88f701 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.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;