Bug 1347248 - Change "nonexistent" for null and query to use CASE WHEN r=mak

MozReview-Commit-ID: I41bOputlIq

--HG--
extra : rebase_source : ddf42e571c34313aa4dca8838dacf801fbfbfe93
This commit is contained in:
tiago 2017-03-20 02:03:02 +01:00
Родитель 46babd4690
Коммит 7070fa0cb7
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -1223,10 +1223,10 @@ function insertBookmark(item, parent) {
`INSERT INTO moz_bookmarks (fk, type, parent, position, title, `INSERT INTO moz_bookmarks (fk, type, parent, position, title,
dateAdded, lastModified, guid, dateAdded, lastModified, guid,
syncChangeCounter, syncStatus) syncChangeCounter, syncStatus)
VALUES ((SELECT id FROM moz_places WHERE url_hash = hash(:url) AND url = :url), :type, :parent, VALUES (CASE WHEN :url ISNULL THEN NULL ELSE (SELECT id FROM moz_places WHERE url_hash = hash(:url) AND url = :url) END,
:index, :title, :date_added, :last_modified, :guid, :type, :parent, :index, :title, :date_added, :last_modified,
:syncChangeCounter, :syncStatus) :guid, :syncChangeCounter, :syncStatus)
`, { url: item.hasOwnProperty("url") ? item.url.href : "nonexistent", `, { url: item.hasOwnProperty("url") ? item.url.href : null,
type: item.type, parent: parent._id, index: item.index, type: item.type, parent: parent._id, index: item.index,
title: item.title, date_added: PlacesUtils.toPRTime(item.dateAdded), title: item.title, date_added: PlacesUtils.toPRTime(item.dateAdded),
last_modified: PlacesUtils.toPRTime(item.lastModified), guid: item.guid, last_modified: PlacesUtils.toPRTime(item.lastModified), guid: item.guid,