Terminate loop properly when cursor window is full. DO NOT MERGE

The existing code exits the column-filling loop immediately but
may continue to try to fill rows.  Ordinarily this should fail
too but it's possible for the process to continue and then
blow up a little later.  Fixed this problem by exiting the row-
filling loop promptly.

Bug: 21406130
Change-Id: Ifab59188d5d1b40f3c1f5c97604dd48da71bf37b
(cherry picked from commit bb8c841e90)
This commit is contained in:
Jeff Brown
2015-05-29 18:48:38 -07:00
committed by Joe LaPenna
parent 06756f352d
commit eb4bd19ef0

View File

@@ -272,7 +272,7 @@ public class DatabaseUtils {
window.setStartPosition(position); window.setStartPosition(position);
window.setNumColumns(numColumns); window.setNumColumns(numColumns);
if (cursor.moveToPosition(position)) { if (cursor.moveToPosition(position)) {
do { rowloop: do {
if (!window.allocRow()) { if (!window.allocRow()) {
break; break;
} }
@@ -309,7 +309,7 @@ public class DatabaseUtils {
} }
if (!success) { if (!success) {
window.freeLastRow(); window.freeLastRow();
break; break rowloop;
} }
} }
position += 1; position += 1;