Merge "Throw clear error if a row doesn't fit into CursorWindow"
This commit is contained in:
committed by
Android (Google) Code Review
commit
a5da2cf57d
@@ -765,6 +765,14 @@ static jlong nativeExecuteForCursorWindow(JNIEnv* env, jclass clazz,
|
||||
if (startPos > totalRows) {
|
||||
ALOGE("startPos %d > actual rows %d", startPos, totalRows);
|
||||
}
|
||||
if (totalRows > 0 && addedRows == 0) {
|
||||
String8 msg;
|
||||
msg.appendFormat("Row too big to fit into CursorWindow requiredPos=%d, totalRows=%d",
|
||||
requiredPos, totalRows);
|
||||
throw_sqlite3_exception(env, SQLITE_TOOBIG, NULL, msg.string());
|
||||
return 0;
|
||||
}
|
||||
|
||||
jlong result = jlong(startPos) << 32 | jlong(totalRows);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user