]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/mysql.c
When creating a new Job, don't grab the JobId in advance.
[bacula/bacula] / bacula / src / cats / mysql.c
index 98ec7d88e7396d8821b0f210e36d703bd18b8c6b..719aab5cd8db50da25287b4ff8fc3d15c673d2ac 100644 (file)
@@ -176,7 +176,9 @@ It is probably not running or your password is incorrect.\n"),
       return 0;
    }
 
+#ifdef HAVE_TREAD_SAFE_MYSQL
    my_thread_init();
+#endif
 
    mdb->connected = TRUE;
    V(mutex);
@@ -188,7 +190,9 @@ db_close_database(JCR *jcr, B_DB *mdb)
 {
    P(mutex);
    mdb->ref_count--;
+#ifdef HAVE_TREAD_SAFE_MYSQL
    my_thread_end();
+#endif
    if (mdb->ref_count == 0) {
       qdchain(&mdb->bq);
       if (mdb->connected && mdb->db) {
@@ -242,7 +246,7 @@ int db_next_index(JCR *jcr, B_DB *mdb, char *table, char *index)
  * Escape strings so that MySQL is happy
  *
  *   NOTE! len is the length of the old string. Your new
- *        string must be long enough (max 2*old) to hold
+ *        string must be long enough (max 2*old+1) to hold
  *        the escaped output.
  */
 void