namhnguyen / asterixdb

Automatically exported from code.google.com/p/asterixdb
0 stars 0 forks source link

Accessing item in orderedlist using non constant index returns AlgebricksException #773

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
let $i := 1
let $b := ["hello", "world"]
return $b[$i]

What is the expected output? What do you see instead?
it should return the second item in the list, which is "world". It throws an 
exception: "get-item: item index cannot be negative! [AlgebricksException]"

Please use labels and text to provide additional information.

Original issue reported on code.google.com by icetin...@gmail.com on 16 May 2014 at 12:14

GoogleCodeExporter commented 9 years ago

Original comment by icetin...@gmail.com on 16 May 2014 at 7:47

GoogleCodeExporter commented 9 years ago
For the record, this was a parser issue. Parser was only accepting literal 
expressions as the index. I fixed this issue in a611ac7575f0 by accepting all 
the expressions during parsing.

Original comment by icetin...@gmail.com on 16 May 2014 at 7:53