Module: kamailio
Branch: master
Commit: 2caa4d38632b158279237472fa97eadf8dac558e
URL: 
https://github.com/kamailio/kamailio/commit/2caa4d38632b158279237472fa97eadf8dac558e

Author: Federico Cabiddu <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2025-12-09T12:10:25+01:00

sqlops: pass the db url to the async function

---

Modified: src/modules/sqlops/sql_api.c
Modified: src/modules/sqlops/sqlops.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/2caa4d38632b158279237472fa97eadf8dac558e.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2caa4d38632b158279237472fa97eadf8dac558e.patch

---

diff --git a/src/modules/sqlops/sql_api.c b/src/modules/sqlops/sql_api.c
index 2c376415a16..25ac1d14eb9 100644
--- a/src/modules/sqlops/sql_api.c
+++ b/src/modules/sqlops/sql_api.c
@@ -431,7 +431,7 @@ int sql_do_query_async(sql_con_t *con, str *query)
                LM_ERR("the db driver module doesn't support async query\n");
                return -1;
        }
-       if(con->dbf.raw_query_async(con->dbh, query) != 0) {
+       if(con->dbf.raw_query_async(&con->db_url, query) != 0) {
                LM_ERR("cannot do the query\n");
                return -1;
        }
diff --git a/src/modules/sqlops/sqlops.c b/src/modules/sqlops/sqlops.c
index 0452bddab63..1fe98ba6ebc 100644
--- a/src/modules/sqlops/sqlops.c
+++ b/src/modules/sqlops/sqlops.c
@@ -258,10 +258,6 @@ static int sql_query2(struct sip_msg *msg, char *dbl, char 
*query)
 static int sql_query_async(struct sip_msg *msg, char *dbl, char *query)
 {
        str sq;
-       if(sql_check_connection((sql_con_t *)dbl) < 0) {
-               LM_ERR("invalid connection to database\n");
-               return -2;
-       }
        if(pv_printf_s(msg, (pv_elem_t *)query, &sq) != 0) {
                LM_ERR("cannot print the sql query\n");
                return -1;

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to