Module: kamailio
Branch: master
Commit: fd1471d8154ad2ae9c067cfe9df7fe9161510ae2
URL:
https://github.com/kamailio/kamailio/commit/fd1471d8154ad2ae9c067cfe9df7fe9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-02-02T23:45:01+01:00
htable: don't sync back to db when cols per htable is set
---
Modified: modules/htable/ht_api.c
Modified: modules/htable/ht_db.c
---
Diff:
https://github.com/kamailio/kamailio/commit/fd1471d8154ad2ae9c067cfe9df7fe9…
Patch:
https://github.com/kamailio/kamailio/commit/fd1471d8154ad2ae9c067cfe9df7fe9…
---
diff --git a/modules/htable/ht_api.c b/modules/htable/ht_api.c
index d3c1aa8..f0ac4d2 100644
--- a/modules/htable/ht_api.c
+++ b/modules/htable/ht_api.c
@@ -982,7 +982,7 @@ int ht_db_sync_tables(void)
ht = _ht_root;
while(ht)
{
- if(ht->dbtable.len>0 && ht->dbmode!=0)
+ if(ht->dbtable.len>0 && ht->dbmode!=0 && ht->ncols==0)
{
LM_DBG("sync db table [%.*s] from ht [%.*s]\n",
ht->dbtable.len, ht->dbtable.s,
diff --git a/modules/htable/ht_db.c b/modules/htable/ht_db.c
index cf38f82..701660f 100644
--- a/modules/htable/ht_db.c
+++ b/modules/htable/ht_db.c
@@ -507,6 +507,12 @@ int ht_db_save_table(ht_t *ht, str *dbtable)
return -1;
}
+ if(ht->ncols>0) {
+ LM_WARN("saving htable [%.*s] with custom db columns is not available\n",
+ ht->name.len, ht->name.s);
+ return 0;
+ }
+
if (ht_dbf.use_table(ht_db_con, dbtable) < 0)
{
LM_ERR("failed to use_table\n");