#ifdef xHAVE_EMBEDDED_MYSQL
// mysql_server_init(0, NULL, NULL);
#endif
- mysql_init(&(mdb->mysql));
+ mysql_init(&mdb->mysql);
+
Dmsg0(50, "mysql_init done\n");
/* If connection fails, try at 5 sec intervals for 30 seconds. */
for (int retry=0; retry < 6; retry++) {
return 0;
}
-#ifdef HAVE_THREAD_SAFE_MYSQL
- my_thread_init();
-#endif
Dmsg3(100, "opendb ref=%d connected=%d db=%p\n", mdb->ref_count,
mdb->connected, mdb->db);
P(mutex);
sql_free_result(mdb);
mdb->ref_count--;
-#if defined(HAVE_THREAD_SAFE_MYSQL)
- my_thread_end();
-#endif
Dmsg3(100, "closedb ref=%d connected=%d db=%p\n", mdb->ref_count,
mdb->connected, mdb->db);
if (mdb->ref_count == 0) {
qdchain(&mdb->bq);
- if (mdb->connected && mdb->db) {
+ if (mdb->connected) {
Dmsg1(100, "close db=%p\n", mdb->db);
- mysql_close(&(mdb->mysql));
+ mysql_close(&mdb->mysql);
+
#ifdef xHAVE_EMBEDDED_MYSQL
// mysql_server_end();
#endif
pthread_cond_destroy(&jcr->term_wait);
jcr->term_wait_inited = false;
}
+ if (jcr->db_batch && jcr->db_batch != jcr->db) {
+ db_close_database(jcr, jcr->db_batch);
+ }
+ jcr->db_batch = NULL;
if (jcr->db) {
db_close_database(jcr, jcr->db);
jcr->db = NULL;
}
- if (jcr->db_batch) {
- db_close_database(jcr, jcr->db_batch);
- jcr->db_batch = NULL;
- }
if (jcr->stime) {
Dmsg0(200, "Free JCR stime\n");
free_pool_memory(jcr->stime);
break;
case 'p':
flags |= DP_F_UNSIGNED;
- strvalue = va_arg(args, char *);
- currlen = fmtint(buffer, currlen, maxlen, (long)strvalue, 16, min, max, flags);
+ if (sizeof(char *) == 4) {
+ value = va_arg(args, uint32_t);
+ } else if (sizeof(char *) == 8) {
+ value = va_arg(args, uint64_t);
+ } else {
+ value = (uint64_t)va_arg(args, char *);
+ }
+ currlen = fmtint(buffer, currlen, maxlen, value, 16, min, max, flags);
break;
case 'n':
if (cflags == DP_C_INT16) {
/* Message Digest Structure */
struct Digest {
crypto_digest_t type;
+ JCR *jcr;
union {
SHA1Context sha1;
MD5Context md5;
/* Dummy Signature Structure */
struct Signature {
+ JCR *jcr;
};
DIGEST *crypto_digest_new(JCR *jcr, crypto_digest_t type)
#undef VERSION
#define VERSION "2.1.8"
-#define BDATE "09 May 2007"
-#define LSMDATE "09May07"
+#define BDATE "11 May 2007"
+#define LSMDATE "11May07"
#define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n"
#define BYEAR "2007" /* year for copyright messages in progs */
Technical notes on version 2.1
General:
+11May07
+kes Fix non-ssl build so that it works (add JCR *jcr to crypto structures).
+kes Fix sign extended editing of %p.
+kes Clean out a little old #ifdefing in cats/mysql.c
10May07
kes If time diff between DIR and FD is more than 600 seconds convert
INFO message to WARNING.