From 28725473ba475d61b75bc652719fc191ed774743 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 7 Nov 2008 13:16:56 +0000 Subject: [PATCH] ebl Fix mysql compilation problem with debug lock code. Add allow_transactions flag like with other engines. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8008 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/cats/cats.h | 1 + bacula/src/cats/mysql.c | 1 + bacula/src/cats/sql.c | 4 ---- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index e8e1d40c82..3c761d7c9d 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -367,6 +367,7 @@ struct B_DB { POOLMEM *cached_path; int cached_path_len; /* length of cached path */ uint32_t cached_path_id; + bool allow_transactions; /* transactions allowed */ int changes; /* changes made to db */ POOLMEM *fname; /* Filename only */ POOLMEM *path; /* Path only */ diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index 622ff003f4..e6f7dd7bd0 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -124,6 +124,7 @@ db_init_database(JCR *jcr, const char *db_name, const char *db_user, const char mdb->path = get_pool_memory(PM_FNAME); mdb->esc_name = get_pool_memory(PM_FNAME); mdb->esc_path = get_pool_memory(PM_FNAME); + mdb->allow_transactions = mult_db_connections; qinsert(&db_list, &mdb->bq); /* put db in list */ Dmsg3(100, "initdb ref=%d connected=%d db=%p\n", mdb->ref_count, mdb->connected, mdb->db); diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index 5ce1aeb695..99d949b441 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -313,7 +313,6 @@ char *db_strerror(B_DB *mdb) static void update_lock_dbg(B_DB *mdb) { -#ifdef xxx if (mdb->allow_transactions) { /* batch connection */ return; } @@ -323,12 +322,10 @@ static void update_lock_dbg(B_DB *mdb) _db_lock_recurse_count++; _db_lock_time = (utime_t) time(NULL); _db_lock_threadid = pthread_self(); -#endif } static void update_unlock_dbg(B_DB *mdb) { -#ifdef xxx if (mdb->allow_transactions) { /* batch connection */ return; } @@ -339,7 +336,6 @@ static void update_unlock_dbg(B_DB *mdb) if (!_db_lock_recurse_count) { memset(&_db_lock_threadid, 0, sizeof(_db_lock_threadid)); } -#endif } /* -- 2.39.5