]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add detection for ODBC WCHAR fields
authorTerry Wilson <twilson@digium.com>
Wed, 7 Mar 2012 15:07:04 +0000 (15:07 +0000)
committerTerry Wilson <twilson@digium.com>
Wed, 7 Mar 2012 15:07:04 +0000 (15:07 +0000)
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.
........

Merged revisions 358435 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@358436 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr/cdr_adaptive_odbc.c
cel/cel_odbc.c

index f9b5bf195be818d4a9bd0689377c85ea09daefb9..c4ffa16c6bd468981c628bafb00279509e23ad95 100644 (file)
@@ -431,9 +431,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:
index 223cb18c99b3a0dee739d414da3616f301deb5b0..3472e9b6e40c37878735c7a905f82cda5eba2872 100644 (file)
@@ -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: