[haiku-bugs] Re: [Haiku] #13254: Query on E-Mail Attributes Misses Files

  • From: "axeld" <trac@xxxxxxxxxxxx>
  • Date: Fri, 07 Apr 2017 22:04:39 -0000

#13254: Query on E-Mail Attributes Misses Files
--------------------------------+---------------------------------------
   Reporter:  AGMS              |      Owner:  axeld
       Type:  bug               |     Status:  new
   Priority:  normal            |  Milestone:  Unscheduled
  Component:  File Systems/BFS  |    Version:  R1/Development
 Resolution:                    |   Keywords:  query bfs index attribute
 Blocked By:                    |   Blocking:
Has a Patch:  0                 |   Platform:  All
--------------------------------+---------------------------------------

Comment (by axeld):

 Thanks! This test shows that `MAIL:to=*` will obviously also be true if
 there aren't any items:
 {{{
 $ find . -exec listattr {} \; | grep MAIL:to | wc -l
 14230
 }}}
 I've started to look into it, and just in case I'm hit by a rock tomorrow:
 the problem is the maximum key length. We allow for 256 bytes, and the
 query's key value storage only allows for 256 bytes.

 However, `TreeIterator::Traverse()` always wants to return null terminated
 strings. For a 256 byte key, we'd need 257 bytes for the key plus the null
 character. Since there is not enough storage, it will return
 `B_BUFFER_OVERFLOW`, and the query will stop.

 Not sure yet if we limit the key size to 255 bytes instead (that seems to
 be what BeOS did), or just increase the query's key storage by one byte.
 While the former makes us more compatible with BeOS, the latter will not
 render currently existing indexes invalid. As always, opinions welcome.

--
Ticket URL: <https://dev.haiku-os.org/ticket/13254#comment:3>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: