summaryrefslogtreecommitdiff
path: root/storage/connect
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-02-11 10:16:52 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-02-11 10:16:52 +0400
commitebf2da004502ff9c34003cf30fe5cfd689c9f1d2 (patch)
tree0d7ebfa4be7519a5a162358fb4bdc31b1158433c /storage/connect
parentf6ca3b05f230498ede5f4d2467719d529abbb14a (diff)
downloadmariadb-git-ebf2da004502ff9c34003cf30fe5cfd689c9f1d2.tar.gz
Fixing compilation problems on Unix:
1. Conflicting declarations: In file included from /usr/include/sql.h:19:0, from <path>/storage/connect/odbconn.h:15, from <path>/storage/connect/ha_connect.cc:117: /usr/include/sqltypes.h:98:23: error: conflicting declaration ‘typedef unsigned int DWORD’ os.h and unixODBC's sqltypes.h (included from sql.h) have conflicting declarations, because unixODBC for some reasons incorrectly defines DWORD as "unsigned int", while we define DWORD as "unsigned long" (which is the Microsoft way). We should never include os.h and odbconn.h from the same file. Inside tabodbc.cpp DWORD must be seen as sql.h defines it. In all other files DWORD must be seen as os.h defines it. Fix: Moving ODBC catalog function prototypes into a separate file odbccat.h. Fixing ha_connect.cc to include odbccat.h instead of odbcon.h 2. Use of ambiguous overloaded function in myconn.cpp: There's no a method SetValue(const char *fmt, int i); There's only a method SetValue(char *fmt, int i); Fixing the call accordingly: - crp->Kdata->SetValue((fmt) ? fmt : "", i); + crp->Kdata->SetValue((fmt) ? fmt : (char*) "", i); Note, this is a quick hack. The correct fix would be to change the method prototype to have the "fmt" argument as "const char *". However, it is tightly related to about 300 other places where "char*" is used instead of "const char *". We'll need to fix all of them gradually (in separate changes). added: storage/connect/odbccat.h modified: storage/connect/ha_connect.cc storage/connect/myconn.cpp storage/connect/odbconn.h storage/connect/tabodbc.cpp
Diffstat (limited to 'storage/connect')
-rw-r--r--storage/connect/ha_connect.cc2
-rw-r--r--storage/connect/myconn.cpp2
-rw-r--r--storage/connect/odbccat.h7
-rw-r--r--storage/connect/odbconn.h8
-rw-r--r--storage/connect/tabodbc.cpp1
5 files changed, 10 insertions, 10 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 4d1ee88c8a1..905f660c016 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -114,7 +114,7 @@
#include "global.h"
#include "plgdbsem.h"
#if defined(ODBC_SUPPORT)
-#include "odbconn.h"
+#include "odbccat.h"
#endif // ODBC_SUPPORT
#if defined(MYSQL_SUPPORT)
#include "myconn.h"
diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp
index b4347f11094..027d37b86c6 100644
--- a/storage/connect/myconn.cpp
+++ b/storage/connect/myconn.cpp
@@ -208,7 +208,7 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
crp->Kdata->SetValue(fld, i);
crp = crp->Next; // New
- crp->Kdata->SetValue((fmt) ? fmt : "", i);
+ crp->Kdata->SetValue((fmt) ? fmt : (char*) "", i);
crp = crp->Next; // New (charset)
fld = myc.GetCharField(2);
diff --git a/storage/connect/odbccat.h b/storage/connect/odbccat.h
new file mode 100644
index 00000000000..617c7d613a8
--- /dev/null
+++ b/storage/connect/odbccat.h
@@ -0,0 +1,7 @@
+/***********************************************************************/
+/* ODBC catalog function prototypes. */
+/***********************************************************************/
+PQRYRES ODBCDataSources(PGLOBAL g, bool info);
+PQRYRES MyODBCCols(PGLOBAL g, char *dsn, char *tab, bool info);
+PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info);
+PQRYRES ODBCDrivers(PGLOBAL g, bool info);
diff --git a/storage/connect/odbconn.h b/storage/connect/odbconn.h
index 6827a5a5ece..f2312a4461f 100644
--- a/storage/connect/odbconn.h
+++ b/storage/connect/odbconn.h
@@ -5,14 +5,6 @@
//nclude <windowsx.h> /* Message crackers */
/***********************************************************************/
-/* Catalog function prototypes. */
-/***********************************************************************/
-PQRYRES ODBCDataSources(PGLOBAL g, bool info);
-PQRYRES MyODBCCols(PGLOBAL g, char *dsn, char *tab, bool info);
-PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info);
-PQRYRES ODBCDrivers(PGLOBAL g, bool info);
-
-/***********************************************************************/
/* Included C-definition files required by the interface. */
/***********************************************************************/
#include "block.h"
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index 55475852a62..276834b4e5e 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -66,6 +66,7 @@
#include "plgdbsem.h"
#include "xtable.h"
#include "tabodbc.h"
+#include "odbccat.h"
#include "tabmul.h"
#include "reldef.h"
#include "tabcol.h"