diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-10 15:45:46 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-10 15:45:46 +0000 |
commit | e9a1c39f0d2c598b848148268c3a7b646ec92c48 (patch) | |
tree | b73f21aa259c721275e53739126f57e58387cf13 /res | |
parent | be513624d46a5db0a706ef4db6d76a85f6ff22b8 (diff) |
sync with 1.2 branch
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@74320 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_config_odbc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c index dbe37c289..fcd4609cf 100644 --- a/res/res_config_odbc.c +++ b/res/res_config_odbc.c @@ -103,7 +103,8 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl 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)) { @@ -251,7 +252,8 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char * 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)) { |