1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Do not allow SQLITE_LIMIT_LENGTH to be set lower than 1 as an

SQLITE_LIMIT_LENGTH of 0 causes lots of unnecessary problems for
users of the sqlite3_str object.

FossilOrigin-Name: 8fd5b8ec4ab9b5554d27f25a4638d56e347eab78b60900f24b15a815d3731330
This commit is contained in:
drh
2021-12-06 15:40:24 +00:00
parent 38ed1ceb5a
commit f6a4ef144e
3 changed files with 9 additions and 7 deletions

View File

@@ -2857,6 +2857,8 @@ int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
if( newLimit>=0 ){ /* IMP: R-52476-28732 */
if( newLimit>aHardLimit[limitId] ){
newLimit = aHardLimit[limitId]; /* IMP: R-51463-25634 */
}else if( newLimit<1 && limitId==SQLITE_LIMIT_LENGTH ){
newLimit = 1;
}
db->aLimit[limitId] = newLimit;
}