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.
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)
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:
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