DERBY-6148 Wrong sort elimination when using permuted sort order
    
    Patch derby-6148-3. Adds lacking use of join order index map into
    optimizableList in method OrderByList#sortRequired. Also adds
    regression tests for previously failing (and a some good) queries.

Back-ported from trunk as svn merge -c 1485938. Manual Java source
level adaptations.



git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/branches/10.10@1485958 13f79535-47bb-0310-9956-ffa450edef68