Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Patch upstream to add escape string function with charset parameter

  • Loading branch information...
commit 0f21c71fb8da9387a05a30e05ffd9f2baedb6ad0 1 parent 3e5ac28
@mscdex authored
View
2  deps/libmariadbclient/include/mysql.h
@@ -570,6 +570,8 @@ int STDCALL mysql_list_fields_cont(MYSQL_RES **ret, MYSQL *mysql,
int status);
unsigned long STDCALL mysql_escape_string(char *to,const char *from,
unsigned long from_length);
+unsigned long STDCALL mysql_escape_string_ex(char *to,const char *from,
+ unsigned long from_length,const char *set);
unsigned long STDCALL mysql_hex_string(char *to,const char *from,
unsigned long from_length);
unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
View
15 deps/libmariadbclient/libmysql/libmysql.c
@@ -1188,6 +1188,21 @@ mysql_escape_string(char *to,const char *from,ulong length)
return (uint) escape_string_for_mysql(default_charset_info, to, 0, from, length);
}
+/*
+ Add ability to specify character set
+*/
+
+ulong STDCALL
+mysql_escape_string_ex(char *to,const char *from,ulong length,const char *set)
+{
+ CHARSET_INFO *charset = default_charset_info;
+ if (set == "utf8")
+ charset = &my_charset_utf8_general_ci;
+ else if (set == "latin1")
+ charset = &my_charset_latin1;
+ return (uint) escape_string_for_mysql(charset, to, 0, from, length);
+}
+
ulong STDCALL
mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
ulong length)
Please sign in to comment.
Something went wrong with that request. Please try again.