79 Commits

Author SHA1 Message Date
PascalWithopf
79de51e4fc codestyle: reduce max line length to 125 2017-12-20 16:16:57 +01:00
Rainer Gerhards
cdd7b62c60 ommysql: do not duplicate entries on failed transaction
If a multi-message batch contains data errors, messages may be
duplicated as connection close is implicit commit (not rollback).
This patch introduces a specific rollback request in those cases.

closes https://github.com/rsyslog/rsyslog/issues/1829
2017-10-10 14:28:44 +02:00
Rainer Gerhards
e9a27a0c53 ommysql: treat server and client-generated messages differently
Server-generated error messages are considered non-recoverable, while
client generated once point into connection problems (which simply can
be retried). This is part of the improvements towards better
message-induced errors. Previous commits did only handle SQL parsing
errors, now we aim to address all of the message-induced error. We assume
that all server-generated errors are such - mysql API unfortunately does
not provide a clear indication of what type if error this is and it is
out of question to check for hundereds of error codes.

closes https://github.com/rsyslog/rsyslog/issues/1830
2017-10-10 14:19:21 +02:00
Rainer Gerhards
50c4d27fff ommysql: improve error messages 2017-10-07 12:14:23 +02:00
Rainer Gerhards
11ce77c19e ommysql: return error code on data failure
ommysql should return RS_RET_DATAFAIL if it knows that
a message can definitely never by processed, e.g. because
of a syntax error inside the message. This helps improve
retry and suspension processing.

closes https://github.com/rsyslog/rsyslog/issues/1819
2017-10-06 12:57:45 +02:00
Rainer Gerhards
ea1860deb0 ommysql: update to v8 transactional interface
provides higher performance and better reliability;
module currently uses old-style interface with new-style emulation.

closes https://github.com/rsyslog/rsyslog/issues/1817
2017-10-06 12:39:09 +02:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
Rainer Gerhards
11d7bd7af7 fix compiler warning 2016-06-03 16:00:29 +02:00
Filip Hajny
a849a5d84c netdb.h is needed for MAXHOSTNAMELEN on at least SunOS. 2016-04-21 11:25:33 +02:00
Rainer Gerhards
b9129e969e bugfix ommysql: on some platforms, serverport parameter had no effect
This was caused by an invalid code sequence which's outcome depends on
compiler settings.

Also, suppress a compiler warning induced by API structure
2016-01-27 09:47:36 +01:00
Rainer Gerhards
07a074dd88 cleanup: remove dbgprintf's not intended to stay
those starting at column 0 are temporary debug aids during development.
Some of them I intend to keep in for a version or two. Some of them
I tend to forget later. This is a cleanup of those. Most are removed,
some are promoted to be permanently there - now indicated by proper
indention.
2016-01-13 09:20:07 -05:30
Peter Portante
2470f0f72b Remove use of sizeof(char) and sizeof(uchar)
Remove the use sizeof(char) or sizeof(uchar) in calculations for memory
allocation or string length.  There are no known platforms for which
sizeof(char) or sizeof(uchar) is not 1, and c99 has defined sizeof(char)
to be 1 (section 6.5.3.4 of c99).
2015-12-16 02:18:45 +00:00
Rainer Gerhards
dee749fc7a fix ommysql issues under RHEL7
under RHEL 7, we have an issue when gnutls is linked. For some reason
(autoconf magic?) we link ommysql against gnutls. I have not found the
root cause, but setting LIBS= below makes the problem go away. A better
solution would be appreciated, but for the time being this seems to
solve the issue.
closes https://github.com/rsyslog/rsyslog/issues/408
2015-07-08 13:06:51 +02:00
Tomas Heinrich
3915a6effa Remove references to deleted files from Makefiles
These files were removed in commits dadec46 and 77ef11a.
2014-11-25 10:01:48 +01:00
Rainer Gerhards
dadec46996 remove GPL contribution
see also https://github.com/rsyslog/rsyslog/issues/82
2014-11-12 12:09:43 +01:00
Rainer Gerhards
e0b300193d bugfix: ommysql: handle/mem leak upon termination of worker thread
This could become bad if the (instance) worker threads are often
started and terminated. But it takes quite a while to show effect.
2014-07-05 22:23:01 +02:00
Rainer Gerhards
9016c24fb3 fix make dist: header file gone away some commits ago 2014-06-02 12:42:08 +02:00
Rainer Gerhards
618bd2844c Merge branch 'v7-stable' into v8-stable
Conflicts:
	grammar/grammar.y
2014-05-22 15:44:22 +02:00
Rainer Gerhards
bb6b78c0d4 remove no longer needed file 2014-05-22 15:36:29 +02:00
Rainer Gerhards
70b8ba19a3 ommysql cosmetic: change some historic names 2013-10-31 18:36:03 +01:00
Rainer Gerhards
bc675b2def ommysql cosmetic: change some historic names 2013-10-31 18:33:18 +01:00
Rainer Gerhards
d171629863 ommysql: add support for v8 output module interface 2013-10-31 18:07:15 +01:00
Rainer Gerhards
78a67ffbba bugfix: ommysql lost configfile/section parameters after first close
This means that when a connection was broken, it was probably
re-instantiated with different parameters than configured.
2013-10-31 17:52:43 +01:00
Ulrike Gerhards
b1267b4f28 ommysql: addd batching/transaction support 2012-12-14 09:28:50 +01:00
Rainer Gerhards
e5ef73eb25 bugfix: invalid rsyslog-internal macro API use
This had no bad effect, because the macro did the same as the one
that should have been used.
2012-11-01 17:05:07 +01:00
Rainer Gerhards
e53ef769dd Merge branch 'v6-stable'
Conflicts:
	tools/syslogd.c
2012-05-03 18:33:29 +02:00
Rainer Gerhards
4f70113457 Merge branch 'v5-stable' into v6-stable
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
2012-05-03 18:28:54 +02:00
Rainer Gerhards
bec43b5380 ommysql: added support for new mysql_library_[init/exit] 2012-05-03 13:48:46 +02:00
Rainer Gerhards
a34e46801b bugfix: ommysql did not properly init/exit the mysql runtime library
This could lead to segfaults. Triggering condition: multiple action
instances using ommysql.  Thanks to Tomas Heinrich for reporting this
problem and providing an initial patch (which my solution is based on,
I need to add more code to clean the mess up).
2012-05-03 12:32:03 +02:00
Rainer Gerhards
3a1c33cea9 Merge branch 'v6-stable' 2012-02-03 15:35:53 +01:00
Rainer Gerhards
f93fb89aef Merge branch 'v5-stable' into v6-stable 2012-02-03 15:35:46 +01:00
Rainer Gerhards
1b5fc33198 Merge branch 'v4-stable' into v5-stable 2012-02-03 15:35:28 +01:00
Rainer Gerhards
c539324298 ommysql: put under ASL 2.0
after getting OK via email from contributor Ariel P. (2012-02-02 22:06 CET)
2012-02-03 15:34:10 +01:00
Rainer Gerhards
03cf2a5113 ommysql: added support for v6 config format 2012-02-02 16:25:59 +01:00
Rainer Gerhards
535d6cf0b8 v6.1/2 scoping support removed from plugins 2012-01-19 14:48:40 +01:00
Rainer Gerhards
6624ad434b Merge branch 'v6-stable-noscoping' into master
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	plugins/imfile/imfile.c
	plugins/imklog/imklog.c
	plugins/immark/immark.c
	plugins/imptcp/imptcp.c
	plugins/imrelp/imrelp.c
	plugins/imtcp/imtcp.c
	plugins/imtemplate/imtemplate.c
	plugins/imudp/imudp.c
	plugins/imuxsock/imuxsock.c
	plugins/mmsnmptrapd/mmsnmptrapd.c
	plugins/omtemplate/omtemplate.c
	runtime/glbl.c
	runtime/parser.c
	tools/omfile.c
	tools/syslogd.c
2012-01-19 13:07:46 +01:00
Rainer Gerhards
b38dd53e08 undoing v6.1 config scoping interface, part II (now finished)
This concludes the removal of the new scoping interface, at least as
far as pre v6-plugins are affected. Full code cleanup will happen
in the v6.3 branch.
2012-01-19 12:33:12 +01:00
Rainer Gerhards
a7e3afb20b milestone: added module config names 2011-07-20 10:47:24 +02:00
Rainer Gerhards
bbe1f2688c renaming conf.* wasn't a good idea -- undoing
too many dependencies, things get cluttered (and merging probably
gets problematic). Now new config will be "conf2".
2011-04-19 08:24:25 +02:00
Rainer Gerhards
e1c34e1741 renamed conf.c to legacyconf.c to make room for new config system 2011-04-19 07:53:23 +02:00
Rainer Gerhards
6c3ef4dacf Merge branch 'v5-beta'
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	plugins/omlibdbi/omlibdbi.c
	tests/Makefile.am
	tests/diag.sh
2011-03-11 10:24:58 +01:00
Bojan Smojver
d1eb6e0edc added work-around for bug in gtls, which causes fd leak when using TLS
The capability has been added for module to specify that they do not
like being unloaded.
related bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=222

Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2011-02-23 11:25:43 +01:00
Rainer Gerhards
7974621502 Merge branch 'v5-devel'
Conflicts:
	plugins/imfile/imfile.c
	plugins/imudp/imudp.c
	plugins/ommysql/ommysql.c
2011-02-01 12:22:36 +01:00
Ariel P
44e3fb96c5 added $OMMySQLConfigFile/$OMMySQLConfigSection config directives
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2011-01-31 17:22:39 +01:00
Rainer Gerhards
d460c1cd5d fixed regression from last commit
config variables were not properly initialized
2010-07-27 11:38:25 +02:00
Rainer Gerhards
d18b238f16 milestone commit: output plugin interface changes (may NOT run)
The output interface has been changed, but we do not yet utilize the
new interface. Also, it looks like a regression was introduced. But before
hunting it down, I'd like to make a commit (what also easys the regresion
hunt).
2010-07-27 09:44:35 +02:00
Rainer Gerhards
e64cd21243 moving towards scoping inside rsyslog.conf
first step: adding object-type specifier to config statement table
2010-07-21 18:08:19 +02:00
Rainer Gerhards
e3d9843c85 re-enabled pipe, tty and console in omfile
... by moving code to stream.c. Thanks to the new design, new cases are
not really needed, resulting in cleaner code.

I also did a cleanup of header file usage as a side-activity.
2009-06-12 11:47:00 +02:00
Michael Biebl
1b912a970c Improve mysql configure check (for unusual paths)
Remove AC_CHECK_HEADERS([mysql/mysql.h],...) as this was causing pain
for users where the mysql headers are not installed in the system include
directory. It was superfluous anyways, as we check for mysql_config and
set the include path to the correct directory.
Update ommysql.c to use #include <mysql.h>, as mysql_config will set the
include path to /path/to/include/mysql/ so <mysql/mysql.h> would not
work.
Remove errmsg.h include as it is not used.
2009-02-24 13:09:45 +01:00
Michael Biebl
1448e2486e make all cflags and libs variables uppercase
pkg-config uses uppercase for its _CFLAGS and _LIBS variable names.
So we follow suit and convert all _cflags and _libs variables to
uppercase for more consistency.
2009-02-24 13:09:44 +01:00