FIX Zend\Db\Sql\Select: getRawState('order') is inconsistent after
calling reset() #5767
Merge pull request #5499 in master
Merge pull request #5768
Merge pull request #5768 in develop