From 45591fac686d5cf947c250cec5f41a10f464aec6 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Sun, 11 Oct 2009 21:42:23 +0000 Subject: [PATCH] can live without library db --- helm/software/components/hmysql/hSql.ml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/helm/software/components/hmysql/hSql.ml b/helm/software/components/hmysql/hSql.ml index 329dd2205..583e082a1 100644 --- a/helm/software/components/hmysql/hSql.ml +++ b/helm/software/components/hmysql/hSql.ml @@ -138,10 +138,13 @@ let mysql_err = function let errno dbtype dbd = wrap - (fun d -> match List.assoc dbtype d with - | Mysql dbd -> mysql_err (HMysql.errno dbd) - | Sqlite dbd -> sqlite_err (HSqlite3.errno dbd) - | FakeMySql -> assert false) + (fun d -> + try + match List.assoc dbtype d with + | Mysql dbd -> mysql_err (HMysql.errno dbd) + | Sqlite dbd -> sqlite_err (HSqlite3.errno dbd) + | FakeMySql -> assert false + with Not_found -> OK) dbd ;; @@ -166,7 +169,10 @@ let escape_string_for_like dbtype dbd = let isMysql dbtype dbd = wrap - (fun d -> match List.assoc dbtype d with Mysql _ -> true | _ -> false) + (fun d -> + try + match List.assoc dbtype d with Mysql _ -> true | _ -> false + with Not_found -> false) dbd ;; -- 2.39.2