projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a369de2
)
postgresql: Set correct value to 'interval' query parameter (bugfix)
author
Pavel Rochnyack
<pavel2000@ngs.ru>
Wed, 4 Jul 2018 04:33:04 +0000
(11:33 +0700)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Wed, 4 Jul 2018 04:33:04 +0000
(11:33 +0700)
src/postgresql.c
patch
|
blob
|
history
diff --git
a/src/postgresql.c
b/src/postgresql.c
index
7c140e0
..
f1c7d7e
100644
(file)
--- a/
src/postgresql.c
+++ b/
src/postgresql.c
@@
-430,9
+430,9
@@
static PGresult *c_psql_exec_query_params(c_psql_database_t *db, udb_query_t *q,
params[i] = db->user;
break;
case C_PSQL_PARAM_INTERVAL:
- snprintf(interval, sizeof(interval), "%.3f",
- (db->interval > 0) ? CDTIME_T_TO_DOUBLE(db->interval)
-
: plugin_get_interval(
));
+ ;
+ cdtime_t tmp = (db->interval > 0) ? db->interval : plugin_get_interval();
+
snprintf(interval, sizeof(interval), "%.3f", CDTIME_T_TO_DOUBLE(tmp
));
params[i] = interval;
break;
case C_PSQL_PARAM_INSTANCE: