Closed Bug 386956 Opened 18 years ago Closed 18 years ago

Simplify nsNavHistory::RemoveDuplicateURIs

Categories

(Firefox :: Bookmarks & History, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 3 alpha7

People

(Reporter: mak, Assigned: mak)

References

Details

Attachments

(2 files, 3 obsolete files)

nsNavHistory::RemoveDuplicateURIs actually uses a SELECT, a cycle to find duplicates, and a cycle on duplicates with 2 DELETEs on each iteration... that can be done with 2 simpleQuery DELETEs in a transaction. Duplicates are found using the HAVING clause.
Attachment #271029 - Flags: review?(sspitzer)
Attachment #271029 - Attachment is obsolete: true
Attachment #271029 - Flags: review?(sspitzer)
fixed typos in comments
Attachment #271032 - Flags: review?(sspitzer)
Attached patch as checked inSplinter Review
Attachment #271032 - Attachment is obsolete: true
Attachment #272089 - Flags: review+
Attachment #271032 - Flags: review?(sspitzer)
fixed, thanks Marco. Checking in nsNavHistory.cpp; /cvsroot/mozilla/toolkit/components/places/src/nsNavHistory.cpp,v <-- nsNavHis tory.cpp new revision: 1.142; previous revision: 1.141 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3 M7
<tracy> dietrich, regarding bugs like https://bugzilla.mozilla.org/show_bug.cgi?id=386956 , what woudl you recommend for verification? <dietrich> sspitzerMsgMe: ^^ any idea how tracy could verify bug 386956? <dietrich> i think that's used by import... Yes, this code is used in import (from Fx 2, history.dat to Fx 3, places.sqlite). See http://lxr.mozilla.org/seamonkey/source/toolkit/components/places/src/nsMorkHistoryImporter.cpp#248 Note, the existing code (before Marco's fix) also removed duplicate uris. his patch is a code simplification. I have Jay Patel's fx 2 history.dat with duplicate URIs that I used for testing. you could migrate from fx 2 -> fx 3 with that, and then use the SQLite Database Browser to verify that there were no duplicate uris after the migration. (Assuming Jay is ok with me sharing that with you privately.)
Can I get a copy of the history.dat file for verification?
> Can I get a copy of the history.dat file for verification? I'm glad you asked. I was creating one for you, and in the process realized there is a problem with this patch and it needs to be backed out. For a uri that appears twice, the currently checked in patch will remove both all the visits for both in moz_historyvisits, and then remove both instances from moz_places. so I need to back out this patch, probably wontfix this bug, and log a new one about instead of deleting moz_historyvisits, making them visits for the moz_place entry we keep. I'll attach a history.dat for testing.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: mak77 → sspitzer
Status: REOPENED → NEW
Comment on attachment 274115 [details] [diff] [review] back out the patch, causes dataloss oops, I'm wrong. Sorry Marco.
Attachment #274115 - Attachment is obsolete: true
Attachment #274115 - Flags: review?(dietrich)
poor testing on my part. Marco's fix is fine. "SELECT id FROM moz_places GROUP BY url HAVING(COUNT(url) > 1)" works as expected. But I don't think we want to remove visits, because that will leave us with a visit count that does not match the number of entries in the moz_historyvisits table. but I'll spin that bug off.
Assignee: sspitzer → mak77
Status: NEW → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
al, you can generate this yourself by doing: http://talkback-public.mozilla.org/search/start.jsp?search=2&type=iid&id=984023' and http://talkback-public.mozilla.org/search/start.jsp?search=2&type=iid&id=984023%27 in a fx2 profile and then migrating to the trunk. to ensure that we don't have duplicate urls, you can inspect the moz_places table in the SQLite Database Browser, or run this query: SELECT id FROM moz_places GROUP BY url HAVING(COUNT(url) > 1) note, in fx 2, you would see two urls in the history sidebar where in fx 3, you will only see one.
> two urls to clarify, I mean two instances of urls like: "http://talkback-public.mozilla.org/search/start.jsp?search=2&type=iid&id=..." there are a few other urls in the history.dat I attached.
> But I don't think we want to remove visits, because that will leave us with a > visit count that does not match the number of entries in the moz_historyvisits > table. but I'll spin that bug off. spun off to bug #389789
Verified with Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a8pre) Gecko/200708100404 Minefield/3.0a8pre.
Status: RESOLVED → VERIFIED
Flags: in-testsuite-
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h". In Thunderbird 3.0b, you do that as follows: Tools | Message Filters Make sure the correct account is selected. Click "New" Conditions: Body contains places-to-b-and-h Change the action to "Delete Message". Select "Manually Run" from the dropdown at the top. Click OK. Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter. Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: