From 522372b3dfe37328a28c1e03d93649cbdc6f9238 Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Wed, 7 Mar 2012 15:03:40 +0000 Subject: [PATCH] Add detection for ODBC WCHAR fields Without detecting these types, cel_odbc blows up when the character set for the table is utf8. This also wraps cdr_adaptive_odbc's use of those types in the HAVE_ODBC_WCHAR #ifdef seen in other parts of the code. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@358435 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- cdr/cdr_adaptive_odbc.c | 2 ++ cel/cel_odbc.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/cdr/cdr_adaptive_odbc.c b/cdr/cdr_adaptive_odbc.c index fe0abb7ea8..619d78155e 100644 --- a/cdr/cdr_adaptive_odbc.c +++ b/cdr/cdr_adaptive_odbc.c @@ -421,9 +421,11 @@ static int odbc_log(struct ast_cdr *cdr) case SQL_CHAR: case SQL_VARCHAR: case SQL_LONGVARCHAR: +#ifdef HAVE_ODBC_WCHAR case SQL_WCHAR: case SQL_WVARCHAR: case SQL_WLONGVARCHAR: +#endif case SQL_BINARY: case SQL_VARBINARY: case SQL_LONGVARBINARY: diff --git a/cel/cel_odbc.c b/cel/cel_odbc.c index 223cb18c99..3472e9b6e4 100644 --- a/cel/cel_odbc.c +++ b/cel/cel_odbc.c @@ -468,6 +468,11 @@ static void odbc_log(const struct ast_event *event, void *userdata) case SQL_CHAR: case SQL_VARCHAR: case SQL_LONGVARCHAR: +#ifdef HAVE_ODBC_WCHAR + case SQL_WCHAR: + case SQL_WVARCHAR: + case SQL_WLONGVARCHAR: +#endif case SQL_BINARY: case SQL_VARBINARY: case SQL_LONGVARBINARY: -- 2.47.2