[collectd] [PATCH] mysql plugin: add support for multipledatabases

Florian Forster octo at verplant.org
Wed Mar 18 12:51:24 CET 2009


Hi Doug,

On Tue, Mar 17, 2009 at 04:51:53PM -0400, Doug MacEachern wrote:
> Ah very nice, `complex_read' makes things much simpler ;)
> Other minor changes in the patch..

thanks again, the patch is applied :)

Yes, `complex_read' has nice uses ;) I originally introduces it for the
`Java' plugin, so that one read function can be registered multiple
times - which Java plugin should be executed is determined using the
user data pointer.

Registering a ``custom'' interval is pretty new and not yet used by any
plugins. It will hopefully be useful for plugins such as `OneWire' and
`SNMP'.

> On an older machine w/ gcc 3.4.6: "mysql.c:130: warning: 'status' might
> be used uninitialized in this function", cured with:
> -	int status;
> +	int status = 0;

I wish I knew how to get GCC to behave in a deterministic manner when
reporting uninitialized variables. Just the other day, I was at another
computer (with Debian Lenny, just like at home) which told me about a
leftover variable which was never written to but once read from. Thanks
for catching it :)

> db->database was NULL, which mysql_real_connect doesn't seem to mind?
> +		db->database = strdup (db->instance);

I didn't test without a `Database' setting. I *thought* it was optional,
though..

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090318/d5435a5a/attachment.pgp 


More information about the collectd mailing list