diff options
author | Ziv Scully <ziv@mit.edu> | 2015-11-07 15:16:44 -0500 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2015-11-07 15:16:44 -0500 |
commit | 1c2069212a7dec30db45e02391d7ca0154cd5709 (patch) | |
tree | 031e8368063250a3b59a5e1021b9347530f1831c /caching-tests | |
parent | b2c1c524f9074637cfbedc07a065f2c75d635e73 (diff) |
Fix some table renaming issues.
Diffstat (limited to 'caching-tests')
-rw-r--r-- | caching-tests/test.ur | 52 | ||||
-rw-r--r-- | caching-tests/test.urp | 5 | ||||
-rw-r--r-- | caching-tests/test.urs | 6 |
3 files changed, 41 insertions, 22 deletions
diff --git a/caching-tests/test.ur b/caching-tests/test.ur index 338f9236..e08c6e47 100644 --- a/caching-tests/test.ur +++ b/caching-tests/test.ur @@ -1,4 +1,4 @@ -table tab : {Id : int, Val : int} PRIMARY KEY Id +table tab : {Id : int, Val : int, Foo : int} PRIMARY KEY Id fun cache id = res <- oneOrNoRows (SELECT tab.Val @@ -22,19 +22,19 @@ fun cache id = (* | Some _ => <xml>Hooray! You guessed it!</xml>} *) (* </body></xml> *) -fun cache2 id1 id2 = - res1 <- oneOrNoRows (SELECT tab.Val - FROM tab - WHERE tab.Id = {[id1]}); - res2 <- oneOrNoRows (SELECT tab.Val - FROM tab - WHERE tab.Id = {[id2]}); - return <xml><body> - Reading {[id1]} and {[id2]}. - {case (res1, res2) of - (Some _, Some _) => <xml>Both are there.</xml> - | _ => <xml>One of them is missing.</xml>} - </body></xml> +(* fun cache2 id1 id2 = *) +(* res1 <- oneOrNoRows (SELECT tab.Val *) +(* FROM tab *) +(* WHERE tab.Id = {[id1]}); *) +(* res2 <- oneOrNoRows (SELECT tab.Val *) +(* FROM tab *) +(* WHERE tab.Id = {[id2]}); *) +(* return <xml><body> *) +(* Reading {[id1]} and {[id2]}. *) +(* {case (res1, res2) of *) +(* (Some _, Some _) => <xml>Both are there.</xml> *) +(* | _ => <xml>One of them is missing.</xml>} *) +(* </body></xml> *) fun flush id = dml (UPDATE tab @@ -44,14 +44,30 @@ fun flush id = Changed {[id]}! </body></xml> -val flush17 = +fun flash id = dml (UPDATE tab - SET Val = Val * (Id + 2) / Val - 3 - WHERE Id = 17); + SET Foo = Val + WHERE Id = {[id]} OR Id = {[id - 1]} OR Id = {[id + 1]}); return <xml><body> - Changed specifically 17! + Maybe changed {[id]}? </body></xml> +fun floosh id = + dml (UPDATE tab + SET Id = {[id + 1]} + WHERE Id = {[id]}); + return <xml><body> + Shifted {[id]}! + </body></xml> + +(* val flush17 = *) +(* dml (UPDATE tab *) +(* SET Val = Val * (Id + 2) / Val - 3 *) +(* WHERE Id = 17); *) +(* return <xml><body> *) +(* Changed specifically 17! *) +(* </body></xml> *) + (* fun flush id = *) (* res <- oneOrNoRows (SELECT tab.Val *) (* FROM tab *) diff --git a/caching-tests/test.urp b/caching-tests/test.urp index 55b0bed7..62041bdd 100644 --- a/caching-tests/test.urp +++ b/caching-tests/test.urp @@ -1,7 +1,8 @@ database test.db sql test.sql safeGet Test/flush -safeGet Test/flush17 -minHeap 4096 +safeGet Test/flash +safeGet Test/floosh +# safeGet Test/flush17 test diff --git a/caching-tests/test.urs b/caching-tests/test.urs index fc23c47d..ebe6bf56 100644 --- a/caching-tests/test.urs +++ b/caching-tests/test.urs @@ -1,4 +1,6 @@ val cache : int -> transaction page -val cache2 : int -> int -> transaction page +(* val cache2 : int -> int -> transaction page *) val flush : int -> transaction page -val flush17 : transaction page +val flash : int -> transaction page +val floosh : int -> transaction page +(* val flush17 : transaction page *) |