Ver Fonte

mtree: replace tree structure even there are no records in db table

- reload didn't replaced old tree if no records in db table
- reported by Juha Heinanen

(cherry picked from commit c36f326d3c7372b149592d438df75f3d7b0a0233)
(cherry picked from commit 47a00936695c46176c3c047e0ab141b4127d08dc)
Daniel-Constantin Mierla há 11 anos atrás
pai
commit
ae8c29f899
1 ficheiros alterados com 4 adições e 4 exclusões
  1. 4 4
      modules/mtree/mtree_mod.c

+ 4 - 4
modules/mtree/mtree_mod.c

@@ -533,8 +533,7 @@ static int mt_load_db(str *tname)
 		} else {
 			if(RES_ROW_N(db_res)==0)
 			{
-				mt_dbf.free_result(db_con, db_res);
-				return 0;
+				goto dbreloaded;
 			}
 		}
 	} else {
@@ -544,8 +543,7 @@ static int mt_load_db(str *tname)
 		{
 			if(ret==0)
 			{
-				mt_dbf.free_result(db_con, db_res);
-				return 0;
+				goto dbreloaded;
 			} else {
 				goto error;
 			}
@@ -600,6 +598,8 @@ static int mt_load_db(str *tname)
 			break;
 		}
 	}  while(RES_ROW_N(db_res)>0);
+
+dbreloaded:
 	mt_dbf.free_result(db_con, db_res);