Module: kamailio
Branch: 5.2
Commit: cff87a49dac6f3bc04bd0bd203aa3c09b91cd613
URL:
https://github.com/kamailio/kamailio/commit/cff87a49dac6f3bc04bd0bd203aa3c0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2020-01-23T15:21:30+01:00
db_redis: do not print full table scan warning when loading the entire table
- GH #2149
(cherry picked from commit 13c1c0bfdd93d2f727ff65275e93f4a780143dee)
---
Modified: src/modules/db_redis/redis_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/cff87a49dac6f3bc04bd0bd203aa3c0…
Patch:
https://github.com/kamailio/kamailio/commit/cff87a49dac6f3bc04bd0bd203aa3c0…
---
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 97fd19ee01..acddbdfd5b 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -1095,11 +1095,15 @@ static int db_redis_perform_query(const db1_con_t* _h,
km_redis_con_t *con, cons
RES_COL_N(*_r) = _nc;
if (!(*keys_count) && do_table_scan) {
- LM_WARN("performing full table scan on table '%.*s' while performing
query\n",
+ if(_n > 0) {
+ LM_WARN("performing full table scan on table '%.*s' while doing
the query\n",
CON_TABLE(_h)->len, CON_TABLE(_h)->s);
- for(i = 0; i < _n; ++i) {
- LM_WARN(" scan key %d is '%.*s'\n",
- i, _k[i]->len, _k[i]->s);
+ for(i = 0; i < _n; ++i) {
+ LM_WARN(" scan key %d is '%.*s'\n",
+ i, _k[i]->len, _k[i]->s);
+ }
+ } else {
+ LM_DBG("loading full table: '%.*s\n", CON_TABLE(_h)->len,
CON_TABLE(_h)->s);
}
if (db_redis_scan_query_keys(con, CON_TABLE(_h), _k, _n,
keys, keys_count,