improved mysql logging

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2018-01-23 20:00:40 +01:00
parent b4e1a6cf44
commit 06b5954070

View File

@ -111,13 +111,13 @@ int p_exec_stmt(struct session_data *sdata, struct sql *sql){
if(mysql_stmt_bind_param(sql->stmt, bind)){ if(mysql_stmt_bind_param(sql->stmt, bind)){
sdata->sql_errno = mysql_stmt_errno(sql->stmt); sdata->sql_errno = mysql_stmt_errno(sql->stmt);
syslog(LOG_PRIORITY, "%s: error: mysql_stmt_bind_param() '%s' (errno: %d)", sdata->ttmpfile, mysql_stmt_error(sql->stmt), sdata->sql_errno); syslog(LOG_PRIORITY, "ERROR: %s: mysql_stmt_bind_param() '%s' (errno: %d)", sdata->ttmpfile, mysql_stmt_error(sql->stmt), sdata->sql_errno);
return ret; return ret;
} }
if(mysql_stmt_execute(sql->stmt)){ if(mysql_stmt_execute(sql->stmt)){
sdata->sql_errno = mysql_stmt_errno(sql->stmt); sdata->sql_errno = mysql_stmt_errno(sql->stmt);
syslog(LOG_PRIORITY, "%s: error: mysql_stmt_execute() '%s' (errno: %d)", sdata->ttmpfile, mysql_error(&(sdata->mysql)), sdata->sql_errno); syslog(LOG_PRIORITY, "ERROR: %s: mysql_stmt_execute() '%s' (errno: %d)", sdata->ttmpfile, mysql_error(&(sdata->mysql)), sdata->sql_errno);
return ret; return ret;
} }