[asterisk-commits] tilghman: trunk r89535 - in /trunk: ./ res/res_config_odbc.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 23 11:09:07 CST 2007


Author: tilghman
Date: Fri Nov 23 11:09:06 2007
New Revision: 89535

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89535
Log:
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)

........

Modified:
    trunk/   (props changed)
    trunk/res/res_config_odbc.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/res/res_config_odbc.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_config_odbc.c?view=diff&rev=89535&r1=89534&r2=89535
==============================================================================
--- trunk/res/res_config_odbc.c (original)
+++ trunk/res/res_config_odbc.c Fri Nov 23 11:09:06 2007
@@ -289,7 +289,8 @@
 		*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,




More information about the asterisk-commits mailing list