summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2005-10-05 14:48:35 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2005-10-05 14:48:35 +0000
commit01f0a8a0cdfbee0983cebe53ef2d8432cf2f9d27 (patch)
treed1783183c246e39578750c5fa2dd9a73340a24c5
parent35eb0504b505369d10589287554909a208e6386e (diff)
downloadrsyslog-01f0a8a0cdfbee0983cebe53ef2d8432cf2f9d27.tar.gz
rsyslog-01f0a8a0cdfbee0983cebe53ef2d8432cf2f9d27.tar.xz
rsyslog-01f0a8a0cdfbee0983cebe53ef2d8432cf2f9d27.zip
fixed an issue with mysql error handling
-rw-r--r--NEWS4
-rw-r--r--syslogd.c11
-rw-r--r--version.h2
3 files changed, 13 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index dfa907a9..3d850b7b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,8 @@
---------------------------------------------------------------------------
+Version 1.0.2 (RGer), 2005-10-05
+- fixed an issue with MySQL error reporting. When an error occured,
+ the MySQL driver went into an endless loop (at least in most cases).
+---------------------------------------------------------------------------
Version 1.0.1 (RGer), 2005-09-23
- fixed a security issue with SQL-escaping in conjunction with
non-(SQL-)standard MySQL features.
diff --git a/syslogd.c b/syslogd.c
index 594cbc4b..27bee376 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -5569,14 +5569,19 @@ void DBErrorHandler(register struct filed *f)
*
* Think about diffrent "delay" for diffrent errors!
*/
+ /* Enable "delay" */
+ f->f_timeResumeOnError = time(&f->f_timeResumeOnError) + _DB_DELAYTIMEONERROR ;
+ f->f_iLastDBErrNo = mysql_errno(&f->f_hmysql);
+ /* *NOW* report the error. The order of operations is vitally important.
+ * Previously, we reported before setting the db error suspend, which
+ * lead to an endless loop. So do not do that again ;)
+ * rgerhards, 2005-10-05
+ */
errno = 0;
snprintf(errMsg, sizeof(errMsg)/sizeof(char),
"db error (%d): %s\n", mysql_errno(&f->f_hmysql),
mysql_error(&f->f_hmysql));
logerror(errMsg);
- /* Enable "delay" */
- f->f_timeResumeOnError = time(&f->f_timeResumeOnError) + _DB_DELAYTIMEONERROR ;
- f->f_iLastDBErrNo = mysql_errno(&f->f_hmysql);
}
diff --git a/version.h b/version.h
index 8890b979..bf742768 100644
--- a/version.h
+++ b/version.h
@@ -1,2 +1,2 @@
#define VERSION "1.0"
-#define PATCHLEVEL "1"
+#define PATCHLEVEL "2"