Browse Source

MT#61977 add return value to execute_wrap

Change-Id: Ic4188e266f0df323f2a30d7323c7f9a86871b66a
pull/1998/head
Richard Fuchs 4 months ago
parent
commit
c425a655db
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      recording-daemon/db.c

+ 4
- 4
recording-daemon/db.c View File

@ -214,7 +214,7 @@ INLINE void my_ts(MYSQL_BIND *b, int64_t ts, double *d) {
}
static void execute_wrap(MYSQL_STMT **stmt, MYSQL_BIND *binds, unsigned long long *auto_id) {
static bool execute_wrap(MYSQL_STMT **stmt, MYSQL_BIND *binds, unsigned long long *auto_id) {
int retr = 0;
while (1) {
if (check_conn())
@ -231,7 +231,7 @@ static void execute_wrap(MYSQL_STMT **stmt, MYSQL_BIND *binds, unsigned long lon
if (mysql_commit(mysql_conn))
goto err;
return;
return true;
err:
if (retr > 5) {
@ -239,12 +239,12 @@ err:
ilog(LOG_ERR, "Failed to bind or execute prepared statement: %s",
mysql_stmt_error(*stmt));
reset_conn();
return;
return false;
}
if (retr > 2) {
reset_conn();
if (check_conn())
return;
return false;
}
retr++;


Loading…
Cancel
Save