X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Flibrary%2FlibraryClean.ml;h=46e2dd18cc2c8d56ca72fa56d2bb52082eba3675;hb=5d5a1108d6c8198fc8425b914db803009941785a;hp=54aa860c9b290acb5b72bd86d7ca31983e0fd1d8;hpb=b3779638cd49747f4b71784fba57cfb0a56297f5;p=helm.git diff --git a/components/library/libraryClean.ml b/components/library/libraryClean.ml index 54aa860c9..46e2dd18c 100644 --- a/components/library/libraryClean.ml +++ b/components/library/libraryClean.ml @@ -51,17 +51,20 @@ let one_step_depend suri = let buri = buri ^ "/" in let buri = HSql.escape buri in let obj_tbl = MetadataTypes.obj_tbl () in - if HSql.isMysql then - sprintf ("SELECT source, h_occurrence FROM %s WHERE " - ^^ "h_occurrence REGEXP '^%s[^/]*$'") obj_tbl buri - else - begin + if HSql.isMysql then + sprintf ("SELECT source, h_occurrence FROM %s WHERE " + ^^ "h_occurrence REGEXP '^%s[^/]*$'") obj_tbl buri + else + begin + sprintf ("SELECT source, h_occurrence FROM %s WHERE " + ^^ "REGEXP(h_occurrence, '^%s[^/]*$')") obj_tbl buri + (* implementation with vanilla ocaml-sqlite3 HLog.debug "Warning SELECT without REGEXP"; - sprintf - ("SELECT source, h_occurrence FROM %s WHERE " ^^ - "h_occurrence LIKE '%s%%'") - obj_tbl buri - end + sprintf + ("SELECT source, h_occurrence FROM %s WHERE " ^^ + "h_occurrence LIKE '%s%%'") + obj_tbl buri*) + end in try let rc = HSql.exec (LibraryDb.instance ()) query in @@ -94,11 +97,15 @@ let db_uris_of_baseuri buri = ^^ "source REGEXP '^%s[^/]*$'") obj_tbl buri else begin + sprintf ("SELECT source FROM %s WHERE " + ^^ "REGEXP(source, '^%s[^/]*$')") obj_tbl buri + (* implementation with vanilla ocaml-sqlite3 HLog.debug "Warning SELECT without REGEXP"; sprintf ("SELECT source, h_occurrence FROM %s WHERE " ^^ "h_occurrence LIKE '%s%%'") obj_tbl buri + *) end in try