mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 04:58:00 +00:00
Bug 376786 - Annotation-based queries are broken. r=dietrich.
This commit is contained in:
parent
9708501644
commit
afdaddfc42
@ -3242,7 +3242,7 @@ nsNavHistory::QueryToSelectClause(nsNavHistoryQuery* aQuery, // const
|
||||
|
||||
if (aQuery->AnnotationIsNot())
|
||||
aClause->AppendLiteral("NOT ");
|
||||
aClause->AppendLiteral("EXISTS (SELECT 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 = ");
|
||||
aClause->AppendLiteral("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 = ");
|
||||
aClause->Append(paramString);
|
||||
aClause->AppendLiteral(") ");
|
||||
// annotation-based queries don't get the common conditions, so you get
|
||||
|
@ -134,6 +134,24 @@ function run_test() {
|
||||
result = histsvc.executeQuery(query, options);
|
||||
result.root.containerOpen = true;
|
||||
do_check_eq(result.root.childCount, 2);
|
||||
|
||||
// test annotation-based queries
|
||||
var annos = Cc["@mozilla.org/browser/annotation-service;1"].
|
||||
getService(Ci.nsIAnnotationService);
|
||||
annos.setAnnotationInt32(uri("http://mozilla.com/"), "testAnno", 0, 0,
|
||||
Ci.nsIAnnotationService.EXPIRE_NEVER);
|
||||
query.annotation = "testAnno";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
result.root.containerOpen = true;
|
||||
do_check_eq(result.root.childCount, 1);
|
||||
do_check_eq(result.root.getChild(0).uri, "http://mozilla.com/");
|
||||
|
||||
// test annotationIsNot
|
||||
query.annotationIsNot = true;
|
||||
result = histsvc.executeQuery(query, options);
|
||||
result.root.containerOpen = true;
|
||||
do_check_eq(result.root.childCount, 1);
|
||||
do_check_eq(result.root.getChild(0).uri, "http://google.com/");
|
||||
|
||||
// by default, browser.history_expire_days is 9
|
||||
do_check_true(!histsvc.historyDisabled);
|
||||
|
Loading…
x
Reference in New Issue
Block a user