summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2015-05-10 12:14:21 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2015-05-10 12:25:08 +0200
commit445fc77497f72ce600ef9faa9a51514e18c60d79 (patch)
tree748b59386bc8c11e8ffb2e97ea21b98f745b22e1
parent7c02f74cf8461934b39e2a5a769d4f36b434581b (diff)
downloadmariadb-git-445fc77497f72ce600ef9faa9a51514e18c60d79.tar.gz
Get rid of more GCC warnings about unused parameters
modified: storage/connect/array.cpp modified: storage/connect/ha_connect.cc modified: storage/connect/mycat.cc modified: storage/connect/tabxml.cpp modified: storage/connect/user_connect.cc modified: storage/connect/user_connect.h
-rw-r--r--storage/connect/array.cpp4
-rw-r--r--storage/connect/ha_connect.cc39
-rw-r--r--storage/connect/mycat.cc8
-rw-r--r--storage/connect/tabxml.cpp26
-rw-r--r--storage/connect/user_connect.cc6
-rw-r--r--storage/connect/user_connect.h2
6 files changed, 50 insertions, 35 deletions
diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp
index a2f537436c9..6867bdbd43c 100644
--- a/storage/connect/array.cpp
+++ b/storage/connect/array.cpp
@@ -186,7 +186,7 @@ ARRAY::ARRAY(PGLOBAL g, int type, int size, int length, int prec)
// The error message was built by PlgDBalloc
Type = TYPE_ERROR;
else if (type != TYPE_PCHAR)
- Value = AllocateValue(g, type, Len, prec, NULL);
+ Value = AllocateValue(g, type, Len, prec);
Constant = TRUE;
} // end of ARRAY constructor
@@ -610,7 +610,7 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp)
// The error message was built by PlgDBalloc
return TYPE_ERROR;
else
- Value = AllocateValue(g, Type, Len, prec, NULL);
+ Value = AllocateValue(g, Type, Len, prec);
/*********************************************************************/
/* Converting STRING to DATE can be done according to date format. */
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index f2827f56cd8..185f0945d15 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -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
@@ -664,7 +664,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;
@@ -822,8 +822,6 @@ ha_connect::~ha_connect(void)
/****************************************************************************/
static PCONNECT GetUser(THD *thd, PCONNECT xp)
{
- const char *dbn= NULL;
-
if (!thd)
return NULL;
@@ -835,7 +833,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 +906,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;
@@ -2008,7 +2007,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 +2149,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 +2922,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 +3018,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 +3222,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");
@@ -3503,7 +3502,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");
@@ -3693,7 +3693,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())
@@ -3876,7 +3876,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);
@@ -4484,7 +4484,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)
{
@@ -4955,7 +4955,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)
{
@@ -4967,8 +4967,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
#if defined(WIN32)
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;
+ int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0, lvl= 0;
+ int cop __attribute__((unused))= 0, pty= 2, lrecl= 0;
#if defined(ODBC_SUPPORT)
POPARM sop = NULL;
char *ucnc = NULL;
@@ -6464,8 +6464,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.
diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc
index b15c8fa2322..0bc82cd80ce 100644
--- a/storage/connect/mycat.cc
+++ b/storage/connect/mycat.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) Olivier Bertrand 2004 - 2014
+/* Copyright (C) Olivier Bertrand 2004 - 2015
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
/* ------------- */
/* Version 1.4 */
/* */
-/* Author: Olivier Bertrand 2012 - 2014 */
+/* Author: Olivier Bertrand 2012 - 2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@@ -478,7 +478,7 @@ void MYCAT::SetPath(PGLOBAL g, LPCSTR *datapath, const char *path)
/* Look for a table descriptor matching the name and type. */
/***********************************************************************/
PRELDEF MYCAT::GetTableDesc(PGLOBAL g, LPCSTR name,
- LPCSTR type, PRELDEF *prp)
+ LPCSTR type, PRELDEF *)
{
if (trace)
printf("GetTableDesc: name=%s am=%s\n", name, SVP(type));
@@ -589,7 +589,7 @@ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type)
/***********************************************************************/
/* ClearDB: Terminates Database usage. */
/***********************************************************************/
-void MYCAT::ClearDB(PGLOBAL g)
+void MYCAT::ClearDB(PGLOBAL)
{
} // end of ClearDB
diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp
index 4f7af638d0c..0717f37bf6f 100644
--- a/storage/connect/tabxml.cpp
+++ b/storage/connect/tabxml.cpp
@@ -118,7 +118,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
FLD_LENGTH, FLD_SCALE, FLD_NULL, FLD_FORMAT};
static unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0};
char *op, colname[65], fmt[129], buf[512];
- int i, j, lvl, rc, n = 0;
+ int i, j, lvl, n = 0;
int ncol = sizeof(buftyp) / sizeof(int);
bool ok = true;
PXCL xcol, xcp, fxcp = NULL, pxcp = NULL;
@@ -164,7 +164,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
txmp = new(g) TDBXML(tdp);
if (txmp->Initialize(g))
- return NULL;
+ goto err;
xcol = new(g) XMCOL;
colname[64] = 0;
@@ -224,8 +224,16 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
if (vp->atp) {
strncpy(colname, vp->atp->GetName(g), sizeof(colname));
strncat(xcol->Name, colname, 64);
- rc = vp->atp->GetText(g, buf, sizeof(buf));
- strncat(fmt, "@", sizeof(fmt));
+
+ switch (vp->atp->GetText(g, buf, sizeof(buf))) {
+ case RC_INFO:
+ PushWarning(g, txmp);
+ case RC_OK:
+ strncat(fmt, "@", sizeof(fmt));
+ break;
+ default:
+ goto err;
+ } // enswitch rc
if (j)
strncat(fmt, colname, sizeof(fmt));
@@ -273,7 +281,15 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
} else
ok = true;
- rc = node->GetContent(g, buf, sizeof(buf));
+ switch (node->GetContent(g, buf, sizeof(buf))) {
+ case RC_INFO:
+ PushWarning(g, txmp);
+ case RC_OK:
+ break;
+ default:
+ goto err;
+ } // enswitch rc
+
} // endif atp;
xcol->Len = strlen(buf);
diff --git a/storage/connect/user_connect.cc b/storage/connect/user_connect.cc
index 4affe447b00..34d192361a5 100644
--- a/storage/connect/user_connect.cc
+++ b/storage/connect/user_connect.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) Olivier Bertrand 2004 - 2014
+/* Copyright (C) Olivier Bertrand 2004 - 2015
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
*/
/****************************************************************************/
-/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2014 */
+/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2015 */
/****************************************************************************/
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
@@ -63,7 +63,7 @@ void SetWorkSize(uint);
/****************************************************************************/
/* Constructor. */
/****************************************************************************/
-user_connect::user_connect(THD *thd, const char *dbn)
+user_connect::user_connect(THD *thd)
{
thdp= thd;
next= NULL;
diff --git a/storage/connect/user_connect.h b/storage/connect/user_connect.h
index 44e4e94fa8a..7f37973f378 100644
--- a/storage/connect/user_connect.h
+++ b/storage/connect/user_connect.h
@@ -45,7 +45,7 @@ class user_connect
friend int connect_done_func(void *);
public:
// Constructor
- user_connect(THD *thd, const char *dbn);
+ user_connect(THD *thd);
// Destructor
virtual ~user_connect();