From 1c2069212a7dec30db45e02391d7ca0154cd5709 Mon Sep 17 00:00:00 2001 From: Ziv Scully Date: Sat, 7 Nov 2015 15:16:44 -0500 Subject: Fix some table renaming issues. --- caching-tests/test.ur | 52 +++++++++++++++++++++++++++++++++----------------- caching-tests/test.urp | 5 +++-- caching-tests/test.urs | 6 ++++-- 3 files changed, 41 insertions(+), 22 deletions(-) (limited to 'caching-tests') 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 _ => Hooray! You guessed it!} *) (* *) -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 - Reading {[id1]} and {[id2]}. - {case (res1, res2) of - (Some _, Some _) => Both are there. - | _ => One of them is missing.} - +(* 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 *) +(* Reading {[id1]} and {[id2]}. *) +(* {case (res1, res2) of *) +(* (Some _, Some _) => Both are there. *) +(* | _ => One of them is missing.} *) +(* *) fun flush id = dml (UPDATE tab @@ -44,14 +44,30 @@ fun flush id = Changed {[id]}! -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 - Changed specifically 17! + Maybe changed {[id]}? +fun floosh id = + dml (UPDATE tab + SET Id = {[id + 1]} + WHERE Id = {[id]}); + return + Shifted {[id]}! + + +(* val flush17 = *) +(* dml (UPDATE tab *) +(* SET Val = Val * (Id + 2) / Val - 3 *) +(* WHERE Id = 17); *) +(* return *) +(* Changed specifically 17! *) +(* *) + (* 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 *) -- cgit v1.2.3