# Non-deterministic sort in paginator (Cake/2.5.0)

**URL:** <https://discourse.cakephp.org/t/non-deterministic-sort-in-paginator-cake-2-5-0/1927>\
**Category:** Need Help\
**Created:** [January 25, 2017, 8:51am UTC](https://discourse.cakephp.org/t/non-deterministic-sort-in-paginator-cake-2-5-0/1927 "2017-01-25T08:51:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvaro](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/alvaro/32/70_2.png) [@alvaro](https://discourse.cakephp.org/u/alvaro)\
**Post date:** [January 25, 2017, 8:51am UTC](https://discourse.cakephp.org/t/non-deterministic-sort-in-paginator-cake-2-5-0/1927/1 "2017-01-25T08:51:41Z")

</div>

I’ve implemented sort links using `PaginatorHelper::sort()` as explained in docs. It works but it only sorts by that column. That means that when the chosen column is not unique CakePHP runs pagination queries that do not have a deterministic order, e.g.:

```
ORDER BY `Vehicle`.`make` asc LIMIT 20, 20

```

It’d a very obvious bug to go unnoticed so I’m wondering if I’m doing something wrong. My links are like:

```
<th><?php echo $this->Paginator->sort('Vehicle.make', __d('foo_manager', 'make')); ?></th>

```

… and I haven’t added any specific sort code to the controller.
