2
0
Эх сурвалжийг харах

mtree: revert a0e4a9c18e and let db_table name not set by default

- it breaks some runtime rpc commands, reported by GH #1057
- reset it also if set by mistake when mtree param is used

(cherry picked from commit a4cdacd0b63245c48fcc6e0a20c9b665ef877090)
Daniel-Constantin Mierla 8 жил өмнө
parent
commit
9748188734

+ 6 - 1
src/modules/mtree/mtree_mod.c

@@ -74,7 +74,9 @@ CREATE TABLE mtrees (
 
 
 /** parameters */
 /** parameters */
 static str db_url = str_init(DEFAULT_DB_URL);
 static str db_url = str_init(DEFAULT_DB_URL);
-static str db_table = str_init("mtrees");
+/* default name created by sql scripts is 'mtrees'
+ * - don't set it here with default value, only via config param */
+static str db_table = str_init("");
 static str tname_column   = str_init("tname");
 static str tname_column   = str_init("tname");
 static str tprefix_column = str_init("tprefix");
 static str tprefix_column = str_init("tprefix");
 static str tvalue_column  = str_init("tvalue");
 static str tvalue_column  = str_init("tvalue");
@@ -269,6 +271,9 @@ static int mod_init(void)
 			}
 			}
 			pt = pt->next;
 			pt = pt->next;
 		}
 		}
+		/* reset db_table value */
+		db_table.s = "";
+		db_table.len = 0;
 	} else {
 	} else {
 		if(db_table.len<=0)
 		if(db_table.len<=0)
 		{
 		{