While compiling sql.c clang 16 generates the following warning:
```
sql.c:407:27: warning: comparison of address of 'db_pool_local[id].mysql' not equal to a null pointer is always true [-Wtautological-pointer-compare]
if (&db_pool_local[id].mysql != NULL) {
~~~~~~~~~~~~~~~~~~^~~~~ ~~~~
sql.c:428:28: warning: comparison of address of 'db_pool_remote[id].mysql' not equal to a null pointer is always true [-Wtautological-pointer-compare]
if (&db_pool_remote[id].mysql != NULL) {
~~~~~~~~~~~~~~~~~~~^~~~~ ~~~~
```
If the conditional is always true then the fix is to remove the
conditional in this instance
Co-authored-by: Erik Sejr <eriks@ssicanada.com>
-issue#202: MySQL SSL Key capability check does not work
-issue#203: Backtracing support checks do not work
-issue#204: MySQL Retry Count capability check always fails
Closes#202Closes#203Closes#204
On my gravestone, I want a quote something to the affect of "Here lies a man who hated the C, but loved the world around it". Great language, fast, but too many rules for this old critter.
There are really four fixes here.
- This first is that the db_escape() function was basically not even working breaking the whole '--mibs' thing.
- When limiting the host list, you should not send everything on the poller back to the main server, only what was polled. Minor, but a finer point.
- The signal handler needs to not mix it up by calling die(). Just fprintf() to standard error, backtrace if you segfaulted and go away. I've found in a few cases that the spine will be left running, and when straced, it's blocked on I/O from trying to do too much while trying to 'die'.
- Lastly, when pushing log data to standard output for debugging, don't trim output
- Spine does not properly use the mysql reconnect option
- Spine segfaults when performing certain re-index operation
- This change also corrects some compiler warnings.
* Correct segfault due to use of wrong variable
* Remove some whitespace
* More declarations to headers
* Add 'Device[]' to some log messages
* PID[] instead of Process[]
* Some block formatting
* Remove an automake warning
* Use stdbool.h
This commit addresses issue #64 by adding MySQL SSL support as per
Cacti's database.php.
Also, simplifies various code blocks by adding common macros for
setting of SQL options or duplicating strings with a message upon
failure.
The new feature tells you what data sources had issues during the
polling cycle. To get more details, you can turn on device debug for
the devices in question or turn logging to MEDIUM, which will generate
quite a bit of output.