Icinga / icinga-reports

Icinga Reports 1.x MySQL (EOL 31.12.2018)
GNU General Public License v2.0
14 stars 13 forks source link

[dev.icinga.com #4152] Fix for buggy MySQL versions #56

Closed icinga-migration closed 11 years ago

icinga-migration commented 11 years ago

This issue has been migrated from Redmine: https://dev.icinga.com/issues/4152

Created by tgelf on 2013-05-08 09:33:37 +00:00

Assignee: (none) Status: Resolved (closed on 2013-06-07 02:42:31 +00:00) Target Version: 1.9.1 Last Update: 2013-06-07 02:42:31 +00:00 (in Redmine)

Icinga Version: 1.8.2
DB Type: MySQL
DB Version: 5.1
Jasper Version: 5.0.1

It seems that some MySQL versions don't respect their documentation when it goes to empty variables. As of http://dev.mysql.com/doc/refman/5.1/en/user-variables.html they should be NULL:

If you refer to a variable that has not been initialized, it has a value of NULL and a type of string.

However we have seen that this doesn't seem to be true at least on some 5.0 and 5.1 versions and could therefore lead to hardly reproduceable issues with SLA values being "sometimes" wrong. I haven't been able to reproduce this on 5.5 yet. You can find a small patch attached to this issue that should fix this.

This bug could also be related to a whole bunch of open MySQL issues related to MySQLs missbehaviour when it goes to variables named like column names. So a more conservative fix would rename @last_state to something different as last_state is also a column name. As this is rather ridiculous and the attached patch seems to be working fine I'd suggest to skip farther changes right now.

Cheers, Thomas

Attachments

Changesets

2013-05-29 12:47:33 +00:00 by (unknown) b119991c0f0aea4af5bc4f21ef16c0f0e258a5b1

fix empty variable for mysql sla procedure

fixes #4152
icinga-migration commented 11 years ago

Updated by mfriedrich on 2013-05-08 09:40:46 +00:00

icinga-migration commented 11 years ago

Updated by Anonymous on 2013-06-07 02:42:31 +00:00

Applied in changeset b119991c0f0aea4af5bc4f21ef16c0f0e258a5b1.