提交 882ebd67 authored 作者: Jeff Lenk's avatar Jeff Lenk

FS-3527 this fixes part of the problem with MSSQL

上级 8f67d2fb
......@@ -540,6 +540,8 @@ SWITCH_DECLARE(int) switch_core_db_changes(switch_core_db_t *db);
* literal.
*/
SWITCH_DECLARE(char*)switch_sql_concat();
SWITCH_END_EXTERN_C
#endif
/* For Emacs:
......
......@@ -702,7 +702,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
"from sip_registrations "
"left join sip_dialogs on "
"sip_dialogs.presence_id = sip_registrations.sip_user || '@' || sip_registrations.sip_host "
"sip_dialogs.presence_id = sip_registrations.sip_user %q '@' %q sip_registrations.sip_host "
"or (sip_dialogs.sip_from_user = sip_registrations.sip_user "
"and sip_dialogs.sip_from_host = sip_registrations.sip_host) "
......@@ -713,6 +713,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
"(sip_registrations.orig_server_host='%q' or sip_registrations.sip_host='%q' "
"or sip_registrations.presence_hosts like '%%%q%%'))",
dh.status, dh.rpid,
switch_sql_concat(), switch_sql_concat(),
probe_euser, probe_host, probe_euser, probe_host, probe_host, probe_host);
switch_assert(sql);
......
......@@ -2114,6 +2114,14 @@ SWITCH_DECLARE(void) switch_cache_db_status(switch_stream_handle_t *stream)
switch_mutex_unlock(sql_manager.dbh_mutex);
}
SWITCH_DECLARE(char*)switch_sql_concat()
{
if(runtime.odbc_dbtype == DBTYPE_MSSQL)
return "+";
return "||";
}
/* For Emacs:
* Local Variables:
* mode:c
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论