From 7c1f922d7f3b4f6538892eb4a96c9fa6e33fac0a Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 4 Feb 2003 12:14:03 +0000 Subject: [PATCH] Bug fixed: "'" must be quoted. --- helm/ocaml/mathql_interpreter/pattern.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helm/ocaml/mathql_interpreter/pattern.ml b/helm/ocaml/mathql_interpreter/pattern.ml index 5fddf5729..9809552a0 100644 --- a/helm/ocaml/mathql_interpreter/pattern.ml +++ b/helm/ocaml/mathql_interpreter/pattern.ml @@ -38,7 +38,10 @@ let rec pattern_ex l = [] -> [] | s::tl -> let result = let c = pgc () in - let qq = "select uri from registry where uri ~ '" ^ s ^ "' order by registry.uri asc" in + let quoted_s = + Str.global_substitute (Str.regexp "'") + (function _ -> "\\'") s in + let qq = "select uri from registry where uri ~ '" ^ quoted_s ^ "' order by registry.uri asc" in let res = c#exec (qq) in List.map (function uri -> (List.hd uri,[])) res#get_list (*for i = 0 to res#ntuples do -- 2.39.2