1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Make sure the min() and max() optimizations work on empty indexed tables.

Ticket #296. (CVS 914)

FossilOrigin-Name: 98ef6110068e5ed3cd77a14b004f890b79b731f7
This commit is contained in:
drh
2003-04-17 12:44:23 +00:00
parent 8396566204
commit d4d595f94c
6 changed files with 74 additions and 19 deletions

View File

@@ -36,7 +36,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.217 2003/04/16 21:03:14 drh Exp $
** $Id: vdbe.c,v 1.218 2003/04/17 12:44:25 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -4505,10 +4505,14 @@ case OP_IdxRecno: {
int v;
int sz;
sqliteBtreeKeySize(pCrsr, &sz);
sqliteBtreeKey(pCrsr, sz - sizeof(u32), sizeof(u32), (char*)&v);
v = keyToInt(v);
aStack[tos].i = v;
aStack[tos].flags = STK_Int;
if( sz<sizeof(u32) ){
aStack[tos].flags = STK_Null;
}else{
sqliteBtreeKey(pCrsr, sz - sizeof(u32), sizeof(u32), (char*)&v);
v = keyToInt(v);
aStack[tos].i = v;
aStack[tos].flags = STK_Int;
}
}
break;
}