2015-01-13 17:24:31 +01:00
|
|
|
// Timeout and net wait defaults
|
|
|
|
#define DEFAULT_LOGIN_TIMEOUT -1 // means do not set
|
|
|
|
#define DEFAULT_QUERY_TIMEOUT -1 // means do not set
|
|
|
|
|
2015-01-31 15:05:43 +01:00
|
|
|
typedef struct odbc_parms {
|
|
|
|
char *User; // User connect info
|
|
|
|
char *Pwd; // Password connect info
|
|
|
|
int Cto; // Connect timeout
|
|
|
|
int Qto; // Query timeout
|
|
|
|
bool UseCnc; // Use SQLConnect (!SQLDriverConnect)
|
|
|
|
} ODBCPARM, *POPARM;
|
|
|
|
|
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
2013-02-11 07:16:52 +01:00
|
|
|
/***********************************************************************/
|
|
|
|
/* ODBC catalog function prototypes. */
|
|
|
|
/***********************************************************************/
|
2013-11-22 16:03:54 +01:00
|
|
|
#if defined(PROMPT_OK)
|
2013-10-26 00:43:03 +02:00
|
|
|
char *ODBCCheckConnection(PGLOBAL g, char *dsn, int cop);
|
2013-11-22 16:03:54 +01:00
|
|
|
#endif // PROMPT_OK
|
2013-12-16 01:32:47 +01:00
|
|
|
PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info);
|
|
|
|
PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table,
|
2015-01-31 15:05:43 +01:00
|
|
|
char *colpat, int maxres, bool info, POPARM sop);
|
|
|
|
PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src, POPARM sop);
|
2013-12-16 01:32:47 +01:00
|
|
|
PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat,
|
2016-07-14 20:12:22 +02:00
|
|
|
char *tabtyp, int maxres, bool info, POPARM sop);
|
2013-12-16 01:32:47 +01:00
|
|
|
PQRYRES ODBCDrivers(PGLOBAL g, int maxres, bool info);
|