# HG changeset patch # User Adam Chlipala # Date 1218923410 14400 # Node ID 36fef91a6bbf2d96972884f24b6a56bb10cafd82 # Parent 79819a6346e2273a3c50d1471a8d7d882defb8aa Integer and float constants in SQL diff -r 79819a6346e2 -r 36fef91a6bbf src/lacweb.grm --- a/src/lacweb.grm Sat Aug 16 17:46:26 2008 -0400 +++ b/src/lacweb.grm Sat Aug 16 17:50:10 2008 -0400 @@ -684,6 +684,13 @@ EVar (["Basis"], "sql_bool"), s (FALSEleft, FALSEright))) + | INT (sql_inject (EPrim (Prim.Int INT), + EVar (["Basis"], "sql_int"), + s (INTleft, INTright))) + | FLOAT (sql_inject (EPrim (Prim.Float FLOAT), + EVar (["Basis"], "sql_float"), + s (FLOATleft, FLOATright))) + | tident DOT fident (let val loc = s (tidentleft, fidentright) val e = (EVar (["Basis"], "sql_field"), loc) diff -r 79819a6346e2 -r 36fef91a6bbf tests/where.lac --- a/tests/where.lac Sat Aug 16 17:46:26 2008 -0400 +++ b/tests/where.lac Sat Aug 16 17:50:10 2008 -0400 @@ -8,4 +8,4 @@ val q5 = (SELECT * FROM t1 WHERE {1} = {1}) val q6 = (SELECT * FROM t1 WHERE {"Hi"} < {"Bye"}) val q7 = (SELECT * FROM t1 WHERE {1} <> {1} AND NOT ({"Hi"} >= {"Bye"})) -val q8 = (SELECT * FROM t1 WHERE t1.A = {1}) +val q8 = (SELECT * FROM t1 WHERE t1.A = 1 OR t1.C < 3.0)