diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 4 | ||||
-rw-r--r-- | src/test1.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c index 2a63dfcae..3c1a4e905 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.431 2008/04/03 16:28:25 danielk1977 Exp $ +** $Id: main.c,v 1.432 2008/04/15 02:36:34 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -1006,7 +1006,7 @@ static const int aHardLimit[] = { */ int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ int oldLimit; - if( limitId<0 || limitId>SQLITE_N_LIMIT ){ + if( limitId<0 || limitId>=SQLITE_N_LIMIT ){ return -1; } oldLimit = db->aLimit[limitId]; diff --git a/src/test1.c b/src/test1.c index 9c0af0244..09199ffe9 100644 --- a/src/test1.c +++ b/src/test1.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test1.c,v 1.297 2008/04/08 03:07:55 mlcreech Exp $ +** $Id: test1.c,v 1.298 2008/04/15 02:36:34 drh Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -4361,6 +4361,10 @@ static int test_limit( { "SQLITE_LIMIT_ATTACHED", SQLITE_LIMIT_ATTACHED }, { "SQLITE_LIMIT_LIKE_PATTERN_LENGTH", SQLITE_LIMIT_LIKE_PATTERN_LENGTH }, { "SQLITE_LIMIT_VARIABLE_NUMBER", SQLITE_LIMIT_VARIABLE_NUMBER }, + + /* Out of range test cases */ + { "SQLITE_LIMIT_TOOSMALL", -1, }, + { "SQLITE_LIMIT_TOOBIG", SQLITE_LIMIT_VARIABLE_NUMBER+1 }, }; int i, id; int val; |