- try
- let rc = Mysql.exec dbd dbg_q in
- let l = ref [] in
- Mysql.iter rc (fun a -> match a.(0) with None ->()|Some a -> l := a:: !l);
- let l = List.sort Pervasives.compare !l in
- MatitaMisc.list_uniq l
- with
- exn -> raise exn (* no errors should be accepted *)
+ if Hashtbl.mem cache_of_processed_baseuri buri then
+ []
+ else
+ begin
+ Hashtbl.add cache_of_processed_baseuri buri true;
+ let query =
+ let buri = buri ^ "/" in
+ let buri = Mysql.escape buri in
+ let obj_tbl = MetadataTypes.obj_tbl () in
+ Printf.sprintf
+ "SELECT source FROM %s WHERE h_occurrence LIKE '%s%%'" obj_tbl buri
+ in
+ try
+ let rc = Mysql.exec dbd query in
+ let l = ref [] in
+ Mysql.iter rc (fun a -> match a.(0) with None ->()|Some a -> l:=a:: !l);
+ let l = List.sort Pervasives.compare !l in
+ MatitaMisc.list_uniq l
+ with
+ exn -> raise exn (* no errors should be accepted *)
+ end