more range checks for ext/sqlite3