What happened to this site? And what's that frog about?

c4_View::Search broken

F104 - Failure Feedback Forum 

Status: review Severity: failure Category: Metakit C++ Created: 2006-08-07 Updated: 2006-12-09

There seems to be several problems with c4_View::Search. The comparison seems to be in wrong order, making the binary search divide across the wrong axis. Also the compare function compares against all properties in the view, failing if any are not present in the search criteria.

I have attached a patch with fixes and some performance improvements.

Best Regards, Alexander Stigsen

2006-Nov-05 14:29:43 by anonymous:

The patch also has several problems, primarily that it only works with basic views (eg. it has no way to know if the view could be reverse sorted). The original search function passed the regression test by luck. When sorting a view it seems that the property being sorted on always ends up as the first property in the resulting view. This made search end up with the correct result, even though the underlying compare sometimes gave incorrect results.

I have attached an patch to the regression test that exposes the bug. I hope that a better solution than my original patch can be found.



2006-08-07 stigsen

Imported

2006-12-09 jcw

Copied from metakit cvstract ticket #11

<a title="File uploaded at Dec 09/2006 08:52PM" href="files/1841.patch"><img border=0 alt="Document Icon" src="styles/doc.gif">search.patch</a>

<a title="File uploaded at Dec 09/2006 08:52PM" href="files/2730.patch"><img border=0 alt="Document Icon" src="styles/doc.gif">searchtest.patch</a>

Add a comment:

Tip: add empty lines between paragraphs and indent lines to prevent reformatting.

Your name or initials:  

Powered by Mavrig