panic("could not connect to database server\n%s\n", mysql.error);
if (mysql.autocommit(false))
- panic("could not set autocommit\n");
+ panic("could not set autocommit\n%s\n", mysql.error);
remove(name);
//cleanup();
setup(name, sample, user, project);
- if (mysql.commit())
- panic("could not commit transaction\n");
}
void
panic("could not get a run\n%s\n", mysql.error);
run_id = mysql.insert_id();
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
}
void
mysql.query(sql);
if (mysql.error)
panic("could not delete run\n%s\n", mysql.error);
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
}
void
"LEFT JOIN runs ON dt_run=rn_id "
"WHERE rn_id IS NULL");
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
+
mysql.query("DELETE formula_ref "
"FROM formula_ref "
"LEFT JOIN runs ON fr_run=rn_id "
"WHERE rn_id IS NULL");
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
+
mysql.query("DELETE formulas "
"FROM formulas "
"LEFT JOIN formula_ref ON fm_stat=fr_stat "
"WHERE fr_stat IS NULL");
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
+
mysql.query("DELETE stats "
"FROM stats "
"LEFT JOIN data ON st_id=dt_stat "
"WHERE dt_stat IS NULL");
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
+
mysql.query("DELETE subdata "
"FROM subdata "
"LEFT JOIN data ON sd_stat=dt_stat "
"WHERE dt_stat IS NULL");
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
+
mysql.query("DELETE bins "
"FROM bins "
"LEFT JOIN data ON bn_id=dt_bin "
"WHERE dt_bin IS NULL");
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
+
mysql.query("DELETE events"
"FROM events"
"LEFT JOIN runs ON ev_run=rn_id"
"WHERE rn_id IS NULL");
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
+
mysql.query("DELETE event_names"
"FROM event_names"
"LEFT JOIN events ON en_id=ev_event"
"WHERE ev_event IS NULL");
+
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
}
void
min, max, bktsize, size);
mysql.query(insert);
- if (!mysql.error)
- return mysql.insert_id();
+ if (!mysql.error) {
+ int id = mysql.insert_id();
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
+ return id;
+ }
stringstream select;
ccprintf(select, "SELECT * FROM stats WHERE st_name=\"%s\"", name);
if (!result)
panic("could not find stat\n%s\n", mysql.error);
- if (mysql.commit())
- panic("could not commit transaction\n");
-
assert(result.num_fields() == 16);
MySQL::Row row = result.fetch_row();
if (!row)
Connection &mysql = MySqlDB.conn();
assert(mysql.connected());
- if (mysql.commit())
- panic("could not commit transaction\n");
-
uint16_t bin_id;
stringstream select;
panic("could not get a bin\n%s\n", mysql.error);
bin_id = mysql.insert_id();
+ if (mysql.commit())
+ panic("could not commit transaction\n%s\n", mysql.error);
+
binmap.insert(make_pair(bin, bin_id));
exit:
- if (mysql.commit())
- panic("could not commit transaction\n");
-
return bin_id;
}
if (mysql.error)
panic("could not insert data\n%s\n", mysql.error);
if (mysql.commit())
- panic("could not commit transaction\n");
+ panic("could not commit transaction\n%s\n", mysql.error);
}
query[0] = '\0';
// panic("could not insert subdata\n%s\n", mysql.error);
if (mysql.commit())
- panic("could not commit transaction\n");
+ panic("could not commit transaction\n%s\n", mysql.error);
}
void
// panic("could not insert formula reference\n%s\n", mysql.error);
if (mysql.commit())
- panic("could not commit transaction\n");
+ panic("could not commit transaction\n%s\n", mysql.error);
}
void
panic("could not update prereq\n%s\n", mysql.error);
if (mysql.commit())
- panic("could not commit transaction\n");
+ panic("could not commit transaction\n%s\n", mysql.error);
}
void
using namespace Database;
MySQL::Connection &mysql = MySqlDB.conn();
- if (mysql.commit())
- panic("could not commit transaction\n");
stat_list_t::const_iterator i, end = stats().end();
for (i = stats().begin(); i != end; ++i) {
}
if (mysql.commit())
- panic("could not commit transaction\n");
+ panic("could not commit transaction\n%s\n", mysql.error);
configured = true;
}
if (bin && stat->binned() || !bin && !stat->binned()) {
stat->visit(*this);
if (mysql.commit())
- panic("could not commit transaction\n");
+ panic("could not commit transaction\n%s\n", mysql.error);
}
}
}