aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2004-05-18 01:23:38 +0000
committerdanielk1977 <danielk1977@noemail.net>2004-05-18 01:23:38 +0000
commitb4964b723c3642dccb530a0ca7af06213c38efd5 (patch)
treec8a55418ab180fe7d22a6a68898d350a4eaafd1f /src/select.c
parente014a83880e3064cbc202de5ff92a4059faa274c (diff)
downloadsqlite-b4964b723c3642dccb530a0ca7af06213c38efd5.tar.gz
sqlite-b4964b723c3642dccb530a0ca7af06213c38efd5.zip
Omit the '\0' at the end of UTF-8 strings on disk (it is implied). Also
don't store the number of rows at the beginning of each table record. (CVS 1390) FossilOrigin-Name: 202a470f2c1804a96e69f16709d1a92e405971f0
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c
index c4e5d1ece..ac715fa0b 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.165 2004/05/17 10:48:58 danielk1977 Exp $
+** $Id: select.c,v 1.166 2004/05/18 01:23:38 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -1313,7 +1313,9 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
/* Create the destination temporary table if necessary
*/
if( eDest==SRT_TempTable ){
+ assert( p->pEList );
sqlite3VdbeAddOp(v, OP_OpenTemp, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iParm, p->pEList->nExpr);
eDest = SRT_Table;
}
@@ -1904,6 +1906,7 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
*/
if( eDest==SRT_TempTable ){
sqlite3VdbeAddOp(v, OP_OpenTemp, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iParm, 1);
}
/* Generating code to find the min or the max. Basically all we have
@@ -1917,6 +1920,7 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
if( pSrc->a[0].pSelect==0 ){
sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0);
sqlite3VdbeOp3(v, OP_OpenRead, base, pTab->tnum, pTab->zName, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, base, pTab->nCol);
}
cont = sqlite3VdbeMakeLabel(v);
if( pIdx==0 ){
@@ -2244,6 +2248,7 @@ int sqlite3Select(
*/
if( eDest==SRT_TempTable ){
sqlite3VdbeAddOp(v, OP_OpenTemp, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iParm, pEList->nExpr);
}
/* Do an analysis of aggregate expressions.