Bug 1252501 - Approach 2: use the entire numbers table instead of limiting it to the grid r=rnewman draft
authorAndrzej Hunt <ahunt@mozilla.com>
Tue, 01 Mar 2016 11:13:20 -0800
changeset 335854 a30bd41264e60bd9c43eff20157a617918ca3e9c
parent 335853 7f77e9476d6f9ddc22238ac229911d32aaee2018
child 515232 013321386202c73e3314c5d5bb3a2c4d07fa0995
push id11895
push userahunt@mozilla.com
push dateTue, 01 Mar 2016 19:15:21 +0000
reviewersrnewman
bugs1252501
milestone47.0a1
Bug 1252501 - Approach 2: use the entire numbers table instead of limiting it to the grid r=rnewman MozReview-Commit-ID: 5TsMFXQF4GB
mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
--- 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") +