[sr-dev] git:5.0:34752a8a: db_text: throw an error and abort instead of silently truncate tables

Ovidiu Sas osas at voipembedded.com
Fri May 10 16:14:48 CEST 2019


Module: kamailio
Branch: 5.0
Commit: 34752a8ab5beb0d71e2fddcde435b410b6825563
URL: https://github.com/kamailio/kamailio/commit/34752a8ab5beb0d71e2fddcde435b410b6825563

Author: Ovidiu Sas <osas at voipembedded.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date: 2019-05-10T10:14:22-04:00

db_text: throw an error and abort instead of silently truncate tables

(cherry picked from commit 3ed1fcdbb9247b1eb10d8d544f2a67b277bd1031)

---

Modified: src/modules/db_text/dbt_base.c

---

Diff:  https://github.com/kamailio/kamailio/commit/34752a8ab5beb0d71e2fddcde435b410b6825563.diff
Patch: https://github.com/kamailio/kamailio/commit/34752a8ab5beb0d71e2fddcde435b410b6825563.patch

---

diff --git a/src/modules/db_text/dbt_base.c b/src/modules/db_text/dbt_base.c
index f965b22d24..2229ecd1ad 100644
--- a/src/modules/db_text/dbt_base.c
+++ b/src/modules/db_text/dbt_base.c
@@ -295,6 +295,11 @@ int dbt_query(db1_con_t* _h, db_key_t* _k, db_op_t* _op, db_val_t* _v,
 		}
 		_drp = _drp->next;
 	}
+	if (_drp && counter == _db_text_max_result_rows)
+	{
+		LM_ERR("Truncated table at [%d] rows. Please increase 'max_result_rows' param!\n", counter);
+		goto error;
+	}
 
 	if (_o_l)
 	{




More information about the sr-dev mailing list