]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added ORDER BY to enforce share entry order
authorVincent Petry <pvince81@owncloud.com>
Wed, 11 Jun 2014 12:28:30 +0000 (14:28 +0200)
committerVincent Petry <pvince81@owncloud.com>
Wed, 11 Jun 2014 12:28:30 +0000 (14:28 +0200)
Sometimes MySQL decides to return the shares in the wrong order, but
some parts of the code seem to require the order to be known, at least
so that the parent shares come before the children shares.

This fix adds an ORDER BY clause to force the order by id.

lib/private/share/share.php

index 883fbd1b298fe80073838588a167dbb8dc34c3b7..a3de8ebc0efa4646daf5cbfaefd31f165ee79154 100644 (file)
@@ -1211,6 +1211,7 @@ class Share extends \OC\Share\Constants {
                        }
                } else {
                        $queryLimit = null;
+                       $where .= ' ORDER BY `*PREFIX*share`.`id` ASC';
                }
                $select = self::createSelectStatement($format, $fileDependent, $uidOwner);
                $root = strlen($root);