many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
void print_dashes(B_DB *mdb);
void print_result(B_DB *mdb);
+dbid_list::dbid_list()
+{
+ memset(this, 0, sizeof(dbid_list));
+ max_ids = 1000;
+ DBId = (DBId_t *)malloc(max_ids * sizeof(DBId_t));
+ num_ids = num_seen = tot_ids = 0;
+ PurgedFiles = NULL;
+}
+
+dbid_list::~dbid_list()
+{
+ free(DBId);
+}
+
+
/*
* Called here to retrieve an integer from the database
*/
QueryDB(const char *file, int line, JCR *jcr, B_DB *mdb, char *cmd)
{
int status;
+
+ sql_free_result(mdb);
if ((status=sql_query(mdb, cmd)) != 0) {
m_msg(file, line, &mdb->errmsg, _("query %s failed:\n%s\n"), cmd, sql_strerror(mdb));
j_msg(file, line, jcr, M_FATAL, 0, "%s", mdb->errmsg);
mdb->num_rows = sql_affected_rows(mdb);
if (mdb->num_rows < 1) {
char ed1[30];
- m_msg(file, line, &mdb->errmsg, _("Update problem: affected_rows=%s\n"),
- edit_uint64(mdb->num_rows, ed1));
+ m_msg(file, line, &mdb->errmsg, _("Update failed: affected_rows=%s for %s\n"),
+ edit_uint64(mdb->num_rows, ed1), cmd);
if (verbose) {
// j_msg(file, line, jcr, M_INFO, 0, "%s\n", cmd);
}
if ((errstat=rwl_writelock(&mdb->lock)) != 0) {
berrno be;
e_msg(file, line, M_FATAL, 0, "rwl_writelock failure. stat=%d: ERR=%s\n",
- errstat, be.strerror(errstat));
+ errstat, be.bstrerror(errstat));
}
}
if ((errstat=rwl_writeunlock(&mdb->lock)) != 0) {
berrno be;
e_msg(file, line, M_FATAL, 0, "rwl_writeunlock failure. stat=%d: ERR=%s\n",
- errstat, be.strerror(errstat));
+ errstat, be.bstrerror(errstat));
}
}