Opened 6 months ago

Last modified 6 months ago

#18672 new bug

different query results depending on the order of the expression

Reported by: augiedoggie Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Storage Kit Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by augiedoggie)

queries in Haiku seem to require the name part of the expression to come first. For example, this works:

query -a '((name=="**")&&(BEOS:TYPE=="application/x-vnd.Be-elfexecutable"))'

but this doesn't:

query -a '((BEOS:TYPE=="application/x-vnd.Be-elfexecutable")&&(name="**"))'

I came across this problem while working on some of the old BeSampleCode at HaikuArchives. I don't have BeOS installed to test but I assume the old code worked.

On a related note, I thought you could execute a query in BeOS without a name but that doesn't seem to work. Maybe I'm not remembering it properly. Like:

query -a '(BEOS:TYPE=="application/x-vnd.Be-elfexecutable")'

Change History (4)

comment:1 by augiedoggie, 6 months ago

Description: modified (diff)

comment:2 by bipolar, 6 months ago

This one drove me nuts some months ago, while testing to see if I could make Pe's BeBookFetch extension work again (even if I had to come up with a custom "Be Book's Bookmarks" zip/package).

(augiedoggie might remember trying to help me, over IRC, to make sense of the issue)

That extension also uses "name" *after* "BEOS:TYPE", and I couldn't really understand why it didn't worked (not an unusual state of mind for me, but... :-P).

comment:3 by bipolar, 6 months ago

I've just tested on a VM with a LiveCD of "BeOS Max Edition" I had lying around.

Both:

query -a '((name=="**")&&(BEOS:TYPE=="application/x-vnd.Be-elfexecutable"))'

and

query -a '((BEOS:TYPE=="application/x-vnd.Be-elfexecutable")&&(name="**"))'

give the exact same results.

While "query without name", ie: query -a '(BEOS:TYPE=="application/x-vnd.Be-elfexecutable")' yields no results.

Trying to use Tracker's Find in "formula mode" with only (BEOS:TYPE=="application/x-vnd.Be-elfexecutable"), just closes the Find window upon hitting enter (on Haiku it shows a query window with no results at least).

Last edited 6 months ago by bipolar (previous) (diff)

comment:4 by madmax, 6 months ago

It would seem we bail out somewhere if there's no index. The query still works if you use any other indexed attribute instead of name, and it also works with just the type search if that is indexed.

Note: See TracTickets for help on using tickets.