Permalink
Browse files

Block signals for mysql_real_query.

  • Loading branch information...
1 parent 71aaa21 commit c2a506211108aa3ab6eb4372cece8b76a03a85dc @bos bos committed Jun 3, 2011
Showing with 13 additions and 1 deletion.
  1. +1 −1 Database/MySQL/Base/C.hsc
  2. +10 −0 cbits/mysql_signals.c
  3. +2 −0 include/mysql_signals.h
@@ -199,7 +199,7 @@ foreign import ccall safe mysql_get_ssl_cipher
foreign import ccall unsafe mysql_stat
:: Ptr MYSQL -> IO CString
-foreign import ccall unsafe mysql_real_query
+foreign import ccall unsafe "mysql_signals.h _hs_mysql_real_query" mysql_real_query
:: Ptr MYSQL -> CString -> CULong -> IO CInt
foreign import ccall safe mysql_insert_id
View
@@ -66,6 +66,16 @@ int STDCALL _hs_mysql_ping(MYSQL *mysql)
return ret;
}
+int STDCALL _hs_mysql_real_query(MYSQL *mysql, const char *q,
+ unsigned long length)
+{
+ int ret;
+ block_rts_signals();
+ ret = mysql_real_query(mysql, q, length);
+ unblock_rts_signals();
+ return ret;
+}
+
const char *STDCALL _hs_mysql_stat(MYSQL *mysql)
{
const char *ret;
View
@@ -17,6 +17,8 @@ MYSQL *STDCALL _hs_mysql_real_connect(MYSQL *mysql, const char *host,
unsigned long clientflag);
void STDCALL _hs_mysql_close(MYSQL *sock);
int STDCALL _hs_mysql_ping(MYSQL *mysql);
+int STDCALL _hs_mysql_real_query(MYSQL *mysql, const char *q,
+ unsigned long length);
const char *STDCALL _hs_mysql_stat(MYSQL *mysql);
my_bool STDCALL _hs_mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
my_bool STDCALL _hs_mysql_change_user(MYSQL *mysql, const char *user,

0 comments on commit c2a5062

Please sign in to comment.