[asterisk-commits] russell: branch 1.2 r73684 - /branches/1.2/res/res_config_odbc.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jul 6 11:06:28 CDT 2007
Author: russell
Date: Fri Jul 6 11:06:27 2007
New Revision: 73684
URL: http://svn.digium.com/view/asterisk?view=rev&rev=73684
Log:
(closes issue #10075)
Reported by: apsaras
Patches submitted by: Corydon76
Tested by: apsaras
Fix a problem with MSSQL 2005 by explicitly stating that '\' is being used as
an escape character.
Modified:
branches/1.2/res/res_config_odbc.c
Modified: branches/1.2/res/res_config_odbc.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_config_odbc.c?view=diff&rev=73684&r1=73683&r2=73684
==============================================================================
--- branches/1.2/res/res_config_odbc.c (original)
+++ branches/1.2/res/res_config_odbc.c Fri Jul 6 11:06:27 2007
@@ -103,6 +103,8 @@
newval = va_arg(aq, const char *);
}
va_end(aq);
+ 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)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -249,6 +251,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 '\\'");
+
res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
More information about the asterisk-commits
mailing list