فهرست منبع

htable: don't sync back to db when cols per htable is set

Daniel-Constantin Mierla 9 سال پیش
والد
کامیت
fd1471d815
2فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 1 1
      modules/htable/ht_api.c
  2. 6 0
      modules/htable/ht_db.c

+ 1 - 1
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,

+ 6 - 0
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");