summaryrefslogtreecommitdiff
path: root/storage/connect/tabodbc.cpp
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-02-01 13:36:56 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-02-01 13:36:56 +0400
commit733ab86c254f880042e0a8cddbb2c2d1257db4d6 (patch)
treecbee1c0ba5b597b541d34c8922fbe441f7c05811 /storage/connect/tabodbc.cpp
parentf09ae60d306bb559700e64a8fa43148286760693 (diff)
downloadmariadb-git-733ab86c254f880042e0a8cddbb2c2d1257db4d6.tar.gz
Adding an option to switch off ICONV support:
cmake -DCONNECT_WITH_ICONV=0 modified: storage/connect/CMakeLists.txt storage/connect/tabodbc.cpp storage/connect/tabodbc.h
Diffstat (limited to 'storage/connect/tabodbc.cpp')
-rw-r--r--storage/connect/tabodbc.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index 0b45691bcc3..1ffa9df2b3e 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -272,7 +272,7 @@ void TDBODBC::SetFile(PGLOBAL g, PSZ fn)
DBQ = fn;
} // end of SetFile
-#if !defined(NO_ICONV)
+#ifdef ICONV_SUPPORT
/******************************************************************/
/* Convert an UTF-8 string to latin characters. */
/******************************************************************/
@@ -290,7 +290,7 @@ int TDBODBC::Decode(iconv_t cd, char *utf, char *buf, size_t n)
buf[n - o] = '\0';
return rc;
} // end of Decode
-#endif // !NO_ICONV
+#endif // ICONV_SUPPORT
/***********************************************************************/
/* MakeSQL: make the SQL statement use with ODBC connection. */
@@ -305,11 +305,11 @@ char *TDBODBC::MakeSQL(PGLOBAL g, bool cnt)
bool first = true;
PTABLE tablep = To_Table;
PCOL colp;
-#if !defined(NO_ICONV)
+#ifdef ICONV_SUPPORT
iconv_t cd = iconv_open("ISO-8859-1", "UTF-8");
#else
- void *cd = NULL;
-#endif // !NO_ICONV
+ void *cd = NULL;
+#endif // ICONV_SUPPORT
if (!cnt) {
// Normal SQL statement to retrieve results
@@ -405,9 +405,9 @@ char *TDBODBC::MakeSQL(PGLOBAL g, bool cnt)
strcat(strcat(sql, ownp), ".");
strcat(sql, tabname);
-#if !defined(NO_ICONV)
+#ifdef ICONV_SUPPORT
iconv_close(cd);
-#endif // !NO_ICONV
+#endif // ICONV_SUPPORT
if (To_Filter)
strcat(strcat(sql, " WHERE "), To_Filter);