# HG changeset patch # User Adam Chlipala # Date 1220806713 14400 # Node ID 5dc11235129d555d6acb59b2c02072bd607d340e # Parent 1afa94582275dc23f4532c2544a23441791946f4 Reading bools from SQL diff -r 1afa94582275 -r 5dc11235129d src/c/urweb.c --- a/src/c/urweb.c Sun Sep 07 12:56:46 2008 -0400 +++ b/src/c/urweb.c Sun Sep 07 12:58:33 2008 -0400 @@ -808,9 +808,9 @@ } lw_Basis_bool lw_Basis_stringToBool_error(lw_context ctx, lw_Basis_string s) { - if (!strcasecmp (s, "True")) + if (!strcasecmp(s, "T") || !strcasecmp (s, "True")) return lw_Basis_True; - else if (!strcasecmp (s, "False")) + else if (!strcasecmp(s, "F") || !strcasecmp (s, "False")) return lw_Basis_False; else lw_error(ctx, FATAL, "Can't parse bool: %s", s); diff -r 1afa94582275 -r 5dc11235129d tests/pquery.ur --- a/tests/pquery.ur Sun Sep 07 12:56:46 2008 -0400 +++ b/tests/pquery.ur Sun Sep 07 12:58:33 2008 -0400 @@ -1,13 +1,14 @@ -table t1 : {A : int, B : string, C : float} +table t1 : {A : int, B : string, C : float, D : bool} fun lookup (inp : {B : string}) = s <- query (SELECT * FROM t1 WHERE t1.B = {inp.B}) (fn fs _ => return fs.T1) - {A = 0, B = "Couldn't find it!", C = 0.0}; + {A = 0, B = "Couldn't find it!", C = 0.0, D = False}; return A: {cdata (show _ s.A)}
B: {cdata (show _ s.B)}
C: {cdata (show _ s.C)}
+ D: {cdata (show _ s.D)}
fun main () : transaction page = return