Module: kamailio
Branch: 5.2
Commit: f2a987a8c4aacb1538f44b890f922d495ef103f6
URL:
https://github.com/kamailio/kamailio/commit/f2a987a8c4aacb1538f44b890f922d4…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Richard Fuchs <rfuchs(a)sipwise.com>
Date: 2020-07-16T11:26:39-04:00
db_redis: fix unfiltered table deletion
---
Modified: src/modules/db_redis/redis_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f2a987a8c4aacb1538f44b890f922d4…
Patch:
https://github.com/kamailio/kamailio/commit/f2a987a8c4aacb1538f44b890f922d4…
---
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index acddbdfd5b..82054a9b51 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -1329,12 +1329,6 @@ static int db_redis_perform_delete(const db1_con_t* _h,
km_redis_con_t *con, con
if (tmp)
db_redis_key_free(&tmp);
- // skip if delete all rows
- if (!*manual_keys_count) {
- db_redis_key_free (&query_v);
- goto skipkeys;
- }
-
if (db_redis_key_prepend_string(&query_v, "HMGET", 5) != 0) {
LM_ERR("Failed to set hmget command to pre-delete query\n");
goto error;
@@ -1426,7 +1420,6 @@ static int db_redis_perform_delete(const db1_con_t* _h,
km_redis_con_t *con, con
db_vals = NULL;
db_redis_free_reply(&reply);
- skipkeys:
if (db_redis_key_add_string(&query_v, "DEL", 3) != 0) {
LM_ERR("Failed to add del command to delete query\n");
goto error;
@@ -2064,6 +2057,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
} else {
LM_DBG("no columns given to build query keys, falling back to full table
scan\n");
keys_count = 0;
+ do_table_scan = 1;
}
if (db_redis_perform_delete(_h, con, _k, _v, query_ops, _n,