From: Claudio Sacerdoti Coen Date: Tue, 9 Mar 2004 10:34:31 +0000 (+0000) Subject: Bug fixed: instead of generating "not ()", I generate "true" (for PostGresql) X-Git-Tag: v0_0_4~30 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=4a324741ecde2a78df8d0ef31d197af96b97472d;p=helm.git Bug fixed: instead of generating "not ()", I generate "true" (for PostGresql) and "1" for Mysql. --- diff --git a/helm/ocaml/mathql_interpreter/mQIMySql.ml b/helm/ocaml/mathql_interpreter/mQIMySql.ml index 59d1ccf97..170a2dfe5 100644 --- a/helm/ocaml/mathql_interpreter/mQIMySql.ml +++ b/helm/ocaml/mathql_interpreter/mQIMySql.ml @@ -46,6 +46,7 @@ let quote s = let exec c q = let g = function None -> "" | Some v -> v in let f a = List.map g (Array.to_list a) in +prerr_endline ("###\n" ^ q); Mysql.map ~f:f (Mysql.exec c q), q let exec c table cols ct cfl = @@ -66,7 +67,8 @@ let exec c table cols ct cfl = else "1" in let pg_cons l = iter pg_con " and " l in - let pg_cons_not l = "not (" ^ pg_cons l ^ ")" in + let pg_cons_not l = + match l with [] -> "1" | _ -> "not (" ^ pg_cons l ^ ")" in let pg_cons_not_l ll = iter pg_cons_not " and " ll in let pg_where = match ct, cfl with | [], [] -> "" diff --git a/helm/ocaml/mathql_interpreter/mQIPostgres.ml b/helm/ocaml/mathql_interpreter/mQIPostgres.ml index f983a5862..932fcc503 100644 --- a/helm/ocaml/mathql_interpreter/mQIPostgres.ml +++ b/helm/ocaml/mathql_interpreter/mQIPostgres.ml @@ -65,7 +65,8 @@ let exec c table cols ct cfl = else "true" in let pg_cons l = iter pg_con " and " l in - let pg_cons_not l = "not (" ^ pg_cons l ^ ")" in + let pg_cons_not l = + match l with [] -> "true" | _ -> "not (" ^ pg_cons l ^ ")" in let pg_cons_not_l ll = iter pg_cons_not " and " ll in let pg_where = match ct, cfl with | [], [] -> ""