First iteration - Added FLWOR expression tests

git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization@547 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/runtimets/ignore.txt b/asterix-app/src/test/resources/runtimets/ignore.txt
index 1cf8519..784be19 100644
--- a/asterix-app/src/test/resources/runtimets/ignore.txt
+++ b/asterix-app/src/test/resources/runtimets/ignore.txt
@@ -37,3 +37,4 @@
 quantifiers/somesat_05.aql
 quantifiers/everysat_02.aql
 quantifiers/everysat_03.aql
+flwor
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for01.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for01.aql
new file mode 100644
index 0000000..046c55f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for01.aql
@@ -0,0 +1,9 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  23rd July 2012
+ */
+
+for $a in [1,2,3,4,5,6,7,8,9]
+where not(false)
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for02.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for02.aql
new file mode 100644
index 0000000..aa75cfa
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for02.aql
@@ -0,0 +1,9 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [[1,2,3,4,5,6,7,8,9],[20,30,40,50,60,70,80]]
+where true
+return for $b in $a where $b > 5 and $b <70 return $b
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for03.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for03.aql
new file mode 100644
index 0000000..00bf474
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for03.aql
@@ -0,0 +1,8 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [[1,2,3,4,5,6,7,8,9,0],["r","t","w","a"],[11,34,56,78,98,01,12,34,56,76,83],[null,null,null],[" ","","    "],["at"],[-1],[0]]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for04.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for04.aql
new file mode 100644
index 0000000..0d26a37
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for04.aql
@@ -0,0 +1,9 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [[1,2,3,4,5,6,7,8,9,0],[11,34,56,78,98,01,12,34,56,76,83],[null,null,null,"and","bat","gone","do"],[" ","","    "],["at"],[-1],[0]]
+where len($a) > 1
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for05.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for05.aql
new file mode 100644
index 0000000..f2f1ca3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for05.aql
@@ -0,0 +1,9 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [1,2,3,4,5,6,7,8,9]
+where ()
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for06.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for06.aql
new file mode 100644
index 0000000..9cc9fe3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for06.aql
@@ -0,0 +1,9 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [1,2,3,4,5,6,7,8,9]
+where $undefined
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for07.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for07.aql
new file mode 100644
index 0000000..9639c60
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for07.aql
@@ -0,0 +1,8 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [{"name":"Bob","age":10,"sex":"Male"},{"name":"John","age":45,"sex":"Female"},{"name":"Raj","age":35,"sex":"Male"}]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for08.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for08.aql
new file mode 100644
index 0000000..f0e0191
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for08.aql
@@ -0,0 +1,9 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [{"name":"Bob","age":10,"sex":"Male"},{"name":"John","age":45,"sex":"Female"},{"name":"Raj","age":35,"sex":"Male"}]
+where $a.name="John"
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for09.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for09.aql
new file mode 100644
index 0000000..872257f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for09.aql
@@ -0,0 +1,9 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [{"name":"Bob","age":10,"sex":"Male"},{"name":"John","age":45,"sex":"Female"},{"name":"Raj","age":35,"sex":"Male"}]
+where $a.name="Tom"
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for10.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for10.aql
new file mode 100644
index 0000000..99c96b4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for10.aql
@@ -0,0 +1,8 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [{"name":"Bob","age":10,"sex":"Male"},{"name":"John","age":45,"sex":"Female"},{"name":"Raj","age":35,"sex":"Male"}]
+return {"a":$a,"additional-data":{{"this is additional data","this is too","and this is additional too"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for11.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for11.aql
new file mode 100644
index 0000000..f2c8ade
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for11.aql
@@ -0,0 +1,8 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [true,true,false,true]
+return {{"this is additional data","this is too","and this is additional too"}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for12.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for12.aql
new file mode 100644
index 0000000..609af54
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for12.aql
@@ -0,0 +1,9 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [true,true,false,true]
+return {"a":{{"this is additional data","this is too","and this is additional too"}},"b":{{"this is additional data","this is too","and this is additional too"}}}
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for13.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for13.aql
new file mode 100644
index 0000000..307995b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for13.aql
@@ -0,0 +1,8 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [true]
+return {{"this is additional data","this is too","and this is additional too"}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for14.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for14.aql
new file mode 100644
index 0000000..bd9eff7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for14.aql
@@ -0,0 +1,8 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [{"name":"Rocky","age":59,"sex":"M"},["job","ink","king","ontario","lavelle"],[1,4,5,6,7,8,9,2,3,4,5,6,7],{{"extra data","extra data","extra data"}}]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for15.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for15.aql
new file mode 100644
index 0000000..5e8f9786
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for15.aql
@@ -0,0 +1,8 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [{"name":"Rocky","age":59,"sex":"M"},[1]]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for16.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for16.aql
new file mode 100644
index 0000000..790f9ce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for16.aql
@@ -0,0 +1,8 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $a in [[[1,2],[3]],[[4,5],[6,7]],[[8,9],[10,11]],[[12,13],[14]],[[15],[16,17]],[[18],[19,20]]]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let01.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let01.aql
new file mode 100644
index 0000000..9836f85
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let01.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $x := int64("92233720368547758")
+return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let02.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let02.aql
new file mode 100644
index 0000000..a0f936f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let02.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $x := 92233720368547758
+return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let03.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let03.aql
new file mode 100644
index 0000000..4cb816b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let03.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $x := int64("92233720368547758")+1
+return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let04.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let04.aql
new file mode 100644
index 0000000..4832e2c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let04.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $x := double("1.7976931348623157E308") 
+return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let05.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let05.aql
new file mode 100644
index 0000000..d8d3023
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let05.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $x := {"a":(1+1*(100/20))}
+return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let06.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let06.aql
new file mode 100644
index 0000000..2d443a9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let06.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $x := 1
+let $y := $x+1
+return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let07.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let07.aql
new file mode 100644
index 0000000..894b1da
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let07.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $x := 1
+let $y := ($x+1)
+return $y
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let08.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let08.aql
new file mode 100644
index 0000000..687cc51
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let08.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $x:=[1,2,3]
+for $b in $x
+let $y:=$b+1
+return $y
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let09.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let09.aql
new file mode 100644
index 0000000..2d4439b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let09.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+for $a in range(1,100)
+where $a%5=0
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let10.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let10.aql
new file mode 100644
index 0000000..208a478
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let10.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $x:=[1,2,3,4,5,6,7,8,9,10,11,14,15,17,19,24,35,56,67,77,89,60,35,25,60]
+for $y in $x
+where $y%5=0
+return $y
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let11.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let11.aql
new file mode 100644
index 0000000..1a96ff3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let11.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+// Return an ordered list comprising of records and other values
+
+let $a := ["a",{"i":1},"b",{"j":2},"c",{"k":3}]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let12.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let12.aql
new file mode 100644
index 0000000..6b80062
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let12.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $a := 1 
+let $b := $a
+let $c := $a+$b 
+return ($c)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let13.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let13.aql
new file mode 100644
index 0000000..8722947
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let13.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+// Bind an undefined variable.
+
+let $a := $b 
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let14.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let14.aql
new file mode 100644
index 0000000..b0cdcad
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let14.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+// nested ordered list
+
+let $a := [[[[[[[[[[[[1,2,3,4,5,6,7,8,9,10],[3,4,5,6,7,8,9,0,0],int64("9222872036854775809")]]]]]]]]]]]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let15.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let15.aql
new file mode 100644
index 0000000..317726a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let15.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+// nested ordered list comprising of only one integer value.
+
+let $a := [[[[[[[[[[[int64("9222872036854775809")]]]]]]]]]]]
+return ($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let16.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let16.aql
new file mode 100644
index 0000000..122d3ee
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let16.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $a := [[[[[[[[[[[int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809"),int64("9222872036854775809")]]]]]]]]]]]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let17.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let17.aql
new file mode 100644
index 0000000..4f9be6f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let17.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $a := ["and","here","we","are",["this is new","stuff"]]
+return $a
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let18.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let18.aql
new file mode 100644
index 0000000..c50c871
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let18.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+// An ordered list comprising of an un ordered list.
+
+let $a:=[{{"John Doe",45,"HR",60000,"Separation"}}]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let19.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let19.aql
new file mode 100644
index 0000000..d3fbafc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let19.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+let $a:={{"John Doe",45,"HR",60000,"Separation"}}
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let20.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let20.aql
new file mode 100644
index 0000000..22814e6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let20.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     :  Test let clause
+ * Expected Result :  Success
+ * Date            :  6th July 2012 
+ */
+
+// An ordered list of un ordered lists, records and ordered list.
+
+let $a:=[{{"John Doe",45,"HR",60000,"Separation"}},{"name":"Roger Sanders","age":50,"dept":"DB2-Books","designatin":"Author"},["DB2 for Z/OS","DB2 for LUW","DB2 9 Application Development","DB2 9 DBA","DB2 for Dummies"]]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let21.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let21.aql
new file mode 100644
index 0000000..81f93be
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let21.aql
@@ -0,0 +1,16 @@
+/*
+ * Description      :  Test let clause
+ * Expected Result  :  Success
+ * Date             :  23rd July 2012
+ */
+
+
+// Ordered list of boolean values.
+
+let $a := [boolean("true"),boolean("false"),boolean("true"),boolean("false")]
+let $b := [boolean("false"),boolean("true"),boolean("false"),boolean("true")]
+for $m in $a
+for $n in $b
+where $m=not($n)
+return $m
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let22.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let22.aql
new file mode 100644
index 0000000..da33601
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let22.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     : Test length of null returned by len() function  
+ * Expected Result : Success
+ * Date            : 23rd July 2012
+ */
+
+let $a := [null]
+return len($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let23.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let23.aql
new file mode 100644
index 0000000..07ea21b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let23.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     : Test length of ordered list
+ * Expected Result : Success
+ * Date            : 23rd July 2012
+ */
+
+let $a := [1,2,3,4,5,6,7,8,9,null]
+return len($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let24.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let24.aql
new file mode 100644
index 0000000..9bfe510
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let24.aql
@@ -0,0 +1,20 @@
+/*
+ *  Description     : Test let clause
+ *  Expected Result : Success
+ *  Date            : 23rd July 2012
+ */
+
+/*
+ * m - closed record
+ * n - closed record with null
+ * o - open data
+ * p - open data with null
+ * q - nested record
+ */
+
+let $m := {"name":"Holmes S","age":25,"sex":"M"}
+let $n := {"name":"Bob","age":35,"sex":null}
+let $o := {{"John",45,"M"}}
+let $p := {{"Optional data goes here",null}}
+let $q := { "id":1345,"test":{"name":"Federer","age":35},"foo":"foo" }
+return { "m":$m,"n":$n,"o":$o, "p":$p,"q":$q }
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let25.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let25.aql
new file mode 100644
index 0000000..e2b88da
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let25.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test let clause
+ * Expected Result : Success
+ * Date            : 23rd July 2012
+ */
+
+let $a := true or false
+let $b := (true or false) and not(false)
+return {"a":$a,"b":$b}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let26.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let26.aql
new file mode 100644
index 0000000..a8afffe
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let26.aql
@@ -0,0 +1,14 @@
+/*
+ * Description     : Test let clause 
+ * Expected Result : Success 
+ * Date            : 23rd July 2012
+ */
+
+/*
+ * Test let clause - let variable := relational expression
+ */
+
+let $a := 10 > 9
+let $b := ((100 * 100)/10 -1999) > 3900
+let $c := true != false
+return {"a":$a,"b":$b,"c":$c}
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let27.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let27.aql
new file mode 100644
index 0000000..5cfc1a7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let27.aql
@@ -0,0 +1,10 @@
+/*
+ * Description     : Test let clause 
+ * Expected Result : Success 
+ * Date            : 23rd July 2012 
+ */
+
+// Bind arithmetic expressions to variable using let clause
+
+let $a := [(100+100),(100-100),(100 * 100),(100 / 100),(100 %10)] 
+return $a