| Mysql.No_such_table -> No_such_table
| Mysql.Table_exists_error -> Table_exists_error
| Mysql.Dup_keyname -> Dup_keyname
- | Mysql.No_such_table -> No_such_table
| Mysql.No_such_index -> No_such_index
| Mysql.Bad_table_error -> Bad_table_error
| _ -> GENERIC_ERROR "Mysql_generic_error"
let isMysql = true
+let escape_string_for_like = ("ESCAPE \"\\\\\"" : ('a,'b,'c,'a) format4);;
val escape: string -> string
+val escape_string_for_like: ('a,'b,'c,'a) format4
+
val isMysql : bool
;;
let isMysql = false
+
+let escape_string_for_like = ("ESCAPE \"\\\"" : ('a,'b,'c,'a) format4);;
HLog.debug "Warning SELECT without REGEXP";
sprintf
("SELECT source, h_occurrence FROM %s WHERE " ^^
- "h_occurrence LIKE '%s%%' ESCAPE \"\\\"")
+ "h_occurrence LIKE '%s%%' " ^^ HSql.escape_string_for_like)
obj_tbl buri*)
end
in
HLog.debug "Warning SELECT without REGEXP";
sprintf
("SELECT source, h_occurrence FROM %s WHERE " ^^
- "h_occurrence LIKE '%s%%' ESCAPE \"\\\" ")
+ "h_occurrence LIKE '%s%%' " ^^ HSql.escape_string_for_like)
obj_tbl buri
*)
end
Pcre.replace ~pat:"([^\\\\])_" ~templ:"$1\\_" (HSql.escape s)
in
let query = sprintf
- "SELECT source FROM %s WHERE source LIKE '%s#xpointer%%' ESCAPE \"\\\" "
+ ("SELECT source FROM %s WHERE source LIKE '%s#xpointer%%' "
+ ^^ HSql.escape_string_for_like)
name_tbl (escape (UriManager.string_of_uri uri))
in
let rc = HSql.exec dbd query in
Pcre.replace ~pat:"([^\\\\])_" ~templ:"$1\\_" (HSql.escape s)
in
let query s =
- sprintf "DELETE FROM %s WHERE source LIKE \"%s%%\" ESCAPE \"\\\" "
+ sprintf
+ ("DELETE FROM %s WHERE source LIKE \"%s%%\" " ^^
+ HSql.escape_string_for_like)
(tbl ()) (escape s)
in
List.iter
Pcre.replace ~pat:"([^\\\\])_" ~templ:"$1\\_" (HSql.escape s)
in
let query tbl =
- sprintf "DELETE FROM %s WHERE source LIKE \"%s%%\" ESCAPE \"\\\" "
+ sprintf
+ ("DELETE FROM %s WHERE source LIKE \"%s%%\" " ^^
+ HSql.escape_string_for_like)
(tbl ()) (escape uri)
in
ignore (HSql.exec dbd (query tbl))
in
let query =
Printf.sprintf
- ("SELECT source FROM %s WHERE source LIKE \"%s\" ESCAPE \"\\\" UNION "
- ^^
- "SELECT source FROM %s WHERE source LIKE \"%s\" ESCAPE \"\\\"")
+ ("SELECT source FROM %s WHERE source LIKE \"%s\" "
+ ^^ HSql.escape_string_for_like ^^ " UNION " ^^
+ "SELECT source FROM %s WHERE source LIKE \"%s\" "
+ ^^ HSql.escape_string_for_like)
(MetadataTypes.name_tbl ()) sql_pat
MetadataTypes.library_name_tbl sql_pat
in
let sql_pat = sqlpat_of_shellglob pat in
let query =
sprintf
- ("SELECT source FROM %s WHERE value LIKE \"%s\" ESCAPE \"\\\" "
- ^^ "UNION " ^^
- "SELECT source FROM %s WHERE value LIKE \"%s\" ESCAPE \"\\\" ")
+ ("SELECT source FROM %s WHERE value LIKE \"%s\" "
+ ^^ HSql.escape_string_for_like
+ ^^ " UNION " ^^
+ "SELECT source FROM %s WHERE value LIKE \"%s\" "
+ ^^ HSql.escape_string_for_like)
(MetadataTypes.name_tbl ()) (escape sql_pat)
MetadataTypes.library_name_tbl (escape sql_pat)
in