Added ORDER BY to enforce share entry order

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.
This commit is contained in:
Vincent Petry 2014-06-11 14:28:30 +02:00
parent 491c96eaa9
commit 65b3d293ce
1 changed files with 1 additions and 0 deletions

View File

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