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/metadata/testsuite.xml b/asterix-app/src/test/resources/metadata/testsuite.xml
index 0b8c26a..bba2ab0 100644
--- a/asterix-app/src/test/resources/metadata/testsuite.xml
+++ b/asterix-app/src/test/resources/metadata/testsuite.xml
@@ -274,6 +274,11 @@
       </compilation-unit>
     </test-case>
     <test-case FilePath="basic">
+      <compilation-unit name="metadata_selfjoin">
+        <output-dir compare="Text">metadata_selfjoin</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
       <compilation-unit name="temp_dataset">
         <output-dir compare="Text">temp_dataset</output-dir>
       </compilation-unit>