提交 4371f568 authored 作者: Rupa Schomaker's avatar Rupa Schomaker

handle case where custom_sql is braindead (no replaceable params)


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12204 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 75dcd9ae
...@@ -321,8 +321,8 @@ static char *expand_digits(switch_memory_pool_t *pool, char *digits) ...@@ -321,8 +321,8 @@ static char *expand_digits(switch_memory_pool_t *pool, char *digits)
/* format the custom sql */ /* format the custom sql */
static char *format_custom_sql(const char *custom_sql, callback_t *cb_struct, const char *digits) static char *format_custom_sql(const char *custom_sql, callback_t *cb_struct, const char *digits)
{ {
char * tmpSQL; char * tmpSQL = NULL;
char * newSQL; char * newSQL = NULL;
switch_channel_t *channel; switch_channel_t *channel;
/* first replace %s with digits to maintain backward compat */ /* first replace %s with digits to maintain backward compat */
...@@ -352,7 +352,12 @@ static char *format_custom_sql(const char *custom_sql, callback_t *cb_struct, co ...@@ -352,7 +352,12 @@ static char *format_custom_sql(const char *custom_sql, callback_t *cb_struct, co
if(tmpSQL != newSQL) { if(tmpSQL != newSQL) {
switch_safe_free(tmpSQL); switch_safe_free(tmpSQL);
} }
return newSQL;
if(newSQL == NULL) {
return (char *) custom_sql;
} else {
return newSQL;
}
} }
static switch_bool_t lcr_execute_sql_callback(char *sql, switch_core_db_callback_func_t callback, void *pdata) static switch_bool_t lcr_execute_sql_callback(char *sql, switch_core_db_callback_func_t callback, void *pdata)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论