aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_config_odbc.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-23 17:09:06 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-23 17:09:06 +0000
commitfe6dbef2a32f2424a412e7930d4f7e6df6cf4c60 (patch)
treed094a7c9ca91cc656638c132c28f14fa87428f46 /res/res_config_odbc.c
parent5ccc5160d7ee813208b02ed863820a072fc075bf (diff)
Merged revisions 89534 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89534 | tilghman | 2007-11-23 11:05:10 -0600 (Fri, 23 Nov 2007) | 5 lines Use ESCAPE clause for the first parameter, not just 2nd-Nth parameters. Reported by: apsaras Patch by: tilghman (Closes issue #11353) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89535 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_config_odbc.c')
-rw-r--r--res/res_config_odbc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c
index 08adeb443..2af47209a 100644
--- a/res/res_config_odbc.c
+++ b/res/res_config_odbc.c
@@ -289,7 +289,8 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
*op = '\0';
newval = va_arg(aq, const char *);
op = !strchr(newparam, ' ') ? " =" : "";
- snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?", table, newparam, op);
+ snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?%s", table, newparam, op,
+ strcasestr(newparam, "LIKE") ? " ESCAPE '\\'" : "");
while((newparam = va_arg(aq, const char *))) {
op = !strchr(newparam, ' ') ? " =" : "";
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s%s ?%s", newparam, op,