summaryrefslogtreecommitdiff
path: root/tests/order_by.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 16:03:43 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 16:03:43 -0400
commit578034280bdf2b7172e71b3f36b6db6db3ce53eb (patch)
tree73facc99e21a2bc100176cc5b210a3a152eefe1c /tests/order_by.ur
parent003594fd2ed4739b9f1fdc8df350615fdc11a3f7 (diff)
Monoize ORDER BY
Diffstat (limited to 'tests/order_by.ur')
-rw-r--r--tests/order_by.ur22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/order_by.ur b/tests/order_by.ur
index f2b501c4..dbe041c2 100644
--- a/tests/order_by.ur
+++ b/tests/order_by.ur
@@ -10,6 +10,26 @@ val q3 = (SELECT t1.B FROM t1
val q4 = (SELECT t1.A, t2.D, t1.A < t2.D AS Lt
FROM t1, t2
ORDER BY Lt)
-val q5 = (SELECT t1.A, t2.D, t1.A < t2.D AS Lt
+val q5 = (SELECT t1.A, t1.B, t2.D, t1.A < t2.D AS Lt
FROM t1, t2
ORDER BY t1.A, Lt, t2.D)
+
+
+datatype list a = Nil | Cons of a * list a
+
+val r1 : transaction (list string) =
+ query q5
+ (fn fs acc => return (Cons (fs.T1.B, acc)))
+ Nil
+
+val r2 : transaction string =
+ ls <- r1;
+ return (case ls of
+ Nil => "Problem"
+ | Cons (b, _) => b)
+
+val main : unit -> transaction page = fn () =>
+ s <- r2;
+ return <html><body>
+ {cdata s}
+ </body></html>