Browse Source

- relax db_init BUG check (allow db init from fixup functions)

(SER-227 related)
Andrei Pelinescu-Onciul 18 năm trước cách đây
mục cha
commit
28e784e433
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  1. 1 2
      modules/db_postgres/dbase.c

+ 1 - 2
modules/db_postgres/dbase.c

@@ -230,10 +230,9 @@ db_con_t* pg_init(const char* url)
 	res = 0;
 	res = 0;
 
 
 	/* if called from PROC_MAIN, allow it only from mod_init( when pt==0)*/
 	/* if called from PROC_MAIN, allow it only from mod_init( when pt==0)*/
-	if (is_main && pt){
+	if (is_main && fixup_complete){
 		LOG(L_ERR, "BUG: postgres: pg_init: called from the main process,"
 		LOG(L_ERR, "BUG: postgres: pg_init: called from the main process,"
 					" ignoring...\n");
 					" ignoring...\n");
-		return 0;
 	}
 	}
 	if (!url) {
 	if (!url) {
 		ERR("Invalid parameter value\n");
 		ERR("Invalid parameter value\n");