set max 100
#
#   Forward tests
#
test select sequence from alltypes where timestamp between '2011-1-1 0:0:0.001'd and '2011-1-1 0:0:2.001'd
>_,TIMESTAMP,SYMBOL,TYPE,sequence
0,2011-01-01 00:00:00.001,S1,0
1,2011-01-01 00:00:01,S0,1
2,2011-01-01 00:00:01,S1,1
3,2011-01-01 00:00:02,S0,2
4,2011-01-01 00:00:02.001,S1,2
!end
#
#   End limit with runtime filter
#
test select sequence from alltypes where sequence > 1 and timestamp <= '2011-1-1 0:0:4.001'd
>_,TIMESTAMP,SYMBOL,TYPE,sequence
0,2011-01-01 00:00:02,S0,2
1,2011-01-01 00:00:02.001,S1,2
2,2011-01-01 00:00:03,S0,3
3,2011-01-01 00:00:03,S1,3
4,2011-01-01 00:00:04,S0,4
5,2011-01-01 00:00:04.001,S1,4
!end
#
#   Reverse tests
#
test select sequence from reverse (alltypes) where timestamp between '2011-1-1 0:0:0.001'd and '2011-1-1 0:0:2.001'd
>_,TIMESTAMP,SYMBOL,TYPE,sequence
0,2011-01-01 00:00:02.001,S1,2
1,2011-01-01 00:00:02,S0,2
2,2011-01-01 00:00:01,S1,1
3,2011-01-01 00:00:01,S0,1
4,2011-01-01 00:00:00.001,S1,0
!end
#
#   Combine start limit with runtime filter
#
test select sequence from reverse (alltypes) where sequence > 1 and timestamp < '2011-1-1 0:0:4.02'd
>_,TIMESTAMP,SYMBOL,TYPE,sequence
0,2011-01-01 00:00:04.001,S1,4
1,2011-01-01 00:00:04,S0,4
2,2011-01-01 00:00:03,S1,3
3,2011-01-01 00:00:03,S0,3
4,2011-01-01 00:00:02.001,S1,2
5,2011-01-01 00:00:02,S0,2
!end
