Module: kamailio
Branch: master
Commit: 13c1c0bfdd93d2f727ff65275e93f4a780143dee
URL:
https://github.com/kamailio/kamailio/commit/13c1c0bfdd93d2f727ff65275e93f4a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-11-26T09:14:42+01:00
db_redis: do not print full table scan warning when loading the entire table
- GH #2149
---
Modified: src/modules/db_redis/redis_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/13c1c0bfdd93d2f727ff65275e93f4a…
Patch:
https://github.com/kamailio/kamailio/commit/13c1c0bfdd93d2f727ff65275e93f4a…
---
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index a33f897796..f3b7c1f019 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -1451,11 +1451,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), _n,
keys, keys_count,