Bug 1252501 - Approach 2: use the entire numbers table instead of limiting it to the grid r=rnewman
MozReview-Commit-ID: 5TsMFXQF4GB
--- a/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
@@ -725,17 +725,17 @@ public class BrowserProvider extends Sha
" ON numbers.position > free_ids.position" +
" GROUP BY numbers.position" +
" ORDER BY numbers.position ASC" +
" LIMIT ?";
final String[] freeIDArgs = DBUtils.concatenateSelectionArgs(
pinnedSitesArgs,
pinnedSitesArgs,
- suggestedGridLimitArgs);
+ totalLimitArgs);
// Filter out: unvisited pages (history_id == -1) pinned (and other special) sites, deleted sites,
// and about: pages.
final String ignoreForTopSitesWhereClause =
"(" + Combined.HISTORY_ID + " IS NOT -1)" +
" AND " +
Combined.URL + " NOT IN (SELECT " +
Bookmarks.URL + " FROM bookmarks WHERE " +
@@ -843,17 +843,17 @@ public class BrowserProvider extends Sha
final SQLiteCursor c = (SQLiteCursor) db.rawQuery(
"SELECT " +
Bookmarks._ID + ", " +
TopSites.BOOKMARK_ID + ", " +
TopSites.HISTORY_ID + ", " +
Bookmarks.URL + ", " +
Bookmarks.TITLE + ", " +
- "COALESCE( " + Bookmarks.POSITION + ", 9999) AS " + Bookmarks.POSITION + ", " +
+ Bookmarks.POSITION + ", " +
Combined.HISTORY_ID + ", " +
TopSites.TYPE +
" FROM " + TABLE_TOPSITES +
" LEFT OUTER JOIN " + // TABLE_IDS +
"(" + freeIDSubquery + ") AS id_results" +
" ON " + DBUtils.qualifyColumn(TABLE_TOPSITES, "rowid") +
" = " + DBUtils.qualifyColumn("id_results", "rowid") +