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