mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixing some of the compilation warnings.
This commit is contained in:
@@ -39,7 +39,7 @@ add_definitions( -DHUGE_SUPPORT -DZIP_SUPPORT )
|
|||||||
#
|
#
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
if(WITH_WARNINGS)
|
if(WITH_WARNINGS)
|
||||||
add_definitions(-Wall -Wfatal-errors -Wextra)
|
add_definitions(-Wall -Wfatal-errors -Wextra -Wmissing-declarations)
|
||||||
message(STATUS "CONNECT: GCC: All warnings enabled")
|
message(STATUS "CONNECT: GCC: All warnings enabled")
|
||||||
else()
|
else()
|
||||||
add_definitions(--no-warnings)
|
add_definitions(--no-warnings)
|
||||||
|
@@ -46,8 +46,6 @@
|
|||||||
#include "filamap.h"
|
#include "filamap.h"
|
||||||
#include "tabdos.h"
|
#include "tabdos.h"
|
||||||
|
|
||||||
bool PushWarning(PGLOBAL, PTDBASE);
|
|
||||||
|
|
||||||
/* --------------------------- Class MAPFAM -------------------------- */
|
/* --------------------------- Class MAPFAM -------------------------- */
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
@@ -70,7 +70,6 @@
|
|||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
PQRYRES PlgAllocResult(PGLOBAL, int, int, int, int *, int *,
|
PQRYRES PlgAllocResult(PGLOBAL, int, int, int, int *, int *,
|
||||||
unsigned int *, bool blank = true, bool nonull = false);
|
unsigned int *, bool blank = true, bool nonull = false);
|
||||||
bool PushWarning(PGLOBAL, PTDBASE);
|
|
||||||
|
|
||||||
extern "C" int trace; // The general trace value
|
extern "C" int trace; // The general trace value
|
||||||
|
|
||||||
|
@@ -52,7 +52,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int num_read, num_there, num_eq[2]; // Statistics
|
extern int num_read, num_there, num_eq[2]; // Statistics
|
||||||
bool PushWarning(PGLOBAL g, PTDBASE tdbp);
|
|
||||||
|
|
||||||
/* --------------------------- Class FIXFAM -------------------------- */
|
/* --------------------------- Class FIXFAM -------------------------- */
|
||||||
|
|
||||||
|
@@ -58,8 +58,6 @@
|
|||||||
extern int num_read, num_there, num_eq[2]; // Statistics
|
extern int num_read, num_there, num_eq[2]; // Statistics
|
||||||
extern "C" int trace;
|
extern "C" int trace;
|
||||||
|
|
||||||
bool PushWarning(PGLOBAL g, PTDBASE tdbp);
|
|
||||||
|
|
||||||
/* --------------------------- Class TXTFAM -------------------------- */
|
/* --------------------------- Class TXTFAM -------------------------- */
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
@@ -92,7 +92,6 @@ typedef struct _vecheader {
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PVBLK AllocValBlock(PGLOBAL, void *, int, int, int, int,
|
PVBLK AllocValBlock(PGLOBAL, void *, int, int, int, int,
|
||||||
bool check = true, bool blank = true);
|
bool check = true, bool blank = true);
|
||||||
bool PushWarning(PGLOBAL, PTDBASE);
|
|
||||||
|
|
||||||
/* -------------------------- Class VCTFAM --------------------------- */
|
/* -------------------------- Class VCTFAM --------------------------- */
|
||||||
|
|
||||||
|
@@ -62,7 +62,6 @@
|
|||||||
/* DB static variables. */
|
/* DB static variables. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
extern int num_read, num_there, num_eq[]; // Statistics
|
extern int num_read, num_there, num_eq[]; // Statistics
|
||||||
bool PushWarning(PGLOBAL g, PTDBASE tdbp);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
@@ -160,14 +160,13 @@ PQRYRES CSVColumns(PGLOBAL g, char *fn, char sep, char q, int hdr, int mxr);
|
|||||||
PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn);
|
PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn);
|
||||||
#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,
|
#include "tabmysql.h"
|
||||||
char *table, 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);
|
||||||
#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);
|
|
||||||
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);
|
||||||
@@ -630,7 +629,9 @@ PGLOBAL ha_connect::GetPlug(THD *thd)
|
|||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/* Return the value of an option specified in the option list. */
|
/* Return the value of an option specified in the option list. */
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
char *ha_connect::GetListOption(char *opname, const char *oplist, char *def)
|
char *ha_connect::GetListOption(const char *opname,
|
||||||
|
const char *oplist,
|
||||||
|
const char *def)
|
||||||
{
|
{
|
||||||
char key[16], val[256];
|
char key[16], val[256];
|
||||||
char *pk, *pv, *pn;
|
char *pk, *pv, *pn;
|
||||||
@@ -1382,7 +1383,7 @@ int ha_connect::MakeRecord(char *buf)
|
|||||||
|
|
||||||
if (xtrace > 1)
|
if (xtrace > 1)
|
||||||
#if defined(MARIADB)
|
#if defined(MARIADB)
|
||||||
printf("Maps: read=%p write=%p vcol=%p defr=%p defw=%p\n",
|
printf("Maps: read=%08X write=%08X vcol=%08X defr=%08X defw=%08X\n",
|
||||||
*table->read_set->bitmap, *table->write_set->bitmap,
|
*table->read_set->bitmap, *table->write_set->bitmap,
|
||||||
*table->vcol_set->bitmap,
|
*table->vcol_set->bitmap,
|
||||||
*table->def_read_set.bitmap, *table->def_write_set.bitmap);
|
*table->def_read_set.bitmap, *table->def_write_set.bitmap);
|
||||||
@@ -1577,9 +1578,9 @@ int ha_connect::CheckRecord(PGLOBAL g, const uchar *oldbuf, uchar *newbuf)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Return the string representing an operator. */
|
/* Return the string representing an operator. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
char *ha_connect::GetValStr(OPVAL vop, bool neg)
|
const char *ha_connect::GetValStr(OPVAL vop, bool neg)
|
||||||
{
|
{
|
||||||
char *val;
|
const char *val;
|
||||||
|
|
||||||
switch (vop) {
|
switch (vop) {
|
||||||
case OP_EQ:
|
case OP_EQ:
|
||||||
@@ -3171,7 +3172,6 @@ bool ha_connect::add_fields(THD *thd, void *alt_info,
|
|||||||
engine_option_value *create_options)
|
engine_option_value *create_options)
|
||||||
{
|
{
|
||||||
register Create_field *new_field;
|
register Create_field *new_field;
|
||||||
LEX *lex= thd->lex;
|
|
||||||
Alter_info *alter_info= (Alter_info*)alt_info;
|
Alter_info *alter_info= (Alter_info*)alt_info;
|
||||||
Virtual_column_info *vcol_info= (Virtual_column_info *)vcolinfo;
|
Virtual_column_info *vcol_info= (Virtual_column_info *)vcolinfo;
|
||||||
|
|
||||||
@@ -3271,14 +3271,16 @@ bool ha_connect::add_fields(THD *thd, void *alt_info,
|
|||||||
*/
|
*/
|
||||||
bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
|
bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
|
||||||
{
|
{
|
||||||
char ttp= '?', spc= ',', qch= 0, *typn= "DOS";
|
char ttp= '?', spc= ',', qch= 0;
|
||||||
char *fn, *dsn, *tab, *db, *host, *user, *pwd, *prt, *sep, *inf;
|
const char *typn= "DOS";
|
||||||
|
const char *user;
|
||||||
|
char *host, *db, *pwd, *tab, *dsn;
|
||||||
|
char *fn, *prt, *sep, *inf;
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
char *nsp= NULL, *cls= NULL;
|
char *nsp= NULL, *cls= NULL;
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
int port= MYSQL_PORT, hdr= 0, mxr= 0;
|
int port= MYSQL_PORT, hdr= 0, mxr= 0;
|
||||||
bool b= false, ok= false, info= false;
|
bool b= false, ok= false, info= false;
|
||||||
LEX *lex= thd->lex;
|
|
||||||
LEX_STRING *comment, *name;
|
LEX_STRING *comment, *name;
|
||||||
HA_CREATE_INFO *create_info= (HA_CREATE_INFO *)crt_info;
|
HA_CREATE_INFO *create_info= (HA_CREATE_INFO *)crt_info;
|
||||||
engine_option_value *pov;
|
engine_option_value *pov;
|
||||||
@@ -3286,7 +3288,8 @@ bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
|
|||||||
PCOLRES crp;
|
PCOLRES crp;
|
||||||
PGLOBAL g= GetPlug(thd);
|
PGLOBAL g= GetPlug(thd);
|
||||||
|
|
||||||
fn= dsn= tab= db= host= user= pwd= prt= sep= inf= NULL;
|
fn= dsn= tab= db= host= pwd= prt= sep= inf= NULL;
|
||||||
|
user= NULL;
|
||||||
|
|
||||||
if (g) {
|
if (g) {
|
||||||
// Set default values
|
// Set default values
|
||||||
|
@@ -241,7 +241,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual const COND *cond_push(const COND *cond);
|
virtual const COND *cond_push(const COND *cond);
|
||||||
PFIL CheckCond(PGLOBAL g, PFIL filp, AMT tty, Item *cond);
|
PFIL CheckCond(PGLOBAL g, PFIL filp, AMT tty, Item *cond);
|
||||||
char *GetValStr(OPVAL vop, bool neg);
|
const char *GetValStr(OPVAL vop, bool neg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Number of rows in table. It will only be called if
|
Number of rows in table. It will only be called if
|
||||||
@@ -346,7 +346,7 @@ char *GetValStr(OPVAL vop, bool neg);
|
|||||||
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
|
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
char *GetListOption(char *opname, const char *oplist, char *def= NULL);
|
char *GetListOption(const char *opname, const char *oplist, const char *def= NULL);
|
||||||
char *encode(PGLOBAL g, char *cnm);
|
char *encode(PGLOBAL g, char *cnm);
|
||||||
bool add_fields(THD *thd, void *alter_info,
|
bool add_fields(THD *thd, void *alter_info,
|
||||||
LEX_STRING *field_name,
|
LEX_STRING *field_name,
|
||||||
|
@@ -182,7 +182,7 @@ PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids,
|
|||||||
/* Get a unique char identifier for types. The letter used are: */
|
/* Get a unique char identifier for types. The letter used are: */
|
||||||
/* ABCDEF..I.KLM.O..R.T.VWXY.. */
|
/* ABCDEF..I.KLM.O..R.T.VWXY.. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
char GetTypeID(char *type)
|
char GetTypeID(const char *type)
|
||||||
{
|
{
|
||||||
return (!type) ? 'D' // DOS (default)
|
return (!type) ? 'D' // DOS (default)
|
||||||
: (!stricmp(type, "FMT")) ? 'T' // CSV
|
: (!stricmp(type, "FMT")) ? 'T' // CSV
|
||||||
@@ -569,7 +569,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am)
|
|||||||
/* Get a unique char identifier for types. The letter used are: */
|
/* Get a unique char identifier for types. The letter used are: */
|
||||||
/* ABCDEF..IJKLM.OPQRSTUVWXYZ and Allocate table definition class */
|
/* ABCDEF..IJKLM.OPQRSTUVWXYZ and Allocate table definition class */
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
tc= GetTypeID((char*)am);
|
tc= GetTypeID(am);
|
||||||
|
|
||||||
switch (tc) {
|
switch (tc) {
|
||||||
case 'F':
|
case 'F':
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
#include "block.h"
|
#include "block.h"
|
||||||
#include "catalog.h"
|
#include "catalog.h"
|
||||||
|
|
||||||
|
char GetTypeID(const char *type);
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* MYCAT: class for managing the CONNECT plugin DB items. */
|
/* MYCAT: class for managing the CONNECT plugin DB items. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -61,4 +63,4 @@ class MYCAT : public CATALOG {
|
|||||||
ha_connect *Hc; // The Connect handler
|
ha_connect *Hc; // The Connect handler
|
||||||
}; // end of class MYCAT
|
}; // end of class MYCAT
|
||||||
|
|
||||||
#endif __MYCAT__H
|
#endif /* __MYCAT__H */
|
||||||
|
@@ -94,7 +94,9 @@ int MYSQLC::GetResultSize(PGLOBAL g, PSZ sql)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Open a MySQL (remote) connection. */
|
/* Open a MySQL (remote) connection. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
int MYSQLC::Open(PGLOBAL g, PSZ host, PSZ db, PSZ user, PSZ pwd, int pt)
|
int MYSQLC::Open(PGLOBAL g, const char *host, const char *db,
|
||||||
|
const char *user, const char *pwd,
|
||||||
|
int pt)
|
||||||
{
|
{
|
||||||
m_DB = mysql_init(NULL);
|
m_DB = mysql_init(NULL);
|
||||||
|
|
||||||
@@ -182,7 +184,7 @@ int MYSQLC::KillQuery(ulong id)
|
|||||||
{
|
{
|
||||||
char kill[20];
|
char kill[20];
|
||||||
|
|
||||||
sprintf(kill, "KILL QUERY %u", id);
|
sprintf(kill, "KILL QUERY %u", (unsigned int) id);
|
||||||
return (m_DB) ? mysql_query(m_DB, kill) : 1;
|
return (m_DB) ? mysql_query(m_DB, kill) : 1;
|
||||||
} // end of KillQuery
|
} // end of KillQuery
|
||||||
|
|
||||||
@@ -477,7 +479,7 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
|
|||||||
} // endif m_Row
|
} // endif m_Row
|
||||||
|
|
||||||
for (crp = qrp->Colresp; crp; crp = crp->Next) {
|
for (crp = qrp->Colresp; crp; crp = crp->Next) {
|
||||||
if (row = m_Row + (crp->Ncol - 1))
|
if ((row = m_Row + (crp->Ncol - 1))) {
|
||||||
if (*row)
|
if (*row)
|
||||||
crp->Kdata->SetValue((PSZ)*row, n);
|
crp->Kdata->SetValue((PSZ)*row, n);
|
||||||
else {
|
else {
|
||||||
@@ -486,10 +488,11 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
|
|||||||
|
|
||||||
crp->Kdata->Reset(n);
|
crp->Kdata->Reset(n);
|
||||||
} // endelse *row
|
} // endelse *row
|
||||||
|
}
|
||||||
|
|
||||||
} // endfor crp
|
} // endfor crp
|
||||||
|
|
||||||
} // endfor n
|
} // endfor n
|
||||||
|
|
||||||
qrp->Nblin = n;
|
qrp->Nblin = n;
|
||||||
return qrp;
|
return qrp;
|
||||||
|
@@ -59,8 +59,9 @@ class DllItem MYSQLC {
|
|||||||
// int GetCurPos(void) {return (m_Res) ? N : 0;}
|
// int GetCurPos(void) {return (m_Res) ? N : 0;}
|
||||||
// int GetProgCur(void) {return N;}
|
// int GetProgCur(void) {return N;}
|
||||||
int GetResultSize(PGLOBAL g, PSZ sql);
|
int GetResultSize(PGLOBAL g, PSZ sql);
|
||||||
int Open(PGLOBAL g, PSZ host, PSZ db, PSZ user = "root",
|
int Open(PGLOBAL g, const char *host, const char *db,
|
||||||
PSZ pwd = "*", int pt = 0);
|
const char *user= "root", const char *pwd= "*",
|
||||||
|
int pt= 0);
|
||||||
ulong GetThreadID(void);
|
ulong GetThreadID(void);
|
||||||
ulong ServerVersion(void);
|
ulong ServerVersion(void);
|
||||||
const char *ServerInfo(void);
|
const char *ServerInfo(void);
|
||||||
|
@@ -521,3 +521,5 @@ DllExport void NewPointer(PTABS, void *, void *);
|
|||||||
FILE *global_fopen(GLOBAL *g, int msgid, const char *path, const char *mode);
|
FILE *global_fopen(GLOBAL *g, int msgid, const char *path, const char *mode);
|
||||||
int global_open(GLOBAL *g, int msgid, const char *filename, int flags);
|
int global_open(GLOBAL *g, int msgid, const char *filename, int flags);
|
||||||
int global_open(GLOBAL *g, int msgid, const char *filename, int flags, int mode);
|
int global_open(GLOBAL *g, int msgid, const char *filename, int flags, int mode);
|
||||||
|
|
||||||
|
bool PushWarning(PGLOBAL, PTDBASE);
|
||||||
|
@@ -78,8 +78,10 @@ PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids,
|
|||||||
/* of a MySQL table that will be retrieved by GetData commands. */
|
/* of a MySQL table that will be retrieved by GetData commands. */
|
||||||
/* key = TRUE when called from Create Table to get key informations. */
|
/* key = TRUE when called from Create Table to get key informations. */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
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)
|
||||||
{
|
{
|
||||||
static int dbtype[] = {DB_CHAR, DB_SHORT, DB_CHAR, DB_INT,
|
static int dbtype[] = {DB_CHAR, DB_SHORT, DB_CHAR, DB_INT,
|
||||||
DB_INT, DB_SHORT, DB_CHAR, DB_CHAR};
|
DB_INT, DB_SHORT, DB_CHAR, DB_CHAR};
|
||||||
|
@@ -137,3 +137,7 @@ class MYSQLCOL : public COLBLK {
|
|||||||
int Rank; // Rank (position) number in the query
|
int Rank; // Rank (position) number in the query
|
||||||
}; // end of class MYSQLCOL
|
}; // end of class MYSQLCOL
|
||||||
|
|
||||||
|
|
||||||
|
PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
|
||||||
|
const char *user, const char *pwd,
|
||||||
|
const char *table, const char *colpat, int port, bool key);
|
||||||
|
@@ -59,8 +59,6 @@ extern int trace;
|
|||||||
#define XMLSUP "libxml2"
|
#define XMLSUP "libxml2"
|
||||||
#endif // !WIN32
|
#endif // !WIN32
|
||||||
|
|
||||||
bool PushWarning(PGLOBAL g, PTDBASE tdbp);
|
|
||||||
|
|
||||||
/* -------------- Implementation of the XMLDEF class ---------------- */
|
/* -------------- Implementation of the XMLDEF class ---------------- */
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
Reference in New Issue
Block a user