ASTERIXDB-1231, ASTERIXDB-636: fixed Self-join

 - Fixed self-join with index-out-of-boud exception during the compilation
 - Added a test case for ASTERIXDB-636

Change-Id: I8d5d9cb0cb54473fbe7a5e43934e9608548c1dbb
Reviewed-on: https://asterix-gerrit.ics.uci.edu/635
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 48dcbb4..bcc80ad 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -4306,6 +4306,11 @@
             </compilation-unit>
         </test-case>
         <test-case FilePath="orderby_limit">
+            <compilation-unit name="orderby_limit_02">
+                <output-dir compare="Text">orderby_limit_02</output-dir>
+            </compilation-unit>
+        </test-case>
+        <test-case FilePath="orderby_limit">
             <compilation-unit name="orderby_limit_offset_01">
                 <output-dir compare="Text">orderby_limit_offset_01</output-dir>
             </compilation-unit>