V(mutex);
}
+void db_thread_cleanup()
+{ }
+
void db_escape_string(char *snew, char *old, int len)
{
V(mutex);
}
+/*
+ * This call is needed because the message channel thread
+ * opens a database on behalf of a jcr that was created in
+ * a different thread. MySQL then allocates thread specific
+ * data, which is NOT freed when the original jcr thread
+ * closes the database. Thus the msgchan must call here
+ * to cleanup any thread specific data that it created.
+ */
+void db_thread_cleanup()
+{
+ my_thread_end();
+}
+
/*
* Return the next unique index (auto-increment) for
* the given table. Return NULL on error.
V(mutex);
}
+void db_thread_cleanup()
+{ }
+
/*
* Return the next unique index (auto-increment) for
* the given table. Return NULL on error.
-/*
- *
- * Database routines that are exported by the cats library for
- * use elsewhere in Bacula (mainly the Director).
- *
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ *
+ * Database routines that are exported by the cats library for
+ * use elsewhere in Bacula (mainly the Director).
+ *
+ * Version $Id$
+ */
#ifndef __SQL_PROTOS_H
#define __SQL_PROTOS_H
void db_start_transaction(JCR *jcr, B_DB *mdb);
void db_end_transaction(JCR *jcr, B_DB *mdb);
int db_int64_handler(void *ctx, int num_fields, char **row);
-
+void db_thread_cleanup();
/* create.c */
bool db_create_file_attributes_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar);
V(mutex);
}
+void db_thread_cleanup()
+{ }
+
/*
* Return the next unique index (auto-increment) for
* the given table. Return 0 on error.
pthread_cond_broadcast(&jcr->term_wait); /* wakeup any waiting threads */
Dmsg1(100, "=== End msg_thread. use=%d\n", jcr->use_count());
free_jcr(jcr); /* release jcr */
+ db_thread_cleanup(); /* remove thread specific data */
}
/*
General:
13May07
+kes Fixed the batch insert MySQL thread specific data that was not
+ being freed. See cats/mysql.c:db_thread_cleanup().
kes Fix restore before command.
kes Convert old hdr.name to name() in a few places.
kes Implement update jobid command.