diff options
Diffstat (limited to 'storage/connect/myconn.cpp')
-rw-r--r-- | storage/connect/myconn.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp index 2f3d75b52fa..ada0109a820 100644 --- a/storage/connect/myconn.cpp +++ b/storage/connect/myconn.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2007-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2007-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -35,11 +35,11 @@ #include "my_sys.h" #include "mysqld_error.h" #endif // !MYSQL_PREPARED_STATEMENTS -#if defined(WIN32) +#if defined(__WIN__) //#include <windows.h> -#else // !WIN32 +#else // !__WIN__ #include "osutil.h" -#endif // !WIN32 +#endif // !__WIN__ #include "global.h" #include "plgdbsem.h" @@ -51,7 +51,8 @@ #define DLL_EXPORT // Items are exported from this DLL #include "myconn.h" -extern "C" int zconv; +//extern "C" int zconv; +int GetConvSize(void); extern MYSQL_PLUGIN_IMPORT uint mysqld_port; extern MYSQL_PLUGIN_IMPORT char *mysqld_unix_port; @@ -265,7 +266,7 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db, return NULL; } else if (type == TYPE_STRING) { if (v == 'X') { - len = zconv; + len = GetConvSize(); sprintf(g->Message, "Column %s converted to varchar(%d)", colname, len); PushWarning(g, thd); @@ -450,15 +451,15 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db, mysql_options(m_DB, MYSQL_OPT_READ_TIMEOUT, &nrt); //mysql_options(m_DB, MYSQL_OPT_WRITE_TIMEOUT, ...); -#if defined(WIN32) +#if defined(__WIN__) if (!strcmp(host, ".")) { mysql_options(m_DB, MYSQL_OPT_NAMED_PIPE, NULL); pipe = mysqld_unix_port; } // endif host -#else // !WIN32 +#else // !__WIN__ if (!strcmp(host, "localhost")) pipe = mysqld_unix_port; -#endif // !WIN32 +#endif // !__WIN__ #if 0 if (pwd && !strcmp(pwd, "*")) { @@ -719,7 +720,7 @@ int MYSQLC::ExecSQL(PGLOBAL g, const char *query, int *w) /***********************************************************************/ /* Get table size by executing "select count(*) from table_name". */ /***********************************************************************/ -int MYSQLC::GetTableSize(PGLOBAL g, PSZ query) +int MYSQLC::GetTableSize(PGLOBAL g __attribute__((unused)), PSZ query) { if (mysql_real_query(m_DB, query, strlen(query))) { #if defined(_DEBUG) |