ASTERIXDB-1406: add a regression test.
Change-Id: I0324a7442d3b0b5cc12faf06be9191963debfa74
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1061
Reviewed-by: Till Westmann <tillw@apache.org>
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.1.ddl.aql
new file mode 100644
index 0000000..88fbf65
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.1.ddl.aql
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type anon as {
+ id: int
+};
+
+create dataset myset(anon) primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.2.update.aql
new file mode 100644
index 0000000..0455dde
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.2.update.aql
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use dataverse test;
+
+insert into dataset myset
+for $i in range(1,3) return {"id": $i };
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.3.query.aql
new file mode 100644
index 0000000..5124e51
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use dataverse test;
+
+for $m in dataset myset
+order by $m.id
+return $m;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.1.adm
new file mode 100644
index 0000000..079f506
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/dml/query-ASTERIXDB-1406/query-ASTERIXDB-1406.1.adm
@@ -0,0 +1,3 @@
+{ "id": 1 }
+{ "id": 2 }
+{ "id": 3 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
index 0d05c31..9b441c3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -1944,6 +1944,11 @@
<output-dir compare="Text">query-ASTERIXDB-867</output-dir>
</compilation-unit>
</test-case>
+ <test-case FilePath="dml">
+ <compilation-unit name="query-ASTERIXDB-1406">
+ <output-dir compare="Text">query-ASTERIXDB-1406</output-dir>
+ </compilation-unit>
+ </test-case>
</test-group>
<test-group name="employee">
<test-case FilePath="employee">