mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
An improved fix for the min() problem of ticket #800. (CVS 1804)
FossilOrigin-Name: b6e8b7a13cd9f90e2f7d963d9ddbe591571f3a27
This commit is contained in:
13
src/select.c
13
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.196 2004/07/18 20:52:32 drh Exp $
|
||||
** $Id: select.c,v 1.197 2004/07/18 21:33:02 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -2075,15 +2075,12 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
|
||||
sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
|
||||
sqlite3VdbeOp3(v, OP_OpenRead, base+1, pIdx->tnum,
|
||||
(char*)&pIdx->keyInfo, P3_KEYINFO);
|
||||
sqlite3VdbeAddOp(v, seekOp, base+1, 0);
|
||||
if( seekOp==OP_Rewind ){
|
||||
int addr;
|
||||
sqlite3VdbeAddOp(v, OP_SetNumColumns, base+1, pIdx->nColumn+1);
|
||||
sqlite3VdbeAddOp(v, OP_KeyAsData, base+1, 1);
|
||||
addr = sqlite3VdbeAddOp(v, OP_IdxColumn, base+1, 0);
|
||||
sqlite3VdbeAddOp(v, OP_NotNull, 1, addr+3);
|
||||
sqlite3VdbeAddOp(v, OP_Next, 1, addr);
|
||||
sqlite3VdbeAddOp(v, OP_String, 0, 0);
|
||||
sqlite3VdbeAddOp(v, OP_MakeRecord, 1, 0);
|
||||
seekOp = OP_MoveGt;
|
||||
}
|
||||
sqlite3VdbeAddOp(v, seekOp, base+1, 0);
|
||||
sqlite3VdbeAddOp(v, OP_IdxRecno, base+1, 0);
|
||||
sqlite3VdbeAddOp(v, OP_Close, base+1, 0);
|
||||
sqlite3VdbeAddOp(v, OP_MoveGe, base, 0);
|
||||
|
||||
Reference in New Issue
Block a user