Commit a8f0f93a authored by Alexander Barkov's avatar Alexander Barkov

A Changeset from Olivier:

Added some #if define(... for WIN32, ODBC and MYSQL in case they not defined.

modified:
  storage/connect/ha_connect.cc
parent bb6b87fd
......@@ -155,15 +155,19 @@ void XmlCleanupParserLib(void);
/* Functions called externally by pre_parser. */
/****************************************************************************/
PQRYRES DBFColumns(PGLOBAL g, char *fn, BOOL info);
PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn);
PQRYRES CSVColumns(PGLOBAL g, char *fn, char sep, char q, int hdr, int mxr);
#if defined(ODBC_SUPPORT)
PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn);
#endif // ODBC_SUPPORT
#if defined(MYSQL_SUPPORT)
PQRYRES MyColumns(PGLOBAL g, char *host, char *db, char *user, char *pwd,
char *table, char *colpat, int port, bool key);
enum enum_field_types PLGtoMYSQL(int type, bool gdf);
#endif // MYSQL_SUPPORT
#if defined(WIN32)
PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *classname, PWMIUT wp= NULL);
#endif // WIN32
char GetTypeID(char *type);
enum enum_field_types PLGtoMYSQL(int type, bool gdf);
bool check_string_char_length(LEX_STRING *str, const char *err_msg,
uint max_char_length, CHARSET_INFO *cs,
bool no_error);
......@@ -3313,11 +3317,12 @@ bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
#if defined(WIN32)
nsp= GetListOption("namespace", pov->value.str);
cls= GetListOption("class", pov->value.str);
#endif
#endif // WIN32
mxr= atoi(GetListOption("maxerr", pov->value.str, "0"));
} // endelse option_list
switch (ttp) {
#if defined(ODBC_SUPPORT)
case 'O': // ODBC
if (!(dsn= create_info->connect_string.str))
sprintf(g->Message, "Missing %s connection string", typn);
......@@ -3325,6 +3330,7 @@ bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
ok= true;
break;
#endif // ODBC_SUPPORT
case 'A': // DBF
case 'C': // CSV
if (!fn)
......@@ -3333,12 +3339,14 @@ bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
ok= true;
break;
#if defined(MYSQL_SUPPORT)
case 'Y': // MYSQL
if (!user)
user= "root"; // Avoid crash
ok= true;
break;
#endif // MYSQL_SUPPORT
#if defined(WIN32)
case 'W': // WMI
ok= true;
......@@ -3366,12 +3374,16 @@ bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
case 'A':
qrp= DBFColumns(g, fn, false);
break;
#if defined(ODBC_SUPPORT)
case 'O':
qrp= MyODBCCols(g, tab, dsn);
break;
#endif // ODBC_SUPPORT
#if defined(MYSQL_SUPPORT)
case 'Y':
qrp= MyColumns(g, host, db, user, pwd, tab, NULL, port, false);
break;
#endif // MYSQL_SUPPORT
case 'C':
qrp= CSVColumns(g, fn, spc, qch, hdr, mxr);
break;
......
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