[asterisk-commits] russell: trunk r74315 - in /trunk: ./ res/res_config_odbc.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jul 10 10:32:21 CDT 2007
Author: russell
Date: Tue Jul 10 10:32:21 2007
New Revision: 74315
URL: http://svn.digium.com/view/asterisk?view=rev&rev=74315
Log:
Merged revisions 74314 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r74314 | russell | 2007-07-10 10:31:41 -0500 (Tue, 10 Jul 2007) | 11 lines
Merged revisions 74313 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r74313 | russell | 2007-07-10 10:30:20 -0500 (Tue, 10 Jul 2007) | 3 lines
Only use ESCAPE when LIKE is used.
(issue #10075, this part reported by jmls on IRC, patch by me)
........
................
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=74315&r1=74314&r2=74315
==============================================================================
--- trunk/res/res_config_odbc.c (original)
+++ trunk/res/res_config_odbc.c Tue Jul 10 10:32:21 2007
@@ -109,7 +109,8 @@
newval = va_arg(aq, const char *);
}
va_end(aq);
- snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ESCAPE '\\'");
+ if (strcasestr(sql, "LIKE"))
+ snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ESCAPE '\\'");
res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
@@ -266,7 +267,8 @@
if (initfield)
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ORDER BY %s", initfield);
va_end(aq);
- snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ESCAPE '\\'");
+ if (strcasestr(sql, "LIKE"))
+ snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ESCAPE '\\'");
res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
More information about the asterisk-commits
mailing list