Only in /tmp/multi/DBD-mysql-4.031/: DBD-mysql-4.031.diff
diff -ur /tmp/orig/DBD-mysql-4.031/dbdimp.c /tmp/multi/DBD-mysql-4.031/dbdimp.c
--- orig/DBD-mysql-4.031/dbdimp.c	2015-01-27 16:26:55.000000000 +0100
+++ multi/DBD-mysql-4.031/dbdimp.c	2015-07-30 11:11:25.478816949 +0200
@@ -1932,11 +1932,13 @@
       PerlIO_printf(DBIc_LOGPIO(imp_xxh), "imp_dbh->mysql_dr_connect: client_flags = %d\n",
 		    client_flag);
 
+    perlinterp_release ();
 #if MYSQL_VERSION_ID >= MULTIPLE_RESULT_SET_VERSION
     client_flag|= CLIENT_MULTI_RESULTS;
 #endif
     result = mysql_real_connect(sock, host, user, password, dbname,
 				portNr, mysql_socket, client_flag);
+    perlinterp_acquire ();
     if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
       PerlIO_printf(DBIc_LOGPIO(imp_xxh), "imp_dbh->mysql_dr_connect: <-");
 
@@ -3323,6 +3325,7 @@
       return -2;
     }
 
+    perlinterp_release ();
     strncpy(table, sbuf, slen);
     sbuf= table;
 
@@ -3336,6 +3339,7 @@
     *result= mysql_list_fields(svsock, table, NULL);
 
     free(table);
+    perlinterp_acquire ();
 
     if (!(*result))
     {
@@ -3359,6 +3363,7 @@
     }
   } else {
 #endif
+      perlinterp_release ();
       if ((mysql_real_query(svsock, sbuf, slen))  &&
           (!mysql_db_reconnect(h)  ||
            (mysql_real_query(svsock, sbuf, slen))))
@@ -3378,6 +3383,7 @@
           else
             rows= mysql_num_rows(*result);
       }
+      perlinterp_acquire ();
 #if MYSQL_ASYNC
   }
 #endif
@@ -3436,6 +3442,8 @@
     PerlIO_printf(DBIc_LOGPIO(imp_xxh),
                   "\t-> mysql_st_internal_execute41\n");
 
+  perlinterp_release ();
+
   /* free result if exists */
   if (*result)
   {
@@ -3457,15 +3465,25 @@
   }
 
   if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
-    PerlIO_printf(DBIc_LOGPIO(imp_xxh),
-                  "\t\tmysql_st_internal_execute41 calling mysql_execute with %d num_params\n",
-                  num_params);
+    {
+      perlinterp_acquire ();
+      PerlIO_printf(DBIc_LOGPIO(imp_xxh),
+                    "\t\tmysql_st_internal_execute41 calling mysql_execute with %d num_params\n",
+                    num_params);
+      perlinterp_release ();
+    }
+
 
   execute_retval= mysql_stmt_execute(stmt);
   if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
-    PerlIO_printf(DBIc_LOGPIO(imp_xxh),
-                  "\t\tmysql_stmt_execute returned %d\n",
-                  execute_retval);
+    {
+      perlinterp_acquire ();
+      PerlIO_printf(DBIc_LOGPIO(imp_xxh),
+                    "\t\tmysql_stmt_execute returned %d\n",
+                    execute_retval);
+      perlinterp_release ();
+    }
+
   if (execute_retval)
     goto error;
 
@@ -3500,6 +3518,7 @@
     else
       rows= mysql_stmt_num_rows(stmt);
   }
+  perlinterp_acquire ();
   if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
     PerlIO_printf(DBIc_LOGPIO(imp_xxh),
                   "\t<- mysql_internal_execute_41 returning %d rows\n",
@@ -3512,6 +3531,7 @@
     mysql_free_result(*result);
     *result= 0;
   }
+  perlinterp_acquire ();
   if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
     PerlIO_printf(DBIc_LOGPIO(imp_xxh),
                   "     errno %d err message %s\n",
diff -ur /tmp/orig/DBD-mysql-4.031/dbdimp.h /tmp/multi/DBD-mysql-4.031/dbdimp.h
--- orig/DBD-mysql-4.031/dbdimp.h	2015-01-27 04:02:15.000000000 +0100
+++ multi/DBD-mysql-4.031/dbdimp.h	2015-07-28 12:11:00.286016823 +0200
@@ -23,6 +23,8 @@
 
 #include <errmsg.h> /* Comes with MySQL-devel */
 
+#include "perlmulticore.h"
+
 /* For now, we hardcode this, but in the future,
  * we can detect capabilities of the MySQL libraries
  * we're talking to */
diff -ur /tmp/orig/DBD-mysql-4.031/mysql.xs /tmp/multi/DBD-mysql-4.031/mysql.xs
--- orig/DBD-mysql-4.031/mysql.xs	2015-01-27 04:02:15.000000000 +0100
+++ multi/DBD-mysql-4.031/mysql.xs	2015-07-30 15:18:22.985712941 +0200
@@ -55,10 +55,12 @@
     char *      user
     char *      password
   PPCODE:
+    perlinterp_release ();
 {
     MYSQL mysql;
     MYSQL* sock = mysql_dr_connect(drh, &mysql, NULL, host, port, user, password,
 				   NULL, NULL);
+    perlinterp_acquire ();
     if (sock != NULL)
     {
       MYSQL_ROW cur;
@@ -494,6 +496,7 @@
         }
         has_binded= 0;
       }
+
       retval = mysql_st_internal_execute41(dbh,
                                            num_params,
                                            &result,
@@ -586,10 +589,14 @@
 
       D_imp_dbh(dbh);
       ASYNC_CHECK_XS(dbh);
+      perlinterp_release ();
       retval = (mysql_ping(imp_dbh->pmysql) == 0);
+      perlinterp_acquire ();
       if (!retval) {
 	if (mysql_db_reconnect(dbh)) {
+          perlinterp_release ();
 	  retval = (mysql_ping(imp_dbh->pmysql) == 0);
+          perlinterp_acquire ();
 	}
       }
       RETVAL = boolSV(retval);
