FS-5019 --resolve I would rather have this fix in the core... But in the mean…

FS-5019 --resolve  I would rather have this fix in the core... But in the mean this, this look good.  Thanks
上级 ede1217e
...@@ -531,6 +531,7 @@ static switch_status_t populate_database(switch_core_session_t *session, dir_pro ...@@ -531,6 +531,7 @@ static switch_status_t populate_database(switch_core_session_t *session, dir_pro
char *sql = NULL; char *sql = NULL;
char *sqlvalues = NULL; char *sqlvalues = NULL;
char *sqltmp = NULL; char *sqltmp = NULL;
int count = 0;
switch_xml_t xml_root = NULL, x_domain; switch_xml_t xml_root = NULL, x_domain;
switch_xml_t ut; switch_xml_t ut;
...@@ -633,13 +634,22 @@ static switch_status_t populate_database(switch_core_session_t *session, dir_pro ...@@ -633,13 +634,22 @@ static switch_status_t populate_database(switch_core_session_t *session, dir_pro
switch_safe_free(fullNameDigit); switch_safe_free(fullNameDigit);
switch_safe_free(lastNameDigit); switch_safe_free(lastNameDigit);
switch_safe_free(firstNameDigit); switch_safe_free(firstNameDigit);
if (++count >= 100) {
count = 0;
sql = switch_mprintf("BEGIN;%s;COMMIT;", sqlvalues);
directory_execute_sql(sql, globals.mutex);
switch_safe_free(sql);
switch_safe_free(sqlvalues);
}
} }
} }
} }
} }
sql = switch_mprintf("BEGIN;%s;COMMIT;", sqlvalues); if (sqlvalues) {
directory_execute_sql(sql, globals.mutex); sql = switch_mprintf("BEGIN;%s;COMMIT;", sqlvalues);
directory_execute_sql(sql, globals.mutex);
}
end: end:
switch_safe_free(sql); switch_safe_free(sql);
switch_safe_free(sqlvalues); switch_safe_free(sqlvalues);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论