fix issue343
diff --git a/asterix-app/src/test/resources/logging.properties b/asterix-app/src/test/resources/logging.properties
index deb88307..a5935be 100644
--- a/asterix-app/src/test/resources/logging.properties
+++ b/asterix-app/src/test/resources/logging.properties
@@ -60,6 +60,7 @@
# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
-#edu.uci.ics.asterix.level = FINE
-#edu.uci.ics.algebricks.level = FINE
+
+#edu.uci.ics.asterix.level = FINEST
+#edu.uci.ics.hyracks.algebricks.level = FINEST
#edu.uci.ics.hyracks.level = INFO
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/ifthenelse_01/ifthenelse_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/misc/ifthenelse_01/ifthenelse_01.1.ddl.aql
index e69de29..e6a3879 100644
--- a/asterix-app/src/test/resources/runtimets/queries/misc/ifthenelse_01/ifthenelse_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/ifthenelse_01/ifthenelse_01.1.ddl.aql
@@ -0,0 +1,2 @@
+drop dataverse test if exists;
+create dataverse test;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343-2/query-issue343-2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343-2/query-issue343-2.1.ddl.aql
new file mode 100644
index 0000000..a49658e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343-2/query-issue343-2.1.ddl.aql
@@ -0,0 +1,47 @@
+/*
+ * Description : This test case is to verify the fix for issue343. It is a more general case.
+ : https://code.google.com/p/asterixdb/issues/detail?id=343
+ * Expected Res : Success
+ * Date : 30th April 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type AllType as open {
+ id: int32,
+ name: string,
+ age: float,
+ salary: double,
+ married: boolean,
+ interests: {{string}},
+ children: [string],
+ address: AddressType,
+ dob: date,
+ time: time,
+ datetime: datetime,
+ duration: duration,
+ location2d: point,
+ location3d: point3d,
+ line: line,
+ polygon: polygon,
+ circle: circle
+}
+
+create type MyListType as open{
+ id: int32,
+ mylist: [string]
+}
+
+create dataset All(AllType)
+ primary key id;
+
+create dataset MyList(MyListType)
+ primary key id;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343-2/query-issue343-2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343-2/query-issue343-2.2.update.aql
new file mode 100644
index 0000000..39b85f3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343-2/query-issue343-2.2.update.aql
@@ -0,0 +1,21 @@
+/*
+ * Description : This test case is to verify the fix for issue343. It is a more general case.
+ : https://code.google.com/p/asterixdb/issues/detail?id=343
+ * Expected Res : Success
+ * Date : 30th April 2013
+ */
+
+use dataverse test;
+
+insert into dataset MyList (
+ {
+ "id" : 1,
+ "mylist": ["blah"]
+ }
+);
+
+insert into dataset All (
+for $m in dataset MyList
+let $record:= { "id": 13, "name": string("Nancy"), "age": 32.5f, "salary": 12.000 ,"married": boolean("true"), "interests": {{"reading", "writing"}}, "children": ["Brad", "Scott"], "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30Z"), "datetime": datetime("-1951-12-27T12:20:30"), "duration": duration("P10Y11M12DT10H50M30S"), "location2d": point("41.00,44.00"), "location3d": point3d("44.00,13.00,41.00"), "line" : line("10.1,11.1 10.2,11.2"), "polygon" : polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle" : circle("10.1,11.1 10.2"), "mylist" : $m.mylist }
+return $record
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343-2/query-issue343-2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343-2/query-issue343-2.3.query.aql
new file mode 100644
index 0000000..e17a6e0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343-2/query-issue343-2.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue343. It is a more general case.
+ : https://code.google.com/p/asterixdb/issues/detail?id=343
+ * Expected Res : Success
+ * Date : 30th April 2013
+ */
+
+use dataverse test;
+
+for $x in dataset All
+return $x
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343/query-issue343.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343/query-issue343.1.ddl.aql
new file mode 100644
index 0000000..bd2ab1a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343/query-issue343.1.ddl.aql
@@ -0,0 +1,41 @@
+/*
+ * Description : This test case is to verify the fix for issue343
+ : https://code.google.com/p/asterixdb/issues/detail?id=343
+ * Expected Res : Success
+ * Date : 30th April 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+create type AllType as open {
+ id: int32,
+ name: string,
+ age: float,
+ salary: double,
+ married: boolean,
+ interests: {{string}},
+ children: [string],
+ address: AddressType,
+ dob: date,
+ time: time,
+ datetime: datetime,
+ duration: duration,
+ location2d: point,
+ location3d: point3d,
+ line: line,
+ polygon: polygon,
+ circle: circle
+}
+
+create dataset All(AllType)
+ primary key id;
+
+
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343/query-issue343.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343/query-issue343.2.update.aql
new file mode 100644
index 0000000..eaafddd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343/query-issue343.2.update.aql
@@ -0,0 +1,14 @@
+/*
+ * Description : This test case is to verify the fix for issue343
+ : https://code.google.com/p/asterixdb/issues/detail?id=343
+ * Expected Res : Success
+ * Date : 30th April 2013
+ */
+
+use dataverse test;
+
+insert into dataset All (
+let $addedList := ["blah"]
+let $record:= { "id": 13, "name": string("Nancy"), "age": 32.5f, "salary": 12.000 ,"married": boolean("true"), "interests": {{"reading", "writing"}}, "children": ["Brad", "Scott"], "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30Z"), "datetime": datetime("-1951-12-27T12:20:30"), "duration": duration("P10Y11M12DT10H50M30S"), "location2d": point("41.00,44.00"), "location3d": point3d("44.00,13.00,41.00"), "line" : line("10.1,11.1 10.2,11.2"), "polygon" : polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle" : circle("10.1,11.1 10.2"), "mylist" : $addedList }
+return $record
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343/query-issue343.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343/query-issue343.3.query.aql
new file mode 100644
index 0000000..9dfde51
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue343/query-issue343.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue343
+ : https://code.google.com/p/asterixdb/issues/detail?id=343
+ * Expected Res : Success
+ * Date : 30th April 2013
+ */
+
+use dataverse test;
+
+for $x in dataset All
+return $x
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue350-2/query-issue350-2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue350-2/query-issue350-2.1.ddl.aql
new file mode 100644
index 0000000..85f2160
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue350-2/query-issue350-2.1.ddl.aql
@@ -0,0 +1,17 @@
+/*
+ * Description : This test case is to verify the fix for issue350
+ : https://code.google.com/p/asterixdb/issues/detail?id=350
+ * Expected Res : Success
+ * Date : 28th April 2013
+ */
+
+drop dataverse TinySocial if exists;
+create dataverse TinySocial;
+use dataverse TinySocial;
+
+create type TweetMessageType as open {
+tweetid: string
+};
+
+create dataset TweetMessages(TweetMessageType)
+primary key tweetid;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue350-2/query-issue350-2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue350-2/query-issue350-2.2.update.aql
new file mode 100644
index 0000000..372d7ca
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue350-2/query-issue350-2.2.update.aql
@@ -0,0 +1,50 @@
+/*
+ * Description : This test case is to verify the fix for issue350
+ : https://code.google.com/p/asterixdb/issues/detail?id=350
+ * Expected Res : Success
+ * Date : 28th April 2013
+ */
+
+use dataverse TinySocial;
+
+load dataset TweetMessages
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_messages.adm"),("format"="adm"));
+
+insert into dataset TweetMessages
+(
+ {"tweetid":"13",
+ "user":
+ {"screen-name":"NathanGiesen@211",
+ "lang":"en",
+ "friends_count":39345,
+ "statuses_count":479,
+ "name":"Nathan Giesen",
+ "followers_count":49420,
+ "hobbies":["basket weaving","mud wrestling"]
+ },
+ "sender-location":point("47.44,80.65"),
+ "send-time":datetime("2008-04-26T10:10:35"),
+ "referred-topics":{{"tweeting"}},
+ "message-text":"tweety tweet, my fellow tweeters!"
+ }
+);
+
+insert into dataset TweetMessages
+(
+ {"tweetid":"15",
+ "user":
+ {"screen-name":"Jason17",
+ "lang":"en",
+ "friends_count":393,
+ "statuses_count":47,
+ "name":"Nathan Giesen",
+ "followers_count":420,
+ "hobbies":["swimming"]
+ },
+ "sender-location":point("49.44,80.65"),
+ "send-time":datetime("2009-04-26T10:10:35"),
+ "referred-topics":{{"nothing"}},
+ "message-text":"Nothing to say!"
+ }
+);
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue350-2/query-issue350-2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue350-2/query-issue350-2.3.query.aql
new file mode 100644
index 0000000..298940a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue350-2/query-issue350-2.3.query.aql
@@ -0,0 +1,13 @@
+/*
+ * Description : This test case is to verify the fix for issue350
+ : https://code.google.com/p/asterixdb/issues/detail?id=350
+ * Expected Res : Success
+ * Date : 28th April 2013
+ */
+
+use dataverse TinySocial;
+
+for $tm in dataset TweetMessages
+where (every $h in $tm.user.hobbies satisfies $h = "basket weaving")
+order by $tm.tweetid
+return $tm;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue343-2/query-issue343-2.1.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue343-2/query-issue343-2.1.adm
new file mode 100644
index 0000000..5196a0f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue343-2/query-issue343-2.1.adm
@@ -0,0 +1 @@
+{ "id": 13, "name": "Nancy", "age": 32.5f, "salary": 12.0d, "married": true, "interests": {{ "reading", "writing" }}, "children": [ "Brad", "Scott" ], "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("-1951-12-27T12:20:30.000Z"), "duration": duration("P10Y11M12DT10H50M30S"), "location2d": point("41.0,44.0"), "location3d": point3d("44.0,13.0,41.0"), "line": line("10.1,11.1 10.2,11.2"), "polygon": polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle": circle("10.1,11.1 10.2"), "mylist": [ "blah" ] }
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue343/query-issue343.1.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue343/query-issue343.1.adm
new file mode 100644
index 0000000..5196a0f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue343/query-issue343.1.adm
@@ -0,0 +1 @@
+{ "id": 13, "name": "Nancy", "age": 32.5f, "salary": 12.0d, "married": true, "interests": {{ "reading", "writing" }}, "children": [ "Brad", "Scott" ], "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("-1951-12-27T12:20:30.000Z"), "duration": duration("P10Y11M12DT10H50M30S"), "location2d": point("41.0,44.0"), "location3d": point3d("44.0,13.0,41.0"), "line": line("10.1,11.1 10.2,11.2"), "polygon": polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle": circle("10.1,11.1 10.2"), "mylist": [ "blah" ] }
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue350-2/query-issue350-2.1.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue350-2/query-issue350-2.1.adm
new file mode 100644
index 0000000..6466feb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue350-2/query-issue350-2.1.adm
@@ -0,0 +1,10 @@
+{ "tweetid": "1", "tweetid-copy": "1", "user": { "screen-name": "RollandEckhardstein#211", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "Rolland Eckhardstein", "followers_count": 3311368 }, "sender-location": point("42.13,80.43"), "send-time": datetime("2005-12-05T21:06:41.000Z"), "send-time-copy": datetime("2005-12-05T21:06:41.000Z"), "referred-topics": {{ "samsung", "plan" }}, "message-text": " love samsung the plan is amazing" }
+{ "tweetid": "10", "tweetid-copy": "10", "user": { "screen-name": "Rolldstein#211", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "Rolland Eckhardstful", "followers_count": 3311368 }, "sender-location": point("46.94,93.98"), "send-time": datetime("2011-04-07T14:08:46.000Z"), "send-time-copy": datetime("2011-04-07T14:08:46.000Z"), "referred-topics": {{ "t-mobile", "signal" }}, "message-text": " like t-mobile the signal is good" }
+{ "tweetid": "2", "tweetid-copy": "2", "user": { "screen-name": "RollandEckhardstein#211", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "David Eckhardstein", "followers_count": 3311368 }, "sender-location": point("28.86,70.44"), "send-time": datetime("2007-08-15T06:44:17.000Z"), "send-time-copy": datetime("2007-08-15T06:44:17.000Z"), "referred-topics": {{ "sprint", "voice-clarity" }}, "message-text": " like sprint its voice-clarity is mind-blowing" }
+{ "tweetid": "3", "tweetid-copy": "3", "user": { "screen-name": "RollandEckhard#500", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "Rolland Hetfield", "followers_count": 3311368 }, "sender-location": point("39.84,86.48"), "send-time": datetime("2008-12-24T00:07:04.000Z"), "send-time-copy": datetime("2008-12-24T00:07:04.000Z"), "referred-topics": {{ "verizon", "voice-command" }}, "message-text": " can't stand verizon its voice-command is terrible:(" }
+{ "tweetid": "4", "tweetid-copy": "4", "user": { "screen-name": "RollandEckhardstein#221", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "Rolland Eckhardstinz", "followers_count": 3311368 }, "sender-location": point("27.67,87.32"), "send-time": datetime("2007-02-05T16:39:13.000Z"), "send-time-copy": datetime("2007-02-05T16:39:13.000Z"), "referred-topics": {{ "t-mobile", "customer-service" }}, "message-text": " love t-mobile its customer-service is mind-blowing" }
+{ "tweetid": "5", "tweetid-copy": "5", "user": { "screen-name": "RollandEcstein#211", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "Rolland Eckhardst", "followers_count": 3311368 }, "sender-location": point("27.3,92.77"), "send-time": datetime("2010-09-12T06:15:28.000Z"), "send-time-copy": datetime("2010-09-12T06:15:28.000Z"), "referred-topics": {{ "t-mobile", "customization" }}, "message-text": " like t-mobile the customization is amazing:)" }
+{ "tweetid": "6", "tweetid-copy": "6", "user": { "screen-name": "Rollkhardstein#211", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "Kirk Hammette ", "followers_count": 3311368 }, "sender-location": point("45.62,84.78"), "send-time": datetime("2012-01-23T06:23:13.000Z"), "send-time-copy": datetime("2012-01-23T06:23:13.000Z"), "referred-topics": {{ "iphone", "network" }}, "message-text": " like iphone its network is awesome:)" }
+{ "tweetid": "7", "tweetid-copy": "7", "user": { "screen-name": "andEckhardstein#211", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "Rolland khardstein", "followers_count": 3311368 }, "sender-location": point("44.12,81.46"), "send-time": datetime("2012-02-17T17:30:26.000Z"), "send-time-copy": datetime("2012-02-17T17:30:26.000Z"), "referred-topics": {{ "t-mobile", "network" }}, "message-text": " hate t-mobile the network is bad" }
+{ "tweetid": "8", "tweetid-copy": "8", "user": { "screen-name": "Rolltein#211", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "Ron Eckhardstein", "followers_count": 3311368 }, "sender-location": point("36.86,90.71"), "send-time": datetime("2009-03-12T13:18:04.000Z"), "send-time-copy": datetime("2009-03-12T13:18:04.000Z"), "referred-topics": {{ "at&t", "touch-screen" }}, "message-text": " dislike at&t its touch-screen is OMG" }
+{ "tweetid": "9", "tweetid-copy": "9", "user": { "screen-name": "Roldstein#211", "lang": "en", "friends_count": 3657079, "statuses_count": 268, "name": "Rolland Eckdstein", "followers_count": 3311368 }, "sender-location": point("29.07,97.05"), "send-time": datetime("2012-08-15T20:19:46.000Z"), "send-time-copy": datetime("2012-08-15T20:19:46.000Z"), "referred-topics": {{ "verizon", "speed" }}, "message-text": " hate verizon its speed is bad" }
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index a9b8eef..43f535b 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -2698,6 +2698,21 @@
<output-dir compare="Text">query-issue350</output-dir>
</compilation-unit>
</test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue350-2">
+ <output-dir compare="Text">query-issue350-2</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue343">
+ <output-dir compare="Text">query-issue343</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue343-2">
+ <output-dir compare="Text">query-issue343-2</output-dir>
+ </compilation-unit>
+ </test-case>
</test-group>
<test-group name="quantifiers">
<test-case FilePath="quantifiers">