summaryrefslogtreecommitdiff
path: root/tests/policy.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-04-04 17:18:41 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-04-04 17:18:41 -0400
commit7e8e31fc6375ba9a0b9db891c3ecbc89fbf6d374 (patch)
tree256d88decd7a8c8d4f86cb636b841dbfd544c2d0 /tests/policy.ur
parent20f0e57e0e9e418ef08ce8bdb202b6d10de1c86b (diff)
WHERE-dependent checking
Diffstat (limited to 'tests/policy.ur')
-rw-r--r--tests/policy.ur9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/policy.ur b/tests/policy.ur
index b821d1d1..9cc230bf 100644
--- a/tests/policy.ur
+++ b/tests/policy.ur
@@ -8,8 +8,11 @@ table order : { Id : order, Fruit : fruit, Qty : int, Code : int }
PRIMARY KEY Id,
CONSTRAINT Fruit FOREIGN KEY Fruit REFERENCES fruit(Id)
-policy query_policy (SELECT fruit.Id, fruit.Nam, fruit.Weight FROM fruit)
-policy query_policy (SELECT order.Id, order.Fruit, order.Qty FROM order)
+policy query_policy (SELECT fruit.Id, fruit.Nam, fruit.Weight
+ FROM fruit)
+policy query_policy (SELECT order.Id, order.Fruit, order.Qty
+ FROM order, fruit
+ WHERE order.Fruit = fruit.Id)
fun main () =
x1 <- queryX (SELECT fruit.Id, fruit.Nam
@@ -18,7 +21,7 @@ fun main () =
x2 <- queryX (SELECT fruit.Nam, order.Qty
FROM fruit, order
- WHERE order.Fruit = fruit.Id)
+ WHERE fruit.Id = order.Fruit)
(fn x => <xml><li>{[x.Fruit.Nam]}: {[x.Order.Qty]}</li></xml>);
return <xml><body>