Closed Bug 431616 Opened 14 years ago Closed 4 years ago
Visit query options do not apply to QUERY
_TYPE _BOOKMARKS, causing creation of an incorrect statement
When performing a complex places query, the generated SQL is referencing a column called v.visit_date which SQLITE tells me doesn't exist. This is a build pulled this morning (April 30, 2008) and so it should be pretty current. I'll attach the test to this bug. If you comment out the query.beginTime and query.endTime statements, this parameter is dropped from the query and the SQL query returns results. However, any time parameter seems to add it back in and we get the failure. query.*TimeReference doesn't seem to matter - they all cause the problem. The NSPR log output: BEGIN DEFERRED -1610559488[1c07310]: Sqlite statement prepare error: 1 'no such column: v.visit_date' -1610559488[1c07310]: Statement was: 'SELECT b.fk, h.url, COALESCE(b.title, h.title), h.rev_host, h.visit_count,(SELECT visit_date FROM moz_historyvisits WHERE place_id = b.fk AND visit_type NOT IN (0,4,7) ORDER BY visit_date DESC LIMIT 1), f.url, null, b.id, b.dateAdded, b.lastModified FROM moz_bookmarks b JOIN moz_places h ON b.fk = h.id AND b.type = 1 LEFT OUTER JOIN moz_favicons f ON h.favicon_id = f.id WHERE NOT EXISTS (SELECT id FROM moz_bookmarks WHERE id = b.parent AND parent = 4) AND (( v.visit_date >= :begin_time AND v.visit_date <= :end_time AND h.visit_count >= :min_visits AND h.rev_host >= :domain_lower AND h.rev_host < :domain_upper AND NOT EXISTS (SELECT h.id FROM moz_annos anno JOIN moz_anno_attributes annoname ON anno.anno_attribute_id = annoname.id WHERE anno.place_id = h.id AND annoname.name = :anno ) ))' -1610559488[1c07310]: WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /Users/clint/code/fx-trunk/mozilla/toolkit/components/places/src/nsNavHistory.cpp, line 3550 -1610559488[1c07310]: ROLLBACK TRANSACTION -1610559488[1c07310]: WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /Users/clint/code/fx-trunk/mozilla/toolkit/components/places/src/nsNavHistoryResult.cpp, line 2347 -1610559488[1c07310]: WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /Users/clint/code/fx-trunk/mozilla/toolkit/components/places/src/nsNavHistoryResult.cpp, line 2142 Here is an MXR query where we refer to visit_date: http://mxr.mozilla.org/mozilla/search?string=visit_date&find=mozilla/toolkit/components/
yeah, QUERY_TYPE_BOOKMARKS does not join history table, so any history related option like beginTime/endTime won't work atm.
Summary: Incorrect query formed - v.visit_date is not a valid column → Visit query options do not apply to QUERY_TYPE_BOOKMARKS, causing creation of an incorrect statement
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
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.