fix issue592
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue592/query-issue592.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue592/query-issue592.1.ddl.aql
new file mode 100644
index 0000000..a0231f4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue592/query-issue592.1.ddl.aql
@@ -0,0 +1,21 @@
+/*
+ * Description : Issue592
+ * Expected Result : Success
+ * Date : 21 October 2013
+ * Notes : This test was written to verify the fix for issue592.
+ */
+
+drop dataverse fooverse if exists;
+create dataverse fooverse;
+use dataverse fooverse;
+
+create type bartype as open {
+ "baz": int32
+}
+
+create type footype as open {
+ "id": int32,
+ "bars": [ bartype ]?
+};
+
+create dataset fooset(footype) primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue592/query-issue592.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue592/query-issue592.2.update.aql
new file mode 100644
index 0000000..0a08c2a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue592/query-issue592.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Description : Issue592
+ * Expected Result : Success
+ * Date : 21 October 2013
+ * Notes : This test was written to verify the fix for issue592.
+ */
+
+use dataverse fooverse;
+
+insert into dataset fooset (
+{
+ "id": 1,
+ "bars": [
+ { "baz": 1 },
+ { "baz": 1 }
+ ]
+}
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue592/query-issue592.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue592/query-issue592.3.query.aql
new file mode 100644
index 0000000..39fd476
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue592/query-issue592.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Issue592
+ * Expected Result : Success
+ * Date : 21 October 2013
+ * Notes : This test was written to verify the fix for issue592.
+ */
+
+use dataverse fooverse;
+
+for $f in dataset fooset
+return $f
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue592/query-issue592.1.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue592/query-issue592.1.adm
new file mode 100644
index 0000000..cd05949
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue592/query-issue592.1.adm
@@ -0,0 +1 @@
+{ "id": 1, "bars": [ { "baz": 1 }, { "baz": 1 } ] }
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 7f68e22..7f9a9c6 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -2899,6 +2899,11 @@
<expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
</compilation-unit>
</test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue592">
+ <output-dir compare="Text">query-issue592</output-dir>
+ </compilation-unit>
+ </test-case>
</test-group>
<test-group name="quantifiers">
<test-case FilePath="quantifiers">