From: Marco van Wieringen Date: Mon, 5 Apr 2010 15:15:17 +0000 (+0200) Subject: Drop have_insert_id in mdb as its always true for all backends. X-Git-Tag: Release-5.2.1~1527 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=81dda5b1bd2666709b08000fe7afb8bfe038f759;p=bacula%2Fbacula Drop have_insert_id in mdb as its always true for all backends. --- diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index d0b7412095..b7cf863cfb 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -135,7 +135,6 @@ struct B_DB { char *db_password; int db_port; /* port for host name address */ bool connected; /* connection made to db */ - bool have_insert_id; /* do not have insert id */ bool fields_defined; /* set when fields defined */ char *sqlite_errmsg; /* error message returned by sqlite */ POOLMEM *errmsg; /* nicely edited error message */ @@ -257,7 +256,6 @@ struct B_DB { char *db_password; int db_port; /* port for host name address */ bool connected; /* connection made to db */ - bool have_insert_id; /* do not have insert id */ bool fields_defined; /* set when fields defined */ char *sqlite_errmsg; /* error message returned by sqlite */ POOLMEM *errmsg; /* nicely edited error message */ @@ -364,7 +362,6 @@ struct B_DB { char *db_address; /* host address */ char *db_socket; /* socket for local access */ int db_port; /* port of host address */ - int have_insert_id; /* do have insert_id() */ bool connected; POOLMEM *errmsg; /* nicely edited error message */ POOLMEM *cmd; /* SQL command string */ @@ -467,7 +464,6 @@ struct B_DB { char *db_address; /* host address */ char *db_socket; /* socket for local access */ int db_port; /* port of host address */ - int have_insert_id; /* do have insert_id() */ bool connected; POOLMEM *errmsg; /* nicely edited error message */ POOLMEM *cmd; /* SQL command string */ @@ -577,7 +573,6 @@ struct B_DB { char *db_socket; /* socket for local access */ int db_port; /* port of host address */ int session_id; /* unique session id */ - int have_insert_id; /* do have insert_id() */ bool connected; POOLMEM *errmsg; /* nicely edited error message */ POOLMEM *cmd; /* SQL command string */ @@ -706,7 +701,6 @@ struct B_DB { char *db_address; /* host address */ char *db_socket; /* socket for local access */ int db_port; /* port of host address */ - int have_insert_id; /* do have insert_id() */ bool connected; POOLMEM *errmsg; /* nicely edited error message */ POOLMEM *cmd; /* SQL command string */ diff --git a/bacula/src/cats/dbi.c b/bacula/src/cats/dbi.c index f3c360ad71..6812fefbed 100644 --- a/bacula/src/cats/dbi.c +++ b/bacula/src/cats/dbi.c @@ -172,7 +172,6 @@ db_init_database(JCR *jcr, const char *db_name, const char *db_user, const char } mdb->db_type = db_type; mdb->db_port = db_port; - mdb->have_insert_id = TRUE; mdb->errmsg = get_pool_memory(PM_EMSG); /* get error message buffer */ *mdb->errmsg = 0; mdb->cmd = get_pool_memory(PM_EMSG); /* get command buffer */ diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index 52ee3302f5..aee5c103ca 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -116,7 +116,6 @@ db_init_database(JCR *jcr, const char *db_name, const char *db_user, const char mdb->db_socket = bstrdup(db_socket); } mdb->db_port = db_port; - mdb->have_insert_id = true; mdb->errmsg = get_pool_memory(PM_EMSG); /* get error message buffer */ *mdb->errmsg = 0; mdb->cmd = get_pool_memory(PM_EMSG); /* get command buffer */ diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index 9407978d67..998b990819 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -117,7 +117,6 @@ db_init_database(JCR *jcr, const char *db_name, const char *db_user, const char mdb->db_socket = bstrdup(db_socket); } mdb->db_port = db_port; - mdb->have_insert_id = TRUE; mdb->errmsg = get_pool_memory(PM_EMSG); /* get error message buffer */ *mdb->errmsg = 0; mdb->cmd = get_pool_memory(PM_EMSG); /* get command buffer */ diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index 41692142d0..5d22eca398 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -270,11 +270,7 @@ InsertDB(const char *file, int line, JCR *jcr, B_DB *mdb, char *cmd) } return 0; } - if (mdb->have_insert_id) { - mdb->num_rows = sql_affected_rows(mdb); - } else { - mdb->num_rows = 1; - } + mdb->num_rows = sql_affected_rows(mdb); if (mdb->num_rows != 1) { char ed1[30]; m_msg(file, line, &mdb->errmsg, _("Insertion problem: affected_rows=%s\n"), diff --git a/bacula/src/cats/sqlite.c b/bacula/src/cats/sqlite.c index 81a5c51661..a7dabacabf 100644 --- a/bacula/src/cats/sqlite.c +++ b/bacula/src/cats/sqlite.c @@ -121,7 +121,6 @@ db_init_database(JCR *jcr, const char *db_name, const char *db_user, const char mdb = (B_DB *)malloc(sizeof(B_DB)); memset(mdb, 0, sizeof(B_DB)); mdb->db_name = bstrdup(db_name); - mdb->have_insert_id = true; mdb->errmsg = get_pool_memory(PM_EMSG); /* get error message buffer */ *mdb->errmsg = 0; mdb->cmd = get_pool_memory(PM_EMSG); /* get command buffer */