Merge tag 'mariadb-10.0.20' into 10.1

This commit is contained in:
Sergei Golubchik 2015-06-27 20:35:26 +02:00
commit 658992699b
390 changed files with 7196 additions and 4464 deletions

View file

@ -138,10 +138,10 @@
#include "reldef.h"
#include "tabcol.h"
#include "xindex.h"
#if defined(WIN32)
#if defined(__WIN__)
#include <io.h>
#include "tabwmi.h"
#endif // WIN32
#endif // __WIN__
#include "connect.h"
#include "user_connect.h"
#include "ha_connect.h"
@ -153,6 +153,7 @@
#endif // LIBXML2_SUPPORT
#include "taboccur.h"
#include "tabpivot.h"
#include "tabfix.h"
#define my_strupr(p) my_caseup_str(default_charset_info, (p));
#define my_strlwr(p) my_casedn_str(default_charset_info, (p));
@ -168,13 +169,13 @@
#define JSONMAX 10 // JSON Default max grp size
extern "C" {
char version[]= "Version 1.03.0007 April 30, 2015";
#if defined(WIN32)
char version[]= "Version 1.03.0007 June 03, 2015";
#if defined(__WIN__)
char compver[]= "Version 1.03.0007 " __DATE__ " " __TIME__;
char slash= '\\';
#else // !WIN32
#else // !__WIN__
char slash= '/';
#endif // !WIN32
#endif // !__WIN__
} // extern "C"
#if defined(XMAP)
@ -193,10 +194,9 @@ extern "C" {
/* Utility functions. */
/***********************************************************************/
PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info);
PQRYRES VirColumns(PGLOBAL g, char *tab, char *db, bool info);
PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn,
int pretty, int lvl, int mxr, bool info);
PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info);
PQRYRES VirColumns(PGLOBAL g, bool info);
PQRYRES JSONColumns(PGLOBAL g, char *db, PTOS topt, bool info);
PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info);
void PushWarning(PGLOBAL g, THD *thd, int level);
bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host,
const char *db, char *tab, const char *src, int port);
@ -349,7 +349,7 @@ int GetConvSize(void) {return THDVAR(current_thd, conv_size);}
TYPCONV GetTypeConv(void) {return (TYPCONV)THDVAR(current_thd, type_conv);}
uint GetJsonGrpSize(void) {return THDVAR(current_thd, json_grp_size);}
uint GetWorkSize(void) {return THDVAR(current_thd, work_size);}
void SetWorkSize(uint n)
void SetWorkSize(uint)
{
// Changing the session variable value seems to be impossible here
// and should be done in a check function
@ -629,11 +629,11 @@ static int connect_init_func(void *p)
}
#endif // 0 (LINUX)
#if defined(WIN32)
#if defined(__WIN__)
sql_print_information("CONNECT: %s", compver);
#else // !WIN32
#else // !__WIN__
sql_print_information("CONNECT: %s", version);
#endif // !WIN32
#endif // !__WIN__
#ifdef LIBXML2_SUPPORT
XmlInitParserLib();
@ -656,6 +656,7 @@ static int connect_init_func(void *p)
sql_print_information("connect_init: hton=%p", p);
DTVAL::SetTimeShift(); // Initialize time zone shift once for all
BINCOL::SetEndian(); // Initialize host endian setting
DBUG_RETURN(0);
} // end of connect_init_func
@ -664,7 +665,7 @@ static int connect_init_func(void *p)
@brief
Plugin clean up
*/
static int connect_done_func(void *p)
static int connect_done_func(void *)
{
int error= 0;
PCONNECT pc, pn;
@ -674,9 +675,9 @@ static int connect_done_func(void *p)
XmlCleanupParserLib();
#endif // LIBXML2_SUPPORT
#if !defined(WIN32)
#if !defined(__WIN__)
//PROFILE_End(); Causes signal 11
#endif // !WIN32
#endif // !__WIN__
for (pc= user_connect::to_users; pc; pc= pn) {
if (pc->g)
@ -743,11 +744,11 @@ ha_connect::ha_connect(handlerton *hton, TABLE_SHARE *table_arg)
xp= (table) ? GetUser(ha_thd(), NULL) : NULL;
if (xp)
xp->SetHandler(this);
#if defined(WIN32)
#if defined(__WIN__)
datapath= ".\\";
#else // !WIN32
#else // !__WIN__
datapath= "./";
#endif // !WIN32
#endif // !__WIN__
tdbp= NULL;
sdvalin1= sdvalin2= sdvalin3= sdvalin4= NULL;
sdvalout= NULL;
@ -822,8 +823,6 @@ ha_connect::~ha_connect(void)
/****************************************************************************/
static PCONNECT GetUser(THD *thd, PCONNECT xp)
{
const char *dbn= NULL;
if (!thd)
return NULL;
@ -835,7 +834,7 @@ static PCONNECT GetUser(THD *thd, PCONNECT xp)
break;
if (!xp) {
xp= new user_connect(thd, dbn);
xp= new user_connect(thd);
if (xp->user_init()) {
delete xp;
@ -908,7 +907,8 @@ const char *ha_connect::index_type(uint inx)
If all_parts is set, MySQL wants to know the flags for the combined
index, up to and including 'part'.
*/
ulong ha_connect::index_flags(uint inx, uint part, bool all_parts) const
//ong ha_connect::index_flags(uint inx, uint part, bool all_parts) const
ulong ha_connect::index_flags(uint, uint, bool) const
{
ulong flags= HA_READ_NEXT | HA_READ_RANGE |
HA_KEYREAD_ONLY | HA_KEY_SCAN_NOT_ROR;
@ -1016,6 +1016,117 @@ char *GetListOption(PGLOBAL g, const char *opname,
return opval;
} // end of GetListOption
/****************************************************************************/
/* Return the value of a string option or NULL if not specified. */
/****************************************************************************/
char *GetStringTableOption(PGLOBAL g, PTOS options, char *opname, char *sdef)
{
const char *opval= NULL;
if (!options)
return sdef;
else if (!stricmp(opname, "Type"))
opval= options->type;
else if (!stricmp(opname, "Filename"))
opval= options->filename;
else if (!stricmp(opname, "Optname"))
opval= options->optname;
else if (!stricmp(opname, "Tabname"))
opval= options->tabname;
else if (!stricmp(opname, "Tablist"))
opval= options->tablist;
else if (!stricmp(opname, "Database") ||
!stricmp(opname, "DBname"))
opval= options->dbname;
else if (!stricmp(opname, "Separator"))
opval= options->separator;
else if (!stricmp(opname, "Qchar"))
opval= options->qchar;
else if (!stricmp(opname, "Module"))
opval= options->module;
else if (!stricmp(opname, "Subtype"))
opval= options->subtype;
else if (!stricmp(opname, "Catfunc"))
opval= options->catfunc;
else if (!stricmp(opname, "Srcdef"))
opval= options->srcdef;
else if (!stricmp(opname, "Colist"))
opval= options->colist;
else if (!stricmp(opname, "Data_charset"))
opval= options->data_charset;
if (!opval && options && options->oplist)
opval= GetListOption(g, opname, options->oplist);
return opval ? (char*)opval : sdef;
} // end of GetStringTableOption
/****************************************************************************/
/* Return the value of a Boolean option or bdef if not specified. */
/****************************************************************************/
bool GetBooleanTableOption(PGLOBAL g, PTOS options, char *opname, bool bdef)
{
bool opval= bdef;
char *pv;
if (!options)
return bdef;
else if (!stricmp(opname, "Mapped"))
opval= options->mapped;
else if (!stricmp(opname, "Huge"))
opval= options->huge;
else if (!stricmp(opname, "Split"))
opval= options->split;
else if (!stricmp(opname, "Readonly"))
opval= options->readonly;
else if (!stricmp(opname, "SepIndex"))
opval= options->sepindex;
else if (!stricmp(opname, "Header"))
opval= (options->header != 0); // Is Boolean for some table types
else if (options->oplist)
if ((pv= GetListOption(g, opname, options->oplist)))
opval= (!*pv || *pv == 'y' || *pv == 'Y' || atoi(pv) != 0);
return opval;
} // end of GetBooleanTableOption
/****************************************************************************/
/* Return the value of an integer option or NO_IVAL if not specified. */
/****************************************************************************/
int GetIntegerTableOption(PGLOBAL g, PTOS options, char *opname, int idef)
{
ulonglong opval= NO_IVAL;
if (!options)
return idef;
else if (!stricmp(opname, "Lrecl"))
opval= options->lrecl;
else if (!stricmp(opname, "Elements"))
opval= options->elements;
else if (!stricmp(opname, "Multiple"))
opval= options->multiple;
else if (!stricmp(opname, "Header"))
opval= options->header;
else if (!stricmp(opname, "Quoted"))
opval= options->quoted;
else if (!stricmp(opname, "Ending"))
opval= options->ending;
else if (!stricmp(opname, "Compressed"))
opval= (options->compressed);
if (opval == NO_IVAL) {
char *pv;
if ((pv= GetListOption(g, opname, options->oplist)))
opval= CharToNumber(pv, strlen(pv), ULONGLONG_MAX, true);
else
return idef;
} // endif opval
return (int)opval;
} // end of GetIntegerTableOption
/****************************************************************************/
/* Return the table option structure. */
/****************************************************************************/
@ -1034,9 +1145,6 @@ char *ha_connect::GetRealString(const char *s)
char *sv;
if (IsPartitioned() && s) {
// sv= (char*)PlugSubAlloc(xp->g, NULL, strlen(s) + strlen(partname));
// With wrong string pattern, the size of the constructed string
// can be more than strlen(s) + strlen(partname)
sv= (char*)PlugSubAlloc(xp->g, NULL, 0);
sprintf(sv, s, partname);
PlugSubAlloc(xp->g, NULL, strlen(sv) + 1);
@ -1047,7 +1155,7 @@ char *ha_connect::GetRealString(const char *s)
} // end of GetRealString
/****************************************************************************/
/* Return the value of a string option or NULL if not specified. */
/* Return the value of a string option or sdef if not specified. */
/****************************************************************************/
char *ha_connect::GetStringOption(char *opname, char *sdef)
{
@ -1065,37 +1173,6 @@ char *ha_connect::GetStringOption(char *opname, char *sdef)
opval= thd_query_string(table->in_use)->str;
else if (!stricmp(opname, "Partname"))
opval= partname;
else if (!options)
;
else if (!stricmp(opname, "Type"))
opval= (char*)options->type;
else if (!stricmp(opname, "Filename"))
opval= GetRealString(options->filename);
else if (!stricmp(opname, "Optname"))
opval= (char*)options->optname;
else if (!stricmp(opname, "Tabname"))
opval= GetRealString(options->tabname);
else if (!stricmp(opname, "Tablist"))
opval= (char*)options->tablist;
else if (!stricmp(opname, "Database") ||
!stricmp(opname, "DBname"))
opval= (char*)options->dbname;
else if (!stricmp(opname, "Separator"))
opval= (char*)options->separator;
else if (!stricmp(opname, "Qchar"))
opval= (char*)options->qchar;
else if (!stricmp(opname, "Module"))
opval= (char*)options->module;
else if (!stricmp(opname, "Subtype"))
opval= (char*)options->subtype;
else if (!stricmp(opname, "Catfunc"))
opval= (char*)options->catfunc;
else if (!stricmp(opname, "Srcdef"))
opval= (char*)options->srcdef;
else if (!stricmp(opname, "Colist"))
opval= (char*)options->colist;
else if (!stricmp(opname, "Data_charset"))
opval= (char*)options->data_charset;
else if (!stricmp(opname, "Table_charset")) {
const CHARSET_INFO *chif= (tshp) ? tshp->table_charset
: table->s->table_charset;
@ -1103,17 +1180,13 @@ char *ha_connect::GetStringOption(char *opname, char *sdef)
if (chif)
opval= (char*)chif->csname;
} // endif Table_charset
} else
opval= GetStringTableOption(xp->g, options, opname, NULL);
if (!opval && options && options->oplist) {
opval= GetListOption(xp->g, opname, options->oplist);
if (opval && (!stricmp(opname, "connect")
|| !stricmp(opname, "tabname")
|| !stricmp(opname, "filename")))
opval = GetRealString(opval);
} // endif opval
if (opval && (!stricmp(opname, "connect")
|| !stricmp(opname, "tabname")
|| !stricmp(opname, "filename")))
opval = GetRealString(opval);
if (!opval) {
if (sdef && !strcmp(sdef, "*")) {
@ -1144,31 +1217,13 @@ char *ha_connect::GetStringOption(char *opname, char *sdef)
/****************************************************************************/
bool ha_connect::GetBooleanOption(char *opname, bool bdef)
{
bool opval= bdef;
char *pv;
bool opval;
PTOS options= GetTableOptionStruct();
if (!stricmp(opname, "View"))
opval= (tshp) ? tshp->is_view : table_share->is_view;
else if (!options)
;
else if (!stricmp(opname, "Mapped"))
opval= options->mapped;
else if (!stricmp(opname, "Huge"))
opval= options->huge;
//else if (!stricmp(opname, "Compressed"))
// opval= options->compressed;
else if (!stricmp(opname, "Split"))
opval= options->split;
else if (!stricmp(opname, "Readonly"))
opval= options->readonly;
else if (!stricmp(opname, "SepIndex"))
opval= options->sepindex;
else if (!stricmp(opname, "Header"))
opval= (options->header != 0); // Is Boolean for some table types
else if (options->oplist)
if ((pv= GetListOption(xp->g, opname, options->oplist)))
opval= (!*pv || *pv == 'y' || *pv == 'Y' || atoi(pv) != 0);
else
opval= GetBooleanTableOption(xp->g, options, opname, bdef);
return opval;
} // end of GetBooleanOption
@ -1197,37 +1252,18 @@ bool ha_connect::SetBooleanOption(char *opname, bool b)
/****************************************************************************/
int ha_connect::GetIntegerOption(char *opname)
{
ulonglong opval= NO_IVAL;
char *pv;
int opval;
PTOS options= GetTableOptionStruct();
TABLE_SHARE *tsp= (tshp) ? tshp : table_share;
if (!stricmp(opname, "Avglen"))
opval= (ulonglong)tsp->avg_row_length;
opval= (int)tsp->avg_row_length;
else if (!stricmp(opname, "Estimate"))
opval= (ulonglong)tsp->max_rows;
else if (!options)
;
else if (!stricmp(opname, "Lrecl"))
opval= options->lrecl;
else if (!stricmp(opname, "Elements"))
opval= options->elements;
else if (!stricmp(opname, "Multiple"))
opval= options->multiple;
else if (!stricmp(opname, "Header"))
opval= options->header;
else if (!stricmp(opname, "Quoted"))
opval= options->quoted;
else if (!stricmp(opname, "Ending"))
opval= options->ending;
else if (!stricmp(opname, "Compressed"))
opval= (options->compressed);
opval= (int)tsp->max_rows;
else
opval= GetIntegerTableOption(xp->g, options, opname, NO_IVAL);
if (opval == (ulonglong)NO_IVAL && options && options->oplist)
if ((pv= GetListOption(xp->g, opname, options->oplist)))
opval= CharToNumber(pv, strlen(pv), ULONGLONG_MAX, true);
return (int)opval;
return opval;
} // end of GetIntegerOption
/****************************************************************************/
@ -2008,7 +2044,7 @@ int ha_connect::MakeRecord(char *buf)
/***********************************************************************/
/* Set row values from a MySQL pseudo record. Specific to MySQL. */
/***********************************************************************/
int ha_connect::ScanRecord(PGLOBAL g, uchar *buf)
int ha_connect::ScanRecord(PGLOBAL g, uchar *)
{
char attr_buffer[1024];
char data_buffer[1024];
@ -2150,7 +2186,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf)
/* Check change in index column. Specific to MySQL. */
/* Should be elaborated to check for real changes. */
/***********************************************************************/
int ha_connect::CheckRecord(PGLOBAL g, const uchar *oldbuf, uchar *newbuf)
int ha_connect::CheckRecord(PGLOBAL g, const uchar *, uchar *newbuf)
{
return ScanRecord(g, newbuf);
} // end of dummy CheckRecord
@ -2923,7 +2959,7 @@ bool ha_connect::get_error_message(int error, String* buf)
&dummy_errors);
if (trace)
htrc("GEM(%u): %s\n", len, g->Message);
htrc("GEM(%d): len=%u %s\n", error, len, g->Message);
msg[len]= '\0';
buf->copy(msg, (uint)strlen(msg), system_charset_info);
@ -3019,7 +3055,7 @@ int ha_connect::open(const char *name, int mode, uint test_if_locked)
@brief
Make the indexes for this table
*/
int ha_connect::optimize(THD* thd, HA_CHECK_OPT* check_opt)
int ha_connect::optimize(THD* thd, HA_CHECK_OPT*)
{
int rc= 0;
PGLOBAL& g= xp->g;
@ -3223,7 +3259,7 @@ int ha_connect::update_row(const uchar *old_data, uchar *new_data)
@see
sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc
*/
int ha_connect::delete_row(const uchar *buf)
int ha_connect::delete_row(const uchar *)
{
int rc= 0;
DBUG_ENTER("ha_connect::delete_row");
@ -3501,7 +3537,8 @@ int ha_connect::index_last(uchar *buf)
/****************************************************************************/
/* This is called to get more rows having the same index value. */
/****************************************************************************/
int ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen)
//t ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen)
int ha_connect::index_next_same(uchar *buf, const uchar *, uint)
{
int rc;
DBUG_ENTER("ha_connect::index_next_same");
@ -3690,7 +3727,7 @@ int ha_connect::rnd_next(uchar *buf)
@see
filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc
*/
void ha_connect::position(const uchar *record)
void ha_connect::position(const uchar *)
{
DBUG_ENTER("ha_connect::position");
//if (((PTDBASE)tdbp)->GetDef()->Indexable())
@ -3873,7 +3910,7 @@ int ha_connect::info(uint flag)
@see
ha_innodb.cc
*/
int ha_connect::extra(enum ha_extra_function operation)
int ha_connect::extra(enum ha_extra_function /*operation*/)
{
DBUG_ENTER("ha_connect::extra");
DBUG_RETURN(0);
@ -3952,11 +3989,11 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn)
case TAB_JSON:
if (options->filename && *options->filename) {
char *s, path[FN_REFLEN], dbpath[FN_REFLEN];
#if defined(WIN32)
#if defined(__WIN__)
s= "\\";
#else // !WIN32
#else // !__WIN__
s= "/";
#endif // !WIN32
#endif // !__WIN__
strcpy(dbpath, mysql_real_data_home);
if (db)
@ -4481,7 +4518,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
@see
get_lock_data() in lock.cc
*/
THR_LOCK_DATA **ha_connect::store_lock(THD *thd,
THR_LOCK_DATA **ha_connect::store_lock(THD *,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type)
{
@ -4715,6 +4752,9 @@ ha_rows ha_connect::records_in_range(uint inx, key_range *min_key,
else
rows= HA_POS_ERROR;
if (trace)
htrc("records_in_range: rows=%llu\n", rows);
DBUG_RETURN(rows);
} // end of records_in_range
@ -4898,7 +4938,7 @@ static int init_table_share(THD* thd,
oom|= sql->append(' ');
oom|= sql->append(opt->name);
oom|= sql->append('=');
oom|= sql->append(vull ? "ON" : "OFF");
oom|= sql->append(vull ? "YES" : "NO");
} // endif vull
break;
@ -4952,7 +4992,7 @@ static int init_table_share(THD* thd,
@note
this function is no more called in case of CREATE .. SELECT
*/
static int connect_assisted_discovery(handlerton *hton, THD* thd,
static int connect_assisted_discovery(handlerton *, THD* thd,
TABLE_SHARE *table_s,
HA_CREATE_INFO *create_info)
{
@ -4960,12 +5000,12 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
const char *fncn= "?";
const char *user, *fn, *db, *host, *pwd, *sep, *tbl, *src;
const char *col, *ocl, *rnk, *pic, *fcl, *skc;
char *tab, *dsn, *shm, *dpath, *objn;
#if defined(WIN32)
char *tab, *dsn, *shm, *dpath;
#if defined(__WIN__)
char *nsp= NULL, *cls= NULL;
#endif // WIN32
int port= 0, hdr= 0, mxr __attribute__((unused))= 0, mxe= 0, rc= 0;
int cop __attribute__((unused))= 0, pty= 2, lrecl= 0, lvl= 0;
#endif // __WIN__
int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0;
int cop __attribute__((unused))= 0, lrecl= 0;
#if defined(ODBC_SUPPORT)
POPARM sop = NULL;
char *ucnc = NULL;
@ -4995,7 +5035,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
if (!g)
return HA_ERR_INTERNAL_ERROR;
user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= dsn= objn= NULL;
user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= dsn= NULL;
// Get the useful create options
ttp= GetTypeID(topt->type);
@ -5026,11 +5066,10 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
skc= GetListOption(g, "skipcol", topt->oplist, NULL);
rnk= GetListOption(g, "rankcol", topt->oplist, NULL);
pwd= GetListOption(g, "password", topt->oplist);
objn= GetListOption(g, "Object", topt->oplist, NULL);
#if defined(WIN32)
#if defined(__WIN__)
nsp= GetListOption(g, "namespace", topt->oplist);
cls= GetListOption(g, "class", topt->oplist);
#endif // WIN32
#endif // __WIN__
port= atoi(GetListOption(g, "port", topt->oplist, "0"));
#if defined(ODBC_SUPPORT)
mxr= atoi(GetListOption(g,"maxres", topt->oplist, "0"));
@ -5044,8 +5083,6 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
#if defined(PROMPT_OK)
cop= atoi(GetListOption(g, "checkdsn", topt->oplist, "0"));
#endif // PROMPT_OK
pty= atoi(GetListOption(g,"Pretty", topt->oplist, "2"));
lvl= atoi(GetListOption(g,"Level", topt->oplist, "0"));
} else {
host= "localhost";
user= (ttp == TAB_ODBC ? NULL : "root");
@ -5189,11 +5226,11 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
ok= false;
break;
#if defined(WIN32)
#if defined(__WIN__)
case TAB_WMI:
ok= true;
break;
#endif // WIN32
#endif // __WIN__
#if defined(PIVOT_SUPPORT)
case TAB_PIVOT:
supfnc= FNC_NO;
@ -5306,11 +5343,11 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
case TAB_CSV:
qrp= CSVColumns(g, dpath, fn, spc, qch, hdr, mxe, fnc == FNC_COL);
break;
#if defined(WIN32)
#if defined(__WIN__)
case TAB_WMI:
qrp= WMIColumns(g, nsp, cls, fnc == FNC_COL);
break;
#endif // WIN32
#endif // __WIN__
case TAB_PRX:
case TAB_TBL:
case TAB_XCL:
@ -5334,10 +5371,10 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
break;
#endif // PIVOT_SUPPORT
case TAB_VIR:
qrp= VirColumns(g, tab, (char*)db, fnc == FNC_COL);
qrp= VirColumns(g, fnc == FNC_COL);
break;
case TAB_JSON:
qrp= JSONColumns(g, (char*)db, fn, objn, pty, lrecl, lvl, fnc == FNC_COL);
qrp= JSONColumns(g, (char*)db, topt, fnc == FNC_COL);
break;
#if defined(LIBXML2_SUPPORT) || defined(DOMDOC_SUPPORT)
case TAB_XML:
@ -5486,10 +5523,11 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
#if defined(ODBC_SUPPORT)
if (ttp == TAB_ODBC) {
int plgtyp;
int plgtyp;
bool w= false; // Wide character type
// typ must be PLG type, not SQL type
if (!(plgtyp= TranslateSQLType(typ, dec, prec, v))) {
if (!(plgtyp= TranslateSQLType(typ, dec, prec, v, w))) {
if (GetTypeConv() == TPC_SKIP) {
// Skip this column
sprintf(g->Message, "Column %s skipped (unsupported type %d)",
@ -5506,6 +5544,13 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
typ= plgtyp;
switch (typ) {
case TYPE_STRING:
if (w) {
sprintf(g->Message, "Column %s is wide characters", cnm);
push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, 0, g->Message);
} // endif w
break;
case TYPE_DOUBLE:
// Some data sources do not count dec in length (prec)
prec += (dec + 2); // To be safe
@ -5764,11 +5809,11 @@ int ha_connect::create(const char *name, TABLE *table_arg,
// on Windows and libxml2 otherwise
switch (*xsup) {
case '*':
#if defined(WIN32)
#if defined(__WIN__)
dom= true;
#else // !WIN32
#else // !__WIN__
dom= false;
#endif // !WIN32
#endif // !__WIN__
break;
case 'M':
case 'D':
@ -6115,11 +6160,11 @@ bool ha_connect::FileExists(const char *fn, bool bf)
NULL, NULL, 0, 0))
return true;
#if defined(WIN32)
#if defined(__WIN__)
s= "\\";
#else // !WIN32
#else // !__WIN__
s= "/";
#endif // !WIN32
#endif // !__WIN__
if (IsPartitioned()) {
sprintf(tfn, fn, GetPartName());
@ -6461,8 +6506,7 @@ fin:
@note: This function is no more called by check_if_supported_inplace_alter
*/
bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes)
bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *, uint)
{
DBUG_ENTER("ha_connect::check_if_incompatible_data");
// TO DO: really implement and check it.
@ -6604,7 +6648,7 @@ maria_declare_plugin(connect)
0x0103, /* version number (1.03) */
NULL, /* status variables */
connect_system_variables, /* system variables */
"1.03.0006", /* string version */
"1.03.0007", /* string version */
MariaDB_PLUGIN_MATURITY_BETA /* maturity */
}
maria_declare_plugin_end;