Bug 1254797 - Post: Ensure we ignore deleted sites in pinned query r=rnewman

Pinned sites should be deleted directly, however I'm not confident enough
in my knowledge of sync to be certain that we won't end up with deleted
pinned sites in our table.

(We use normal bookmark deletion for removing pinned sites.)

MozReview-Commit-ID: SSLDkSXWlI
This commit is contained in:
Andrzej Hunt 2016-03-15 14:44:13 -07:00
Родитель 1916a1090c
Коммит 2304a9088e
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -713,7 +713,9 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
suggestedGridLimit = Integer.parseInt(gridLimitParam, 10);
}
final String pinnedSitesFromClause = "FROM " + TABLE_BOOKMARKS + " WHERE " + Bookmarks.PARENT + " == " + Bookmarks.FIXED_PINNED_LIST_ID;
final String pinnedSitesFromClause = "FROM " + TABLE_BOOKMARKS + " WHERE " +
Bookmarks.PARENT + " == " + Bookmarks.FIXED_PINNED_LIST_ID +
" AND " + Bookmarks.IS_DELETED + " IS NOT 1";
// Ideally we'd use a recursive CTE to generate our sequence, e.g. something like this worked at one point:
// " WITH RECURSIVE" +
@ -925,8 +927,7 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
Bookmarks.POSITION + ", " +
"NULL AS " + Combined.HISTORY_ID + ", " +
TopSites.TYPE_PINNED + " as " + TopSites.TYPE +
" FROM " + TABLE_BOOKMARKS +
" WHERE " + Bookmarks.PARENT + " == " + Bookmarks.FIXED_PINNED_LIST_ID +
" " + pinnedSitesFromClause +
" ORDER BY " + Bookmarks.POSITION,