Bryan O'Sullivan avatar Bryan O'Sullivan committed e4550b3

Block signals for mysql_real_query.

Comments (0)

Files changed (3)

Database/MySQL/Base/C.hsc

 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

cbits/mysql_signals.c

     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;

include/mysql_signals.h

 				      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,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.