Browse Source

Add missing check_conn when running SQL statements

Intermittent errors from the DB can cause the connection to be reset and
not re-established for the next statement to be executed, leading to
segfaults.

fixes #742

Change-Id: I1ed5b75457ab7167a70df5e04a964d37f98e60f7
changes/32/28432/1
Richard Fuchs 7 years ago
parent
commit
cfbd4bccf8
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      recording-daemon/db.c

+ 2
- 0
recording-daemon/db.c View File

@ -203,6 +203,8 @@ INLINE void my_d(MYSQL_BIND *b, const double *d) {
static void execute_wrap(MYSQL_STMT **stmt, MYSQL_BIND *binds, unsigned long long *auto_id) {
int retr = 0;
while (1) {
if (check_conn())
goto err;
if (mysql_stmt_bind_param(*stmt, binds))
goto err;
if (mysql_stmt_execute(*stmt))


Loading…
Cancel
Save