[haiku-3rdparty-dev] Re: Fetching data from queries

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Thu, 05 Nov 2009 11:06:42 +0100

-------- Original-Nachricht --------
> Datum: Thu, 5 Nov 2009 22:45:54 +1300
> Von: "Yashasvi A.C." <yashasviac@xxxxxxxxx>
>
> On Thu, Nov 5, 2009 at 8:06 PM, Ingo Weinhold <ingo_weinhold@xxxxxx>
> wrote:
> 
> >
> > On 2009-11-05 at 03:46:59 [+0100], Rene Gollent <anevilyak@xxxxxxxxx>
> > wrote:
> > > On Wed, Nov 4, 2009 at 8:39 PM, Rene Gollent <anevilyak@xxxxxxxxx>
> > wrote:
> > > > far more than the 4 entries in your folder. The other problem is
> that
> > > > last_modified is not relative, it's a timestamp, which is to say you
> > > > probably want something like "(%now% - last_modified) < 10000000" as
> > >
> > > On second thought, you might want to rework that as "last_modified >
> > > (%now% - 10000000)"..I'm not sure how intelligent BFS is at optimizing
> > > queries, and in case it doesn't do any such thing this form should be
> > > friendlier for the indices.
> >
> > I don't think that would work either. The expression could be
> > "last_modified > %-10 secs%", though.
> 
> The "last_modified > (%non% - 10000000)" predicate doesn't really restrict
> the files that were modified in the last 10 seconds. So, even if I click
> the
> button once again after 15 seconds, the previous messages are still
> listed.

Particularly with the "%non%" in the query predicate is invalid. Under BeOS the 
"query" command line tool fails. Under Haiku it doesn't fail and instead 
returns a whole lot of files. Apparently a bug.

> Also, as Rene mentioned, all the files are being checked. So, I put in a
> simple filter on the file name (pretty much checking if the string starts
> with Message and checking the character after that is a digit) to get the
> files that I needed. Maybe I could try the predicate that Ingo suggested
> and
> check if it gives me the files within the last 10 seconds.

I just tried it myself under Haiku and there seems to be an issue with the time 
zone not being considered correctly (in GMT+1 I have to specify "%+50 mins%" to 
get the files modified at most ten minutes ago).

I'm using an older Haiku ATM, though, so maybe the bugs have been fixed 
already. I vaguely recall having seen BFS query code related commits recently.

CU, Ingo

Other related posts: