Commit ec2112f3 authored by Olivier Bertrand's avatar Olivier Bertrand

1) Fix bug on strange sprintf

2) Fix bug on bad sprintf
3) Fix bug on cast from pointer to int

4) Begin implementing the "info" tables.
Already existing were the ODBC sata source table and the
WMI column info table.

A common way to handle them will permit to develop many
other such tables. Implemented:

The ODBC column info table.

Modified:
ha_connect.cc  (4)
odbconn.cpp    (4)
tabodbc.h      (4)
tabodbc.cpp    (4)
tabsys.h       (3)
rcmsg.c        (4)
tabfmt.cpp     (2)
tabtbl.cpp     (1)
resource.h     (4)
mycat.h        (4)
parent 2809803e
...@@ -161,8 +161,10 @@ PQRYRES ODBCDataSources(PGLOBAL g, bool info = true); ...@@ -161,8 +161,10 @@ PQRYRES ODBCDataSources(PGLOBAL g, bool info = true);
PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn, bool info); PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn, bool info);
#endif // ODBC_SUPPORT #endif // ODBC_SUPPORT
#if defined(MYSQL_SUPPORT) #if defined(MYSQL_SUPPORT)
PQRYRES MyColumns(PGLOBAL g, char *host, char *db, char *user, char *pwd, PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
char *table, char *colpat, int port, bool key); const char *user, const char *pwd,
const char *table, const char *colpat,
int port, bool key);
#endif // MYSQL_SUPPORT #endif // MYSQL_SUPPORT
enum enum_field_types PLGtoMYSQL(int type, bool gdf); enum enum_field_types PLGtoMYSQL(int type, bool gdf);
...@@ -3283,7 +3285,7 @@ bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info) ...@@ -3283,7 +3285,7 @@ bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
char ttp= '?', spc= ',', qch= 0; char ttp= '?', spc= ',', qch= 0;
const char *typn= "DOS"; const char *typn= "DOS";
const char *user; const char *user;
char *fn, *dsn, *tab, *db, *host, *user, *pwd, *prt, *sep, *inf; char *fn, *dsn, *tab, *db, *host, *pwd, *prt, *sep, *inf;
#if defined(WIN32) #if defined(WIN32)
char *nsp= NULL, *cls= NULL; char *nsp= NULL, *cls= NULL;
#endif // WIN32 #endif // WIN32
......
...@@ -339,6 +339,7 @@ PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn, bool info) ...@@ -339,6 +339,7 @@ PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn, bool info)
/************************************************************************/ /************************************************************************/
/* Close the local connection. */ /* Close the local connection. */
/************************************************************************/ /************************************************************************/
if (ocp)
ocp->Close(); ocp->Close();
if (!qrp) if (!qrp)
...@@ -379,7 +380,7 @@ PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn, bool info) ...@@ -379,7 +380,7 @@ PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn, bool info)
/* data sources available on the local host. */ /* data sources available on the local host. */
/* Called with info=true to have result column names. */ /* Called with info=true to have result column names. */
/*************************************************************************/ /*************************************************************************/
PQRYRES ODBCDataSources(PGLOBAL g) PQRYRES ODBCDataSources(PGLOBAL g, bool info)
{ {
static int dbtype[] = {DB_CHAR, DB_CHAR}; static int dbtype[] = {DB_CHAR, DB_CHAR};
static int buftyp[] = {TYPE_STRING, TYPE_STRING}; static int buftyp[] = {TYPE_STRING, TYPE_STRING};
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
#include "sql_string.h" #include "sql_string.h"
extern "C" char *GetMsgid(int id); extern "C" char *GetMsgid(int id);
PQRYRES ODBCDataSources(PGLOBAL g); PQRYRES ODBCDataSources(PGLOBAL g, bool info = false);
PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn, bool info); PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn, bool info);
/***********************************************************************/ /***********************************************************************/
...@@ -934,8 +934,6 @@ PCOL TDBOIF::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) ...@@ -934,8 +934,6 @@ PCOL TDBOIF::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
if (!stricmp(colp->Name, GetMsgid(ID + i))) if (!stricmp(colp->Name, GetMsgid(ID + i)))
colp->Flag = i; colp->Flag = i;
} // endif Flag
return colp; return colp;
} // end of MakeCol } // end of MakeCol
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment