From 4a324741ecde2a78df8d0ef31d197af96b97472d Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 9 Mar 2004 10:34:31 +0000 Subject: [PATCH] Bug fixed: instead of generating "not ()", I generate "true" (for PostGresql) and "1" for Mysql. --- helm/ocaml/mathql_interpreter/mQIMySql.ml | 4 +++- helm/ocaml/mathql_interpreter/mQIPostgres.ml | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) 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 | [], [] -> "" -- 2.39.2