lsmith77/phpcr_benchmark — pull request #5 by joschi127 (2014-07-15 07:50:53+00:00)
Title: Fix for postgresql, do not assume nodes to be returned in the order they...

... have been inserted

As discussed on irc: for me the benchmark failed with postgresql when the database did not return the nodes in the same order as they have been inserted. It throws the Exception "Benchmark failing to read correct data: '/benchmark/1/50' does not match '/benchmark/2/50'". The error only happened for me when using a modified xpath query in jackalope-doctrine-dbal which allows using an index on the xpath expression. For some reason postgresql returns the data in another order then.

I fixed the issue by writing $section.'/'.$count to the node instead of just $count and adjusting the queries accordingly.

In addition i also changed $count/2 to ceil($count/2). Without this change the benchmark would fail when using --count 1.